Commit 53da4d4b authored by JoyJ's avatar JoyJ

update srv5555 scripts

parent 51bd442c
......@@ -2,13 +2,23 @@
--所有起动效果变为2速。
--T2多抽1张。
local OrigSetType = Effect.SetType
OrigRegister = Card.RegisterEffect
Card.RegisterEffect = function(c,e,forced)
local typ = e:GetType()
if typ and (typ & EFFECT_TYPE_IGNITION)>0 then
e:SetType(EFFECT_TYPE_QUICK_O)
e:SetCode(EVENT_FREE_CHAIN)
local cat = e:GetCategory()
if cat and (cat & (CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_NEGATE))>0 then
local prop = e:GetProperty()
if not prop then prop = 0 end
prop = prop | (EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DAMAGE_STEP)
e:SetProperty(prop)
end
end
return OrigRegister(c,e,forced)
end
function Auxiliary.PreloadUds()
Effect.SetType = function(e,typ)
if typ==EFFECT_TYPE_IGNITION then typ=EFFECT_TYPE_QUICK_O end
OrigSetType(e,typ)
end
-- 1 more draw
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -77,7 +77,7 @@ function CUNGUI.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function CUNGUI.recfilter(c)
return c:IsFaceup() and c:IsCode(76103675)
return c:IsFaceup() and c:IsCode(20871001)
end
function CUNGUI.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
--村规决斗:正版卫士
--所有怪兽(同名卡)在场上都只能有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: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_MZONE,
LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA+LOCATION_MZONE,
nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
CUNGUI.used={}
CUNGUI.used[0]=0
CUNGUI.used[1]=0
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
c:SetUniqueOnField(1,1,c:GetOriginalCode())
--change code
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(89312388,0))
e1:SetCountLimit(1,87654321)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(CUNGUI.target)
e1:SetOperation(CUNGUI.operation)
c:RegisterEffect(e1)
end
function CUNGUI.filter(c)
return c:IsFaceup()
end
function CUNGUI.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return
Duel.IsExistingMatchingCard(CUNGUI.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectMatchingCard(tp,CUNGUI.filter,tp,0,LOCATION_MZONE,1,1,nil)
if not g or #g == 0 then return end
local c = g:GetFirst()
local code = Duel.AnnounceCard(tp,TYPE_MONSTER)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
c:RegisterEffect(e1)
local turn = Duel.GetTurnCount()
if CUNGUI.used[tp]<turn then
CUNGUI.used[tp]=turn
code = Duel.AnnounceCard(tp,TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK|TYPE_FUSION)
local tc=Duel.CreateToken(tp,code)
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
end
end
--村规决斗:你也是龙
--仅在卡片效果判定时:
--所有卡都具有全属性。
--所有卡都视为全种族。
--所有卡都视为正面朝上。
--(背面朝上的场合,同时视为正面朝上+背面朝上)
--所有卡都视为是任意攻击力·守备力。
--所有卡都视为是任意等级。
CUNGUI = {}
Card.IsFaceup = function() return true end
Card.IsRace = function() return true end
Card.GetRace = function() return RACE_ALL end
Card.IsAttribute = function() return true end
Card.GetAttribute = function() return 0x7f end
Card.IsFaceup = function() return true end
Card.IsAttackAbove = function() return true end
Card.IsAttackBelow = function() return true end
Card.IsDefenseAbove = function() return true end
Card.IsDefenseBelow = function() return true end
Card.IsLevelAbove = function() return true end
Card.IsLevelBelow = function() return true end
Card.IsAttack = function() return true end
Card.IsDefense = function() return true end
Card.IsLevel = function() return true end
function Auxiliary.PreloadUds()
end
--村规决斗:希望剑斩
--所有卡得到以下效果:
--这个效果的发动和效果不会被无效化。
--把这张卡从手卡里侧表示除外才能发动。从卡组外将2张有装备效果,
--且能加入手卡的随机「异热同心武器」卡加入手卡。
--这个效果加入手卡的卡,在那个回合不能把此类效果发动(即使发生过位置移动)。
--加入的卡不需要给对方确认。
--所有怪兽得到以下效果:
--这张卡的卡名在场上·墓地也当作【混沌No.39希望皇 霍普雷】使用。这个效果不会被无效化。
CUNGUI = {}
CUNGUI.ZexalWeapons={2648201,6330307,12927849,18865703,29353756,32164201,
32281491,40941889,45082499,76080032,81471108,87008374,95886782}
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)
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(66666004,4))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(CUNGUI.cost)
e1:SetProperty(EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(CUNGUI.operation)
c:RegisterEffect(e1)
if c:IsType(TYPE_MONSTER) then
Auxiliary.AddCodeList(c,56840427)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetValue(56840427)
c:RegisterEffect(e2)
end
end
function CUNGUI.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEDOWN,REASON_COST)
end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local add=0
if not CUNGUI.DiceInit then
CUNGUI.DiceInit=true
local a1,a2,a3,a4,a5=Duel.TossDice(tp,5)
local a6,a7,a8,a9,a10=Duel.TossDice(tp,5)
local x=a1*6^10+a2*6^9+a3*6^8+a4*6^7+a5*6^6+a6*6^5+a7*6^4+a8*6^3+a9*6^2+a10*6
math.randomseed(x)
end
while add<2 do
local code=math.random(#CUNGUI.ZexalWeapons)
local tc=Duel.CreateToken(tp,CUNGUI.ZexalWeapons[code])
if tc then
add = add + Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
--村规决斗:自由主义
--所有回合发动次数限制变为3倍。
CUNGUI = {}
local SetCountLimit = Effect.SetCountLimit
Effect.SetCountLimit = function(e,count,code)
count = count * 3
SetCountLimit(e,count,code)
end
function Auxiliary.PreloadUds()
end
--村规决斗:即刻开摆
--游戏开始时,各自从卡组外将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:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
CUNGUI.Exceptions=Group.CreateGroup()
CUNGUI.origE=Card.RegisterEffect
Card.RegisterEffect = function(c,e,forced)
if CUNGUI.Exceptions:IsContains(c) then return false end
return CUNGUI.origE(c,e,forced)
end
function CUNGUI.AdjustOperation2(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(Card.IsCode,0,0x7f-LOCATION_HAND-LOCATION_ONFIELD,0x7f-LOCATION_HAND-LOCATION_ONFIELD,nil,10000)
if #g > 0 then
Duel.SendtoHand(g,REASON_RULE+REASON_RETURN)
end
end
function CUNGUI.EnablePendulumAttribute(c,reg)
if not Auxiliary.PendulumChecklist then
Auxiliary.PendulumChecklist=0
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(Auxiliary.PendulumReset)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(1163)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(Auxiliary.PendCondition())
e1:SetOperation(Auxiliary.PendOperation())
e1:SetValue(SUMMON_TYPE_PENDULUM)
CUNGUI.origE(c,e1)
--register by default
if reg==nil or reg then
local e2=Effect.CreateEffect(c)
e2:SetDescription(1160)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
CUNGUI.origE(c,e2)
end
end
function CUNGUI.InitPlayer(tp)
local xre=Card.RegisterEffect
Card.RegisterEffect = function() return false end
local card1 = Duel.CreateToken(tp,22211622)
local card2 = Duel.CreateToken(tp,96227613)
Card.RegisterEffect = xre
CUNGUI.EnablePendulumAttribute(card1)
CUNGUI.EnablePendulumAttribute(card2)
Duel.MoveToField(card1,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
Duel.MoveToField(card2,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
local g=Group.CreateGroup()
g:AddCard(card1)
g:AddCard(card2)
g:KeepAlive()
CUNGUI.Exceptions:AddCard(card1)
CUNGUI.Exceptions:AddCard(card2)
--return
local e2=Effect.CreateEffect(card1)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_ADJUST)
e2:SetLabelObject(g)
e2:SetOperation(CUNGUI.PCardReturnToField)
Duel.RegisterEffect(e2,tp)
end
function CUNGUI.PCardReturnToField(e,tp)
local g=e:GetLabelObject()
local pzcard=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
for tc in aux.Next(pzcard) do
if not g:IsContains(tc) then
Duel.SendtoExtraP(tc,nil,REASON_RULE)
end
end
for tc in aux.Next(g) do
if not tc:IsLocation(LOCATION_PZONE) then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
if not CUNGUI.INIT then
CUNGUI.INIT = true
CUNGUI.InitPlayer(0)
CUNGUI.InitPlayer(1)
end
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