Commit a04fddec authored by salix5's avatar salix5 Committed by GitHub

fix: flip summoning (#548)

* add is_gemini_summoning

* fix Duel.NegateSummon

* remove STATUS_FUTURE_FUSION

* negate summon without moving

* add card::is_summon_negatable

* update Duel.NegateSummon

* add STATUS_FLIP_SUMMONING

* add STATUS_FLIP_SUMMON_DISABLED
parent 0d23e593
...@@ -1438,7 +1438,7 @@ void card::set_status(uint32 status, int32 enabled) { ...@@ -1438,7 +1438,7 @@ void card::set_status(uint32 status, int32 enabled) {
else else
this->status &= ~status; this->status &= ~status;
} }
// match at least 1 status // get match status
int32 card::get_status(uint32 status) { int32 card::get_status(uint32 status) {
return this->status & status; return this->status & status;
} }
...@@ -3397,6 +3397,28 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe ...@@ -3397,6 +3397,28 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe
pduel->game_field->restore_lp_cost(); pduel->game_field->restore_lp_cost();
return TRUE; return TRUE;
} }
int32 card::is_summon_negatable(uint32 sumtype, effect* reason_effect) {
uint32 code = 0;
if (sumtype & SUMMON_TYPE_NORMAL)
code = EFFECT_CANNOT_DISABLE_SUMMON;
else if (sumtype & SUMMON_TYPE_FLIP)
code = EFFECT_CANNOT_DISABLE_FLIP_SUMMON;
else if (sumtype & SUMMON_TYPE_SPECIAL)
code = EFFECT_CANNOT_DISABLE_SPSUMMON;
else
return FALSE;
if (is_affected_by_effect(code))
return FALSE;
if (sumtype == SUMMON_TYPE_DUAL || sumtype & SUMMON_TYPE_FLIP) {
if (!is_status(STATUS_FLIP_SUMMONING))
return FALSE;
if (!is_affect_by_effect(reason_effect))
return FALSE;
if (sumtype == SUMMON_TYPE_DUAL && (!is_affected_by_effect(EFFECT_DUAL_SUMMONABLE) || is_affected_by_effect(EFFECT_DUAL_STATUS)))
return FALSE;
}
return TRUE;
}
int32 card::get_summon_tribute_count() { int32 card::get_summon_tribute_count() {
int32 min = 0, max = 0; int32 min = 0, max = 0;
int32 level = get_level(); int32 level = get_level();
......
...@@ -342,6 +342,7 @@ public: ...@@ -342,6 +342,7 @@ public:
int32 is_spsummonable(effect* proc, material_info info = null_info); int32 is_spsummonable(effect* proc, material_info info = null_info);
int32 is_summonable(effect* proc, uint8 min_tribute, uint32 zone = 0x1f, uint32 releasable = 0xff00ff); int32 is_summonable(effect* proc, uint8 min_tribute, uint32 zone = 0x1f, uint32 releasable = 0xff00ff);
int32 is_can_be_summoned(uint8 playerid, uint8 ingore_count, effect* peffect, uint8 min_tribute, uint32 zone = 0x1f); int32 is_can_be_summoned(uint8 playerid, uint8 ingore_count, effect* peffect, uint8 min_tribute, uint32 zone = 0x1f);
int32 is_summon_negatable(uint32 sumtype, effect* reason_effect);
int32 get_summon_tribute_count(); int32 get_summon_tribute_count();
int32 get_set_tribute_count(); int32 get_set_tribute_count();
int32 is_can_be_flip_summoned(uint8 playerid); int32 is_can_be_flip_summoned(uint8 playerid);
...@@ -408,6 +409,8 @@ public: ...@@ -408,6 +409,8 @@ public:
#define SUMMON_VALUE_CUSTOM_TYPE 0x0000ffff #define SUMMON_VALUE_CUSTOM_TYPE 0x0000ffff
constexpr uint32 DEFAULT_SUMMON_TYPE = SUMMON_VALUE_MAIN_TYPE | SUMMON_VALUE_SUB_TYPE | SUMMON_VALUE_CUSTOM_TYPE; constexpr uint32 DEFAULT_SUMMON_TYPE = SUMMON_VALUE_MAIN_TYPE | SUMMON_VALUE_SUB_TYPE | SUMMON_VALUE_CUSTOM_TYPE;
#define SUMMON_VALUE_FUTURE_FUSION 0x18
//Counter //Counter
#define COUNTER_WITHOUT_PERMIT 0x1000 #define COUNTER_WITHOUT_PERMIT 0x1000
//#define COUNTER_NEED_ENABLE 0x2000 //#define COUNTER_NEED_ENABLE 0x2000
......
...@@ -181,27 +181,27 @@ struct card_sort { ...@@ -181,27 +181,27 @@ struct card_sort {
#define REASONS_PROCEDURE (REASON_SYNCHRO | REASON_XYZ | REASON_LINK) #define REASONS_PROCEDURE (REASON_SYNCHRO | REASON_XYZ | REASON_LINK)
//Status //Status
#define STATUS_DISABLED 0x0001 // #define STATUS_DISABLED 0x0001
#define STATUS_TO_ENABLE 0x0002 // #define STATUS_TO_ENABLE 0x0002
#define STATUS_TO_DISABLE 0x0004 // #define STATUS_TO_DISABLE 0x0004
#define STATUS_PROC_COMPLETE 0x0008 // #define STATUS_PROC_COMPLETE 0x0008
#define STATUS_SET_TURN 0x0010 // #define STATUS_SET_TURN 0x0010
#define STATUS_NO_LEVEL 0x0020 // #define STATUS_NO_LEVEL 0x0020
#define STATUS_BATTLE_RESULT 0x0040 // #define STATUS_BATTLE_RESULT 0x0040
#define STATUS_SPSUMMON_STEP 0x0080 // #define STATUS_SPSUMMON_STEP 0x0080
#define STATUS_FORM_CHANGED 0x0100 // #define STATUS_FORM_CHANGED 0x0100
#define STATUS_SUMMONING 0x0200 // #define STATUS_SUMMONING 0x0200
#define STATUS_EFFECT_ENABLED 0x0400 // #define STATUS_EFFECT_ENABLED 0x0400
#define STATUS_SUMMON_TURN 0x0800 // #define STATUS_SUMMON_TURN 0x0800
#define STATUS_DESTROY_CONFIRMED 0x1000 // #define STATUS_DESTROY_CONFIRMED 0x1000
#define STATUS_LEAVE_CONFIRMED 0x2000 // #define STATUS_LEAVE_CONFIRMED 0x2000
#define STATUS_BATTLE_DESTROYED 0x4000 // #define STATUS_BATTLE_DESTROYED 0x4000
#define STATUS_COPYING_EFFECT 0x8000 // #define STATUS_COPYING_EFFECT 0x8000
#define STATUS_CHAINING 0x10000 // #define STATUS_CHAINING 0x10000
#define STATUS_SUMMON_DISABLED 0x20000 // #define STATUS_SUMMON_DISABLED 0x20000
#define STATUS_ACTIVATE_DISABLED 0x40000 // #define STATUS_ACTIVATE_DISABLED 0x40000
#define STATUS_EFFECT_REPLACED 0x80000 #define STATUS_EFFECT_REPLACED 0x80000
#define STATUS_FUTURE_FUSION 0x100000 #define STATUS_FLIP_SUMMONING 0x100000
#define STATUS_ATTACK_CANCELED 0x200000 #define STATUS_ATTACK_CANCELED 0x200000
#define STATUS_INITIALIZING 0x400000 #define STATUS_INITIALIZING 0x400000
#define STATUS_TO_HAND_WITHOUT_CONFIRM 0x800000 #define STATUS_TO_HAND_WITHOUT_CONFIRM 0x800000
...@@ -212,6 +212,7 @@ struct card_sort { ...@@ -212,6 +212,7 @@ struct card_sort {
#define STATUS_OPPO_BATTLE 0x10000000 #define STATUS_OPPO_BATTLE 0x10000000
#define STATUS_FLIP_SUMMON_TURN 0x20000000 #define STATUS_FLIP_SUMMON_TURN 0x20000000
#define STATUS_SPSUMMON_TURN 0x40000000 #define STATUS_SPSUMMON_TURN 0x40000000
#define STATUS_FLIP_SUMMON_DISABLED 0x80000000
//Query list //Query list
#define QUERY_CODE 0x1 #define QUERY_CODE 0x1
......
...@@ -313,6 +313,8 @@ struct processor { ...@@ -313,6 +313,8 @@ struct processor {
uint8 coin_result[MAX_COIN_COUNT]{}; uint8 coin_result[MAX_COIN_COUNT]{};
int32 coin_count{ 0 }; int32 coin_count{ 0 };
bool is_target_ready{ false }; bool is_target_ready{ false };
bool is_gemini_summoning{ false };
bool is_summon_negated{ false };
uint8 to_bp{ FALSE }; uint8 to_bp{ FALSE };
uint8 to_m2{ FALSE }; uint8 to_m2{ FALSE };
......
...@@ -1836,30 +1836,66 @@ int32 scriptlib::duel_disable_summon(lua_State *L) { ...@@ -1836,30 +1836,66 @@ int32 scriptlib::duel_disable_summon(lua_State *L) {
pduel = pgroup->pduel; pduel = pgroup->pduel;
} else } else
return luaL_error(L, "Parameter %d should be \"Card\" or \"Group\".", 1); return luaL_error(L, "Parameter %d should be \"Card\" or \"Group\".", 1);
uint32 sumtype = 0;
if (pduel->game_field->check_event(EVENT_SUMMON)) {
if (pduel->game_field->core.is_gemini_summoning)
sumtype = SUMMON_TYPE_DUAL;
else
sumtype = SUMMON_TYPE_NORMAL;
}
else if (pduel->game_field->check_event(EVENT_FLIP_SUMMON))
sumtype = SUMMON_TYPE_FLIP;
else if (pduel->game_field->check_event(EVENT_SPSUMMON))
sumtype = SUMMON_TYPE_SPECIAL;
else
return 0;
if (sumtype & SUMMON_TYPE_NORMAL || sumtype & SUMMON_TYPE_FLIP) {
if (pgroup && pgroup->container.size() != 1)
return 0;
if (!pcard)
pcard = *pgroup->container.begin();
}
uint8 sumplayer = PLAYER_NONE; uint8 sumplayer = PLAYER_NONE;
if(pcard) { effect* reason_effect = pduel->game_field->core.reason_effect;
field::card_set negated_cards;
if (sumtype == SUMMON_TYPE_DUAL || sumtype & SUMMON_TYPE_FLIP) {
if (!pcard->is_summon_negatable(sumtype, reason_effect))
return 0;
sumplayer = pcard->summon_player;
pcard->set_status(STATUS_FLIP_SUMMONING, FALSE);
pcard->set_status(STATUS_FLIP_SUMMON_DISABLED, TRUE);
}
else {
if (pcard) {
if (!pcard->is_summon_negatable(sumtype, reason_effect))
return 0;
sumplayer = pcard->summon_player; sumplayer = pcard->summon_player;
pcard->set_status(STATUS_SUMMONING, FALSE); pcard->set_status(STATUS_SUMMONING, FALSE);
pcard->set_status(STATUS_SUMMON_DISABLED, TRUE); pcard->set_status(STATUS_SUMMON_DISABLED, TRUE);
if (!match_all(pcard->summon_info, SUMMON_TYPE_FLIP) && !match_all(pcard->summon_info, SUMMON_TYPE_DUAL))
pcard->set_status(STATUS_PROC_COMPLETE, FALSE); pcard->set_status(STATUS_PROC_COMPLETE, FALSE);
} else { }
for(auto& pcard : pgroup->container) { else {
for (auto& pcard : pgroup->container) {
if (!pcard->is_summon_negatable(sumtype, reason_effect))
continue;
sumplayer = pcard->summon_player; sumplayer = pcard->summon_player;
pcard->set_status(STATUS_SUMMONING, FALSE); pcard->set_status(STATUS_SUMMONING, FALSE);
pcard->set_status(STATUS_SUMMON_DISABLED, TRUE); pcard->set_status(STATUS_SUMMON_DISABLED, TRUE);
if (!match_all(pcard->summon_info, SUMMON_TYPE_FLIP) && !match_all(pcard->summon_info, SUMMON_TYPE_DUAL))
pcard->set_status(STATUS_PROC_COMPLETE, FALSE); pcard->set_status(STATUS_PROC_COMPLETE, FALSE);
negated_cards.insert(pcard);
} }
if (!negated_cards.size())
return 0;
} }
}
pduel->game_field->core.is_summon_negated = true;
uint32 event_code = 0; uint32 event_code = 0;
if(pduel->game_field->check_event(EVENT_SUMMON)) if(sumtype & SUMMON_TYPE_NORMAL)
event_code = EVENT_SUMMON_NEGATED; event_code = EVENT_SUMMON_NEGATED;
else if(pduel->game_field->check_event(EVENT_FLIP_SUMMON)) else if(sumtype & SUMMON_TYPE_FLIP)
event_code = EVENT_FLIP_SUMMON_NEGATED; event_code = EVENT_FLIP_SUMMON_NEGATED;
else if(pduel->game_field->check_event(EVENT_SPSUMMON)) else if(sumtype & SUMMON_TYPE_SPECIAL)
event_code = EVENT_SPSUMMON_NEGATED; event_code = EVENT_SPSUMMON_NEGATED;
effect* reason_effect = pduel->game_field->core.reason_effect;
uint8 reason_player = pduel->game_field->core.reason_player; uint8 reason_player = pduel->game_field->core.reason_player;
if(pcard) if(pcard)
pduel->game_field->raise_event(pcard, event_code, reason_effect, REASON_EFFECT, reason_player, sumplayer, 0); pduel->game_field->raise_event(pcard, event_code, reason_effect, REASON_EFFECT, reason_player, sumplayer, 0);
......
...@@ -1827,6 +1827,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui ...@@ -1827,6 +1827,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
target->summon_info |= SUMMON_TYPE_NORMAL; target->summon_info |= SUMMON_TYPE_NORMAL;
target->current.reason_effect = 0; target->current.reason_effect = 0;
target->current.reason_player = sumplayer; target->current.reason_player = sumplayer;
core.is_gemini_summoning = true;
effect* deffect = pduel->new_effect(); effect* deffect = pduel->new_effect();
deffect->owner = target; deffect->owner = target;
deffect->code = EFFECT_DUAL_STATUS; deffect->code = EFFECT_DUAL_STATUS;
...@@ -1886,37 +1887,50 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui ...@@ -1886,37 +1887,50 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
return FALSE; return FALSE;
} }
case 13: { case 13: {
if (core.is_gemini_summoning) {
target->set_status(STATUS_SUMMONING, FALSE);
target->set_status(STATUS_FLIP_SUMMONING, TRUE);
}
else {
target->set_status(STATUS_SUMMONING, TRUE); target->set_status(STATUS_SUMMONING, TRUE);
target->set_status(STATUS_FLIP_SUMMONING, FALSE);
}
target->set_status(STATUS_SUMMON_DISABLED, FALSE); target->set_status(STATUS_SUMMON_DISABLED, FALSE);
target->set_status(STATUS_FLIP_SUMMON_DISABLED, FALSE);
raise_event(target, EVENT_SUMMON, proc, 0, sumplayer, sumplayer, 0); raise_event(target, EVENT_SUMMON, proc, 0, sumplayer, sumplayer, 0);
process_instant_event(); process_instant_event();
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0x101, TRUE); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0x101, TRUE);
return FALSE; return FALSE;
} }
case 14: { case 14: {
if(target->is_status(STATUS_SUMMONING)) { if (core.is_gemini_summoning && target->is_status(STATUS_FLIP_SUMMONING) || !core.is_gemini_summoning && target->is_status(STATUS_SUMMONING)) {
core.units.begin()->step = 14; core.units.begin()->step = 14;
return FALSE; return FALSE;
} }
if(proc) { if (core.is_summon_negated) {
if (proc) {
remove_oath_effect(proc); remove_oath_effect(proc);
if(proc->is_flag(EFFECT_FLAG_COUNT_LIMIT) && (proc->count_code & EFFECT_COUNT_CODE_OATH)) { if (proc->is_flag(EFFECT_FLAG_COUNT_LIMIT) && (proc->count_code & EFFECT_COUNT_CODE_OATH)) {
dec_effect_code(proc->count_code, sumplayer); dec_effect_code(proc->count_code, sumplayer);
} }
} }
if(effect_set* peset = (effect_set*)core.units.begin()->ptr2) { if (effect_set* peset = (effect_set*)core.units.begin()->ptr2) {
for(int32 i = 0; i < peset->size(); ++i) for (int32 i = 0; i < peset->size(); ++i)
remove_oath_effect(peset->at(i)); remove_oath_effect(peset->at(i));
delete peset; delete peset;
core.units.begin()->ptr2 = 0; core.units.begin()->ptr2 = 0;
} }
if(target->current.location == LOCATION_MZONE) if (target->get_status(STATUS_SUMMON_DISABLED | STATUS_FLIP_SUMMON_DISABLED) && target->current.location == LOCATION_MZONE)
send_to(target, 0, REASON_RULE, PLAYER_NONE, sumplayer, LOCATION_GRAVE, 0, 0); send_to(target, 0, REASON_RULE, PLAYER_NONE, sumplayer, LOCATION_GRAVE, 0, 0);
adjust_instant(); adjust_instant();
}
core.is_gemini_summoning = false;
core.is_summon_negated = false;
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, 0); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, 0);
return TRUE; return TRUE;
} }
case 15: { case 15: {
core.is_gemini_summoning = false;
if(proc) { if(proc) {
release_oath_relation(proc); release_oath_relation(proc);
} }
...@@ -1927,6 +1941,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui ...@@ -1927,6 +1941,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
core.units.begin()->ptr2 = 0; core.units.begin()->ptr2 = 0;
} }
target->set_status(STATUS_SUMMONING, FALSE); target->set_status(STATUS_SUMMONING, FALSE);
target->set_status(STATUS_FLIP_SUMMONING, FALSE);
target->set_status(STATUS_SUMMON_TURN, TRUE); target->set_status(STATUS_SUMMON_TURN, TRUE);
target->enable_field_effect(true); target->enable_field_effect(true);
if(target->is_status(STATUS_DISABLED)) if(target->is_status(STATUS_DISABLED))
...@@ -2001,8 +2016,8 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target, uint32 act ...@@ -2001,8 +2016,8 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target, uint32 act
if(target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_FLIP_SUMMON)) if(target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_FLIP_SUMMON))
core.units.begin()->step = 2; core.units.begin()->step = 2;
else { else {
target->set_status(STATUS_SUMMONING, TRUE); target->set_status(STATUS_FLIP_SUMMONING, TRUE);
target->set_status(STATUS_SUMMON_DISABLED, FALSE); target->set_status(STATUS_FLIP_SUMMON_DISABLED, FALSE);
raise_event(target, EVENT_FLIP_SUMMON, 0, 0, sumplayer, sumplayer, 0); raise_event(target, EVENT_FLIP_SUMMON, 0, 0, sumplayer, sumplayer, 0);
process_instant_event(); process_instant_event();
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0x101, TRUE); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0x101, TRUE);
...@@ -2010,16 +2025,19 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target, uint32 act ...@@ -2010,16 +2025,19 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target, uint32 act
return FALSE; return FALSE;
} }
case 2: { case 2: {
if(target->is_status(STATUS_SUMMONING)) if(target->is_status(STATUS_FLIP_SUMMONING))
return FALSE; return FALSE;
if(effect_set* peset = (effect_set*)core.units.begin()->ptr1) { if (core.is_summon_negated) {
for(int32 i = 0; i < peset->size(); ++i) if (effect_set* peset = (effect_set*)core.units.begin()->ptr1) {
for (int32 i = 0; i < peset->size(); ++i)
remove_oath_effect(peset->at(i)); remove_oath_effect(peset->at(i));
delete peset; delete peset;
core.units.begin()->ptr1 = 0; core.units.begin()->ptr1 = 0;
} }
if(target->current.location == LOCATION_MZONE) if (target->is_status(STATUS_FLIP_SUMMON_DISABLED) && target->current.location == LOCATION_MZONE)
send_to(target, 0, REASON_RULE, PLAYER_NONE, sumplayer, LOCATION_GRAVE, 0, 0); send_to(target, 0, REASON_RULE, PLAYER_NONE, sumplayer, LOCATION_GRAVE, 0, 0);
}
core.is_summon_negated = false;
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, 0); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, 0);
return TRUE; return TRUE;
} }
...@@ -2030,7 +2048,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target, uint32 act ...@@ -2030,7 +2048,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target, uint32 act
delete peset; delete peset;
core.units.begin()->ptr1 = 0; core.units.begin()->ptr1 = 0;
} }
target->set_status(STATUS_SUMMONING, FALSE); target->set_status(STATUS_FLIP_SUMMONING, FALSE);
target->enable_field_effect(true); target->enable_field_effect(true);
if(target->is_status(STATUS_DISABLED)) if(target->is_status(STATUS_DISABLED))
target->reset(RESET_DISABLE, RESET_EVENT); target->reset(RESET_DISABLE, RESET_EVENT);
...@@ -2900,7 +2918,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin ...@@ -2900,7 +2918,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
delete peset; delete peset;
core.units.begin()->ptr1 = 0; core.units.begin()->ptr1 = 0;
} }
if(target->current.location == LOCATION_MZONE) if (target->is_status(STATUS_SUMMON_DISABLED) && target->current.location == LOCATION_MZONE)
send_to(target, 0, REASON_RULE, PLAYER_NONE, sumplayer, LOCATION_GRAVE, 0, 0); send_to(target, 0, REASON_RULE, PLAYER_NONE, sumplayer, LOCATION_GRAVE, 0, 0);
adjust_instant(); adjust_instant();
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, 0); add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, 0);
...@@ -3084,7 +3102,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin ...@@ -3084,7 +3102,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
card* pcard = *cit; card* pcard = *cit;
if (!pcard->is_status(STATUS_SUMMONING)) { if (!pcard->is_status(STATUS_SUMMONING)) {
cit = pgroup->container.erase(cit); cit = pgroup->container.erase(cit);
if (pcard->current.location == LOCATION_MZONE) if (pcard->is_status(STATUS_SUMMON_DISABLED) && pcard->current.location == LOCATION_MZONE)
cset.insert(pcard); cset.insert(pcard);
} }
else else
...@@ -3352,7 +3370,8 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla ...@@ -3352,7 +3370,8 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla
if(!(pcard->current.position & POS_FACEDOWN)) if(!(pcard->current.position & POS_FACEDOWN))
raise_single_event(pcard, 0, EVENT_SPSUMMON_SUCCESS, pcard->current.reason_effect, 0, pcard->current.reason_player, pcard->summon_player, 0); raise_single_event(pcard, 0, EVENT_SPSUMMON_SUCCESS, pcard->current.reason_effect, 0, pcard->current.reason_player, pcard->summon_player, 0);
int32 summontype = pcard->summon_info & (SUMMON_VALUE_MAIN_TYPE | SUMMON_VALUE_SUB_TYPE); int32 summontype = pcard->summon_info & (SUMMON_VALUE_MAIN_TYPE | SUMMON_VALUE_SUB_TYPE);
if(summontype && pcard->material_cards.size() && !pcard->is_status(STATUS_FUTURE_FUSION)) { int32 custom_type = pcard->summon_info & SUMMON_VALUE_CUSTOM_TYPE;
if(summontype && pcard->material_cards.size() && custom_type != SUMMON_VALUE_FUTURE_FUSION) {
int32 matreason = 0; int32 matreason = 0;
if(summontype == SUMMON_TYPE_FUSION) if(summontype == SUMMON_TYPE_FUSION)
matreason = REASON_FUSION; matreason = REASON_FUSION;
...@@ -3366,7 +3385,6 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla ...@@ -3366,7 +3385,6 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla
raise_single_event(mcard, &targets->container, EVENT_BE_MATERIAL, pcard->current.reason_effect, matreason, pcard->current.reason_player, pcard->summon_player, 0); raise_single_event(mcard, &targets->container, EVENT_BE_MATERIAL, pcard->current.reason_effect, matreason, pcard->current.reason_player, pcard->summon_player, 0);
raise_event(&(pcard->material_cards), EVENT_BE_MATERIAL, reason_effect, matreason, reason_player, pcard->summon_player, 0); raise_event(&(pcard->material_cards), EVENT_BE_MATERIAL, reason_effect, matreason, reason_player, pcard->summon_player, 0);
} }
pcard->set_status(STATUS_FUTURE_FUSION, FALSE);
} }
process_single_event(); process_single_event();
process_instant_event(); process_instant_event();
...@@ -4139,6 +4157,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -4139,6 +4157,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
if((core.deck_reversed && pcard->current.location == LOCATION_DECK) || (pcard->current.position == POS_FACEUP_DEFENSE)) if((core.deck_reversed && pcard->current.location == LOCATION_DECK) || (pcard->current.position == POS_FACEUP_DEFENSE))
param->show_decktop[pcard->current.controler] = true; param->show_decktop[pcard->current.controler] = true;
pcard->set_status(STATUS_LEAVE_CONFIRMED, FALSE); pcard->set_status(STATUS_LEAVE_CONFIRMED, FALSE);
pcard->set_status(STATUS_FLIP_SUMMONING, FALSE);
pcard->set_status(STATUS_FLIP_SUMMON_DISABLED, FALSE);
if(pcard->status & (STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED)) { if(pcard->status & (STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED)) {
pcard->set_status(STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED, FALSE); pcard->set_status(STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED, FALSE);
pcard->previous.location = 0; pcard->previous.location = 0;
...@@ -4187,6 +4207,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -4187,6 +4207,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pduel->write_buffer32(pcard->get_info_location()); pduel->write_buffer32(pcard->get_info_location());
pduel->write_buffer32(pcard->current.reason); pduel->write_buffer32(pcard->current.reason);
pcard->set_status(STATUS_LEAVE_CONFIRMED, FALSE); pcard->set_status(STATUS_LEAVE_CONFIRMED, FALSE);
pcard->set_status(STATUS_FLIP_SUMMONING, FALSE);
pcard->set_status(STATUS_FLIP_SUMMON_DISABLED, FALSE);
if(pcard->status & (STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED)) { if(pcard->status & (STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED)) {
pcard->set_status(STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED, FALSE); pcard->set_status(STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED, FALSE);
pcard->previous.location = 0; pcard->previous.location = 0;
...@@ -4900,6 +4922,8 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec ...@@ -4900,6 +4922,8 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
trapmonster = true; trapmonster = true;
if(pcard->status & (STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED)) if(pcard->status & (STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED))
pcard->set_status(STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED, FALSE); pcard->set_status(STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED, FALSE);
pcard->set_status(STATUS_FLIP_SUMMONING, FALSE);
pcard->set_status(STATUS_FLIP_SUMMON_DISABLED, FALSE);
pcard->reset(RESET_TURN_SET, RESET_EVENT); pcard->reset(RESET_TURN_SET, RESET_EVENT);
pcard->clear_card_target(); pcard->clear_card_target();
pcard->set_status(STATUS_SET_TURN, TRUE); pcard->set_status(STATUS_SET_TURN, TRUE);
......
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