a place for all your custom card needs you can post scripts pics and request for card to be made also please donate to the funding for a new server made for custom card duels
 
HomePortalCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | .
 

 Is this correct?

View previous topic View next topic Go down 
AuthorMessage
VB99

avatar


Member Title : Legendary Planet
Posts : 368
Join date : 2013-11-10

PostSubject: Is this correct?   Mon May 12, 2014 7:08 pm

I'm trying to script an Alien-Card (two with the same pendulum effect, actually).

I Just wanted to know if this is correct: 

function cXXXXXXXX.initial_effect(c)
aux.AddPendulumProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(cXXXXXXXX.descost)
e2:SetTarget(cXXXXXXXX.target)
e2:SetOperation(cXXXXXXXX.operation)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_REMOVE_COUNTER+0xe)
e3:SetOperation(cXXXXXXXX.ctop1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DAMAGE_CALCULATING)
e4:SetRange(LOCATION_SZONE)
e4:SetOperation(cXXXXXXXX.adval)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(XXXXXXXX,0))
e5:SetCategory(CATEGORY_COUNTER)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EVENT_PHASE+PHASE_STANDBY)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_REPEAT)
e5:SetCountLimit(1)
e5:SetCondition(cXXXXXXXX.condition1)
e5:SetTarget(cXXXXXXXX.target1)
e5:SetOperation(cXXXXXXXX.operation1)
c:RegisterEffect(e5)
end
function cXXXXXXXX.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,0,1,0xe,1,REASON_COST) end
Duel.RemoveCounter(tp,0,1,0xe,1,REASON_COST)
end
function cXXXXXXXX.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,0xe,1)
end
function cXXXXXXXX.operation(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.ctop1(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0xe,1)
end
function cXXXXXXXX.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cXXXXXXXX.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,0xe,1)
end
function cXXXXXXXX.operation1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
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)*-300)
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
Back to top Go down
View user profile http://www.fanfiktion.de/u/VB99
 

Is this correct?

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Politically Correct terms!
» Politically Correct --- or not.
» Need help determining correct bias adjustment
» Optispark service video
» What is the correct color?

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Requests-