Commit 60d8b81d authored by mercury233's avatar mercury233
parents b7ef043d b4f974c7
...@@ -188,16 +188,14 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) { ...@@ -188,16 +188,14 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
} }
if(query_flag & QUERY_OWNER) if(query_flag & QUERY_OWNER)
*p++ = owner; *p++ = owner;
if(query_flag & QUERY_IS_DISABLED) { if(query_flag & QUERY_STATUS) {
tdata = (status & (STATUS_DISABLED | STATUS_FORBIDDEN)) ? 1 : 0; tdata = status & (STATUS_DISABLED | STATUS_FORBIDDEN | STATUS_PROC_COMPLETE);
if(!use_cache || (tdata != q_cache.is_disabled)) { if(!use_cache || (tdata != q_cache.status)) {
q_cache.is_disabled = tdata; q_cache.status = tdata;
*p++ = tdata; *p++ = tdata;
} else } else
query_flag &= ~QUERY_IS_DISABLED; query_flag &= ~QUERY_STATUS;
} }
if(query_flag & QUERY_IS_PUBLIC)
*p++ = is_position(POS_FACEUP) ? 1 : 0;
if(!use_cache) { if(!use_cache) {
if(query_flag & QUERY_LSCALE) q_cache.lscale = *p++ = get_lscale(); if(query_flag & QUERY_LSCALE) q_cache.lscale = *p++ = get_lscale();
if(query_flag & QUERY_RSCALE) q_cache.rscale = *p++ = get_rscale(); if(query_flag & QUERY_RSCALE) q_cache.rscale = *p++ = get_rscale();
......
...@@ -80,8 +80,7 @@ struct query_cache { ...@@ -80,8 +80,7 @@ struct query_cache {
int32 base_attack; int32 base_attack;
int32 base_defense; int32 base_defense;
uint32 reason; uint32 reason;
int32 is_public; int32 status;
int32 is_disabled;
uint32 lscale; uint32 lscale;
uint32 rscale; uint32 rscale;
uint32 link_marker; uint32 link_marker;
...@@ -361,38 +360,6 @@ public: ...@@ -361,38 +360,6 @@ public:
#define SUMMON_TYPE_XYZ 0x49000000 #define SUMMON_TYPE_XYZ 0x49000000
#define SUMMON_TYPE_PENDULUM 0x4a000000 #define SUMMON_TYPE_PENDULUM 0x4a000000
#define SUMMON_TYPE_LINK 0x4c000000 #define SUMMON_TYPE_LINK 0x4c000000
//Status
#define STATUS_DISABLED 0x0001 //
#define STATUS_TO_ENABLE 0x0002 //
#define STATUS_TO_DISABLE 0x0004 //
#define STATUS_PROC_COMPLETE 0x0008 //
#define STATUS_SET_TURN 0x0010 //
#define STATUS_NO_LEVEL 0x0020 //
#define STATUS_BATTLE_RESULT 0x0040 //
#define STATUS_SPSUMMON_STEP 0x0080 //
#define STATUS_FORM_CHANGED 0x0100 //
#define STATUS_SUMMONING 0x0200 //
#define STATUS_EFFECT_ENABLED 0x0400 //
#define STATUS_SUMMON_TURN 0x0800 //
#define STATUS_DESTROY_CONFIRMED 0x1000 //
#define STATUS_LEAVE_CONFIRMED 0x2000 //
#define STATUS_BATTLE_DESTROYED 0x4000 //
#define STATUS_COPYING_EFFECT 0x8000 //
#define STATUS_CHAINING 0x10000 //
#define STATUS_SUMMON_DISABLED 0x20000 //
#define STATUS_ACTIVATE_DISABLED 0x40000 //
#define STATUS_EFFECT_REPLACED 0x80000
#define STATUS_FUTURE_FUSION 0x100000
#define STATUS_ATTACK_CANCELED 0x200000
#define STATUS_INITIALIZING 0x400000
//#define STATUS_ACTIVATED 0x800000
#define STATUS_JUST_POS 0x1000000
#define STATUS_CONTINUOUS_POS 0x2000000
#define STATUS_FORBIDDEN 0x4000000
#define STATUS_ACT_FROM_HAND 0x8000000
#define STATUS_OPPO_BATTLE 0x10000000
#define STATUS_FLIP_SUMMON_TURN 0x20000000
#define STATUS_SPSUMMON_TURN 0x40000000
//Counter //Counter
#define COUNTER_WITHOUT_PERMIT 0x1000 #define COUNTER_WITHOUT_PERMIT 0x1000
#define COUNTER_NEED_ENABLE 0x2000 #define COUNTER_NEED_ENABLE 0x2000
......
...@@ -160,6 +160,39 @@ struct card_sort { ...@@ -160,6 +160,39 @@ struct card_sort {
//#define REASON_REVEAL 0x8000000 // //#define REASON_REVEAL 0x8000000 //
#define REASON_LINK 0x10000000 // #define REASON_LINK 0x10000000 //
//Status
#define STATUS_DISABLED 0x0001 //
#define STATUS_TO_ENABLE 0x0002 //
#define STATUS_TO_DISABLE 0x0004 //
#define STATUS_PROC_COMPLETE 0x0008 //
#define STATUS_SET_TURN 0x0010 //
#define STATUS_NO_LEVEL 0x0020 //
#define STATUS_BATTLE_RESULT 0x0040 //
#define STATUS_SPSUMMON_STEP 0x0080 //
#define STATUS_FORM_CHANGED 0x0100 //
#define STATUS_SUMMONING 0x0200 //
#define STATUS_EFFECT_ENABLED 0x0400 //
#define STATUS_SUMMON_TURN 0x0800 //
#define STATUS_DESTROY_CONFIRMED 0x1000 //
#define STATUS_LEAVE_CONFIRMED 0x2000 //
#define STATUS_BATTLE_DESTROYED 0x4000 //
#define STATUS_COPYING_EFFECT 0x8000 //
#define STATUS_CHAINING 0x10000 //
#define STATUS_SUMMON_DISABLED 0x20000 //
#define STATUS_ACTIVATE_DISABLED 0x40000 //
#define STATUS_EFFECT_REPLACED 0x80000
#define STATUS_FUTURE_FUSION 0x100000
#define STATUS_ATTACK_CANCELED 0x200000
#define STATUS_INITIALIZING 0x400000
//#define STATUS_ACTIVATED 0x800000
#define STATUS_JUST_POS 0x1000000
#define STATUS_CONTINUOUS_POS 0x2000000
#define STATUS_FORBIDDEN 0x4000000
#define STATUS_ACT_FROM_HAND 0x8000000
#define STATUS_OPPO_BATTLE 0x10000000
#define STATUS_FLIP_SUMMON_TURN 0x20000000
#define STATUS_SPSUMMON_TURN 0x40000000
//Query list //Query list
#define QUERY_CODE 0x1 #define QUERY_CODE 0x1
#define QUERY_POSITION 0x2 #define QUERY_POSITION 0x2
...@@ -180,8 +213,7 @@ struct card_sort { ...@@ -180,8 +213,7 @@ struct card_sort {
#define QUERY_OVERLAY_CARD 0x10000 #define QUERY_OVERLAY_CARD 0x10000
#define QUERY_COUNTERS 0x20000 #define QUERY_COUNTERS 0x20000
#define QUERY_OWNER 0x40000 #define QUERY_OWNER 0x40000
#define QUERY_IS_DISABLED 0x80000 #define QUERY_STATUS 0x80000
#define QUERY_IS_PUBLIC 0x100000
#define QUERY_LSCALE 0x200000 #define QUERY_LSCALE 0x200000
#define QUERY_RSCALE 0x400000 #define QUERY_RSCALE 0x400000
#define QUERY_LINK 0x800000 #define QUERY_LINK 0x800000
......
...@@ -206,10 +206,6 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con ...@@ -206,10 +206,6 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
return FALSE; return FALSE;
if(handler->equiping_target) if(handler->equiping_target)
return FALSE; return FALSE;
if(handler->get_status(STATUS_SET_TURN)) {
if((handler->data.type & TYPE_SPELL) && (handler->data.type & TYPE_QUICKPLAY))
return FALSE;
}
if(!(handler->data.type & (TYPE_FIELD | TYPE_PENDULUM)) && is_flag(EFFECT_FLAG_LIMIT_ZONE) && !(zone & (1u << handler->current.sequence))) if(!(handler->data.type & (TYPE_FIELD | TYPE_PENDULUM)) && is_flag(EFFECT_FLAG_LIMIT_ZONE) && !(zone & (1u << handler->current.sequence)))
return FALSE; return FALSE;
} else { } else {
...@@ -237,6 +233,8 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con ...@@ -237,6 +233,8 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
} else if(handler->current.location == LOCATION_SZONE) { } else if(handler->current.location == LOCATION_SZONE) {
if((handler->data.type & TYPE_TRAP) && handler->get_status(STATUS_SET_TURN)) if((handler->data.type & TYPE_TRAP) && handler->get_status(STATUS_SET_TURN))
ecode = EFFECT_TRAP_ACT_IN_SET_TURN; ecode = EFFECT_TRAP_ACT_IN_SET_TURN;
if((handler->data.type & TYPE_SPELL) && (handler->data.type & TYPE_QUICKPLAY) && handler->get_status(STATUS_SET_TURN))
ecode = EFFECT_QP_ACT_IN_SET_TURN;
} }
if(ecode) { if(ecode) {
bool available = false; bool available = false;
......
...@@ -439,6 +439,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2) ...@@ -439,6 +439,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
//#define EFFECT_ADD_LINK_SETCODE 355 //#define EFFECT_ADD_LINK_SETCODE 355
#define EFFECT_ADD_LINK_ATTRIBUTE 356 #define EFFECT_ADD_LINK_ATTRIBUTE 356
#define EFFECT_ADD_LINK_RACE 357 #define EFFECT_ADD_LINK_RACE 357
#define EFFECT_EXTRA_LINK_MATERIAL 358
#define EFFECT_QP_ACT_IN_SET_TURN 359
#define EVENT_STARTUP 1000 #define EVENT_STARTUP 1000
#define EVENT_FLIP 1001 #define EVENT_FLIP 1001
......
...@@ -619,7 +619,7 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost) { ...@@ -619,7 +619,7 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost) {
if(core.select_options.size() == 1) if(core.select_options.size() == 1)
returns.ivalue[0] = 0; returns.ivalue[0] = 0;
else if(core.select_effects[0] == 0 && core.select_effects.size() == 2) else if(core.select_effects[0] == 0 && core.select_effects.size() == 2)
add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_effects[1]->handler, playerid, 0); add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_effects[1]->handler, playerid, 218);
else else
add_process(PROCESSOR_SELECT_OPTION, 0, 0, 0, playerid, 0); add_process(PROCESSOR_SELECT_OPTION, 0, 0, 0, playerid, 0);
return FALSE; return FALSE;
...@@ -683,7 +683,7 @@ int32 field::remove_counter(uint16 step, uint32 reason, card* pcard, uint8 rplay ...@@ -683,7 +683,7 @@ int32 field::remove_counter(uint16 step, uint32 reason, card* pcard, uint8 rplay
if(core.select_options.size() == 1) if(core.select_options.size() == 1)
returns.ivalue[0] = 0; returns.ivalue[0] = 0;
else if(core.select_effects[0] == 0 && core.select_effects.size() == 2) else if(core.select_effects[0] == 0 && core.select_effects.size() == 2)
add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_effects[1]->handler, rplayer, 0); add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_effects[1]->handler, rplayer, 219);
else else
add_process(PROCESSOR_SELECT_OPTION, 0, 0, 0, rplayer, 0); add_process(PROCESSOR_SELECT_OPTION, 0, 0, 0, rplayer, 0);
return FALSE; return FALSE;
...@@ -759,7 +759,7 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8 ...@@ -759,7 +759,7 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8
if(core.select_options.size() == 1) if(core.select_options.size() == 1)
returns.ivalue[0] = 0; returns.ivalue[0] = 0;
else if(core.select_effects[0] == 0 && core.select_effects.size() == 2) else if(core.select_effects[0] == 0 && core.select_effects.size() == 2)
add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_effects[1]->handler, rplayer, 0); add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_effects[1]->handler, rplayer, 220);
else else
add_process(PROCESSOR_SELECT_OPTION, 0, 0, 0, rplayer, 0); add_process(PROCESSOR_SELECT_OPTION, 0, 0, 0, rplayer, 0);
return FALSE; return FALSE;
......
...@@ -326,6 +326,8 @@ int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 fo ...@@ -326,6 +326,8 @@ int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 fo
if((playerid == 1) && (core.duel_options & DUEL_SIMPLE_AI)) { if((playerid == 1) && (core.duel_options & DUEL_SIMPLE_AI)) {
if(core.select_chains.size() == 0) if(core.select_chains.size() == 0)
returns.ivalue[0] = -1; returns.ivalue[0] = -1;
else if(forced)
returns.ivalue[0] = 0;
else { else {
bool act = true; bool act = true;
for(const auto& ch : core.current_chain) for(const auto& ch : core.current_chain)
......
...@@ -1799,7 +1799,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free ...@@ -1799,7 +1799,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
core.units.begin()->step = 5; core.units.begin()->step = 5;
return FALSE; return FALSE;
} else if(core.select_chains.size() == 1 && !core.current_chain.size()) { } else if(core.select_chains.size() == 1 && !core.current_chain.size()) {
add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_chains[0].triggering_effect->get_handler(), core.current_player, 0); add_process(PROCESSOR_SELECT_EFFECTYN, 0, 0, (group*)core.select_chains[0].triggering_effect->get_handler(), core.current_player, 221);
return FALSE; return FALSE;
} else { } else {
add_process(PROCESSOR_SELECT_CHAIN, 0, 0, 0, core.current_player, 0x7f); add_process(PROCESSOR_SELECT_CHAIN, 0, 0, 0, core.current_player, 0x7f);
...@@ -4208,6 +4208,8 @@ int32 field::add_chain(uint16 step) { ...@@ -4208,6 +4208,8 @@ int32 field::add_chain(uint16 step) {
} else if(phandler->current.location == LOCATION_SZONE) { } else if(phandler->current.location == LOCATION_SZONE) {
if((phandler->data.type & TYPE_TRAP) && phandler->get_status(STATUS_SET_TURN)) if((phandler->data.type & TYPE_TRAP) && phandler->get_status(STATUS_SET_TURN))
ecode = EFFECT_TRAP_ACT_IN_SET_TURN; ecode = EFFECT_TRAP_ACT_IN_SET_TURN;
if((phandler->data.type & TYPE_SPELL) && (phandler->data.type & TYPE_QUICKPLAY) && phandler->get_status(STATUS_SET_TURN))
ecode = EFFECT_QP_ACT_IN_SET_TURN;
} }
if(ecode) { if(ecode) {
eset.clear(); eset.clear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment