Commit e374f7c1 authored by Nemo Ma's avatar Nemo Ma

SP_SUMMON Fix

parent 7a562cbb
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
--动物朋友 PPP×动物饼干
function c33700062.initial_effect(c)
c:EnableUnsummonable()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
--动物朋友 槌蛇
function c33700074.initial_effect(c)
c:EnableUnsummonable()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......
--Succession of Illusion and Dreams
--AlphaKretin
--For Nemoma
local s = c33700422
local id = 33700422
function s.initial_effect(c)
--Activate
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.accon)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
--Link Spell
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_LINK_SPELL_KOISHI)
e2:SetValue(LINK_MARKER_TOP)
c:RegisterEffect(e2)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
--Gemini status
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE, 0)
e4:SetTarget(s.gemtg)
e4:SetCode(EFFECT_DUAL_STATUS)
c:RegisterEffect(e4)
end
function s.cfilter(c, oc, tp)
if not (c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:GetDefense() > c:GetAttack()) then
return false
end
local g = c:GetColumnGroup()
return g:FilterCount(
function(c, tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_SZONE)
end,
nil,
tp
) == 0 or g:IsContains(oc)
end
function s.accon(e, tp, eg, ep, ev, re, r, rp)
return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil, e:GetHandler(), tp)
end
function s.effilter(c)
return c:IsAbleToGrave() and c:IsType(TYPE_EFFECT) and c:GetDefense() > c:GetAttack()
end
function s.acop(e, tp, eg, ep, ev, re, r, rp)
local tc = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_MZONE, 0, 1, 1, nil, e:GetHandler(), tp):GetFirst()
Duel.MoveSequence(e:GetHandler(), tc:GetSequence())
if
Duel.IsExistingMatchingCard(s.effilter, tp, LOCATION_DECK, 0, 1, nil) and
Duel.SelectYesNo(tp, aux.Stringid(0, id))
then
local g = Duel.SelectMatchingCard(tp, s.effilter, tp, LOCATION_DECK, 0, 1, 1, nil)
if Duel.SendtoGrave(g, REASON_EFFECT) > 0 then
local cid = tc:CopyEffect(g:GetFirst():GetOriginalCodeRule(), RESET_EVENT + RESETS_STANDARD, 1)
end
end
end
function s.gemtg(e, c)
return c:IsCode(33700423) and e:GetLinkedGroup():IsContains(c)
end
--Milreaf, Precocious Dragon Child
--AlphaKretin
--For Nemoma
local s = c33700423
local id = 33700423
function s.initial_effect(c)
aux.EnableDualAttribute(c)
--Special Summon
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(aux.IsDualState)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.spfilter(c, e, tp)
return c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and
Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp)
end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
return
end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local tc = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp):GetFirst()
if tc then
Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEUP)
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT + RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT + RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3 = Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetValue(0)
e3:SetReset(RESET_EVENT + RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4 = e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE)
e4:SetValue(2000)
tc:RegisterEffect(e4)
Duel.SpecialSummonComplete()
--no material
local e5 = Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e5:SetValue(s.spval)
tc:RegisterEffect(e5)
local e6 = e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e6)
local e7 = e5:Clone()
e7:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e7)
local e8 = e5:Clone()
e8:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e8)
end
end
function s.spval(e, c)
if not c then
return false
end
return not c:IsRace(e:GetHandler():GetRace())
end
--Backstage Desperation
--AlphaKretin
--For Nemoma
local s = c33700424
local id = 33700424
function s.initial_effect(c)
--Activate
local e0 = Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Draw in hand
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id, 0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_TRIGGER_O + EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_PHASE + PHASE_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1, id)
e1:SetCondition(s.drcon)
e1:SetCost(s.drcost)
e1:SetTarget(s.drtg)
e1:SetOperation(s.drop)
c:RegisterEffect(e1)
--Count activations/summons while face-up
local ea = Effect.CreateEffect(c)
ea:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
ea:SetRange(LOCATION_SZONE)
ea:SetCode(EVENT_SUMMON_SUCCESS)
ea:SetOperation(s.countop)
c:RegisterEffect(ea)
local eb = ea:Clone()
eb:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(eb)
local ec = ea:Clone()
ec:SetCode(EVENT_CHAINING)
c:RegisterEffect(ec)
--Draw on field
local e2 = Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id, 1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_TRIGGER_F + EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_PHASE + PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1, id)
e2:SetLabelObject(ea)
e2:SetCondition(s.drcon2)
e2:SetTarget(s.drtg2)
e2:SetOperation(s.drop2)
c:RegisterEffect(e2)
end
function s.drcon(e, tp, eg, ep, ev, re, r, rp)
local eff, ns, ss = Duel.GetActivityCount(tp, ACTIVITY_CHAIN, ACTIVITY_SUMMON, ACTIVITY_SPECIALSUMMON)
return (eff + ns + ss == 0) and (tp == Duel.GetTurnPlayer())
end
function s.drcost(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
if chk == 0 then
return not c:IsPublic()
end
--reveals as part of activation innately
end
function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return Duel.IsPlayerCanDraw(tp, 1)
end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
end
function s.drop(e, tp, eg, ep, ev, re, r, rp)
local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
Duel.Draw(p, d, REASON_EFFECT)
end
function s.countop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
if rp == tp and (not re or re:GetHandler() ~= c) then
c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
end
end
function s.drcon2(e, tp, eg, ep, ev, re, r, rp)
return e:GetHandler():GetFlagEffect(id) == 0
end
function s.drtg2(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return Duel.IsPlayerCanDraw(tp, 3)
end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(3)
Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 3)
end
function s.setfilter(c, tp)
if c:IsType(TYPE_MONSTER) then
return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and
c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEDOWN_DEFENSE)
else
return (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp, LOCATION_SZONE) > 0) and c:IsSSetable()
end
end
function s.drop2(e, tp, eg, ep, ev, re, r, rp)
local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
Duel.Draw(p, d, REASON_EFFECT)
local og = Duel.GetOperatedGroup():Filter(s.setfilter, nil, tp)
local c = e:GetHandler()
if not Duel.IsExistingMatchingCard(Card.IsFaceup, tp, LOCATION_ONFIELD, 0, 1, c) and og then
local cg = Group.CreateGroup()
while #og > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 2)) do
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
local tc = og:Select(tp, 1, 1, nil):GetFirst()
if tc:IsType(TYPE_MONSTER) then
Duel.SpecialSummonStep(tc, 0, tp, tp, false, false, POS_FACEDOWN_DEFENSE)
else
Duel.SSet(tp, tc)
end
cg:AddCard(tc)
og:RemoveCard(tc)
og = og:Filter(s.setfilter, nil, tp)
end
Duel.SpecialSummonComplete()
Duel.ConfirmCards(1 - tp, cg)
end
end
--Blade of Devotion
--AlphaKretin
--For Nemoma
local s = c33700425
local id = 33700425
function s.initial_effect(c)
aux.AddEquipProcedure(c)
--0 atk
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(0)
c:RegisterEffect(e1)
--cannot attack
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
c:RegisterEffect(e2)
--gain atk
local e3 = Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id, 0))
e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_DAMAGE)
e3:SetCondition(s.atkcon)
e3:SetOperation(s.atkop)
c:RegisterEffect(e3)
--search
local e4 = Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id, 1))
e4:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(s.thcon)
e4:SetCost(s.thcost)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
--draw
local e5 = Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id, 2))
e5:SetCategory(CATEGORY_DRAW)
e5:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCondition(s.drcon)
e5:SetTarget(s.drtg)
e5:SetOperation(s.drop)
c:RegisterEffect(e5)
end
function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
return e:GetHandler():GetEquipTarget()
end
function s.atkop(e, tp, eg, ep, ev, re, r, rp)
local tc = e:GetHandler():GetEquipTarget()
local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT + RESETS_STANDARD)
e1:SetValue(1000)
tc:RegisterEffect(e1)
end
function s.thcon(e, tp, eg, ep, ev, re, r, rp)
local ec = e:GetHandler():GetEquipTarget()
return ec and ec:IsAttackAbove(6000)
end
function s.thcost(e, tp, eg, ep, ev, re, r, rp, chk)
local ec = e:GetHandler():GetEquipTarget()
if chk == 0 then
return ec and ec:IsAbleToGraveAsCost()
end
Duel.SendtoGrave(ec, REASON_COST)
end
function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return Duel.IsExistingMatchingCard(Card.IsAbleToHand, tp, LOCATION_DECK, 0, 1, nil)
end
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
end
function s.thop(e, tp, eg, ep, ev, re, r, rp)
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
local g = Duel.SelectMatchingCard(tp, Card.IsAbleToHand, tp, LOCATION_DECK, 0, 1, 1, nil)
if #g > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT)
Duel.ConfirmCards(1 - tp, g)
end
end
function s.drcon(e, tp, eg, ep, ev, re, r, rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return Duel.IsPlayerCanDraw(tp, 1)
end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
end
function s.drop(e, tp, eg, ep, ev, re, r, rp)
local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
Duel.Draw(p, d, REASON_EFFECT)
end
--True Form Revealed!
--AlphaKretin
--For Nemoma
local s = c33700426
local id = 33700426
function s.initial_effect(c)
--Activate
local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE + CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0, 0x1c0)
e1:SetTarget(s.negtg)
e1:SetOperation(s.negop)
c:RegisterEffect(e1)
end
function s.negtg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return Duel.IsExistingTarget(aux.TRUE, tp, 0, LOCATION_MZONE, 1, nil)
end
if Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) then
e:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CANNOT_NEGATE)
else
e:SetProperty(0)
end
Duel.SetOperationInfo(0, CATEGORY_DISABLE, nil, 1, 0, 0)
Duel.SetOperationInfo(0, CATEGORY_ATKCHANGE, nil, 1, 0, 0)
end
function s.lkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function s.nlkfilter(c)
return c:IsFaceup() and not c:IsType(TYPE_LINK)
end
function s.lvval(c)
return math.max(c:GetLevel(), c:GetRank())
end
function s.negop(e, tp, eg, ep, ev, re, r, rp)
local lg = Duel.GetMatchingGroup(s.lkfilter, tp, 0, LOCATION_MZONE, nil)
local og = Duel.GetMatchingGroup(s.nlkfilter, tp, 0, LOCATION_MZONE, nil)
local tc
if #lg > 0 then
tc = lg:GetMaxGroup(Card.GetLink):Select(1 - tp, 1, 1, nil):GetFirst()
else
tc = Duel.GetMaxGroup(s.lvval):Select(1 - tp, 1, 1, nil):GetFirst()
end
if tc then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT + RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2 = e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3 = e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e3)
end
local e4 = e1:Clone()
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetValue(0)
tc:RegisterEffect(e4)
local e5 = e4:Clone()
e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e5)
e:SetLabelObject(tc)
local e6 = Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_IGNITION + EFFECT_TYPE_CONTINUOUS)
e6:SetRange(LOCATION_MZONE)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e6:SetTarget(s.eftg)
e6:SetOperation(s.efop)
e6:SetReset(RESET_EVENT + RESETS_STANDARD)
tc:RegisterEffect(e6)
end
end
function s.effilter(c, oc)
local lv = math.max(oc:GetLevel(), oc:GetRank(), oc:GetLink())
return c:IsRace(oc:GetRace()) and c:IsAttribute(oc:GetAttribute()) and c:IsLevelBelow(lv - 1) and c:IsAbleToRemove()
end
function s.eftg(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
if ckh == 0 then
return Duel.IsExistingMatchingCard(s.effilter, tp, LOCATION_DECK, 0, 1, nil, c)
end
end
function s.efop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
local g = Duel.SelectMatchingCard(tp, s.effilter, tp, LOCATION_DECK, 0, 1, nil, c)
if #g > 0 and Duel.Remove(g, POS_FACEUP, REASON_EFFECT) ~= 0 then
end
end
--Spirit Spirit Fairy Fairy
--AlphaKretin
--For Nemoma
local s = c33700427
local id = 33700427
function s.initial_effect(c)
--link summon
aux.AddLinkProcedure(c, nil, 2)
c:EnableReviveLimit()
--change control
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id, 0))
e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.ctcon)
e1:SetTarget(s.cttg)
e1:SetOperation(s.ctop)
c:RegisterEffect(e1)
local e2 = e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--atk in def
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DEFENSE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
e3:SetTarget(s.atktg)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
e4:SetTarget(s.noatktg)
c:RegisterEffect(e4)
--reverse stat change
local e5 = Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_REVERSE_UPDATE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
e5:SetTarget(s.atktg)
c:RegisterEffect(e5)
end
function s.ctfilter(c, ec, tp)
if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
else
return (ec:GetLinkedZone(c:GetPreviousControler()) & (1 << c:GetPreviousSequence())) ~= 0
end
end
function s.ctcon(e, tp, eg, ep, ev, re, r, rp)
return eg:IsExists(s.ctfilter, 1, nil, e:GetHandler(), tp)
end
function s.cttg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return true
end
local g = eg:Filter(s.ctfilter, nil, e:GetHandler(), tp)
local ct = g and #g or 0
Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, ct, 0, 0)
end
function s.ctop(e, tp, eg, ep, ev, re, r, rp)
local g = eg:Filter(s.ctfilter, nil, e:GetHandler(), tp)
if #g < 1 then
return
end
local p = tp
local g1 = g:Filter(Card.IsControler, nil, tp)
local g2 = g:Filter(Card.IsControler, nil, 1 - tp)
if #g2 > #g1 then
p = 1 - tp
g1, g2 = g2, g1
end
local diff = #g1 - #g2
if diff > 0 then
local ct = math.min(diff, Duel.GetLocationCount(1 - p, LOCATION_MZONE))
local tg
if ct > #g1 then
tg = g1
else
tg = g1:Select(p, ct, ct, nil)
end
Duel.GetControl(tg, 1 - p)
g1:Sub(tg)
end
if #g2 > 0 then
local tg2
if #g2 == #g1 then
tg2 = g1
else
tg2 = g1:Select(p, #g2, #g2, nil)
end
Duel.SwapControl(tg2, g2)
g1:Sub(tg2)
end
if #g1 > 0 then
Duel.SendtoGrave(g1, REASON_RULE)
end
end
function s.atktg(e, c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function s.noatktg(e, c)
return e:GetHandler():GetLinkedGroup():IsContains(c) and c:IsPosition(POS_FACEUP_ATTACK)
end
--Hyper Dimension Idol, Hoshino Yumemi
--AlphaKretin
--For Nemoma
local s = c33700428
local id = 33700428
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c, aux.FilterBoolFunctionEx(Card.IsType, TYPE_TOKEN), 4, 4)
--battle indestructable
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--direct
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e2)
--count damage
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_DAMAGE)
e3:SetRange(LOCATION_MZONE)
e3:SetLabel(0)
e3:SetOperation(s.damop)
c:RegisterEffect(e3)
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_TURN_END)
e4:SetLabelObject(e3)
e4:SetCondition(s.resetop)
c:RegisterEffect(e4)
--skip
local e5 = Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e5:SetLabelObject(e3)
e5:SetCondition(s.skipcon)
e5:SetOperation(s.skipop)
c:RegisterEffect(e5)
end
function s.damop(e, tp, eg, ep, ev, re, r, rp)
if ep == tp and (r & REASON_BATTLE == REASON_BATTLE or (r & REASON_EFFECT == REASON_EFFECT and rp == 1 - tp)) then
e:SetLabel(e:GetLabel() + ev)
end
end
function s.resetop(e, tp, eg, ep, ev, re, r, rp)
e:GetLabelObject():SetLabel(0)
return false
end
function s.skipcon(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetTurnPlayer() ~= tp and e:GetLabelObject():GetLabel() >= 3000
end
function s.skipop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(3000)
e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END + RESET_SELF_TURN)
c:RegisterEffect(e1)
Duel.SkipPhase(1 - tp, PHASE_MAIN1, RESET_PHASE + PHASE_END, 1)
Duel.SkipPhase(1 - tp, PHASE_BATTLE, RESET_PHASE + PHASE_END, 1)
Duel.SkipPhase(1 - tp, PHASE_MAIN2, RESET_PHASE + PHASE_END, 1)
Duel.SkipPhase(1 - tp, PHASE_END, RESET_PHASE + PHASE_END, 1)
Duel.SkipPhase(tp, PHASE_DRAW, RESET_PHASE + PHASE_END, 2)
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE + PHASE_END)
e2:SetCondition(s.drcon)
e2:SetOperation(s.drop)
Duel.RegisterEffect(e2, tp)
end
function s.drcon(e, tp, eg, ep, ev, re, r, rp)
return tp == Duel.GetTurnPlayer()
end
function s.drop(e, tp, eg, ep, ev, re, r, rp)
Duel.Draw(tp, 1, REASON_EFFECT)
e:Reset()
end
......@@ -20,4 +20,4 @@ function cm.initial_effect(c)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
rsve.addcounter(tp,5)
end
\ No newline at end of file
end
......@@ -53,4 +53,4 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
rsve.addcounter(tp,g:GetFirst():GetLevel()*2,nil,e:GetHandler())
end
end
end
\ No newline at end of file
end
......@@ -79,3 +79,4 @@ function cm.damop(sel)
end
end
end
......@@ -5,7 +5,6 @@ if not RSTFVal then
RSTFVal=RSTFVal or {}
tfrsv=RSTFVal
function tfrsv.SSLimitEffect(c)
c:EnableUnsummonable()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -167,7 +167,7 @@ function rsss.ntop(fun)
end
end
function rsss.ActFieldFunction(c,code)
local e1=rsef.QO(c,nil,{m,6},{1,code},nil,nil,LOCATION_FZONE,nil,rscost.costself(Card.IsAbleToDeckAsCost,"td"),rsss.actg,rsss.acop)
local e1=rsef.QO(c,nil,{m,6},{1,code},nil,nil,LOCATION_FZONE,nil,rscost.cost(Card.IsAbleToDeckAsCost,"td"),rsss.actg,rsss.acop)
e1:SetLabel(code)
return e1
end
......@@ -240,13 +240,13 @@ function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x144d)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
......@@ -5,8 +5,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2)
local e1=rsef.FV_CANNOT_BE_TARGET(c,"battle",nil,cm.cfilter,{LOCATION_MZONE,LOCATION_MZONE },cm.con)
local e3=rsef.FV_CANNOT_BE_TARGET(c,"effect",nil,cm.cfilter,{LOCATION_MZONE,LOCATION_MZONE },cm.con)
local e1,e3=rsef.FV_CANNOT_BE_TARGET(c,"battle,effect",nil,cm.cfilter,{LOCATION_MZONE,LOCATION_MZONE },cm.con)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
......
......@@ -125,7 +125,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)~=0 then
c:CompleteProcedure()
local lp=rscost[e]
local lp=rscost.costinfo[e]
if not lp or lp<1000 or not c:IsType(TYPE_XYZ) then return end
local ct=math.floor(lp/1000)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_DECK,0,nil)
......
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