--Primalgeddon Crumbling Paradise --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --atk & def local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_FZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x487)) e2:SetValue(300) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCondition(cid.condition) e3:SetValue(500) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EFFECT_UPDATE_DEFENSE) e4:SetCondition(cid.condition) e4:SetValue(500) c:RegisterEffect(e4) --destroy local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,0)) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e5:SetCode(EVENT_DESTROYED) e5:SetRange(LOCATION_FZONE) e5:SetCountLimit(1,id) e5:SetCondition(cid.descon) e5:SetTarget(cid.destg) e5:SetOperation(cid.desop) c:RegisterEffect(e5) --destroy local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,1)) e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e6:SetRange(LOCATION_FZONE) e6:SetCode(EVENT_PHASE+PHASE_STANDBY) e6:SetCountLimit(1) e6:SetCondition(cid.sdescon) e6:SetTarget(cid.sdestg) e6:SetOperation(cid.sdesop) c:RegisterEffect(e6) end --ATK & DEF function cid.condition(e) return Duel.GetTurnPlayer()~=e:GetHandlerPlayer() end --DESTROY function cid.descon(e,tp,eg,ep,ev,re,r,rp) local des=eg:GetFirst() if des:IsReason(REASON_BATTLE) then local rc=des:GetReasonCard() return rc and rc:IsSetCard(0x487) and rc:IsControler(tp) and rc:IsRelateToBattle() end return false end function cid.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,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) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end --SELF DESTROY function cid.sdescon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp and e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED) end function cid.sdestg(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.sdesop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.Destroy(c,REASON_EFFECT) end end