Commit 236201e9 authored by TanakaKotoha's avatar TanakaKotoha

new and fix

parent 9f1a4299
--堕天司之王 路西法
function c47579900.initial_effect(c)
c:SetUniqueOnField(1,0,47579900)
--xyz summon
aux.AddXyzProcedureLevelFree(c,c47579900.mfilter,c47579900.xyzcheck,3,3)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.xyzlimit)
c:RegisterEffect(e0)
--inactivatable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetRange(LOCATION_SZONE)
e1:SetValue(c47579900.effectfilter)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(c47579900.effectfilter)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(47579900,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c47579900.xyzcon)
e3:SetTarget(c47579900.rmtg)
e3:SetOperation(c47579900.rmop)
c:RegisterEffect(e3)
--repeat attack
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BATTLE_START)
e4:SetOperation(c47579900.ovop)
c:RegisterEffect(e4)
--effect gian
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_ADJUST)
e5:SetRange(LOCATION_MZONE)
e5:SetOperation(c47579900.efop)
c:RegisterEffect(e5)
--spsummon bgm
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_SPSUMMON_SUCCESS)
e9:SetOperation(c47579900.spsuc)
c:RegisterEffect(e9)
c:SetUniqueOnField(1,0,47579900)
--xyz summon
aux.AddXyzProcedureLevelFree(c,c47579900.mfilter,c47579900.xyzcheck,3,3)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.xyzlimit)
c:RegisterEffect(e0)
--inactivatable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetRange(LOCATION_SZONE)
e1:SetValue(c47579900.effectfilter)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(c47579900.effectfilter)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(47579900,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c47579900.xyzcon)
e3:SetOperation(c47579900.rmop)
c:RegisterEffect(e3)
--repeat attack
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BATTLE_START)
e4:SetOperation(c47579900.ovop)
c:RegisterEffect(e4)
--effect gian
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_ADJUST)
e5:SetRange(LOCATION_MZONE)
e5:SetOperation(c47579900.efop)
c:RegisterEffect(e5)
--spsummon bgm
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_SPSUMMON_SUCCESS)
e9:SetOperation(c47579900.spsuc)
c:RegisterEffect(e9)
end
function c47579900.effectfilter(e,ct)
local p=e:GetHandler():GetControler()
local te,tp,loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
return p==tp and te:GetHandler():IsCode(47579900) and bit.band(loc,LOCATION_ONFIELD)~=0
local p=e:GetHandler():GetControler()
local te,tp,loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
return p==tp and te:GetHandler():IsCode(47579900) and bit.band(loc,LOCATION_ONFIELD)~=0
end
function c47579900.mfilter(c)
return c:IsSetCard(0x95de)
return c:IsSetCard(0x95de)
end
function c47579900.xyzcheck(g)
return g:GetClassCount(Card.GetCode)==g:GetCount()
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c47579900.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c47579900.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_MZONE)
function c47579900.rmfilter(c)
return c:IsType(TYPE_MONSTER)
end
function c47579900.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,LOCATION_MZONE,nil,TYPE_MONSTER,e:GetHandler())
local tg=g:GetMaxGroup(Card.GetAttack)
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEDOWN,REASON_RULE)
end
local g=Duel.GetMatchingGroup(c47579900.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,aux.ExceptThisCard(e))
local tg=g:GetMaxGroup(Card.GetAttack)
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEDOWN,REASON_RULE)
end
end
function c47579900.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if c==tc then tc=Duel.GetAttackTarget() end
if tc and tc:IsRelateToBattle() then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
Duel.ChainAttack()
end
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if c==tc then tc=Duel.GetAttackTarget() end
if tc and tc:IsRelateToBattle() then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
Duel.ChainAttack()
end
end
function c47579900.effilter(c)
return c:IsType(TYPE_MONSTER)
return c:IsType(TYPE_MONSTER)
end
function c47579900.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetOverlayGroup(tp,1,0)
local wg=ct:Filter(c47579900.effilter,nil,tp)
local wbc=wg:GetFirst()
while wbc do
local code=wbc:GetOriginalCode()
if c:IsFaceup() and c:GetFlagEffect(code)==0 then
c:CopyEffect(code,RESET_EVENT+0x1fe0000+EVENT_CHAINING,1)
c:RegisterFlagEffect(code,RESET_EVENT+0x1fe0000+EVENT_CHAINING,0,1)
end
wbc=wg:GetNext()
end
local c=e:GetHandler()
local ct=c:GetOverlayGroup(tp,1,0)
local wg=ct:Filter(c47579900.effilter,nil,tp)
local wbc=wg:GetFirst()
while wbc do
local code=wbc:GetOriginalCode()
if c:IsFaceup() and c:GetFlagEffect(code)==0 then
c:CopyEffect(code,RESET_EVENT+0x1fe0000+EVENT_CHAINING,1)
c:RegisterFlagEffect(code,RESET_EVENT+0x1fe0000+EVENT_CHAINING,0,1)
end
wbc=wg:GetNext()
end
end
function c47579900.spsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(47579900,1))
Duel.Hint(HINT_SOUND,0,aux.Stringid(47579900,2))
Duel.Hint(HINT_MUSIC,0,aux.Stringid(47579900,1))
Duel.Hint(HINT_SOUND,0,aux.Stringid(47579900,2))
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