Skip to content

Commit 435507c

Browse files
authored
Update "Mud Max"
-Should Tribute itself, not send itself to the GY -Should be able to activate on any attack, not just if the equipped monster is targeted
1 parent 8d36059 commit 435507c

1 file changed

Lines changed: 34 additions & 36 deletions

File tree

unofficial/c511000484.lua

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,42 @@
1+
--マッド・マックス
12
--Mud Max
23
local s,id=GetID()
34
function s.initial_effect(c)
45
aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsCode,84327329))
5-
--equip effect
6-
local e3=Effect.CreateEffect(c)
7-
e3:SetType(EFFECT_TYPE_EQUIP)
8-
e3:SetCode(EFFECT_UPDATE_ATTACK)
9-
e3:SetValue(300)
10-
c:RegisterEffect(e3)
11-
--battle target
12-
local e4=Effect.CreateEffect(c)
13-
e4:SetDescription(aux.Stringid(id,0))
14-
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
15-
e4:SetCode(EVENT_BE_BATTLE_TARGET)
16-
e4:SetRange(LOCATION_SZONE)
17-
e4:SetCondition(s.negcon)
18-
e4:SetCost(s.negcost)
19-
e4:SetOperation(s.negop)
20-
c:RegisterEffect(e4)
21-
end
22-
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
23-
local eq=e:GetHandler():GetEquipTarget()
24-
local bt=eg:GetFirst()
25-
return bt==eq
26-
end
27-
function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
28-
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
29-
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
6+
--The equipped monster gains 300 ATK
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetType(EFFECT_TYPE_EQUIP)
9+
e1:SetCode(EFFECT_UPDATE_ATTACK)
10+
e1:SetValue(300)
11+
c:RegisterEffect(e1)
12+
--When an opponent's monster declares an attack, you can Tribute this card to Special Summon 1 Level 4 or lower "Elemental Hero" monster from your hand and negate the attack of that opponent's monster.
13+
local e2=Effect.CreateEffect(c)
14+
e2:SetDescription(aux.Stringid(id,0))
15+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
16+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
17+
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
18+
e2:SetRange(LOCATION_SZONE)
19+
e2:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end)
20+
e2:SetCost(Cost.SelfRelease)
21+
e2:SetTarget(s.spnegatktg)
22+
e2:SetOperation(s.spnegatkop)
23+
c:RegisterEffect(e2)
3024
end
25+
s.listed_names={84327329} --"Elemental HERO Clayman"
26+
s.listed_series={SET_ELEMENTAL_HERO}
3127
function s.spfilter(c,e,tp)
32-
return c:GetLevel()<=4 and c:IsSetCard(SET_ELEMENTAL_HERO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
28+
return c:IsLevelBelow(4) and c:IsSetCard(SET_ELEMENTAL_HERO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
3329
end
34-
function s.negop(e,tp,eg,ep,ev,re,r,rp)
35-
if Duel.NegateAttack() then
36-
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
37-
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g>0
38-
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
39-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
40-
local sg=g:Select(tp,1,1,nil)
41-
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
42-
end
30+
function s.spnegatktg(e,tp,eg,ep,ev,re,r,rp,chk)
31+
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 end
32+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
33+
end
34+
function s.spnegatkop(e,tp,eg,ep,ev,re,r,rp)
35+
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
36+
if #g==0 or Duel.GetMZoneCount(tp)==0 then return end
37+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
38+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
39+
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
40+
Duel.NegateAttack()
4341
end
44-
end
42+
end

0 commit comments

Comments
 (0)