Commit 397aeb6c authored by 聖園ミカ's avatar 聖園ミカ 🐟

Replace c22134505.lua

parent 58e0131e
Pipeline #30849 canceled with stages
in 1 minute and 23 seconds
--荒芜之地·粉碎奇迹
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableCounterPermit(0x760,LOCATION_PZONE+LOCATION_MZONE)
-- 让这张卡就算被无效也能放指示物
-- 以后定义哪张卡可以放指示物要在这里输入0x760
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e31:SetCode(EFFECT_COUNTER_PERMIT|0x760)
e31:SetRange(LOCATION_PZONE+LOCATION_MZONE)
c:RegisterEffect(e31)
--pendulum summon
aux.EnablePendulumAttribute(c)
--add counter
......@@ -19,6 +26,32 @@ function s.initial_effect(c)
e1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
-- 用于让卡被无效之后指示物也不会被去除
-- 检测是否出现指示物跳变
local ec1=Effect.CreateEffect(c)
ec1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec1:SetCode(EVENT_CHAIN_SOLVED)
ec1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec1:SetOperation(s.chkcop)
c:RegisterEffect(ec1)
-- 检测指示物是否属于自主减少
local ec0=Effect.CreateEffect(c)
ec0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
ec0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec0:SetCode(EVENT_REMOVE_COUNTER+0x760)
ec0:SetOperation(s.chkncop)
c:RegisterEffect(ec0)
-- 指示物跳变时,检测这次变化是否是由效果无效而引起的,如果是,则加上失去的那些
local ec2=Effect.CreateEffect(c)
ec2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec2:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec2:SetCode(EVENT_CUSTOM+id)
ec2:SetOperation(s.htccop)
c:RegisterEffect(ec2)
--special summon by PZONE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
......@@ -110,10 +143,9 @@ end
--游戏开始后的第一个抽卡阶段检测卡组里有没有同名卡,卡号(2134500)标识每张卡都不用改
--会多次检测,但是只会施加一个标识
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(nil,tp,0xFF,0,nil)
local gg = Duel.GetMatchingGroup(nil,tp,0x3,0,nil)
if aux.dncheck(gg) and Duel.GetFlagEffect(tp,22134500)<=0 then
Duel.RegisterFlagEffect(tp,22134500,0,0,0)
-- debug用 Duel.Draw(tp,1,REASON_RULE)
end
end
--通用自肃1,卡号(2134500)标识每张卡都不用改
......@@ -275,3 +307,30 @@ end
function s.tdfilter2(c)
return c:IsAbleToDeck()
end
-- 用于让卡被无效之后指示物也不会被去除
function s.chkcop(e,tp,eg,ep,ev,re,r,rp)
local cnt = e:GetHandler():GetCounter(0x760)
local chc = e:GetLabel()
if chc then
if chc>=cnt then
e:SetLabel(chc)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,0,0)
return
end
end
e:SetLabel(cnt)
end
function s.chkncop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(22134501)==0 then
e:GetHandler():RegisterFlagEffect(22134501,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
end
function s.htccop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:GetFlagEffect(22134501)<=0 and c:IsDisabled() and c:IsLocation(LOCATION_PZONE+LOCATION_MZONE) then
local cnt = re:GetLabel()
if not (Duel.IsCanAddCounter(c:GetOwner(),0x760,cnt,c) and cnt >0) then return end
c:AddCounter(0x760,cnt)
end
end
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