So I made some cards recently and I found out you can make scripts for them, and I'm trying 1 card I made which is probably really hard to do since it has 5 effects. I've been trying to see if I'm understanding it and going in the right direction, but I'm not sure yet. Was wondering if anybody can tell me if I'm even doing this right...
http://i.imgur.com/h2FajKE.jpg This is what I have so far(once again...it's probably all messed up):
--Hazy Rebirth
function c81632349.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c81632349.cost)
e1:SetTarget(c81632349.target)
e1:SetOperation(c81632349.activate)
c:RegisterEffect(e1)
end
--noattack
local e2=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
tc:RegisterFlagEffect(81632349,RESET_EVENT+0x1fe0000,0,1)
tc:CompleteProcedure()
--nosppsummon
local e23=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c81632349.splimit)
c:RegisterEffect(e3)
--attachxyz
local e4+Effect.CreateEffect(c)
--oneperturn
local e5+Effect.CreateEffect(c)
function c81632349.filter(c,e,tp)
return c:IsSetCard(0x107d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c81632349.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c81632349.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c81632349.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c81632349.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
If it's too difficult to do, I'd at least appreciate a push in the right direction.
(EDIT: Cannot activate card. Only lets me set it. Probably forgot to search on how to activate Spells.)
File Attachment(s):
c81632349.lua (2kb) downloaded 1 time(s).
You cannot view/download attachments. Try to login or register.