Commit d0d74aa4 authored by Momobako's avatar Momobako

Push by Appveyor

parent ff8d1048
......@@ -14,39 +14,18 @@ function cm.initial_effect(c)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.chk then
cm.chk=true
local ex=Effect.GlobalEffect()
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_ADJUST)
ex:SetOperation(cm.reg)
Duel.RegisterEffect(ex,0)
end
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.rfilter,tp,0xff,0xff,nil)
return g:GetCount()>0
end
function cm.reg(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.rfilter,tp,0xff,0xff,nil)
g:ForEach(function(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and e:GetHandler():GetOverlayGroup():IsExists(aux.FilterEqualFunction(Card.GetOriginalCode,m),1,nil)
return Duel.GetTurnPlayer()==tp
end)
e3:SetTarget(cm.mttg)
e3:SetOperation(cm.mtop)
c:RegisterEffect(e3,true)
c:RegisterFlagEffect(m,0,0,1)
end)
end
function cm.rfilter(c)
return c:IsType(TYPE_XYZ) and c:GetFlagEffect(m)==0
c:RegisterEffect(e3)
end
function cm.mtfilter(c)
return Senya.check_set_elem(c)
......
--夜樱之宴
local m=98600005
local cm=_G["c"..m]
cm.count=0
function cm.initial_effect(c)
local id=cm.count+m
cm.count=cm.count+100
--summon with 5 tribute
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......@@ -25,53 +22,24 @@ function cm.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e3)
--[[
--cannot target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--indes
e2:SetCountLimit(1)
e2:SetCondition(cm.discon)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.indval)
c:RegisterEffect(e3)]]
--negate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(id)
e2:SetCondition(cm.acon)
e2:SetTarget(aux.TargetBoolFunction(Card.IsFaceup))
e2:SetValue(1)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetCondition(cm.acon)
e2:SetTarget(aux.TargetBoolFunction(Card.IsFaceup))
e2:SetValue(TYPE_EFFECT)
c:RegisterEffect(e2)
--local g=Group.CreateGroup()
--g:KeepAlive()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_ADJUST)
--e2:SetLabelObject(g)
e2:SetLabel(id)
e2:SetCondition(cm.regcon)
e2:SetOperation(cm.regop)
c:RegisterEffect(e2)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(cm.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function cm.ttcon(e,c,minc)
if c==nil then return true end
......@@ -86,43 +54,12 @@ function cm.setcon(e,c)
if not c then return true end
return false
end
function cm.indval(e,re,tp)
return tp~=e:GetHandlerPlayer()
end
function cm.acon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.regfilter(c,id)
return c:IsFaceup() and c:IsHasEffect(id) and c:GetFlagEffect(id)==0
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local id=e:GetLabel()
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE) and Duel.IsExistingMatchingCard(cm.regfilter,tp,LOCATION_MZONE,0,1,nil,id)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local id=e:GetLabel()
local g=Duel.GetMatchingGroup(cm.regfilter,tp,LOCATION_MZONE,0,nil,id)
for tc in aux.Next(g) do
tc:RegisterFlagEffect(id,0,0,0)
local e2=Effect.CreateEffect(tc)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetLabel(id)
e2:SetCondition(cm.discon)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
--e2:SetReset(0x1fe1000)
tc:RegisterEffect(e2,true)
end
function cm.eftg(e,c)
return c:IsFaceup() and e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) or not c:IsHasEffect(e:GetLabel()) then return false end
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return Duel.IsChainNegatable(ev)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
......
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