VB99
Member Title : Legendary Planet Posts : 368 Join date : 2013-11-10
| Subject: Alien support (what I have managed to do myself (aka not much (I hope this is the right section....))) Fri Jul 04, 2014 5:29 pm | |
| I just found someone who alsocreated a few ustom cards and thought to myself: Why not try scripting them too (with slight changes)? However, being as unsure as I am, I left 1 card to my normal thread. E.T. Alien Curse LV 3 DARK/Reptile Effect 500/1500 When this card is removed from the field, target 1 face-up monster with A-Counters, destroy it and inflict damage to your opponent equal to ATK of that monster. You cannot conduct your battle phase the turn you activated this effect. (If a monster with an A-Counter battles an "Alien" monster, it loses 1000 ATK and DEF for each A-Counter during damage calculation only.) - Spoiler:
function cXXXXXXXX.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(XXXXXXXX,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_LEAVE_FIELD) e1:SetCost(cXXXXXXXX.dmcost) e1:SetTarget(cXXXXXXXX.dmtg) e1:SetOperation(cXXXXXXXX.dmop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_DAMAGE_CALCULATING) e2:SetRange(LOCATION_MZONE) e2:SetOperation(cXXXXXXXX.adval) c:RegisterEffect(e2) end function cXXXXXXXX.filter(c) return c:GetCounter(0xe)>0 and c:IsDestructable() end function cXXXXXXXX.dmcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCurrentPhase()==PHASE_MAIN1 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_BP) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function cXXXXXXXX.dmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and cXXXXXXXX.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(cXXXXXXXX.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,cXXXXXXXX.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local d=g:GetFirst() local atk=0 if d:IsFaceup() then atk=d:GetAttack() end Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk) end function cXXXXXXXX.dmop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then local atk=0 if tc:IsFaceup() then atk=tc:GetAttack() end if Duel.Destroy(tc,REASON_EFFECT)==0 then return end Duel.Damage(1-tp,atk,REASON_EFFECT) end end function cXXXXXXXX.addown(c,e) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL) e1:SetValue(c:GetCounter(0xe)*-1000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENCE) c:RegisterEffect(e2) end function cXXXXXXXX.adval(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() if not d then return end if a:GetCounter(0xe)>0 and d:IsSetCard(0xc) then cXXXXXXXX.addown(a,e) end if d:GetCounter(0xe)>0 and a:IsSetCard(0xc) then cXXXXXXXX.addown(d,e) end end
E.T. Alien Space Invader LV 4 Light/Reptile Effect 1800/500 When this card is normal summoned, special summon 1 "Alien" monster from your hand. (If a monster with an A-Counter battles an "Alien" monster, it loses 1000 ATK and DEF for each A-Counter during damage calculation only.) - Spoiler:
function cXXXXXXXX.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(XXXXXXXX,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(cXXXXXXXX.sptg) e1:SetOperation(cXXXXXXXX.spop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_DAMAGE_CALCULATING) e2:SetRange(LOCATION_MZONE) e2:SetOperation(cXXXXXXXX.adval) c:RegisterEffect(e2) end function cXXXXXXXX.filter(c,e,tp) return c:IsSetCard(0xc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cXXXXXXXX.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_HAND) and chkc:IsControler(tp) and cXXXXXXXX.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cXXXXXXXX.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,cXXXXXXXX.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function cXXXXXXXX.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 end function cXXXXXXXX.addown(c,e) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL) e1:SetValue(c:GetCounter(0xe)*-1000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENCE) c:RegisterEffect(e2) end function cXXXXXXXX.adval(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() if not d then return end if a:GetCounter(0xe)>0 and d:IsSetCard(0xc) then cXXXXXXXX.addown(a,e) end if d:GetCounter(0xe)>0 and a:IsSetCard(0xc) then cXXXXXXXX.addown(d,e) end end
E.T. Alien Injector LV 4 Light/Reptile Effect 1600/1200 Once per turn: You can place 1 A-Counter on 1 face-up monster your opponent controls. (If a monster with an A-Counter battles an "Alien" monster, it loses 1000 ATK and DEF for each A-Counter during damage calculation only.) - Spoiler:
local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(XXXXXXXX,0)) e1:SetCategory(CATEGORY_COUNTER) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(cXXXXXXXX.cttg) e1:SetOperation(cXXXXXXXX.ctop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_DAMAGE_CALCULATING) e2:SetRange(LOCATION_MZONE) e2:SetOperation(cXXXXXXXX.adval) c:RegisterEffect(e2) end function cXXXXXXXX.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,0xe,1) end function cXXXXXXXX.ctop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then tc:AddCounter(0xe,1) end end function cXXXXXXXX.addown(c,e) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL) e1:SetValue(c:GetCounter(0xe)*-1000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENCE) c:RegisterEffect(e2) end function cXXXXXXXX.adval(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() if not d then return end if a:GetCounter(0xe)>0 and d:IsSetCard(0xc) then cXXXXXXXX.addown(a,e) end if d:GetCounter(0xe)>0 and a:IsSetCard(0xc) then cXXXXXXXX.addown(d,e) end end
E.T. Alien Guardian Light/Reptile Effect LV 4 1000/1600 FLIP: Place 2 A-Counters on all face-up monsters in your opponent controls. (If a monster with an A-Counter battles an "Alien" monster, it loses 1000 ATK and DEF for each A-Counter during damage calculation only.) - Spoiler:
function cXXXXXXXX.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_COUNTER) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) e1:SetTarget(cXXXXXXXX.cttg) e1:SetOperation(cXXXXXXXX.ctop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_DAMAGE_CALCULATING) e2:SetRange(LOCATION_MZONE) e2:SetOperation(cXXXXXXXX.adval) c:RegisterEffect(e2) end function cXXXXXXXX.cttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end end function cXXXXXXXX.ctop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local tc=g:GetFirst() while tc do tc:AddCounter(0xe,2) tc=g:GetNext() end end function cXXXXXXXX.addown(c,e) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_PHASE+RESET_DAMAGE_CAL) e1:SetValue(c:GetCounter(0xe)*-1000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENCE) c:RegisterEffect(e2) end function cXXXXXXXX.adval(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() if not d then return end if a:GetCounter(0xe)>0 and d:IsSetCard(0xc) then cXXXXXXXX.addown(a,e) end if d:GetCounter(0xe)>0 and a:IsSetCard(0xc) then cXXXXXXXX.addown(d,e) end end
|
|