Commit 42c3c98c authored by TanakaKotoha's avatar TanakaKotoha

fix 3

parent 183adab3
No preview for this file type
......@@ -49,6 +49,13 @@ function cm.initial_effect(c)
e5:SetOperation(cm.addcount)
Duel.RegisterEffect(e5,0)
end
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_BATTLE_DESTROYING)
e6:SetCondition(aux.bdocon)
e6:SetOperation(cm.bdop)
c:RegisterEffect(e6)
end
function cm.immcon(e)
local c=e:GetHandler()
......@@ -74,13 +81,6 @@ function cm.eaop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
if not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or c:GetAttackAnnouncedCount()==0 then return end
if Duel.GetAttacker()==c then
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if #sg>0 then
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
end
function cm.resetcount(e,tp,eg,ep,ev,re,r,rp)
......@@ -99,4 +99,10 @@ function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Damage(1-tp,ct,REASON_EFFECT)
end
end
function cm.bdop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if #sg>0 then
Duel.Destroy(sg,REASON_EFFECT)
end
end
\ No newline at end of file
--Ruby Rose
function c60151501.initial_effect(c)
c:SetUniqueOnField(1,0,60151501)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c60151501.cost)
e1:SetTarget(c60151501.target)
e1:SetOperation(c60151501.activate)
c:RegisterEffect(e1)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60151501,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1)
e2:SetTarget(c60151501.mvtg)
e2:SetOperation(c60151501.seqop)
c:RegisterEffect(e2)
--act in hand
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_SINGLE)
e12:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e12:SetCondition(c60151501.handcon)
c:RegisterEffect(e12)
c:SetUniqueOnField(1,0,60151501)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c60151501.cost)
e1:SetTarget(c60151501.target)
e1:SetOperation(c60151501.activate)
c:RegisterEffect(e1)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60151501,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1)
e2:SetTarget(c60151501.mvtg)
e2:SetOperation(c60151501.seqop)
c:RegisterEffect(e2)
--act in hand
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_SINGLE)
e12:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e12:SetCondition(c60151501.handcon)
c:RegisterEffect(e12)
end
function c60151501.cfilter(c)
return c:IsType(TYPE_MONSTER)
return c:IsType(TYPE_MONSTER)
end
function c60151501.handcon(e)
local tp=e:GetHandlerPlayer()
return not Duel.IsExistingMatchingCard(c60151501.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetTurnPlayer()==tp
local tp=e:GetHandlerPlayer()
return not Duel.IsExistingMatchingCard(c60151501.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetTurnPlayer()==tp
end
function c60151501.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
e:SetLabel(1)
return true
end
function c60151501.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,60151501,0x9b28,0x21,1500,1500,4,RACE_WARRIOR,ATTRIBUTE_FIRE) end
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,60151501,0x9b28,0x21,1500,1500,4,RACE_WARRIOR,ATTRIBUTE_FIRE) end
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c60151501.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,60151501,0x9b28,0x21,1500,1500,4,RACE_WARRIOR,ATTRIBUTE_FIRE) then
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP)
c:AddMonsterAttributeComplete()
c:RegisterFlagEffect(60151501,RESET_EVENT+0x1fe0000,0,1)
Duel.SpecialSummonComplete()
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,60151501,0x9b28,0x21,1500,1500,4,RACE_WARRIOR,ATTRIBUTE_FIRE) then
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
c:RegisterFlagEffect(60151501,RESET_EVENT+0x1fe0000,0,1)
end
end
function c60151501.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0 end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0 end
end
function c60151501.spfilter(c)
return c:IsFaceup() and (c:GetAttack()~=0 or c:GetDefense()~=0)
return c:IsFaceup() and (c:GetAttack()~=0 or c:GetDefense()~=0)
end
function c60151501.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
if Duel.MoveSequence(c,nseq)~=0 then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(c60151501.spfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(60151501,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
Duel.HintSelection(sg)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(0)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(0)
tc:RegisterEffect(e2)
end
end
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
if Duel.MoveSequence(c,nseq)~=0 then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(c60151501.spfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(60151501,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
Duel.HintSelection(sg)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(0)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(0)
tc:RegisterEffect(e2)
end
end
end
\ No newline at end of file
......@@ -93,11 +93,12 @@ function c60152603.e1op(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) then
if e:GetHandler():GetColumnGroupCount()==0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_GRAVE,1,1,nil)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(60152603,1)) then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
......
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