Jump to content

[Resolved] YGOPRO custom card scripting help/question (plz)


Vengevoid

Recommended Posts

Hello, this is a Ygopro custom card scripting related question.

I'm currently running into a problem with the functionality of the effects that I'm using for this card. I'm hoping anyone can help me answer or at least help with scripting this effect. Some of the effects below are already finished but feel free to make changes along the way. I just need help on the others. 

 

Effect 1 (done):

When this card attacks a Defense Position monster, if the attack target is a non-LIGHT or a non-DARK monster during the Damage Step, inflict piercing battle damage to your opponent.

(This means if the monster is face-up (regardless if its flipped or not) during damage step, piercing battle damage is applied.)

 

Effect 2 (done):

This card is also treated as a DARK monster.

(self-explanatory)

 

Effect 3 (needs to be fixed):

Once per turn, during your Main Phase 1, you can banish 1 LIGHT and 1 DARK monster from your graveyard; until the end of this turn, this card can attack all monsters your opponent controls, once each. 

(Because this is a powerful effect, it is necessary for the cost to be that way.)

 

Effect 4 (needs to be fixed):

When this card destroys a monster as a result of battle, this card loses 200 ATK until the End Phase of this turn.

(This effect is almost pretty useless unless you're using effect 3. If anyone has ever played the game "Maplestory" and have made a 4th job Luminous character (I'm not making this card using the real luminous character), you can definitely understand why effect 3 and 4 are linked to each other.)

 

Feel free to comment down below if you know who to script this. I'm not sure if the order of the script really matters but feel free to put an attachment if possible. Thank you in advance. It's really appreciative and you have my gratitude.

I'll post the script below this post. 


somehow i dont remember how to put attachments because i rarely post attachments here.

But here it is for now:

 

LIGHT/Spellcaster/LV 7/ ATK: 2500/ DEF: 1500

 

--Lumino Voidslayer, Viper
function c20626169.initial_effect©
--Attribute Dark
local e1=Effect.CreateEffect©
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ATTRIBUTE_DARK)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect©
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetRange(LOCATION_MZONE) 
e2:SetCondition(c20626169.condtion)
c:RegisterEffect(e2)
--atkdown
local e3=Effect.CreateEffect©
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetOperation(c20626169.atkop)
c:RegisterEffect(e3)
--attack all
local e4=Effect.CreateEffect©
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(c20626169.cost)
e4:SetCountLimit:(1)
e4:SetOperation(c20626169.operation)
c:RegisterEffect(e4)
end
 
function c20626169.costfilter©
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemoveAsCost()
end
function c20626169.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84704041.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c84704041.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
 
function c20626169.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect©
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
 
function c20626169.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect©
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-200)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+RESET_BATTLE)
c:RegisterEffect(e1)
end
 
function c20626169.condtion(e)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
local bc=c:GetBattleTarget()
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL)
and c:IsRelateToBattle() and bc:IsFaceup() and bc:IsAttribute(ATTRIBUTE_FIRE) or bc:IsAttribute(ATTRIBUTE_WATER) or bc:IsAttribute(ATTRIBUTE_WIND) or bc:IsAttribute(ATTRIBUTE_EARTH) or bc:IsAttribute(ATTRIBUTE_DIVINE) 
end
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...