ShikaShika
Member Title : Card newbie Posts : 11 Join date : 2014-07-12
| Subject: Help with a card effect Wed Nov 05, 2014 10:53 pm | |
| Hey all. I'm trying but failing to script a card with the following effect: - Quote :
- Once per turn: you can detach 1 Xyz Material from this card to send to the Graveyard 1 card that your opponent controls (for no effect), and if you do, cards with that name and their effects cannot be used for the rest of the Duel.
Here are the relevant portions of my current script: - Quote :
- function c6000311.initial_effect(c)
--Pop local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(6000311,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCost(c6000311.popcost) e1:SetOperation(c6000311.popop) c:RegisterEffect(e1) end function c6000311.popfilter(c) return c:IsAbleToGrave() end function c6000311.popcost(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 c6000311.popop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local c=e:GetHandler() local g=Duel.GetMatchingGroup(Card.IsAbletoGrave,tp,0,LOCATION_ONFIELD,nil) if g:GetCount()>0 then local des=g:Select(tp,1,1,nil) e:SetLabel(des:GetFirst():GetCode()) Duel.HintSelection(des) Duel.BreakEffect() Duel.SendtoGrave(des,REASON_RULE) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(0,1) e1:SetValue(c6000311.aclimit) e1:SetLabel(e:GetLabel()) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_FORBIDDEN) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE) e2:SetLabelObject(e:GetLabelObject()) Duel.RegisterEffect(e2,tp) local e3=e1:Clone() e3:SetCode(EFFECT_DISABLE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_IGNORE_RANGE) e3:SetLabelObject(e:GetLabelObject()) Duel.RegisterEffect(e3,tp) end end function c6000311.aclimit(e,re,tp) return re:GetHandler():IsCode(e:GetLabel()) end This is a combination of the effects of Apoqliphort Killer, Prohibition, and Cursed Seal of the Forbidden Spell. The actual ToGrave effect works fine, but the Forbidden/Can't Use effect doesn't seem to work at all. Targeted cards can later be played without issue. If anyone can help, it would be greatly appreciated. |
|
TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Re: Help with a card effect Thu Nov 06, 2014 1:38 am | |
| This is from vulcan the divine, maybe it might help - Vulcan the divine:
- Code:
-
function c98012938.hfilter(c,e) return c:IsRelateToEffect(e) and c:IsFaceup() end function c98012938.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if not g then return end g=g:Filter(c98012938.hfilter,nil,e) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) local tc=g:GetFirst() while tc do if tc:IsLocation(LOCATION_HAND) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(1,0) e1:SetValue(c98012938.aclimit) e1:SetLabel(tc:GetCode()) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end tc=g:GetNext() end end end function c98012938.aclimit(e,re,tp) return re:GetHandler():IsCode(e:GetLabel()) end
You'd need to make it only affect your opponent (not you) and for the remainder of the duel (rather than 1 turn). And change hand to graveyard more than likely. The problem is, this might have to recognize what the cards were on the field so if the card your opponent sends was face-down it might not work. |
|