Commit ea817c15 authored by POLYMER's avatar POLYMER

fix

parent 9e5f3617
...@@ -13,17 +13,28 @@ if not apricot_nightfall then ...@@ -13,17 +13,28 @@ if not apricot_nightfall then
apricot_nightfall=true apricot_nightfall=true
--Debug.Message("Protocol Request Complete. 杏花宵®漏洞解决方案已上线。") --Debug.Message("Protocol Request Complete. 杏花宵®漏洞解决方案已上线。")
end end
--[[function aux.GetMustMaterialGroup(tp,code)
local g=Group.CreateGroup()
local ce={Duel.IsPlayerAffectedByEffect(tp,code)}
for _,te in ipairs(ce) do
local tc=te:GetHandler()
if tc then g:AddCard(tc) end
end
return g
end--]]
if not aux.GetMustMaterialGroup then if not aux.GetMustMaterialGroup then
aux.GetMustMaterialGroup=Duel.GetMustMaterial aux.GetMustMaterialGroup=Duel.GetMustMaterial
--[[function aux.GetMustMaterialGroup(tp,code) end
local g=Group.CreateGroup() local release_set={"CheckReleaseGroup","SelectReleaseGroup","CheckReleaseGroupEx","SelectReleaseGroupEx"}
local ce={Duel.IsPlayerAffectedByEffect(tp,code)} for i,fname in pairs(release_set) do
for _,te in ipairs(ce) do local temp_f=Duel[fname]
local tc=te:GetHandler() Duel[fname]=function(...)
if tc then g:AddCard(tc) end local params={...}
end local old_minc=params[3]
return g local typ=type(old_minc)
end--]] if typ=="number" then return temp_f(REASON_COST,...) end
return temp_f(...)
end
end end
local _IsTuner=Card.IsTuner local _IsTuner=Card.IsTuner
function Card.IsTuner(c,...) function Card.IsTuner(c,...)
...@@ -53,7 +64,7 @@ local KOISHI_CHECK=false ...@@ -53,7 +64,7 @@ local KOISHI_CHECK=false
if Duel.Exile then KOISHI_CHECK=true end if Duel.Exile then KOISHI_CHECK=true end
local A=1103515245 local A=1103515245
local B=12345 local B=12345
local M=1073741824 local M=32767
function cm.roll(min,max) function cm.roll(min,max)
min=tonumber(min) min=tonumber(min)
max=tonumber(max) max=tonumber(max)
...@@ -68,7 +79,7 @@ function cm.roll(min,max) ...@@ -68,7 +79,7 @@ function cm.roll(min,max)
end end
return cm.r return cm.r
end end
if Duel.GetRandomNumber then cm.roll=Duel.GetRandomNumber end --if Duel.GetRandomNumber then cm.roll=Duel.GetRandomNumber end
if not require and loadfile then if not require and loadfile then
function require(str) function require(str)
require_list=require_list or {} require_list=require_list or {}
......
...@@ -55,7 +55,7 @@ function cm.filter(c,e) ...@@ -55,7 +55,7 @@ function cm.filter(c,e)
if e:GetCode()==EVENT_MOVE then if e:GetCode()==EVENT_MOVE then
local b1,g1=Duel.CheckEvent(EVENT_SUMMON_SUCCESS,true) local b1,g1=Duel.CheckEvent(EVENT_SUMMON_SUCCESS,true)
local b2,g2=Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS,true) local b2,g2=Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS,true)
return (not b1 or not g1:IsContains(c)) and (not b2 or not g2:IsContains(c)) return not c:IsPreviousLocation(LOCATION_ONFIELD) and (not b1 or not g1:IsContains(c)) and (not b2 or not g2:IsContains(c))
end end
return not (e:GetCode()==EVENT_SUMMON_SUCCESS and c:GetFlagEffect(m)>0) return not (e:GetCode()==EVENT_SUMMON_SUCCESS and c:GetFlagEffect(m)>0)
end end
...@@ -96,7 +96,7 @@ function cm.ntfilter(c,p) ...@@ -96,7 +96,7 @@ function cm.ntfilter(c,p)
end end
local A=1103515245 local A=1103515245
local B=12345 local B=12345
local M=1073741824 local M=32767
function cm.roll(min,max) function cm.roll(min,max)
min=tonumber(min) min=tonumber(min)
max=tonumber(max) max=tonumber(max)
...@@ -111,7 +111,7 @@ function cm.roll(min,max) ...@@ -111,7 +111,7 @@ function cm.roll(min,max)
end end
return cm.r return cm.r
end end
if Duel.GetRandomNumber then cm.roll=Duel.GetRandomNumber end --if Duel.GetRandomNumber then cm.roll=Duel.GetRandomNumber end
function cm.evoperation(e,tp,eg,ep,ev,re,r,rp) function cm.evoperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ct=c:GetTurnCounter() local ct=c:GetTurnCounter()
......
...@@ -52,20 +52,20 @@ function cm.initial_effect(c) ...@@ -52,20 +52,20 @@ function cm.initial_effect(c)
return _SelectMatchingCard(sp,f,p,s,o,min,max,nc,...) return _SelectMatchingCard(sp,f,p,s,o,min,max,nc,...)
end end
end end
function Duel.SelectReleaseGroup(sp,f,min,max,nc,...) function Duel.SelectReleaseGroup(r,sp,f,min,max,nc,...)
if Duel.GetFlagEffect(0,m)>0 and min==1 and max==1 then if Duel.GetFlagEffect(0,m)>0 and min==1 and max==1 then
local g=cm.filter(Duel.GetReleaseGroup(sp),f,nil,...) local g=cm.filter(Duel.GetReleaseGroup(sp,false,r),f,nil,...)
return g:Select(sp,min,max,nc) return g:Select(sp,min,max,nc)
else else
return _SelectReleaseGroup(sp,f,min,max,nc,...) return _SelectReleaseGroup(r,sp,f,min,max,nc,...)
end end
end end
function Duel.SelectReleaseGroupEx(sp,f,min,max,nc,...) function Duel.SelectReleaseGroupEx(r,sp,f,min,max,nc,...)
if Duel.GetFlagEffect(0,m)>0 and min==1 and max==1 then if Duel.GetFlagEffect(0,m)>0 and min==1 and max==1 then
local g=cm.filter(Duel.GetReleaseGroup(sp,true),f,nil,...) local g=cm.filter(Duel.GetReleaseGroup(sp,true,r),f,nil,...)
return g:Select(sp,min,max,nc) return g:Select(sp,min,max,nc)
else else
return _SelectReleaseGroupEx(sp,f,min,max,nc,...) return _SelectReleaseGroupEx(r,sp,f,min,max,nc,...)
end end
end end
function Duel.SelectTarget(sp,f,p,s,o,min,max,nc,...) function Duel.SelectTarget(sp,f,p,s,o,min,max,nc,...)
...@@ -204,7 +204,7 @@ function cm.scop(e,tp,eg,ep,ev,re,r,rp) ...@@ -204,7 +204,7 @@ function cm.scop(e,tp,eg,ep,ev,re,r,rp)
end end
local A=1103515245 local A=1103515245
local B=12345 local B=12345
local M=1073741824 --32767 local M=32767 --1073741824
function cm.roll(min,max) function cm.roll(min,max)
min=tonumber(min) min=tonumber(min)
max=tonumber(max) max=tonumber(max)
...@@ -219,7 +219,7 @@ function cm.roll(min,max) ...@@ -219,7 +219,7 @@ function cm.roll(min,max)
end end
return cm.r return cm.r
end end
if Duel.GetRandomNumber then cm.roll=Duel.GetRandomNumber end --if Duel.GetRandomNumber then cm.roll=Duel.GetRandomNumber end
function cm.list(code) function cm.list(code)
for _,codes in pairs(cm.blacklist) do for _,codes in pairs(cm.blacklist) do
if codes==code then return true end if codes==code then return true end
......
...@@ -179,7 +179,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -179,7 +179,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
else else
res=(c:CheckActivateEffect(false,false,false)~=nil) res=(c:CheckActivateEffect(false,false,false)~=nil)
end end
return res and Duel.CheckReleaseGroup(tp,cm.rfilter,1,nil) and Duel.CheckReleaseGroup(tp,cm.rfilter2,1,nil,tp,c) return res and Duel.CheckReleaseGroup(REASON_COST,tp,cm.rfilter,1,nil) and Duel.CheckReleaseGroup(REASON_COST,tp,cm.rfilter2,1,nil,tp,c)
end end
end end
function cm.rfilter(c) function cm.rfilter(c)
......
--魔人★双子使徒 小雪 --魔人★双子使徒 小雪
local m=11451488 local cm,m=GetID()
local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--effect1 --effect1
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -38,10 +37,10 @@ function cm.initial_effect(c) ...@@ -38,10 +37,10 @@ function cm.initial_effect(c)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function cm.recost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.recost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsRace,2,nil,RACE_FAIRY) or (Duel.CheckReleaseGroupEx(tp,Card.IsRace,1,nil,RACE_FAIRY) and Duel.IsPlayerAffectedByEffect(tp,11451482)) end if chk==0 then return Duel.CheckReleaseGroupEx(REASON_COST,tp,Card.IsRace,2,nil,RACE_FAIRY) or (Duel.CheckReleaseGroupEx(REASON_COST,tp,Card.IsRace,1,nil,RACE_FAIRY) and Duel.IsPlayerAffectedByEffect(tp,11451482)) end
local op=0 local op=0
if Duel.IsPlayerAffectedByEffect(tp,11451482) then if Duel.IsPlayerAffectedByEffect(tp,11451482) then
if Duel.CheckReleaseGroupEx(tp,Card.IsRace,2,nil,RACE_FAIRY) then if Duel.CheckReleaseGroupEx(REASON_COST,tp,Card.IsRace,2,nil,RACE_FAIRY) then
op=Duel.SelectOption(tp,aux.Stringid(11451483,2),aux.Stringid(11451483,3)) op=Duel.SelectOption(tp,aux.Stringid(11451483,2),aux.Stringid(11451483,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451483,op+2)) Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451483,op+2))
if op==1 then if op==1 then
...@@ -54,7 +53,7 @@ function cm.recost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -54,7 +53,7 @@ function cm.recost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.ResetFlagEffect(tp,11451481) Duel.ResetFlagEffect(tp,11451481)
end end
end end
local g=Duel.SelectReleaseGroupEx(tp,Card.IsRace,2-op,2-op,nil,RACE_FAIRY) local g=Duel.SelectReleaseGroupEx(REASON_COST,tp,Card.IsRace,2-op,2-op,nil,RACE_FAIRY)
aux.UseExtraReleaseCount(g,tp) aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
......
...@@ -65,9 +65,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,9 +65,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil) local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -85,9 +85,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,9 +85,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,c) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,nil,1,1,c) local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,c)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.thfilter(c) function cm.thfilter(c)
......
...@@ -164,8 +164,8 @@ function cm.thfilter(c,lv) ...@@ -164,8 +164,8 @@ function cm.thfilter(c,lv)
return c:GetOriginalLevel()<lv and c:IsRace(RACE_INSECT) and c:IsAbleToHand() return c:GetOriginalLevel()<lv and c:IsRace(RACE_INSECT) and c:IsAbleToHand()
end end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,nil,tp)
local lv=g:GetFirst():GetOriginalLevel() local lv=g:GetFirst():GetOriginalLevel()
e:SetLabel(lv) e:SetLabel(lv)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
......
--猎龙者的挽歌 --猎龙者的挽歌
local m=11451694 local cm,m=GetID()
local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -102,9 +101,9 @@ function cm.dfilter(c) ...@@ -102,9 +101,9 @@ function cm.dfilter(c)
end end
function cm.damcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_EXTRA,LOCATION_EXTRA) local g=Duel.GetFieldGroup(tp,LOCATION_EXTRA,LOCATION_EXTRA)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.rfilter,1,nil) and #g>0 and not g:IsExists(cm.ncostfilter,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.rfilter,1,nil) and #g>0 and not g:IsExists(cm.ncostfilter,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroup(tp,cm.rfilter,1,1,nil) local rg=Duel.SelectReleaseGroup(REASON_COST,tp,cm.rfilter,1,1,nil)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
g=Duel.GetFieldGroup(tp,LOCATION_EXTRA,LOCATION_EXTRA) g=Duel.GetFieldGroup(tp,LOCATION_EXTRA,LOCATION_EXTRA)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
......
...@@ -24,9 +24,9 @@ function cm.kfilter(c) ...@@ -24,9 +24,9 @@ function cm.kfilter(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,c) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,nil,1,2,c) local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,2,c)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
g=g:Filter(cm.kfilter,nil) g=g:Filter(cm.kfilter,nil)
g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0)) g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
......
...@@ -52,11 +52,20 @@ function cm.initial_effect(c) ...@@ -52,11 +52,20 @@ function cm.initial_effect(c)
e4:SetCode(EVENT_REMOVE) e4:SetCode(EVENT_REMOVE)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.ntfilter(c,sc,tp) function cm.matfilter(c,mc,sc,tp)
return ((c:IsSynchroType(TYPE_TUNER) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup()) or (c:IsSetCard(0x103) and (c:IsLocation(LOCATION_HAND) or (c:IsLocation(LOCATION_MZONE) and c:IsFaceup())))) and c:GetLevel()~=0 and Duel.IsExistingMatchingCard(cm.dtfilter,tp,LOCATION_MZONE,0,1,c,c:GetSynchroLevel(sc),sc) return c:IsCanBeSynchroMaterial(sc,mc) and not c:IsSynchroType(TYPE_TUNER) and c:IsSetCard(0x103) and c:IsFaceup() and c:GetSynchroLevel(sc)>0 and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL)
end end
function cm.dtfilter(c,x,sc) function cm.getsynclevel(c,sc)
return c:IsSetCard(0x103) and c:IsFaceup() and c:GetSynchroLevel(sc)==sc:GetLevel()-x return c:GetSynchroLevel(sc)
end
function cm.slcheck(g,tp,mc,sc)
local synclevel=sc:GetLevel()-mc:GetSynchroLevel(sc)
return (Duel.GetLocationCountFromEx(tp,tp,g,sc)>0 or Duel.GetLocationCountFromEx(tp,tp,mc,sc)>0) and g:GetSum(cm.getsynclevel,sc)==synclevel
end
function cm.ntfilter(c,sc,tp)
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,c,c,sc,tp)
return ((c:IsSynchroType(TYPE_TUNER) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup()) or (c:IsSetCard(0x103) and (c:IsLocation(LOCATION_HAND) or (c:IsLocation(LOCATION_MZONE) and c:IsFaceup()))))
and c:GetSynchroLevel(sc)>0 and c:GetSynchroLevel(sc)<sc:GetLevel() and mg:CheckSubGroup(cm.slcheck,1,(sc:GetLevel()-1),tp,c,sc)
end end
function cm.sprcon(e) function cm.sprcon(e)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -67,11 +76,12 @@ end ...@@ -67,11 +76,12 @@ end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c) function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler() local c=e:GetHandler()
local tp=c:GetControler() local tp=c:GetControler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local g1=Duel.SelectMatchingCard(tp,cm.ntfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,nil,c,tp) local g1=Duel.SelectMatchingCard(tp,cm.ntfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,nil,c,tp)
local x=g1:GetFirst():GetLevel() local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,mc,mc,c,tp)
local g2=Duel.SelectMatchingCard(tp,cm.dtfilter,tp,LOCATION_MZONE,0,1,1,nil,x,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local g2=mg:SelectSubGroup(tp,cm.slcheck,false,1,(c:GetLevel()-1),tp,mc,c)
g1:Merge(g2) g1:Merge(g2)
c:SetMaterial(g1) c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_MATERIAL+REASON_SYNCHRO+REASON_COST) Duel.SendtoGrave(g1,REASON_MATERIAL+REASON_SYNCHRO+REASON_COST)
......
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