Commit 7be98033 authored by Tachibana's avatar Tachibana

ndyd

parent 498381d4
...@@ -4,113 +4,110 @@ local cm=_G["c"..m] ...@@ -4,113 +4,110 @@ local cm=_G["c"..m]
cm.dfc_front_side=m cm.dfc_front_side=m
cm.dfc_back_side=m+2 cm.dfc_back_side=m+2
function c47510239.initial_effect(c) function c47510239.initial_effect(c)
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
--summon with 1 tribute --summon with 1 tribute
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47510239,0)) e1:SetDescription(aux.Stringid(47510239,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC) e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c47510239.otcon) e1:SetCondition(c47510239.otcon)
e1:SetOperation(c47510239.otop) e1:SetOperation(c47510239.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE) e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_SET_PROC) e2:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e2) c:RegisterEffect(e2)
-- --
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SUMMON_SUCCESS) e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetOperation(c47510239.thop) e4:SetOperation(c47510239.thop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47510239,2)) e1:SetDescription(aux.Stringid(47510239,2))
e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetRange(LOCATION_PZONE) e5:SetRange(LOCATION_PZONE)
e5:SetCode(EVENT_FREE_CHAIN) e5:SetCode(EVENT_FREE_CHAIN)
e5:SetCountLimit(1,47510240) e5:SetCountLimit(1,47510240)
e5:SetTarget(c47510239.sumtg) e5:SetTarget(c47510239.sumtg)
e5:SetOperation(c47510239.sumop) e5:SetOperation(c47510239.sumop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--Change --Change
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(47510239,3)) e6:SetDescription(aux.Stringid(47510239,3))
e6:SetType(EFFECT_TYPE_IGNITION) e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_MZONE) e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1,47510239) e6:SetCountLimit(1,47510239)
e6:SetCost(c47510239.chcost) e6:SetCost(c47510239.chcost)
e6:SetTarget(c47510239.changetg) e6:SetTarget(c47510239.changetg)
e6:SetOperation(c47510239.changeop) e6:SetOperation(c47510239.changeop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c47510239.otfilter(c) function c47510239.otfilter(c)
return c:IsType(TYPE_PENDULUM) return c:IsType(TYPE_PENDULUM)
end end
function c47510239.otcon(e,c,minc) function c47510239.otcon(e,c,minc)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return c:GetLevel()>4 and minc<=1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c47510239.otfilter,tp,LOCATION_PZONE,0,1,c,tp) return c:GetLevel()>4 and minc<=1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c47510239.otfilter,tp,LOCATION_PZONE,0,1,c,tp)
end end
function c47510239.otop(e,tp,eg,ep,ev,re,r,rp,c) function c47510239.otop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectMatchingCard(tp,c47510239.otfilter,tp,LOCATION_PZONE,0,1,1,c,tp) local sg=Duel.SelectMatchingCard(tp,c47510239.otfilter,tp,LOCATION_PZONE,0,1,1,c,tp)
c:SetMaterial(sg) c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL) Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end end
function c47510239.thfilter(c,e,tp,zone) function c47510239.thfilter(c,e,tp,zone)
return c:IsType(TYPE_PENDULUM) and c:IsLevelAbove(7) and c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT) return c:IsType(TYPE_PENDULUM) and c:IsLevelAbove(7) and c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT)
end end
function c47510239.thop(e,tp,eg,ep,ev,re,r,rp) function c47510239.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectMatchingCard(tp,c47510239.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c47510239.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end end
end end
end end
function c47510239.sumfilter(c) function c47510239.sumfilter(c)
return c:IsFacedown() or not c:IsRace(RACE_FAIRY) return c:IsFacedown() or not c:IsRace(RACE_FAIRY)
end end
function c47510239.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function c47510239.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1) end local minc,maxc=c:GetTributeRequirement()
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0) if chk==0 then return Duel.IsPlayerCanSummon(tp,SUMMON_TYPE_ADVANCE,c) and Duel.CheckTribute(c,minc,maxc) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,tp,LOCATION_PZONE)
end end
function c47510239.sumop(e,tp,eg,ep,ev,re,r,rp) function c47510239.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end local minc,maxc=c:GetTributeRequirement()
local pos=0 if not c:IsRelateToEffect(e) or not Duel.CheckTribute(c,minc,maxc) or not Duel.IsPlayerCanSummon(tp,SUMMON_TYPE_ADVANCE,c) then return end
if c:IsSummonable(true,nil,1) then pos=pos+POS_FACEUP_ATTACK end local SummonCheck=Duel.CheckTribute(c,minc,maxc)
if c:IsMSetable(true,nil,1) then pos=pos+POS_FACEDOWN_DEFENSE end if SummonCheck then
if pos==0 then return end Duel.Summon(tp,c,true,nil,1)
if Duel.SelectPosition(tp,c,pos)==POS_FACEUP_ATTACK then end
Duel.Summon(tp,c,true,nil,1)
else
Duel.MSet(tp,c,true,nil,1)
end
end end
function c47510239.chfilter(c) function c47510239.chfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsLevelAbove(7) and c:IsAbleToGraveAsCost() return c:IsRace(RACE_FAIRY) and c:IsLevelAbove(7) and c:IsAbleToGraveAsCost()
end end
function c47510239.chcost(e,tp,eg,ep,ev,re,r,rp,chk) function c47510239.chcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c47510239.chfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,2,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c47510239.chfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,2,nil) end
local g=Duel.SelectMatchingCard(tp,c47510239.chfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,2,2,nil) local g=Duel.SelectMatchingCard(tp,c47510239.chfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,2,2,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c47510239.changetg(e,tp,eg,ep,ev,re,r,rp,chk) function c47510239.changetg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c.dfc_back_side and c.dfc_front_side==c:GetOriginalCode() end if chk==0 then return c.dfc_back_side and c.dfc_front_side==c:GetOriginalCode() end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function c47510239.changeop(e,tp,eg,ep,ev,re,r,rp,chk) function c47510239.changeop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsImmuneToEffect(e) then return end if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsImmuneToEffect(e) then return end
local tcode=c.dfc_back_side local tcode=c.dfc_back_side
c:SetEntityCode(tcode,true) c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0) c:ReplaceEffect(tcode,0,0)
end end
\ No newline at end of file
--吉姆强袭型改 --吉姆强袭型改
function c47530026.initial_effect(c) function c47530026.initial_effect(c)
--pendulum summon --pendulum summon
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
--splimit --splimit
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetTarget(c47530026.psplimit) e1:SetTarget(c47530026.psplimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--summon --summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47530026,1)) e2:SetDescription(aux.Stringid(47530026,1))
e2:SetCategory(CATEGORY_SUMMON) e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetTarget(c47530026.sumtg) e2:SetTarget(c47530026.sumtg)
e2:SetOperation(c47530026.sumop) e2:SetOperation(c47530026.sumop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--spsummon proc --spsummon proc
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LIMIT_SUMMON_PROC) e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e1:SetCondition(c47530026.ttcon) e1:SetCondition(c47530026.ttcon)
e1:SetOperation(c47530026.ttop) e1:SetOperation(c47530026.ttop)
e1:SetValue(SUMMON_TYPE_ADVANCE) e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LIMIT_SET_PROC) e2:SetCode(EFFECT_LIMIT_SET_PROC)
e2:SetCondition(c47530026.setcon) e2:SetCondition(c47530026.setcon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--tribute check --tribute check
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE) e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_MATERIAL_CHECK) e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetValue(c47530026.valcheck) e5:SetValue(c47530026.valcheck)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--buff --buff
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE) e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e6:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e6:SetRange(LOCATION_MZONE) e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c47530026.advcon) e6:SetCondition(c47530026.advcon)
e6:SetValue(1) e6:SetValue(1)
c:RegisterEffect(e6) c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE) e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetCode(EFFECT_IMMUNE_EFFECT) e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetRange(LOCATION_MZONE) e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c47530026.advcon) e7:SetCondition(c47530026.advcon)
e7:SetValue(c47530026.efilter) e7:SetValue(c47530026.efilter)
c:RegisterEffect(e7) c:RegisterEffect(e7)
local e8=Effect.CreateEffect(c) local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE) e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetCode(EFFECT_EXTRA_ATTACK) e8:SetCode(EFFECT_EXTRA_ATTACK)
e8:SetRange(LOCATION_MZONE) e8:SetRange(LOCATION_MZONE)
e8:SetCondition(c47530026.advcon) e8:SetCondition(c47530026.advcon)
e8:SetValue(1) e8:SetValue(1)
c:RegisterEffect(e8) c:RegisterEffect(e8)
--actlimit --actlimit
local e9=Effect.CreateEffect(c) local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_FIELD) e9:SetType(EFFECT_TYPE_FIELD)
e9:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e9:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e9:SetCode(EFFECT_CANNOT_ACTIVATE) e9:SetCode(EFFECT_CANNOT_ACTIVATE)
e9:SetRange(LOCATION_MZONE) e9:SetRange(LOCATION_MZONE)
e9:SetTargetRange(0,1) e9:SetTargetRange(0,1)
e9:SetValue(c47530026.aclimit) e9:SetValue(c47530026.aclimit)
e9:SetCondition(c47530026.actcon) e9:SetCondition(c47530026.actcon)
c:RegisterEffect(e9) c:RegisterEffect(e9)
--remove --remove
local e10=Effect.CreateEffect(c) local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(47530026,0)) e10:SetDescription(aux.Stringid(47530026,0))
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetCode(EVENT_DAMAGE_STEP_END) e10:SetCode(EVENT_DAMAGE_STEP_END)
e10:SetCondition(c47530026.rmcon) e10:SetCondition(c47530026.rmcon)
e10:SetOperation(c47530026.rmop) e10:SetOperation(c47530026.rmop)
c:RegisterEffect(e10) c:RegisterEffect(e10)
end end
function c47530026.IsEFSF(c) function c47530026.IsEFSF(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
return m and m.is_named_with_EFSF return m and m.is_named_with_EFSF
end end
function c47530026.rmcon(e,tp,eg,ep,ev,re,r,rp) function c47530026.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
e:SetLabelObject(bc) e:SetLabelObject(bc)
return c==Duel.GetAttacker() and bc and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle() return c==Duel.GetAttacker() and bc and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle()
end end
function c47530026.rmop(e,tp,eg,ep,ev,re,r,rp) function c47530026.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local bc=e:GetLabelObject() local bc=e:GetLabelObject()
local atk1=bc:GetAttack() local atk1=bc:GetAttack()
local atk2=c:GetAttack() local atk2=c:GetAttack()
local atk=atk1+atk2 local atk=atk1+atk2
if bc:IsRelateToBattle() then if bc:IsRelateToBattle() then
local lp=Duel.GetLP(1-tp) local lp=Duel.GetLP(1-tp)
Duel.SetLP(1-tp,lp-atk) Duel.SetLP(1-tp,lp-atk)
end end
end end
function c47530026.aclimit(e,re,tp) function c47530026.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e) return not re:GetHandler():IsImmuneToEffect(e)
end end
function c47530026.actcon(e) function c47530026.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() and e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE) return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() and e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end end
function c47530026.efilter(e,te) function c47530026.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) return te:IsActiveType(TYPE_MONSTER) and te:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
end end
function c47530026.advcon(e,tp,eg,ep,ev,re,r,rp) function c47530026.advcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE) return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end end
function c47530026.psplimit(e,c) function c47530026.psplimit(e,c)
return not c:IsRace(RACE_MACHINE) return not c:IsRace(RACE_MACHINE)
end end
function c47530026.setfilter(c) function c47530026.setfilter(c)
return c47530026.IsEFSF(c) and (c:IsType(TYPE_TRAP) or c:IsType(TYPE_SPELL)) return c47530026.IsEFSF(c) and (c:IsType(TYPE_TRAP) or c:IsType(TYPE_SPELL))
end end
function c47530026.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function c47530026.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsSummonable(true,nil,1) and Duel.IsExistingMatchingCard(c47530026.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end local minc,maxc=c:GetTributeRequirement()
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0) if chk==0 then return Duel.IsPlayerCanSummon(tp,SUMMON_TYPE_ADVANCE,c) and Duel.CheckTribute(c,minc,maxc) and Duel.IsExistingMatchingCard(c47530026.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0)
end end
function c47530026.sumop(e,tp,eg,ep,ev,re,r,rp) function c47530026.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end local minc,maxc=c:GetTributeRequirement()
if Duel.Summon(tp,c,true,nil,1)~=0 then if not c:IsRelateToEffect(e) or not Duel.CheckTribute(c,minc,maxc) or not Duel.IsPlayerCanSummon(tp,SUMMON_TYPE_ADVANCE,c) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) if Duel.Summon(tp,c,true,nil,1)~=0 then
local g=Duel.SelectMatchingCard(tp,c47530026.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,false) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
if g:GetCount()>0 then local g=Duel.SelectMatchingCard(tp,c47530026.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,false)
Duel.SSet(tp,g:GetFirst()) if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g) Duel.SSet(tp,g:GetFirst())
end Duel.ConfirmCards(1-tp,g)
end end
end
end end
function c47530026.otfilter(c) function c47530026.otfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA and c:IsRace(RACE_MACHINE) return c:GetSummonLocation()==LOCATION_EXTRA and c:IsRace(RACE_MACHINE)
end end
function c47530026.ttcon(e,c,minc) function c47530026.ttcon(e,c,minc)
if c==nil then return true end if c==nil then return true end
local mg=Duel.GetMatchingGroup(c47530026.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil) local mg=Duel.GetMatchingGroup(c47530026.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
return c:IsLevelAbove(7) and minc<=2 and Duel.CheckTribute(c,2,2,mg) return c:IsLevelAbove(7) and minc<=2 and Duel.CheckTribute(c,2,2,mg)
end end
function c47530026.ttop(e,tp,eg,ep,ev,re,r,rp,c) function c47530026.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c47530026.otfilter,0,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(c47530026.otfilter,0,LOCATION_MZONE,0,nil)
local sg=Duel.SelectTribute(tp,c,2,2,mg) local sg=Duel.SelectTribute(tp,c,2,2,mg)
c:SetMaterial(sg) c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL) Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end end
function c47530026.setcon(e,c,minc) function c47530026.setcon(e,c,minc)
if not c then return true end if not c then return true end
return false return false
end end
function c47530026.valcheck(e,c) function c47530026.valcheck(e,c)
local g=c:GetMaterial() local g=c:GetMaterial()
local tc=g:GetFirst() local tc=g:GetFirst()
local atk=0 local atk=0
local def=0 local def=0
while tc do while tc do
local catk=tc:GetTextAttack() local catk=tc:GetTextAttack()
local cdef=tc:GetTextDefense() local cdef=tc:GetTextDefense()
atk=atk+(catk>=0 and catk or 0) atk=atk+(catk>=0 and catk or 0)
def=def+(cdef>=0 and cdef or 0) def=def+(cdef>=0 and cdef or 0)
tc=g:GetNext() tc=g:GetNext()
end end
if e:GetLabel()==1 then if e:GetLabel()==1 then
e:SetLabel(0) e:SetLabel(0)
--atk continuous effect --atk continuous effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk) e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000) e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--def continuous effect --def continuous effect
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(def) e2:SetValue(def)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
end end
\ No newline at end of file
function c47530027.initial_effect(c) function c47530027.initial_effect(c)
--pendulum summon --pendulum summon
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
--splimit --splimit
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetTarget(c47530027.psplimit) e1:SetTarget(c47530027.psplimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--summon --summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47530027,1)) e2:SetDescription(aux.Stringid(47530027,1))
e2:SetCategory(CATEGORY_SUMMON) e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetTarget(c47530027.sumtg) e2:SetTarget(c47530027.sumtg)
e2:SetOperation(c47530027.sumop) e2:SetOperation(c47530027.sumop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--spsummon proc --spsummon proc
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(47530027,0)) e3:SetDescription(aux.Stringid(47530027,0))
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_SUMMON_PROC) e3:SetCode(EFFECT_SUMMON_PROC)
e3:SetValue(SUMMON_TYPE_ADVANCE) e3:SetValue(SUMMON_TYPE_ADVANCE)
e3:SetCondition(c47530027.otcon) e3:SetCondition(c47530027.otcon)
e3:SetOperation(c47530027.otop) e3:SetOperation(c47530027.otop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=e3:Clone() local e4=e3:Clone()
e4:SetCode(EFFECT_SET_PROC) e4:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--tribute check --tribute check
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE) e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_MATERIAL_CHECK) e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetValue(c47530027.valcheck) e5:SetValue(c47530027.valcheck)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--buff --buff
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE) e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e6:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e6:SetRange(LOCATION_MZONE) e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c47530027.advcon) e6:SetCondition(c47530027.advcon)
e6:SetValue(1) e6:SetValue(1)
c:RegisterEffect(e6) c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE) e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetCode(EFFECT_IMMUNE_EFFECT) e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetRange(LOCATION_MZONE) e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c47530027.advcon) e7:SetCondition(c47530027.advcon)
e7:SetValue(c47530027.efilter) e7:SetValue(c47530027.efilter)
c:RegisterEffect(e7) c:RegisterEffect(e7)
local e8=Effect.CreateEffect(c) local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE) e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetCode(EFFECT_EXTRA_ATTACK) e8:SetCode(EFFECT_EXTRA_ATTACK)
e8:SetRange(LOCATION_MZONE) e8:SetRange(LOCATION_MZONE)
e8:SetCondition(c47530027.advcon) e8:SetCondition(c47530027.advcon)
e8:SetValue(1) e8:SetValue(1)
c:RegisterEffect(e8) c:RegisterEffect(e8)
--actlimit --actlimit
local e9=Effect.CreateEffect(c) local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_FIELD) e9:SetType(EFFECT_TYPE_FIELD)
e9:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e9:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e9:SetCode(EFFECT_CANNOT_ACTIVATE) e9:SetCode(EFFECT_CANNOT_ACTIVATE)
e9:SetRange(LOCATION_MZONE) e9:SetRange(LOCATION_MZONE)
e9:SetTargetRange(0,1) e9:SetTargetRange(0,1)
e9:SetValue(c47530027.aclimit) e9:SetValue(c47530027.aclimit)
e9:SetCondition(c47530027.actcon) e9:SetCondition(c47530027.actcon)
c:RegisterEffect(e9) c:RegisterEffect(e9)
--remove --remove
local e10=Effect.CreateEffect(c) local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(47530027,0)) e10:SetDescription(aux.Stringid(47530027,0))
e10:SetCategory(CATEGORY_REMOVE) e10:SetCategory(CATEGORY_REMOVE)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetCode(EVENT_BATTLE_START) e10:SetCode(EVENT_BATTLE_START)
e10:SetCondition(c47530027.descon) e10:SetCondition(c47530027.descon)
e10:SetTarget(c47530027.destg) e10:SetTarget(c47530027.destg)
e10:SetOperation(c47530027.desop) e10:SetOperation(c47530027.desop)
c:RegisterEffect(e10) c:RegisterEffect(e10)
end end
function c47530027.IsZEON(c) function c47530027.IsZEON(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
return m and m.is_named_with_ZEON return m and m.is_named_with_ZEON
end end
function c47530027.descon(e,tp,eg,ep,ev,re,r,rp) function c47530027.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
return c:IsDualState() and Duel.GetAttacker()==c return c:IsDualState() and Duel.GetAttacker()==c
and bc and bc:IsSummonType(SUMMON_TYPE_SPECIAL) and bc:IsAbleToRemove() and bc and bc:IsSummonType(SUMMON_TYPE_SPECIAL) and bc:IsAbleToRemove()
end end
function c47530027.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c47530027.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler():GetBattleTarget(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler():GetBattleTarget(),1,0,0)
end end
function c47530027.desop(e,tp,eg,ep,ev,re,r,rp) function c47530027.desop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget() local bc=e:GetHandler():GetBattleTarget()
if bc:IsRelateToBattle() and Duel.GetControl(bc,tp)==0 then if bc:IsRelateToBattle() and Duel.GetControl(bc,tp)==0 then
local atk=bc:GetAttack() local atk=bc:GetAttack()
local lp=Duel.GetLP(1-tp) local lp=Duel.GetLP(1-tp)
Duel.SetLP(1-tp,lp-atk) Duel.SetLP(1-tp,lp-atk)
end end
end end
function c47530027.aclimit(e,re,tp) function c47530027.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e) return not re:GetHandler():IsImmuneToEffect(e)
end end
function c47530027.actcon(e) function c47530027.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() and e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE) return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() and e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end end
function c47530027.efilter(e,te) function c47530027.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) return te:IsActiveType(TYPE_MONSTER) and te:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
end end
function c47530027.advcon(e,tp,eg,ep,ev,re,r,rp) function c47530027.advcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE) return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end end
function c47530027.psplimit(e,c) function c47530027.psplimit(e,c)
return not c:IsRace(RACE_MACHINE) return not c:IsRace(RACE_MACHINE)
end end
function c47530027.setfilter(c) function c47530027.setfilter(c)
return c47530027.IsZEON(c) and c:IsType(TYPE_TRAP) and c:IsType(TYPE_COUNTER) and c:IsSSetable() return c47530027.IsZEON(c) and c:IsType(TYPE_TRAP) and c:IsType(TYPE_COUNTER) and c:IsSSetable()
end end
function c47530027.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function c47530027.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsSummonable(true,nil,1) and Duel.IsExistingMatchingCard(c47530027.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end local minc,maxc=c:GetTributeRequirement()
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0) if chk==0 then return Duel.IsPlayerCanSummon(tp,SUMMON_TYPE_ADVANCE,c) and Duel.CheckTribute(c,minc,maxc) and Duel.IsExistingMatchingCard(c47530027.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0)
end end
function c47530027.sumop(e,tp,eg,ep,ev,re,r,rp) function c47530027.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end local minc,maxc=c:GetTributeRequirement()
if Duel.Summon(tp,c,true,nil,1)~=0 then if not c:IsRelateToEffect(e) or not Duel.CheckTribute(c,minc,maxc) or not Duel.IsPlayerCanSummon(tp,SUMMON_TYPE_ADVANCE,c) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) if Duel.Summon(tp,c,true,nil,1)~=0 then
local g=Duel.SelectMatchingCard(tp,c47530027.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,false) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
if g:GetCount()>0 then local g=Duel.SelectMatchingCard(tp,c47530027.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,false)
Duel.SSet(tp,g:GetFirst()) if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g) Duel.SSet(tp,g:GetFirst())
end Duel.ConfirmCards(1-tp,g)
end end
end
end end
function c47530027.otfilter(c) function c47530027.otfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA and c:IsRace(RACE_MACHINE) return c:GetSummonLocation()==LOCATION_EXTRA and c:IsRace(RACE_MACHINE)
end end
function c47530027.otcon(e,c,minc) function c47530027.otcon(e,c,minc)
if c==nil then return true end if c==nil then return true end
local mg=Duel.GetMatchingGroup(c47530027.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil) local mg=Duel.GetMatchingGroup(c47530027.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
return c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg) return c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
end end
function c47530027.otop(e,tp,eg,ep,ev,re,r,rp,c) function c47530027.otop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c47530027.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil) local mg=Duel.GetMatchingGroup(c47530027.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
local sg=Duel.SelectTribute(tp,c,1,1,mg) local sg=Duel.SelectTribute(tp,c,1,1,mg)
c:SetMaterial(sg) c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL) Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end end
function c47530027.valcheck(e,c) function c47530027.valcheck(e,c)
local g=c:GetMaterial() local g=c:GetMaterial()
local tc=g:GetFirst() local tc=g:GetFirst()
local atk=0 local atk=0
local def=0 local def=0
while tc do while tc do
local catk=tc:GetTextAttack() local catk=tc:GetTextAttack()
local cdef=tc:GetTextDefense() local cdef=tc:GetTextDefense()
atk=atk+(catk>=0 and catk or 0) atk=atk+(catk>=0 and catk or 0)
def=def+(cdef>=0 and cdef or 0) def=def+(cdef>=0 and cdef or 0)
tc=g:GetNext() tc=g:GetNext()
end end
if e:GetLabel()==1 then if e:GetLabel()==1 then
e:SetLabel(0) e:SetLabel(0)
--atk continuous effect --atk continuous effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk) e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000) e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--def continuous effect --def continuous effect
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(def) e2:SetValue(def)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
end end
\ No newline at end of file
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