--Pandemoniumgraph Spirit local cid,id=GetID() function cid.initial_effect(c) aux.AddOrigPandemoniumType(c) --Increase ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_SZONE) e1:SetCode(EVENT_BATTLE_CONFIRM) e1:SetCountLimit(1) e1:SetCondition(cid.atkcon) e1:SetTarget(cid.atktg) e1:SetOperation(cid.atkop) c:RegisterEffect(e1) aux.EnablePandemoniumAttribute(c,e1,true,TYPE_EFFECT,true,true,1,id) --Destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e3:SetCode(EVENT_DESTROYED) e3:SetTarget(cid.destg) e3:SetOperation(cid.desop) c:RegisterEffect(e3) end function cid.atkcon(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() if not a:IsControler(tp) then a=Duel.GetAttackTarget() end return aux.PandActCheck(e) and a and a:IsSetCard(0xcf80) and a:IsType(TYPE_MONSTER) end function cid.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) end function cid.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local tc=Duel.GetAttacker() if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end if tc:IsRelateToBattle() and not tc:IsImmuneToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(500) e1:SetReset(RESET_PHASE+PHASE_DAMAGE) tc:RegisterEffect(e1) Duel.BreakEffect() Duel.Destroy(c,REASON_EFFECT) end end function cid.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function cid.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end