Skip to content

Commit 5897b3b

Browse files
authored
Some unofficial card fixes
- Cyber Larva (Manga): Prevent damage from a battle where this card itself is destroyed. Register the "no damage" effect on the card's previous controller. Don't Special Summon on resolution if this card isn't in the GY anymore since its name needs to be referenced. - Infernal Gauntlet: Shouldn't prevent the monster from attacking directly in general, just the extra attack granted by this effect should be limited to monsters only. Register the additional attack effect on the monster, not as the Equip's effect. Being a Trigger effect it should only be usable as Chain Link 1. Don't allow the effect to be usable at the end of the Battle Phase. - Samsara Dragon (Manga): Special Summon ignoring the Summoning conditions. - T.G. Blade Blaster (Anime): Should able to use its Accel Synchro effect as Chain Link 2 or higher. Should send the card to the GY instead of discarding it, should only negate the effect rather than the negating the activation and destroying the card, and should only negate a Spell/Trap effect that would affect this card. The Special Summoning effect should trigger only when it's destroyed by battle.
1 parent bf95a74 commit 5897b3b

File tree

4 files changed

+165
-157
lines changed

4 files changed

+165
-157
lines changed

unofficial/c511000329.lua

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,38 @@
1+
--ヘル・ガントレット
12
--Infernal Gauntlet
23
local s,id=GetID()
34
function s.initial_effect(c)
45
aux.AddEquipProcedure(c)
5-
--Double attack
6-
local e3=Effect.CreateEffect(c)
7-
e3:SetType(EFFECT_TYPE_QUICK_O)
8-
e3:SetCode(EVENT_FREE_CHAIN)
9-
e3:SetRange(LOCATION_SZONE)
10-
e3:SetCondition(s.dacon)
11-
e3:SetCost(s.dacost)
12-
e3:SetOperation(s.daop)
13-
c:RegisterEffect(e3)
6+
--Grant the equipped monster an additional attack (on monsters)
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_QUICK_O)
10+
e1:SetCode(EVENT_FREE_CHAIN)
11+
e1:SetRange(LOCATION_SZONE)
12+
e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) and Duel.IsBattlePhase() and not Duel.IsPhase(PHASE_BATTLE) and Duel.GetCurrentChain()==0 end)
13+
e1:SetCost(s.exatkcost)
14+
e1:SetOperation(s.exatkop)
15+
c:RegisterEffect(e1)
1416
end
15-
function s.dacon(e,tp,eg,ep,ev,re,r,rp)
16-
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
17-
end
18-
function s.dacost(e,tp,eg,ep,ev,re,r,rp,chk)
19-
local eq=e:GetHandler():GetEquipTarget()
20-
if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,nil,eq) end
21-
local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,nil,eq)
17+
function s.exatkcost(e,tp,eg,ep,ev,re,r,rp,chk)
18+
local eqc=e:GetHandler():GetEquipTarget()
19+
if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,nil,eqc) end
20+
local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,nil,eqc)
2221
Duel.Release(g,REASON_COST)
2322
end
24-
function s.daop(e,tp,eg,ep,ev,re,r,rp)
23+
function s.exatkop(e,tp,eg,ep,ev,re,r,rp)
2524
local c=e:GetHandler()
26-
local eq=c:GetEquipTarget()
27-
if eq and eq:IsFaceup() then
28-
local e2=Effect.CreateEffect(c)
29-
e2:SetType(EFFECT_TYPE_EQUIP)
30-
e2:SetCode(EFFECT_EXTRA_ATTACK)
31-
e2:SetValue(1)
32-
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
33-
c:RegisterEffect(e2)
34-
local e4=Effect.CreateEffect(c)
35-
e4:SetType(EFFECT_TYPE_EQUIP)
36-
e4:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
37-
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
38-
c:RegisterEffect(e4)
25+
local eqc=c:GetEquipTarget()
26+
if eqc then
27+
local atk_announce_ct=eqc:GetAttackAnnouncedCount()
28+
local extra_atk_ct=atk_announce_ct==0 and 1 or atk_announce_ct
29+
--The equipped monster gains an additional attack in addition to its normal attack, but if it attacks using this effect, it cannot attack your opponent directly
30+
local e1=Effect.CreateEffect(c)
31+
e1:SetType(EFFECT_TYPE_SINGLE)
32+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
33+
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
34+
e1:SetValue(extra_atk_ct)
35+
e1:SetReset(RESETS_STANDARD_PHASE_END)
36+
eqc:RegisterEffect(e1)
3937
end
40-
end
38+
end

unofficial/c511000366.lua

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,30 @@
22
--Samsara Dragon (Manga)
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Special summon from the Graveyard
5+
--Special Summon 1 Dragon monster from your GY, ignoring its Summoning conditions
66
local e1=Effect.CreateEffect(c)
77
e1:SetDescription(aux.Stringid(id,0))
88
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
9-
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
109
e1:SetType(EFFECT_TYPE_IGNITION)
1110
e1:SetRange(LOCATION_GRAVE)
12-
e1:SetCost(aux.bfgcost)
13-
e1:SetTarget(s.target)
14-
e1:SetOperation(s.operation)
11+
e1:SetCost(aux.SelfBanishCost)
12+
e1:SetTarget(s.sptg)
13+
e1:SetOperation(s.spop)
1514
c:RegisterEffect(e1)
1615
end
17-
function s.filter(c,e,tp)
18-
return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
16+
function s.spfilter(c,e,tp)
17+
return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
1918
end
20-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
21-
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc,e,tp) end
19+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
2220
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
23-
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
24-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
25-
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
26-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
21+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
22+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
2723
end
28-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
29-
local tc=Duel.GetFirstTarget()
30-
if tc and tc:IsRelateToEffect(e) then
31-
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
24+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
25+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
26+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
27+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
28+
if #g>0 then
29+
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
3230
end
33-
end
31+
end

unofficial/c511005701.lua

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,66 @@
11
--サイバー・ラーバァ (Manga)
22
--Cyber Larva (Manga)
3-
--Scripted by GameMaster()
4-
--cleaned up by MLD
53
local s,id=GetID()
64
function s.initial_effect(c)
7-
--Controller takes no battle damage for the rest of this turn
5+
--When this card is destroyed, its controller takes no damage this turn
86
local e1=Effect.CreateEffect(c)
9-
e1:SetDescription(aux.Stringid(id,0))
10-
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
11-
e1:SetCode(EVENT_DESTROYED)
12-
e1:SetCondition(function(e) return e:GetHandler():IsReason(REASON_BATTLE|REASON_EFFECT) end)
13-
e1:SetOperation(s.nodamop)
7+
e1:SetType(EFFECT_TYPE_SINGLE)
8+
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
9+
e1:SetCondition(s.nobattledmgcon)
10+
e1:SetValue(1)
1411
c:RegisterEffect(e1)
15-
--Special Summon 1 card with the same name as this card from your Deck
1612
local e2=Effect.CreateEffect(c)
17-
e2:SetDescription(aux.Stringid(id,1))
18-
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
19-
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
13+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
2014
e2:SetCode(EVENT_DESTROYED)
21-
e2:SetCondition(function(e) return e:GetHandler():IsReason(REASON_BATTLE|REASON_EFFECT) end)
22-
e2:SetTarget(s.sptg)
23-
e2:SetOperation(s.spop)
15+
e2:SetOperation(s.nodamop)
2416
c:RegisterEffect(e2)
17+
--Special Summon 1 card with the same name as this card from your Deck
18+
local e3=Effect.CreateEffect(c)
19+
e3:SetDescription(aux.Stringid(id,0))
20+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
21+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
22+
e3:SetCode(EVENT_DESTROYED)
23+
e3:SetTarget(s.sptg)
24+
e3:SetOperation(s.spop)
25+
c:RegisterEffect(e3)
26+
end
27+
function s.nobattledmgcon(e)
28+
local c=e:GetHandler()
29+
if c:IsHasEffect(EFFECT_INDESTRUCTABLE_BATTLE) or c:IsHasEffect(EFFECT_INDESTRUCTABLE) then return false end
30+
local bc=c:GetBattleTarget()
31+
if c==Duel.GetAttacker() then
32+
return bc:IsAttackPos() and bc:IsAttackAbove(1) and bc:IsAttackAbove(c:GetAttack())
33+
else
34+
local battle_stat=0
35+
if bc:IsAttackPos() then
36+
battle_stat=bc:GetAttack()
37+
else
38+
local def_attack_eff=bc:IsHasEffect(EFFECT_DEFENSE_ATTACK)
39+
battle_stat=def_attack_eff:GetValue()==1 and bc:GetDefense() or bc:GetAttack()
40+
end
41+
return battle_stat>0 and ((c:IsAttackPos() and c:IsAttackBelow(battle_stat))
42+
or (c:IsDefensePos() and c:GetDefense()<battle_stat))
43+
end
2544
end
2645
function s.nodamop(e,tp,eg,ep,ev,re,r,rp)
27-
local e1=Effect.CreateEffect(e:GetHandler())
46+
local c=e:GetHandler()
47+
local prev_ctrl=c:GetPreviousControler()
48+
--Its controller takes no damage this turn
49+
local e1=Effect.CreateEffect(c)
50+
e1:SetDescription(aux.Stringid(id,1))
2851
e1:SetType(EFFECT_TYPE_FIELD)
52+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
2953
e1:SetCode(EFFECT_CHANGE_DAMAGE)
30-
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
3154
e1:SetTargetRange(1,0)
32-
e1:SetValue(s.damval)
33-
e1:SetReset(RESET_PHASE|PHASE_END,1)
34-
Duel.RegisterEffect(e1,tp)
35-
end
36-
function s.damval(e,re,dam,r,rp,rc)
37-
if r&(REASON_BATTLE|REASON_EFFECT)~=0 then
38-
return 0
39-
else return dam end
55+
e1:SetValue(0)
56+
e1:SetReset(RESET_PHASE|PHASE_END)
57+
Duel.RegisterEffect(e1,prev_ctrl)
58+
local e2=e1:Clone()
59+
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
60+
Duel.RegisterEffect(e2,prev_ctrl)
4061
end
41-
function s.spfilter(c,e,tp,cid)
42-
return c:IsCode(cid) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
62+
function s.spfilter(c,e,tp,code)
63+
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
4364
end
4465
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
4566
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
@@ -48,8 +69,10 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
4869
end
4970
function s.spop(e,tp,eg,ep,ev,re,r,rp)
5071
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
51-
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetHandler():GetCode()):GetFirst()
52-
if tc then
53-
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
72+
local c=e:GetHandler()
73+
if not c:IsRelateToEffect(e) then return end
74+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,c:GetCode())
75+
if #g>0 then
76+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
5477
end
55-
end
78+
end

0 commit comments

Comments
 (0)