Skip to content

Commit bfc465b

Browse files
authored
Update "Infernalvania"
-Destruction effect is an ignition effect that applies only to the controller, not both players -Fixed category in initial effect/changed range to Field Zone -Adjusted cost as it only looks for Normal Summon/Set activity -Destruction should still be attemptable for monsters that cannot be destroyed by effects -General script polish/clean-up
1 parent 4401343 commit bfc465b

1 file changed

Lines changed: 20 additions & 30 deletions

File tree

unofficial/c511000141.lua

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--不死の王国-ヘルヴァニア
12
--Infernalvania
23
local s,id=GetID()
34
function s.initial_effect(c)
@@ -6,55 +7,44 @@ function s.initial_effect(c)
67
e1:SetType(EFFECT_TYPE_ACTIVATE)
78
e1:SetCode(EVENT_FREE_CHAIN)
89
c:RegisterEffect(e1)
9-
--Destroy
10+
--Destroy all monsters on the field
1011
local e2=Effect.CreateEffect(c)
1112
e2:SetDescription(aux.Stringid(id,0))
12-
e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
13-
e2:SetCategory(CATEGORY_SUMMON)
13+
e2:SetCategory(CATEGORY_DESTROY)
1414
e2:SetType(EFFECT_TYPE_IGNITION)
15-
e2:SetRange(LOCATION_SZONE)
15+
e2:SetRange(LOCATION_FZONE)
1616
e2:SetCost(s.cost)
1717
e2:SetTarget(s.target)
1818
e2:SetOperation(s.operation)
19-
e2:SetLabelObject(e1)
2019
c:RegisterEffect(e2)
2120
end
22-
function s.cfilter(c)
23-
return c:IsMonster() and c:IsRace(RACE_ZOMBIE) and c:IsDiscardable()
21+
function s.costfilter(c)
22+
return c:IsRace(RACE_ZOMBIE) and c:IsAbleToGraveAsCost()
2423
end
2524
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
26-
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0
27-
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
25+
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil) end
26+
--You cannot Normal Summon/Set the turn you use this effect
2827
local e1=Effect.CreateEffect(e:GetHandler())
2928
e1:SetType(EFFECT_TYPE_FIELD)
3029
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
31-
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
32-
e1:SetReset(RESET_PHASE+PHASE_END)
30+
e1:SetCode(EFFECT_CANNOT_SUMMON)
31+
e1:SetReset(RESET_PHASE|PHASE_END)
3332
e1:SetTargetRange(1,0)
34-
e1:SetLabelObject(e)
35-
e1:SetTarget(s.sumlimit)
3633
Duel.RegisterEffect(e1,tp)
37-
local e2=Effect.CreateEffect(e:GetHandler())
38-
e2:SetType(EFFECT_TYPE_FIELD)
39-
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
40-
e2:SetCode(EFFECT_CANNOT_SUMMON)
41-
e2:SetReset(RESET_PHASE+PHASE_END)
42-
e2:SetTargetRange(1,0)
34+
local e2=e1:Clone()
35+
e2:SetCode(EFFECT_CANNOT_MSET)
4336
Duel.RegisterEffect(e2,tp)
44-
local e3=e2:Clone(e1)
45-
e3:SetCode(EFFECT_CANNOT_MSET)
46-
Duel.RegisterEffect(e3,tp)
47-
Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST+REASON_DISCARD)
48-
end
49-
function s.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
50-
return e:GetLabelObject()~=se
37+
--Send 1 Zombie monster from your hand to the GY
38+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
39+
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,nil)
40+
Duel.SendtoGrave(g,REASON_COST)
5141
end
5242
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
53-
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
54-
local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
43+
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
44+
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
5545
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,#sg,0,0)
5646
end
5747
function s.operation(e,tp,eg,ep,ev,re,r,rp)
58-
local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
48+
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
5949
Duel.Destroy(sg,REASON_EFFECT)
60-
end
50+
end

0 commit comments

Comments
 (0)