Commit 271dec32 authored by POLYMER's avatar POLYMER

fix

parent 8d8e68b5
......@@ -6575,6 +6575,9 @@
30001240 0
30001245 0
60002255 0
61701009 0
61701019 0
61701021 0
#limit
33403513 1
82204250 0
......
--魔导探机 鹰眼MkII
local cm,m=GetID()
pnflpf=pnflpf or {}
function pnfl_prophecy_flight_initial(c)
PNFL_PROPHECY_FLIGHT_CHECK=true
PNFL_PROPHECY_FLIGHT_DEBUG=false
PNFL_PROPHECY_FLIGHT_OPERATION_PERMIT=true
PNFL_PROPHECY_FLIGHT_TACTIC_VIEW=false
pnflpf[0]=0
pnflpf[1]=0
pnflpf.coinsequence={}
local _TossCoin=Duel.TossCoin
local _SetCoinResult=Duel.SetCoinResult
function Duel.SetCoinResult(...)
local ct0=#pnflpf.coinsequence
local res0={Duel.GetCoinResult()}
if pnflpf.res and #res0>0 then
for i=1,#res0 do pnflpf.coinsequence[ct0+i]=res0[i] end
end
pnflpf.res=nil
_SetCoinResult(...)
end
function Duel.TossCoin(p,ct)
local ct0=#pnflpf.coinsequence
local res0={Duel.GetCoinResult()}
--before replaced by this coin, register last coin.
if pnflpf.res and #res0>0 then
for i=1,ct do pnflpf.coinsequence[ct0+i]=res0[i] end
end
pnflpf.res=res0
ct0=#pnflpf.coinsequence
local res={_TossCoin(p,ct)}
local ct1=#pnflpf.coinsequence
--if this coin isn't replaced, register it.
if pnflpf.res and ct0==ct1 then
for i=1,ct do pnflpf.coinsequence[ct1+i]=res[i] end
end
local str="实际投掷结果:"
for i=1,#res do
if res[i]==1 then str=str.."[表]" else str=str.."[里]" end
end
--Debug.Message(str)
pnflpf.res=nil
return table.unpack(res)
end
--[[function Duel.TossCoin(p,ct)
local dic={}
local ct0=#pnflpf.coinsequence
for i=1,ct do table.insert(pnflpf.coinsequence,2) end
local res={_TossCoin(p,ct)}
local bool1,bool2=true,true
while bool1 or bool2 do
local s0,s1=false,false
for _,r in ipairs(res) do if r==0 then s0=true end end
for _,r in ipairs(res) do if r==1 then s1=true end end
local b1=Duel.IsCanRemoveCounter(p,1,0,0x1972,1,REASON_EFFECT) and s0
local b2=Duel.IsCanRemoveCounter(p,1,0,0x1971,1,REASON_EFFECT) and s1
local off=1
local ops,opval={},{}
if b1 then
ops[off]=aux.Stringid(11451856,0)
opval[off]=0
off=off+1
end
if b2 then
ops[off]=aux.Stringid(11451856,1)
opval[off]=1
off=off+1
end
ops[off]=aux.Stringid(11451856,2)
opval[off]=2
if off==1 then
bool1=false
else
local op=Duel.SelectOption(p,table.unpack(ops))+1
local sel=opval[op]
if sel==0 then
Duel.RemoveCounter(p,1,0,0x1972,1,REASON_EFFECT)
for i,r in ipairs(res) do res[i]=1 end
elseif sel==1 then
Duel.RemoveCounter(p,1,0,0x1971,1,REASON_EFFECT)
for i,r in ipairs(res) do res[i]=0 end
else
bool1=false
end
end
local s0,s1=false,false
for _,r in ipairs(res) do if r==0 then s0=true end end
for _,r in ipairs(res) do if r==1 then s1=true end end
local b1=Duel.IsCanRemoveCounter(1-p,1,0,0x1972,1,REASON_EFFECT) and s0
local b2=Duel.IsCanRemoveCounter(1-p,1,0,0x1971,1,REASON_EFFECT) and s1
local off=1
local ops,opval={},{}
if b1 then
ops[off]=aux.Stringid(11451856,0)
opval[off]=0
off=off+1
end
if b2 then
ops[off]=aux.Stringid(11451856,1)
opval[off]=1
off=off+1
end
ops[off]=aux.Stringid(11451856,2)
opval[off]=2
if off==1 then
bool2=false
else
local op=Duel.SelectOption(1-p,table.unpack(ops))+1
local sel=opval[op]
if sel==0 then
Duel.RemoveCounter(1-p,1,0,0x1972,1,REASON_EFFECT)
for i,r in ipairs(res) do res[i]=1 end
elseif sel==1 then
Duel.RemoveCounter(1-p,1,0,0x1971,1,REASON_EFFECT)
for i,r in ipairs(res) do res[i]=0 end
else
bool2=false
end
end
end
for i=1,ct do pnflpf.coinsequence[ct0+i]=res[i] end
return table.unpack(res)
end--]]
--increase by Card.ReverseInDeck
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge0:SetCode(EVENT_ADJUST)
ge0:SetCondition(function() return not pnfl_adjusting end)
ge0:SetOperation(pnflpf.resetop)
Duel.RegisterEffect(ge0,0)
--decrease by leaving from deck
local ge1=ge0:Clone()
ge1:SetCode(EVENT_MOVE)
Duel.RegisterEffect(ge1,0)
--tactic view
local ge4=Effect.CreateEffect(c)
ge4:SetDescription(aux.Stringid(11451851,4))
ge4:SetType(EFFECT_TYPE_FIELD)
ge4:SetCode(EFFECT_SPSUMMON_PROC_G)
ge4:SetRange(0xff)
ge4:SetOperation(pnflpf.debug)
c:RegisterEffect(ge4)
end
function pnflpf.resetop(e,tp,eg,ep,ev,re,r,rp)
local g0=Duel.GetMatchingGroup(Card.IsHasEffect,0,LOCATION_DECK,0,nil,11451851)
local g1=Duel.GetMatchingGroup(Card.IsHasEffect,1,LOCATION_DECK,0,nil,11451851)
local res0=pnflpf[0]~=#g0 and pnflpf[0]>0 and #g0>0
local res1=pnflpf[1]~=#g1 and pnflpf[1]>0 and #g1>0
pnflpf[0]=#g0
pnflpf[1]=#g1
if res0 or res1 then
if PNFL_PROPHECY_FLIGHT_DEBUG then Debug.Message("reset") end
if res0 then for tc in aux.Next(g0) do tc:ResetFlagEffect(11451851) end end
if res1 then for tc in aux.Next(g1) do tc:ResetFlagEffect(11451851) end end
Duel.Readjust()
end
end
function pnflpf.tdfilter(c)
return c:GetTurnID()==Duel.GetTurnCount()
end
function pnflpf.debug(e,tp,eg,ep,ev,re,r,rp)
if not PNFL_PROPHECY_FLIGHT_TACTIC_VIEW then
PNFL_PROPHECY_FLIGHT_TACTIC_VIEW=Duel.SelectYesNo(tp,aux.Stringid(11451851,3))
elseif PNFL_PROPHECY_FLIGHT_TACTIC_VIEW then
local opt=Duel.SelectOption(tp,aux.Stringid(11451851,4),aux.Stringid(11451851,5))
if opt==0 then
local g=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_DECK,0,nil,11451851)
local g1=g:Filter(pnflpf.tdfilter,nil)
local g2=g-g1
local tpg=Group.CreateGroup()
if #g1>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451851,6))
Duel.DisableShuffleCheck()
Group.SelectUnselect(g1,tpg,tp,true,true,#g1,#g1)
end
if #g2>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451851,7))
Duel.DisableShuffleCheck()
Group.SelectUnselect(g2,tpg,tp,true,true,#g2,#g2)
end
tpg:DeleteGroup()
else
PNFL_PROPHECY_FLIGHT_TACTIC_VIEW=false
end
end
if PNFL_PROPHECY_FLIGHT_OPERATION_PERMIT then
PNFL_PROPHECY_FLIGHT_OPERATION_PERMIT=not Duel.SelectYesNo(tp,aux.Stringid(11451851,8))
else
PNFL_PROPHECY_FLIGHT_OPERATION_PERMIT=Duel.SelectYesNo(tp,aux.Stringid(11451851,9))
end
end
--
local m=11451856
local cm=_G["c"..m]
function cm.initial_effect(c)
if not PNFL_PROPHECY_FLIGHT_CHECK then
dofile("expansions/script/c11451851.lua")
pnfl_prophecy_flight_initial(c)
end
--Activate
......
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