Commit 9c5fa1f0 authored by nanahira's avatar nanahira

Merge branch 'master' into new

parents e5b7881c c3fe5ff0
expansions/pics/37564058.jpg

53.4 KB | W: | H:

expansions/pics/37564058.jpg

53.9 KB | W: | H:

expansions/pics/37564058.jpg
expansions/pics/37564058.jpg
expansions/pics/37564058.jpg
expansions/pics/37564058.jpg
  • 2-up
  • Swipe
  • Onion skin
...@@ -31,11 +31,12 @@ function cm.initial_effect(c) ...@@ -31,11 +31,12 @@ function cm.initial_effect(c)
--xm --xm
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE) e2:SetCode(EFFECT_OVERLAY_REMOVE_COST_CHANGE_KOISHI)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.rcon) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetOperation(aux.TRUE) e2:SetTargetRange(1,0)
e2:SetValue(cm.rval)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.immfilter(e,te) function cm.immfilter(e,te)
...@@ -77,9 +78,8 @@ end ...@@ -77,9 +78,8 @@ end
function cm.xmfilter(c) function cm.xmfilter(c)
return Senya.check_set_elem(c) and c:IsType(TYPE_XYZ) and c:GetRank()==4 return Senya.check_set_elem(c) and c:IsType(TYPE_XYZ) and c:GetRank()==4
end end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp) function cm.rval(e,re,tp,ct,r,c)
return (r & REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ) and Senya.check_set_elem(re:GetHandler()) and e:GetHandler():GetOverlayGroup():IsExists(cm.xmfilter,1,nil) if r&REASON_COST~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ) and Senya.check_set_elem(re:GetHandler()) and e:GetHandler():GetOverlayGroup():IsExists(cm.xmfilter,1,nil) and re:GetHandler()~=e:GetHandler() then return 0 else return ct end
and re:GetHandler()~=e:GetHandler()
end end
...@@ -10,11 +10,12 @@ function cm.initial_effect(c) ...@@ -10,11 +10,12 @@ function cm.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLevel,4),2,2) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLevel,4),2,2)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE) e2:SetCode(EFFECT_OVERLAY_REMOVE_COST_CHANGE_KOISHI)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.rcon) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetOperation(aux.TRUE) e2:SetTargetRange(1,0)
e2:SetValue(cm.rval)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(m,0))
...@@ -29,8 +30,8 @@ function cm.initial_effect(c) ...@@ -29,8 +30,8 @@ function cm.initial_effect(c)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp) function cm.rval(e,re,tp,ct,r,c)
return (r & REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ) and Senya.check_set_elem(re:GetHandler()) and e:GetHandler():GetLinkedGroup():IsContains(re:GetHandler()) if r&REASON_COST~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ) and Senya.check_set_elem(re:GetHandler()) and e:GetHandler():GetLinkedGroup():IsContains(re:GetHandler()) then return 0 else return ct end
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsFaceup() and e:GetHandler():GetLinkedGroup():IsContains(c) return c:IsFaceup() and e:GetHandler():GetLinkedGroup():IsContains(c)
......
...@@ -1349,6 +1349,16 @@ function cm.CopySpellModule(c,loc1,loc2,f,con,cost,ctlm,ctlmid,eloc,x) ...@@ -1349,6 +1349,16 @@ function cm.CopySpellModule(c,loc1,loc2,f,con,cost,ctlm,ctlmid,eloc,x)
c:RegisterEffect(e3) c:RegisterEffect(e3)
return e2,e3 return e2,e3
end end
function cm.ProtectedRun(f,...)
if not f then return true end
local params={...}
local ret={}
local res_test=pcall(function()
ret={f(table.unpack(params))}
end)
if not res_test then return false end
return table.unpack(ret)
end
function cm.ForbiddenCost(costf) function cm.ForbiddenCost(costf)
return function(e,tp,eg,ep,ev,re,r,rp,chk) return function(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(1)
...@@ -1366,7 +1376,7 @@ return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -1366,7 +1376,7 @@ return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then if chkc then
local te=e:GetLabelObject() local te=e:GetLabelObject()
local tg=te:GetTarget() local tg=te:GetTarget()
return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)) return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,0,chkc)
end end
local og=Duel.GetFieldGroup(tp,loc1,loc2) local og=Duel.GetFieldGroup(tp,loc1,loc2)
if x then og:Merge(e:GetHandler():GetOverlayGroup()) end if x then og:Merge(e:GetHandler():GetOverlayGroup()) end
...@@ -1405,7 +1415,7 @@ function cm.CopyOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -1405,7 +1415,7 @@ function cm.CopyOperation(e,tp,eg,ep,ev,re,r,rp)
if te:IsHasType(EFFECT_TYPE_ACTIVATE) then if te:IsHasType(EFFECT_TYPE_ACTIVATE) then
e:GetHandler():ReleaseEffectRelation(e) e:GetHandler():ReleaseEffectRelation(e)
end end
if op then op(e,tp,eg,ep,ev,re,r,rp) end cm.ProtectedRun(op,e,tp,eg,ep,ev,re,r,rp)
end end
function cm.CopySpellChainingFilter(c,e,tp,eg,ep,ev,re,r,rp,f) function cm.CopySpellChainingFilter(c,e,tp,eg,ep,ev,re,r,rp,f)
if (c:GetType()==TYPE_SPELL or c:GetType()==TYPE_SPELL+TYPE_QUICKPLAY if (c:GetType()==TYPE_SPELL or c:GetType()==TYPE_SPELL+TYPE_QUICKPLAY
...@@ -1414,7 +1424,7 @@ function cm.CopySpellChainingFilter(c,e,tp,eg,ep,ev,re,r,rp,f) ...@@ -1414,7 +1424,7 @@ function cm.CopySpellChainingFilter(c,e,tp,eg,ep,ev,re,r,rp,f)
local te=c:GetActivateEffect() local te=c:GetActivateEffect()
if te:GetCode()~=EVENT_CHAINING then return false end if te:GetCode()~=EVENT_CHAINING then return false end
local tg=te:GetTarget() local tg=te:GetTarget()
if tg and not tg(e,tp,eg,ep,ev,re,r,rp,0) then return false end if not cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,0) then return false end
return true return true
else return false end else return false end
end end
...@@ -1449,9 +1459,9 @@ return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -1449,9 +1459,9 @@ return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then if tg then
if fchain then if fchain then
tg(e,tp,ceg,cep,cev,cre,cr,crp,1) cm.ProtectedRun(tg,e,tp,ceg,cep,cev,cre,cr,crp,1)
else else
tg(e,tp,eg,ep,ev,re,r,rp,1) cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,1)
end end
end end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
...@@ -1492,7 +1502,7 @@ function cm.InstantCopyTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -1492,7 +1502,7 @@ function cm.InstantCopyTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then if chkc then
local te=e:GetLabelObject() local te=e:GetLabelObject()
local tg=te:GetTarget() local tg=te:GetTarget()
return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)) return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,0,chkc)
end end
local te=re:Clone() local te=re:Clone()
local tg=te:GetTarget() local tg=te:GetTarget()
...@@ -1506,20 +1516,17 @@ function cm.InstantCopyTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -1506,20 +1516,17 @@ function cm.InstantCopyTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetLabel(0) e:SetLabel(0)
local res=false local res=false
if not tg then return true end if not tg then return true end
if not pcall(function() if tres then return cm.ProtectedRun(tg,e,tp,teg,tep,tev,tre,tr,trp,0)
if tres then res=tg(e,tp,teg,tep,tev,tre,tr,trp,0) else return cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,0) end
else res=tg(e,tp,eg,ep,ev,re,r,rp,0) end
end) then return false end
return res
end end
e:SetLabel(te:GetLabel()) e:SetLabel(te:GetLabel())
e:SetCategory(te:GetCategory()) e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
if tg then if tg then
if tres then if tres then
tg(e,tp,teg,tep,tev,tre,tr,trp,1) cm.ProtectedRun(tg,e,tp,teg,tep,tev,tre,tr,trp,1)
else else
tg(e,tp,eg,ep,ev,re,r,rp,1) cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,1)
end end
end end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
......
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