Commit 5c370a30 authored by Nemo Ma's avatar Nemo Ma

Add new cards by 樱幕 & Alpha, Fix Suzaku Field

parent afd24814
No preview for this file type
--平行世界超载
function c11113105.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,11113105+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c11113105.cost)
e1:SetTarget(c11113105.target)
e1:SetOperation(c11113105.activate)
c:RegisterEffect(e1)
if not c11113105.global_check then
c11113105.global_check=true
c11113105[0]=0
c11113105[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVED)
ge1:SetOperation(c11113105.check)
Duel.RegisterEffect(ge1,0)
end
end
function c11113105.check(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc:IsCode(11113105) then
c11113105[ep]=c11113105[ep]+1
if c11113105[ep]>=2 then
Duel.RegisterFlagEffect(ep,11113105,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
end
function c11113105.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function c11113105.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=5-Duel.GetMatchingGroupCount(nil,tp,LOCATION_HAND,0,e:GetHandler())
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function c11113105.rtfilter(c,tp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_HAND,0,1,c,c:GetCode())
end
function c11113105.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=5-Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
if ct>0 and Duel.Draw(p,ct,REASON_EFFECT)~=0 then
local ph=Duel.GetCurrentPhase()
if ph==PHASE_MAIN1 then
Duel.SkipPhase(p,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,p)
elseif ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE then
Duel.SkipPhase(p,PHASE_BATTLE,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
else
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
end
Duel.BreakEffect()
local hg=Duel.GetFieldGroup(p,LOCATION_HAND,0)
Duel.ConfirmCards(1-p,hg)
if hg:IsExists(c11113105.rtfilter,1,nil,p)
and Duel.GetMatchingGroupCount(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)>0 then
Duel.SendtoDeck(hg,nil,2,REASON_EFFECT)
end
Duel.ShuffleHand(p)
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(c11113105.dmcon)
e2:SetOperation(c11113105.dmop)
Duel.RegisterEffect(e2,p)
end
function c11113105.dmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,11113105)~=0
end
function c11113105.dmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,11113105)
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if not tc:IsCode(11113105) then
Duel.SetLP(tp,0)
end
end
\ No newline at end of file
--无谋的欲望
function c11113123.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_RECOVER+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_SPSUMMON,TIMING_SUMMON)
e1:SetCountLimit(1,11113123+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c11113123.target)
e1:SetOperation(c11113123.activate)
c:RegisterEffect(e1)
end
function c11113123.target(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
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tg=g:GetMaxGroup(Card.GetAttack)
local atk=tg:GetFirst():GetAttack()
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,atk)
end
function c11113123.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tg=g:GetMaxGroup(Card.GetAttack)
local atk=tg:GetFirst():GetAttack()
if tg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=tg:Select(tp,1,1,nil)
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
Duel.Recover(tp,atk,REASON_EFFECT)
local cg=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,LOCATION_DECK+LOCATION_GRAVE,nil,sg:GetFirst():GetCode())
if cg:GetCount()>0 and Duel.GetLP(tp)<Duel.GetLP(1-tp)
and not Duel.IsPlayerAffectedByEffect(tp,30459350) and Duel.SelectYesNo(tp,aux.Stringid(11113123,0)) then
Duel.BreakEffect()
local ct=Duel.Remove(cg,POS_FACEUP,REASON_EFFECT)
Duel.Recover(tp,ct*500,REASON_EFFECT)
end
end
elseif Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
Duel.Recover(tp,atk,REASON_EFFECT)
local cg=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,LOCATION_DECK+LOCATION_GRAVE,nil,tg:GetFirst():GetCode())
if cg:GetCount()>0 and Duel.GetLP(tp)<Duel.GetLP(1-tp)
and not Duel.IsPlayerAffectedByEffect(tp,30459350) and Duel.SelectYesNo(tp,aux.Stringid(11113123,0)) then
Duel.BreakEffect()
local ct=Duel.Remove(cg,POS_FACEUP,REASON_EFFECT)
Duel.Recover(tp,ct*500,REASON_EFFECT)
end
end
end
local rct=1
if Duel.GetTurnPlayer()~=tp then rct=2 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c11113123.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,rct)
Duel.RegisterEffect(e1,tp)
end
function c11113123.aclimit(e,re,tp)
return re:IsActiveType(TYPE_SPELL)
end
\ No newline at end of file
--重巡舰娘 雷电
function c11113125.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c11113125.ffilter,2,true)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,11113125)
e1:SetCondition(c11113125.sprcon)
e1:SetOperation(c11113125.sprop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11113125,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1)
e2:SetCondition(c11113125.ngcon)
e2:SetTarget(c11113125.ngtg)
e2:SetOperation(c11113125.ngop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11113125,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c11113125.hdcon)
e3:SetTarget(c11113125.hdtg)
e3:SetOperation(c11113125.hdop)
c:RegisterEffect(e3)
end
function c11113125.ffilter(c)
return c:IsRace(RACE_MACHINE) and c:GetAttack()==c:GetDefense()
end
function c11113125.spfilter1(c,tp,ft)
if c:IsRace(RACE_MACHINE) and c:GetAttack()==c:GetDefense() and c:IsAbleToHandAsCost() and c:IsCanBeFusionMaterial(nil,true) and (c:IsControler(tp) or c:IsFaceup()) then
if ft>0 or c:IsControler(tp) then
return Duel.IsExistingMatchingCard(c11113125.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,tp)
else
return Duel.IsExistingMatchingCard(c11113125.spfilter2,tp,LOCATION_MZONE,0,1,c,tp)
end
else return false end
end
function c11113125.spfilter2(c,tp)
return c:IsRace(RACE_MACHINE) and c:GetAttack()==c:GetDefense() and c:IsAbleToHandAsCost() and c:IsCanBeFusionMaterial() and (c:IsControler(tp) or c:IsFaceup())
end
function c11113125.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c11113125.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp,ft)
end
function c11113125.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11113125,0))
local g1=Duel.SelectMatchingCard(tp,c11113125.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp,ft)
local tc=g1:GetFirst()
local g=Duel.GetMatchingGroup(c11113125.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,tc,tp)
local g2=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11113125,0))
if ft>0 or tc:IsControler(tp) then
g2=g:Select(tp,1,1,nil)
else
g2=g:FilterSelect(tp,Card.IsControler,1,1,nil,tp)
end
g1:Merge(g2)
Duel.SendtoHand(g1,nil,REASON_COST)
Duel.ConfirmCards(1-tp,g1)
end
function c11113125.ngcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsContains(c) and Duel.IsChainDisablable(ev)
end
function c11113125.ngfilter(c,e,tp,atk,def)
return c:IsRace(RACE_MACHINE) and c:GetAttack()<=atk and c:GetDefense()<=def
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11113125.ngtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11113125.ngfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetAttack(),c:GetDefense()) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c11113125.ngop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c11113125.ngfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,c:GetAttack(),c:GetDefense())
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local at=g:GetFirst():GetAttack()
local df=g:GetFirst():GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-at)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(-df)
c:RegisterEffect(e2)
Duel.BreakEffect()
Duel.NegateEffect(ev)
end
end
function c11113125.hdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c11113125.hdfilter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:GetAttack()==c:GetDefense() and c:IsCanBeFusionMaterial()
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11113125.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingMatchingCard(c11113125.hdfilter,tp,LOCATION_HAND,0,2,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c11113125.hdfilter,tp,LOCATION_HAND,0,2,2,nil,e,tp)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
end
function c11113125.hdop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if ft>0 and (g:GetCount()>0 or (g:GetCount()>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if g:GetCount()>ft then g=g:Select(tp,ft,ft,nil) end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--智商碾压!?
function c11113127.initial_effect(c)
c:SetUniqueOnField(1,1,11113127)
c:EnableCounterPermit(0x4)
c:SetCounterLimit(0x4,5)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c11113127.activate)
c:RegisterEffect(e1)
--activate limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetCondition(c11113127.econ1)
e2:SetValue(c11113127.actlimit)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetTargetRange(0,1)
e3:SetCondition(c11113127.econ2)
c:RegisterEffect(e3)
if not c11113127.global_check then
c11113127.global_check=true
c11113127[0]=0
c11113127[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c11113127.checkop1)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_NEGATED)
ge2:SetOperation(c11113127.checkop2)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(c11113127.clear)
Duel.RegisterEffect(ge3,0)
end
end
function c11113127.checkop1(e,tp,eg,ep,ev,re,r,rp)
c11113127[ep]=c11113127[ep]+1
end
function c11113127.checkop2(e,tp,eg,ep,ev,re,r,rp)
c11113127[ep]=c11113127[ep]-1
end
function c11113127.clear(e,tp,eg,ep,ev,re,r,rp)
c11113127[0]=0
c11113127[1]=0
end
function c11113127.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ct=c11113127[tp]
if ct<5 then
local t={}
for i=1,6-ct do t[i]=i+(ct-1) end
local at=Duel.AnnounceNumber(tp,table.unpack(t))
c:AddCounter(0x4,at)
else
c:AddCounter(0x4,5)
end
end
function c11113127.econ1(e)
local tp=e:GetHandlerPlayer()
local st=c11113127[tp]
return st>=e:GetHandler():GetCounter(0x4)
end
function c11113127.econ2(e)
local tp=e:GetHandlerPlayer()
local st=c11113127[1-tp]
return st>=e:GetHandler():GetCounter(0x4)
end
function c11113127.actlimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
\ No newline at end of file
--智商扭曲?
function c11113131.initial_effect(c)
c:SetUniqueOnField(1,1,11113131)
c:EnableCounterPermit(0x4)
c:SetCounterLimit(0x4,5)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c11113131.activate)
c:RegisterEffect(e1)
--summon limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetCondition(c11113131.econ1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_SUMMON)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(0,1)
e4:SetCondition(c11113131.econ2)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(e5)
if not c11113131.global_check then
c11113131.global_check=true
c11113131[0]=0
c11113131[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(c11113131.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(c11113131.clear)
Duel.RegisterEffect(ge3,0)
end
end
function c11113131.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p=tc:GetSummonPlayer()
c11113131[p]=c11113131[p]+1
end
function c11113131.clear(e,tp,eg,ep,ev,re,r,rp)
c11113131[0]=0
c11113131[1]=0
end
function c11113131.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ct=c11113131[tp]
if ct<5 then
local t={}
for i=1,6-ct do t[i]=i+(ct-1) end
local at=Duel.AnnounceNumber(tp,table.unpack(t))
if at==0 then return end
c:AddCounter(0x4,at)
else
c:AddCounter(0x4,5)
end
end
function c11113131.econ1(e)
local tp=e:GetHandlerPlayer()
local st=c11113131[tp]
return st>=e:GetHandler():GetCounter(0x4)
end
function c11113131.econ2(e)
local tp=e:GetHandlerPlayer()
local st=c11113131[1-tp]
return st>=e:GetHandler():GetCounter(0x4)
end
\ No newline at end of file
--诡异的光
function c11113133.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c11113133.target1)
e1:SetOperation(c11113133.operation)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,11113133)
e2:SetCost(c11113133.cost)
e2:SetTarget(c11113133.target2)
e2:SetOperation(c11113133.operation)
e2:SetLabel(1)
c:RegisterEffect(e2)
end
function c11113133.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetFlagEffect(tp,11113133)==0 and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0
and Duel.SelectYesNo(tp,94) then
Duel.RegisterFlagEffect(tp,11113133,RESET_PHASE+PHASE_END,0,1)
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function c11113133.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11113133)==0 end
Duel.RegisterFlagEffect(tp,11113133,RESET_PHASE+PHASE_END,0,1)
end
function c11113133.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
end
function c11113133.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==0 or not c:IsRelateToEffect(e)
or Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CARDTYPE)
local op=Duel.SelectOption(1-tp,70,71,72)
local hd=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.ConfirmCards(1-tp,hd)
if (op==0 and not hd:IsExists(Card.IsType,1,nil,TYPE_MONSTER)) or (op==1 and not hd:IsExists(Card.IsType,1,nil,TYPE_SPELL))
or (op==2 and not hd:IsExists(Card.IsType,1,nil,TYPE_TRAP)) then
if Duel.GetTurnPlayer()==tp then
--cannot inactivate/disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11113133,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_SZONE)
e1:SetValue(c11113133.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(c11113133.efilter)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
--cannot disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_DISABLE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
else
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(11113133,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c11113133.negcon)
e4:SetOperation(c11113133.negop)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e4)
end
end
Duel.ShuffleHand(tp)
end
function c11113133.efilter(e,ct)
local p=e:GetHandlerPlayer()
local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return p==tp
end
function c11113133.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.IsChainDisablable(ev)
end
function c11113133.negop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
\ No newline at end of file
...@@ -33,7 +33,9 @@ function c33700063.initial_effect(c) ...@@ -33,7 +33,9 @@ function c33700063.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c33700063.condition(e,tp,eg,ep,ev,re,r,rp) function c33700063.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():GetPreviousControler()==tp and re:GetHandler():IsSetCard(0x442) local c=e:GetHandler()
local rc=re and re:GetHandler()
return c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_RULE) and c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp and rc and rc:IsSetCard(0x442) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c33700063.operation(e,tp,eg,ep,ev,re,r,rp) function c33700063.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0 if Duel.GetMZoneCount(tp)>0
......
...@@ -43,7 +43,9 @@ function c33700065.initial_effect(c) ...@@ -43,7 +43,9 @@ function c33700065.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c33700065.condition(e,tp,eg,ep,ev,re,r,rp) function c33700065.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():GetPreviousControler()==tp and re:GetHandler():IsSetCard(0x442) local c=e:GetHandler()
local rc=re and re:GetHandler()
return c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_RULE) and c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp and rc and rc:IsSetCard(0x442) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c33700065.operation(e,tp,eg,ep,ev,re,r,rp) function c33700065.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0 if Duel.GetMZoneCount(tp)>0
......
...@@ -42,7 +42,9 @@ function c33700066.initial_effect(c) ...@@ -42,7 +42,9 @@ function c33700066.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c33700066.condition(e,tp,eg,ep,ev,re,r,rp) function c33700066.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT) and e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():GetPreviousControler()==tp and re:GetHandler():IsSetCard(0x442) local c=e:GetHandler()
local rc=re and re:GetHandler()
return c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_RULE) and c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp and rc and rc:IsSetCard(0x442) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c33700066.operation(e,tp,eg,ep,ev,re,r,rp) function c33700066.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0 if Duel.GetMZoneCount(tp)>0
...@@ -65,7 +67,7 @@ function c33700066.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,7 +67,7 @@ function c33700066.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c33700066.cfilter(c) function c33700066.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3442) return c:IsFaceup() and c:IsSetCard(0x442)
end end
function c33700066.spfilter(c,e,tp) function c33700066.spfilter(c,e,tp)
return c:IsSetCard(0x442) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x442) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
...@@ -77,7 +79,7 @@ function c33700066.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -77,7 +79,7 @@ function c33700066.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c33700066.cfilter(chkc) and chkc:IsControler(tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c33700066.cfilter(chkc) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(c33700066.cfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c33700066.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,c33700066.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
end end
function c33700066.operation1(e,tp,eg,ep,ev,re,r,rp) function c33700066.operation1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
...@@ -96,4 +98,4 @@ end ...@@ -96,4 +98,4 @@ end
function c33700066.con(e) function c33700066.con(e)
local g=Duel.GetMatchingGroup(c33700066.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c33700066.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)>=3 return g:GetClassCount(Card.GetCode)>=3
end end
\ No newline at end of file
...@@ -36,7 +36,9 @@ function c33700067.initial_effect(c) ...@@ -36,7 +36,9 @@ function c33700067.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c33700067.condition(e,tp,eg,ep,ev,re,r,rp) function c33700067.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():GetPreviousControler()==tp and re:GetHandler():IsSetCard(0x442) local c=e:GetHandler()
local rc=re and re:GetHandler()
return c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_RULE) and c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp and rc and rc:IsSetCard(0x442) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c33700067.operation(e,tp,eg,ep,ev,re,r,rp) function c33700067.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0 if Duel.GetMZoneCount(tp)>0
......
...@@ -59,7 +59,7 @@ function c33700069.aclimit(e,re,tp) ...@@ -59,7 +59,7 @@ function c33700069.aclimit(e,re,tp)
end end
function c33700069.thcon(e,tp,eg,ep,ev,re,r,rp) function c33700069.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4
and Duel.GetDrawCount(tp)>0 and Duel.GetDrawCount(tp)>0 and Duel.GetTurnCount()>1
end end
function c33700069.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c33700069.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
......
...@@ -95,8 +95,8 @@ function c33700171.con(e) ...@@ -95,8 +95,8 @@ function c33700171.con(e)
return g:GetClassCount(Card.GetCode)<g:GetCount() return g:GetClassCount(Card.GetCode)<g:GetCount()
end end
function c33700171.efilter(e,re,rp) function c33700171.efilter(e,re,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end if re:GetOwnerPlayer()==e:GetOwnerPlayer() then return false end
if re:GetOwnerPlayer()==e:GetOwnerPlayer() then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
return not g:IsContains(e:GetHandler()) return not g:IsContains(e:GetHandler())
end end
......
...@@ -39,13 +39,13 @@ function c33700175.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,13 +39,13 @@ function c33700175.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
function c33700175.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c33700175.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end end
function c33700175.op(e,tp,eg,ep,ev,re,r,rp) function c33700175.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SSet(tp,c) Duel.SSet(tp,c)
end end
end end
function c33700175.thcon(e,tp,eg,ep,ev,re,r,rp) function c33700175.thcon(e,tp,eg,ep,ev,re,r,rp)
...@@ -55,32 +55,31 @@ function c33700175.thtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -55,32 +55,31 @@ function c33700175.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_HAND,nil) local ct=Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_HAND,nil)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,ct,tp,0)
end end
function c33700175.thop(e,tp,eg,ep,ev,re,r,rp) function c33700175.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then return end
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct1=Duel.GetFieldGroupCount(p,0,LOCATION_HAND) local ct1=Duel.GetFieldGroupCount(p,0,LOCATION_HAND)
local ct2=ct1-Duel.GetFieldGroupCount(p,LOCATION_HAND,0) local ct2=ct1-Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
if ct>0 then if ct2>0 then
Duel.Draw(p,ct2,REASON_EFFECT) Duel.Draw(tp,ct2,REASON_EFFECT)
end end
local sg=Duel.GetOperatedGroup() local sg=Duel.GetOperatedGroup()
Duel.ConfirmCards(1-p,sg) Duel.ConfirmCards(1-p,sg)
if sg:GetClassCount(Card.GetCode)==sg:GetCount() then if sg:GetClassCount(Card.GetCode)==sg:GetCount() then
local gt=FilterSelect(p,Card.IsDiscardable,1,sg:GetCount(),nil) local gt=sg:FilterSelect(p,Card.IsDiscardable,1,sg:GetCount(),nil)
Duel.SendtoGrave(gt,REASON_EFFECT+REASON_DISCARD) Duel.SendtoGrave(gt,REASON_EFFECT+REASON_DISCARD)
local ct3=gt:Filter(Card.IsLocation,nil,LOCATION_GRAVE):GetCount() local ct3=gt:GetCount()
local tg=Duel.GetMatchingGroup(Card.IsAbleToHand,p,LOCATION_GRAVE,0,nil) local tg=Duel.GetMatchingGroup(Card.IsAbleToHand,p,LOCATION_GRAVE,0,nil)
if ct3>0 and tg:GetCount()>=ct3 then if ct3>0 and tg:GetCount()>=ct3 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sel=tg:Select(p,ct3,ct3,nil) local sel=tg:Select(p,ct3,ct3,nil)
Duel.SendtoHand(sel,nil,REASON_EFFECT) Duel.SendtoHand(sel,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sel) Duel.ConfirmCards(1-p,sel)
end end
else else
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -74,7 +74,7 @@ function cm.initial_effect(c) ...@@ -74,7 +74,7 @@ function cm.initial_effect(c)
table.insert(cm.check[ep],tc:GetCode()) table.insert(cm.check[ep],tc:GetCode())
end end
end) end)
Duel.RegisterEffect(ge1) Duel.RegisterEffect(ge1,0)
local ge1=Effect.GlobalEffect() local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW) ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
......
--Night March
--AlphaKretin
--For Nemoma
function c33700400.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c33700400.target)
e1:SetOperation(c33700400.operation)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c33700400.atkval)
c:RegisterEffect(e2)
--atk/def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCondition(c33700400.atkcon)
e3:SetValue(1000)
c:RegisterEffect(e3)
--atk/def
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetCondition(c33700400.atkcon2)
e4:SetValue(2000)
c:RegisterEffect(e4)
--Pierce
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCondition(c33700400.atkcon2)
e5:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e5)
--Equip limit
local e6=Effect.CreateEffect(c)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_EQUIP_LIMIT)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c33700400.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c33700400.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c33700400.atkval(e,c)
return (Duel.GetMatchingGroupCount(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,TYPE_SPELL) * 100) + 100
end
function c33700400.atkcon(e)
return Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,33700400)==1
end
function c33700400.atkcon2(e)
return Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,33700400)==2
end
--Tipi, the Blue Little Lady
--AlphaKretin
--For Nemoma
function c33700401.initial_effect(c)
c:EnableCounterPermit(0x441)
--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(c33700401.ctcon)
e1:SetTarget(c33700401.cttg)
e1:SetOperation(c33700401.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(c33700401.spcost)
e2:SetTarget(c33700401.sptg)
e2:SetOperation(c33700401.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(c33700401.tgtg)
e3:SetOperation(c33700401.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(c33700401.thcon)
e4:SetTarget(c33700401.thtg)
e4:SetOperation(c33700401.thop)
c:RegisterEffect(e4)
end
function c33700401.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function c33700401.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,0x441)
end
function c33700401.ctop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
e:GetHandler():AddCounter(0x441,2)
end
function c33700401.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 c33700401.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,0x441)
end
function c33700401.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(0x441,e:GetLabel())
end
end
function c33700401.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local sel=0
if c33700401.hftg(e,tp,eg,ep,ev,re,r,rp,chk) then sel=sel+1 end
if c33700401.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,0x441,1,REASON_COST) and c:GetCounter(0x441)>1 and Duel.SelectYesNo(tp,aux.Stringid(33700401,2)) then
c:RemoveCounter(tp,0x441,1,REASON_COST)
p=tp
end
sel=Duel.SelectOption(p,aux.Stringid(33700401,0),aux.Stringid(33700401,1))+1
end
if sel==1 then c33700401.hftg(e,tp,eg,ep,ev,re,r,rp,chk) elseif sel==2 then c33700401.dktg(e,tp,eg,ep,ev,re,r,rp,chk) end
e:SetLabel(sel)
end
function c33700401.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 c33700401.hfop(e,tp,eg,ep,ev,re,r,rp) else c33700401.dkop(e,tp,eg,ep,ev,re,r,rp) end
end
function c33700401.hftg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetHandler():GetCounter(0x441)
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 c33700401.hfop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetCounter(0x441)
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 c33700401.dktg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetHandler():GetCounter(0x441)
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 c33700401.dkop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetCounter(0x441)
Duel.DiscardDeck(1-tp,ct,REASON_RULE)
end
function c33700401.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x441)
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 c33700401.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 c33700401.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