Commit cdd8e34b authored by mercury233's avatar mercury233
parents a7640393 0bdc4ead
...@@ -2538,12 +2538,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin ...@@ -2538,12 +2538,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
case 3: { case 3: {
effect* peffect = core.units.begin()->peffect; effect* peffect = core.units.begin()->peffect;
target->material_cards.clear(); target->material_cards.clear();
std::vector<int32> retval;
peffect->get_value(target, 0, &retval);
uint32 summon_info = retval.size() > 0 ? retval[0] : 0;
uint32 zone = retval.size() > 1 ? retval[1] : 0xff;
core.units.begin()->arg3 = zone;
target->summon_info = (summon_info & 0xf00ffff) | SUMMON_TYPE_SPECIAL | ((uint32)target->current.location << 16);
if(peffect->operation) { if(peffect->operation) {
pduel->lua->add_param(target, PARAM_TYPE_CARD); pduel->lua->add_param(target, PARAM_TYPE_CARD);
if(core.limit_tuner || core.limit_syn) { if(core.limit_tuner || core.limit_syn) {
...@@ -2581,7 +2575,11 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin ...@@ -2581,7 +2575,11 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
} }
if(positions == 0) if(positions == 0)
positions = POS_FACEUP_ATTACK; positions = POS_FACEUP_ATTACK;
uint32 zone = core.units.begin()->arg3; std::vector<int32> retval;
peffect->get_value(target, 0, &retval);
uint32 summon_info = retval.size() > 0 ? retval[0] : 0;
uint32 zone = retval.size() > 1 ? retval[1] : 0xff;
target->summon_info = (summon_info & 0xf00ffff) | SUMMON_TYPE_SPECIAL | ((uint32)target->current.location << 16);
target->enable_field_effect(false); target->enable_field_effect(false);
move_to_field(target, sumplayer, targetplayer, LOCATION_MZONE, positions, FALSE, 0, FALSE, zone); move_to_field(target, sumplayer, targetplayer, LOCATION_MZONE, positions, FALSE, 0, FALSE, zone);
target->current.reason = REASON_SPSUMMON; target->current.reason = REASON_SPSUMMON;
......
...@@ -1740,8 +1740,9 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free ...@@ -1740,8 +1740,9 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
clit->set_triggering_place(phandler); clit->set_triggering_place(phandler);
if(!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY) && (peffect->type & EFFECT_TYPE_FIELD) if(!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY) && (peffect->type & EFFECT_TYPE_FIELD)
&& (peffect->range & LOCATION_HAND) && phandler->current.location == LOCATION_HAND) { && (peffect->range & LOCATION_HAND) && phandler->current.location == LOCATION_HAND) {
if(!phandler->is_has_relation(*clit)) if(!phandler->is_has_relation(*clit) && peffect->is_condition_check(phandler->current.controler, clit->evt))
phandler->create_relation(*clit); phandler->create_relation(*clit);
peffect->set_activate_location();
clit->triggering_player = phandler->current.controler; clit->triggering_player = phandler->current.controler;
clit->set_triggering_place(phandler); clit->set_triggering_place(phandler);
} }
...@@ -2075,8 +2076,9 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori ...@@ -2075,8 +2076,9 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
card* phandler = peffect->get_handler(); card* phandler = peffect->get_handler();
if(!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY) && (peffect->type & EFFECT_TYPE_FIELD) if(!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY) && (peffect->type & EFFECT_TYPE_FIELD)
&& (peffect->range & LOCATION_HAND) && phandler->current.location == LOCATION_HAND) { && (peffect->range & LOCATION_HAND) && phandler->current.location == LOCATION_HAND) {
if(!phandler->is_has_relation(ch)) if(!phandler->is_has_relation(ch) && peffect->is_condition_check(phandler->current.controler, ch.evt))
phandler->create_relation(ch); phandler->create_relation(ch);
peffect->set_activate_location();
ch.triggering_player = phandler->current.controler; ch.triggering_player = phandler->current.controler;
ch.set_triggering_place(phandler); ch.set_triggering_place(phandler);
} }
...@@ -2263,7 +2265,8 @@ int32 field::process_instant_event() { ...@@ -2263,7 +2265,8 @@ int32 field::process_instant_event() {
newchain.set_triggering_place(phandler); newchain.set_triggering_place(phandler);
if(peffect->is_flag(EFFECT_FLAG_EVENT_PLAYER) && (ev.event_player == 0 || ev.event_player == 1)) if(peffect->is_flag(EFFECT_FLAG_EVENT_PLAYER) && (ev.event_player == 0 || ev.event_player == 1))
newchain.triggering_player = ev.event_player; newchain.triggering_player = ev.event_player;
else newchain.triggering_player = phandler->current.controler; else
newchain.triggering_player = phandler->current.controler;
core.new_fchain.push_back(newchain); core.new_fchain.push_back(newchain);
phandler->create_relation(newchain); phandler->create_relation(newchain);
} }
...@@ -2272,7 +2275,8 @@ int32 field::process_instant_event() { ...@@ -2272,7 +2275,8 @@ int32 field::process_instant_event() {
effect* peffect = eit->second; effect* peffect = eit->second;
++eit; ++eit;
card* phandler = peffect->get_handler(); card* phandler = peffect->get_handler();
if(!phandler->is_status(STATUS_EFFECT_ENABLED) || !peffect->is_condition_check(phandler->current.controler, ev)) bool act = phandler->is_status(STATUS_EFFECT_ENABLED) && peffect->is_condition_check(phandler->current.controler, ev);
if(!act && !(peffect->range & LOCATION_HAND))
continue; continue;
peffect->set_activate_location(); peffect->set_activate_location();
newchain.flag = 0; newchain.flag = 0;
...@@ -2282,11 +2286,12 @@ int32 field::process_instant_event() { ...@@ -2282,11 +2286,12 @@ int32 field::process_instant_event() {
newchain.set_triggering_place(phandler); newchain.set_triggering_place(phandler);
if(peffect->is_flag(EFFECT_FLAG_EVENT_PLAYER) && (ev.event_player == 0 || ev.event_player == 1)) if(peffect->is_flag(EFFECT_FLAG_EVENT_PLAYER) && (ev.event_player == 0 || ev.event_player == 1))
newchain.triggering_player = ev.event_player; newchain.triggering_player = ev.event_player;
else newchain.triggering_player = phandler->current.controler; else
newchain.triggering_player = phandler->current.controler;
core.new_ochain.push_back(newchain); core.new_ochain.push_back(newchain);
if(peffect->is_flag(EFFECT_FLAG_FIELD_ONLY) if(peffect->is_flag(EFFECT_FLAG_FIELD_ONLY)
|| ((peffect->type & EFFECT_TYPE_SINGLE) && !peffect->is_flag(EFFECT_FLAG_SINGLE_RANGE)) || !(peffect->range & LOCATION_HAND)
|| !(peffect->range & LOCATION_HAND) || (peffect->range & phandler->current.location)) || (peffect->range & phandler->current.location) && act)
phandler->create_relation(newchain); phandler->create_relation(newchain);
} }
//instant_f //instant_f
...@@ -2304,7 +2309,8 @@ int32 field::process_instant_event() { ...@@ -2304,7 +2309,8 @@ int32 field::process_instant_event() {
newchain.set_triggering_place(phandler); newchain.set_triggering_place(phandler);
if(peffect->is_flag(EFFECT_FLAG_EVENT_PLAYER) && (ev.event_player == 0 || ev.event_player == 1)) if(peffect->is_flag(EFFECT_FLAG_EVENT_PLAYER) && (ev.event_player == 0 || ev.event_player == 1))
newchain.triggering_player = ev.event_player; newchain.triggering_player = ev.event_player;
else newchain.triggering_player = phandler->current.controler; else
newchain.triggering_player = phandler->current.controler;
core.quick_f_chain[peffect] = newchain; core.quick_f_chain[peffect] = newchain;
phandler->create_relation(newchain); phandler->create_relation(newchain);
} }
......
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