Skip to content

Commit 46d73d1

Browse files
authored
Fix "Blue Flame Swordsman"
Should only be able to activate if destroyed by an opponent's card/minor script update
1 parent 06336ed commit 46d73d1

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

official/c50903514.lua

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
--蒼炎の剣士
2+
--Blue Flame Swordsman
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--atk
5+
--Make 1 monster you control gain 600 ATK
56
local e1=Effect.CreateEffect(c)
67
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_ATKCHANGE)
@@ -11,38 +12,31 @@ function s.initial_effect(c)
1112
e1:SetHintTiming(TIMING_DAMAGE_STEP)
1213
e1:SetCountLimit(1)
1314
e1:SetRange(LOCATION_MZONE)
14-
e1:SetCondition(s.condition)
15-
e1:SetTarget(s.target)
16-
e1:SetOperation(s.operation)
15+
e1:SetCondition(function(e) return Duel.IsBattlePhase() and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()) end)
16+
e1:SetTarget(s.atktg)
17+
e1:SetOperation(s.atkop)
1718
c:RegisterEffect(e1)
18-
--summon
19+
--Special Summon 1 FIRE Warrior monster from your GY
1920
local e2=Effect.CreateEffect(c)
2021
e2:SetDescription(aux.Stringid(id,1))
2122
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
2223
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
2324
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
2425
e2:SetCode(EVENT_TO_GRAVE)
2526
e2:SetCondition(s.spcon)
26-
e2:SetCost(aux.bfgcost)
27+
e2:SetCost(aux.SelfBanishCost)
2728
e2:SetTarget(s.sptg)
2829
e2:SetOperation(s.spop)
2930
c:RegisterEffect(e2)
3031
end
31-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
32-
local ph=Duel.GetCurrentPhase()
33-
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and (ph~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
34-
end
35-
function s.filter(c)
36-
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
37-
end
38-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
39-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
32+
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
33+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsRace(RACE_WARRIOR) and chkc~=e:GetHandler() end
4034
if chk==0 then return e:GetHandler():IsAttackAbove(600)
41-
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
35+
and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsRace,RACE_WARRIOR),tp,LOCATION_MZONE,0,1,e:GetHandler()) end
4236
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
43-
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
37+
Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsRace,RACE_WARRIOR),tp,LOCATION_MZONE,0,1,1,e:GetHandler())
4438
end
45-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
39+
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
4640
local c=e:GetHandler()
4741
local tc=Duel.GetFirstTarget()
4842
if not c:IsFacedown() and c:IsRelateToEffect(e) and not tc:IsFacedown() and tc:IsRelateToEffect(e) and c:UpdateAttack(-600)==-600 then
@@ -51,8 +45,8 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
5145
end
5246
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
5347
local c=e:GetHandler()
54-
return rp~=tp and c:IsReason(REASON_DESTROY)
55-
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(tp)
48+
return c:IsReason(REASON_DESTROY) and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT)))
49+
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
5650
end
5751
function s.spfilter(c,e,tp)
5852
return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)

0 commit comments

Comments
 (0)