Commit d6eb54c1 authored by Nemo Ma's avatar Nemo Ma

maint

parent f064b2fd
......@@ -1534,6 +1534,24 @@
31403102 0
31403103 0
31403104 0
#「机骸」系列 - 修女鱼
31200010 0
31200038 0
31200036 0
31200034 0
31200032 0
31200030 0
31200028 0
31200026 0
31200024 0
31200022 0
31200020 0
31200018 0
31200016 0
31200014 0
31200012 0
#230618
53796103 0
#230611
30005508 0
11451703 1
......
No preview for this file type
......@@ -91,7 +91,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tp=c:GetControler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,29010023,nil,0x4011,1500,1500,1,RACE_AQUA,ATTRIBUTE_WATER)
and Duel.IsPlayerCanSpecialSummonMonster(tp,29098632,nil,0x4011,1500,1500,1,RACE_AQUA,ATTRIBUTE_WATER)
and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_TOKEN) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
......@@ -100,8 +100,8 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,29010023,nil,0x4011,1500,1500,1,RACE_AQUA,ATTRIBUTE_WATER) then return end
local token=Duel.CreateToken(tp,29010023)
if not Duel.IsPlayerCanSpecialSummonMonster(tp,29098632,nil,0x4011,1500,1500,1,RACE_AQUA,ATTRIBUTE_WATER) then return end
local token=Duel.CreateToken(tp,29098632)
local fid=e:GetHandler():GetFieldID()
local g=Group.CreateGroup()
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) then
......@@ -183,14 +183,14 @@ function cm.efilter(c,sc,seq,tp)
end
end
return b and c:IsCode(29010023) and sc:GetControler()==tp
return b and c:IsCode(29098632) and sc:GetControler()==tp
end
function cm.eftg(e,c)
local seq=c:GetSequence()
return c:IsType(TYPE_EFFECT) and ((seq<5 and math.abs(e:GetHandler():GetSequence()-seq)<=1) or (Duel.IsExistingMatchingCard(cm.efilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_MZONE,1,nil,c,seq,e:GetHandlerPlayer())))
end
function cm.repfilter(c,e)
return c:IsFaceup() and (c:IsCode(29010023) or c:IsCode(15000181))
return c:IsFaceup() and (c:IsCode(29098632) or c:IsCode(15000181))
and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -219,7 +219,7 @@ end
function cm.cdcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
return Duel.GetFlagEffect(tp,15000181)==0 and ((c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() and eg:FilterCount(Card.IsReason,nil,REASON_DESTROY)==eg:GetCount() and not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,c)) or (eg:IsContains(c) and c:IsReason(REASON_REPLACE)) or (c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() and eg:GetFirst():IsReason(REASON_DESTROY) and eg:GetCount()==1 and eg:GetFirst():GetPreviousControler()==1-tp and (Duel.GetAttacker():IsCode(29010023) or (Duel.GetAttackTarget() and Duel.GetAttackTarget():IsCode(29010023)))))
return Duel.GetFlagEffect(tp,15000181)==0 and ((c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() and eg:FilterCount(Card.IsReason,nil,REASON_DESTROY)==eg:GetCount() and not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,c)) or (eg:IsContains(c) and c:IsReason(REASON_REPLACE)) or (c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() and eg:GetFirst():IsReason(REASON_DESTROY) and eg:GetCount()==1 and eg:GetFirst():GetPreviousControler()==1-tp and (Duel.GetAttacker():IsCode(29098632) or (Duel.GetAttackTarget() and Duel.GetAttackTarget():IsCode(29098632)))))
end
function cm.cdop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -229,7 +229,7 @@ function cm.cdop1(e,tp,eg,ep,ev,re,r,rp)
Duel.SelectYesNo(tp,aux.Stringid(m,0))
elseif eg:IsContains(c) and c:IsReason(REASON_REPLACE) then
Duel.SelectYesNo(tp,aux.Stringid(m,1))
elseif c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() and eg:GetFirst():IsReason(REASON_DESTROY) and eg:GetCount()==1 and eg:GetFirst():GetPreviousControler()==1-tp and (Duel.GetAttacker():IsCode(29010023) or (Duel.GetAttackTarget() and Duel.GetAttackTarget():IsCode(29010023))) then
elseif c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() and eg:GetFirst():IsReason(REASON_DESTROY) and eg:GetCount()==1 and eg:GetFirst():GetPreviousControler()==1-tp and (Duel.GetAttacker():IsCode(29098632) or (Duel.GetAttackTarget() and Duel.GetAttackTarget():IsCode(29098632))) then
Duel.SelectYesNo(tp,aux.Stringid(m,2))
end
Duel.RegisterFlagEffect(tp,15000181,RESET_PHASE+PHASE_END,0,99)
......
......@@ -4,6 +4,7 @@
local s,id=GetID()
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
xpcall(function() require("expansions/script/utterconfusionlib") end,function() require("script/utterconfusionlib") end)
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
......
--慈英州対張銅羅
--Duel of the Walkers || Duello dei Camminatori
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
--Counter Permit workaround for placing counters at activation (do NOT assign the EFFECT_FLAG_SINGLE_RANGE property)
local ct=Effect.CreateEffect(c)
ct:SetType(EFFECT_TYPE_SINGLE)
ct:SetRange(LOCATION_FZONE)
ct:SetCode(EFFECT_COUNTER_PERMIT|0x46c)
c:RegisterEffect(ct)
--[[Activate this card by paying half of your LP. If you do, when this card resolves, place 1 Life Counter on this card for every 400 LP you paid this way (rounded up).]]
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
c:RegisterEffect(e1)
--[[Monsters cannot activate their effects or declare an attack, during the turn they were Normal Summoned/Set.]]
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(1,1)
e2:SetValue(s.aclimit)
c:RegisterEffect(e2)
local e2x=Effect.CreateEffect(c)
e2x:SetType(EFFECT_TYPE_FIELD)
e2x:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2x:SetRange(LOCATION_FZONE)
e2x:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2x:SetTarget(aux.TargetBoolFunction(Card.HasFlagEffect,id))
c:RegisterEffect(e2x)
--[[You choose the attack targets for your opponent's attacks, also you can make them direct attacks.]]
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_PATRICIAN_OF_DARKNESS)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(0,1)
c:RegisterEffect(e3)
local e3x=Effect.CreateEffect(c)
e3x:SetType(EFFECT_TYPE_FIELD)
e3x:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3x:SetCode(EFFECT_DIRECT_ATTACK)
e3x:SetRange(LOCATION_FZONE)
e3x:SetTargetRange(0,LOCATION_MZONE)
c:RegisterEffect(e3x)
--[[If you would gain LP, place 1 Life Counter on this card for each 400 LP you would have gained, instead.]]
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CHANGE_RECOVER)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(1,0)
e4:SetValue(s.recval)
c:RegisterEffect(e4)
local e4x=Effect.CreateEffect(c)
e4x:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e4x:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e4x:SetRange(LOCATION_FZONE)
e4x:SetCondition(s.bdcon)
e4x:SetOperation(s.bdop)
c:RegisterEffect(e4x)
--[[If you would take damage, remove 1 Life Counter from this card for each 400 damage you would have taken, instead.]]
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CHANGE_DAMAGE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(1,0)
e5:SetValue(s.damval)
c:RegisterEffect(e5)
local e5x=e5:Clone()
e5x:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e5x:SetValue(s.CheckProtectionApplicability)
c:RegisterEffect(e5x)
--[[If there are no Life Counters on this card, send it to the GY.]]
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetCode(EFFECT_SELF_TOGRAVE)
e6:SetRange(LOCATION_FZONE)
e6:SetCondition(s.selftg)
c:RegisterEffect(e6)
--[[If this card leaves the field: Halve your LP.]]
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(id,1))
e7:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_F)
e7:SetCode(EVENT_LEAVE_FIELD)
e7:SetOperation(s.hlop)
c:RegisterEffect(e7)
--
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.regsum)
Duel.RegisterEffect(ge1,0)
end
end
function s.regsum(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
tc:RegisterFlagEffect(id,RESET_EVENT|(RESETS_STANDARD&(~(RESET_TEMP_REMOVE|RESET_TURN_SET)))|RESET_PHASE|PHASE_END,EFFECT_FLAG_SET_AVAILABLE,1)
end
end
--E1
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local cost=math.floor(Duel.GetLP(tp)/2)
if chk==0 then return c:IsCanAddCounter(0x46c,math.ceil(cost/400),false,LOCATION_FZONE) end
Duel.PayLPCost(tp,cost)
e:SetLabel(math.ceil(cost/400))
c:AddCounter(0x46c,math.ceil(cost/400))
end
--E2
function s.aclimit(e,re,tp)
local tc=re:GetHandler()
return tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and re:IsActiveType(TYPE_MONSTER) and tc:HasFlagEffect(id)
end
--E4
function s.recval(e,r,val)
local c=e:GetHandler()
local ct=math.floor(val/400)
if ct>0 and c:IsCanAddCounter(0x46c,ct) then
c:AddCounter(0x46c,ct)
end
return 0
end
--E4X
function s.bdcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetBattleDamage(tp)<=0 or Duel.IsPlayerAffectedByEffect(tp,EFFECT_AVOID_BATTLE_DAMAGE) then return false end
local DamageWillBeReversed=false
for _,ce in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DAMAGE)}) do
local val=ce:GetValue()
local rc = (re and re&REASON_EFFECT==REASON_EFFECT) and re:GetHandler() or Duel.GetAttacker()
if not val or (type(val)=="number" and val~=0) or val(ce,re,r|REASON_BATTLE,rp,rc) then
DamageWillBeReversed=true
break
end
end
for _,ce in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_RECOVER)}) do
local val=ce:GetValue()
if not val or (type(val)=="number" and val~=0) or val(ce,re,r|REASON_BATTLE,rp) then
DamageWillBeReversed=false
break
end
end
return DamageWillBeReversed
end
function s.bdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.PlayerHasFlagEffect(tp,id) then return end
local c=e:GetHandler()
local ct=math.floor(Duel.GetBattleDamage(tp)/400)
if ct>0 and c:IsCanAddCounter(0x46c,ct) then
c:AddCounter(0x46c,ct)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_DAMAGE,0,1)
Duel.ChangeBattleDamage(tp,0)
end
end
--E5
function s.damval(e,re,val,r,rp,rc)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
local ct=math.floor(val/400)
if ct>0 and c:IsCanRemoveCounter(tp,0x46c,ct,REASON_EFFECT) then
Duel.IgnoreActionCheck(Card.RemoveCounter,c,tp,0x46c,ct,REASON_EFFECT)
return 0
end
return ev
end
--E5X
function s.CheckProtectionApplicability(e,dam)
return dam>=400
end
--E6
function s.selftg(e)
return e:GetHandler():GetCounter(0x46c)==0
end
--E7
function s.hlop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(tp,math.ceil(Duel.GetLP(tp)/2))
end
\ No newline at end of file
--无声交流
--Expression in Silence || Espressione nel Silenzio
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--[[While this card is on the field, you skip your Draw Phase.]]
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetCode(EFFECT_SKIP_DP)
c:RegisterEffect(e2)
--[[During your Standby Phase: Look at the top 3 cards of your Deck, place 1 of them on the bottom of the Deck, and if you do,
add 1 of them to your hand, and keep it revealed as long as it remains in your hand, then add the remaining card to your hand.]]
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORIES_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE|PHASE_STANDBY)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(aux.TurnPlayerCond(0))
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
--[[Once per turn, during the End Phase: Banish, face-down, all revealed cards in your hand that were revealed by this card's effect.]]
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE|PHASE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetTarget(s.rmtg)
e4:SetOperation(s.rmop)
c:RegisterEffect(e4)
--[[When your opponent activates a card or effect, while this card is in the GY: You can banish this card and 1 card with the same name from your GY, face-down, and if you do, negate that effect.]]
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,4))
e5:SetCategory(CATEGORY_DISABLE|CATEGORY_REMOVE)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_GRAVE)
e5:SetCondition(s.discon)
e5:SetTarget(s.distg)
e5:SetOperation(s.disop)
c:RegisterEffect(e5)
end
--E3
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return end
local g=Duel.GetDecktopGroup(tp,3)
Duel.ConfirmCards(tp,g)
local bg=g:Select(tp,1,1,nil)
if #bg>0 then
local bc=bg:GetFirst()
Duel.MoveSequence(bc,1)
if bc:IsLocation(LOCATION_DECK) and bc:GetSequence()==0 then
g:RemoveCard(bc)
local sg=g:Filter(Card.IsAbleToHand,nil)
if #sg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=sg:Select(tp,1,1,nil)
if #sg1>0 then
Duel.DisableShuffleCheck()
if Duel.SendtoHand(sg1,nil,REASON_EFFECT)>0 and aux.PLChk(sg1,tp,LOCATION_HAND) then
Duel.ConfirmCards(1-tp,sg1)
local sc1=sg1:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetLabel(tp)
e1:SetCondition(s.resetcon)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
sc1:RegisterEffect(e1)
sc1:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
sg:RemoveCard(sc1)
if #sg>0 then
Duel.BreakEffect()
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
Duel.ShuffleHand(tp)
end
end
end
end
end
function s.resetcon(e)
local c=e:GetHandler()
if c:GetControler()~=e:GetLabel() then
e:ResetFlagEffect(id)
e:Reset()
return false
end
return true
end
--FILTERS E4
function s.revfilter(c,tp)
return c:IsPublic() and c:HasFlagEffect(id) and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
--E4
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.Group(s.revfilter,tp,LOCATION_HAND,0,nil,tp)
if #g>0 then
Duel.SetCardOperationInfo(g,CATEGORY_REMOVE)
end
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.Group(s.revfilter,tp,LOCATION_HAND,0,nil,tp)
if #g>0 then
Duel.Banish(g,POS_FACEDOWN)
end
end
--FILTERS E5
function s.rmfilter(c,tp,code1,code2)
return c:IsCode(code1,code2) and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
--E5
function s.discon(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or not Duel.IsChainDisablable(ev) then return false end
return true
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local code1,code2=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CODE,CHAININFO_TRIGGERING_CODE2)
if chk==0 then
return not re:GetHandler():IsStatus(STATUS_DISABLED) and c:IsAbleToRemove(tp,POS_FACEDOWN) and Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_GRAVE,0,1,c,tp,code1,code2)
end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,2,tp,LOCATION_GRAVE)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToChain() then return end
local code1,code2=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CODE,CHAININFO_TRIGGERING_CODE2)
local g=Duel.Select(HINTMSG_REMOVE,false,tp,aux.Necro(s.rmfilter),tp,LOCATION_GRAVE,0,1,1,c,tp,code1,code2)
if not c:IsHasEffect(EFFECT_NECRO_VALLEY) and c:IsAbleToRemove(tp,POS_FACEDOWN) then
g:AddCard(c)
end
if #g>0 then
Duel.HintSelection(g)
if Duel.Banish(g,POS_FACEDOWN)>0 then
Duel.NegateEffect(ev)
end
end
end
\ No newline at end of file
--无尽的重担 ~月童~
--Timeless Burden - Tsukiwarawa- || Fardello senza Tempo - Tsukiwarawa-
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id,o=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
c:EnableCounterPermit(0x46d)
--[[If this is your first turn of the Duel, you can activate this card from your hand.]]
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(s.handcon)
c:RegisterEffect(e0)
--[[When this card is activated: You lose 2000 LP, also until the End Phase of your opponent's next turn, all damage you would take becomes 0.]]
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--[[Cannot be destroyed by other card effects.]]
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(s.efilter)
c:RegisterEffect(e2)
--[[Once per turn, during your Main Phase: You can place 1 counter on this card, and if you do, draw cards equal to the number of counters on this card (if any).]]
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,3))
e3:SetCategory(CATEGORY_COUNTER|CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,RELEVANT_TIMINGS)
e3:SetCondition(aux.MainPhaseCond(0))
e3:SetTarget(s.cttg)
e3:SetOperation(s.ctop)
c:RegisterEffect(e3)
--[[During the Standby Phase: You take damage equal to the number of counters on this card x 400.]]
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,4))
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE|PHASE_STANDBY)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetTarget(s.damtg)
e4:SetOperation(s.damop)
c:RegisterEffect(e4)
--[[If you have 6 or more cards in your hand, destroy this card.]]
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EFFECT_SELF_DESTROY)
e5:SetCondition(s.descon)
c:RegisterEffect(e5)
--[[If this card leaves the field: You lose LP equal to the number of counters that were on it x 2000.]]
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_CONTINUOUS)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e6:SetCode(EVENT_LEAVE_FIELD_P)
e6:SetOperation(s.regop)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(id,5))
e7:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_F)
e7:SetCode(EVENT_LEAVE_FIELD)
e7:SetLabelObject(e6)
e7:SetCondition(s.lpcon)
e7:SetOperation(s.lpop)
c:RegisterEffect(e7)
if not s.global_check then
s.global_check=true
s[0]=0
s[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START|PHASE_DRAW)
ge1:SetCountLimit(1,id)
ge1:SetOperation(s.regturn)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_PHASE_START|PHASE_STANDBY)
Duel.RegisterEffect(ge2,0)
local ge3=ge1:Clone()
ge3:SetCode(EVENT_PHASE_START|PHASE_MAIN1)
Duel.RegisterEffect(ge3,0)
local ge4=ge1:Clone()
ge4:SetCode(EVENT_PHASE_START|PHASE_BATTLE_START)
Duel.RegisterEffect(ge4,0)
local ge5=ge1:Clone()
ge5:SetCode(EVENT_PHASE_START|PHASE_MAIN2)
Duel.RegisterEffect(ge5,0)
local ge6=ge1:Clone()
ge6:SetCode(EVENT_PHASE_START|PHASE_END)
Duel.RegisterEffect(ge6,0)
end
end
function s.regturn(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetTurnPlayer()
s[p]=s[p]+1
end
--E0
function s.handcon(e)
return s[e:GetHandlerPlayer()]==1
end
--E1
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsSpellTrapOnField,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.LoseLP(tp,2000)
local c=e:GetHandler()
local rct = (Duel.GetTurnPlayer()==tp and 1 or 2)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT|EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetTargetRange(1,0)
e1:SetValue(0)
e1:SetReset(RESET_PHASE|PHASE_END|RESET_TURN_OPPO,rct)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_PHASE|PHASE_END|RESET_TURN_OPPO,rct)
Duel.RegisterEffect(e2,tp)
end
--E2
function s.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
--E3
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetCounter(0x46d)+1
if chk==0 then return c:IsCanAddCounter(0x46d,1) and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x46d)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToChain() and c:IsFaceup() and c:AddCounter(0x46d,1)) then return end
local ct=c:GetCounter(0x46d)
if ct>0 then
Duel.Draw(tp,ct,REASON_EFFECT)
end
end
--E4
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=e:GetHandler():GetCounter(0x46d)
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,ct*400)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=math.max(0,c:GetCounter(0x46d))
Duel.Damage(p,ct*400,REASON_EFFECT)
end
end
--E5
function s.descon(e)
return Duel.GetHandCount(e:GetHandlerPlayer())>=116
end
--E6 and E7
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetCounter(0x46d)
e:SetLabel(ct)
end
function s.lpcon(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel()
e:SetLabel(ct)
return ct>0
end
function s.lpop(e,tp,eg,ep,ev,re,r,rp)
Duel.LoseLP(tp,e:GetLabel()*2000)
end
\ No newline at end of file
--直面光明
--Facing the Light || Affrontare la Luce
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id,o=GetID()
function s.initial_effect(c)
--[[Banish, from your hand, field, and/or Extra Deck, LIGHT monsters with a total Level of 50 or more,
and if you do, your opponent sends to the GY, 1 monster they control, 1 card in their Spell & Trap Card Zones, and 1 card in their hand,
and if less than 3 cards are sent to the GY by this effect, inflict damage to your opponent equal to the difference x 800.
If this card is activated on or after the 5th turn of this Duel, you can also banish cards from your GY.]]
local e1=Effect.CreateEffect(c)
e1:Desc(0)
e1:SetCategory(CATEGORY_REMOVE|CATEGORY_TOGRAVE|CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:HOPT(true)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
--FILTERS E1
function s.rmfilter(c)
return (not c:IsOnField() or c:IsFaceup()) and c:IsMonster() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:HasLevel() and c:IsAbleToRemove()
end
function s.gcheck(g)
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetLevel,50)
end
function s.tgfilter(c,tp)
return (not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5) and Duel.IsPlayerCanSendtoGrave(1-tp,c)
end
function s.tgcheck(g)
return g:GetClassCount(Card.GetLocation)==#g
end
--E1
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=LOCATION_HAND|LOCATION_MZONE|LOCATION_EXTRA
if Duel.GetTurnCount()>=5 then
loc=loc|LOCATION_GRAVE
end
if chk==0 then
local g=Duel.Group(s.rmfilter,tp,loc,0,nil)
return #g>0 and g:CheckWithSumGreater(Card.GetLevel,50)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,loc)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local loc=LOCATION_HAND|LOCATION_MZONE|LOCATION_EXTRA
if Duel.GetTurnCount()>=5 then
loc=loc|LOCATION_GRAVE
end
local g=Duel.Group(aux.Necro(s.rmfilter),tp,loc,0,nil)
if #g>0 and g:CheckWithSumGreater(Card.GetLevel,50) then
Duel.HintMessage(tp,HINTMSG_REMOVE)
local rg=g:SelectWithSumGreater(tp,Card.GetLevel,50)
if #rg>0 and Duel.Banish(rg)>0 then
local ct=3
local sg=Duel.Group(s.tgfilter,tp,0,LOCATION_HAND|LOCATION_MZONE|LOCATION_SZONE,nil,tp)
if #sg>0 then
local min=3
local loclist={LOCATION_HAND,LOCATION_MZONE,LOCATION_SZONE}
for i=1,3 do
if not sg:IsExists(Card.IsLocation,1,nil,loclist[i]) then
min=min-1
if min==1 then
break
end
end
end
Duel.HintMessage(1-tp,HINTMSG_TOGRAVE)
aux.GCheckAdditional=s.tgcheck
local tg=sg:SelectSubGroup(1-tp,aux.TRUE,false,min,min)
aux.GCheckAdditional=nil
if #tg>0 and Duel.SendtoGrave(tg,REASON_RULE)>0 then
local oct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
ct=3-oct
end
end
if ct>0 then
Duel.Damage(1-tp,ct*800,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--电脑童
--Brilliant Program & Genius Kid || Programma Brillante & Bambino Geniale
--Scripted by: XGlitchy30
xpcall(function() require("expansions/script/glitchylib_vsnemo") end,function() require("script/glitchylib_vsnemo") end)
local s,id,o=GetID()
function s.initial_effect(c)
--[[(Quick Effect): You can send this card from your hand or field to the GY; reveal 1 monster in your Extra Deck, then banish it face-down, and if you do, choose up to 2 of the below values. For the rest of this turn, the chosen values of all face-up monster on the field become the respective original values of the monster banished by this card's effect.
● ATK
● DEF
● Type
● Attribute.]]
local e1=Effect.CreateEffect(c)
e1:Desc(0)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND|LOCATION_MZONE)
e1:SetHintTiming(0,RELEVANT_TIMINGS)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
--FILTERS E1
function s.rmfilter(c,tp)
return not c:IsPublic() and c:IsMonster() and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
--E1
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_EXTRA,0,1,nil,tp)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_EXTRA)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.Select(HINTMSG_CONFIRM,false,tp,s.rmfilter,tp,LOCATION_EXTRA,0,1,1,nil,tp)
if #g>0 then
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
local atk,def,type,attr = tc:GetTextAttack(),tc:GetTextDefense(),tc:GetOriginalRace(),tc:GetOriginalAttribute()
local hasdef = not tc:IsType(TYPE_LINK)
Duel.BreakEffect()
if Duel.Banish(g,POS_FACEDOWN)>0 then
local val=0
for i=1,2 do
local b1 = val&0x1==0
local b2 = val&0x2==0 and hasdef
local b3 = val&0x4==0
local b4 = val&0x8==0
local opt=aux.Option(tp,id,1,b1,b2,b3,b4)
val = val|(2^opt)
end
if val~=0 then
local c=e:GetHandler()
if val&0x1==0x1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(0,EFFECT_FLAG2_WICKED)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
if val&0x2==0x2 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(0,EFFECT_FLAG2_WICKED)
e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetValue(def)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
if val&0x4==0x4 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetValue(type)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
if val&0x8==0x8 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetValue(attr)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
end
end
\ No newline at end of file
......@@ -41,7 +41,7 @@ function cm.dfilter(c)
end
function cm.actcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.cfilter(c)
return c:IsRace(RACE_FIEND) and c:IsAbleToGraveAsCost()
......
......@@ -40,7 +40,7 @@ function cm.dfilter(c)
end
function cm.actcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.cfilter(c)
return c:IsRace(RACE_FIEND) and c:IsAbleToGraveAsCost()
......
......@@ -39,7 +39,7 @@ function cm.dfilter(c)
end
function cm.actcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetFlagEffect(tp,40009560)>0 or Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.tfilter(c,tp)
return ((c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() and c:IsControler(tp)) or c:IsLocation(LOCATION_GRAVE)) and cm.Diablotherhood(c)
......
......@@ -87,13 +87,9 @@ end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.cfilter(c,ft,tp)
return c:IsCode(40009699)
and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup())
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cfilter,3,nil) end
local g=Duel.SelectReleaseGroup(tp,cm.cfilter,3,3,nil)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,3,nil,40009699) end
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,3,3,nil,40009699)
Duel.Release(g,REASON_COST)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -55,6 +55,17 @@ function cm.initial_effect(c)
sg:KeepAlive()
e4:SetLabelObject(sg)
e5:SetLabelObject(e4)
if not cm.global_check then
cm.global_check=true
cm[0]=Card.GetType
Card.GetType=function(tc)
if tc:GetFlagEffect(m)>0 then
return TYPE_SPELL
else
return cm[0](tc)
end
end
end
end
function cm.etg(e,c)
return e:GetHandler():GetEquipGroup():IsContains(c)
......@@ -102,12 +113,6 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMOVE_TYPE)
e3:SetValue(TYPE_EQUIP)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
end
function cm.eqlimit(e,c)
......
......@@ -2,128 +2,129 @@
local m=89387007
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x99),2,2,cm.lcheck)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(cm.indestg)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_PZONE)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.pencon)
e4:SetOperation(cm.penop)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+100000000)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCountLimit(1,m+200000000)
e5:SetCondition(cm.spcon)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
c:RegisterEffect(e5)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x99),2,2,cm.lcheck)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(cm.indestg)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_PZONE)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.pencon)
e4:SetOperation(cm.penop)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+100000000)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCountLimit(1,m+200000000)
e5:SetCondition(cm.spcon)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
c:RegisterEffect(e5)
end
cm.pendulum_level=7
function cm.lfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA
return c:GetSummonLocation()==LOCATION_EXTRA
end
function cm.lcheck(g)
return g:IsExists(cm.lfilter,1,nil)
return g:IsExists(cm.lfilter,1,nil)
end
function cm.indestg(e,c)
return c:IsSetCard(0x99) and c~=e:GetHandler()
return c:IsSetCard(0x99) and c~=e:GetHandler()
end
function cm.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x99) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x99) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.filter,1,c,tp) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end
return Duel.SelectEffectYesNo(tp,c,96)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.filter,1,c,tp) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.filter(c,e:GetHandlerPlayer())
return cm.filter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
end
function cm.pencon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonLocation()==LOCATION_EXTRA
return e:GetHandler():GetSummonLocation()==LOCATION_EXTRA
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetValue(cm.pendvalue)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetCountLimit(1,29432356)
e2:SetValue(cm.pendvalue)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.pendvalue(e,c)
return c:IsSetCard(0x99)
return c:IsSetCard(0x99)
end
function cm.spfilter(c)
return c:IsSetCard(0x99) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden() and (not c:IsLocation(LOCATION_EXTRA) or c:IsFaceup())
return c:IsSetCard(0x99) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden() and (not c:IsLocation(LOCATION_EXTRA) or c:IsFaceup())
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_PZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_PZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_PZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_PZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
if not (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--核成将军
function c98920240.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98920240,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,98920240)
e1:SetCondition(c98920240.spcon)
e1:SetTarget(c98920240.sptg)
e1:SetOperation(c98920240.spop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c98920240.desreptg)
e2:SetValue(c98920240.desrepval)
e2:SetOperation(c98920240.desrepop)
c:RegisterEffect(e2)
end
function c98920240.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c98920240.spfilter(c,e,tp)
return c:IsSetCard(0x1d) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c98920240.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c98920240.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c98920240.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c98920240.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c98920240.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c98920240.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsOnField() and not c:IsReason(REASON_REPLACE) and c:IsSetCard(0x1d)
end
function c98920240.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c98920240.repfilter,1,nil,tp)
and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c98920240.desrepval(e,c)
return c98920240.repfilter(c,e:GetHandlerPlayer())
end
function c98920240.desrepop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
Duel.Hint(HINT_CARD,0,98920240)
end
\ No newline at end of file
......@@ -11,6 +11,7 @@ function c98920338.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetCountLimit(1,29432356)
e1:SetCondition(c98920338.excon)
e1:SetValue(c98920338.pendvalue)
c:RegisterEffect(e1)
......
This diff is collapsed.
This diff is collapsed.
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