Commit 66eb67ce authored by 聖園ミカ's avatar 聖園ミカ 🐟

byd

parent 046043bb
No preview for this file type
expansions/pics/33701500.jpg

16.3 KB | W: | H:

expansions/pics/33701500.jpg

13.9 KB | W: | H:

expansions/pics/33701500.jpg
expansions/pics/33701500.jpg
expansions/pics/33701500.jpg
expansions/pics/33701500.jpg
  • 2-up
  • Swipe
  • Onion skin
--【背景音台】POP TEAM EPIC - old
--function c33701499.initial_effect(c)
--card,code,oathcount,bgmHintID(卡片,卡号,契约回合,音乐提示)
--card,code,oathcount,bgmHintID(<cardname>,<cardID>,<contractTurn>,<BGMFileName>)
--bgmhandle(c,33701499,6,1)
--end
function bgmhandle(c,code,count,bgmid,con,cost,tg,op)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
if con then e0:SetCondition(con) end
e0:SetCost((cost and {cost} or {function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if bgmid then Duel.Hint(HINT_MUSIC,0,aux.Stringid(code,bgmid)) end
end})[1])
if tg then e0:SetTarget(tg) end
if op then e0:SetOperation(op) end
--indes
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
--Cannot activate
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CANNOT_NEGATE)
e3:SetTargetRange(1, 0)
e3:SetValue(function(e,re,tp)
return re:GetHandler():IsType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE) end)
--cannot set
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SSET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(1, 0)
e4:SetTarget(function(e,c)
return c:IsType(TYPE_FIELD) end)
c:RegisterEffect(e4)
--Auto oath count
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_FZONE)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(1082946)==0 then
c:RegisterFlagEffect(1082946,RESET_PHASE+PHASE_END+RESET_SELF_TURN,0,count)
c:SetTurnCounter(0)
end
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct>=count then
Duel.Destroy(c,REASON_RULE)
c:ResetFlagEffect(1082946)
end end)
c:RegisterEffect(e0)
c:RegisterEffect(e1)
c:RegisterEffect(e2)
c:RegisterEffect(e3)
c:RegisterEffect(e4)
_G["c"..code][c] = e1
end
\ No newline at end of file
--【背景音台】POP TEAM EPIC --【背景音台】POP TEAM EPIC
function c33701500.initial_effect(c) local s,id=GetID()
--card,code,oathcount,bgmHintID(卡片,卡号,契约回合,音乐提示) if not GLITCHYLIB_LOADED then
--card,code,oathcount,bgmHintID(<cardname>,<cardID>,<contractTurn>,<BGMFileName>) Duel.LoadScript("glitchylib_vsnemo.lua")
bgmhandle(c,33701500,6,1)
end end
function bgmhandle(c,code,count,bgmid,con,cost,tg,op) if not TYPE_SOUNDSTAGE then
--Activate Duel.LoadScript("glitchylib_soundstage.lua")
local e0=Effect.CreateEffect(c) end
e0:SetType(EFFECT_TYPE_ACTIVATE) function s.initial_effect(c)
e0:SetCode(EVENT_FREE_CHAIN) --[[Template to add a Sound Stage procedure
if con then e0:SetCondition(con) end 1) Card the procedure will be registered to
e0:SetCost((cost and {cost} or {function(e,tp,eg,ep,ev,re,r,rp,chk) 2) Activation effect of the card (must be EFFECT_TYPE_ACTIVATE)
if chk==0 then return true end 3) ID of the card
if bgmid then Duel.Hint(HINT_MUSIC,0,aux.Stringid(code,bgmid)) end 4) Contract turns of the card
end})[1]) 5) Description string ID that contains the name of the music file that plays when the card is activated (aux.Stringid is called by passing the arguments (3) and (5))
if tg then e0:SetTarget(tg) end aux.AddSoundStageProc(c,卡片发动效果,卡号,契约回合数,音乐文件名CDB提示ID)
if op then e0:SetOperation(op) end ]]
--indes
local e2 = Effect.CreateEffect(c) aux.AddSoundStageProc(c,c:Activation(),id,6,1)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
--Cannot activate
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE)
e3:SetTargetRange(1, 0)
e3:SetValue(function(e,re,tp)
return re:GetHandler():IsType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE) end)
--cannot set
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SSET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(1, 0)
e4:SetTarget(function(e,c)
return c:IsType(TYPE_FIELD) end)
c:RegisterEffect(e4)
--Auto oath count
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_FZONE)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(1082946)==0 then
c:RegisterFlagEffect(1082946,RESET_PHASE+PHASE_END+RESET_SELF_TURN,0,count)
c:SetTurnCounter(0)
end
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct>=count then
Duel.Destroy(c,REASON_RULE)
c:ResetFlagEffect(1082946)
end end)
c:RegisterEffect(e0)
c:RegisterEffect(e1)
c:RegisterEffect(e2)
c:RegisterEffect(e3)
c:RegisterEffect(e4)
_G["c"..code][c] = e1
end end
\ No newline at end of file
EFFECT_NO_RECOVER = 33720228 --Affected player cannot gain LP by card effects
aux.EnabledRegisteredEffectMods={}
--EFFECT TABLES --EFFECT TABLES
function Auxiliary.CheckAlreadyRegisteredEffects()
if aux.CheckAlreadyRegisteredEffectsFlag then return end
aux.CheckAlreadyRegisteredEffectsFlag=true
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCode(EVENT_PREDRAW)
e1:OPT()
e1:SetOperation(function(e)
local g=Duel.Group(aux.TRUE,0,LOCATION_ALL,LOCATION_ALL,nil)
for tc in aux.Next(g) do
if not global_card_effect_table[tc] then
local code=tc:GetOriginalCode()
Duel.SetMetatable(tc, _G["c"..code])
tc:ReplaceEffect(CARD_CYBER_HARPIE_LADY,0,0)
tc:SetStatus(STATUS_EFFECT_REPLACED,false)
local s=getmetatable(c)
s.initial_effect(tc)
end
end
end)
Duel.RegisterEffect(e1,0)
end
function Effect.GLGetTargetRange(e)
if not global_target_range_effect_table[e] then return false,false end
local s=global_target_range_effect_table[e][1]
local o=global_target_range_effect_table[e][2]
return s,o
end
--Global Card Effect Table --Global Card Effect Table
function Card.GetEffects(c)
local eset=global_card_effect_table[c]
if not eset then return {} end
-- local ct=#eset
-- for i = 1,ct do
-- local e=eset[i]
-- if e and e:WasReset(c) then
-- table.remove(global_card_effect_table[c],i)
-- end
-- end
return global_card_effect_table[c]
end
if not global_card_effect_table_global_check then if not global_card_effect_table_global_check then
global_card_effect_table_global_check=true global_card_effect_table_global_check=true
global_card_effect_table={} global_card_effect_table={}
...@@ -9,10 +58,53 @@ if not global_card_effect_table_global_check then ...@@ -9,10 +58,53 @@ if not global_card_effect_table_global_check then
table.insert(global_card_effect_table[self],e) table.insert(global_card_effect_table[self],e)
local code=e:GetCode() local code=e:GetCode()
local selfp,oppo=e:GLGetTargetRange()
local condition,cost,tg,op,val=e:GetCondition(),e:GetCost(),e:GetTarget(),e:GetOperation(),e:GetValue() local condition,cost,tg,op,val=e:GetCondition(),e:GetCost(),e:GetTarget(),e:GetOperation(),e:GetValue()
--Damage Replacement Effects (necessary for cards like Sepialife - Passive On Pink) --Damage Replacement Effects (necessary for cards like Sepialife - Passive On Pink)
if code==EFFECT_REVERSE_DAMAGE or code==EFFECT_REFLECT_DAMAGE then if code==EFFECT_REVERSE_DAMAGE then
local newcon = function(e)
local tp=e:GetHandlerPlayer()
return (not condition or condition(e)) and not aux.IsChangedDamage and not aux.IsReplacedDamage
end
e:SetCondition(newcon)
--Fix interaction between EFFECT_NO_RECOVER and damage-recovery swap effects (such as Muscle Medic)
if aux.EnabledRegisteredEffectMods[EFFECT_NO_RECOVER] then
local newval = function(e,re,r,rp,rc)
local res0=val
if type(val)=="function" then
res0=val(e,re,r,rp,rc)
end
if aux.IsDamageFunctionCalled then
return res0
end
local tp=e:GetHandlerPlayer()
local dam0,dam1=Duel.GetBattleDamage(0),Duel.GetBattleDamage(1)
local p=dam0>0 and 0 or dam1>0 and 1 or nil
if not p then return res0 end
local eset={Duel.IsPlayerAffectedByEffect(p,EFFECT_NO_RECOVER)}
if #eset==0 then
return res0
else
if (selfp==0 and p==tp) or (oppo==0 and p==1-tp) then return res0 end
for _,ce in ipairs(eset) do
local res=ce:Evaluate(p,0,r)
if res then
return false
end
end
return res0
end
end
e:SetValue(newval)
end
elseif code==EFFECT_REFLECT_DAMAGE then
local newcon = function(...) local newcon = function(...)
return (not condition or condition(...)) and not aux.IsChangedDamage and not aux.IsReplacedDamage return (not condition or condition(...)) and not aux.IsChangedDamage and not aux.IsReplacedDamage
end end
...@@ -99,6 +191,7 @@ if not global_card_effect_table_global_check then ...@@ -99,6 +191,7 @@ if not global_card_effect_table_global_check then
end end
end end
if aux.PreventSecondRegistration then return end
return self.register_global_card_effect_table(self,e,forced) return self.register_global_card_effect_table(self,e,forced)
end end
end end
...@@ -116,11 +209,20 @@ if not global_duel_effect_table_global_check then ...@@ -116,11 +209,20 @@ if not global_duel_effect_table_global_check then
local condition,cost,tg,op,val=e:GetCondition(),e:GetCost(),e:GetTarget(),e:GetOperation(),e:GetValue() local condition,cost,tg,op,val=e:GetCondition(),e:GetCost(),e:GetTarget(),e:GetOperation(),e:GetValue()
--Damage Replacement Effects --Damage Replacement Effects
if code==EFFECT_REVERSE_DAMAGE or code==EFFECT_REFLECT_DAMAGE then if code==EFFECT_REVERSE_DAMAGE then
local newcon = function(e,...)
local tp=e:GetHandlerPlayer()
return (not condition or condition(...)) and not aux.IsChangedDamage and not aux.IsReplacedDamage
and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_NO_RECOVER)
end
e:SetCondition(newcon)
elseif code==EFFECT_REFLECT_DAMAGE then
local newcon = function(...) local newcon = function(...)
return (not condition or condition(...)) and not aux.IsChangedDamage and not aux.IsReplacedDamage return (not condition or condition(...)) and not aux.IsChangedDamage and not aux.IsReplacedDamage
end end
e:SetCondition(newcon) e:SetCondition(newcon)
elseif code==EFFECT_CHANGE_DAMAGE then elseif code==EFFECT_CHANGE_DAMAGE then
local newcon = function(...) local newcon = function(...)
return (not condition or condition(...)) and not aux.IsReplacedDamage return (not condition or condition(...)) and not aux.IsReplacedDamage
...@@ -202,6 +304,7 @@ if not global_duel_effect_table_global_check then ...@@ -202,6 +304,7 @@ if not global_duel_effect_table_global_check then
end end
end end
if aux.PreventSecondRegistration then return end
return Duel.register_global_duel_effect_table(e,tp) return Duel.register_global_duel_effect_table(e,tp)
end end
end end
\ No newline at end of file
--Library for Sound Stage Cards
TYPE_SOUNDSTAGE = 0x2000000000
FLAG_SOUNDSTAGE_CONTRACT = 1082946
--Handle card type overwriting
Auxiliary.SoundStage={}
local get_type, get_orig_type, get_prev_type_field, get_active_type, is_active_type, get_reason, get_fusion_type, get_synchro_type, get_xyz_type, get_link_type, get_ritual_type =
Card.GetType, Card.GetOriginalType, Card.GetPreviousTypeOnField, Effect.GetActiveType, Effect.IsActiveType, Card.GetReason, Card.GetFusionType, Card.GetSynchroType, Card.GetXyzType, Card.GetLinkType, Card.GetRitualType
Card.GetType=function(c,scard,sumtype,p)
local tpe=scard and get_type(c,scard,sumtype,p) or get_type(c)
if Auxiliary.SoundStage[c] then
tpe=(tpe&(~TYPE_FIELD))|TYPE_SOUNDSTAGE
end
return tpe
end
Card.GetOriginalType=function(c)
local tpe=get_orig_type(c)
if Auxiliary.SoundStage[c] then
tpe=(tpe&(~TYPE_FIELD))|TYPE_SOUNDSTAGE
end
return tpe
end
Card.GetPreviousTypeOnField=function(c)
local tpe=get_prev_type_field(c)
if Auxiliary.SoundStage[c] then
tpe=(tpe&(~TYPE_FIELD))|TYPE_SOUNDSTAGE
end
return tpe
end
Effect.GetActiveType=function(e)
local tpe=get_active_type(e)
local c = e:GetType()&0x7f0>0 and e:GetHandler() or e:GetOwner()
if not (e:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsType(TYPE_PENDULUM)) and c:IsType(TYPE_SOUNDSTAGE) then
tpe=(tpe&(~TYPE_FIELD))|TYPE_SOUNDSTAGE
end
return tpe
end
Effect.IsActiveType=function(e,typ)
return e:GetActiveType()&typ>0
end
Card.GetReason=function(c)
local rs=get_reason(c)
local rc=c:GetReasonCard()
if rc and Auxiliary.SoundStage[rc] then
rs=rs|REASON_DRIVE
end
return rs
end
Card.GetFusionType=function(c)
local tpe=get_fusion_type(c)
if Auxiliary.SoundStage[c] then
tpe=(tpe&(~TYPE_FIELD))|TYPE_SOUNDSTAGE
end
return tpe
end
Card.GetSynchroType=function(c)
local tpe=get_synchro_type(c)
if Auxiliary.SoundStage[c] then
tpe=(tpe&(~TYPE_FIELD))|TYPE_SOUNDSTAGE
end
return tpe
end
Card.GetXyzType=function(c)
local tpe=get_xyz_type(c)
if Auxiliary.SoundStage[c] then
tpe=(tpe&(~TYPE_FIELD))|TYPE_SOUNDSTAGE
end
return tpe
end
Card.GetLinkType=function(c)
local tpe=get_link_type(c)
if Auxiliary.SoundStage[c] then
tpe=(tpe&(~TYPE_FIELD))|TYPE_SOUNDSTAGE
end
return tpe
end
Card.GetRitualType=function(c)
local res=get_ritual_type(c)
if Auxiliary.SoundStage[c] then
tpe=(tpe&(~TYPE_FIELD))|TYPE_SOUNDSTAGE
end
return tpe
end
function Auxiliary.AddOrigSoundStageType(c)
Auxiliary.SoundStage[c]=true
end
--Add Sound Stage procedure
function Auxiliary.AddSoundStageProc(c,e,id,count,bgmid)
Auxiliary.SoundStage[c]=true
if id and bgmid then
local cost=e:GetCost()
e:SetCost(function(_e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not cost or cost(_e,tp,eg,ep,ev,re,r,rp,chk) end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(id,bgmid))
end)
end
--Cannot be destroyed
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE|EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--Cannot be replaced by activating/Setting Field Spells
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET|EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(1,0)
e3:SetValue(function(_e,re,tp)
return re:GetHandler():IsType(TYPE_FIELD|TYPE_SOUNDSTAGE) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SSET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET|EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_UNCOPYABLE)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(1,0)
e4:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_FIELD|TYPE_SOUNDSTAGE))
c:RegisterEffect(e4)
--Send to GY after contract expiration
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_PHASE|PHASE_END)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_UNCOPYABLE)
e6:SetCountLimit(1)
e6:SetRange(LOCATION_FZONE)
e6:SetOperation(aux.SoundStageSelfToGY(count))
c:RegisterEffect(e6)
--Modify TCG/OCG cards (see e5)
if not aux.SoundStageModCheck then
aux.SoundStageModCheck=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
ge1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
ge1:SetCode(EVENT_PREDRAW)
ge1:OPT()
ge1:SetOperation(aux.SoundStageMod)
Duel.RegisterEffect(ge1,0)
end
return e6
end
Auxiliary.SoundStageModCodes={
[73468603]=173468603; --Set Rotation
[47404795]=147404795; --Abyss Actor - Super Producer
[87498729]=187498729; --Fallen of the Tistina
[30676200]=130676200; --Hero of the Ashened City
[86239173]=186239173; --Horned Saurus
[30680659]=130680659; --Water Enchantress of the Temple
[30453613]=130453613; --Awakening of Veidos
[25964547]=125964547; --Dream Mirror Hypnagogia
[65305978]=165305978; --Fire King Sanctuary
[49568943]=149568943; --Vaylantz World - Shinra Bansho
[75952542]=175952542; --Vaylantz World - Konig Wissen
}
function Auxiliary.SoundStageMod(e,tp)
local g=Duel.GetMatchingGroup(function(c) return aux.SoundStageModCodes[c:GetOriginalCode()] end,0,LOCATION_ALL,LOCATION_ALL,nil)
for tc in aux.Next(g) do
local code=tc:GetOriginalCode()
local modcode=aux.SoundStageModCodes[code]
tc:ReplaceEffect(modcode,0,0)
end
end
function Card.IsCanPlaceInFieldZone(c,placing_player,receiving_player)
receiving_player = receiving_player or placing_player
local fc=Duel.GetFieldGroup(receiving_player,LOCATION_FZONE,0):GetFirst()
if fc and fc:IsOriginalType(TYPE_SOUNDSTAGE) then
return false
end
return true
end
function Auxiliary.SoundStageSelfToGY(count)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(FLAG_SOUNDSTAGE_CONTRACT)==0 then
c:RegisterFlagEffect(FLAG_SOUNDSTAGE_CONTRACT,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_END,0,count)
c:SetTurnCounter(0)
end
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct>=count then
Duel.SendtoGrave(c,nil,REASON_RULE)
end
end
end
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