--Summoned Archfiend Marauder function c155310.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),6,2) c:EnableReviveLimit() --pierce local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_PIERCE) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_FIEND)) c:RegisterEffect(e1) --Destroy&Damage local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e2:SetDescription(aux.Stringid(155310,0)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) e2:SetCost(c155310.cost) e2:SetTarget(c155310.target) e2:SetOperation(c155310.operation) c:RegisterEffect(e2) --Destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(155310,1)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetTarget(c155310.tgtg) e3:SetOperation(c155310.tgop) c:RegisterEffect(e3) --Damage local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_DAMAGE) e4:SetDescription(aux.Stringid(155310,2)) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetRange(LOCATION_MZONE) e4:SetCode(EVENT_DESTROYED) e4:SetCountLimit(1) e4:SetCondition(c155310.dcondition) e4:SetTarget(c155310.dtarget) e4:SetOperation(c155310.doperation) c:RegisterEffect(e4) end function c155310.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end function c155310.filter(c) return c:IsDestructable() and c:IsLocation(LOCATION_MZONE) end function c155310.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c155310.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c155310.filter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,c155310.filter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function c155310.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then Duel.Damage(1-tp,500,REASON_EFFECT) end end function c155310.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c155310.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil) if g:GetCount()>0 then Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end end function c155310.dfilter(c,tp) return bit.band(c:GetReason(),0x41)==0x41 and c:IsControler(tp) end function c155310.dcondition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c155310.dfilter,1,nil,tp) end function c155310.dtarget(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function c155310.doperation(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