Commit dd676b25 authored by POLYMER's avatar POLYMER

fix

parent 4e0a64a9
......@@ -64,31 +64,6 @@ function cm.roll(min,max)
return cm.r
end
if Duel.GetRandomNumber then cm.roll=Duel.GetRandomNumber end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil)
if not KOISHI_CHECK or #g<36 then e:Reset() return end
local c=e:GetHandler()
local tp=c:GetControler()
if c:IsLocation(LOCATION_DECK) then
Duel.DisableShuffleCheck()
Duel.Exile(c,0)
elseif c:IsLocation(LOCATION_HAND) then
if not cm.r then
cm.r=Duel.GetFieldGroup(0,LOCATION_DECK+LOCATION_HAND,LOCATION_DECK+LOCATION_EXTRA):GetSum(Card.GetCode)
end
local ct=cm.roll(1,#g)-1
local tc=g:Filter(function(c) return c:GetSequence()==ct end,nil):GetFirst()
c:SetEntityCode(tc:GetOriginalCode())
local ini=cm.initial_effect
cm.initial_effect=function() end
c:ReplaceEffect(m,0)
cm.initial_effect=ini
if tc.initial_effect then tc.initial_effect(c) end
Duel.DisableShuffleCheck()
Duel.Exile(tc,0)
end
e:Reset()
end
if not require and loadfile then
function require(str)
require_list=require_list or {}
......@@ -116,4 +91,48 @@ if not require and Duel.LoadScript then
end
return require_list[str]
end
end
function cm.nnfilter(c)
return c:GetOriginalType()~=0x11 and c:GetOriginalType()~=0x1011 and not c.initial_effect
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local ag=Duel.GetMatchingGroup(cm.nnfilter,0,0xff,0xff,nil)
local _TGetID=GetID
for ac in aux.Next(ag) do
local int=ac:GetOriginalCode()
if not _G["c"..int] then
_G["c"..int]={}
_G["c"..int].__index=_G["c"..int]
end
GetID=function()
return _G["c"..int],int
end
require("expansions/script/c"..int)
local ini=ac.initial_effect
if ini then ac.initial_effect(ac) end
end
GetID=_TGetID
local c=e:GetHandler()
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil)
if not KOISHI_CHECK or #g<36 then e:Reset() return end
if c:IsLocation(LOCATION_DECK) then
Duel.DisableShuffleCheck()
Duel.Exile(c,0)
elseif c:IsLocation(LOCATION_HAND) then
if not cm.r then
cm.r=Duel.GetFieldGroup(0,LOCATION_DECK+LOCATION_HAND,LOCATION_DECK+LOCATION_EXTRA):GetSum(Card.GetCode)
end
local ct=cm.roll(1,#g)-1
local tc=g:Filter(function(c) return c:GetSequence()==ct end,nil):GetFirst()
c:SetEntityCode(tc:GetOriginalCode())
local ini=cm.initial_effect
cm.initial_effect=function() end
c:ReplaceEffect(m,0)
cm.initial_effect=ini
if tc.initial_effect then tc.initial_effect(c) end
Duel.DisableShuffleCheck()
Duel.Exile(tc,0)
end
e:Reset()
end
\ No newline at end of file
......@@ -9,7 +9,7 @@ function cm.initial_effect(c)
e00:SetCode(EFFECT_SPSUMMON_PROC)
e00:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e00:SetRange(LOCATION_EXTRA)
e00:SetCondition(aux.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,2,2))
e00:SetCondition(function(...) return aux.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,2,2)(...) and cm[0]==1 and cm[1]==2 end)
e00:SetTarget(aux.XyzLevelFreeTarget(cm.mfilter,cm.xyzcheck,2,2))
e00:SetOperation(aux.XyzLevelFreeOperation(cm.mfilter,cm.xyzcheck,2,2))
e00:SetValue(SUMMON_TYPE_XYZ)
......@@ -81,7 +81,7 @@ function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[1]=0
end
function cm.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA) or st&SUMMON_TYPE_XYZ~=SUMMON_TYPE_XYZ or (st&SUMMON_TYPE_XYZ==SUMMON_TYPE_XYZ and not se)
return not e:GetHandler():IsLocation(LOCATION_EXTRA) or st&SUMMON_TYPE_XYZ~=SUMMON_TYPE_XYZ or (st&SUMMON_TYPE_XYZ==SUMMON_TYPE_XYZ and not se and cm[0]==1 and cm[1]==2)
end
function cm.mfilter(c,xyzc)
return (not xyzc or cm[xyzc:GetControler()]) and c:IsXyzType(TYPE_MONSTER) and (c:IsXyzLevel(xyzc,8) or c:IsRank(8))
......@@ -138,7 +138,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetTargetCard(g)
end
function cm.imfilter(c,e)
return c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
return c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and c:IsCanOverlay()
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
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