Commit e59e19c3 authored by JoyJ's avatar JoyJ
parents abd0c027 5ff0e941
--村规决斗:你忍一下 EX --村规决斗:你忍一下 EX
--所有怪兽得到以下效果: --所有怪兽得到以下效果,这些效果不会被无效化
--这张卡当作4星使用。 --这张卡当作4星使用。
--这张卡的攻击力变成原本的1/100(向上取整)。 --这张卡的攻击力变成原本的1/100(向上取整)。
--直接攻击成功时,对方失去这张卡原本攻击力2倍的基本分。 --直接攻击成功时,对方失去这张卡原本攻击力2倍的基本分。
CUNGUI = {} CUNGUI = {}
local cgl = Card.GetLevel
Card.GetLevel = function() return 4 end Card.GetLevel = function(c) return (not c:IsLocation(LOCATION_HAND+LOCATION_MZONE)) and cgl(c) or 4 end
Card.IsLevelAbove = function(c,lv) return lv<=4 end local cila = Card.IsLevelAbove
Card.IsLevelBelow = function(c,lv) return lv>=4 end Card.IsLevelAbove = function(c,lv) return (not c:IsLocation(LOCATION_HAND+LOCATION_MZONE)) and cila(c) or lv<=4 end
local cilb = Card.IsLevelBelow
Card.IsLevelAbove = function(c,lv) return (not c:IsLocation(LOCATION_HAND+LOCATION_MZONE)) and cilb(c) or lv>=4 end
local cil = Card.IsLevel
Card.IsLevel = function(c,...) Card.IsLevel = function(c,...)
if not c:IsLocation(LOCATION_HAND+LOCATION_MZONE) then return cil(c,...) end
for _,lv in ipairs{...} do for _,lv in ipairs{...} do
if lv==4 then return true end if lv==4 then return true end
end end
...@@ -24,6 +28,17 @@ function Auxiliary.PreloadUds() ...@@ -24,6 +28,17 @@ function Auxiliary.PreloadUds()
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation) e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
if not CUNGUI.init then
CUNGUI.init = true
--level
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,LOCATION_HAND+LOCATION_MZONE)
e2:SetTarget(aux.TRUE)
e2:SetValue(4)
Duel.RegisterEffect(e2,0)
end
end end
CUNGUI.RegisteredMonsters = Group.CreateGroup() CUNGUI.RegisteredMonsters = Group.CreateGroup()
...@@ -54,7 +69,7 @@ function CUNGUI.RegisterMonsterSpecialEffects(c) ...@@ -54,7 +69,7 @@ function CUNGUI.RegisterMonsterSpecialEffects(c)
e2:SetDescription(aux.Stringid(56052205,0)) e2:SetDescription(aux.Stringid(56052205,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetCondition(CUNGUI.condition) e2:SetCondition(CUNGUI.condition)
e2:SetOperation(CUNGUI.operation) e2:SetOperation(CUNGUI.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -64,11 +79,8 @@ function CUNGUI.RegisterMonsterSpecialEffects(c) ...@@ -64,11 +79,8 @@ function CUNGUI.RegisterMonsterSpecialEffects(c)
e3:SetValue(4) e3:SetValue(4)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function CUNGUI.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x12) and not c:IsCode(56052205)
end
function CUNGUI.condition(e,tp,eg,ep,ev,re,r,rp) function CUNGUI.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetAttackTarget()==nil and e:GetHandler():GetBaseAttack()>0 return ep~=tp and Duel.GetAttackTarget()==nil
end end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp) function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp)
local lp = Duel.GetLP(1-tp) - e:GetHandler():GetBaseAttack() * 2 local lp = Duel.GetLP(1-tp) - e:GetHandler():GetBaseAttack() * 2
......
--村规决斗:以血为祭
--所有卡片原本的Cost变为【支付200点基本分才能发动】。
--为没有Cost的效果添加以上Cost。
CUNGUI = {}
local reg=Card.RegisterEffect
Card.RegisterEffect=function(c,e,f)
local new_cost = function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,200) end
Duel.DisableActionCheck(true)
Duel.PayLPCost(tp,200)
Duel.DisableActionCheck(false)
end
e:SetCost(new_cost)
return reg(c,e,f)
end
function Auxiliary.PreloadUds()
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: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)
--control
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(31833038,1))
e4:SetCategory(CATEGORY_CONTROL)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_START)
e4:SetTarget(CUNGUI.cttg)
e4:SetOperation(CUNGUI.ctop)
c:RegisterEffect(e4)
end
function CUNGUI.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetAttackTarget()
if chk==0 then
return Duel.GetAttacker()==c and tc and tc:IsControlerCanBeChanged()
and c:IsOwner(tp)
end
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,tc,1,0,0)
end
function CUNGUI.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp)
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 typ = e:GetType()
if typ and (typ & 0x7d0)==0 then
return reg(c,e,f)
end
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 typ = e:GetType()
if typ and (typ & 0x7d0)==0 then
return dreg(e,tp)
end
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
--村规决斗:源源不绝
--所有怪兽得到以下效果:
--场上表侧表示存在的这张卡被送去墓地的场合才能发动。
--从卡组把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)
--Search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(1644289,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(CUNGUI.thcon)
e4:SetTarget(CUNGUI.thtg)
e4:SetOperation(CUNGUI.thop)
c:RegisterEffect(e4)
end
function CUNGUI.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP)
and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function CUNGUI.thfilter(c,typ)
return c:GetType()==typ and c:IsAbleToHand()
end
function CUNGUI.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(CUNGUI.thfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler():GetType()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function CUNGUI.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,CUNGUI.thfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetHandler():GetType())
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
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