Commit 6457c93a authored by Nemo Ma's avatar Nemo Ma

Add cards by Alpha

parent d2ffdd25
--Night March
--AlphaKretin
--For Nemoma
function c33700300.initial_effect(c)
aux.AddEquipProcedure(c)
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c33700300.atkval)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCondition(c33700300.atkcon)
e2:SetValue(1000)
c:RegisterEffect(e2)
--atk/def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCondition(c33700300.atkcon2)
e3:SetValue(2000)
c:RegisterEffect(e3)
--Pierce
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCondition(c33700300.atkcon2)
e4:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e4)
end
function c33700300.atkval(e,c)
return (Duel.GetMatchingGroupCount(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,TYPE_SPELL) * 100) + 100
end
function c33700300.atkcon(e)
return Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,33700300)==1
end
function c33700300.atkcon2(e)
return Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,33700300)==2
end
--Tipi, the Blue Little Lady
--AlphaKretin
--For Nemoma
function c33700301.initial_effect(c)
c:EnableCounterPermit(0x233)
--place counters
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82821760,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c33700301.ctcon)
e1:SetTarget(c33700301.cttg)
e1:SetOperation(c33700301.ctop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86585274,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCost(c33700301.spcost)
e2:SetTarget(c33700301.sptg)
e2:SetOperation(c33700301.spop)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetTarget(c33700301.tgtg)
e3:SetOperation(c33700301.tgop)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(79798060,0))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROY)
e4:SetCondition(c33700301.thcon)
e4:SetTarget(c33700301.thtg)
e4:SetOperation(c33700301.thop)
c:RegisterEffect(e4)
end
function c33700301.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function c33700301.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,e:GetHandler(),0,0x233)
end
function c33700301.ctop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
e:GetHandler():AddCounter(0x233,2)
end
function c33700301.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,c)
e:SetLabel(g:GetCount())
Duel.SendtoGrave(g,REASON_COST)
end
function c33700301.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,e:GetHandler(),0,0x233)
end
function c33700301.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
e:GetHandler():AddCounter(0x233,e:GetLabel())
end
end
function c33700301.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local sel=0
if c33700301.hftg(e,tp,eg,ep,ev,re,r,rp,chk) then sel=sel+1 end
if c33700301.dktg(e,tp,eg,ep,ev,re,r,rp,chk) then sel=sel+2 end
e:SetLabel(sel)
return true
end
local sel=e:GetLabel()
if sel>2 then
local p=1-tp
if c:IsCanRemoveCounter(tp,0x233,1,REASON_COST) and c:GetCounter(0x233)>1 and Duel.SelectYesNo(tp,aux.Stringid(33700301,2)) then
c:RemoveCounter(tp,0x233,1,REASON_COST)
p=tp
end
sel=Duel.SelectOption(p,aux.Stringid(33700301,0),aux.Stringid(33700301,1))+1
end
if sel==1 then c33700301.hftg(e,tp,eg,ep,ev,re,r,rp,chk) elseif sel==2 then c33700301.dktg(e,tp,eg,ep,ev,re,r,rp,chk) end
e:SetLabel(sel)
end
function c33700301.tgop(e,tp,eg,ep,ev,re,r,rp)
local sel=e:GetLabel()
if sel<1 or sel>2 then return end
if sel==1 then c33700301.hfop(e,tp,eg,ep,ev,re,r,rp) else c33700301.dkop(e,tp,eg,ep,ev,re,r,rp) end
end
function c33700301.hftg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetHandler():GetCounter(0x233)
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,1-tp,LOCATION_HAND+LOCATION_ONFIELD,0,ct,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,1-tp,LOCATION_HAND+LOCATION_ONFIELD)
end
function c33700301.hfop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetCounter(0x233)
local g=Duel.SelectMatchingCard(1-tp,Card.IsAbleToGrave,1-tp,LOCATION_HAND+LOCATION_ONFIELD,0,ct,ct,nil)
Duel.SendtoGrave(g,REASON_RULE)
end
function c33700301.dktg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetHandler():GetCounter(0x233)
if chk==0 then return ct>0 and Duel.IsPlayerCanDiscardDeck(1-tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,ct)
end
function c33700301.dkop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetCounter(0x233)
Duel.DiscardDeck(1-tp,ct,REASON_RULE)
end
function c33700301.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x233)
e:SetLabel(ct)
return ct>0 and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 and not c:IsReason(REASON_BATTLE) and re and re:GetOwner()~=c
end
function c33700301.thtg(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,ct,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end
function c33700301.thop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_GRAVE,0,ct,ct,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment