Commit b6311da9 authored by argon.sun's avatar argon.sun

bug fix

parent 4d1dc353
......@@ -98,7 +98,7 @@ function c10000020.adval(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*1000
end
function c10000020.atkfilter(c,e,tp)
return c:IsControler(tp) and c:IsPosition(POS_FACEUP_ATTACK) and (not e or c:IsRelateToEffect(e))
return c:GetSummonPlayer()==tp and c:IsPosition(POS_FACEUP_ATTACK) and (not e or c:IsRelateToEffect(e))
end
function c10000020.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10000020.atkfilter,1,nil,nil,1-tp)
......@@ -113,13 +113,14 @@ function c10000020.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2000)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
if tc:GetAttack()==0 then dg:AddCard(tc) end
if preatk~=0 and tc:GetAttack()==0 then dg:AddCard(tc) end
tc=g:GetNext()
end
Duel.Destroy(dg,REASON_EFFECT)
......
......@@ -98,7 +98,7 @@ function c10000021.adval(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*1000
end
function c10000021.atkfilter(c,e,tp)
return c:IsControler(tp) and c:IsPosition(POS_FACEUP_ATTACK) and (not e or c:IsRelateToEffect(e))
return c:GetSummonPlayer()==tp and c:IsPosition(POS_FACEUP_ATTACK) and (not e or c:IsRelateToEffect(e))
end
function c10000021.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10000021.atkfilter,1,nil,nil,1-tp)
......@@ -113,13 +113,14 @@ function c10000021.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2000)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
if tc:GetAttack()==0 then dg:AddCard(tc) end
if preatk~=0 and tc:GetAttack()==0 then dg:AddCard(tc) end
tc=g:GetNext()
end
Duel.Destroy(dg,REASON_EFFECT)
......
......@@ -39,7 +39,7 @@ function c10979723.initial_effect(c)
c:RegisterEffect(e6)
end
function c10979723.val(e,c)
return Duel.GetMatchingGroupCount(c10979723.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*400
return Duel.GetMatchingGroupCount(c10979723.filter,c:GetControler(),LOCATION_MZONE,0,nil)*400
end
function c10979723.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
......
--風の精霊 ガルーダ
function c54615781.initial_effect(c)
function c12800777.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
......@@ -7,47 +7,47 @@ function c54615781.initial_effect(c)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c54615781.spcon)
e1:SetOperation(c54615781.spop)
e1:SetCondition(c12800777.spcon)
e1:SetOperation(c12800777.spop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetDescription(aux.Stringid(54615781,0))
e2:SetDescription(aux.Stringid(12800777,0))
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_REPEAT)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCondition(c54615781.poscon)
e2:SetTarget(c54615781.postg)
e2:SetOperation(c54615781.posop)
e2:SetCondition(c12800777.poscon)
e2:SetTarget(c12800777.postg)
e2:SetOperation(c12800777.posop)
c:RegisterEffect(e2)
end
function c54615781.spfilter(c)
function c12800777.spfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToRemoveAsCost()
end
function c54615781.spcon(e,c)
function c12800777.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c54615781.spfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(c12800777.spfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function c54615781.spop(e,tp,eg,ep,ev,re,r,rp,c)
function c12800777.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c54615781.spfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c12800777.spfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c54615781.poscon(e,tp,eg,ep,ev,re,r,rp)
function c12800777.poscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c54615781.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c12800777.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c54615781.posop(e,tp,eg,ep,ev,re,r,rp)
function c12800777.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_UP_DEFENCE,0,POS_FACEUP_ATTACK,0)
......
......@@ -30,6 +30,7 @@ function c1834107.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
end
function c1834107.recop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
......@@ -52,6 +52,7 @@ function c21420702.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,HAND)
end
function c21420702.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c21420702.disfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -36,6 +36,7 @@ function c21598948.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c21598948.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local a=Duel.GetAttacker()
if not a:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(21598948,4))
......
......@@ -39,6 +39,7 @@ function c22201234.atg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
end
function c22201234.aop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==1 then
Duel.DisableAttack()
end
......@@ -58,5 +59,6 @@ function c22201234.qtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetTargetCard(tg)
end
function c22201234.qop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.DisableAttack()
end
......@@ -16,6 +16,7 @@ function c26905245.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c26905245.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,26905245,0,0x21,0,3000,10,RACE_AQUA,ATTRIBUTE_WATER) then return end
c:AddTrapMonsterAttribute(true,ATTRIBUTE_WATER,RACE_AQUA,10,0,3000)
......
......@@ -42,15 +42,13 @@ end
function c28529976.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c28529976.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e:GetLabel(),e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
c:SetCardTarget(tc)
e:SetLabelObject(tc)
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
tc:CreateRelation(c,RESET_EVENT+0x1020000)
end
end
function c28529976.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -17,7 +17,7 @@ function c29654737.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c29654737.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1500) end
Duel.CheckLPCost(tp,1500)
Duel.PayLPCost(tp,1500)
end
function c29654737.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
......
......@@ -21,6 +21,7 @@ function c30241314.filter(c,e,sp)
return c:GetCode()==54493213 and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
function c30241314.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local cg=Duel.GetMatchingGroup(c30241314.filter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp)
if cg:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if Duel.SelectYesNo(tp, aux.Stringid(30241314,0)) then
......
......@@ -64,6 +64,7 @@ function c31828916.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c31828916.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if e:GetLabel()==1 then
local tc=e:GetLabelObject()
......
......@@ -29,6 +29,7 @@ function c34906152.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,400)
end
function c34906152.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
......@@ -49,6 +49,7 @@ function c35419032.target1(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c35419032.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c35419032.afilter,tp,LOCATION_DECK,0,1,1,nil)
......
......@@ -31,6 +31,7 @@ function c35577420.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c35577420.rmop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end
local g=Duel.GetDecktopGroup(1-tp,1)
Duel.DisableShuffleCheck()
......
......@@ -32,6 +32,7 @@ function c35631584.tg(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RegisterFlagEffect(35631584,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c35631584.op(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
......@@ -19,6 +19,7 @@ function c40555959.initial_effect(c)
c:RegisterEffect(e2)
end
function c40555959.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c40555959.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(40555959,1)) then
......@@ -39,6 +40,7 @@ function c40555959.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RegisterFlagEffect(40555959,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c40555959.remop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
......
......@@ -50,6 +50,7 @@ function c43889633.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
end
function c43889633.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
tc:RegisterFlagEffect(43889634,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
......
......@@ -23,6 +23,7 @@ function c47060347.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,3000)
end
function c47060347.recop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
......
......@@ -10,7 +10,7 @@ function c47480070.initial_effect(c)
c:RegisterEffect(e1)
end
function c47480070.val(e,c)
return Duel.GetMatchingGroupCount(c47480070.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*100
return Duel.GetMatchingGroupCount(c47480070.filter,c:GetControler(),LOCATION_MZONE,0,nil)*100
end
function c47480070.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
......
......@@ -19,7 +19,7 @@ function c51452091.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_SZONE)
e3:SetOperation(c51452091.disoperation)
e3:SetOperation(c51452091.disop)
c:RegisterEffect(e3)
--disable trap monster
local e4=Effect.CreateEffect(c)
......@@ -33,9 +33,9 @@ end
function c51452091.distarget(e,c)
return c~=e:GetHandler() and c:IsType(TYPE_TRAP)
end
function c51452091.disoperation(e,tp,eg,ep,ev,re,r,rp)
function c51452091.disop(e,tp,eg,ep,ev,re,r,rp)
local te,tl=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_LOCATION)
if tl==LOCATION_SZONE and Duel.GetChainInfo(ev,CHAININFO_TYPE)==TYPE_TRAP then
if tl==LOCATION_SZONE and Duel.GetChainInfo(ev,CHAININFO_TYPE)==TYPE_TRAP and te:GetHandler()~=e:GetHandler() then
Duel.NegateEffect(ev)
end
end
......@@ -50,6 +50,7 @@ function c51670553.skipcon(e,tp,eg,ep,ev,re,r,rp)
return tc and ep~=tp and r==REASON_BATTLE and (Duel.GetAttacker()==tc or Duel.GetAttackTarget()==tc)
end
function c51670553.skipop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
......
......@@ -53,6 +53,7 @@ function c52971944.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:GetHandler():RegisterFlagEffect(52971944,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c52971944.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
......
......@@ -40,7 +40,7 @@ function c53347303.initial_effect(c)
end
function c53347303.spcon(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,23995346)
return Duel.CheckReleaseGroup(c:GetControler(),Card.IsCode,1,nil,23995346)
end
function c53347303.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),Card.IsCode,1,1,nil,23995346)
......
......@@ -34,8 +34,9 @@ function c56460688.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c56460688.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if Duel.Remove(tg,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsRelateToEffect(e) then
if Duel.Remove(tg,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local g=Duel.GetOperatedGroup()
local tc=g:GetFirst()
while tc do
......
......@@ -31,6 +31,7 @@ function c57953380.tg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c57953380.op(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
......@@ -33,6 +33,7 @@ function c61623148.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c61623148.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
......@@ -75,6 +75,7 @@ function c64038662.eftg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
c64038662.select(e,tp,b1,b2)
end
function c64038662.efop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 then return
elseif e:GetLabel()==1 then
local tc1=e:GetLabelObject()
......
--攻撃の無力化
--機甲忍法フリーズ·ロック
function c65150219.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -24,6 +24,7 @@ function c65150219.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(c65150219.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c65150219.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.DisableAttack() then
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
end
......
......@@ -86,6 +86,7 @@ function c6733059.dfilter(c,lv)
return c:IsFaceup() and c:GetLevel()==lv and c:IsDestructable()
end
function c6733059.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local lv=e:GetLabel()
if lv==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
......@@ -41,6 +41,7 @@ function c69537999.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,HAND)
end
function c69537999.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c69537999.disfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -33,9 +33,9 @@ function c70861343.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c70861343.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c70861343.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e:GetLabel(),e,tp)
local tc=g:GetFirst()
......
......@@ -28,6 +28,7 @@ function c79205581.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
else e:SetLabel(0) end
end
function c79205581.operation1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==1 then
Duel.SkipPhase(Duel.GetTurnPlayer(),PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
end
......@@ -41,5 +42,6 @@ function c79205581.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST)
end
function c79205581.operation2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.SkipPhase(Duel.GetTurnPlayer(),PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
end
......@@ -45,6 +45,7 @@ function c80604091.target1(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c80604091.activate1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if e:GetLabel()~=1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c80604091.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
......
......@@ -42,6 +42,7 @@ function c84613836.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c84613836.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
......
......@@ -25,6 +25,7 @@ function c88279736.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c88279736.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(ep,LOCATION_HAND,0,nil)
local sg=g:RandomSelect(ep,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
......
......@@ -37,17 +37,14 @@ function c90200789.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,2,0,0)
end
function c90200789.tfilter(c,e)
return c:IsFaceup() and c:IsRelateToEffect(e)
end
function c90200789.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(c90200789.tfilter,nil,e)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()==0 then return end
Duel.SendtoGrave(tg,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
if not c:IsRelateToEffect(e) then return end
local tc=tg:GetFirst()
local lv=0
if tc:IsLocation(LOCATION_GRAVE) then lv=lv+tc:GetLevel() end
......
......@@ -35,6 +35,7 @@ function c92035412.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c92035412.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft==0 then return end
if ft>e:GetLabel() then ft=e:GetLabel() end
......
......@@ -39,6 +39,7 @@ function c92223641.tg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,e:GetLabel())
end
function c92223641.op(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
......@@ -36,6 +36,7 @@ function c95084054.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RegisterFlagEffect(95084054,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c95084054.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
......@@ -33,6 +33,7 @@ function c95714077.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c95714077.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c95714077.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -20,7 +20,7 @@ function c96965364.cfilter(c,e,tp)
return lv>0 and Duel.IsExistingMatchingCard(c96965364.spfilter,tp,LOCATION_DECK,0,1,nil,lv+1,e,tp)
end
function c96965364.spfilter(c,lv,e,tp)
return c:IsLevelBelow(lv) and c:IsRace(RACE_INSECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:GetLevel()==lv and c:IsRace(RACE_INSECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c96965364.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
......
......@@ -48,6 +48,7 @@ function c99342953.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c99342953.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
......@@ -41,6 +41,7 @@ function c99659159.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c99659159.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
......
......@@ -580,7 +580,7 @@ function Auxiliary.FOperationFun2(f1,f2,insf)
local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
if chkf~=PLAYER_NONE then
g1=sg:FilterSelect(tp,Auxiliary.FConditionCheckF,1,1,nil)
g1=sg:FilterSelect(tp,Auxiliary.FConditionCheckF,1,1,nil,chkf)
else g1=sg:Select(tp,1,1,nil) end
local tc1=g1:GetFirst()
sg:RemoveCard(tc1)
......@@ -633,7 +633,7 @@ function Auxiliary.FOperationCodeRep(code,cc,sub,insf)
local sg=eg:Filter(Auxiliary.FConditionFilterCR,nil,code,sub)
local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
if chkf~=PLAYER_NONE then g1=sg:FilterSelect(tp,Auxiliary.FConditionCheckF,1,1,nil)
if chkf~=PLAYER_NONE then g1=sg:FilterSelect(tp,Auxiliary.FConditionCheckF,1,1,nil,chkf)
else g1=sg:Select(tp,1,1,nil) end
local tc1=g1:GetFirst()
for i=1,cc-1 do
......@@ -682,7 +682,7 @@ function Auxiliary.FOperationFunRep(f,cc,insf)
return
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=sg:FilterSelect(tp,Auxiliary.FConditionCheckF,1,1,nil)
local g1=sg:FilterSelect(tp,Auxiliary.FConditionCheckF,1,1,nil,chkf)
local tc1=g1:GetFirst()
sg:RemoveCard(tc1)
if cc>1 then
......
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