tgs19997
Member Title : tgs19997 Posts : 12 Join date : 2013-09-29
| Subject: Banishing Cards Need Help Sat May 24, 2014 10:52 pm | |
| Can someone show me how to code the following effect. "You can detach 1 Xyz Material from this card, target 1 set card on the field; banish it and all other cards on the field, both player's hands, decks and graveyard with the same name of that card." |
|
cane_63106
Member Title : D.D. Dragon Kaiser Posts : 454 Join date : 2013-07-23 Location : St. Louis, MO
| Subject: Re: Banishing Cards Need Help Sun May 25, 2014 4:02 am | |
| Try this. If it doesn't work and an error code comes, up plz LMK
function c007.initial_effect(c) --remove local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_REMOVE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCost(c007.cost) e1:SetTarget(c007.target) e1:SetOperation(c007.operation) c:RegisterEffect(e1) end function c007.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 c007.filter(c) return c:IsFacedown() and c:IsAbleToRemove() end function c007.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c007.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c007.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,c007.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function c007.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then local code=tc:GetCode() local g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_FIELD+LOCATION_GRAVE+LOCATION_HAND,LOCATION_DECK+LOCATION_FIELD+LOCATION_GRAVE+LOCATION_HAND,nil,code) Duel.Remove(g,POS_FACEUP,REASON_EFFECT) g=Duel.GetFieldGroup(tp,0,LOCATION_DECK+LOCATION_FIELD+LOCATION_GRAVE+LOCATION_HAND) Duel.ConfirmCards(tp,g) g=Duel.GetFieldGroup(tp,LOCATION_DECK+LOCATION_FIELD+LOCATION_GRAVE+LOCATION_HAND,0) Duel.ConfirmCards(1-tp,g) Duel.ShuffleDeck(tp) Duel.ShuffleDeck(1-tp) end end |
|