Skip to content

Commit 8d265eb

Browse files
authored
Update "Valkyrie Brunhilde (Anime)"
-Missing Spell effect protection -General script clean-up
1 parent b339863 commit 8d265eb

1 file changed

Lines changed: 20 additions & 24 deletions

File tree

unofficial/c100000538.lua

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
1-
--ワルキューレ・ブリュンヒルデ
1+
--ワルキューレ・ブリュンヒルデ (Anime)
2+
--Valkyrie Brunhilde (Anime)
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--atk
5+
--Unaffected by your opponent's Spell effects
56
local e1=Effect.CreateEffect(c)
67
e1:SetType(EFFECT_TYPE_SINGLE)
78
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
9+
e1:SetCode(EFFECT_IMMUNE_EFFECT)
810
e1:SetRange(LOCATION_MZONE)
9-
e1:SetCode(EFFECT_UPDATE_ATTACK)
10-
e1:SetCondition(s.con)
11-
e1:SetValue(s.val)
11+
e1:SetValue(function(e,te) return te:IsSpellEffect() and te:GetOwnerPlayer()~=e:GetHandlerPlayer() end)
1212
c:RegisterEffect(e1)
13-
--Destroy replace
13+
--Gains 300 ATK for each Dragon and Warrior monster on the field
1414
local e2=Effect.CreateEffect(c)
15-
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
15+
e2:SetType(EFFECT_TYPE_SINGLE)
1616
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
17-
e2:SetCode(EFFECT_DESTROY_REPLACE)
17+
e2:SetCode(EFFECT_UPDATE_ATTACK)
1818
e2:SetRange(LOCATION_MZONE)
19-
e2:SetTarget(s.desreptg)
19+
e2:SetValue(function(e,c) return Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_DRAGON|RACE_WARRIOR),0,LOCATION_MZONE,LOCATION_MZONE,nil)*300 end)
2020
c:RegisterEffect(e2)
21-
end
22-
function s.con(e)
23-
return e:GetHandler():IsPosition(POS_FACEUP_ATTACK)
24-
end
25-
function s.val(e,c)
26-
return Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsRace,RACE_DRAGON+RACE_WARRIOR),0,LOCATION_MZONE,LOCATION_MZONE,nil)*300
21+
--If this card would be destroyed by battle with a monster, you can have it lose exactly 1000 DEF instead.
22+
local e3=Effect.CreateEffect(c)
23+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
24+
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
25+
e3:SetCode(EFFECT_DESTROY_REPLACE)
26+
e3:SetRange(LOCATION_MZONE)
27+
e3:SetTarget(s.desreptg)
28+
c:RegisterEffect(e3)
2729
end
2830
function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
2931
local c=e:GetHandler()
30-
if chk==0 then return c:IsReason(REASON_BATTLE) and c:IsFaceup() and c:GetDefense()>=1000 end
32+
if chk==0 then return c:IsReason(REASON_BATTLE) and c:IsFaceup() and c:IsDefenseAbove(1000) end
3133
if Duel.SelectYesNo(tp,aux.Stringid(40945356,0)) then
32-
local e2=Effect.CreateEffect(c)
33-
e2:SetType(EFFECT_TYPE_SINGLE)
34-
e2:SetProperty(EFFECT_FLAG_COPY_INHERIT)
35-
e2:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE)
36-
e2:SetCode(EFFECT_UPDATE_DEFENSE)
37-
e2:SetValue(-1000)
38-
c:RegisterEffect(e2)
34+
c:UpdateDefense(-1000,RESET_EVENT|RESETS_STANDARD_DISABLE)
3935
return true
4036
else return false end
41-
end
37+
end

0 commit comments

Comments
 (0)