--Volcanic Prison Guard --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --negate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(cid.negcon) e1:SetTarget(cid.negtg) e1:SetOperation(cid.negop) c:RegisterEffect(e1) --damage local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_TO_GRAVE) e2:SetRange(LOCATION_MZONE) e2:SetCondition(cid.damcon) e2:SetOperation(cid.damop) c:RegisterEffect(e2) end --NEGATE --filters function cid.filter(c) return c:IsSetCard(0x32) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end --------- function cid.negcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if ep==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) return loc==LOCATION_GRAVE and Duel.IsChainNegatable(ev) end function cid.negtg(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 cid.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) then local g=Duel.GetMatchingGroup(cid.filter,tp,LOCATION_GRAVE,0,nil) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:FilterSelect(tp,aux.NecroValleyFilter(nil),1,1,nil) Duel.BreakEffect() Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end end --DAMAGE --filters function cid.damfilter(c,tp) return c:IsSetCard(0x32) and c:IsType(TYPE_MONSTER) and c:IsControler(tp) end --------- function cid.damcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(cid.damfilter,1,nil,tp) end function cid.damop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) local ct=eg:FilterCount(cid.damfilter,nil,tp) Duel.Damage(1-tp,ct*200,REASON_EFFECT) end