Commit 2802614b authored by argon.sun's avatar argon.sun

new scripts

parent bd1daa27
......@@ -60,7 +60,7 @@ function c10004783.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x34) end
end
function c10004783.tfop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x34)
if g:GetCount()>0 then
......
--タイガードラゴン
function c10097168.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10097168,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c10097168.condition)
e1:SetTarget(c10097168.target)
e1:SetOperation(c10097168.operation)
c:RegisterEffect(e1)
--tribute check
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c10097168.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c10097168.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsRace,1,nil,RACE_DRAGON) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c10097168.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE and e:GetLabel()==1
end
function c10097168.filter(c)
return c:IsFacedown() and c:GetSequence()~=5 and c:IsDestructable()
end
function c10097168.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(c10097168.filter,tp,0,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c10097168.filter,tp,0,LOCATION_SZONE,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c10097168.dfilter(c,e)
return c:IsRelateToEffect(e) and c:IsFacedown()
end
function c10097168.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(c10097168.dfilter,nil,e)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
......@@ -44,7 +44,7 @@ function c10110717.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,g:GetFirst():GetControler(),500)
end
function c10110717.damop(e,tp,eg,ep,ev,re,r,rp)
......
--トラップ·イーター
function c13821299.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--spsummon proc
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c13821299.spcon)
e2:SetOperation(c13821299.spop)
c:RegisterEffect(e2)
end
function c13821299.spfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function c13821299.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c13821299.spfilter,c:GetControler(),0,LOCATION_ONFIELD,1,nil)
end
function c13821299.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c13821299.spfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
--ストーム·サモナー
function c15935204.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_BATTLE_END)
e1:SetOperation(c15935204.operation)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(15935204,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c15935204.dmcon)
e2:SetTarget(c15935204.dmtg)
e2:SetOperation(c15935204.dmop)
c:RegisterEffect(e2)
end
function c15935204.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local b1=not a:IsType(TYPE_TOKEN) and a:IsStatus(STATUS_BATTLE_DESTROYED) and a:IsControler(1-tp) and d and d~=c and d:IsRace(RACE_PSYCHO)
local b2=d and not d:IsType(TYPE_TOKEN) and d:IsStatus(STATUS_BATTLE_DESTROYED) and d:IsControler(1-tp) and a~=c and a:IsRace(RACE_PSYCHO)
if (not b1 and not b2) or not Duel.SelectYesNo(tp,aux.Stringid(15935204,1)) then return end
if b1 then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetTarget(c15935204.reptg)
e1:SetOperation(c15935204.repop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
a:RegisterEffect(e1)
end
if b2 then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetTarget(c15935204.reptg)
e1:SetOperation(c15935204.repop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
d:RegisterEffect(e1)
end
end
function c15935204.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_BATTLE) end
return true
end
function c15935204.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_EFFECT)
end
function c15935204.dmcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_BATTLE)
end
function c15935204.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
Duel.SetTargetPlayer(c:GetPreviousControler())
Duel.SetTargetParam(c:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,c:GetPreviousControler(),c:GetAttack())
end
function c15935204.dmop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
......@@ -19,7 +19,7 @@ function c17021204.check(tp)
end
function c17021204.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(tp,LOCATION_MZONE)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c17021204.spfilter,c:GetControler(),0,LOCATION_MZONE,2,nil)
and c17021204.check(c:GetControler())
end
......
......@@ -29,7 +29,7 @@ function c18060565.eqfilter(c)
return c:IsSetCard(0x29) and c:IsRace(RACE_DRAGON) and c:GetLevel()<=3
end
function c18060565.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
......
--偽りの種
function c18752938.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c18752938.target)
e1:SetOperation(c18752938.activate)
c:RegisterEffect(e1)
end
function c18752938.filter(c,e,tp)
return c:IsLevelBelow(2) and c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c18752938.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c18752938.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c18752938.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c18752938.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
end
--ウィード
function c19505896.initial_effect(c)
--Destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c19505896.desreptg)
e1:SetOperation(c19505896.desrepop)
c:RegisterEffect(e1)
end
function c19505896.repfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
end
function c19505896.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE)
and Duel.IsExistingMatchingCard(c19505896.repfilter,tp,LOCATION_MZONE,0,1,c) end
if Duel.SelectYesNo(tp,aux.Stringid(19505896,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,c19505896.repfilter,tp,LOCATION_MZONE,0,1,1,c)
e:SetLabelObject(g:GetFirst())
g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true)
return true
else return false end
end
function c19505896.desrepop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
tc:SetStatus(STATUS_DESTROY_CONFIRMED,false)
Duel.Destroy(tc,REASON_EFFECT+REASON_REPLACE)
end
--ハネワタ
function c20450925.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20450925,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c20450925.cost)
e1:SetOperation(c20450925.operation)
c:RegisterEffect(e1)
end
function c20450925.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c20450925.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c20450925.damval)
e1:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e1,tp)
end
function c20450925.damval(e,re,val,r,rp,rc)
if bit.band(r,REASON_EFFECT) then return 0
else return val end
end
......@@ -41,7 +41,7 @@ function c21249921.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c21249921.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
......@@ -25,7 +25,7 @@ end
function c21698716.reptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return false end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return false end
return Duel.SelectEffectYesNo(tp,c)
end
function c21698716.repoperation(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -39,7 +39,7 @@ function c21790410.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c21790410.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c21790410.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
......
......@@ -44,7 +44,7 @@ function c21977828.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
......
......@@ -47,7 +47,7 @@ function c2461031.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c2461031.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c2461031.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
......
......@@ -21,7 +21,7 @@ function c2584136.eqlimit(e,c)
end
function c2584136.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=c:GetBattleTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToBattle() then
Duel.Equip(tp,c,tc,true)
......
......@@ -34,7 +34,7 @@ function c25988873.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp)
or Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
or Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.BreakEffect()
if not Duel.Equip(tp,c,tc,false) then return end
local e1=Effect.CreateEffect(c)
......
--C·シューター
function c26157485.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(26157485,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c26157485.damcost)
e1:SetTarget(c26157485.damtg)
e1:SetOperation(c26157485.damop)
c:RegisterEffect(e1)
end
function c26157485.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x25) and c:IsAbleToGraveAsCost()
end
function c26157485.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c26157485.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c26157485.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c26157485.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c26157485.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
......@@ -37,7 +37,7 @@ function c26211048.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or c:IsFacedown() or not c:IsRelateToEffect(e) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then
if tc:IsLocation(LOCATION_MZONE) then Duel.SendtoGrave(tc,REASON_EFFECT) end
return
end
......
......@@ -17,7 +17,7 @@ function c26302522.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if not tc:IsRelateToBattle() or not c:IsRelateToBattle() then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or tc:IsFacedown() then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() then
Duel.Destroy(c,REASON_EFFECT)
return
end
......
--DNA定期健診
function c27340877.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c27340877.target)
e1:SetOperation(c27340877.activate)
c:RegisterEffect(e1)
end
function c27340877.filter(c)
return c:IsFacedown() and c:GetRace()~=0
end
function c27340877.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsCOntroler(tp) and c27340877.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c27340877.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
Duel.SelectTarget(tp,c27340877.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,563)
local rc=Duel.AnnounceRace(1-tp,2,0xffffff)
e:SetLabel(rc)
end
function c27340877.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
Duel.ConfirmCards(1-tp,tc)
if tc:IsRace(e:GetLabel()) then
Duel.Draw(1-tp,2,REASON_EFFECT)
else
Duel.Draw(tp,2,REASON_EFFECT)
end
end
end
--チェイス·スカッド
function c27870033.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(27870033,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c27870033.damcon)
e1:SetTarget(c27870033.damtg)
e1:SetOperation(c27870033.damop)
c:RegisterEffect(e1)
end
function c27870033.cfilter(c)
return c:IsPreviousPosition(POS_DEFENCE) and c:IsLocation(LOCATION_GRAVE)
and c:IsReason(REASON_BATTLE) and c:IsType(TYPE_MONSTER)
end
function c27870033.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c27870033.cfilter,1,nil)
end
function c27870033.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsFaceup() end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c27870033.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--竹頭木屑
function c28062325.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c28062325.cost)
e1:SetTarget(c28062325.target)
e1:SetOperation(c28062325.activate)
c:RegisterEffect(e1)
end
function c28062325.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_PLANT) end
local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_PLANT)
Duel.Release(g,REASON_COST)
end
function c28062325.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,28062326,0,0x4011,800,500,1,RACE_PLANT,ATTRIBUTE_EARTH,POS_FACEUP_DEFENCE,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
function c28062325.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<2 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,28062326,0,0x4011,800,500,1,RACE_PLANT,ATTRIBUTE_EARTH,POS_FACEUP_DEFENCE,1-tp) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,28062326)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENCE)
end
Duel.SpecialSummonComplete()
end
......@@ -38,7 +38,7 @@ function c28183605.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c28183605.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
--破壊神の系譜
function c29307554.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c29307554.condition)
e1:SetTarget(c29307554.target)
e1:SetOperation(c29307554.activate)
c:RegisterEffect(e1)
if not c29307554.global_check then
c29307554.global_check=true
c29307554[0]=true
c29307554[1]=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROY)
ge1:SetOperation(c29307554.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(c29307554.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c29307554.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsDefence() then
c29307554[1-tc:GetControler()]=true
end
tc=eg:GetNext()
end
end
function c29307554.clear(e,tp,eg,ep,ev,re,r,rp)
c29307554[0]=false
c29307554[1]=false
end
function c29307554.condition(e,tp,eg,ep,ev,re,r,rp)
return c29307554[tp] and Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()<=PHASE_BATTLE
end
function c29307554.filter(c)
return c:IsFaceup() and c:IsLevelAbove(8) and c:GetEffectCount(EFFECT_EXTRA_ATTACK)==0
end
function c29307554.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29307554.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c29307554.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c29307554.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c29307554.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and c29307554.filter(tc) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
--アイヴィ·ウォール
function c30069398.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(30069398,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_FLIP+EFFECT_TYPE_SINGLE)
e1:SetTarget(c30069398.target)
e1:SetOperation(c30069398.operation)
c:RegisterEffect(e1)
end
function c30069398.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c30069398.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,30069399,0,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH,POS_FACEUP_DEFENCE,1-tp) then return end
local token=Duel.CreateToken(tp,30069399)
if Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENCE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DESTROY)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(c30069398.damop)
token:RegisterEffect(e1,true)
end
Duel.SpecialSummonComplete()
end
function c30069398.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,300,REASON_EFFECT)
end
--シンクロ·ストライク
function c30123142.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c30123142.condition)
e1:SetTarget(c30123142.target)
e1:SetOperation(c30123142.activate)
c:RegisterEffect(e1)
end
function c30123142.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c30123142.filter(c)
return c:IsFaceup() and c:GetSummonType()==SUMMON_TYPE_SYNCHRO and c:GetMaterialCount()~=0
end
function c30123142.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c30123142.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c30123142.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c30123142.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c30123142.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and c30123142.filter(tc) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetMaterialCount()*500)
tc:RegisterEffect(e1)
end
end
......@@ -34,7 +34,7 @@ function c3019642.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c3019642.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
--ヒール·ウェーバー
function c31281980.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31281980,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c31281980.rectg)
e1:SetOperation(c31281980.recop)
c:RegisterEffect(e1)
end
function c31281980.filter(c)
return c:IsFaceup() and c:GetLevel()>0
end
function c31281980.rectg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c31281980.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c31281980.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c31281980.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetLevel()*100)
end
function c31281980.recop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Recover(tp,tc:GetLevel()*100,REASON_EFFECT)
end
end
--不死式冥界砲
function c31467372.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(31467372,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c31467372.damcon)
e2:SetTarget(c31467372.damtg)
e2:SetOperation(c31467372.damop)
c:RegisterEffect(e2)
end
function c31467372.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsRace(RACE_ZOMBIE)
end
function c31467372.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c31467372.filter,1,nil,tp)
end
function c31467372.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c31467372.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
......@@ -64,7 +64,7 @@ function c31829185.eqlimit(e,c)
end
function c31829185.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Equip(tp,c,tc)
......
--最古式念導
function c32180819.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c32180819.condition)
e1:SetTarget(c32180819.target)
e1:SetOperation(c32180819.activate)
c:RegisterEffect(e1)
end
function c32180819.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO)
end
function c32180819.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c32180819.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c32180819.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
end
function c32180819.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.Damage(tp,1000,REASON_EFFECT)
end
end
......@@ -24,7 +24,7 @@ end
function c32710364.reptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return false end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return false end
return Duel.SelectEffectYesNo(tp,c)
end
function c32710364.repoperation(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -27,7 +27,7 @@ end
function c32933942.reptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return false end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return false end
return Duel.SelectEffectYesNo(tp,c)
end
function c32933942.repoperation(e,tp,eg,ep,ev,re,r,rp,chk)
......
--ポイズン·チェーン
function c33302407.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--discard deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33302407,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_DECKDES)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c33302407.discon)
e2:SetTarget(c33302407.distg)
e2:SetOperation(c33302407.disop)
c:RegisterEffect(e2)
end
function c33302407.discon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and not Duel.CheckAttackActivity(tp)
end
function c33302407.filter(c)
return c:IsSetCard(0x25) and c:IsType(TYPE_MONSTER)
end
function c33302407.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(c33302407.filter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return ct>0 and Duel.IsPlayerCanDiscardDeck(1-tp,0) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,ct)
end
function c33302407.disop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local ct=Duel.GetMatchingGroupCount(c33302407.filter,tp,LOCATION_GRAVE,0,nil)
if ct>0 then
Duel.DiscardDeck(1-tp,ct,REASON_EFFECT)
end
end
......@@ -39,7 +39,7 @@ function c36870345.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp)
or Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
or Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.BreakEffect()
if not Duel.Equip(tp,c,tc,false) then return end
local e1=Effect.CreateEffect(c)
......
......@@ -42,7 +42,7 @@ function c38450736.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c38450736.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c38450736.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
......
......@@ -47,7 +47,7 @@ function c40418351.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c40418351.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
......@@ -29,7 +29,7 @@ function c41230939.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c41230939.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
......@@ -11,9 +11,6 @@ function c42969214.initial_effect(c)
e1:SetOperation(c42969214.operation)
c:RegisterEffect(e1)
end
function c42969214.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c42969214.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
......
--マンモス·ゾンビ
function c43642620.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(c43642620.sdcon)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(43642620,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c43642620.dmcon)
e2:SetTarget(c43642620.dmtg)
e2:SetOperation(c43642620.dmop)
c:RegisterEffect(e2)
end
function c43642620.sdcon(e)
return not Duel.IsExistingMatchingCard(Card.IsRace,0,LOCATION_GRAVE,0,1,nil,RACE_ZOMBIE)
end
function c43642620.dmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
and (not c:IsReason(REASON_BATTLE) or bit.band(c:GetBattlePosition(),POS_FACEUP)~=0)
end
function c43642620.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
Duel.SetTargetPlayer(c:GetPreviousControler())
Duel.SetTargetParam(1900)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,c:GetPreviousControler(),1900)
end
function c43642620.dmop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
......@@ -41,7 +41,7 @@ end
function c44505297.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or c:IsFacedown()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown()
or not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
Duel.Equip(tp,tc,c,false)
local e1=Effect.CreateEffect(c)
......
......@@ -12,7 +12,7 @@ function c45133463.initial_effect(c)
c:RegisterEffect(e1)
end
function c45133463.cfiltetr(c,tp)
return c:IsPreviousLocation(LOCATION_GRAVE) and c:GetPreviousControler(tp)
return c:IsPreviousLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp
end
function c45133463.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c45133463.cfiltetr,1,nil,tp)
......
......@@ -20,7 +20,7 @@ function c47121070.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x34) end
end
function c47121070.tfop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x34)
if g:GetCount()>0 then
......
......@@ -26,7 +26,7 @@ function c48370501.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function c48370501.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48370501,1))
local g=Duel.SelectMatchingCard(tp,c48370501.filter,tp,LOCATION_DECK,0,1,1,nil,e:GetHandler())
if g:GetCount()>0 then
......
--Ωメガネ
function c4857085.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c4857085.target)
e1:SetOperation(c4857085.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(1)
c:RegisterEffect(e2)
--confirm
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(4857085,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCost(c4857085.cfcost)
e3:SetTarget(c4857085.cftg)
e3:SetOperation(c4857085.cfop)
c:RegisterEffect(e3)
end
function c4857085.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c4857085.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c4857085.cfcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEquipTarget():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function c4857085.cftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
end
function c4857085.cfop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(tp,1)
Duel.ConfirmCards(tp,sg)
Duel.ShuffleHand(1-tp)
end
--サイコジャンパー
function c52430902.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(52430902,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c52430902.cost)
e1:SetTarget(c52430902.target)
e1:SetOperation(c52430902.operation)
c:RegisterEffect(e1)
end
function c52430902.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c52430902.filter1(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:GetCode()~=52430902 and c:IsAbleToChangeControler()
end
function c52430902.filter2(c)
return c:IsFaceup() and c:IsAbleToChangeControler()
end
function c52430902.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c52430902.filter2,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingTarget(c52430902.filter1,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g1=Duel.SelectTarget(tp,c52430902.filter1,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g2=Duel.SelectTarget(tp,c52430902.filter2,tp,0,LOCATION_MZONE,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g1,2,0,0)
end
function c52430902.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc1=g:GetFirst()
local tc2=g:GetNext()
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then
if Duel.SwapControl(tc1,tc2) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e1)
local e2=e1:Clone()
tc2:RegisterEffect(e2)
end
end
end
......@@ -36,7 +36,7 @@ function c52601736.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c52601736.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c52601736.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
......
......@@ -41,7 +41,7 @@ function c52977572.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp)
or Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
or Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.BreakEffect()
if not Duel.Equip(tp,c,tc,false) then return end
local e1=Effect.CreateEffect(c)
......
--C·コイル
function c53152590.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53152590,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c53152590.atktg)
e1:SetOperation(c53152590.atkop)
c:RegisterEffect(e1)
end
function c53152590.filter(c)
return c:IsFaceup() and c:IsSetCard(0x25)
end
function c53152590.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c53152590.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c53152590.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c53152590.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c53152590.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
tc:RegisterEffect(e2)
end
end
--C·リペアラー
function c53274132.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53274132,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c53274132.damcon)
e1:SetTarget(c53274132.damtg)
e1:SetOperation(c53274132.damop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(53274132,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c53274132.spcost)
e2:SetTarget(c53274132.sptg)
e2:SetOperation(c53274132.spop)
c:RegisterEffect(e2)
end
function c53274132.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and c:IsFaceup() and bc:IsLocation(LOCATION_GRAVE)
and bc:IsReason(REASON_BATTLE) and bc:IsType(TYPE_MONSTER)
end
function c53274132.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300)
end
function c53274132.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function c53274132.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function c53274132.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x25) and c:GetCode()~=53274132 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c53274132.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c53274132.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c53274132.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c53274132.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c53274132.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--植物連鎖
function c54451023.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c54451023.condition)
e1:SetTarget(c54451023.target)
e1:SetOperation(c54451023.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(54451023,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c54451023.spcon)
e2:SetTarget(c54451023.sptg)
e2:SetOperation(c54451023.spop)
c:RegisterEffect(e2)
end
function c54451023.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c54451023.filter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT)
end
function c54451023.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c54451023.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c54451023.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c54451023.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c54451023.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
c:CancelToGrave()
--Atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c54451023.eqlimit)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
end
function c54451023.eqlimit(e,c)
return c:GetControler()==e:GetOwnerPlayer() and c:IsRace(RACE_PLANT)
end
function c54451023.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetReason(),0x41)==0x41 and e:GetHandler():GetEquipTarget()
end
function c54451023.spfilter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c54451023.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c54451023.spfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c54451023.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c54451023.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c54451023.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -35,7 +35,7 @@ function c54578613.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c54578613.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
......@@ -34,7 +34,7 @@ function c61962135.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_REPEAT)
e4:SetCountLimit(1)
e4:SetCondition(c61962135.discon)
e4:SetCost(c61962135.discost)
e4:SetTarget(c61962135.distg)
e4:SetOperation(c61962135.disop)
c:RegisterEffect(e4)
end
......@@ -73,7 +73,7 @@ end
function c61962135.discon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c61962135.discost(e,tp,eg,ep,ev,re,r,rp,chk)
function c61962135.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
......
......@@ -67,7 +67,7 @@ function c63487632.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c63487632.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
......@@ -46,7 +46,7 @@ function c65844845.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
return
end
Duel.Equip(tp,c,tc,true)
......
......@@ -48,7 +48,7 @@ function c66066482.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c66066482.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c66066482.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
......
--ドッペル·ゲイナー
function c66395299.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(66395299,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_DAMAGE)
e2:SetCondition(c66395299.damcon)
e2:SetTarget(c66395299.damtg)
e2:SetOperation(c66395299.damop)
c:RegisterEffect(e2)
end
function c66395299.damcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and re:GetHandler():IsLocation(LOCATION_MZONE) and re:GetHandler():IsControler(1-tp)
end
function c66395299.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ev)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ev)
end
function c66395299.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
--プライドの咆哮
function c66518841.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(c66518841.condition)
e1:SetCost(c66518841.cost)
e1:SetOperation(c66518841.activate)
c:RegisterEffect(e1)
end
function c66518841.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
local bc=tc:GetBattleTarget()
if tc and bc then
local dif=bc:GetAttack()-tc:GetAttack()
e:SetLabel(dif)
return dif>0
else return false end
end
function c66518841.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,e:GetLabel()) end
Duel.PayLPCost(tp,e:GetLabel())
end
function c66518841.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
local bc=tc:GetBattleTarget()
local dif=bc:GetAttack()-tc:GetAttack()
if dif>0 and tc:IsRelateToBattle() and bc:IsRelateToBattle() and tc:IsFaceup() and bc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(dif+300)
tc:RegisterEffect(e1)
end
end
--コンフュージョン·チャフ
function c67630339.initial_effect(c)
--damage cal
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c67630339.condition)
e1:SetOperation(c67630339.operation)
c:RegisterEffect(e1)
if not c67630339.global_check then
c67630339.global_check=true
c67630339[0]=0
c67630339[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetCondition(c67630339.check)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_ATTACK_DISABLED)
ge2:SetCondition(c67630339.check2)
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(c67630339.clear)
Duel.RegisterEffect(ge3,0)
end
end
function c67630339.check(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if Duel.GetAttackTarget()==nil then
c67630339[1-tc:GetControler()]=c67630339[1-tc:GetControler()]+1
Duel.GetAttacker():RegisterFlagEffect(67630339,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
if c67630339[1-tc:GetControler()]==1 then
c67630339[2]=Duel.GetAttacker()
end
end
end
function c67630339.check2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:GetFlagEffect(67630339)~=0 and Duel.GetAttackTarget()~=nil then
c67630339[1-tc:GetControler()]=c67630339[1-tc:GetControler()]-1
end
end
function c67630339.clear(e,tp,eg,ep,ev,re,r,rp)
c67630339[0]=0
c67630339[1]=0
end
function c67630339.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetAttackTarget()==nil and c67630339[tp]==2
and c67630339[2]:GetFlagEffect(67630339)~=0
end
function c67630339.operation(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=c67630339[2]
if a:GetFlagEffect(67630339)~=0 and d:GetFlagEffect(67630339)~=0 then
Duel.CalculateDamage(a,d)
end
end
......@@ -39,7 +39,7 @@ function c68184115.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c68184115.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c68184115.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
......
......@@ -25,7 +25,7 @@ end
function c68215963.reptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return false end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return false end
return Duel.SelectEffectYesNo(tp,c)
end
function c68215963.repoperation(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -48,7 +48,7 @@ function c69207766.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c69207766.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c69207766.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
......
--フレグランス·ストーム
function c69584564.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c69584564.target)
e1:SetOperation(c69584564.operation)
c:RegisterEffect(e1)
end
function c69584564.filter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsDestructable()
end
function c69584564.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c69584564.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c69584564.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c69584564.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c69584564.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local ct=Duel.Draw(tp,1,REASON_EFFECT)
if ct==0 then return end
local dc=Duel.GetOperatedGroup():GetFirst()
if dc:IsRace(RACE_PLANT) and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(69584564,0)) then
Duel.BreakEffect()
Duel.ConfirmCards(1-tp,dc)
Duel.Draw(tp,1,REASON_EFFECT)
Duel.ShuffleHand(tp)
end
end
end
......@@ -23,7 +23,7 @@ end
function c69937550.reptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return false end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return false end
return Duel.SelectEffectYesNo(tp,c)
end
function c69937550.repoperation(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -36,7 +36,7 @@ end
function c7093411.reptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return false end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return false end
return Duel.SelectEffectYesNo(tp,c)
end
function c7093411.repoperation(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -59,7 +59,7 @@ function c7093411.target(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function c7093411.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,0x34)
if g:GetCount()>0 then
......
......@@ -65,7 +65,7 @@ function c76080032.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
......
......@@ -36,7 +36,7 @@ function c77625948.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c77625948.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
......@@ -15,5 +15,8 @@ function c79409334.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c79409334.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(e:GetHandler(), POS_FACEUP_DEFENCE)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsPosition(POS_FACEUP_ATTACK) then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
end
--パラライズ·チェーン
function c79707116.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--discard deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(79707116,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c79707116.damcon)
e2:SetTarget(c79707116.damtg)
e2:SetOperation(c79707116.damop)
c:RegisterEffect(e2)
end
function c79707116.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp
end
function c79707116.damcon(e,tp,eg,ep,ev,re,r,rp)
return re and bit.band(r,REASON_EFFECT)~=0 and eg:IsExists(c79707116.cfilter,1,nil,1-tp)
end
function c79707116.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300)
end
function c79707116.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
......@@ -16,7 +16,7 @@ end
function c80549379.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsFaceup() and c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0
or not Duel.IsExistingMatchingCard(c80549379.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) then return false end
return Duel.SelectEffectYesNo(tp,c)
end
......
--大落とし穴
function c80723580.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c80723580.condition)
e1:SetTarget(c80723580.target)
e1:SetOperation(c80723580.activate)
c:RegisterEffect(e1)
end
function c80723580.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()>=2
end
function c80723580.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c80723580.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--C·スネーク
function c80769747.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(80769747,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c80769747.eqtg)
e1:SetOperation(c80769747.eqop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80769747,1))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c80769747.ddescon)
e2:SetTarget(c80769747.ddestg)
e2:SetOperation(c80769747.ddesop)
c:RegisterEffect(e2)
end
function c80769747.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c80769747.eqlimit(e,c)
return e:GetOwner()==c
end
function c80769747.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() then
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Equip(tp,c,tc,true)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c80769747.eqlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(tc)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(-800)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(tc)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_DEFENCE)
e3:SetValue(-800)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
else
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
end
function c80769747.ddescon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
if c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_BATTLE) and ec:IsLocation(LOCATION_GRAVE) then
e:SetLabelObject(ec)
return true
else return false end
end
function c80769747.ddestg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ec=e:GetLabelObject()
local desp=ec:GetPreviousControler()
local desc=ec:GetLevel()
Duel.SetTargetPlayer(desp)
Duel.SetTargetParam(desc)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,desp,desc)
end
function c80769747.ddesop(e,tp,eg,ep,ev,re,r,rp)
local dp,dc=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.DiscardDeck(dp,dc,REASON_EFFECT)
end
--サーチ·ストライカー
function c80885324.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(80885324,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCondition(c80885324.descon)
e1:SetTarget(c80885324.destg)
e1:SetOperation(c80885324.desop)
c:RegisterEffect(e1)
--to defence
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c80885324.poscon)
e2:SetOperation(c80885324.posop)
c:RegisterEffect(e2)
end
function c80885324.descon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
return e:GetHandler()==Duel.GetAttacker() and d and d:IsFacedown() and d:IsDefence()
end
function c80885324.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,Duel.GetAttackTarget(),1,0,0)
end
function c80885324.desop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d:IsRelateToBattle() then
Duel.Destroy(d,REASON_EFFECT)
e:GetHandler():RegisterFlagEffect(80885324,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c80885324.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(80885324)~=0
end
function c80885324.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttack() then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_COPY_INHERIT)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,3)
c:RegisterEffect(e1)
end
--王墓の罠
function c80955168.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c80955168.condition)
e1:SetTarget(c80955168.target)
e1:SetOperation(c80955168.activate)
c:RegisterEffect(e1)
end
function c80955168.cfilter(c,tp)
return c:IsFaceup() and c:IsPreviousLocation(LOCATION_GRAVE) and c:GetPreviousControler()==1-tp
and c:IsControler(tp) and c:IsRace(RACE_ZOMBIE)
end
function c80955168.condition(e,tp,eg,ep,ev,re,r,rp,chk)
return eg:IsExists(c80955168.cfilter,1,nil,tp)
end
function c80955168.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,2,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function c80955168.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(g,REASON_EFFECT)
end
--ギガント·セファロタス
function c82116191.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82116191,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c82116191.atkcon)
e1:SetTarget(c82116191.atktg)
e1:SetOperation(c82116191.atkop)
c:RegisterEffect(e1)
end
function c82116191.filter(c)
return c:IsRace(RACE_PLANT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c82116191.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c82116191.filter,1,nil)
end
function c82116191.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsFaceup() end
end
function c82116191.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(200)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
end
--ツクシー
function c82994509.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82994509,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetTarget(c82994509.condition)
e1:SetTarget(c82994509.target)
e1:SetOperation(c82994509.operation)
c:RegisterEffect(e1)
end
function c82994509.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c82994509.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c82994509.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,82994510,0,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_WIND,POS_FACEUP_DEFENCE,1-tp) then return end
local token=Duel.CreateToken(tp,82994510)
if Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENCE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DESTROY)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(c82994509.handes)
token:RegisterEffect(e1,true)
end
Duel.SpecialSummonComplete()
end
function c82994509.handes(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsReason(REASON_BATTLE) and c:GetReasonCard():IsRace(RACE_PLANT) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT)
end
end
......@@ -53,7 +53,7 @@ function c876330.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c876330.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
--パワー·インジェクター
function c89547299.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(89547299,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c89547299.atkcost)
e1:SetTarget(c89547299.atktg)
e1:SetOperation(c89547299.atkop)
c:RegisterEffect(e1)
end
function c89547299.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,600) end
Duel.PayLPCost(tp,600)
end
function c89547299.filter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO)
end
function c89547299.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c89547299.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function c89547299.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c89547299.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--リバイバル·ギフト
function c93912845.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c93912845.target)
e1:SetOperation(c93912845.activate)
c:RegisterEffect(e1)
end
function c93912845.spfilter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c93912845.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c93912845.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c93912845.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsPlayerCanSpecialSummonMonster(tp,93912846,0,0x4011,1500,1500,3,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,1-tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c93912845.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c93912845.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2,true)
end
end
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,93912846,0,0x4011,1500,1500,3,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,1-tp) then
for i=1,2 do
local token=Duel.CreateToken(tp,93912846)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end
......@@ -44,7 +44,7 @@ function c94573223.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
......
--マッド·デーモン
function c94664694.initial_effect(c)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(94664694,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetTarget(c94664694.target)
e2:SetOperation(c94664694.operation)
c:RegisterEffect(e2)
end
function c94664694.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAttack() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c94664694.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsPosition(POS_FACEUP_ATTACK) then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
end
......@@ -22,8 +22,7 @@ function c95084054.initial_effect(c)
c:RegisterEffect(e3)
end
function c95084054.filter(c)
local lv=c:GetLevel()
return lv>0 and lv<=4 and c:IsFaceup() and c:IsRace(RACE_THUNDER)
return c:IsFaceup() and c:IsLevelBelow(4) and c:IsRace(RACE_THUNDER)
end
function c95084054.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c95084054.filter,1,nil)
......
......@@ -67,7 +67,7 @@ function c95090813.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c95090813.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......
......@@ -44,7 +44,7 @@ function c95395761.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c95395761.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c95395761.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
......
......@@ -23,7 +23,7 @@ end
function c95600067.reptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return false end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return false end
return Duel.SelectEffectYesNo(tp,c)
end
function c95600067.repoperation(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -40,7 +40,7 @@ function c95750695.filter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_DUAL)
end
function c95750695.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c95750695.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c95750695.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c95750695.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c95750695.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......@@ -63,7 +63,7 @@ end
function c95750695.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c95750695.spfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c95750695.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
......
......@@ -36,7 +36,7 @@ function c97904474.eqlimit(e,c)
end
function c97904474.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=c:GetBattleTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToBattle() then
Duel.Equip(tp,c,tc,true)
......
......@@ -42,7 +42,7 @@ function c99659159.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
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
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
......
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