Commit c939c891 authored by VanillaSalt's avatar VanillaSalt

fix

parent cf905862
......@@ -1527,7 +1527,7 @@ int32 field::is_player_can_discard_deck_as_cost(uint8 playerid, int32 count) {
if(is_player_affected_by_effect(playerid, EFFECT_CANNOT_DISCARD_DECK))
return FALSE;
if((count == 1) && core.deck_reversed)
return (*player[playerid].list_grave.rbegin())->is_capable_cost_to_grave(playerid);
return (*player[playerid].list_main.rbegin())->is_capable_cost_to_grave(playerid);
effect_set eset;
filter_field_effect(EFFECT_TO_GRAVE_REDIRECT, &eset);
for(int32 i = 0; i < eset.count; ++i) {
......
......@@ -3155,6 +3155,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
case 0: {
card_set::iterator cit;
card_set equipings;
card_set flips;
card_set pos_changed;
uint8 npos, opos, noflip;
card_vector cv;
......@@ -3193,6 +3194,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
pcard->fieldid = infos.field_id++;
if(pcard->current.location == LOCATION_MZONE) {
raise_single_event(pcard, 0, EVENT_FLIP, reason_effect, 0, reason_player, 0, noflip);
flips.insert(pcard);
}
if(enable)
pcard->enable_field_effect(TRUE);
......@@ -3229,6 +3231,8 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
}
adjust_instant();
process_single_event();
if(flips.size())
raise_event(&flips, EVENT_FLIP, reason_effect, 0, reason_player, 0, 0);
if(pos_changed.size())
raise_event(&pos_changed, EVENT_CHANGE_POS, reason_effect, 0, reason_player, 0, 0);
process_instant_event();
......
......@@ -15,6 +15,7 @@ function c23015896.initial_effect(c)
e2:SetCondition(c23015896.spcon)
e2:SetTarget(c23015896.sptg)
e2:SetOperation(c23015896.spop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
......@@ -39,13 +40,17 @@ function c23015896.initial_effect(c)
end
function c23015896.spreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if bit.band(r,0x41)==0x41 then
c:RegisterFlagEffect(23015896,RESET_EVENT+0x1fe0000,0,1)
if bit.band(r,0x41)~=0x41 then return end
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(23015896,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(23015896,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,0,1)
end
end
function c23015896.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetTurnID()~=Duel.GetTurnCount() and c:GetFlagEffect(23015896)>0
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and e:GetHandler():GetFlagEffect(23015896)>0
end
function c23015896.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -87,9 +87,9 @@ function c24696097.dacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp
end
function c24696097.datg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and e:GetHandler():IsCanBeEffectTarget(e)
if chk==0 then return e:GetHandler():IsAbleToRemove() and Duel.GetAttacker():IsCanBeEffectTarget(e)
and not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetTargetCard(e:GetHandler())
Duel.SetTargetCard(Duel.GetAttacker())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end
function c24696097.daop(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -2,6 +2,7 @@
function c2766877.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,2),2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2766877,0))
......
......@@ -172,7 +172,7 @@ end
function c33900648.hdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if bit.band(c33900648[Duel.GetTurnPlayer()],ATTRIBUTE_WATER)==0 then return end
Duel.DiscardHand(Duel.GetTurnPlayer(),nil,1,1,REASON_EFFECT)
Duel.DiscardHand(Duel.GetTurnPlayer(),nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
function c33900648.damcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(c33900648[Duel.GetTurnPlayer()],ATTRIBUTE_FIRE)~=0
......
......@@ -74,7 +74,7 @@ function c3429238.rmop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
if c:IsRelateToEffect(e) and Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)~=0 then
e:GetHandler():RegisterFlagEffect(3429238,RESET_EVENT+0x1fe0000,0,1)
e:GetHandler():RegisterFlagEffect(3429238,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
end
......
......@@ -52,7 +52,7 @@ function c38107923.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
c:RegisterFlagEffect(38107923,RESET_EVENT+0x1fe0000,0,1)
c:RegisterFlagEffect(38107923,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
function c38107923.spcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -79,7 +79,7 @@ function c50933533.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetDescription(aux.Stringid(50933533,1))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetTarget(c50933533.damtg2)
e1:SetOperation(c50933533.damop)
......
......@@ -19,7 +19,7 @@ function c58851034.cfilter(c)
end
function c58851034.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c58851034.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c58851034.cfilter,1,1,REASON_COST,nil)
Duel.DiscardHand(tp,c58851034.cfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c58851034.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -15,6 +15,7 @@ function c61441708.initial_effect(c)
e2:SetCondition(c61441708.spcon)
e2:SetTarget(c61441708.sptg)
e2:SetOperation(c61441708.spop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
......@@ -30,11 +31,17 @@ end
function c61441708.spr(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if bit.band(r,0x41)~=0x41 or c:IsPreviousLocation(LOCATION_SZONE) then return end
c:RegisterFlagEffect(61441708,RESET_EVENT+0x1fe0000,0,1)
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(61441708,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(61441708,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
function c61441708.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetTurnID()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(61441708)>0
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(61441708)>0
end
function c61441708.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -23,6 +23,7 @@ function c62953041.initial_effect(c)
e2:SetCondition(c62953041.spcon)
e2:SetTarget(c62953041.sptg)
e2:SetOperation(c62953041.spop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--only 1 can exists
local e3=Effect.CreateEffect(c)
......@@ -56,13 +57,18 @@ function c62953041.hspcon(e,c)
end
function c62953041.spreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if bit.band(r,0x41)==0x41 and c:IsPreviousPosition(POS_FACEUP) then
c:RegisterFlagEffect(62953041,RESET_EVENT+0x1fe0000,0,1)
if bit.band(r,0x41)~=0x41 or not c:IsPreviousPosition(POS_FACEUP) then return end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(61441708,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(61441708,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
function c62953041.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetTurnID()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(62953041)>0
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(62953041)>0
end
function c62953041.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -27,6 +27,7 @@ function c69000994.initial_effect(c)
e3:SetCondition(c69000994.thcon)
e3:SetTarget(c69000994.thtg)
e3:SetOperation(c69000994.thop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c69000994.cfilter(c,tp)
......@@ -50,22 +51,25 @@ function c69000994.spop(e,tp,eg,ep,ev,re,r,rp)
end
function c69000994.threg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if bit.band(r,0x41)==0x41 then
c:RegisterFlagEffect(69000994,RESET_EVENT+0x1fe0000,0,1)
if bit.band(r,0x41)~=0x41 then return end
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(69000994,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(69000994,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,0,1)
end
end
function c69000994.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetTurnID()~=Duel.GetTurnCount() and c:GetFlagEffect(69000994)>0
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and e:GetHandler():GetFlagEffect(69000994)>0
end
function c69000994.thfilter(c,e,tp)
function c69000994.thfilter(c)
return c:IsSetCard(0x81) and c:GetCode()~=69000994 and c:IsAbleToHand()
end
function c69000994.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
c:ResetFlagEffect(69000994)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
e:GetHandler():ResetFlagEffect(69000994)
end
function c69000994.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
--デビルドーザー
function c76039636.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......
......@@ -2,6 +2,7 @@
function c82944432.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),4),2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82944432,0))
......
......@@ -2,6 +2,7 @@
function c88942504.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,3),2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88942504,0))
......
......@@ -46,7 +46,7 @@ end
function c96594609.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function c96594609.tgfilter(c,e,tp)
function c96594609.tgfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToGrave()
end
function c96594609.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -137,9 +137,9 @@ function c97489701.nacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp
end
function c97489701.natg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and e:GetHandler():IsCanBeEffectTarget(e)
if chk==0 then return e:GetHandler():IsAbleToRemove() and Duel.GetAttacker():IsCanBeEffectTarget(e)
and not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetTargetCard(e:GetHandler())
Duel.SetTargetCard(Duel.GetAttacker())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end
function c97489701.naop(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -37,7 +37,7 @@ function c97811903.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp
and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
if Duel.SelectYesNo(tp,aux.Stringid(97811903,0)) then
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT)
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
return true
else return false end
end
......@@ -47,7 +47,7 @@ function c98502113.discon(e,tp,eg,ep,ev,re,r,rp)
end
function c98502113.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST,nil)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c98502113.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
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