Commit 71c6cc38 authored by 未闻皂名's avatar 未闻皂名

2022/9/26 新增:B223新卡,念动力新卡,更新守备力判断函数

parent 17c0bf64
No preview for this file type
......@@ -52,6 +52,10 @@ end
function RushDuel.IsLPBelowOpponent(player, lp)
return Duel.GetLP(player) <= Duel.GetLP(1 - player) - (lp or 0)
end
-- 条件: 守备力为 def
function RushDuel.IsDefense(card, def)
return card:IsDefense(def) and not RushDuel.IsMaximumMode(card)
end
-- 条件: 守备力在 def 以上
function RushDuel.IsDefenseAbove(card, def)
return card:IsDefenseAbove(def) and not RushDuel.IsMaximumMode(card)
......
......@@ -18,7 +18,7 @@ function cm.exfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsLocation(LOCATION_GRAVE)
end
function cm.thfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsDefense(0) and c:IsAbleToHand()
return c:IsRace(RACE_CYBERSE) and RD.IsDefense(c,0) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
......
......@@ -16,7 +16,7 @@ function cm.initial_effect(c)
end
--Special Summon
function cm.confilter(c)
return c:IsFaceup() and c:IsAttack(100) and c:IsDefense(100)
return c:IsFaceup() and c:IsAttack(100) and RD.IsDefense(c,100)
end
function cm.spfilter(c,e,tp)
return c:IsLevel(7) and c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_ATTACK)
......
......@@ -29,7 +29,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.confilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsDefense(500)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and RD.IsDefense(c,500)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,1,nil)
......
......@@ -18,7 +18,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.confilter1(c)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsDefense(500)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and RD.IsDefense(c,500)
end
function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp
......
......@@ -19,7 +19,7 @@ function cm.confilter(c,tp)
and RD.IsPreviousAttribute(c,ATTRIBUTE_LIGHT)
end
function cm.spfilter(c,e,tp)
return (c:IsRace(RACE_CYBORG) or (c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsDefense(500)))
return (c:IsRace(RACE_CYBORG) or (c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and RD.IsDefense(c,500)))
and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -20,7 +20,7 @@ function cm.costfilter(c)
return c:IsCode(list[1]) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDefense(400)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_FIRE) and RD.IsDefense(c,400)
and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,1,1)
......
......@@ -17,7 +17,7 @@ function cm.costfilter(c,e,tp)
return c:IsAbleToDeckAsCost() and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,c,e,tp)
end
function cm.spfilter(c,e,tp)
return c:IsLevelBelow(7) and c:IsRace(RACE_FIEND) and c:IsDefense(0) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
return c:IsLevelBelow(7) and c:IsRace(RACE_FIEND) and RD.IsDefense(c,0) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.thfilter(c)
return c:IsRace(RACE_FIEND) and c:IsAbleToHand()
......
......@@ -22,7 +22,7 @@ function cm.confilter2(c)
return c:IsFaceup() and not c:IsRace(RACE_WARRIOR)
end
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_WARRIOR) and c:IsAttack(1000) and c:IsDefense(1000)
return c:IsRace(RACE_WARRIOR) and c:IsAttack(1000) and RD.IsDefense(c,1000)
and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_DEFENSE)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -16,7 +16,7 @@ function cm.filter(c)
return c:IsFaceup() and RD.IsCanAttachDoubleTribute(c,cm.trival)
end
function cm.exfilter(c)
return c:IsFaceup() and c:IsLevel(6) and c:IsDefense(500)
return c:IsFaceup() and c:IsLevel(6) and RD.IsDefense(c,500)
end
function cm.check(g)
return g:GetClassCount(Card.GetRace)==g:GetCount()
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.filter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsDefense(0) and c:IsAbleToHand()
return c:IsAttribute(ATTRIBUTE_DARK) and RD.IsDefense(c,0) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,2,nil) end
......
......@@ -16,7 +16,7 @@ function cm.initial_effect(c)
end
--To Hand
function cm.confilter(c)
return c:IsFaceup() and c:IsAttack(1000) and c:IsDefense(1000)
return c:IsFaceup() and c:IsAttack(1000) and RD.IsDefense(c,1000)
end
function cm.thfilter(c)
return c:IsLevel(8) and c:IsAttack(2500) and c:IsAbleToHand()
......
local m=120228021
local cm=_G["c"..m]
cm.name="琴斧蓝麦"
function cm.initial_effect(c)
--To Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--To Deck
function cm.confilter(c)
return c:IsFaceup() and not c:IsLevel(3) and c:IsRace(RACE_PSYCHO)
end
function cm.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler()) and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)<=4
and Duel.GetMatchingGroupCount(cm.confilter,tp,LOCATION_MZONE,0,nil)==2
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=5-Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,0,LOCATION_GRAVE,2,nil)
and ct>0 and Duel.IsPlayerCanDraw(1-tp,ct) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,2,2,nil,function(g)
if RD.SendToDeckAndExists(g) then
local ct=5-Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(1-tp,ct,REASON_EFFECT)
end
end
end)
end
\ No newline at end of file
local m=120228022
local cm=_G["c"..m]
cm.name="蓝草窃取者"
function cm.initial_effect(c)
--Discard Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Discard Deck
cm.trival=RD.ValueDoubleTribute(ATTRIBUTE_WIND,RACE_PSYCHO)
function cm.exfilter(c)
return c:IsRace(RACE_PSYCHO) and c:IsLocation(LOCATION_GRAVE)
end
function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and RD.IsCanAttachDoubleTribute(c,cm.trival)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,1,cm.exfilter,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),aux.Stringid(m,2),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.AttachDoubleTribute(e,g:GetFirst(),cm.trival,aux.Stringid(m,3),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
end
end
\ No newline at end of file
local m=120228054
local list={120170002}
local cm=_G["c"..m]
cm.name="即兴果酱音跃:P检查!"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO)
end
function cm.exfilter(c)
return c:IsFaceup() and c:IsCode(list[1])
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.confilter,tp,LOCATION_MZONE,0,nil)
return g:GetCount()>=2 and g:IsExists(Card.IsType,1,nil,TYPE_NORMAL)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_FACEDOWN,Card.IsFacedown,tp,0,LOCATION_SZONE,1,2,nil,function(g)
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
if sg:GetCount()>0 then
Duel.HintSelection(sg)
if Duel.Destroy(sg,REASON_EFFECT)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Recover(tp,1000,REASON_EFFECT)
end
end
end)
end
\ No newline at end of file
local m=120231001
local list={120106001,120220001}
local cm=_G["c"..m]
cm.name="龙骑士 盖亚"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Fusion Material
aux.AddFusionProcCode2(c,list[1],list[2],true,true)
end
local m=120231010
local cm=_G["c"..m]
cm.name="全套运动衫"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return c:IsFaceup() and RD.IsDefense(c,500)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
cm.cost=RD.CostPayLP(500)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
g:ForEach(function(tc)
RD.AttachAtkDef(e,tc,500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_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