Commit 4efd33e5 authored by POLYMER's avatar POLYMER

fix

parent 4c4d1f6b
...@@ -36,10 +36,11 @@ function cm.initial_effect(c) ...@@ -36,10 +36,11 @@ function cm.initial_effect(c)
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD) e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_QP_ACT_IN_SET_TURN) e6:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e6:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE) e6:SetProperty(EFFECT_FLAG_SET_AVAILABLE) --+EFFECT_FLAG_IGNORE_IMMUNE)
e6:SetRange(LOCATION_FZONE) e6:SetRange(LOCATION_FZONE)
e6:SetTargetRange(LOCATION_SZONE,0) e6:SetTargetRange(LOCATION_SZONE,0)
e6:SetDescription(aux.Stringid(m,0)) e6:SetDescription(aux.Stringid(m,0))
e6:SetCondition(cm.con)
e6:SetCost(cm.costt) e6:SetCost(cm.costt)
c:RegisterEffect(e6) c:RegisterEffect(e6)
local e7=e6:Clone() local e7=e6:Clone()
......
...@@ -122,7 +122,7 @@ function cm.checkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -122,7 +122,7 @@ function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasCategory(CATEGORY_COIN) then return end if not re:IsHasCategory(CATEGORY_COIN) then return end
local se=Effect.CreateEffect(e:GetHandler()) local se=Effect.CreateEffect(e:GetHandler())
se:SetType(EFFECT_TYPE_SINGLE) se:SetType(EFFECT_TYPE_SINGLE)
se:SetCode(0x20000000+m) se:SetCode(EFFECT_FLAG_EFFECT+m)
se:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) se:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
se:SetReset(RESET_PHASE+PHASE_END,2) se:SetReset(RESET_PHASE+PHASE_END,2)
rc:RegisterEffect(se,true) rc:RegisterEffect(se,true)
...@@ -307,7 +307,7 @@ function cm.shfilter(c) ...@@ -307,7 +307,7 @@ function cm.shfilter(c)
return c:GetFlagEffect(m)>0 return c:GetFlagEffect(m)>0
end end
function cm.chkval(e,te) function cm.chkval(e,te)
if e:GetHandler():GetFlagEffect(m-10)>0 and te and te:GetHandler() and not te:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and (te:GetCode()<0x10000 or te:IsHasType(EFFECT_TYPE_ACTIONS)) then if e:GetHandler():GetFlagEffect(m-10)>0 and te and te:GetHandler() and not te:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and te:IsHasType(EFFECT_TYPE_ACTIONS) then
local tp=e:GetOwnerPlayer() local tp=e:GetOwnerPlayer()
local g=e:GetLabelObject() local g=e:GetLabelObject()
g:ForEach(Card.ResetFlagEffect,m-10) g:ForEach(Card.ResetFlagEffect,m-10)
...@@ -334,7 +334,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -334,7 +334,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,5)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,5))
local tc=sg:Select(tp,1,1,nil):GetFirst() local tc=sg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode()) Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
local eset={tc:IsHasEffect(0x20000000+m)} local eset={tc:IsHasEffect(EFFECT_FLAG_EFFECT+m)}
local te=eset[1]:GetLabelObject() local te=eset[1]:GetLabelObject()
if #eset>1 then if #eset>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,6)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,6))
......
...@@ -196,7 +196,7 @@ function cm.shfilter(c) ...@@ -196,7 +196,7 @@ function cm.shfilter(c)
return c:GetFlagEffect(m)>0 return c:GetFlagEffect(m)>0
end end
function cm.chkval(e,te) function cm.chkval(e,te)
if te and te:GetHandler() and not te:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and (te:GetCode()<0x10000 or te:IsHasType(EFFECT_TYPE_ACTIONS)) then if te and te:GetHandler() and not te:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and te:IsHasType(EFFECT_TYPE_ACTIONS) then
local tp=te:GetOwnerPlayer() local tp=te:GetOwnerPlayer()
local e3=Effect.CreateEffect(e:GetOwner()) local e3=Effect.CreateEffect(e:GetOwner())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -206,6 +206,7 @@ function cm.chkval(e,te) ...@@ -206,6 +206,7 @@ function cm.chkval(e,te)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e3,tp)
e:SetValue(aux.FALSE) e:SetValue(aux.FALSE)
e:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e:SetDescription(0)
if tp==e:GetOwnerPlayer() then if tp==e:GetOwnerPlayer() then
if SetCardData then if SetCardData then
Duel.Hint(24,0,aux.Stringid(m,3)) Duel.Hint(24,0,aux.Stringid(m,3))
......
...@@ -257,7 +257,7 @@ function cm.thop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -257,7 +257,7 @@ function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
g=g:Filter(Card.IsRelateToEffect,nil,e) g=g:Filter(Card.IsRelateToEffect,nil,e)
if #g==0 then return end if #g==0 then return end
g:KeepAlive() g:KeepAlive()
g:ForEach(Card.RegisterFlagEffect,m-10,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET,EFFECT_FLAG_CLIENT_HINT,1,aux.Stringid(m,10)) g:ForEach(Card.RegisterFlagEffect,m-10,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,10))
for tc in aux.Next(g) do for tc in aux.Next(g) do
local ge2=Effect.CreateEffect(c) local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_SINGLE) ge2:SetType(EFFECT_TYPE_SINGLE)
...@@ -271,7 +271,7 @@ function cm.thop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -271,7 +271,7 @@ function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.chkval(e,te) function cm.chkval(e,te)
if e:GetHandler():GetFlagEffect(m-10)>0 and te and te:GetHandler() and not te:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and (te:GetCode()<0x10000 or te:IsHasType(EFFECT_TYPE_ACTIONS)) then if e:GetHandler():GetFlagEffect(m-10)>0 and te and te:GetHandler() and not te:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and te:IsHasType(EFFECT_TYPE_ACTIONS) then
local g=e:GetLabelObject() local g=e:GetLabelObject()
g:ForEach(Card.ResetFlagEffect,m-10) g:ForEach(Card.ResetFlagEffect,m-10)
if Duel.GetFlagEffect(tp,0xffff+m)==0 then if Duel.GetFlagEffect(tp,0xffff+m)==0 then
......
...@@ -120,7 +120,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -120,7 +120,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
de:SetDescription(aux.Stringid(11451961+#eset,6)) de:SetDescription(aux.Stringid(11451961+#eset,6))
de:SetLabel(eid) de:SetLabel(eid)
de:SetType(EFFECT_TYPE_FIELD) de:SetType(EFFECT_TYPE_FIELD)
de:SetCode(0x20000000+11451961) de:SetCode(EFFECT_FLAG_EFFECT+11451961)
de:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) de:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
de:SetTargetRange(1,0) de:SetTargetRange(1,0)
Duel.RegisterEffect(de,tp) Duel.RegisterEffect(de,tp)
...@@ -157,7 +157,7 @@ function cm.reop(e,tp,eg,ep,ev,re,r,rp) ...@@ -157,7 +157,7 @@ function cm.reop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.efilter(e,te) function cm.efilter(e,te)
if e:GetHandler():GetFlagEffect(m+0xffffff)>0 and te and te:GetHandler() and not te:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and (te:GetCode()<0x10000 or te:IsHasType(EFFECT_TYPE_ACTIONS)) and te:GetCode()~=16 and te:GetCode()~=359 then if e:GetHandler():GetFlagEffect(m+0xffffff)>0 and te and te:GetHandler() and not te:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and te:IsHasType(EFFECT_TYPE_ACTIONS) then
if KOISHI_CHECK then if KOISHI_CHECK then
Duel.DisableActionCheck(true) Duel.DisableActionCheck(true)
pcall(Duel.HintSelection,Group.FromCards(e:GetHandler())) pcall(Duel.HintSelection,Group.FromCards(e:GetHandler()))
......
...@@ -130,7 +130,7 @@ function s.startop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -130,7 +130,7 @@ function s.startop2(e,tp,eg,ep,ev,re,r,rp)
pc:RegisterEffect(e1,true) pc:RegisterEffect(e1,true)
if s.humancheck(0) then if s.humancheck(0) then
s.IsHuman[1]=true s.IsHuman[1]=true
s.dealcard2(17,0) s.dealcard2(17,0)
else else
landlord=2 landlord=2
Debug.Message("1号位玩家被识别为人机!") Debug.Message("1号位玩家被识别为人机!")
...@@ -141,7 +141,7 @@ function s.startop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -141,7 +141,7 @@ function s.startop2(e,tp,eg,ep,ev,re,r,rp)
else else
Debug.Message("2号位玩家被识别为人机!") Debug.Message("2号位玩家被识别为人机!")
end end
s.skip() s.skip(2)
local ge0=Effect.GlobalEffect() local ge0=Effect.GlobalEffect()
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge0:SetCode(EVENT_PREDRAW) ge0:SetCode(EVENT_PREDRAW)
...@@ -149,62 +149,12 @@ function s.startop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -149,62 +149,12 @@ function s.startop2(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(ge0,0) Duel.RegisterEffect(ge0,0)
end end
end end
local races = {
{value = 0x1, name = "战士"},
{value = 0x2, name = "魔法师"},
{value = 0x4, name = "天使"},
{value = 0x8, name = "恶魔"},
{value = 0x10, name = "不死"},
{value = 0x20, name = "机械"},
{value = 0x40, name = "水"},
{value = 0x80, name = "炎"},
{value = 0x100, name = "岩石"},
{value = 0x200, name = "鸟兽"},
{value = 0x400, name = "植物"},
{value = 0x800, name = "昆虫"},
{value = 0x1000, name = "雷"},
{value = 0x2000, name = "龙"},
{value = 0x4000, name = "兽"},
{value = 0x8000, name = "兽战士"},
{value = 0x10000, name = "恐龙"},
{value = 0x20000, name = "鱼"},
{value = 0x40000, name = "海龙"},
{value = 0x80000, name = "爬虫类"},
{value = 0x100000, name = "念动力"},
{value = 0x200000, name = "幻神兽"},
{value = 0x400000, name = "创造神"},
{value = 0x800000, name = "幻龙"},
{value = 0x1000000, name = "电子界"},
{value = 0x2000000, name = "幻想魔"}
}
function s.humancheck(tp) function s.humancheck(tp)
if Duel.SelectYesNo(tp,1214) then if Duel.SelectYesNo(tp,1214) then
return false return false
else else
return true return true
end end
local count=s.rollrandom(1,3)
Debug.Message("我们怀疑您是人机,请按照以下内容点击正确的选项")
local selected = {}
local total_value=0
local available_indices = {}
for i = 1,#races do
table.insert(available_indices,i)
end
for i=1,3 do
local index=s.rollrandom(1,#available_indices)
local selected_race=races[available_indices[index]]
table.insert(selected,selected_race)
total_value=total_value+selected_race.value
table.remove(available_indices,index)
end
local names=""
for _, race in ipairs(selected) do
names=names..race.name.." "
end
Debug.Message(names)
return Duel.AnnounceRace(tp,3,RACE_ALL)==total_value
end end
function s.skip(count) function s.skip(count)
if not count then count=1 end if not count then count=1 end
...@@ -232,6 +182,7 @@ function s.skiptoplayer(pid) ...@@ -232,6 +182,7 @@ function s.skiptoplayer(pid)
s.skip(turn) s.skip(turn)
end end
function s.startop3(e,tp,eg,ep,ev,re,r,rp) function s.startop3(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(Duel.GetTurnPlayer(),id)>0 then return end
e:Reset() e:Reset()
if s.humancheck(0) then if s.humancheck(0) then
s.IsHuman[3]=true s.IsHuman[3]=true
...@@ -241,9 +192,9 @@ function s.startop3(e,tp,eg,ep,ev,re,r,rp) ...@@ -241,9 +192,9 @@ function s.startop3(e,tp,eg,ep,ev,re,r,rp)
if s.humancheck(1) then if s.humancheck(1) then
s.IsHuman[4]=true s.IsHuman[4]=true
else else
Debug.Message("4号位玩家被识别为人机!") Debug.Message("4号位玩家被识别为人机!")
end end
local count=0 local count=0
for i=1,4 do for i=1,4 do
if s.IsHuman[i]==true then if s.IsHuman[i]==true then
count=count+1 count=count+1
...@@ -327,17 +278,23 @@ function s.dealcard(count,tp) ...@@ -327,17 +278,23 @@ function s.dealcard(count,tp)
if not tp then tp=Duel.GetTurnPlayer() end if not tp then tp=Duel.GetTurnPlayer() end
for i=1,count do for i=1,count do
local seq=(i-1)%5 local seq=(i-1)%5
local loc=i%10<=5 and LOCATION_MZONE or LOCATION_SZONE local loc=i%10<=5 and LOCATION_MZONE or LOCATION_SZONE
local mc=Duel.GetFieldGroup(tp,LOCATION_DECK,0):GetFirst() local mc=Duel.GetFieldGroup(tp,LOCATION_DECK,0):GetFirst()
if not mc then mc=Duel.CreateToken(tp,id) end if not mc then mc=Duel.CreateToken(tp,id) end
Duel.MoveToField(mc,tp,tp,loc,POS_FACEUP_ATTACK,false,2^seq) Duel.MoveToField(mc,tp,tp,loc,POS_FACEUP_ATTACK,false,2^seq)
s.changecardcode(mc) s.changecardcode(mc)
if i%10==0 then if i%10==0 then
Duel.SendtoHand(Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0),tp,REASON_RULE) local mg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0)
Duel.ConfirmCards(0,mg)
Duel.ConfirmCards(1,mg)
Duel.SendtoHand(mg,tp,REASON_RULE)
end end
end end
Duel.SendtoHand(Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0),tp,REASON_RULE) local mg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0)
s.sortop(e,tp) Duel.ConfirmCards(0,mg)
Duel.ConfirmCards(1,mg)
Duel.SendtoHand(mg,tp,REASON_RULE)
s.sortop(nil,tp)
end end
function s.dealcard2(count,tp) function s.dealcard2(count,tp)
if not tp then tp=Duel.GetTurnPlayer() end if not tp then tp=Duel.GetTurnPlayer() end
...@@ -360,17 +317,18 @@ function s.dealcard2(count,tp) ...@@ -360,17 +317,18 @@ function s.dealcard2(count,tp)
g:AddCard(mc) g:AddCard(mc)
end end
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
Duel.Overlay(oc,g)
local tc=g:GetFirst() local tc=g:GetFirst()
for i=count,1,-1 do for i=count,1,-1 do
Duel.Overlay(oc,tc)
local code=codetable[i] local code=codetable[i]
tc:SetEntityCode(id,true) tc:SetEntityCode(id,true)
tc:SetCardData(CARDDATA_CODE,code) tc:SetCardData(CARDDATA_CODE,code)
tc:ReplaceEffect(code,0) tc:ReplaceEffect(code,0)
Duel.DisableShuffleCheck()
Duel.SendtoDeck(tc,tp,0,REASON_RULE)
tc=g:GetNext() tc=g:GetNext()
end end
Duel.DisableShuffleCheck() Duel.Draw(tp,count,REASON_RULE)
Duel.SendtoHand(g,tp,REASON_RULE)
--Duel.ShuffleHand(tp) --Duel.ShuffleHand(tp)
else else
s.dealcard(tp) s.dealcard(tp)
...@@ -428,7 +386,7 @@ function s.checkStraight(c,g) ...@@ -428,7 +386,7 @@ function s.checkStraight(c,g)
local max=math.min(14,cpoint+4) local max=math.min(14,cpoint+4)
for i=min,max do for i=min,max do
if codetable[i]==true then if codetable[i]==true then
count=count+1 count=count+1
else else
if count>=5 then if count>=5 then
return true,i-count,i-1 return true,i-count,i-1
...@@ -502,8 +460,7 @@ function s.fpair2(g,hg) ...@@ -502,8 +460,7 @@ function s.fpair2(g,hg)
return g:GetClassCount(s.getpoint)==1 and eg:CheckSubGroup(s.fpair,2,2) return g:GetClassCount(s.getpoint)==1 and eg:CheckSubGroup(s.fpair,2,2)
end end
function s.fflight(g,hg) function s.fflight(g,hg)
local eg=hg:Filter(aux.TRUE,g) local eg=hg:Filter(aux.TRUE,g)
return g:GetClassCount(s.getpoint)==1 and eg:CheckSubGroup(s.fpair,3,3) return g:GetClassCount(s.getpoint)==1 and eg:CheckSubGroup(s.fpair,3,3)
end end
function s.handcon(e,tp,eg,ep,ev,re,r,rp) function s.handcon(e,tp,eg,ep,ev,re,r,rp)
...@@ -522,16 +479,22 @@ function s.handop(e,tp,eg,ep,ev,re,r,rp) ...@@ -522,16 +479,22 @@ function s.handop(e,tp,eg,ep,ev,re,r,rp)
local cg=g:Filter(s.pairfilter,c,point) local cg=g:Filter(s.pairfilter,c,point)
local cardtype=Single local cardtype=Single
local isstraight,min,max=s.checkStraight(c,g) local isstraight,min,max=s.checkStraight(c,g)
if isstraight then if isstraight then
cg:Merge(g:Filter(s.straightfilter,c,min,max,c:GetCode()%20)) cg:Merge(g:Filter(s.straightfilter,c,min,max,c:GetCode()%20))
end end
if point==16 or point==17 then
cg:Merge(g:Filter(s.pointsame,c,33-point))
end
while true do while true do
local sc=cg:SelectUnselect(sg,p,true,true,0,1) local sc=cg:SelectUnselect(sg,p,true,true,0,1)
if sc then if sc then
if sg:IsContains(sc) then return end if sg:IsContains(sc) then return end
sg:AddCard(sc) sg:AddCard(sc)
cg:RemoveCard(sc) cg:RemoveCard(sc)
if s.getpoint(sc)==point then if s.getpoint(sc)==16 or s.getpoint(sc)==17 then
cardtype=KingBomb
cg:Clear()
elseif s.getpoint(sc)==point then
cardtype=sg:GetCount() cardtype=sg:GetCount()
cg=cg:Filter(s.pairfilter,c,s.getpoint(sc)) cg=cg:Filter(s.pairfilter,c,s.getpoint(sc))
else else
...@@ -566,7 +529,7 @@ function s.handop(e,tp,eg,ep,ev,re,r,rp) ...@@ -566,7 +529,7 @@ function s.handop(e,tp,eg,ep,ev,re,r,rp)
local fmin=c:GetCode()%20 local fmin=c:GetCode()%20
eg=g:Filter(aux.TRUE,sg) eg=g:Filter(aux.TRUE,sg)
local fg=g:Filter(s.updownfilter,sg,fmin,fmax) local fg=g:Filter(s.updownfilter,sg,fmin,fmax)
while (cardtype==ThreeOfAKind or cardtype==Flight0) and fg:CheckSubGroup(s.fpair,3,3) and Duel.SelectYesNo(p,aux.Stringid(id,3)) do while (cardtype==ThreeOfAKind or cardtype==Flight0) and fg:CheckSubGroup(s.fpair,3,3) and Duel.SelectYesNo(p,aux.Stringid(id,3)) do
mg=fg:SelectSubGroup(p,s.fpair1,true,3,3,eg) mg=fg:SelectSubGroup(p,s.fpair1,true,3,3,eg)
if mg and mg:GetCount()==3 then if mg and mg:GetCount()==3 then
local cpoint=mg:GetFirst():GetCode()%20 local cpoint=mg:GetFirst():GetCode()%20
...@@ -580,7 +543,7 @@ function s.handop(e,tp,eg,ep,ev,re,r,rp) ...@@ -580,7 +543,7 @@ function s.handop(e,tp,eg,ep,ev,re,r,rp)
break break
end end
end end
while (cardtype==ThreeWithOne or cardtype==Flight1) and fg:CheckSubGroup(s.fpair1,3,3,eg) and Duel.SelectYesNo(p,aux.Stringid(id,3)) do while (cardtype==ThreeWithOne or cardtype==Flight1) and fg:CheckSubGroup(s.fpair1,3,3,eg) and Duel.SelectYesNo(p,aux.Stringid(id,3)) do
mg=fg:SelectSubGroup(p,s.fpair1,true,3,3,eg) mg=fg:SelectSubGroup(p,s.fpair1,true,3,3,eg)
if mg and mg:GetCount()==3 then if mg and mg:GetCount()==3 then
local cpoint=mg:GetFirst():GetCode()%20 local cpoint=mg:GetFirst():GetCode()%20
...@@ -595,7 +558,7 @@ function s.handop(e,tp,eg,ep,ev,re,r,rp) ...@@ -595,7 +558,7 @@ function s.handop(e,tp,eg,ep,ev,re,r,rp)
break break
end end
end end
while (cardtype==ThreeWithTwo or cardtype==Flight2) and fg:CheckSubGroup(s.fpair2,3,3,eg) and Duel.SelectYesNo(p,aux.Stringid(id,3)) do while (cardtype==ThreeWithTwo or cardtype==Flight2) and fg:CheckSubGroup(s.fpair2,3,3,eg) and Duel.SelectYesNo(p,aux.Stringid(id,3)) do
mg=fg:SelectSubGroup(p,s.fpair2,true,3,3,eg) mg=fg:SelectSubGroup(p,s.fpair2,true,3,3,eg)
if mg and mg:GetCount()==3 then if mg and mg:GetCount()==3 then
local cpoint=mg:GetFirst():GetCode()%20 local cpoint=mg:GetFirst():GetCode()%20
...@@ -692,6 +655,13 @@ function s.movecard(cardtype,mg) ...@@ -692,6 +655,13 @@ function s.movecard(cardtype,mg)
Duel.MoveToField(tc,p,p,LOCATION_SZONE,POS_FACEUP,false,2^i) Duel.MoveToField(tc,p,p,LOCATION_SZONE,POS_FACEUP,false,2^i)
tc=mg2:GetNext() tc=mg2:GetNext()
end end
elseif cardtype==KingBomb then
local tc=mg:GetFirst()
Duel.MoveToField(tc,p,p,LOCATION_MZONE,POS_FACEUP_ATTACK,false,2^1)
Duel.MoveSequence(tc,5)
tc=mg:GetNext()
Duel.MoveToField(tc,p,p,LOCATION_MZONE,POS_FACEUP_ATTACK,false,2^3)
Duel.MoveSequence(tc,6)
elseif cardtype==Straight then elseif cardtype==Straight then
for i=0,4 do for i=0,4 do
local tc=mg:GetMinGroup(s.getpoint):GetFirst() local tc=mg:GetMinGroup(s.getpoint):GetFirst()
...@@ -785,7 +755,7 @@ function s.movecard(cardtype,mg) ...@@ -785,7 +755,7 @@ function s.movecard(cardtype,mg)
e1:SetValue(1-p) e1:SetValue(1-p)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
end end
end end
if count>=3 then if count>=3 then
Debug.Message("完成成就:卢食传说") Debug.Message("完成成就:卢食传说")
...@@ -845,7 +815,7 @@ function s.movecard(cardtype,mg) ...@@ -845,7 +815,7 @@ function s.movecard(cardtype,mg)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
tc=mgtable2[i]:GetNext() tc=mgtable2[i]:GetNext()
end end
end end
end end
if count>=3 then if count>=3 then
...@@ -856,26 +826,35 @@ function s.movecard(cardtype,mg) ...@@ -856,26 +826,35 @@ function s.movecard(cardtype,mg)
if Duel.GetFieldGroupCount(p,LOCATION_HAND,0)==0 then Duel.Win(p,0xffff,Duel.CreateToken(p,id)) end if Duel.GetFieldGroupCount(p,LOCATION_HAND,0)==0 then Duel.Win(p,0xffff,Duel.CreateToken(p,id)) end
end end
function s.sortop(e,tp) function s.sortop(e,tp)
local p=Duel.GetTurnPlayer() if e then tp=Duel.GetTurnPlayer() end
local oc=Duel.GetFieldGroup(p,LOCATION_EXTRA,0):GetFirst() local oc=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0):GetFirst()
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.Overlay(oc,g) local count=g:GetCount()
--Duel.Overlay(oc,g)
local cg=Group.CreateGroup() local cg=Group.CreateGroup()
while g:GetCount()>0 do while g:GetCount()>0 do
local mg=g:GetMaxGroup(s.getpoint) local mg=g:GetMinGroup(s.getpoint)
while mg:GetCount()>0 do while mg:GetCount()>0 do
local mc=mg:GetMaxGroup(Card.GetCode):GetFirst() local mc=mg:GetMaxGroup(Card.GetCode):GetFirst()
g:RemoveCard(mc) g:RemoveCard(mc)
mg:RemoveCard(mc) mg:RemoveCard(mc)
cg:AddCard(mc) cg:AddCard(mc)
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
Duel.SendtoHand(mc,p,REASON_RULE) Duel.SendtoDeck(mc,nil,0,REASON_RULE)
Duel.AdjustAll() Duel.AdjustAll()
end end
end end
Duel.Draw(tp,count,REASON_RULE)
end
function s.fbomb(g)
return g:GetClassCount(s.getpoint)==1 and g:GetCount()==4 or g:IsExists(s.pointsame,1,nil,16) and g:IsExists(s.pointsame,1,nil,17) and g:GetCount()==2
end
function s.fpairs(g,count)
return g:GetClassCount(s.getpoint)==count
end end
function s.chainop(e,tp,eg,ep,ev,re,r,rp) function s.chainop(e,tp,eg,ep,ev,re,r,rp)
local cardtype,point,lastp=e:GetLabel() local cardtype,point,lastp=e:GetLabel()
local p=Duel.GetTurnPlayer()
local pid=(Duel.GetTurnCount()-1)%playercount+1 local pid=(Duel.GetTurnCount()-1)%playercount+1
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0) local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
local upg=g:Filter(s.pointup,nil,point) local upg=g:Filter(s.pointup,nil,point)
...@@ -883,14 +862,18 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp) ...@@ -883,14 +862,18 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp)
local ischainable=false local ischainable=false
local ischain=false local ischain=false
local mg=Group.CreateGroup() local mg=Group.CreateGroup()
if g:CheckSubGroup(s.fpair,4,4) and Duel.SelectYesNo(p,aux.Stringid(id,5)) then if cardtype~=KingBomb and cardtype~=Bomb and g:CheckSubGroup(s.fbomb,2,4) and Duel.SelectYesNo(p,aux.Stringid(id,5)) then
mg=g:SelectSubGroup(p,s.fpair,true,4,4) mg=g:SelectSubGroup(p,s.fbomb,true,4,4)
if mg and mg:GetCount()==4 then if mg and mg:GetCount()==4 then
cardtype=Bomb cardtype=Bomb
point=s.getpoint(mg:GetFirst()) point=s.getpoint(mg:GetFirst())
ischain=true ischain=true
else
cardtype=KingBomb
point=17
ischain=true
end end
end end
if cardtype==Single and upg:GetCount()>0 then if cardtype==Single and upg:GetCount()>0 then
ischainable=true ischainable=true
mg=upg:SelectSubGroup(p,s.fpair,true,1,1) mg=upg:SelectSubGroup(p,s.fpair,true,1,1)
...@@ -933,7 +916,7 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp) ...@@ -933,7 +916,7 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp)
if mg and mg:GetCount()==3 then if mg and mg:GetCount()==3 then
point=s.getpoint(mg:GetFirst()) point=s.getpoint(mg:GetFirst())
local mg2=g:Filter(aux.TRUE,mg):SelectSubGroup(p,s.fpair,true,2,2) local mg2=g:Filter(aux.TRUE,mg):SelectSubGroup(p,s.fpair,true,2,2)
mg:Merge(mg2) mg:Merge(mg2)
ischain=true ischain=true
end end
elseif cardtype==Flight0 then elseif cardtype==Flight0 then
...@@ -962,16 +945,18 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp) ...@@ -962,16 +945,18 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp)
if #abletable>0 then if #abletable>0 then
ischainable=true ischainable=true
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
while sg:GetCount()<s.lastcard:GetCount() do while sg:GetCount()<count*3 do
local mg=upg:Filter(s.flightable,nil,abletable,count) local mg=upg:Filter(s.flightable,nil,abletable,count)
local sc=mg:SelectUnselect(sg,p,true,true,0,1) local sc=mg:SelectUnselect(sg,p,true,true,0,1)
if sc then if sc and not sg:IsContains(sc) then
if sg:IsContains(sc) then return end
local cpoint=s.getpoint(sc) local cpoint=s.getpoint(sc)
for i=13,1,-1 do
if i>=cpoint then abletable[i]=false else break end
end
local tg=mg:Filter(s.pointsame,nil,cpoint) local tg=mg:Filter(s.pointsame,nil,cpoint)
mg=mg:Filter(s.flightable,tg,abletable,count)
if tg:GetCount()==4 then tg=tg:Select(p,3,3,nil) end if tg:GetCount()==4 then tg=tg:Select(p,3,3,nil) end
sg:Merge(tg) sg:Merge(tg)
else else
break break
end end
...@@ -981,7 +966,112 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp) ...@@ -981,7 +966,112 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp)
ischain=true ischain=true
end end
end end
elseif cardtype==Straight then elseif cardtype==Flight1 then
local count=s.lastcard:GetCount()/4
local gtable={}
local codetable={}
local abletable={}
for i=1,14 do
codetable[i]=false
end
local min
local cg=upg:GetMaxGroup(s.getpoint)
while upg:GetCount()>0 do
if cg:GetCount()>=3 then
local cpoint=cg:GetFirst():GetCode()%20
if cpoint==1 then codetable[14]=true end
codetable[cpoint]=true
local bool=true
for i=cpoint,cpoint+count-1 do
eg:Merge()
if codetable[i]~=true then bool=false end
end
local eg=Group.__add(g:Filter(s.pointup,nil,cpoint+count-1),g:Filter(s.pointdown,nil,cpoint))
if bool and eg:GetCount()>=count then table.insert(abletable,i) end
end
upg=upg:Filter(aux.TRUE,cg)
end
if #abletable>0 then
ischainable=true
local sg=Group.CreateGroup()
while sg:GetCount()<count*3 do
local mg=upg:Filter(s.flightable,nil,abletable,count)
local sc=mg:SelectUnselect(sg,p,true,true,0,1)
if sc and not sg:IsContains(sc) then
local cpoint=s.getpoint(sc)
for i=13,1,-1 do
if i>=cpoint then abletable[i]=false else break end
end
local tg=mg:Filter(s.pointsame,nil,cpoint)
mg=mg:Filter(s.flightable,tg,abletable,count)
if tg:GetCount()==4 then tg=tg:Select(p,3,3,nil) end
sg:Merge(tg)
else
break
end
end
local cp=s.getpoint(mg:GetMinGroup():GetFirst())
sg:Merge(g:Select(p,count,count,sg))
if sg:GetCount()==s.lastcard:GetCount() then
point=cp
ischain=true
end
end
elseif cardtype==Flight2 then
local count=s.lastcard:GetCount()/4
local gtable={}
local codetable={}
local abletable={}
for i=1,14 do
codetable[i]=false
end
local min
local cg=upg:GetMaxGroup(s.getpoint)
while upg:GetCount()>0 do
if cg:GetCount()>=3 then
local cpoint=cg:GetFirst():GetCode()%20
if cpoint==1 then codetable[14]=true end
codetable[cpoint]=true
local bool=true
for i=cpoint,cpoint+count-1 do
eg:Merge()
if codetable[i]~=true then bool=false end
end
local eg=Group.__add(g:Filter(s.pointup,nil,cpoint+count-1),g:Filter(s.pointdown,nil,cpoint))
if bool and eg:CheckSubGroup(s.fpairs,2*count,2*count,count) then
table.insert(abletable,i)
end
end
upg=upg:Filter(aux.TRUE,cg)
end
if #abletable>0 then
ischainable=true
local sg=Group.CreateGroup()
while sg:GetCount()<count*3 do
local mg=upg:Filter(s.flightable,nil,abletable,count)
local sc=mg:SelectUnselect(sg,p,true,true,0,1)
if sc and not sg:IsContains(sc) then
local cpoint=s.getpoint(sc)
for i=13,1,-1 do
if i>=cpoint then abletable[i]=false else break end
end
local tg=mg:Filter(s.pointsame,nil,cpoint)
mg=mg:Filter(s.flightable,tg,abletable,count)
if tg:GetCount()==4 then tg=tg:Select(p,3,3,nil) end
sg:Merge(tg)
else
break
end
end
local cp=s.getpoint(mg:GetMinGroup():GetFirst())
local eg=g:Filter(aux.TRUE,sg)
sg:Merge(eg:SelectSubGroup(p,s.fpairs,true,2*count,2*count,count))
if sg:GetCount()==s.lastcard:GetCount() then
point=cp
ischain=true
end
end
elseif cardtype==Straight then
local cardtable=s.checkStraight2(point,upg) local cardtable=s.checkStraight2(point,upg)
if #cardtable>0 then if #cardtable>0 then
ischainable=true ischainable=true
...@@ -991,8 +1081,7 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp) ...@@ -991,8 +1081,7 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp)
end end
while mg:GetCount()<5 do while mg:GetCount()<5 do
local sc=cg:SelectUnselect(mg,p,true,true,0,1) local sc=cg:SelectUnselect(mg,p,true,true,0,1)
if sc then if sc and not cg:IsContains(sc) then
if sg:IsContains(sc) then return end
for i,v in ipairs(cardtable) do for i,v in ipairs(cardtable) do
if sc:GetCode()%20>=v.min and sc:GetCode()%20<=v.max then if sc:GetCode()%20>=v.min and sc:GetCode()%20<=v.max then
cg=cg:Filter(s.straightfilter,nil,v.min,v.max,sc:GetCode()%20) cg=cg:Filter(s.straightfilter,nil,v.min,v.max,sc:GetCode()%20)
...@@ -1012,13 +1101,14 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp) ...@@ -1012,13 +1101,14 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp)
end end
if ischain then if ischain then
s.movecard(cardtype,mg) s.movecard(cardtype,mg)
lastp=p lastp=pid
else else
if not ischainable then if not ischainable then
Duel.SelectYesNo(p,aux.Stringid(id,1)) Duel.SelectYesNo(p,aux.Stringid(id,1))
end end
local pid=(Duel.GetTurnCount()-1)%playercount+1 local pid=(Duel.GetTurnCount()-1)%playercount+1
Debug.Message(pid.."号位玩家:不要!") local identity=pid==landlord and "地主" or "农民"
if s.IsHuman[pid]==true or playercount==2 then Debug.Message(pid.."号位玩家("..identity.."):不要!") end
end end
local p=Duel.GetTurnPlayer() local p=Duel.GetTurnPlayer()
s.skip() s.skip()
...@@ -1029,7 +1119,9 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp) ...@@ -1029,7 +1119,9 @@ function s.chainop(e,tp,eg,ep,ev,re,r,rp)
ge0:SetOperation(s.chainop) ge0:SetOperation(s.chainop)
Duel.RegisterEffect(ge0,0) Duel.RegisterEffect(ge0,0)
else else
Debug.Message(pid.."号位玩家的回合") local pid=(Duel.GetTurnCount()-1)%playercount+1
local identity=pid==landlord and "地主" or "农民"
Debug.Message(pid.."号位玩家("..identity..")的回合")
local g=Duel.GetFieldGroup(0,LOCATION_ONFIELD,LOCATION_ONFIELD) local g=Duel.GetFieldGroup(0,LOCATION_ONFIELD,LOCATION_ONFIELD)
if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_RULE) end if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_RULE) end
end end
......
...@@ -331,7 +331,7 @@ function c91300032.discon5(e,tp,eg,ep,ev,re,r,rp) ...@@ -331,7 +331,7 @@ function c91300032.discon5(e,tp,eg,ep,ev,re,r,rp)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c)
end end
function c91300032.disop5(e,tp,eg,ep,ev,re,r,rp) function c91300032.disop5(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(91301025,0)) then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD)
local p=Duel.GetChainInfo(ev,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(ev,CHAININFO_TARGET_PLAYER)
Duel.ChangeTargetPlayer(ev,1-p) Duel.ChangeTargetPlayer(ev,1-p)
......
...@@ -334,7 +334,7 @@ function c91300033.discon5(e,tp,eg,ep,ev,re,r,rp) ...@@ -334,7 +334,7 @@ function c91300033.discon5(e,tp,eg,ep,ev,re,r,rp)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c)
end end
function c91300033.disop5(e,tp,eg,ep,ev,re,r,rp) function c91300033.disop5(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(91301025,0)) then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD)
local p=Duel.GetChainInfo(ev,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(ev,CHAININFO_TARGET_PLAYER)
Duel.ChangeTargetPlayer(ev,1-p) Duel.ChangeTargetPlayer(ev,1-p)
......
...@@ -347,7 +347,7 @@ function c91300034.discon5(e,tp,eg,ep,ev,re,r,rp) ...@@ -347,7 +347,7 @@ function c91300034.discon5(e,tp,eg,ep,ev,re,r,rp)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c)
end end
function c91300034.disop5(e,tp,eg,ep,ev,re,r,rp) function c91300034.disop5(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(91301025,0)) then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD)
local p=Duel.GetChainInfo(ev,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(ev,CHAININFO_TARGET_PLAYER)
Duel.ChangeTargetPlayer(ev,1-p) Duel.ChangeTargetPlayer(ev,1-p)
......
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