Commit 03b11da4 authored by VanillaSalt's avatar VanillaSalt

fix

parent 8933d0b9
......@@ -782,7 +782,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer::SendBufferToPlayer(players[1 - player], STOC_GAME_MSG, offset, pbuf - offset);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
NetServer::ReSendToPlayer(*oit);
RefreshHand(player, 0x181fff, 0);
RefreshHand(player, 0x781fff, 0);
break;
}
case MSG_REFRESH_DECK: {
......
......@@ -723,7 +723,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer::SendBufferToPlayer(players[i], STOC_GAME_MSG, offset, pbuf - offset);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
NetServer::ReSendToPlayer(*oit);
RefreshHand(player, 0x181fff, 0);
RefreshHand(player, 0x781fff, 0);
break;
}
case MSG_REFRESH_DECK: {
......
......@@ -2165,20 +2165,26 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
}
case 26: {
group* pgroup = core.units.begin()->ptarget;
if((*pgroup->container.begin())->is_status(STATUS_SUMMONING))
return FALSE;
card_set cset;
for(auto cit = pgroup->container.begin(); cit != pgroup->container.end(); ++cit) {
if((*cit)->current.location == LOCATION_MZONE)
cset.insert(*cit);
for(auto cit = pgroup->container.begin(); cit != pgroup->container.end(); ) {
card* pcard = *cit++;
if(!pcard->is_status(STATUS_SUMMONING)) {
pgroup->container.erase(pcard);
if(pcard->current.location == LOCATION_MZONE)
cset.insert(*cit);
}
}
if(cset.size() == 0)
return FALSE;
send_to(&cset, 0, REASON_RULE, sumplayer, sumplayer, LOCATION_GRAVE, 0, 0);
adjust_instant();
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, FALSE, 0);
return TRUE;
return FALSE;
}
case 27: {
group* pgroup = core.units.begin()->ptarget;
if(pgroup->container.size() == 0)
return TRUE;
for(auto oeit = effects.oath.begin(); oeit != effects.oath.end(); ++oeit)
if(oeit->second == core.units.begin()->peffect)
oeit->second = 0;
......
......@@ -1413,13 +1413,13 @@ int32 field::process_phase_event(int16 step, int32 phase) {
newchain.flag = 0;
newchain.chain_id = infos.field_id++;
newchain.evt = nil_event;
newchain.triggering_effect = peffect;
newchain.triggering_controler = peffect->handler->current.controler;
newchain.triggering_location = peffect->handler->current.location;
newchain.triggering_sequence = peffect->handler->current.sequence;
newchain.triggering_player = infos.turn_player;
core.new_chains.push_back(newchain);
newchain.triggering_effect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
core.select_chains.clear();
add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0);
add_process(PROCESSOR_QUICK_EFFECT, 0, 0, 0, FALSE, 1 - infos.turn_player);
......@@ -1551,13 +1551,13 @@ int32 field::process_phase_event(int16 step, int32 phase) {
newchain.flag = 0;
newchain.chain_id = infos.field_id++;
newchain.evt = nil_event;
newchain.triggering_effect = peffect;
newchain.triggering_controler = peffect->handler->current.controler;
newchain.triggering_location = peffect->handler->current.location;
newchain.triggering_sequence = peffect->handler->current.sequence;
newchain.triggering_player = 1 - infos.turn_player;
core.new_chains.push_back(newchain);
newchain.triggering_effect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
core.select_chains.clear();
add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0);
add_process(PROCESSOR_QUICK_EFFECT, 0, 0, 0, FALSE, infos.turn_player);
......@@ -1676,13 +1676,15 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
core.delayed_quick.clear();
core.delayed_quick_break.swap(core.delayed_quick);
for (auto clit = core.flip_chain.begin(); clit != core.flip_chain.end(); ++clit) {
if(clit->triggering_effect->is_chainable(clit->triggering_player)
&& clit->triggering_effect->is_activateable(clit->triggering_player, clit->evt, TRUE)) {
effect* peffect = clit->triggering_effect;
if(peffect->is_chainable(clit->triggering_player)
&& peffect->is_activateable(clit->triggering_player, clit->evt, TRUE)) {
if(clit->triggering_player == infos.turn_player)
core.tpchain.push_back(*clit);
else
core.ntpchain.push_back(*clit);
clit->triggering_effect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
}
}
if(core.tpchain.size() > 1)
......@@ -1738,6 +1740,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
else
core.ntpchain.push_back(*clit);
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
}
}
if(core.tpchain.size() > 1)
......@@ -1831,17 +1834,18 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
return FALSE;
}
case 6: {
auto clit = core.new_ochain_s.begin();
uint8 tp = clit->triggering_player;
if(returns.ivalue[0]) {
clit->triggering_effect->handler->set_status(STATUS_CHAINING, TRUE);
auto clit = core.new_ochain_s.begin();
effect* peffect = clit->triggering_effect;
uint8 tp = clit->triggering_player;
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
if(tp == infos.turn_player)
core.tpchain.push_back(*clit);
else
core.ntpchain.push_back(*clit);
if(clit->triggering_effect->flag & EFFECT_FLAG_CVAL_CHECK) {
clit->triggering_effect->get_value();
}
if(peffect->flag & EFFECT_FLAG_CVAL_CHECK)
peffect->get_value();
}
core.new_ochain_s.pop_front();
core.units.begin()->step = 4;
......@@ -1956,6 +1960,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
if (act){
core.tpchain.push_back(ifit->second);
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
}
} else {
act = true;
......@@ -1977,6 +1982,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
if (act){
core.ntpchain.push_back(ifit->second);
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
}
}
}
......@@ -2146,8 +2152,10 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
if(core.select_chains.size() && returns.ivalue[0] != -1) {
chain newchain = core.select_chains[returns.ivalue[0]];
core.new_chains.push_back(newchain);
core.delayed_quick.erase(make_pair(newchain.triggering_effect, newchain.evt));
newchain.triggering_effect->handler->set_status(STATUS_CHAINING, TRUE);
effect* peffect = newchain.triggering_effect;
core.delayed_quick.erase(make_pair(peffect, newchain.evt));
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0);
add_process(PROCESSOR_QUICK_EFFECT, 0, 0, 0, FALSE, 1 - priority);
infos.priorities[0] = 0;
......@@ -2535,6 +2543,7 @@ int32 field::process_idle_command(uint16 step) {
newchain.triggering_player = infos.turn_player;
core.new_chains.push_back(newchain);
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
core.select_chains.clear();
add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0);
add_process(PROCESSOR_QUICK_EFFECT, 0, 0, 0, FALSE, 1 - infos.turn_player);
......@@ -2760,6 +2769,7 @@ int32 field::process_battle_command(uint16 step) {
newchain.triggering_player = infos.turn_player;
core.new_chains.push_back(newchain);
peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count();
core.select_chains.clear();
add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0);
add_process(PROCESSOR_QUICK_EFFECT, 0, 0, 0, FALSE, 1 - infos.turn_player);
......@@ -4199,12 +4209,12 @@ int32 field::add_chain(uint16 step) {
chain_array::iterator clit = --(core.current_chain.end());
effect* peffect = clit->triggering_effect;
if(clit->target_cards && clit->target_cards->container.size()) {
if(clit->triggering_effect->flag & EFFECT_FLAG_CARD_TARGET) {
if(peffect->flag & EFFECT_FLAG_CARD_TARGET) {
for(auto cit = clit->target_cards->container.begin(); cit != clit->target_cards->container.end(); ++cit)
raise_single_event(*cit, 0, EVENT_BECOME_TARGET, clit->triggering_effect, 0, clit->triggering_player, 0, clit->chain_count);
raise_single_event(*cit, 0, EVENT_BECOME_TARGET, peffect, 0, clit->triggering_player, 0, clit->chain_count);
process_single_event();
if(clit->target_cards->container.size())
raise_event(&clit->target_cards->container, EVENT_BECOME_TARGET, clit->triggering_effect, 0, clit->triggering_player, clit->triggering_player, clit->chain_count);
raise_event(&clit->target_cards->container, EVENT_BECOME_TARGET, peffect, 0, clit->triggering_player, clit->triggering_player, clit->chain_count);
}
}
if(peffect->type & EFFECT_TYPE_ACTIVATE) {
......@@ -4213,11 +4223,10 @@ int32 field::add_chain(uint16 step) {
&& !peffect->handler->is_affected_by_effect(EFFECT_REMAIN_FIELD))
peffect->handler->set_status(STATUS_LEAVE_CONFIRMED, TRUE);
}
clit->triggering_effect->dec_count();
core.phase_action = TRUE;
pduel->write_buffer8(MSG_CHAINED);
pduel->write_buffer8(clit->chain_count);
raise_event(clit->triggering_effect->handler, EVENT_CHAINING, clit->triggering_effect, 0, clit->triggering_player, clit->triggering_player, clit->chain_count);
raise_event(peffect->handler, EVENT_CHAINING, peffect, 0, clit->triggering_player, clit->triggering_player, clit->chain_count);
process_instant_event();
if(core.new_chains.size())
add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0);
......
......@@ -17,19 +17,24 @@ function c11593137.initial_effect(c)
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
end
function c11593137.filter(c)
return c:IsAttribute(0x30) and c:IsAbleToRemove()
end
function c11593137.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and eg:GetFirst():IsAttribute(0x30)
return Duel.GetCurrentChain()==0 and eg:IsExists(c11593137.filter,1,nil)
end
function c11593137.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000)
else Duel.PayLPCost(tp,2000) end
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
end
function c11593137.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:GetFirst():IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
if chk==0 then return true end
local g=eg:Filter(c11593137.filter,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c11593137.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
local g=eg:Filter(c11593137.filter,nil)
Duel.NegateSummon(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
......@@ -20,19 +20,24 @@ end
function c30888983.cfilter(c,rc)
return c:IsFaceup() and c:IsRace(rc)
end
function c30888983.filter(c)
return Duel.IsExistingMatchingCard(c30888983.cfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,c:GetRace())
end
function c30888983.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and Duel.IsExistingMatchingCard(c30888983.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,eg:GetFirst():GetRace())
return Duel.GetCurrentChain()==0 and eg:IsExists(c30888983.filter,1,nil)
end
function c30888983.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000)
else Duel.PayLPCost(tp,1000) end
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c30888983.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
local g=eg:Filter(c30888983.filter,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c30888983.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.Destroy(eg,REASON_EFFECT)
local g=eg:Filter(c30888983.filter,nil)
Duel.NegateSummon(g)
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -27,10 +27,10 @@ function c32233746.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c32233746.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c32233746.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
......@@ -16,8 +16,11 @@ function c37926346.initial_effect(c)
e1:SetOperation(c37926346.operation)
c:RegisterEffect(e1)
end
function c37926346.filter(c)
return c:IsLevelAbove(5)
end
function c37926346.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():GetLevel()>=5 and Duel.GetCurrentChain()==0
return Duel.GetCurrentChain()==0 and eg:IsExists(c37926346.filter,1,nil)
end
function c37926346.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......@@ -25,10 +28,12 @@ function c37926346.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c37926346.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
local g=eg:Filter(c37926346.filter,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c37926346.operation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.NegateSummon(eg:GetFirst())
Duel.Destroy(eg,REASON_EFFECT)
local g=eg:Filter(c37926346.filter,nil)
Duel.NegateSummon(g)
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -25,12 +25,10 @@ function c44901281.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c44901281.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c44901281.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.NegateSummon(eg:GetFirst())
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
......@@ -15,7 +15,7 @@ function c56993276.initial_effect(c)
c:RegisterEffect(e2)
end
function c56993276.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():IsControler(1-tp) and Duel.GetCurrentChain()==0
return Duel.GetCurrentChain()==0 and eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function c56993276.cfilter(c)
return c:IsSetCard(0xe) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
......@@ -26,10 +26,12 @@ function c56993276.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c56993276.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
local g=eg:Filter(Card.IsControler,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c56993276.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.Destroy(eg,REASON_EFFECT)
local g=eg:Filter(Card.IsControler,nil,1-tp)
Duel.NegateSummon(g)
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -36,11 +36,11 @@ function c57355219.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c57355219.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c57355219.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
local tc=e:GetLabelObject()
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -34,11 +34,11 @@ function c59718521.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c59718521.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c59718521.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c59718521.condition2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -33,7 +33,7 @@ function c74294676.initial_effect(c)
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
end
function c74294676.condition1(e,tp,eg,ep,ev,re,r,rp,chk)
function c74294676.condition1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
......
......@@ -18,7 +18,7 @@ function c7811875.initial_effect(c)
c:RegisterEffect(e3)
end
function c7811875.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
return Duel.GetCurrentChain()==0 and eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function c7811875.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsAbleToGraveAsCost()
......@@ -31,12 +31,14 @@ function c7811875.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c7811875.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
local g=eg:Filter(Card.IsControler,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c7811875.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.Destroy(eg,REASON_EFFECT)
local g=eg:Filter(Card.IsControler,nil,1-tp)
Duel.NegateSummon(g)
Duel.Destroy(g,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......
......@@ -46,7 +46,7 @@ end
function c93016201.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
if Duel.GetLP(tp)<=800 then return end
if not Duel.PayLPCost(tp,800) then return end
local ct=Duel.GetCurrentChain()
if ct==1 then return end
local pe=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
......@@ -72,7 +72,7 @@ function c93016201.activate1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()~=1 then return end
if not c:IsRelateToEffect(e) then return end
local ct,tg=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT,CHAININFO_TARGET_CARDS)
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
local te=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
Duel.NegateEffect(ct-1)
......@@ -84,8 +84,8 @@ function c93016201.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c93016201.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800)
else Duel.PayLPCost(tp,800) end
if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
end
function c93016201.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -93,17 +93,16 @@ function c93016201.target2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c93016201.activate2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c93016201.condition3(e,tp,eg,ep,ev,re,r,rp,chk)
function c93016201.condition3(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasCategory(CATEGORY_SPECIAL_SUMMON) and Duel.IsChainDisablable(ev)
end
function c93016201.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800)
else Duel.PayLPCost(tp,800) end
if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
end
function c93016201.target3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -113,8 +112,7 @@ function c93016201.target3(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c93016201.activate3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
......
......@@ -46,17 +46,17 @@ function c97836203.discon(e,tp,eg,ep,ev,re,r,rp)
end
function c97836203.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(97836203)==0 end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
e:GetHandler():RegisterFlagEffect(97836203,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c97836203.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.NegateSummon(eg:GetFirst())
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c97836203.spcon(e,tp,eg,ep,ev,re,r,rp,chk)
function c97836203.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c97836203.filter(c,e,tp)
......
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