Commit 8386cb62 authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/patch-majestic' into develop

parents cbf4f0b3 6fc3624d
...@@ -4794,23 +4794,19 @@ int32 scriptlib::duel_majestic_copy(lua_State *L) { ...@@ -4794,23 +4794,19 @@ int32 scriptlib::duel_majestic_copy(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
check_param(L, PARAM_TYPE_CARD, 2); check_param(L, PARAM_TYPE_CARD, 2);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
card* ccard = *(card**) lua_touserdata(L, 2); card* copy_target = *(card**) lua_touserdata(L, 2);
for(auto eit = ccard->single_effect.begin(); eit != ccard->field_effect.end(); ++eit) { for(auto& peffect: copy_target->initial_effect) {
if(eit == ccard->single_effect.end()) { if (!(peffect->type & (EFFECT_TYPES_CHAIN_LINK & ~EFFECT_TYPE_ACTIVATE)))
eit = ccard->field_effect.begin(); continue;
if(eit == ccard->field_effect.end()) if (peffect->type & EFFECT_TYPE_XMATERIAL)
break;
}
effect* peffect = eit->second;
if (!(peffect->type & 0x7c))
continue; continue;
if (!peffect->is_flag(EFFECT_FLAG_INITIAL)) if (!peffect->is_monster_effect())
continue; continue;
effect* ceffect = peffect->clone(); effect* ceffect = peffect->clone();
ceffect->owner = pcard; ceffect->owner = pcard;
ceffect->flag[0] &= ~EFFECT_FLAG_INITIAL; ceffect->flag[0] &= ~EFFECT_FLAG_INITIAL;
ceffect->effect_owner = PLAYER_NONE; ceffect->effect_owner = PLAYER_NONE;
ceffect->reset_flag = RESET_EVENT + 0x1fe0000 + RESET_PHASE + PHASE_END + RESET_SELF_TURN + RESET_OPPO_TURN; ceffect->reset_flag = RESET_EVENT | RESETS_STANDARD | RESET_PHASE | PHASE_END | RESET_SELF_TURN | RESET_OPPO_TURN;
ceffect->reset_count = 1; ceffect->reset_count = 1;
ceffect->recharge(); ceffect->recharge();
if(ceffect->type & EFFECT_TYPE_TRIGGER_F) { if(ceffect->type & EFFECT_TYPE_TRIGGER_F) {
......
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