Commit b9c149ed authored by wind2009's avatar wind2009

Fix 怒髪天衝セイバーザウルス

parent f2b4128b
Pipeline #32323 passed with stages
in 2 minutes
-- --怒髪天衝セイバーザウルス
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--xyz summon --xyz summon
...@@ -16,19 +16,17 @@ function s.initial_effect(c) ...@@ -16,19 +16,17 @@ function s.initial_effect(c)
e1:SetOperation(s.desop) e1:SetOperation(s.desop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--atk up --atk up
local e1=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_BATTLE_START)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e2:SetRange(LOCATION_MZONE)
e1:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id)
e1:SetHintTiming(TIMING_DAMAGE_STEP) e2:SetCondition(s.atkcon)
e1:SetCountLimit(1,id) e2:SetTarget(s.atktg)
e1:SetCondition(s.atkcon) e2:SetOperation(s.atkop)
e1:SetTarget(atktg) c:RegisterEffect(e2)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
end end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
...@@ -43,28 +41,30 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -43,28 +41,30 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil) local dg=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then if dg:GetCount()>0 then
Duel.HintSelection(g) Duel.HintSelection(dg)
if Duel.Destroy(g,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) if Duel.Destroy(dg,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local cg=Duel.SelectTarget(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then if cg:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.ChangePosition(g:GetFirst(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) Duel.HintSelection(cg)
Duel.ChangePosition(cg:GetFirst(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end end
end end
end end
end end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp) function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
local a=Duel.GetAttacker() local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget() local d=Duel.GetAttackTarget()
if not a:IsControler(tp) then a,d=d,a end if not a:IsControler(tp) then a,d=d,a end
e:SetLabelObject(a) if a and a~=e:GetHandler() and a:IsFaceup() and a:IsControler(tp) and a:IsRace(RACE_DINOSAUR) and a:IsRelateToBattle() then
return a and a~=e:GetHandler() and a:IsFaceup() and a:IsControler(tp) and a:IsRace(RACE_DINOSAUR) and a:IsRelateToBattle() e:SetLabelObject(a)
return true
end
return false
end end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -75,13 +75,13 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,13 +75,13 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetLabelObject() local a=e:GetLabelObject()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then
if not a or not a:IsRelateToBattle() then return end if not a or not a:IsRelateToBattle() then return end
if a:IsFaceup() then if a:IsFaceup() and a:IsRace(RACE_DINOSAUR) and a:IsType(TYPE_MONSTER) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(2000) e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
a:RegisterEffect(e1) a:RegisterEffect(e1)
end 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