Commit e1ea8867 authored by POLYMER's avatar POLYMER

fix

parent 4fe1edcd
......@@ -6009,9 +6009,6 @@
87402378 0
87402379 0
32909498 0
33590040 0
33590080 0
33591000 0
89478001 0
89478011 0
89478021 0
......
No preview for this file type
local m=33590000
local cm=_G["c"..m]
function cm.initial_effect(c)
---Draw and Back
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.backcon)
e1:SetCost(cm.backcost)
e1:SetTarget(cm.backtg)
e1:SetOperation(cm.backop)
c:RegisterEffect(e1)
--Draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.drawcon)
e2:SetCost(cm.drawcost)
e2:SetTarget(cm.drawtg)
e2:SetOperation(cm.drawop)
c:RegisterEffect(e2)
end
function cm.backcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
local g1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
if g>g1 then
e:SetLabel(g-g1)
end
return g>g1
end
function cm.backcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function cm.backtg(e,tp,eg,ep,ev,re,r,rp,chk)
local nb=e:GetLabel()
if chk==0 then return Duel.IsPlayerCanDraw(tp,nb)
end
end
function cm.backop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local nb=e:GetLabel()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
if Duel.Draw(tp,nb,REASON_EFFECT)==0 then return end
Duel.ShuffleHand(tp)
Duel.SendtoGrave(c,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,nb,nb,nil)
if nb>0 then
Duel.BreakEffect()
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
end
function cm.drawcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
local g1=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
return g>g1
end
function cm.refilter(c,e,tp)
return c:IsCode(m) and c:IsAbleToRemoveAsCost()
end
function cm.drawcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.refilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.IsPlayerCanRemove(tp,c,REASON_COST) end
local nb=Duel.Remove(g,POS_FACEDOWN,REASON_COST)
e:SetLabel(nb)
end
function cm.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
local nb=e:GetLabel()
if chk==0 then return Duel.IsPlayerCanDraw(tp,nb) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,nb)
end
function cm.drawop(e,tp,eg,ep,ev,re,r,rp)
local nb=e:GetLabel()
Duel.Draw(tp,nb,REASON_EFFECT)
end
\ No newline at end of file
local m=33590040
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP,EVENT_SPSUMMON_SUCCESS)
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e0:SetRange(LOCATION_DECK)
e0:SetCountLimit(1,m)
e0:SetCode(EVENT_BATTLE_CONFIRM)
e0:SetCondition(cm.spcon)
e0:SetTarget(cm.sptg)
e0:SetOperation(cm.spop)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+1)
e1:SetCost(cm.secost)
e1:SetTarget(cm.setg)
e1:SetOperation(cm.seop)
--c:RegisterEffect(e1)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()==0 then return false end
local tg=g:GetMaxGroup(Card.GetAttack)
local ac=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
e:SetLabelObject(bc)
return bc and bc:IsControler(1-tp) and ac:IsControler(tp) and bc:GetAttack()>ac:GetAttack() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tg:IsExists(Card.IsControler,1,nil,1-tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=e:GetLabelObject()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_ATTACK)~=0 and bc then
Duel.BreakEffect()
Duel.CalculateDamage(c,bc)
end
end
function cm.secost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToHand() and c:IsLevelAbove(7)
end
function cm.setg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.seop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if not tc then return end
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.sumlimit)
e1:SetLabel(tc:GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetValue(cm.aclimit)
Duel.RegisterEffect(e4,tp)
end
end
function cm.sumlimit(e,c)
return c:IsCode(e:GetLabel())
end
function cm.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel()) and re:IsActiveType(TYPE_MONSTER)
end
\ No newline at end of file
local m=33590045
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(m)
e0:SetRange(LOCATION_PZONE)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,0)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetRange(LOCATION_PZONE)
--e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetCondition(cm.pspcon)
e1:SetOperation(cm.countop)
c:RegisterEffect(e1)
--if not cm.global_check then
--cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetRange(0x7F)
ge1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
ge1:SetCondition(cm.checkcon)
ge1:SetOperation(cm.checkop)
c:RegisterEffect(ge1)
--end
--no damage
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(cm.ndcon)
e5:SetValue(1)
c:RegisterEffect(e5)
--battle indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetCondition(cm.indcon)
c:RegisterEffect(e2)
--reflect battle damage
local e3=e2:Clone()
e3:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_EQUIP)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,m) then return end
return Duel.IsExistingMatchingCard(cm.pspfilter2,tp,0x7F,0,1,nil)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.pspfilter2,tp,0x7F,0,nil)
if g:GetCount()<1 then return end
local tc=g:GetFirst()
while tc do
if Duel.IsPlayerAffectedByEffect(tp,m) then return end
local mt=getmetatable(tc)
if loc==0x02 then loc=nil end
mt.psummonable_location=loc
tc:ResetFlagEffect(m)
tc=g:GetNext()
end
end
function cm.pspfilter(c)
return c:IsType(TYPE_RITUAL) and c:GetFlagEffect(m)==0 and not c:IsHasEffect(EFFECT_SPSUMMON_CONDITION)
end
function cm.pspfilter2(c)
return c:IsType(TYPE_RITUAL) and c:GetFlagEffect(m)~=0 and not Duel.IsPlayerAffectedByEffect(c:GetControler(),m)
end
function cm.pspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.pspfilter,tp,LOCATION_HAND,0,1,nil) and Duel.IsPlayerAffectedByEffect(tp,m)
end
function cm.countop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.pspfilter,tp,LOCATION_HAND,0,nil)
if g:GetCount()<1 or not Duel.IsPlayerAffectedByEffect(tp,m) then return end
local tc=g:GetFirst()
while tc do
if tc:IsStatus(STATUS_COPYING_EFFECT) or not Duel.IsPlayerAffectedByEffect(tp,m) then return end
tc:EnableReviveLimit()
local mt=getmetatable(tc)
if loc==nil then loc=0x02 end
mt.psummonable_location=loc
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
--e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetOperation(Auxiliary.PSSCompleteProcedure)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,0,0,1)
tc=g:GetNext()
end
end
function cm.ndcon(e)
return e:GetHandler():GetEquipCount()==0
end
function cm.indcon(e)
return e:GetHandler():GetEquipCount()>0
end
function cm.thfilter(c)
return c:IsSetCard(0x18d) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
local m=33590061
local cm=_G["c"..m]
function cm.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:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function Card.GetTypeEffect(c,code)
local cp={}
local func=Card.RegisterEffect
Card.RegisterEffect=function(c,e,f)
if e:GetCode()==code then
table.insert(cp,e:Clone())
end
return func(c,e,f)
end
Duel.CreateToken(0,c:GetOriginalCode())
Card.RegisterEffect=func
return cp
end
function table_leng(t)
local leng=0
for k,v in pairs(t) do
leng=leng+1
end
return leng
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
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) and g:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.filter(c)
return c:CheckUniqueOnField(tp,LOCATION_SZONE) and not c:IsForbidden() and c:IsSetCard(0x4a) and c:IsLevel(10)
end
function cm.filter1(c,ec)
return c:GetEquipTarget()==ec
end
function cm.filter2(c)
return c:IsSetCard(0x4a)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if not tc:IsRelateToEffect(e) or g:GetCount()<1 then return end
Duel.ConfirmCards(tp,g)
local g2=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_DECK,nil)
local seq=Duel.GetLocationCount(tp,LOCATION_SZONE)
if g2:GetCount()>0 and seq>0 then
local sg=g2:SelectSubGroup(tp,aux.dncheck,false,1,seq)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=sg:GetFirst()
while ec do
Duel.Equip(tp,ec,tc)
--equip limit
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetLabelObject(tc)
e1:SetValue(cm.eqlimit)
ec:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e2)
ec=sg:GetNext()
end
local e6=Effect.CreateEffect(e:GetHandler())
e6:SetCategory(CATEGORY_DAMAGE)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_PHASE+PHASE_BATTLE)
e6:SetCountLimit(1)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(cm.effcon)
e6:SetTarget(cm.damtg)
e6:SetCost(cm.effcost)
e6:SetOperation(cm.effop)
tc:RegisterEffect(e6)
end
end
function cm.eqlimit(e,c)
return c==e:GetLabelObject()
end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroupCount()>0
end
function cm.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEquipGroup():IsExists(Card.IsAbleToGraveAsCost,1,nil) and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=e:GetHandler():GetEquipGroup():FilterSelect(tp,cm.filter2,1,1,nil)
local tc=g:GetFirst()
e:SetLabelObject(tc)
--local seq=tc:GetSequence()
Duel.MoveToField(tc,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,1000)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local p1,d1=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p1,d1,REASON_EFFECT)
local tc=e:GetLabelObject()
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
local ae=tc:GetTypeEffect(EVENT_PHASE+PHASE_BATTLE)
if table_leng(tc:GetTypeEffect(EVENT_PHASE+PHASE_BATTLE))~=0 then
Duel.BreakEffect()
local tg=ae[1]:GetTarget()
local op=ae[1]:GetOperation()
tg(e,tp,eg,ep,ev,re,r,rp)
op(e,tp,eg,ep,ev,re,r,rp)
end
end
end
\ No newline at end of file
local m=33590075
local cm=_G["c"..m]
function cm.initial_effect(c)
--pb
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
--e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
--e1:SetCost(cm.tgcost)
--e1:SetTarget(cm.tgtg)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetCondition(cm.pbcon2)
e1:SetOperation(cm.pbop)
c:RegisterEffect(e1)
--disable field
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EFFECT_DISABLE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
--e2:SetTargetRange(1,0)
e2:SetCondition(cm.pbcon)
--e2:SetValue(0x7f)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_RECOVER)
e3:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.pbcon3)
e3:SetTarget(cm.tgtg)
e3:SetOperation(cm.tgop)
c:RegisterEffect(e3)
--maintain
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetRange(LOCATION_HAND)
e5:SetCountLimit(1)
e5:SetCondition(cm.pbcon)
e5:SetOperation(cm.mtop)
c:RegisterEffect(e5)
end
function cm.tgfilter(c)
return c:GetSequence()<5
end
function cm.pbcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not c:IsPublic()
end
function cm.pbop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local fid=c:GetFieldID()
c:RegisterFlagEffect(9822220,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,fid,66)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local sg=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_MZONE,0,nil)
if sg:GetCount()>0 then
Duel.SendtoGrave(sg,REASON_RULE)
end
end
function cm.pbcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPublic()
end
function cm.disop(e,tp)
return 0x1f
end
function cm.pbcon3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPublic() and (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local atk=sg:GetFirst():GetBaseAttack()
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.Recover(tp,atk,REASON_EFFECT)
end
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsAbleToRemove(tp,POS_FACEDOWN) then
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
return
end
if Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
else
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
local lp1=Duel.GetLP(tp)
local lp2=Duel.GetLP(1-tp)
Duel.SetLP(tp,lp2)
Duel.SetLP(1-tp,lp1)
end
end
\ No newline at end of file
local m=33590078
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCode(EVENT_FREE_CHAIN)
--e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
--e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--cost
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,1))
e2:SetCost(cm.cost)
e2:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
c:RegisterEffect(e2)
end
function cm.tfilter(c,lv)
return c:IsLevelAbove(5) and c:IsLevelAbove(lv) and c:IsAbleToHand()
end
function cm.filter(c,e,tp)
local lv=c:GetLevel()
return c:IsFaceup() and lv>0 and Duel.IsExistingMatchingCard(cm.tfilter,tp,LOCATION_DECK,0,1,nil,lv)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
e:SetLabel(g:GetFirst():GetLevel())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local lv=e:GetLabel()
local g=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_DECK,0,1,1,nil,lv)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY,2)
tc:RegisterFlagEffect(9822220,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY,EFFECT_FLAG_CLIENT_HINT,2,fid,66)
else
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY)
tc:RegisterFlagEffect(9822220,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY,EFFECT_FLAG_CLIENT_HINT,1,fid,66)
end
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY,2)
else
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY)
end
e2:SetCondition(cm.discon)
tc:RegisterEffect(e2)
--cannot attack
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetRange(LOCATION_HAND)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(cm.atkcon)
e3:SetTarget(cm.atktarget)
tc:RegisterEffect(e3)
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)>Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil) and c:IsPublic()
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPublic() and c:IsLocation(LOCATION_HAND)
end
function cm.atktarget(e,c)
local tc=e:GetHandler()
return c:GetAttack()<tc:GetAttack()
end
function cm.rfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>1 and (c:IsControler(tp) or c:IsFaceup())
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.rfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,cm.rfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
\ No newline at end of file
local m=33590080
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),6,2,cm.ovfilter2,aux.Stringid(m,0))
c:EnableReviveLimit()
--special summon
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetRange(LOCATION_EXTRA)
e0:SetCountLimit(1,m)
e0:SetCondition(cm.spcon)
e0:SetTarget(cm.sptg)
e0:SetOperation(cm.spop)
c:RegisterEffect(e0)
--[[--up atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.atkval)
c:RegisterEffect(e1)]]
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SEND_REPLACE)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
c:RegisterEffect(e2)
local g=Group.CreateGroup()
g:KeepAlive()
e2:SetLabelObject(g)
--[[--Position
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
--e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e3:SetRange(LOCATION_MZONE)
e3:SetCategory(CATEGORY_POSITION+CATEGORY_ATKCHANGE)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.poscon)
e3:SetCost(cm.poscost)
e3:SetTarget(cm.postg)
e3:SetOperation(cm.posop)
c:RegisterEffect(e3)]]
--indes
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
--e4:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE)
e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e4:SetCountLimit(1,m+1)
e4:SetCondition(cm.incon)
e4:SetCost(cm.incost)
e4:SetOperation(cm.inop)
c:RegisterEffect(e4)
--atk/def gain
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetCode(EFFECT_UPDATE_DEFENSE)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(cm.value)
c:RegisterEffect(e5)
end
function StarFlow(x,y)
local t=0
if x==nil then x=0 end
if y==nil then y=0 end
if x>=y then
t=x
else
t=y
end
if t==0 then return 0 end
local sf=((x-y)/t)
local formatted_num = string.format("%.2f",sf)
local num = tonumber(formatted_num)*100
return num
end
function cm.ovfilter2(c)
local tp=c:GetControler()
local x=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetAttack)
local y=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetAttack)
local sf=StarFlow(x,y)
return c:IsFaceup() and c:GetAttack()>=(1800) and sf<=-25
end
function cm.ovfilter(c)
return c:IsFaceup() and c:GetAttack()>=(1800) and c:IsCanBeXyzMaterial(c)
end
--[[function cm.atkval(e,c)
return c:GetOverlayCount()*200
end]]
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
local c=e:GetHandler()
local tp=c:GetControler()
local x=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetAttack)
local y=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetAttack)
local sf=StarFlow(x,y)
return Duel.GetTurnPlayer()~=tp and sf<=-25 and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and aux.dscon()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.ovfilter,tp,LOCATION_MZONE,0,1,nil) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<0 or not Duel.IsExistingMatchingCard(cm.ovfilter,tp,LOCATION_MZONE,0,1,nil) then return end
local g=Duel.SelectMatchingCard(tp,cm.ovfilter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(c,mg)
end
c:SetMaterial(Group.FromCards(tc))
Duel.Overlay(c,Group.FromCards(tc))
Duel.SpecialSummon(c,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
c:CompleteProcedure()
end
function cm.repfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_BATTLE) and c:IsCanOverlay(tp) and c:GetDestination()==LOCATION_GRAVE
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE) and eg:IsExists(cm.repfilter,1,nil,tp) end
local g=eg:Filter(cm.repfilter,nil,tp,tp)
local tc=g:GetFirst()
local container=e:GetLabelObject()
container:Clear()
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
container:AddCard(tc)
return true
end
function cm.repval(e,c)
return e:GetLabelObject():IsContains(c)
end
--[[function cm.poscon(e,tp,eg,ep,ev,re,r,rp)
local x=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetAttack)
local y=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetAttack)
local sf=StarFlow(x,y)
return sf<=25
end
function cm.sefilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsCanTurnSet() end
if chk==0 then return Duel.IsExistingTarget(cm.sefilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.sefilter,tp,0,LOCATION_MZONE,1,1,nil)
end
function cm.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end]]
function cm.incost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local ct=Duel.GetOperatedGroup():GetFirst()
e:SetLabelObject(ct)
end
function cm.incon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local x=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetAttack)
local y=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetAttack)
local sf=StarFlow(x,y)
return bc and bc:IsControler(1-tp) and sf<=25
end
function cm.inop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=c:GetBattleTarget()
local ct=e:GetLabelObject()
--if not dc:IsRelateToEffect(e) then return end
if ct:IsType(TYPE_MONSTER) then
local atk=ct:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
else
local atk=dc:GetBaseAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(atk/2)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e3)
end
end
function cm.value(e,c)
local sc=e:GetHandler()
local tp=sc:GetControler()
local x=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetAttack)
local y=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetAttack)
local sf=StarFlow(x,y)
return sf*10
end
\ No newline at end of file
local m=33591000
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),6,2,cm.ovfilter2,aux.Stringid(m,0))
c:EnableReviveLimit()
--special summon
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetRange(LOCATION_EXTRA)
e0:SetCountLimit(1,m)
e0:SetCondition(cm.spcon)
e0:SetTarget(cm.sptg)
e0:SetOperation(cm.spop)
c:RegisterEffect(e0)
--cannot release
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetValue(1)
c:RegisterEffect(e1)
local e5=e1:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
--e2:SetCountLimit(1,m)
e2:SetCondition(cm.necon)
e2:SetCost(cm.necost)
e2:SetTarget(cm.netg)
e2:SetOperation(cm.neop)
c:RegisterEffect(e2)
--atk/def gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(cm.value)
c:RegisterEffect(e2)
end
function StarFlow(x,y)
local t=0
if x==nil then x=0 end
if y==nil then y=0 end
if x>=y then
t=x
else
t=y
end
if t==0 then return 0 end
local sf=((x-y)/t)
local formatted_num = string.format("%.2f",sf)
local num = tonumber(formatted_num)*100
return num
end
function cm.ovfilter2(c)
local tp=c:GetControler()
local x=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetAttack)
local y=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetAttack)
local sf=StarFlow(x,y)
return c:IsFaceup() and c:GetAttack()>=(2500) and sf<=25
end
function cm.ovfilter(c)
return c:IsFaceup() and c:GetAttack()>=(2500) and c:IsCanBeXyzMaterial(c)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
local c=e:GetHandler()
local tp=c:GetControler()
local x=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetAttack)
local y=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetAttack)
local sf=StarFlow(x,y)
return Duel.GetTurnPlayer()~=tp and sf<=25 and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.ovfilter,tp,LOCATION_MZONE,0,1,nil) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<0 or not Duel.IsExistingMatchingCard(cm.ovfilter,tp,LOCATION_MZONE,0,1,nil) then return end
local g=Duel.SelectMatchingCard(tp,cm.ovfilter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(c,mg)
end
c:SetMaterial(Group.FromCards(tc))
Duel.Overlay(c,Group.FromCards(tc))
Duel.SpecialSummon(c,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
c:CompleteProcedure()
end
function cm.necon(e,tp,eg,ep,ev,re,r,rp)
local x=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetAttack)
local y=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetAttack)
local sf=StarFlow(x,y)
local g=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_MZONE,0,e:GetHandler())
if #g<1 then return end
local oatk=re:GetHandler():GetAttack()
local satk=g:GetSum(Card.GetAttack)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and re:GetActivateLocation()==LOCATION_MZONE and satk>=oatk and sf<=50
end
function cm.costfilter(c,satk,oatk2)
local oatk=c:GetAttack()
return c:IsReleasable()
end
function cm.necost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_MZONE,0,e:GetHandler())
if #g<1 then return end
local oatk=re:GetHandler():GetAttack()
if oatk<=0 then
if chk==0 then return true end
local g3=Duel.SelectReleaseGroup(tp,Card.IsReleasable,1,1,nil)
Duel.Release(g3,REASON_COST)
else
local satk=g:GetSum(Card.GetAttack)
if chk==0 then return satk>=oatk end
local g2=g:SelectWithSumGreater(tp,Card.GetAttack,oatk)
Duel.Release(g2,REASON_COST)
end
end
function cm.netg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function cm.neop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
c:RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Destroy(rc,REASON_EFFECT)
end
end
function cm.value(e,c)
local sc=e:GetHandler()
local tp=sc:GetControler()
local x=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetAttack)
local y=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetAttack)
local sf=StarFlow(x,y)
return sf*10
end
\ No newline at end of file
--不知道
function c33591008.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,33591008+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c33591008.actg)
e1:SetOperation(c33591008.acop)
c:RegisterEffect(e1)
end
function c33591008.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) end
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,0,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(c33591008.chlimit)
end
end
function c33591008.chlimit(e,ep,tp)
return not (e:GetHandler():IsOnField() and e:GetHandler():IsFacedown())
end
function c33591008.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
local code=Duel.AnnounceCard(tp)
Duel.ConfirmCards(tp,tc)
if tc:IsCode(code) then
if Duel.Destroy(tc,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(33591008,0)) then
local sc=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,0,LOCATION_SZONE,1,1,nil):GetFirst()
local scode=Duel.AnnounceCard(tp)
Duel.ConfirmCards(tp,sc)
if sc:IsCode(scode) then
Duel.Destroy(sc,REASON_EFFECT)
else
Duel.PayLPCost(tp,1000)
end
end
else
Duel.PayLPCost(tp,1000)
end
end
end
sNo(tp,aux.Stringid(33591008,0)) then
local sc=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,0,LOCATION_SZONE,1,1,nil):GetFirst()
local scode=Duel.AnnounceCard(tp)
Duel.ConfirmCards(tp,sc)
if sc:IsCode(scode) then
Duel.Destroy(sc,REASON_EFFECT)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x17a0000)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x17a0000)
sc:RegisterEffect(e2)
else
Duel.PayLPCost(tp,1000)
end
end
end
else
Duel.PayLPCost(tp,1000)
end
end
end
......@@ -30,22 +30,20 @@ function c75075604.initial_effect(c)
e2:SetTarget(c75075604.postg)
e2:SetOperation(c75075604.posop)
c:RegisterEffect(e2)
--disable
----
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetCondition(c75075604.atkcon)
e4:SetTarget(c75075604.disable)
e4:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e4)
e4:SetOperation(c75075604.disop)
c:RegisterEffect(e4)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(c75075604.atkcon)
e3:SetCondition(c75075604.atkcon2)
e3:SetTarget(aux.TargetBoolFunction(Card.IsFacedown))
e3:SetValue(c75075604.efilter)
c:RegisterEffect(e3)
......@@ -60,12 +58,12 @@ function c75075604.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c75075604.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c75075604.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c75075604.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c75075604.filter,tp,LOCATION_MZONE,0,1,nil) end
and Duel.IsExistingTarget(c75075604.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c75075604.filter,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectTarget(tp,c75075604.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
......@@ -97,13 +95,20 @@ function c75075604.posop(e,tp,eg,ep,ev,re,r,rp)
end
--
function c75075604.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPosition(POS_FACEUP_DEFENSE)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and loc&LOCATION_ONFIELD~=0
end
function c75075604.disable(e,c)
local seq=aux.MZoneSequence(c:GetSequence())
return Duel.IsExistingMatchingCard(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil,seq)
function c75075604.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local seq=aux.MZoneSequence(rc:GetSequence())
if Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,seq) then
Duel.NegateEffect(ev)
end
end
--
function c75075604.atkcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPosition(POS_FACEUP_DEFENSE)
end
function c75075604.efilter(e,te)
return not te:IsSetCard(0x757)
end
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