Skip to content

Commit 4b18f66

Browse files
authored
Update "Performage Mirror Conductor (Anime)"
- Should not make Link Monster ATK 0 (they technically have no defense) - Other minor script polishing and updates for modernization purposes.
1 parent f566662 commit 4b18f66

File tree

1 file changed

+34
-38
lines changed

1 file changed

+34
-38
lines changed

unofficial/c511001565.lua

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,64 @@
1-
--Performage Mirror Conductor
1+
--Emミラー・コンダクター (Anime)
2+
--Performage Mirror Conductor (Anime)
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--pendulum summon
5+
--Pendulum Summon procedure
56
Pendulum.AddProcedure(c)
6-
--lowest value
7-
local e1=Effect.CreateEffect(c)
8-
e1:SetType(EFFECT_TYPE_FIELD)
9-
e1:SetCode(EFFECT_SET_BASE_ATTACK)
10-
e1:SetRange(LOCATION_PZONE)
11-
e1:SetTargetRange(0,LOCATION_MZONE)
12-
e1:SetTarget(s.target)
13-
e1:SetValue(s.val)
7+
--The original ATK and DEF of each Special Summoned monster your opponent controls become equal to the lowest value
8+
local e1a=Effect.CreateEffect(c)
9+
e1a:SetType(EFFECT_TYPE_FIELD)
10+
e1a:SetCode(EFFECT_SET_BASE_ATTACK)
11+
e1a:SetRange(LOCATION_PZONE)
12+
e1a:SetTargetRange(0,LOCATION_MZONE)
13+
e1a:SetTarget(aux.TargetBoolFunction(Card.IsSpecialSummoned))
14+
e1a:SetValue(s.atkdefval)
1415
c:RegisterEffect(e1)
15-
local e2=e1:Clone()
16-
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
16+
local e1b=e1a:Clone()
17+
e1b:SetCode(EFFECT_SET_BASE_DEFENSE)
18+
c:RegisterEffect(e1b)
19+
--When this card battle an opponent's monster: Target that monster, then switch its ATK/DEF during that damage calculation only
20+
local e2=Effect.CreateEffect(c)
21+
e2:SetDescription(aux.Stringid(id,0))
22+
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
23+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
24+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
25+
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
26+
e2:SetCondition(s.adswapcon)
27+
e2:SetTarget(s.adswaptg)
28+
e2:SetOperation(s.adswapop)
1729
c:RegisterEffect(e2)
18-
--switch
19-
local e3=Effect.CreateEffect(c)
20-
e3:SetDescription(aux.Stringid(id,0))
21-
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
22-
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
23-
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
24-
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
25-
e3:SetCondition(s.con)
26-
e3:SetTarget(s.tg)
27-
e3:SetOperation(s.op)
28-
c:RegisterEffect(e3)
2930
end
30-
function s.val(e,c)
31-
if c:GetBaseAttack()<=c:GetBaseDefense() then
31+
function s.atkdefval(e,c)
32+
if c:GetBaseAttack()<=c:GetBaseDefense() or not c:HasDefense() then
3233
return c:GetBaseAttack()
3334
else
3435
return c:GetBaseDefense()
3536
end
3637
end
37-
function s.target(e,c)
38-
return (c:GetSummonType()&SUMMON_TYPE_SPECIAL)~=0
39-
end
40-
function s.con(e,tp,eg,ep,ev,re,r,rp)
38+
function s.adswapcon(e,tp,eg,ep,ev,re,r,rp)
4139
local c=e:GetHandler()
4240
local bc=c:GetBattleTarget()
43-
return bc
41+
return c:IsRelateToBattle() and bc and bc:IsControler(1-tp) and bc:IsRelateToBattle() and bc:IsFaceup()
4442
end
45-
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
43+
function s.adswaptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
4644
local bc=e:GetHandler():GetBattleTarget()
4745
if chkc then return chkc==bc end
4846
if chk==0 then return bc:IsOnField() and bc:IsCanBeEffectTarget(e) end
4947
Duel.SetTargetCard(bc)
5048
end
51-
function s.op(e,tp,eg,ep,ev,re,r,rp)
49+
function s.adswapop(e,tp,eg,ep,ev,re,r,rp)
5250
local c=e:GetHandler()
5351
local tc=Duel.GetFirstTarget()
5452
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
55-
local atk=tc:GetAttack()
56-
local def=tc:GetDefense()
5753
local e1=Effect.CreateEffect(c)
5854
e1:SetType(EFFECT_TYPE_SINGLE)
5955
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
60-
e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
61-
e1:SetValue(def)
56+
e1:SetReset(RESET_PHASE|PHASE_DAMAGE_CAL)
57+
e1:SetValue(tc:GetDefense())
6258
tc:RegisterEffect(e1)
6359
local e2=e1:Clone()
6460
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
65-
e2:SetValue(atk)
61+
e2:SetValue(tc:GetAttack())
6662
tc:RegisterEffect(e2)
6763
end
68-
end
64+
end

0 commit comments

Comments
 (0)