Commit 2b206e0e authored by POLYMER's avatar POLYMER

fix

parent a0406f3e
No preview for this file type
No preview for this file type
--天球流转的羽之隙
local cm,m=GetID()
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(cm.con)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.check)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_SOLVED)
ge2:SetCondition(cm.clearcon)
ge2:SetOperation(cm.clear)
Duel.RegisterEffect(ge2,0)
local ge3=ge2:Clone()
ge3:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(ge3,0)
local ge4=ge1:Clone()
ge4:SetCode(EVENT_CHAIN_NEGATED)
ge4:SetCondition(cm.rscon)
ge4:SetOperation(cm.reset)
Duel.RegisterEffect(ge4,0)
end
end
function cm.check(e,tp,eg,ep,ev,re,r,rp)
local tf=re:GetHandler():IsRelateToEffect(re)
local cid=re:GetHandler():GetRealFieldID()
cm[ev]={re,tf,cid}
end
function cm.rscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>1
end
function cm.reset(e,tp,eg,ep,ev,re,r,rp)
cm[ev]={re,false,0}
end
function cm.clearcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
local i=1
while cm[i] do
cm[i]=nil
i=i+1
end
end
function cm.thfilter(c)
return c:IsSetCard(0x6977) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD,nil)
--[[local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(tc)
e2:SetCondition(cm.descon)
e2:SetOperation(cm.desop)
Duel.RegisterEffect(e2,tp)--]]
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(m)~=0 then
return true
else
e:Reset()
return false
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_DISCARD)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>0
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Group.CreateGroup()
for i=1,Duel.GetCurrentChain() do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
if tc:IsRelateToEffect(te) and tc:IsAbleToHand() and not (tc:IsLocation(LOCATION_HAND) or (tc:IsLocation(LOCATION_EXTRA) and tc:IsFacedown())) then g:AddCard(tc) end
end
return #g>0
end
local g=Group.CreateGroup()
for i=1,Duel.GetCurrentChain() do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
if tc:IsRelateToEffect(te) and tc:IsAbleToHand() and not (tc:IsLocation(LOCATION_HAND) or (tc:IsLocation(LOCATION_EXTRA) and tc:IsFacedown())) then g:AddCard(tc) end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
local i=1
while type(cm[i])=="table" do
local te,tf,cid=table.unpack(cm[i])
local tc=te:GetHandler()
if ((i<=Duel.GetCurrentChain() and tc:IsRelateToEffect(te)) or (i>Duel.GetCurrentChain() and tf and tc:GetRealFieldID()==cid)) and tc:IsAbleToHand() and not (tc:IsLocation(LOCATION_HAND) or (tc:IsLocation(LOCATION_EXTRA) and tc:IsFacedown())) then g:AddCard(tc) end
i=i+1
end
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--新世坏
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0xfd6)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,m)
e3:SetCost(cm.cos3)
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(m,1))
e4:SetTarget(cm.tg4)
c:RegisterEffect(e4)
end
--e2
function cm.conf2(c)
return c:IsSetCard(0xfd6,0x5fd5) and c:IsType(TYPE_MONSTER)
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.conf2,1,nil,0xfd6)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
eg=eg:Filter(Card.IsType,nil,TYPE_MONSTER)
local n=eg:FilterCount(Card.IsSetCard,nil,0xfd6)+3*eg:FilterCount(Card.IsSetCard,nil,0x5fd5)
e:GetHandler():AddCounter(0xfd6,n)
end
--e3
function cm.cos3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0xfd6,5,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0xfd6,5,REASON_COST)
end
function cm.tgf3(c)
return c:IsSetCard(0x5fd5) and c:IsAbleToHand()
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf3,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
e:SetLabel(1)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Group.CreateGroup()
if e:GetLabel()==1 then
g=Duel.SelectMatchingCard(tp,cm.tgf3,tp,LOCATION_DECK,0,1,1,nil)
else
g=Duel.SelectMatchingCard(tp,cm.tgf4,tp,LOCATION_DECK,0,2,2,nil)
end
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--e4
function cm.tgf4(c)
return c:IsSetCard(0xfd6) and c:IsAbleToHand()
end
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf4,tp,LOCATION_DECK,0,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
\ No newline at end of file
...@@ -52,9 +52,9 @@ end ...@@ -52,9 +52,9 @@ end
function c22348121.adjustop(e,tp,eg,ep,ev,re,r,rp) function c22348121.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase() local phase=Duel.GetCurrentPhase()
local c=e:GetHandler() local c=e:GetHandler()
local flaga=Duel.GetFlagEffect(e:GetHandler(),22348121) local flaga=Duel.GetFlagEffect(tp,22348121)
local flagb=Duel.GetFlagEffect(e:GetHandler(),22349121) local flagb=Duel.GetFlagEffect(tp,22349121)
local ct=Duel.GetFlagEffect(e:GetHandler(),22348121)-Duel.GetFlagEffect(e:GetHandler(),22349121) local ct=Duel.GetFlagEffect(tp,22348121)-Duel.GetFlagEffect(tp,22349121)
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL then return end if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL then return end
if flaga and flagb then if flaga and flagb then
Card.ResetFlagEffect(c,22350121) Card.ResetFlagEffect(c,22350121)
...@@ -78,7 +78,7 @@ end ...@@ -78,7 +78,7 @@ end
function c22348121.checkop(e,tp,eg,ep,ev,re,r,rp) function c22348121.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
while tc do while tc do
Duel.RegisterFlagEffect(e:GetHandler(),22348121,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tc:GetPreviousControler(),22348121,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext() tc=eg:GetNext()
end end
end end
...@@ -104,11 +104,11 @@ function c22348121.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -104,11 +104,11 @@ function c22348121.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c22348121.descon(e,tp,eg,ep,ev,re,r,rp) function c22348121.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(e:GetHandler(),22348121)>Duel.GetFlagEffect(e:GetHandler(),22349121) return Duel.GetFlagEffect(tp,22348121)>Duel.GetFlagEffect(tp,22349121)
end end
function c22348121.descost(e,tp,eg,ep,ev,re,r,rp,chk) function c22348121.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.RegisterFlagEffect(e:GetHandler(),22349121,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,22349121,RESET_PHASE+PHASE_END,0,1)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end end
function c22348121.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c22348121.destg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -48,6 +48,15 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -48,6 +48,15 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN) e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
e1:SetValue(Duel.GetTurnCount())
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
e1:SetValue(0)
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,1)
end
e1:SetLabelObject(c) e1:SetLabelObject(c)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetOperation(cm.retop) e1:SetOperation(cm.retop)
...@@ -56,7 +65,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -56,7 +65,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp if Duel.GetTurnPlayer()~=tp or Duel.GetTurnCount()==e:GetValue() then return false end
return e:GetLabelObject():GetFlagEffect(m)~=0
end end
function cm.retop(e,tp,eg,ep,ev,re,r,rp) function cm.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject()) Duel.ReturnToField(e:GetLabelObject())
......
...@@ -16,14 +16,23 @@ function cm.initial_effect(c) ...@@ -16,14 +16,23 @@ function cm.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_PIERCE) e4:SetCode(EFFECT_PIERCE)
e4:SetCondition(cm.con(3)) e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)>=4
end)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--attack up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23232295,0))
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_DETACH_MATERIAL)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1) end)
c:RegisterEffect(e2)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_PRE_BATTLE_DAMAGE) e5:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e5:SetCondition(cm.con(2,function(e,tp,eg,ep,ev,re,r,rp) e5:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return e:GetHandler():GetFlagEffect(m)>=2
end)) end)
e5:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e5:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2) Duel.ChangeBattleDamage(ep,ev*2)
end) end)
...@@ -40,10 +49,17 @@ end ...@@ -40,10 +49,17 @@ end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToBattle() then return end if not c:IsRelateToBattle() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(500)
c:RegisterEffect(e1)
Duel.ChainAttack()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetValue(1) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
\ No newline at end of file
...@@ -96,7 +96,8 @@ function c40009021.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -96,7 +96,8 @@ function c40009021.rmop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(c40009021.retcon) e1:SetCondition(c40009021.retcon)
e1:SetOperation(c40009021.retop) e1:SetOperation(c40009021.retop)
local reset=0 e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
--[[local reset=0
if tc:IsControler(tp) then if tc:IsControler(tp) then
reset=RESET_OPPO_TURN reset=RESET_OPPO_TURN
else else
...@@ -110,6 +111,15 @@ function c40009021.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -110,6 +111,15 @@ function c40009021.rmop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN) e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e1:SetValue(0) e1:SetValue(0)
tc:RegisterFlagEffect(40009021,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+reset,0,1) tc:RegisterFlagEffect(40009021,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+reset,0,1)
end--]]
if Duel.GetTurnPlayer()==1-tp and Duel.GetCurrentPhase()==PHASE_END then
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
e1:SetValue(Duel.GetTurnCount())
tc:RegisterFlagEffect(40009021,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e1:SetValue(0)
tc:RegisterFlagEffect(40009021,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,1)
end end
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
......
...@@ -75,11 +75,11 @@ function c40009036.eqlimit(e,c) ...@@ -75,11 +75,11 @@ function c40009036.eqlimit(e,c)
end end
function c40009036.operation(e,tp,eg,ep,ev,re,r,rp) function c40009036.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local dc=Duel.GetAttacker() local dc=Duel.GetAttacker()
if dc:IsRelateToEffect(e) and Duel.Destroy(dc,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then if dc:IsRelateToEffect(e) and Duel.Destroy(dc,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
Duel.BreakEffect() Duel.BreakEffect()
Duel.Equip(tp,c,tc) Duel.Equip(tp,c,tc)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -81,12 +81,12 @@ function c40009037.eqlimit(e,c) ...@@ -81,12 +81,12 @@ function c40009037.eqlimit(e,c)
end end
function c40009037.operation(e,tp,eg,ep,ev,re,r,rp) function c40009037.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1) Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
Duel.Equip(tp,c,tc) Duel.Equip(tp,c,tc)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP) e2:SetType(EFFECT_TYPE_EQUIP)
......
...@@ -81,10 +81,10 @@ function c40009038.eqlimit(e,c) ...@@ -81,10 +81,10 @@ function c40009038.eqlimit(e,c)
end end
function c40009038.operation(e,tp,eg,ep,ev,re,r,rp) function c40009038.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
Duel.BreakEffect() Duel.BreakEffect()
Duel.Equip(tp,c,tc) Duel.Equip(tp,c,tc)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -81,10 +81,10 @@ function c40009039.eqlimit(e,c) ...@@ -81,10 +81,10 @@ function c40009039.eqlimit(e,c)
end end
function c40009039.operation(e,tp,eg,ep,ev,re,r,rp) function c40009039.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
Duel.BreakEffect() Duel.BreakEffect()
Duel.Equip(tp,c,tc) Duel.Equip(tp,c,tc)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -31,12 +31,15 @@ function cm.initial_effect(c) ...@@ -31,12 +31,15 @@ function cm.initial_effect(c)
Duel.SpecialSummon=function(tg,...) Duel.SpecialSummon=function(tg,...)
tg=Group.__add(tg,tg) tg=Group.__add(tg,tg)
local g=Duel.GetMatchingGroup(Card.IsHasEffect,0,LOCATION_EXTRA,LOCATION_EXTRA,nil,m) local g=Duel.GetMatchingGroup(Card.IsHasEffect,0,LOCATION_EXTRA,LOCATION_EXTRA,nil,m)
if #g>0 and tg:IsExists(function(c)return c:GetFlagEffect(m)>0 and not c:IsType(TYPE_TOKEN)end,1,nil) then local cg=tg:Filter(function(c)return c:GetFlagEffect(m)>0 and not c:IsType(TYPE_TOKEN)end,nil)
if #g>0 and #cg>0 then
local sg=g:RandomSelect(0,1) local sg=g:RandomSelect(0,1)
Duel.ConfirmCards(0,sg) Duel.ConfirmCards(0,sg)
Duel.ConfirmCards(1,sg) Duel.ConfirmCards(1,sg)
return 0 tg:Sub(cg)
else return cm[3](tg,...) end end
tg:ForEach(Card.ResetFlagEffect,m)
return cm[3](tg,...)
end end
cm[4]=Duel.SpecialSummonStep cm[4]=Duel.SpecialSummonStep
Duel.SpecialSummonStep=function(sc,...) Duel.SpecialSummonStep=function(sc,...)
...@@ -46,7 +49,10 @@ function cm.initial_effect(c) ...@@ -46,7 +49,10 @@ function cm.initial_effect(c)
Duel.ConfirmCards(0,sg) Duel.ConfirmCards(0,sg)
Duel.ConfirmCards(1,sg) Duel.ConfirmCards(1,sg)
return false return false
else return cm[4](sc,...) end else
sc:ResetFlagEffect(m)
return cm[4](sc,...)
end
end end
cm[5]=Duel.SendtoDeck cm[5]=Duel.SendtoDeck
Duel.SendtoDeck=function(tg,...) Duel.SendtoDeck=function(tg,...)
......
...@@ -18,8 +18,7 @@ function c60000011.initial_effect(c) ...@@ -18,8 +18,7 @@ function c60000011.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60000011,1)) e3:SetDescription(aux.Stringid(60000011,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMING_END_PHASE) e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCountLimit(1,70000011) e3:SetCountLimit(1,70000011)
......
...@@ -139,7 +139,7 @@ end ...@@ -139,7 +139,7 @@ end
function s.filter2(c) function s.filter2(c)
return c:IsSetCard(0xb4) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_RITUAL) return c:IsSetCard(0xb4) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_RITUAL)
end end
function s.filter(c,tp) function s.filter(c,tp,e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local eff=Nekroz_discard_effect[c:GetOriginalCode()] local eff=Nekroz_discard_effect[c:GetOriginalCode()]
if not eff then return false end if not eff then return false end
local target=eff:GetTarget() local target=eff:GetTarget()
...@@ -154,11 +154,11 @@ function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -154,11 +154,11 @@ function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=te:GetTarget() local tg=te:GetTarget()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,tp,e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetCategory(0) e:SetCategory(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,tp) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,tp,e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local te=Nekroz_discard_effect[g:GetFirst():GetOriginalCode()] local te=Nekroz_discard_effect[g:GetFirst():GetOriginalCode()]
Duel.ClearTargetCard() Duel.ClearTargetCard()
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
......
...@@ -56,7 +56,7 @@ function c75000719.spfilter1(c,e,tp) ...@@ -56,7 +56,7 @@ function c75000719.spfilter1(c,e,tp)
return c:IsSetCard(0x750) and not c:IsCode(75000719) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x750) and not c:IsCode(75000719) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c75000719.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) function c75000719.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75000714.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c75000719.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c75000719.spop1(e,tp,eg,ep,ev,re,r,rp) function c75000719.spop1(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -42,7 +42,7 @@ function c75030008.initial_effect(c) ...@@ -42,7 +42,7 @@ function c75030008.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c75030008.thfilter(c) function c75030008.thfilter(c)
return c:IsSetCard(0x753,0x751) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x753,0x75f) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function c75030008.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c75030008.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75030008.thfilter,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():GetFlagEffect(75030008)==0 end if chk==0 then return Duel.IsExistingMatchingCard(c75030008.thfilter,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():GetFlagEffect(75030008)==0 end
......
--厮杀之际
local this,id,ofs=GetID()
function this.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(this.spcon)
e1:SetTarget(this.sptg)
e1:SetOperation(this.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+ofs)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetTarget(this.dtg)
e3:SetOperation(this.dop)
c:RegisterEffect(e3)
end
function this.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_ONFIELD)
end
function this.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,c:GetLocation())
if c:IsLocation(LOCATION_GRAVE) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e:SetLabel(1)
end
end
function this.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetMZoneCount(tp)>0 and Duel.SpecialSummon(c,SUMMON_TYPE_SPECIAL,tp,tp,false,false,POS_FACEUP)>0
and e:GetLabel()>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
if tc then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
function this.dfilter1(c,tp)
return c:IsDestructable() and c:IsFaceup()
and Duel.IsExistingTarget(this.dfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function this.dfilter2(c)
return c:IsDestructable() and c:IsFaceup()
end
function this.dtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(this.dfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,this.dfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(tp,this.dfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g)
g:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0)
end
function this.dop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
if #g~=2 then return end
Duel.Destroy(g,REASON_EFFECT)
end
...@@ -85,14 +85,16 @@ function c9910070.setfilter(c) ...@@ -85,14 +85,16 @@ function c9910070.setfilter(c)
end end
function c9910070.settg(e,tp,eg,ep,ev,re,r,rp,chk) function c9910070.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c9910070.setfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c9910070.setfilter,tp,0,LOCATION_MZONE,nil)
local tg=g:GetMaxGroup(Card.GetDefense):Filter(Card.IsCanTurnSet,nil) local tg=Group.CreateGroup()
if #g>0 then tg=g:GetMaxGroup(Card.GetDefense):Filter(Card.IsCanTurnSet,nil) end
if chk==0 then return #tg>0 end if chk==0 then return #tg>0 end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_POSITION,tg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tg,1,0,0)
end end
function c9910070.setop(e,tp,eg,ep,ev,re,r,rp) function c9910070.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c9910070.setfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c9910070.setfilter,tp,0,LOCATION_MZONE,nil)
local tg=g:GetMaxGroup(Card.GetDefense):Filter(Card.IsCanTurnSet,nil) local tg=Group.CreateGroup()
if #g>0 then tg=g:GetMaxGroup(Card.GetDefense):Filter(Card.IsCanTurnSet,nil) end
if #tg>0 then if #tg>0 then
if #tg>1 then if #tg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
......
...@@ -77,7 +77,7 @@ function c9911306.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,7 +77,7 @@ function c9911306.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
end end
function c9911306.filter(c) function c9911306.filter(c)
return c:GetOriginalType()&TYPE_MONSTER>0 and (not c:IsOnField() or c:IsFaceup()) return c:GetOriginalRace()&RACE_FIEND>0 and c:GetOriginalType()&TYPE_MONSTER>0 and (not c:IsOnField() or c:IsFaceup())
end end
function c9911306.rmcon(e,tp,eg,ep,ev,re,r,rp) function c9911306.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c9911306.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c9911306.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
......
...@@ -53,14 +53,16 @@ function c9911309.setcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -53,14 +53,16 @@ function c9911309.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c9911309.settg(e,tp,eg,ep,ev,re,r,rp,chk) function c9911309.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tg=g:GetMaxGroup(Card.GetAttack):Filter(Card.IsCanTurnSet,nil) local tg=Group.CreateGroup()
if #g>0 then tg=g:GetMaxGroup(Card.GetAttack):Filter(Card.IsCanTurnSet,nil) end
if chk==0 then return #tg>0 end if chk==0 then return #tg>0 end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_POSITION,tg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tg,1,0,0)
end end
function c9911309.setop(e,tp,eg,ep,ev,re,r,rp) function c9911309.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tg=g:GetMaxGroup(Card.GetAttack):Filter(Card.IsCanTurnSet,nil) local tg=Group.CreateGroup()
if #g>0 then tg=g:GetMaxGroup(Card.GetAttack):Filter(Card.IsCanTurnSet,nil) end
if #tg==0 then return end if #tg==0 then return end
if #tg>1 then if #tg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
......
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