--created by Swag, coded by Lyris local s,id=GetID() function s.initial_effect(c) aux.AddOrigPandemoniumType(c) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetRange(LOCATION_SZONE) e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e4:SetTargetRange(1,0) e4:SetTarget(s.splimit) c:RegisterEffect(e4) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_FREE_CHAIN) e5:SetRange(LOCATION_SZONE) e5:SetCountLimit(1) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetCategory(CATEGORY_DESTROY) e5:SetCondition(aux.PandActCheck) e5:SetCost(s.cost) e5:SetTarget(s.destg) e5:SetOperation(s.desop) c:RegisterEffect(e5) aux.EnablePandemoniumAttribute(c,e5) local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_FIELD) e6:SetCode(EFFECT_SPSUMMON_PROC) e6:SetRange(LOCATION_HAND) e6:SetCountLimit(1,id) e6:SetProperty(EFFECT_FLAG_UNCOPYABLE) e6:SetCondition(s.spcon) e6:SetOperation(s.spop) c:RegisterEffect(e6) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_TO_GRAVE) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCategory(CATEGORY_DAMAGE) e2:SetCondition(function(e,tp,eg) return eg:IsExists(s.filter,1,nil) end) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,id+100) e3:SetCategory(CATEGORY_DAMAGE) e3:SetTarget(s.tg) e3:SetOperation(s.op) c:RegisterEffect(e3) end function s.splimit(e,c,sump,sumtype,sumpos,targetp) if c:IsRace(RACE_DINOSAUR) then return false end return bit.band(sumtype,SUMMON_TYPE_PANDEMONIUM)==SUMMON_TYPE_PANDEMONIUM end function s.cfilter(c) return c:IsAbleToGraveAsCost() and c:IsSetCard(0x9b5) and c:IsType(TYPE_MONSTER) and (c:IsFaceup() and c:IsType(TYPE_PANDEMONIUM+TYPE_PENDULUM) or c:IsLocation(LOCATION_HAND)) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,1,nil,e,tp) Duel.SendtoGrave(g,REASON_COST) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,c) end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,1,c) Duel.SendtoGrave(g,REASON_COST) end function s.filter(c) return c:IsSetCard(0x9b5) and c:IsType(TYPE_MONSTER) and c:IsReason(REASON_EFFECT) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetParam(300) Duel.SetTargetPlayer(1-tp) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300) end function s.operation(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 s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetParam(500) Duel.SetTargetPlayer(1-tp) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function s.op(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