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

2022/9/23 新增:花牙新卡,新增从卡组底把卡送去墓地的操作

parent 740dd10b
No preview for this file type
......@@ -191,6 +191,15 @@ end
function RushDuel.SendDeckTopToGraveAndExists(player, card_count, filter, count, expect)
return Duel.DiscardDeck(player, card_count, REASON_EFFECT) ~= 0 and RushDuel.IsOperatedGroupExists(filter, count, expect)
end
-- 操作: 从卡组下面把卡送去墓地
function RushDuel.SendDeckBottomToGraveAndExists(player, card_count, filter, count, expect)
local dg = RushDuel.GetDeckBottomGroup(player, card_count)
if dg:GetCount() == 0 then
return false
end
Duel.DisableShuffleCheck()
return Duel.SendtoGrave(dg, REASON_EFFECT) ~= 0 and RushDuel.IsOperatedGroupExists(filter, count, expect)
end
-- 操作: 随机选对方的手卡送去墓地
function RushDuel.SendOpponentHandToGrave(tp, desc, min, max)
local g = Duel.GetFieldGroup(tp, 0, LOCATION_HAND)
......
......@@ -124,6 +124,20 @@ function RushDuel.CostSendDeckTopToGrave(count, set_label, set_object)
end
end
end
-- 代价: 从卡组下面把卡送去墓地
function RushDuel.CostSendDeckBottomToGrave(count, set_label, set_object)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return Duel.IsPlayerCanDiscardDeckAsCost(tp, count)
end
local dg = RushDuel.GetDeckBottomGroup(tp, count)
Duel.DisableShuffleCheck()
if Duel.SendtoGrave(dg, REASON_COST) ~= 0 and (set_label ~= nil or set_object ~= nil) then
local og = Duel.GetOperatedGroup()
RushDuel.SetLabelAndObject(e, og, set_label, set_object)
end
end
end
-- 代价: 把自己场上表侧表示的这张卡送去墓地
function RushDuel.CostSendSelfToGrave()
return function(e, tp, eg, ep, ev, re, r, rp, chk)
......
......@@ -107,6 +107,16 @@ function RushDuel.SendDeckBottomToTop(player, count)
Duel.MoveSequence(g:GetMinGroup(Card.GetSequence):GetFirst(), 0)
end
end
-- 获取卡组底的N张卡
function RushDuel.GetDeckBottomGroup(player, count)
local dg = Duel.GetFieldGroup(player, LOCATION_DECK, 0)
local ct = dg:GetCount()
if (count < ct) then
local top = Duel.GetDecktopGroup(player, ct - count)
dg:Sub(top)
end
return dg
end
-- 返回卡组并排序
function RushDuel.SendToDeckSort(target, sequence, reason, sort_player, target_player)
......
......@@ -30,7 +30,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),function(g)
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e),function(g)
Duel.Destroy(g,REASON_EFFECT)
end)
end
\ No newline at end of file
......@@ -30,7 +30,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),function(g)
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e),function(g)
Duel.Destroy(g,REASON_EFFECT)
end)
end
\ No newline at end of file
......@@ -7,7 +7,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_PLAYER_TARGET)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
......
local m=120228011
local cm=_G["c"..m]
cm.name="银河舰空白龙"
function cm.initial_effect(c)
--To Hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_ATKCHANGE)
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
--To Hand
function cm.costfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end
function cm.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:GetSequence()<5 and c:IsAbleToHand()
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsLevelBelow(7) and c:IsAttackAbove(2500)
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,0,LOCATION_SZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.thfilter,tp,0,LOCATION_SZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_RTOHAND,cm.thfilter,tp,0,LOCATION_SZONE,1,1,nil,function(g)
if RD.SendToOpponentHand(g)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),aux.Stringid(m,2),cm.atkfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
Duel.BreakEffect()
RD.AttachAtkDef(e,g:GetFirst(),-2500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
end
end)
end
\ No newline at end of file
local m=120228018
local list={120228048,120228049}
local cm=_G["c"..m]
cm.name="希花牙之鸢尾花"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
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
--Set
function cm.setfilter(c)
return c:IsCode(list[1],list[2]) and c:IsSSetable()
end
function cm.exfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsLevel(5) and c:IsRace(RACE_PLANT) and c:IsLocation(LOCATION_GRAVE)
end
function cm.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PLANT) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
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.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSet(aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,1,nil,e)~=0 then
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.BreakEffect()
if RD.SendDeckBottomToGraveAndExists(tp,1,cm.exfilter,1,nil) then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
end
end
end
\ No newline at end of file
local m=120228019
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_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Discard Deck
function cm.confilter1(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT)
end
function cm.confilter2(c)
return c:IsFaceup() and not c:IsRace(RACE_PLANT)
end
function cm.exfilter(c)
return c:IsRace(RACE_PLANT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
and Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(cm.confilter2,tp,LOCATION_MZONE,0,1,nil)
end
cm.cost=RD.CostSendHandToDeckBottom(Card.IsAbleToDeckAsCost,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,3,cm.exfilter,1,nil) then
RD.CanDraw(aux.Stringid(m,1),tp,1)
end
end
\ No newline at end of file
local m=120228033
local cm=_G["c"..m]
cm.name="幽灵恶毒"
function cm.initial_effect(c)
--Attack Twice
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:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Attack Twice
function cm.confilter(c)
return c:IsFaceup() and c:IsLevel(5) and c:IsRace(RACE_ZOMBIE)
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevel(5) and c:IsRace(RACE_ZOMBIE) and RD.IsCanAttachExtraAttack(c,1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
and Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
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.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.AttachExtraAttack(e,g:GetFirst(),1,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
end
\ No newline at end of file
local m=120228035
local cm=_G["c"..m]
cm.name="新生挥舞植物"
function cm.initial_effect(c)
--Indes
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
--Indes
cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP)
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsCanAttachEffectIndes(e:GetHandler(),cm.indval)
end
cm.cost=RD.CostSendDeckBottomToGrave(1,function(g)
return g:GetFirst():GetRace()
end)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.AttachEffectIndes(e,c,cm.indval,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
if e:GetLabel()==RACE_PLANT then
RD.AttachAtkDef(e,c,700,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
end
end
end
\ No newline at end of file
local m=120228037
local list={120170028,120170007,120170057}
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)
--Direct Attack
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:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Direct Attack
function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT) and RD.IsCanAttachDirectAttack(c)
end
function cm.setfilter(c)
return c:IsCode(list[3]) and c:IsSSetable()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
cm.cost=RD.CostSendDeckTopToGrave(3)
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.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.AttachDirectAttack(e,g:GetFirst(),aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
RD.CanSelectAndSet(aux.Stringid(m,3),aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,1,nil,e)
end)
end
\ No newline at end of file
local m=120228038
local list={120170028,120170007,120170058}
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)
--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:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Destroy
function cm.setfilter(c)
return c:IsCode(list[3]) and c:IsSSetable()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,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,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
RD.CanSelectAndSet(aux.Stringid(m,1),aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,true)
end
end)
end
\ No newline at end of file
local m=120228048
local cm=_G["c"..m]
cm.name="花牙缝纫"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.confilter(c)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PLANT)
end
function cm.atkfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PLANT)
end
function cm.exfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsLevel(5)
end
function cm.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7)
end
cm.cost=RD.CostSendDeckTopToGrave(3)
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_GRAVE,0,1,nil) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local atk=Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_GRAVE,0,nil)*-100
if atk==0 then return end
RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.AttachAtkDef(e,g:GetFirst(),atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local dg=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end)
end
\ No newline at end of file
local m=120228049
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+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PLANT) and c:IsLevelAbove(1)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetLevel())
end
function cm.spfilter(c,e,tp,lv)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PLANT) and c:IsLevelBelow(lv)
and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.exfilter(c)
return c:IsFaceup() and c:IsLevel(5)
end
function cm.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7)
end
cm.cost=RD.CostSendHandToDeckBottom(Card.IsAbleToDeckAsCost,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(aux.Stringid(m,1),filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
local lv=g:GetFirst():GetLevel()
local spfilter=function(c,e,tp)
return cm.spfilter(c,e,tp,lv)
end
if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(spfilter),tp,LOCATION_GRAVE,0,1,2,nil,e,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local dg=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end)
end
\ No newline at end of file
local m=120228061
local cm=_G["c"..m]
cm.name="蓝之牢狱"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
--Activate
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
cm.cost=RD.CostSendMZoneToGrave(Card.IsAbleToGraveAsCost,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)~=0 and Duel.GetFlagEffect(1-tp,m)~=0 end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,1)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_GRAVE) and c:IsLevel(7,8)
end
\ No newline at end of file
local m=120228065
local cm=_G["c"..m]
cm.name="复仇极斧"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
--Activate
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup()
end
function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.desfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsLevelBelow(8)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD,0,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,LOCATION_ONFIELD,0,1,1,aux.ExceptThisCard(e),function(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 and g:GetFirst():IsType(TYPE_EQUIP) then
local sg=eg:Filter(cm.desfilter,nil)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=sg:Select(tp,1,1,nil)
if dg:GetCount()>0 then
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
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