Commit f4d375be authored by Chen Bill's avatar Chen Bill

fix: target effect

parent 689c9bda
......@@ -12,8 +12,7 @@ end
function c1005587.filter(c,tp)
return aux.NegateMonsterFilter(c) and c:IsAttackAbove(2000) and c:IsSummonPlayer(tp)
end
function c1005587.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
function c1005587.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c1005587.filter,1,nil,1-tp) end
Duel.SetTargetCard(eg)
local g=eg:Filter(c1005587.filter,nil,1-tp)
......
......@@ -37,7 +37,7 @@ end
function c10602628.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c10602628.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c10602628.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.IsExistingMatchingCard(c10602628.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
......
......@@ -28,7 +28,7 @@ end
function c12171659.filter(c)
return c:IsCode(56433456) and c:IsAbleToHand()
end
function c12171659.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c12171659.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12171659.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -26,7 +26,7 @@ end
function c13650422.filter(c)
return (aux.IsCodeListed(c,94820406) or c:IsCode(94820406)) and not c:IsCode(13650422) and c:IsAbleToHand()
end
function c13650422.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c13650422.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13650422.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -45,7 +45,7 @@ end
function c14536035.filter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGrave()
end
function c14536035.sgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c14536035.sgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c14536035.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
......
......@@ -46,7 +46,7 @@ function c15327215.filter(c,mc)
return c:IsLevelBelow(4) and c:IsSetCard(0x3d) and c:IsAbleToRemoveAsCost()
and not (c:IsLevel(mc:GetLevel()) and c:IsAttribute(mc:GetAttribute()) and c:IsAttack(mc:GetAttack()) and c:IsDefense(mc:GetDefense()))
end
function c15327215.cost(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c15327215.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c15327215.filter,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c15327215.filter,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
......
......@@ -41,6 +41,7 @@ function c16643334.initial_effect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(0,TIMING_BATTLE_START+TIMING_END_PHASE)
......
......@@ -19,7 +19,7 @@ end
function c17393207.filter(c)
return c:IsCode(47355498) and c:IsAbleToHand()
end
function c17393207.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c17393207.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17393207.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -32,7 +32,7 @@ function c18859369.tgfilter2(c,attr)
return c:IsAbleToGrave() and c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT)
and not c:IsAttribute(attr)
end
function c18859369.sgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c18859369.sgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if e:GetLabel()~=100 then return false end
......
......@@ -28,7 +28,7 @@ end
function c19280589.tkcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c19280589.tktg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c19280589.tktg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,19280590,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
......
......@@ -37,7 +37,7 @@ function c2204038.ptcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at and at:IsControler(1-tp) and at:IsRelateToBattle()
end
function c2204038.pttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c2204038.pttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDefense()>=1000 end
end
......
......@@ -21,6 +21,7 @@ function c22056710.initial_effect(c)
e3:SetDescription(aux.Stringid(22056710,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c22056710.sptg)
......@@ -51,6 +52,7 @@ function c22056710.spfilter(c,e,tp,lv)
return clv>0 and clv<lv and c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c22056710.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c22056710.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
......
......@@ -16,7 +16,7 @@ function c23234094.filter(c,e,tp)
return c:IsLevelBelow(6) and c:IsRace(RACE_DINOSAUR) and c:IsAttribute(ATTRIBUTE_FIRE)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23234094.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c23234094.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c23234094.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
......
......@@ -9,7 +9,7 @@ function c24317029.initial_effect(c)
e1:SetOperation(c24317029.operation)
c:RegisterEffect(e1)
end
function c24317029.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c24317029.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
......
......@@ -75,7 +75,7 @@ function c24731391.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp==1-tp and c:IsPreviousControler(tp)
end
function c24731391.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c24731391.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24731391.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -33,7 +33,7 @@ function c25538345.filter(c)
return not c:IsCode(25538345) and ((c:IsSetCard(0x10db) and c:IsType(TYPE_MONSTER)) or (c:IsSetCard(0xdb) and c:IsType(TYPE_SPELL+TYPE_TRAP)))
and c:IsAbleToGrave()
end
function c25538345.sgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c25538345.sgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c25538345.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
......
......@@ -16,6 +16,7 @@ function c25669282.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c25669282.spcon)
e2:SetCost(aux.bfgcost)
......
......@@ -42,7 +42,7 @@ end
function c26577155.thfilter(c)
return c:IsCode(62265044) and c:IsAbleToHand()
end
function c26577155.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c26577155.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c26577155.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -38,7 +38,7 @@ end
function c28240337.spfilter(c,e,tp)
return c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c28240337.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c28240337.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c28240337.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
......
......@@ -35,7 +35,7 @@ end
function c29596581.filter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x11c) and not c:IsCode(29596581) and c:IsAbleToHand()
end
function c29596581.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c29596581.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29596581.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
......
......@@ -32,7 +32,7 @@ end
function c29888389.filter(c)
return c:IsSetCard(0x3a) and c:GetType()==TYPE_SPELL+TYPE_RITUAL and c:IsAbleToHand()
end
function c29888389.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c29888389.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29888389.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -39,7 +39,7 @@ end
function c31600513.tkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c31600513.tktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c31600513.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,31600514,0,TYPES_TOKEN_MONSTER,500,500,1,RACE_INSECT,ATTRIBUTE_WIND) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
......
......@@ -20,7 +20,7 @@ end
function c31786629.filter(c)
return c:IsCode(31786629) and c:IsAbleToHand()
end
function c31786629.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c31786629.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c31786629.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -12,8 +12,7 @@ end
function c32120116.filter(c,tp)
return c:IsSummonPlayer(tp)
end
function c32120116.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
function c32120116.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c32120116.filter,1,nil,1-tp) end
Duel.SetTargetCard(eg)
local g=eg:Filter(c32120116.filter,nil,1-tp)
......
......@@ -53,7 +53,7 @@ function c33438666.spfilter(c,e,tp,rc,tid)
return c:IsReason(REASON_BATTLE) and c:GetReasonCard()==rc and c:GetTurnID()==tid
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33438666.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c33438666.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c33438666.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp,e:GetHandler(),Duel.GetTurnCount()) end
local g=Duel.GetMatchingGroup(c33438666.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp,e:GetHandler(),Duel.GetTurnCount())
......
......@@ -46,7 +46,7 @@ function c3370104.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:IsPreviousPosition(POS_FACEUP)
end
function c3370104.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c3370104.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
......
......@@ -20,7 +20,7 @@ end
function c3431737.filter(c)
return c:IsCode(80280737) and c:IsAbleToHand()
end
function c3431737.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c3431737.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c3431737.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -37,7 +37,7 @@ function c34904525.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
and aux.IsCodeListed(c,25955164) and aux.IsCodeListed(c,62340868) and aux.IsCodeListed(c,98434877)
end
function c34904525.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c34904525.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34904525.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -14,7 +14,7 @@ c3493058.toss_dice=true
function c3493058.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c3493058.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c3493058.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c3493058.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
......
......@@ -51,7 +51,7 @@ end
function c35815783.thfilter(c)
return c:IsCode(99426088) and c:IsAbleToHand()
end
function c35815783.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c35815783.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c35815783.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
......
......@@ -8,6 +8,7 @@ function c3792766.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c3792766.thcon)
e1:SetTarget(c3792766.thtg)
e1:SetOperation(c3792766.thop)
......
......@@ -25,7 +25,7 @@ end
function c38723936.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c38723936.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c38723936.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c38723936.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
......
......@@ -40,7 +40,7 @@ end
function c39512984.filter(c)
return c:IsLevelBelow(7) and c:IsSetCard(0x1047) and c:IsType(TYPE_FUSION) and c:IsAbleToRemoveAsCost()
end
function c39512984.cost(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c39512984.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c39512984.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c39512984.filter,tp,LOCATION_GRAVE,0,1,1,nil)
......
......@@ -36,7 +36,7 @@ function c40867519.initial_effect(c)
e5:SetTarget(c40867519.distarget)
c:RegisterEffect(e5)
end
function c40867519.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c40867519.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAttackPos() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
......
......@@ -22,7 +22,7 @@ function c41090784.initial_effect(c)
e3:SetValue(c41090784.indval)
c:RegisterEffect(e3)
end
function c41090784.potg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c41090784.potg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAttackPos() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
......
......@@ -51,7 +51,7 @@ end
function c41562624.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_ZOMBIE)
end
function c41562624.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c41562624.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
......
......@@ -17,7 +17,7 @@ end
function c41705642.filter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c41705642.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c41705642.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c41705642.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
......
......@@ -35,7 +35,7 @@ function c42256406.initial_effect(c)
e5:SetOperation(c42256406.defop)
c:RegisterEffect(e5)
end
function c42256406.potg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c42256406.potg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAttackPos() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
......
......@@ -35,7 +35,7 @@ function c423585.initial_effect(c)
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
end
function c423585.potg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c423585.potg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
......
......@@ -32,7 +32,7 @@ function c43739056.ctcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
return p==Duel.GetTurnPlayer() and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c43739056.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c43739056.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsControlerCanBeChanged() end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
......
......@@ -19,7 +19,7 @@ end
function c43797906.filter(c)
return c:GetOriginalCode()==295517 and c:IsAbleToHand()
end
function c43797906.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c43797906.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c43797906.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -65,7 +65,7 @@ end
function c44308317.tkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c44308317.tkfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c44308317.tktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c44308317.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,44308318,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_AQUA,ATTRIBUTE_WATER) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
......
......@@ -37,7 +37,7 @@ end
function c44364207.filter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevel(4) and c:IsAbleToHand()
end
function c44364207.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c44364207.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c44364207.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -14,8 +14,9 @@ function c45072394.initial_effect(c)
e2:SetDescription(aux.Stringid(45072394,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c45072394.spcon)
e2:SetTarget(c45072394.sptg)
......
......@@ -15,7 +15,7 @@ end
function c45222299.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c45222299.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c45222299.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_HAND)
end
......
......@@ -5,6 +5,7 @@ function c45885288.initial_effect(c)
e1:SetDescription(aux.Stringid(45885288,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,45885288)
e1:SetCost(c45885288.spcost)
......
......@@ -42,8 +42,7 @@ end
function c46037213.spfilter(c,e,tp,rc)
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_SUMMON) and c:GetReasonCard()==rc and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c46037213.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
function c46037213.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=e:GetHandler():GetMaterial():Filter(c46037213.spfilter,nil,e,tp,e:GetHandler())
Duel.SetTargetCard(g)
......
......@@ -32,7 +32,7 @@ end
function c47106439.filter(c)
return c:IsSetCard(0x3a) and bit.band(c:GetType(),0x81)==0x81 and c:IsAbleToHand()
end
function c47106439.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c47106439.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c47106439.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -27,7 +27,7 @@ end
function c48675364.filter(c)
return c:IsCode(94585852) and c:IsAbleToHand()
end
function c48675364.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c48675364.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48675364.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -64,7 +64,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function s.ddtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function s.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsPlayerCanDiscardDeck(tp,3)
local b2=Duel.IsPlayerCanDiscardDeck(1-tp,3)
if chk==0 then return b1 or b2 end
......
......@@ -19,7 +19,7 @@ end
function c49941059.tgfilter(c)
return c:IsAttackPos() and c:IsCanChangePosition() and c:IsControlerCanBeChanged()
end
function c49941059.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c49941059.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49941059.tgfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,1-tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,1-tp,LOCATION_MZONE)
......
......@@ -12,7 +12,7 @@ function c50593156.initial_effect(c)
c:RegisterEffect(e1)
end
c50593156.toss_coin=true
function c50593156.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c50593156.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,3)
......
......@@ -14,6 +14,7 @@ function c52176579.initial_effect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,52176579)
e2:SetCondition(aux.exccon)
......
......@@ -5,7 +5,7 @@ function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,2,2)
c:EnableReviveLimit()
--add counter
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_ATKCHANGE)
......@@ -30,7 +30,7 @@ end
function s.tgfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x18c)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
......
......@@ -11,7 +11,7 @@ end
function c53193261.filter(c)
return c:IsFaceup() and c:IsSetCard(0xe)
end
function c53193261.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c53193261.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c53193261.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c53193261.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -29,7 +29,7 @@ function c56387350.filter(c,e,tp,rc,tid)
return c:IsReason(REASON_BATTLE) and c:GetReasonCard()==rc and c:GetTurnID()==tid
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c56387350.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c56387350.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c56387350.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp,e:GetHandler(),Duel.GetTurnCount()) end
local g=Duel.GetMatchingGroup(c56387350.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp,e:GetHandler(),Duel.GetTurnCount())
......
......@@ -37,7 +37,7 @@ end
function c56713174.filter(c)
return c:IsCode(56713174) and c:IsAbleToHand()
end
function c56713174.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c56713174.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c56713174.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -48,7 +48,7 @@ function c56839613.drcon(e,tp,eg,ep,ev,re,r,rp)
and e:GetHandler():IsReason(REASON_BATTLE)
and e:GetHandler():GetFlagEffect(56839613)~=0
end
function c56839613.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c56839613.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
......
......@@ -17,7 +17,7 @@ function c56840658.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c56840658.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c56840658.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
......
......@@ -18,7 +18,7 @@ end
function c57139487.filter(c)
return c:IsFaceup() and c:GetAttack()<=1000 and c:IsAbleToRemove()
end
function c57139487.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c57139487.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c57139487.filter,1,nil) end
local g=eg:Filter(c57139487.filter,nil)
Duel.SetTargetCard(g)
......
......@@ -44,7 +44,7 @@ end
function c58062306.filter(c)
return c:IsCode(84335863) and c:IsAbleToHand()
end
function c58062306.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c58062306.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c58062306.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -15,7 +15,7 @@ end
function c60161788.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c60161788.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c60161788.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
......
......@@ -94,7 +94,7 @@ function c6039967.spfilter2(c,e,tp,rc,tid)
return c:IsReason(REASON_BATTLE) and c:GetReasonCard()==rc and c:GetTurnID()==tid
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c6039967.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c6039967.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c6039967.spfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp,e:GetHandler(),Duel.GetTurnCount()) end
local g=Duel.GetMatchingGroup(c6039967.spfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp,e:GetHandler(),Duel.GetTurnCount())
......
......@@ -5,6 +5,7 @@ function c60431417.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c60431417.condition)
e1:SetTarget(c60431417.target)
e1:SetOperation(c60431417.activate)
......
......@@ -60,7 +60,7 @@ function c60600126.filter(c)
return ((c:IsSetCard(0x1093) and c:IsType(TYPE_MONSTER)) or (c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE) and not c:IsSummonableCard()))
and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c60600126.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c60600126.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c60600126.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -44,7 +44,7 @@ end
function s.thfilter(c)
return c:IsType(TYPE_FIELD) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=eg:Filter(s.filter,nil,tp)
local b1=g:IsExists(s.filter1,1,nil,e,tp)
......
......@@ -32,7 +32,7 @@ end
function c62411811.thfilter(c)
return c:IsSetCard(0x193) and c:IsAbleToHand()
end
function c62411811.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c62411811.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c62411811.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -33,7 +33,7 @@ end
function c65331686.thfilter(c)
return c:IsCode(24094653) and c:IsAbleToHand()
end
function c65331686.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c65331686.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65331686.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -85,7 +85,7 @@ end
function c66750703.thfilter(c)
return c:IsRace(RACE_BEASTWARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c66750703.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c66750703.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c66750703.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -20,7 +20,7 @@ end
function c67111213.filter(c)
return c:IsDefenseBelow(1000) and c:IsSetCard(0x3a) and c:IsType(TYPE_MONSTER) and not c:IsCode(67111213) and c:IsAbleToHand()
end
function c67111213.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c67111213.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67111213.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -36,7 +36,7 @@ function c8967776.filter(c,e,tp)
return c:IsRace(RACE_FAIRY) and c:IsLevelAbove(8)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c8967776.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c8967776.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c8967776.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
......
......@@ -22,7 +22,7 @@ function c9897998.filter(c,e,tp)
return c:IsDefenseBelow(1500) and c:IsRace(RACE_PSYCHO) and c:IsAttribute(ATTRIBUTE_WIND)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9897998.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c9897998.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c9897998.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
......
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