Commit e91f919f authored by VanillaSalt's avatar VanillaSalt

fix

parent 6d58c819
......@@ -66,7 +66,7 @@ function c12958919.damcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c12958919.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,12958920)==0 end
if chk==0 then return Duel.GetFlagEffect(tp,12958919)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
......
......@@ -15,7 +15,8 @@ function c16638212.spfilter(c)
end
function c16638212.spcon(e,c)
if c==nil then return true end
return Duel.IsExistingMatchingCard(c16638212.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c16638212.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c16638212.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......
......@@ -11,8 +11,6 @@ function c17418744.initial_effect(c)
c:RegisterEffect(e1)
if not c17418744.global_check then
c17418744.global_check=true
c17418744[0]=true
c17418744[1]=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
......@@ -28,28 +26,23 @@ function c17418744.initial_effect(c)
ge3:SetCode(EVENT_SPSUMMON_SUCCESS)
ge3:SetOperation(c17418744.checkop)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge4:SetOperation(c17418744.clear)
Duel.RegisterEffect(ge4,0)
end
end
function c17418744.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if tc:IsAttribute(0x6f) then
c17418744[tc:GetSummonPlayer()]=false
if tc:GetSummonPlayer()==0 then p1=true else p2=true end
end
tc=eg:GetNext()
end
end
function c17418744.clear(e,tp,eg,ep,ev,re,r,rp)
c17418744[0]=true
c17418744[1]=true
if p1 then Duel.RegisterFlagEffect(0,17418744,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,17418744,RESET_PHASE+PHASE_END,0,1) end
end
function c17418744.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c17418744[tp] end
if chk==0 then return Duel.GetFlagEffect(tp,17418744)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
......
......@@ -12,30 +12,19 @@ function c17655904.initial_effect(c)
c:RegisterEffect(e1)
if not c17655904.global_check then
c17655904.global_check=true
c17655904[0]=true
c17655904[1]=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c17655904.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c17655904.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c17655904.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsCode(89631139) then
c17655904[tc:GetControler()]=false
Duel.RegisterFlagEffect(tc:GetControler(),17655904,RESET_PHASE+PHASE_END,0,1)
end
end
function c17655904.clear(e,tp,eg,ep,ev,re,r,rp)
c17655904[0]=true
c17655904[1]=true
end
function c17655904.cfilter(c)
return c:IsFaceup() and c:IsCode(89631139)
end
......@@ -43,7 +32,7 @@ function c17655904.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17655904.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c17655904.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c17655904[tp] end
if chk==0 then return Duel.GetFlagEffect(tp,17655904)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
......
......@@ -4,7 +4,9 @@ function c17874674.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DRAW_PHASE)
e1:SetHintTiming(0,TIMING_DRAW_PHASE)
e1:SetTarget(c17874674.target1)
e1:SetOperation(c17874674.operation)
c:RegisterEffect(e1)
--confirm
local e2=Effect.CreateEffect(c)
......@@ -13,9 +15,8 @@ function c17874674.initial_effect(c)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCondition(c17874674.condition)
e2:SetTarget(c17874674.target)
e2:SetTarget(c17874674.target2)
e2:SetOperation(c17874674.operation)
c:RegisterEffect(e2)
--cancel target
......@@ -37,29 +38,54 @@ function c17874674.initial_effect(c)
e4:SetOperation(c17874674.costop)
c:RegisterEffect(e4)
end
function c17874674.filter(c)
return c:IsFaceup() and (not c:IsType(TYPE_MONSTER) or c:IsType(TYPE_EFFECT))
end
function c17874674.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c17874674.filter(chkc) end
if chk==0 then return true end
if Duel.GetTurnPlayer()~=tp and Duel.GetCurrentPhase()==PHASE_STANDBY
and Duel.IsExistingTarget(c17874674.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(17874674,2)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c17874674.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
e:GetHandler():RegisterFlagEffect(17874674,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else
e:SetProperty(0)
end
end
function c17874674.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c17874674.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return true end
function c17874674.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c17874674.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(17874674)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SelectTarget(tp,c17874674.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
e:GetHandler():RegisterFlagEffect(17874674,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c17874674.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(17874674)==0 then return end
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
e:SetLabelObject(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_OWNER_RELATE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetCondition(c17874674.rcon)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e2:SetCondition(c17874674.rcon)
tc:RegisterEffect(e2)
end
end
function c17874674.rcon(e)
......@@ -71,7 +97,7 @@ function c17874674.ctarget(e,tp,eg,ep,ev,re,r,rp)
end
function c17874674.costop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return end
if Duel.GetLP(tp)>=500 and Duel.SelectYesNo(tp,aux.Stringid(17874674,1)) then
if Duel.CheckLPCost(tp,500) and Duel.SelectYesNo(tp,aux.Stringid(17874674,1)) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
......
......@@ -33,7 +33,8 @@ end
function c18631392.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c18631392.spfilter,tp,LOCATION_MZONE,0,1,nil,RACE_FAIRY)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c18631392.spfilter,tp,LOCATION_MZONE,0,1,nil,RACE_FAIRY)
and Duel.IsExistingMatchingCard(c18631392.spfilter,tp,LOCATION_MZONE,0,1,nil,RACE_DRAGON)
end
function c18631392.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
......@@ -31,7 +31,8 @@ end
function c21390858.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c21390858.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c21390858.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
end
function c21390858.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
......@@ -17,12 +17,15 @@ function c25407643.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25407643,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c25407643.condition)
e2:SetTarget(c25407643.target)
e2:SetOperation(c25407643.operation)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function c25407643.filter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
......
......@@ -25,15 +25,15 @@ end
function c30548775.condition(e,tp,eg,ep,ev,re,r,rp,chk)
return eg:IsExists(c30548775.filter,1,nil)
end
function c30548775.spfilter(c,eg)
return c:IsReason(REASON_FUSION) and eg:IsContains(c:GetReasonCard())
function c30548775.spfilter(c,eg,e,tp)
return c:IsReason(REASON_FUSION) and eg:IsContains(c:GetReasonCard()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c30548775.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c30548775.spfilter(chkc,eg) end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c30548775.spfilter(chkc,eg,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c30548775.spfilter,tp,LOCATION_GRAVE,0,1,nil,eg) end
and Duel.IsExistingTarget(c30548775.spfilter,tp,LOCATION_GRAVE,0,1,nil,eg,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c30548775.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,eg)
local g=Duel.SelectTarget(tp,c30548775.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,eg,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c30548775.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -25,7 +25,7 @@ end
function c31563350.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c31563350.filter,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND)
end
function c31563350.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -33,7 +33,7 @@ function c32750510.initial_effect(c)
end
function c32750510.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-2
and Duel.CheckReleaseGroup(c:GetControler(),Card.IsAttribute,2,nil,ATTRIBUTE_WATER)
end
function c32750510.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
......@@ -47,12 +47,13 @@ function c3606728.efcon(e,tp,eg,ep,ev,re,r,rp)
return not ec:GetMaterial():IsExists(c3606728.ffilter,1,nil) and r==REASON_XYZ
end
function c3606728.efop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,3606728)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(3606728,1))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c3606728.atkcon)
......@@ -77,7 +78,7 @@ function c3606728.atkfilter(c)
end
function c3606728.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c3606728.atkfilter(chkc) end
if chk==0 then return true end
if chk==0 then return Duel.IsExistingTarget(c3606728.atkfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c3606728.atkfilter,tp,0,LOCATION_MZONE,1,1,nil)
end
......
......@@ -36,7 +36,8 @@ function c4068622.spfilter2(c)
end
function c4068622.spcon(e,c)
if c==nil then return true end
return Duel.IsExistingMatchingCard(c4068622.spfilter1,c:GetControler(),LOCATION_MZONE,0,1,nil)
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c4068622.spfilter1,c:GetControler(),LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c4068622.spfilter2,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c4068622.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
......@@ -12,8 +12,6 @@ function c43140791.initial_effect(c)
c:RegisterEffect(e1)
if not c43140791.global_check then
c43140791.global_check=true
c43140791[0]=true
c43140791[1]=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
......@@ -24,26 +22,21 @@ function c43140791.initial_effect(c)
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetOperation(c43140791.checkop)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(c43140791.clear)
Duel.RegisterEffect(ge3,0)
end
end
function c43140791.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
local lv=tc:GetLevel()
if lv==3 or lv==4 then
c43140791[tc:GetSummonPlayer()]=false
if tc:GetSummonPlayer()==0 then p1=true else p2=true end
end
tc=eg:GetNext()
end
end
function c43140791.clear(e,tp,eg,ep,ev,re,r,rp)
c43140791[0]=true
c43140791[1]=true
if p1 then Duel.RegisterFlagEffect(0,43140791,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,43140791,RESET_PHASE+PHASE_END,0,1) end
end
function c43140791.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT)
......@@ -52,7 +45,7 @@ function c43140791.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c43140791.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c43140791.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c43140791[tp] end
if chk==0 then return Duel.GetFlagEffect(tp,43140791)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
......
......@@ -26,14 +26,25 @@ function c50263751.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsRelateToBattle() and e:GetHandler():IsFaceup()
end
function c50263751.operation(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local lv=bc:GetLevel()
if lv>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1ff0000)
e:GetHandler():RegisterEffect(e1)
if c:GetFlagEffect(50263751)==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
c:RegisterFlagEffect(50263751,RESET_EVENT+0x1ff0000,0,0)
e:SetLabelObject(e1)
e:SetLabel(lv)
else
local pe=e:GetLabelObject()
local ct=e:GetLabel()+lv
e:SetLabel(ct)
pe:SetValue(ct)
end
end
end
......@@ -4,6 +4,9 @@ function c54059040.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_SUMMON+TIMING_SPSUMMON)
e1:SetTarget(c54059040.target1)
e1:SetOperation(c54059040.operation)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
......@@ -12,8 +15,9 @@ function c54059040.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c54059040.target)
e2:SetTarget(c54059040.target2)
e2:SetOperation(c54059040.operation)
e2:SetLabel(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
......@@ -25,7 +29,23 @@ end
function c54059040.pfilter(c,e)
return c:IsPosition(POS_FACEUP_ATTACK) and not c:IsAttribute(ATTRIBUTE_WATER) and (not e or c:IsRelateToEffect(e))
end
function c54059040.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c54059040.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_SUMMON_SUCCESS,true)
if not res then
res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS,true)
end
if res and Duel.IsExistingMatchingCard(c54059040.cfilter,tp,LOCATION_MZONE,0,1,nil)
and teg:IsExists(c54059040.pfilter,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(54059040,1)) then
e:SetLabel(1)
Duel.SetTargetCard(teg)
Duel.SetOperationInfo(0,CATEGORY_POSITION,teg,teg:GetCount(),0,0)
else
e:SetLabel(0)
end
end
function c54059040.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.IsExistingMatchingCard(c54059040.cfilter,tp,LOCATION_MZONE,0,1,nil)
and eg:IsExists(c54059040.pfilter,1,nil) end
......@@ -33,7 +53,7 @@ function c54059040.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_POSITION,eg,eg:GetCount(),0,0)
end
function c54059040.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=eg:Filter(c54059040.pfilter,nil,e)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c54059040.pfilter,nil,e)
Duel.ChangePosition(g,POS_FACEUP_DEFENCE)
end
......@@ -12,7 +12,6 @@ function c54762426.initial_effect(c)
c:RegisterEffect(e1)
end
function c54762426.condition(e,tp,eg,ep,ev,re,r,rp)
if rp==tp then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_TOHAND)
return ex and tg~=nil and tg:IsContains(e:GetHandler())
end
......
......@@ -15,7 +15,8 @@ function c65549080.spfilter(c)
end
function c65549080.spcon(e,c)
if c==nil then return true end
return Duel.IsExistingMatchingCard(c65549080.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c65549080.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c65549080.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......@@ -26,6 +27,6 @@ function c65549080.spop(e,tp,eg,ep,ev,re,r,rp,c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(1700)
e1:SetReset(RESET_EVENT+0xfe0000)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
......@@ -36,7 +36,7 @@ end
function c68450517.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and c68450517.filter(tc,c:GetAttribute()) then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and c68450517.filter(tc,c:GetAttribute()) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -32,7 +32,8 @@ end
function c73285669.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c73285669.spfilter,tp,LOCATION_MZONE,0,2,nil)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c73285669.spfilter,tp,LOCATION_MZONE,0,2,nil)
end
function c73285669.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
......
......@@ -27,7 +27,6 @@ function c90219263.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c90219263.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if not Duel.IsExistingMatchingCard(c90219263.cfilter,tp,LOCATION_MZONE,0,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c90219263.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
......
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