Commit 880c4887 authored by JoyJ's avatar JoyJ

update srv5555 scripts

parent 8178625a
--村规决斗:一起哈啤
--所有怪兽得到以下效果:
--这张卡召唤·特殊召唤成功的场合发动。
--对方必须从卡组外把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)
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
local g = Duel.GetMatchingGroup(Card.IsType,0,0x7f,0x7f,nil,TYPE_MONSTER)
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)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1)
e2:SetOperation(CUNGUI.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function CUNGUI.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.CreateToken(1-tp,c:GetCode())
Duel.MoveToField(tc,1-tp,1-tp,LOCATION_MZONE,c:GetPosition(),true)
end
\ No newline at end of file
--村规决斗:一将功成
--所有怪兽得到以下效果:
--这张卡可以丢弃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,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)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(CUNGUI.spcon)
e1:SetOperation(CUNGUI.spop)
c:RegisterEffect(e1)
end
function CUNGUI.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c)
end
function CUNGUI.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
--村规决斗:下不为例
--所有含有次数限制的效果,变为决斗中X次的效果。
--X的数量是原限制次数*3。
CUNGUI = {}
local scl = Effect.SetCountLimit
Effect.SetCountLimit = function(e,count,code)
if not code then
code = EFFECT_COUNT_CODE_DUEL
else
code = code | EFFECT_COUNT_CODE_DUEL
end
count = count * 3
scl(e,count,code)
end
\ No newline at end of file
--村规决斗:怪以类聚
--所有怪兽得到以下效果:
--这张卡召唤·特殊召唤成功的场合,
--从手卡·卡组·墓地·除外的卡中将所有同名怪兽
--无视召唤条件和苏生限制在自己场上尽可能地攻击表示特殊召唤。
--这个效果特殊召唤的卡当作正规召唤使用。
--后攻多抽2张。
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,0x7f,0x7f,nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
if not CUNGUI.Init then
CUNGUI.Init = 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)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1)
e2:SetOperation(CUNGUI.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
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
--村规决斗:极性不定
--所有卡片原本的Cost变为效果,原本的效果变为Cost。
--所有效果的动作信息不变(即,灰流丽·星尘龙以前能无效的现在也能无效)。
CUNGUI = {}
REASON_COST = 0x40
REASON_EFFECT = 0x80
Card.IsAbleToDeckAsCost,Card.IsAbleToDeck=Card.IsAbleToDeck,Card.IsAbleToDeckAsCost
Card.IsAbleToDeckOrExtraAsCost=Card.IsAbleToDeckAsCost --实质IsAbleToDeck
Card.IsAbleToDecreaseAttackAsCost=aux.TRUE
Card.IsAbleToDecreaseDefenseAsCost=aux.TRUE
Card.IsAbleToExtraAsCost=aux.TRUE
Card.IsAbleToHand,Card.IsAbleToHandAsCost=Card.IsAbleToHandAsCost,Card.IsAbleToHand
Card.IsAbleToRemove,Card.IsAbleToRemoveAsCost=Card.IsAbleToRemoveAsCost,Card.IsAbleToRemove
Card.IsAbleToGrave,Card.IsAbleToGraveAsCost=Card.IsAbleToGraveAsCost,Card.IsAbleToGrave
local dreg=Duel.RegisterEffect
local reg=Card.RegisterEffect
Card.RegisterEffect=function(c,e,f)
local targ = e:GetTarget()
local cost = e:GetCost()
local op = e:GetOperation()
local new_cost = function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if targ then return targ(e,tp,eg,ep,ev,re,r,rp,chk) end
return true
end
Duel.DisableActionCheck(true)
if targ then targ(e,tp,eg,ep,ev,re,r,rp,1) end
if op then op(e,tp,eg,ep,ev,re,r,rp,1) end
Duel.DisableActionCheck(false)
end
local new_targ = function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return targ(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then
if cost then return cost(e,tp,eg,ep,ev,re,r,rp,chk) end
return true
end
end
local new_op = function(e,tp,eg,ep,ev,re,r,rp)
Duel.DisableActionCheck(true)
if cost then cost(e,tp,eg,ep,ev,re,r,rp,1) end
Duel.DisableActionCheck(false)
end
e:SetCost(new_cost)
e:SetTarget(new_targ)
e:SetOperation(new_op)
return reg(c,e,f)
end
Duel.RegisterEffect=function(e,tp)
local targ = e:GetTarget()
local cost = e:GetCost()
local op = e:GetOperation()
local new_cost = function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if targ then return targ(e,tp,eg,ep,ev,re,r,rp,chk) end
return true
end
Duel.DisableActionCheck(true)
if targ then targ(e,tp,eg,ep,ev,re,r,rp,1) end
if op then op(e,tp,eg,ep,ev,re,r,rp,1) end
Duel.DisableActionCheck(false)
end
local new_targ = function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return targ(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then
if cost then return cost(e,tp,eg,ep,ev,re,r,rp,chk) end
return true
end
end
local new_op = function(e,tp,eg,ep,ev,re,r,rp)
Duel.DisableActionCheck(true)
if cost then cost(e,tp,eg,ep,ev,re,r,rp,1) end
Duel.DisableActionCheck(false)
end
e:SetCost(new_cost)
e:SetTarget(new_targ)
e:SetOperation(new_op)
return dreg(e,tp)
end
function Auxiliary.PreloadUds()
end
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