Commit a83e2299 authored by 未闻皂名's avatar 未闻皂名

2024/11/10 新增:KP19新卡,极大模式判断修改

parent d017cca6
No preview for this file type
......@@ -21,6 +21,7 @@ EFFECT_PLAYER_CANNOT_ACTIVATE_TRAP = 120247013 -- 三角神迷火花 (整个回
EFFECT_PLAYER_CANNOT_ACTIVATE_TRAP_BATTLE = 120261022 -- 暗物质人偶·水母 (战斗阶段不能发动陷阱)
EFFECT_ATTACK_NOT_CHAIN_TRAP = 120140004 -- 不许始末战士 (攻击宣言时, 对方不能把陷阱卡发动)
EFFECT_ONLY_FUSION_SUMMON = 120263031 -- 只能融合召唤 (奇迹融合)
EFFECT_MAXIMUM_MODE = 120272058 -- 通过效果变成极大模式 (时间机器)
FLAG_SUMMON_TURN = 120000011 -- 召唤·特殊召唤的回合被盖放, 不再符合召唤·特殊召唤的回合的条件
FLAG_ATTACK_ANNOUNCED = 120000012 -- 已经进行了攻击宣言, 不能向怪兽攻击的效果失效
......
......@@ -2,7 +2,7 @@
RushDuel = RushDuel or {}
TYPE_MAXIMUM = 0x400 -- 极大怪兽
SUMMON_TYPE_MAXIMUM = 0x45000000 -- 极大模式
SUMMON_TYPE_MAXIMUM = 0x45000000 -- 极大召唤
-- 初始化极大怪兽规则
function RushDuel.InitMaximum()
......@@ -27,36 +27,36 @@ function RushDuel.InitMaximum()
Duel.RegisterEffect(e4, 0)
end
function RushDuel.MaximumMonster(e, c)
return c:IsSummonType(SUMMON_TYPE_MAXIMUM) and c:GetOverlayCount() > 0
return c:IsHasEffect(EFFECT_MAXIMUM_MODE) and c:GetOverlayCount() > 0
end
function RushDuel.MaximumMonsterAtk(e, c)
return c:IsPosition(POS_FACEUP_ATTACK) and RushDuel.MaximumMonster(e, c)
end
-- 添加极大召唤手续
function RushDuel.AddMaximumProcedure(c, max_atk, left_code, right_code)
if c:IsStatus(STATUS_COPYING_EFFECT) then
function RushDuel.AddMaximumProcedure(card, max_atk, left_code, right_code)
if card:IsStatus(STATUS_COPYING_EFFECT) then
return
end
-- 记录状态
if c.maximum_attack == nil then
local mt = getmetatable(c)
if card.maximum_attack == nil then
local mt = getmetatable(card)
mt.maximum_attack = max_atk
end
-- 极大召唤 手续
RushDuel.AddHandSpecialSummonProcedure(c, aux.Stringid(120000000, 0), RushDuel.MaximumSummonCondition(left_code, right_code), RushDuel.MaximumSummonTarget(left_code, right_code),
RushDuel.AddHandSpecialSummonProcedure(card, aux.Stringid(120000000, 0), RushDuel.MaximumSummonCondition(left_code, right_code), RushDuel.MaximumSummonTarget(left_code, right_code),
RushDuel.MaximumSummonOperation(left_code, right_code), RushDuel.MaximumSummonValue, POS_FACEUP_ATTACK)
-- 极大攻击力
local e1 = Effect.CreateEffect(c)
local e1 = Effect.CreateEffect(card)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(RushDuel.MaximumMode)
e1:SetValue(max_atk)
c:RegisterEffect(e1)
card:RegisterEffect(e1)
-- 占用3个主要怪兽区域
local e2 = Effect.CreateEffect(c)
local e2 = Effect.CreateEffect(card)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_MAX_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
......@@ -64,7 +64,7 @@ function RushDuel.AddMaximumProcedure(c, max_atk, left_code, right_code)
e2:SetTargetRange(1, 0)
e2:SetCondition(RushDuel.MaximumMode)
e2:SetValue(1)
c:RegisterEffect(e2)
card:RegisterEffect(e2)
end
function RushDuel.MaximumSummonFilter(c, e, tp, left_code, right_code)
return c:IsCode(left_code, right_code) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP)
......@@ -113,12 +113,25 @@ function RushDuel.MaximumSummonOperation(left_code, right_code)
c:SetMaterial(mg)
Duel.Overlay(c, mg)
mg:DeleteGroup()
RushDuel.EnableMaximumMode(c, RESET_EVENT + 0xff0000)
end
end
function RushDuel.MaximumSummonValue(e, c)
return SUMMON_TYPE_MAXIMUM, 0x4
end
-- 手动添加极大模式
function RushDuel.EnableMaximumMode(card, reset)
local e = Effect.CreateEffect(card)
e:SetType(EFFECT_TYPE_SINGLE)
e:SetCode(EFFECT_MAXIMUM_MODE)
e:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e:SetRange(LOCATION_MZONE)
e:SetReset(reset)
card:RegisterEffect(e, true)
end
-- 极大模式
function RushDuel.MaximumMode(e)
local c = e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_MAXIMUM) and c:GetOverlayCount() > 0
return c:IsHasEffect(EFFECT_MAXIMUM_MODE) and c:GetOverlayCount() > 0
end
local m=120218012
local list={120209001,120109024}
local cm=_G["c"..m]
cm.name="穿越侍·突袭线性海牛侍"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Fusion Material
RD.AddFusionProcedure(c,list[1],cm.matfilter)
--Level Down
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Fusion Material
cm.unspecified_funsion=true
function cm.matfilter(c)
return c:IsFusionType(TYPE_EFFECT) and not c:IsLevel(7) and c:IsRace(RACE_GALAXY)
end
--Level Down
function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.exfilter(c)
return c:IsCode(list[2])
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLevelAbove(4)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2,nil,nil,function(g)
if g:IsExists(cm.exfilter,1,nil) then
return 20272035
else
return 0
end
end)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local reset=RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END
RD.AttachLevel(e,c,-3,reset)
if e:GetLabel()==20272035 then
local e1=RD.AttachPierce(e,c,aux.Stringid(m,1),reset)
e1:SetValue(DOUBLE_DAMAGE)
end
end
end
\ No newline at end of file
......@@ -16,7 +16,7 @@ function cm.initial_effect(c)
end
--Change Code
function cm.spfilter(c,e,tp)
return c:IsCode(list[2]) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
return c:IsCode(list[2]) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_DEFENSE)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsCode(list[1])
......@@ -26,6 +26,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.ChangeCode(e,c,list[1],RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_DEFENSE,true)
end
end
\ No newline at end of file
local m=120272029
local list={120272029}
local cm=_G["c"..m]
cm.name="龙水之神子"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Destroy
function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:GetSequence()<5
end
function cm.check(g)
if g:IsExists(Card.IsCode,1,nil,list[1]) then
return g:GetCount()==1 or g:GetCount()==4
else
return g:GetCount()==4
end
end
cm.cost=RD.CostSendGraveSubToDeck(cm.costfilter,cm.check,1,4)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_SZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_SZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_SZONE,1,1,nil,function(g)
Duel.Destroy(g,REASON_EFFECT)
end)
end
\ No newline at end of file
local m=120272033
local cm=_G["c"..m]
cm.name="诡术师"
function cm.initial_effect(c)
--Special Summon Procedure
RD.AddHandSpecialSummonProcedure(c,aux.Stringid(m,0),cm.spcon,cm.sptg,cm.spop)
end
--Special Summon Procedure
function cm.spconfilter(c)
return c:IsAbleToGraveAsCost()
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spconfilter,tp,LOCATION_HAND,0,1,e:GetHandler())
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.spconfilter,tp,LOCATION_HAND,0,0,1,e:GetHandler())
if g:GetCount()>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else
return false
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup()
end
\ No newline at end of file
local m=120272046
local list={120196006,120272001}
local cm=_G["c"..m]
cm.name="钢铁徽章之阿尔玛明星"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_DESTROY)
e2:SetCategory(CATEGORY_CONTROL)
end
--Multi-Choose Effect
cm.cost=RD.CostChangeSelfPosition()
--Destroy
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()==0 then return end
Duel.ConfirmCards(tp,g)
local sg=g:Filter(Card.IsType,nil,TYPE_SPELL)
if sg:GetCount()>0 then
Duel.Destroy(sg,REASON_EFFECT)
end
end
--Control
function cm.filter(c)
return c:IsFaceup() and not c:IsType(TYPE_MAXIMUM) and c:IsRace(RACE_FAIRY)
and c:IsControlerCanBeChanged()
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,1-tp,LOCATION_MZONE)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_CONTROL,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
Duel.GetControl(g:GetFirst(),tp)
end)
end
\ No newline at end of file
local m=120272058
local cm=_G["c"..m]
cm.name="时间机械"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return eg:GetCount()==1
and Duel.GetLocationCount(tc:GetPreviousControler(),LOCATION_MZONE)>0
and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE)
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,tc:GetPreviousPosition(),tc:GetPreviousControler()) end
tc:CreateEffectRelation(e)
if tc:GetPreviousOverlayCountOnField()>0 then
e:SetLabel(1)
else
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,eg,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) then
if e:GetLabel()==1 then
local og=tc:GetMaterial()
if Duel.SpecialSummon(tc,0,tp,tc:GetPreviousControler(),false,false,tc:GetPreviousPosition())~=0 then
tc:SetMaterial(og)
Duel.Overlay(tc,og)
RD.EnableMaximumMode(tc,RESET_EVENT+RESETS_STANDARD)
end
else
Duel.SpecialSummon(tc,0,tp,tc:GetPreviousControler(),false,false,tc:GetPreviousPosition())
end
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