Commit 5daebd65 authored by JoyJ's avatar JoyJ

update srv5555 scripts

parent da071445
--村规决斗:层林尽染
--双方的所有卡(包括通常怪兽)得到对方某一张随机卡的效果。
--额外卡组的卡只会得到额外卡组的卡的效果,主卡组的卡只会得到主卡组的卡的效果。
--怪兽只会得到怪兽的效果,场地只会得到场地的效果,
--其他魔法只会得到非场地魔法的效果,陷阱只会得到陷阱的效果。
--开局时,双方将1张千里眼(60391791)从卡组外表侧表示除外。
--这场决斗中这张卡不是表侧表示除外的场合,这张卡表侧表示除外。
--这张卡得到以下效果。
--1回合最多2次,自己主要阶段才能处理这个效果。这个效果的处理不会被无效。
--查看自己场上·手卡·墓地·额外·除外的1张卡复制了哪张卡的效果。
CUNGUI={}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation2)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation2()
if not CUNGUI.INIT2 then
CUNGUI.INIT2 = true
CUNGUI.RegisterCardRule(0)
CUNGUI.RegisterCardRule(1)
end
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and (not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[1]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
function CUNGUI.RegisterCardRule(tp)
local c=Duel.CreateToken(tp,60391791)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
--forbid
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66666004,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(2)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetCondition(CUNGUI.rulecond)
e1:SetOperation(CUNGUI.ruleop)
c:RegisterEffect(e1)
end
function CUNGUI.rulecond(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()<1
end
function CUNGUI.ruleop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g and #g>0 then
local tc=g:GetFirst()
Duel.Hint(HINT_CODE,1-tp,CUNGUI.RegCard[tc] or 0)
end
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
local CRegisterEffect=Card.RegisterEffect
Card.RegisterEffect = function(c,e,forced)
if not e:GetDescription() or e:GetDescription()==0 then
e:SetDescription(aux.Stringid(66666004,4))
end
return CRegisterEffect(c,e,forced)
end
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
if not CUNGUI.INIT then
CUNGUI.INIT = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
local g = Duel.GetMatchingGroup(nil,0,0x7f,0x7f,nil)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
local g=Duel.GetMatchingGroup(CUNGUI.filter,c:GetControler(),0,0x7f,nil,c)
local t={}
local i=1
for tc in aux.Next(g) do
t[i]=tc
i=i+1
end
if #t<1 then return end
CUNGUI.RegisterCard(c,t[math.random(1,#t)])
end
function CUNGUI.filter(c,oc)
if not oc:IsExtraDeckMonster() == c:IsExtraDeckMonster() then return false end
if oc:IsType(TYPE_MONSTER) then return c:IsType(TYPE_MONSTER) end
if oc:IsType(TYPE_FIELD) then return c:IsType(TYPE_FIELD) end
if oc:IsType(TYPE_SPELL) then return c:IsType(TYPE_SPELL) end
if oc:IsType(TYPE_TRAP) then return c:IsType(TYPE_TRAP) end
end
CUNGUI.RegCard={}
function CUNGUI.RegisterCard(c,tc)
local tce=_G["c"..tc:GetOriginalCode()]
if tce and tce.initial_effect then
CUNGUI.RegCard[c]=tc:GetOriginalCode()
tce.initial_effect(c)
end
end
function CUNGUI.spfilter(c,e,tp)
return c:IsCode(e:GetHandler():GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEUP_ATTACK)
end
function CUNGUI.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(CUNGUI.spfilter,tp,0x33,0,c,e,tp)
local f=Duel.GetMZoneCount(tp)
if #g>0 and f>0 then
local max = #g
if max > f then max = f end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(g,tp,max,max,nil)
Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP_ATTACK)
end
end
\ No newline at end of file
--村规决斗:幻神之战
--开局时,双方将1张缚神冢(269012)从卡组外表侧表示除外。
--这场决斗中这张卡不是表侧表示除外的场合,这张卡表侧表示除外。
--这张卡得到以下效果。
--自己结束阶段发动。从卡组外将1张随机5星通常怪兽在自己场上表侧表示放置。
--如果放置的卡是狮子男巫(4392470) 海马兽(47922711) 莫林芬(55784832)
--再给予对方4000点伤害。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation()
if not CUNGUI.INIT then
CUNGUI.INIT = true
CUNGUI.RegisterCardRule(0)
CUNGUI.RegisterCardRule(1)
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and (not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[1]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
function CUNGUI.RegisterCardRule(tp)
local c=Duel.CreateToken(tp,269012)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
--forbid
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66666004,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetOperation(CUNGUI.ruleop)
c:RegisterEffect(e1)
end
CUNGUI.cards={2971090,4035199,4179849,4392470,7562372,10538007,11250655,11714098,12146024,14977074,15023985,16972957,17192817,18246479,19474136,19737320,20624263,26378150,28279543,28546905,29172562,29402771,29616941,30090452,31477025,32012841,32012842,32344688,33178416,33621868,33878931,34690519,35322812,35565537,36904469,38116136,40155554,42418084,42599677,43785278,43793530,44865098,47319141,47922711,48202661,48365709,48766543,49587396,50176820,50407691,51194046,51228280,52584282,54615781,55291359,55784832,55998462,62762898,65518099,66989694,67273917,67284908,67494157,68182934,68339286,69455834,69893315,70345785,73051941,73081602,73911410,74637266,75622825,75850803,76634149,77998771,78060096,78780140,80141480,81386177,81686058,82818645,85326399,85771020,86088138,87511987,90876561,96981563,97612389,98795934}
function CUNGUI.ruleop(e,tp,eg,ep,ev,re,r,rp)
local code=math.random(#CUNGUI.cards)
local c=Duel.CreateToken(tp,CUNGUI.cards[code])
if Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,true) and (code==4392470 or code==47922711 or code==55784832) then
Duel.BreakEffect()
Duel.Damage(1-tp,4000,REASON_EFFECT)
end
end
--村规决斗:激斗陀螺
--在战斗阶段以外,双方进行的任何行动,都会让全场表侧表示怪兽的表示形式改变。
--全场的怪兽能以守备表示进行攻击宣言(仍用攻击力进行计算)。
--这个效果不会被无效化。
CUNGUI={}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
--adjust
local e3=Effect.GlobalEffect()
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EVENT_ADJUST)
e3:SetCountLimit(1)
e3:SetOperation(CUNGUI.AdjustOperation2)
Duel.RegisterEffect(e3,0)
end
function CUNGUI.AdjustOperation(e)
if Duel.GetCurrentPhase() > PHASE_MAIN1 and Duel.GetCurrentPhase() < PHASE_MAIN2 then return end
local g=Duel.GetFieldGroup(0,LOCATION_MZONE,LOCATION_MZONE)
for tc in aux.Next(g) do
if tc:IsFaceup() then
if tc:IsPosition(POS_FACEUP_ATTACK) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
end
end
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation2(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(Card.IsType,0,0x7f,0x7f,nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DEFENSE_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE)
c:RegisterEffect(e2)
end
--村规决斗:战争和平
--开局时,双方将1张灰篮撞击(2759860)从卡组外表侧表示除外。
--这场决斗中这张卡不是表侧表示除外的场合,这张卡表侧表示除外。
--这张卡得到以下效果。
--这张卡的①②效果1回合只能有1次使用其中任意1个。
--①:1回合1次,自己主要阶段才能处理这个效果。选自己场上和对方场上1张卡破坏。
--②:1回合1次,自己结束阶段才能处理这个效果。从卡组选1张卡加入手卡。
--这些效果的处理不会被无效,且不受【不能加入手卡】类效果的影响。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation()
if not CUNGUI.INIT then
CUNGUI.INIT = true
CUNGUI.RegisterCardRule(0)
CUNGUI.RegisterCardRule(1)
end
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and (not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[1]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
function CUNGUI.RegisterCardRule(tp)
local c=Duel.CreateToken(tp,2759860)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
--forbid
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66666004,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,66666666)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetCondition(CUNGUI.rulecond)
e1:SetOperation(CUNGUI.ruleop)
c:RegisterEffect(e1)
--get
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66666004,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1,66666666)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetOperation(CUNGUI.ruleop)
c:RegisterEffect(e1)
end
function CUNGUI.rulecond(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()<1 and
(((Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)*Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)>0)
or (Duel.GetCurrentPhase()==PHASE_END and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0))
end
function CUNGUI.ruleop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()==PHASE_END then
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_RULE)
else
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
g:Merge(g2)
Duel.Destroy(g,REASON_EFFECT)
end
end
--村规决斗:火烧连营
--开局时,双方将1张战华史略-东南之风(62528292)从卡组外表侧表示除外。
--这场决斗中这张卡不是表侧表示除外的场合,这张卡表侧表示除外。
--这张卡得到以下效果。
--自己手卡少于3张的场合,自己从卡组抽1张。
--每回合第1次使用这个效果,自己受到100点伤害。
--同1个回合多次使用这个效果的场合,这个伤害每次都会加倍。
CUNGUI = {}
CUNGUI.RuleCardCode=62528292
CUNGUI.Used={}
CUNGUI.Used[0]=0
CUNGUI.Used[1]=0
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation()
if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0)
CUNGUI.RegisterCardRule(1)
end
CUNGUI.Used[0]=0
CUNGUI.Used[1]=0
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and (not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[1]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
function CUNGUI.RegisterCardRule(tp)
local c=Duel.CreateToken(tp,CUNGUI.RuleCardCode)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetRange(LOCATION_REMOVED)
e1:SetOperation(CUNGUI.AdjustOperation2)
c:RegisterEffect(e1)
end
function CUNGUI.rulecond(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()<1 and Duel.GetTurnPlayer()==tp
end
function CUNGUI.AdjustOperation2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ct<3 then
Duel.Draw(tp,1,REASON_RULE)
Duel.Damage(tp,100*(math.pow(2,CUNGUI.Used[tp])),REASON_RULE)
CUNGUI.Used[tp]=CUNGUI.Used[tp]+1
end
end
--村规决斗:琴瑟合鸣
--开局时,后攻方抽2张。
--所有灵摆卡以外的原本种类是怪兽卡的卡得到以下效果:
--表侧表示的这张卡因Cost·召唤手续以外从场上送去墓地的场合,
--可以不送去墓地当作通常魔法卡使用在自己的魔法与陷阱区域表侧表示放置。
--那次连锁结束后,这张卡得到以下②效果。
--所有【场地·装备·永续】以外的原本种类是魔法·陷阱卡的卡得到以下效果:
--①:这张卡发动的场合不送去墓地。那次连锁结束后,这张卡得到以下②效果。
--②:此类②效果以外的效果发动时,把表侧表示的这张卡从自己的魔法·陷阱区域送去墓地才能发动。
--这个效果变成与那个效果相同。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(nil,0,0x7f,0x7f,nil)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
if not CUNGUI.DrawInit then
CUNGUI.DrawInit = true
Duel.Draw(1,2,REASON_RULE)
end
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
if c:IsType(TYPE_MONSTER) then
if c:IsType(TYPE_PENDULUM) then return end
--send replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(CUNGUI.repcon)
e1:SetOperation(CUNGUI.repop)
c:RegisterEffect(e1)
elseif not c:IsType(TYPE_PENDULUM+TYPE_CONTINUOUS+TYPE_EQUIP+TYPE_FIELD) then
--remain field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_SZONE)
e4:SetOperation(CUNGUI.regop)
c:RegisterEffect(e4)
end
end
CUNGUI.Registered={}
function CUNGUI.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(66666666)>0 then return end
c:RegisterFlagEffect(66666666,RESET_EVENT+RESETS_STANDARD,0,1)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetReset(RESETS_STANDARD+RESET_EVENT)
e1:SetProperty(EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DAMAGE_STEP)
CUNGUI.Registered[e1]=true
e1:SetCondition(CUNGUI.condition)
e1:SetCost(CUNGUI.cost)
e1:SetTarget(CUNGUI.target)
e1:SetOperation(CUNGUI.activate)
c:RegisterEffect(e1)
end
function CUNGUI.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(0x7d0) and not CUNGUI.Registered[re]
end
function CUNGUI.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
end
function CUNGUI.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ftg=re:GetTarget()
if chkc then return ftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return not ftg or ftg(e,tp,eg,ep,ev,re,r,rp,chk) end
local prop = EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DAMAGE_STEP
if re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
prop = prop | EFFECT_FLAG_CARD_TARGET
end
e:SetProperty(prop)
if ftg then
pcall(ftg,e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function CUNGUI.activate(e,tp,eg,ep,ev,re,r,rp)
local fop=re:GetOperation()
if fop==nil then return end
pcall(fop,e,tp,eg,ep,ev,re,r,rp)
end
function CUNGUI.repcon(e)
local c=e:GetHandler()
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and not c:IsReason(REASON_COST)
end
function CUNGUI.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL)
c:RegisterEffect(e1)
CUNGUI.regop(e,tp,eg,ep,ev,re,r,rp)
end
function CUNGUI.spfilter(c,e,tp)
return c:IsCode(e:GetHandler():GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEUP_ATTACK)
end
function CUNGUI.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(CUNGUI.spfilter,tp,0x33,0,c,e,tp)
local f=Duel.GetMZoneCount(tp)
if #g>0 and f>0 then
local max = #g
if max > f then max = f end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(g,tp,max,max,nil)
Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP_ATTACK)
end
end
\ No newline at end of file
--村规决斗:时空乱流
--每个回合的时长随机变化为30~300秒。
--(双方分别有一个随机的时间限制)
CUNGUI = {}
function Auxiliary.PreloadUds()
if not CUNGUI.InitRandomSeed then
CUNGUI.InitRandomSeed = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
local tm = math.random(30,300)
Duel.Hint(HINT_NUMBER,tp,tm)
Duel.ResetTimeLimit(0,tm)
tm = math.random(30,300)
Duel.ResetTimeLimit(1,tm)
Duel.Hint(HINT_NUMBER,1,tm)
end
--村规决斗:继往开来
--所有怪兽得到以下效果:
--场上存在的这张卡送去墓地时发动。从卡组将1只与这张卡种族或属性相同的怪兽加入手卡。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(Card.IsType,0,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(135598,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(CUNGUI.condition)
e1:SetTarget(CUNGUI.target)
e1:SetOperation(CUNGUI.operation)
c:RegisterEffect(e1)
end
function CUNGUI.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function CUNGUI.filter(c,oc)
return (c:IsRace(oc:GetRace()) or c:IsAttribute(oc:GetAttribute())) and c:IsAbleToHand()
end
function CUNGUI.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if not (e:GetHandler():IsRelateToEffect(e)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,CUNGUI.filter,tp,LOCATION_DECK,0,1,1,nil,e:GetHandler())
if #tc>0 then
if Duel.SendtoHand(tc,nil,REASON_EFFECT) > 0 then
Duel.ConfirmCards(1-tp,tc)
end
end
end
--村规决斗:挣脱枷锁II
--所有效果的发动·使用条件无效。
local SetCond=Effect.SetCondition
function GetFunc(func)
return function(e,tp,eg,ep,ev,re,r,rp)
func(e,tp,eg,ep,ev,re,r,rp)
return true
end
end
Effect.SetCondition = function(e,func)
if func==nil then return end
if e:GetCode()==EFFECT_FUSION_MATERIAL then
SetCond(e,func)
else
SetCond(e,GetFunc(func))
end
end
--村规决斗:挣脱枷锁 Extra
--所有入连锁的效果的发动条件无效,
--可以空发,并尽量处理Cost和效果。
--
function GetFunc(func)
return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local err,c = pcall(func,e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c end
return true
end
end
local Register = Card.RegisterEffect
Card.RegisterEffect = function(c,e,forced)
local type=e:GetType()
local cost=e:GetCost()
local cond=e:GetCondition()
local targ=e:GetTarget()
if (type & 0x7d0) > 0 then
if cond then e:SetCondition(GetFunc(cond)) end
if cost then e:SetCost(GetFunc(cost)) end
if targ then e:SetTarget(GetFunc(targ)) end
end
return Register(c,e,forced)
end
\ No newline at end of file
--村规决斗:对等召唤
--开局时,双方将1张暗黑神殿 扎拉拉姆(64230128)从卡组外表侧表示除外。
--这场决斗中这张卡不是表侧表示除外的场合,这张卡表侧表示除外。
--这张卡得到以下效果。
--1回合1次,自己主要阶段才能处理这个效果。
--从双方卡组·额外卡组选2张卡。那之中随机1张在自己场上无视召唤条件特殊召唤,另1张在对方场上无视召唤条件特殊召唤。
--这个特殊召唤当作正规召唤使用。
--如果特殊召唤的卡是XYZ怪兽,则从卡组外将2张【礼品卡】(39526584)当作叠光素材在那些卡下面叠放。
--细则:
--从对方卡组·额外卡组几乎是盲选……额外表侧表示的灵摆卡另说。
--各自决定表示形式(表侧攻击·里侧攻击·表侧守备·里侧守备)。
--如果选择了守备表示,则连接怪兽会召唤失败。
CUNGUI = {}
CUNGUI.RuleCardCode=64230128
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0)
CUNGUI.RegisterCardRule(1)
CUNGUI.PosCard=Duel.CreateToken(tp, 39526584)
end
if not CUNGUI.DrawInit then
CUNGUI.DrawInit = true
Duel.Draw(1,1,REASON_RULE)
end
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and (not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[1]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
function CUNGUI.RegisterCardRule(tp)
local c=Duel.CreateToken(tp,CUNGUI.RuleCardCode)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
--forbid
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66666004,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetCondition(CUNGUI.rulecond)
e1:SetOperation(CUNGUI.ruleop)
c:RegisterEffect(e1)
end
function CUNGUI.rulecond(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()<1 and Duel.GetTurnPlayer()==tp
end
function CUNGUI.AddOverlay(c)
if not c:IsLocation(LOCATION_MZONE) then return end
local g=Group.CreateGroup()
for i=1,2 do
local tc = Duel.CreateToken(c:GetControler(), 39526584)
g:AddCard(tc)
end
Duel.SendtoHand(g, c:GetControler(), REASON_RULE)~=2
Duel.Overlay(c,g)
end
function CUNGUI.ruleop(e,tp,eg,ep,ev,re,r,rp)
local g
local opt = Duel.SelectOption(tp,102,103)
if opt==0 then
g=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,2,nil,TYPE_MONSTER)
else
g=Duel.SelectMatchingCard(tp,Card.IsType,tp,0,LOCATION_DECK+LOCATION_EXTRA,2,2,nil,TYPE_MONSTER)
end
if g and #g==2 then
local tc=g:RandomSelect(tp,1):GetFirst()
g:RemoveCard(tc)
local fc=g:GetFirst()
local pos = Duel.SelectPosition(tp, CUNGUI.PosCard, POS_FACEDOWN+POS_FACEUP)
local tcb = Duel.SpecialSummonStep(tc,0,tp,tp,true,true,pos)
pos = Duel.SelectPosition(1-tp, CUNGUI.PosCard, POS_FACEDOWN+POS_FACEUP)
local fcb = Duel.SpecialSummonStep(fc,0,tp,1-tp,true,true,pos)
tc:CompleteProcedure()
fc:CompleteProcedure()
if tcb and tc:IsType(TYPE_XYZ) then
CUNGUI.AddOverlay(tc)
end
if fcb and fc:IsType(TYPE_XYZ) then
CUNGUI.AddOverlay(fc)
end
Duel.SpecialSummonComplete()
end
end
--村规决斗:斗牌传说
--开局时,双方将1张打赌胜负(34236961)从卡组外表侧表示除外。
--这场决斗中这张卡不是表侧表示除外的场合,这张卡表侧表示除外。
--这张卡得到以下效果。
--1回合1次,自己主要阶段才能处理这个效果。这个效果的处理不会被无效。
--宣言【星数·攻击·守备·卡号(关键字)】中的1个,双方各自选1张手卡展示。
--宣言的值较高的一方将选出的卡放回手卡,较低的一方受到1000点伤害,将选出的卡送去墓地。
--平局则双方都放回手卡。
--选择怪兽卡以外的卡时,星数·攻击·守备计为0。
CUNGUI = {}
CUNGUI.RuleCardCode=34236961
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation()
if not CUNGUI.RandomSeedInit then
CUNGUI.RandomSeedInit = true
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if not CUNGUI.RuleCardInit then
CUNGUI.RuleCardInit = true
CUNGUI.RegisterCardRule(0)
CUNGUI.RegisterCardRule(1)
end
if not CUNGUI.DrawInit then
CUNGUI.DrawInit = true
Duel.Draw(1,1,REASON_RULE)
end
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and (not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[1]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
function CUNGUI.RegisterCardRule(tp)
local c=Duel.CreateToken(tp,CUNGUI.RuleCardCode)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
--forbid
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66666004,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetCondition(CUNGUI.rulecond)
e1:SetOperation(CUNGUI.ruleop)
c:RegisterEffect(e1)
end
function CUNGUI.rulecond(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()<1 and Duel.GetTurnPlayer()==tp
and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
end
function CUNGUI.ruleop(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0) then return end
local opt = Duel.SelectOption(tp,1322,1323,1324,1325)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
local ec=Duel.SelectMatchingCard(1-tp,nil,1-tp,LOCATION_HAND,0,1,1,nil):GetFirst()
local ti=tc:GetOriginalCode()
local ei=ec:GetOriginalCode()
if opt == 0 then
ti=(tc:IsType(TYPE_MONSTER) and tc:GetBaseAttack()) or 0
ei=(ec:IsType(TYPE_MONSTER) and ec:GetBaseAttack()) or 0
elseif opt == 1 then
ti=(tc:IsType(TYPE_MONSTER) and tc:GetBaseDefense()) or 0
ei=(ec:IsType(TYPE_MONSTER) and ec:GetBaseDefense()) or 0
elseif opt == 2 then
ti=(tc:IsType(TYPE_MONSTER) and tc:GetOriginalLevel()) or 0
ei=(ec:IsType(TYPE_MONSTER) and ec:GetOriginalLevel()) or 0
end
Duel.ConfirmCards(1-tp,tc)
Duel.ConfirmCards(tp,ec)
if ti==ei then return end
if ti>ei then
Duel.SendtoGrave(ec,REASON_EFFECT)
Duel.Damage(1-tp,1000,REASON_EFFECT)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
Duel.Damage(tp,1000,REASON_EFFECT)
end
end
--村规决斗:强制平衡
--双方抽卡阶段抽卡数量,变成双方场上+手卡数量之差。
--连续4个回合未能抽卡的场合,第4个回合的回合玩家的基本分变为0。
--(自己比对方多也会多抽卡)
CUNGUI={}
function Auxiliary.PreloadUds()
--Draw
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DRAW_COUNT)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetValue(CUNGUI.DrawCount)
Duel.RegisterEffect(e2,0)
end
CUNGUI.Used=0
function CUNGUI.DrawCount(e)
local p=Duel.GetTurnPlayer()
local ct=Duel.GetFieldGroupCount(p,LOCATION_HAND+LOCATION_ONFIELD,0)
local ct2=Duel.GetFieldGroupCount(1-p,LOCATION_HAND+LOCATION_ONFIELD,0)-ct
if ct2<0 then ct2=-ct2 end
if ct2==0 then
CUNGUI.Used = CUNGUI.Used + 1
else
CUNGUI.Used = 0
end
if CUNGUI.Used > 3 then
Duel.SetLP(p,0)
end
return ct2
end
\ No newline at end of file
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