Commit 0ae091b1 authored by VanillaSalt's avatar VanillaSalt

fix

parent 9e897caf
--Reject Reborn
--リジェクト・リボーン
function c78161960.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -6,12 +6,16 @@ function c78161960.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c78161960.condition)
e1:SetCost(c78161960.cost)
e1:SetOperation(c78161960.activate)
c:RegisterEffect(e1)
end
function c78161960.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetAttackTarget()==nil
return eg:GetFirst():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function c78161960.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.RegisterFlagEffect(tp,78161960,RESET_PHASE+PHASE_BATTLE,0,1)
end
function c78161960.filter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -21,17 +25,20 @@ function c78161960.filter2(c,e,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c78161960.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,78161960)==0 then return end
local c=e:GetHandler()
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
Duel.BreakEffect()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsExistingMatchingCard(c78161960.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(c78161960.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(78161960,0)) then
local g=Duel.SelectTarget(tp,c78161960.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local g2=Duel.SelectTarget(tp,c78161960.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
g:Merge(g2)
if g:GetCount()~=2 then return false end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local tc=g:GetFirst()
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,c78161960.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c78161960.filter2,tp,LOCATION_GRAVE,0,1,1,g1:GetFirst(),e,tp)
g1:Merge(g2)
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
local tc=g1:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -43,7 +50,7 @@ function c78161960.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=g:GetNext()
tc=g1:GetNext()
end
end
end
--Superheavy Great General San-nya
--超重輝将サン-5
function c78274190.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
......@@ -11,7 +11,7 @@ function c78274190.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LSCALE)
--e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_PZONE)
e2:SetCondition(c78274190.sccon)
e2:SetValue(4)
......@@ -21,7 +21,7 @@ function c78274190.initial_effect(c)
c:RegisterEffect(e3)
--chain attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(33823832,1))
e4:SetDescription(aux.Stringid(78274190,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLED)
e4:SetRange(LOCATION_PZONE)
......@@ -31,18 +31,25 @@ function c78274190.initial_effect(c)
c:RegisterEffect(e4)
--draw
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(25857246,1))
e5:SetDescription(aux.Stringid(78274190,1))
e5:SetCategory(CATEGORY_DRAW)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,78274190)
e5:SetCondition(c78274190.condition)
e5:SetCost(c78274190.cost)
e5:SetTarget(c78274190.target)
e5:SetOperation(c78274190.operation)
c:RegisterEffect(e5)
--add setcode
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e6:SetCode(EFFECT_ADD_SETCODE)
e6:SetValue(0x9a)
c:RegisterEffect(e6)
end
function c78274190.sccon(e,tp,eg,ep,ev,re,r,rp)
function c78274190.sccon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE,0,1,nil,TYPE_SPELL+TYPE_TRAP)
end
......@@ -51,7 +58,7 @@ function c78274190.cacon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if not d then return false end
if a:IsStatus(STATUS_OPPO_BATTLE) and d:IsControler(tp) then a,d=d,a end
if a:IsSetCard(0x9a)
if a:IsSetCard(0x9a) and a:IsChainAttackable()
and not a:IsStatus(STATUS_BATTLE_DESTROYED) and d:IsStatus(STATUS_BATTLE_DESTROYED) then
e:SetLabelObject(a)
return true
......@@ -59,32 +66,25 @@ function c78274190.cacon(e,tp,eg,ep,ev,re,r,rp)
end
function c78274190.caop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsFaceup() and tc:IsControler(tp) and tc:IsRelateToBattle() and tc:IsChainAttackable() then
if tc:IsFaceup() and tc:IsControler(tp) and tc:IsRelateToBattle() then
Duel.ChainAttack()
end
end
function c78274190.filter(c)
return c:IsSetCard(0x9a) and c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect()
end
function c78274190.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE,0,1,nil,TYPE_SPELL+TYPE_TRAP)
end
function c78274190.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x9a) end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct>2 then ct=2 end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,ct,nil,0x9a)
local rct=Duel.Release(g,REASON_COST)
e:SetLabel(rct)
end
function c78274190.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.CheckReleaseGroup(tp,c78274190.filter,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,e:GetLabel())
end
function c78274190.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDraw(tp) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then ct=1 end
if ct>2 then ct=2 end
local g=Duel.SelectReleaseGroup(tp,c78274190.filter,1,ct,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local rct=Duel.Release(g,REASON_EFFECT)
Duel.Draw(tp,rct,REASON_EFFECT)
end
Duel.Draw(tp,e:GetLabel(),REASON_EFFECT)
end
--Fate of the Destruction Swordsman
--破壊剣士の宿命
function c78348934.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -15,59 +15,62 @@ function c78348934.initial_effect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,783489342)
e2:SetCost(c78348934.cost)
e2:SetTarget(c78348934.tg)
e2:SetOperation(c78348934.op)
e2:SetCountLimit(1,78348935)
e2:SetCost(c78348934.thcost)
e2:SetTarget(c78348934.thtg)
e2:SetOperation(c78348934.thop)
c:RegisterEffect(e2)
end
function c78348934.filter1(c,rc)
return c:IsAbleToRemove() and c:GetRace()==rc and c:IsType(TYPE_MONSTER)
function c78348934.filter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c78348934.filter2(c)
return c:IsType(TYPE_MONSTER) and (c:IsCode(86240887) or c:IsCode(3428069) or c:IsCode(61190918)
or c:IsCode(78193831) or c:IsSetCard(0x1e7))
function c78348934.filter2(c,rc)
return c:GetRace()==rc and c:IsAbleToRemove()
end
function c78348934.filter3(c)
return c:IsFaceup() and (c:IsSetCard(0xd6) or c:IsSetCard(0xd7))
end
function c78348934.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil)
and Duel.IsExistingMatchingCard(c78348934.filter2,tp,LOCATION_MZONE,0,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c78348934.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c78348934.filter1,tp,0,LOCATION_GRAVE,1,nil)
and Duel.IsExistingMatchingCard(c78348934.filter3,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
local g1=Duel.SelectTarget(tp,c78348934.filter1,tp,0,LOCATION_GRAVE,1,1,nil)
local rc=g1:GetFirst():GetRace()
if Duel.IsExistingTarget(c78348934.filter1,tp,0,LOCATION_GRAVE,1,g1:GetFirst(),rc)
if Duel.IsExistingTarget(c78348934.filter2,tp,0,LOCATION_GRAVE,1,g1:GetFirst(),rc)
and Duel.SelectYesNo(tp,aux.Stringid(78348934,0)) then
local g2=Duel.SelectTarget(tp,c78348934.filter1,tp,0,LOCATION_GRAVE,1,2,g1:GetFirst(),rc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.SelectTarget(tp,c78348934.filter2,tp,0,LOCATION_GRAVE,1,2,g1:GetFirst(),rc)
end
end
function c78348934.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
local ct=Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
local bb=Duel.SelectMatchingCard(tp,c78348934.filter2,tp,LOCATION_MZONE,0,1,1,nil)
if bb:GetCount()>0 then
local tc=bb:GetFirst()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ct=Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
if ct==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=Duel.SelectMatchingCard(tp,c78348934.filter3,tp,LOCATION_MZONE,0,1,1,nil)
local tc=sg:GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(sg:GetCount()*500)
e1:SetValue(ct*500)
tc:RegisterEffect(e1)
end
end
function c78348934.costfilter(c)
return c:IsSetCard(0x1e7) and c:IsDiscardable()
function c78348934.cfilter(c)
return c:IsSetCard(0xd6) and c:IsDiscardable()
end
function c78348934.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c78348934.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c78348934.costfilter,1,1,REASON_DISCARD+REASON_COST)
function c78348934.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c78348934.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c78348934.cfilter,1,1,REASON_DISCARD+REASON_COST)
end
function c78348934.tg(e,tp,eg,ep,ev,re,r,rp,chk)
function c78348934.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c78348934.op(e,tp,eg,ep,ev,re,r,rp)
function c78348934.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
......
--Majespecter Supercell
--マジェスペクター・スーパーセル
function c78949372.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c78949372.target1)
e1:SetOperation(c78949372.drop)
e1:SetTarget(c78949372.target)
e1:SetHintTiming(0,0x1c0)
c:RegisterEffect(e1)
--Draw
......@@ -44,69 +43,56 @@ function c78949372.initial_effect(c)
e5:SetCondition(c78949372.tgcon)
e5:SetValue(c78949372.effectfilter)
c:RegisterEffect(e5)
end
function c78949372.filter(c)
return c:IsSetCard(0xd0) and c:IsAbleToDeck()
end
function c78949372.target1(e,tp,eg,ep,ev,re,r,rp,chk)
function c78949372.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
if e:GetHandler():GetFlagEffect(tp,78949372)==0
and Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_GRAVE,0,5,nil,0xd0)
and Duel.SelectYesNo(tp,aux.Stringid(78949372,0)) then
if c78949372.drtg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e:GetHandler():RegisterFlagEffect(tp,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c78949372.filter,tp,LOCATION_GRAVE,0,5,5,nil)
Duel.ConfirmCards(tp,g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
e:SetLabel(1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(78949372,2))
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c78949372.drop)
c78949372.drtg(e,tp,eg,ep,ev,re,r,rp,1,chkc)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(78949372,1))
else
e:SetCategory(0)
e:SetProperty(0)
e:SetLabel(0)
e:SetOperation(nil)
end
end
function c78949372.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:GetControler()==tp and c78949372.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and e:GetHandler():GetFlagEffect(tp,78949372)==0
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c78949372.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and e:GetHandler():GetFlagEffect(78949372)==0
and Duel.IsExistingTarget(c78949372.filter,tp,LOCATION_GRAVE,0,5,nil) end
e:GetHandler():RegisterFlagEffect(78949372,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c78949372.filter,tp,LOCATION_GRAVE,0,5,5,nil)
Duel.ConfirmCards(tp,g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c78949372.tgfilter(c,e)
return not c:IsRelateToEffect(e)
end
function c78949372.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
Duel.ShuffleDeck(tp)
local g=Duel.GetOperatedGroup()
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c78949372.tgcon(e,tp,eg,ep,ev,re,r,rp)
local tc1=Duel.GetFieldCard(tp,LOCATION_SZONE,6)
local tc2=Duel.GetFieldCard(tp,LOCATION_SZONE,7)
return tc1:IsSetCard(0xd0) or tc2:IsSetCard(0xd0)
return (tc1 and tc1:IsSetCard(0xd0)) or (tc2 and tc2:IsSetCard(0xd0))
end
function c78949372.effectfilter(e,ct)
local p=e:GetHandler():GetControler()
local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
local p=e:GetHandlerPlayer()
local te,tp,loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
local tc=te:GetHandler()
return p==tp and tc:IsType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) and tc:IsSetCard(0xd0) and tc~=e:GetHandler()
return p==tp and bit.band(loc,LOCATION_ONFIELD)~=0 and tc:IsSetCard(0xd0) and tc~=e:GetHandler()
end
--Timesword Magician
--刻剣の魔術師
function c80335817.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
......@@ -16,14 +16,14 @@ function c80335817.initial_effect(c)
e2:SetTarget(c80335817.indtg)
e2:SetValue(c80335817.indval)
c:RegisterEffect(e2)
--tohand
--double
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(c80335817.thcon)
e3:SetOperation(c80335817.thop)
e3:SetCondition(c80335817.atkcon)
e3:SetOperation(c80335817.atkop)
c:RegisterEffect(e3)
--Banish
local e4=Effect.CreateEffect(c)
......@@ -47,15 +47,12 @@ end
function c80335817.indval(e,c)
return c80335817.filter(c,e:GetHandlerPlayer())
end
function c80335817.cfilter(c)
return c:GetTurnID()==Duel.GetTurnCount() and c:GetSummonType()==SUMMON_TYPE_PENDULUM and c:IsPreviousLocation(LOCATION_HAND)
end
function c80335817.thcon(e,tp,eg,ep,ev,re,r,rp)
function c80335817.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetSummonType()==SUMMON_TYPE_PENDULUM and c:IsPreviousLocation(LOCATION_HAND)
and not Duel.IsExistingMatchingCard(c80335817.cfilter,tp,LOCATION_MZONE,0,1,c)
return eg:GetCount()==1 and eg:GetFirst()==c
and c:GetSummonType()==SUMMON_TYPE_PENDULUM and c:IsPreviousLocation(LOCATION_HAND)
end
function c80335817.thop(e,tp,eg,ep,ev,re,r,rp)
function c80335817.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
......@@ -66,14 +63,14 @@ function c80335817.thop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
end
end
function c80335817.rmfil(c)
return c:IsAbleToRemove()
end
function c80335817.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c80335817.rmfil(chkc) end
if chk==0 then return Duel.IsExistingTarget(c80335817.rmfil,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) and e:GetHandler():IsAbleToRemove() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c80335817.rmfil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToRemove() end
if chk==0 then return e:GetHandler():IsAbleToRemove()
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0)
end
function c80335817.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -84,7 +81,11 @@ function c80335817.rmop(e,tp,eg,ep,ev,re,r,rp)
local og=Duel.GetOperatedGroup()
local oc=og:GetFirst()
while oc do
oc:RegisterFlagEffect(80335817,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
if oc:IsControler(tp) then
oc:RegisterFlagEffect(80335817,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
else
oc:RegisterFlagEffect(80335817,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_OPPO_TURN,0,1)
end
oc=og:GetNext()
end
og:KeepAlive()
......@@ -93,8 +94,8 @@ function c80335817.rmop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
e1:SetCountLimit(1)
e1:SetCondition(c80335817.retcon)
e1:SetLabelObject(og)
e1:SetCondition(c80335817.retcon)
e1:SetOperation(c80335817.retop)
Duel.RegisterEffect(e1,tp)
end
......@@ -106,7 +107,8 @@ function c80335817.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c80335817.retop(e,tp,eg,ep,ev,re,r,rp)
local sg=e:GetLabelObject()
local g=e:GetLabelObject()
local sg=g:Filter(c80335817.retfilter,nil)
local tc=sg:GetFirst()
while tc do
Duel.ReturnToField(tc)
......
--Ikusagami - Shiranui
--戦神-不知火
function c83283063.initial_effect(c)
c:SetSPSummonOnce(83283063)
--synchro summon
aux.AddSynchroProcedure(c,c83283063.synfilter,aux.NonTuner(c83283063.synfilter),1)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11260714,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(83283063,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCost(c83283063.cost)
e1:SetOperation(c83283063.operation)
c:RegisterEffect(e1)
--add to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(36733451,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetDescription(aux.Stringid(83283063,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c83283063.thcon)
e2:SetTarget(c83283063.thtg)
e2:SetOperation(c83283063.thop)
e2:SetCondition(c83283063.tgcon)
e2:SetTarget(c83283063.tgtg)
e2:SetOperation(c83283063.tgop)
c:RegisterEffect(e2)
end
function c83283063.synfilter(c)
return c:IsRace(RACE_ZOMBIE)
end
function c83283063.cfilter(c)
return c:IsRace(RACE_ZOMBIE) and c:IsAbleToRemoveAsCost()
return c:IsRace(RACE_ZOMBIE) and c:GetBaseAttack()>0 and c:IsAbleToRemoveAsCost()
end
function c83283063.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c83283063.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c83283063.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
e:SetLabel(g:GetFirst():GetAttack())
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetFirst():GetBaseAttack())
end
function c83283063.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c83283063.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_DESTROY)>0
and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
and e:GetHandler():GetPreviousControler()==tp
function c83283063.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c83283063.filter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_ZOMBIE) and c:GetDefence()==0
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:GetDefence()==0
end
function c83283063.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c83283063.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c83283063.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c83283063.filter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c83283063.filter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c83283063.thop(e,tp,eg,ep,ev,re,r,rp)
function c83283063.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN)
end
end
--Pendulum Storm
--ペンデュラム・ストーム
function c83461421.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
......@@ -20,14 +21,15 @@ function c83461421.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c83461421.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c83461421.filter,tp,LOCATION_SZONE,LOCATION_SZONE,nil)
local ct=Duel.Destroy(g1,REASON_EFFECT)
local g=Duel.GetMatchingGroup(c83461421.filter2,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(83461421,0)) then
local g=Duel.GetMatchingGroup(c83461421.filter,tp,LOCATION_SZONE,LOCATION_SZONE,nil)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
local dg=Duel.GetMatchingGroup(c83461421.filter2,tp,0,LOCATION_ONFIELD,nil)
if dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(83461421,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
local sg=dg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
--Goyo King
--ゴヨウ・キング
function c84305651.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsType,TYPE_SYNCHRO),1)
......@@ -13,74 +13,61 @@ function c84305651.initial_effect(c)
e1:SetOperation(c84305651.atkop)
c:RegisterEffect(e1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCondition(c84305651.spcon)
e1:SetTarget(c84305651.sptg)
e1:SetOperation(c84305651.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.bdogcon)
e2:SetTarget(c84305651.sptg)
e2:SetOperation(c84305651.spop)
c:RegisterEffect(e2)
end
function c84305651.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()~=nil
end
function c84305651.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local ct=Duel.GetMatchingGroupCount(c84305651.filter,tp,LOCATION_MZONE,0,nil)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c84305651.atkval)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
e1:SetValue(ct*400)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
end
end
function c84305651.filter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsType(TYPE_SYNCHRO)
end
function c84305651.atkval(e,c)
return Duel.GetMatchingGroupCount(c84305651.filter,c:GetControler(),LOCATION_MZONE,0,nil)*400
end
function c84305651.cfilter(c)
function c84305651.ctfilter(c)
return c:IsFaceup() and c:IsControlerCanBeChanged()
end
function c84305651.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if not c:IsRelateToBattle() or c:IsFacedown() then return false end
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function c84305651.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetHandler():GetBattleTarget()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (bc:IsCanBeSpecialSummoned(e,0,tp,false,false) or Duel.IsExistingTarget(c84305651.cfilter,tp,0,LOCATION_MZONE,1,nil)) end
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and bc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=Duel.IsExistingMatchingCard(c84305651.ctfilter,tp,0,LOCATION_MZONE,1,nil)
if chk==0 then return b1 or b2 end
local op=0
if bc:IsCanBeSpecialSummoned(e,0,tp,false,false) then op=op+1 end
if Duel.IsExistingTarget(c84305651.cfilter,tp,0,LOCATION_MZONE,1,nil) then op=op+2 end
if op==3 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(84305651,0))
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(84305651,1),aux.Stringid(84305651,2))+1
end
if op==1 then
Duel.SetTargetCard(bc)
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c84305651.cfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
e:SetLabel(op)
end
function c84305651.spop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==0 then return end
if e:GetLabel()==1 then
local tc=Duel.GetFirstTarget()
if op==1 then
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
if op==2 then
if tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp) then
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,c84305651.ctfilter,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if not Duel.GetControl(tc,tp) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
......
--Superheavy Maju Kyu-B
--超重魔獣キュウ-B
function c85528209.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0x9a),1)
c:EnableReviveLimit()
--defence attack
--add setcode
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENCE_ATTACK)
e1:SetValue(1)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_SETCODE)
e1:SetValue(0x9a)
c:RegisterEffect(e1)
--defence attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_DEFENCE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c85528209.sccon)
e2:SetValue(c85528209.adval)
e2:SetCode(EFFECT_DEFENCE_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_DEFENCE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c85528209.sccon)
e3:SetValue(c85528209.adval)
c:RegisterEffect(e3)
end
function c85528209.sccon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE,0,1,nil,TYPE_SPELL+TYPE_TRAP)
function c85528209.sccon(e)
return not Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil,TYPE_SPELL+TYPE_TRAP)
end
function c85528209.adval(tp,c)
return Duel.GetMatchingGroupCount(c85528209.ctfilter,tp,0,LOCATION_MZONE,nil)*900
function c85528209.adval(e,c)
return Duel.GetMatchingGroupCount(c85528209.ctfilter,c:GetControler(),0,LOCATION_MZONE,nil)*900
end
function c85528209.ctfilter(c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL and c:GetControler()~=e:GetHandler():GetControler()
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
--Buster Blader, the Dragon Destroyer
--Fixed by Ragna as well...
--竜破壊の剣士-バスター・ブレイダー
function c86240887.initial_effect(c)
--fusion material
c:EnableReviveLimit()
......
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