TGAP-Trixie
Member Title : Trixie does not even... Posts : 273 Join date : 2014-04-17
| Subject: Quick equip Thu Nov 06, 2014 1:48 am | |
| Having trouble with a quick equip effect. "During either player's standby phase, if this card is in your graveyard: You can equip it to a face-up monster you control" After that, it's basically an armory arm, same effect and everything (and that works). What's happening right now though is when I use the quick equip effect, it destroys itself before equipping. Here's the related code - Code:
- Code:
-
--standby equip local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CANNOT_DISABLE) e1:SetCategory(CATEGORY_EQUIP) e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetRange(LOCATION_GRAVE) e1:SetCountLimit(1) e1:SetTarget(c60000133.sbtg) e1:SetOperation(c60000133.sbop) c:RegisterEffect(e1) function c60000133.filter(c,e) return c:IsFaceup() and c:IsType(TYPE_MONSTER) end function c60000133.sbtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c60000133.filter,tp,LOCATION_MZONE,0,1,nil,e) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c60000133.filter,tp,LOCATION_MZONE,0,1,1,nil,e) Duel.SetChainLimit(aux.FALSE) end function c60000133.sbop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if Duel.Equip(tp,c,tc,true) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT+0x1fe0000) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetValue(c60000133.sblimit) e2:SetCountLimit(1) e2:SetLabel(0) e2:SetReset(RESET_EVENT+0x1fe0000) c:RegisterEffect(e2) end end function c60000133.sblimit(e,c) return c==e:GetLabelObject() end
I copied the functions from cocoon of evolution so maybe there's something unnecessary there, idk |
|