Skip to content

Commit ce465e4

Browse files
authored
Small script updates
1 parent c948dc7 commit ce465e4

10 files changed

Lines changed: 55 additions & 13 deletions

File tree

official/c42079445.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
3939
tc:NegateEffects(c)
4040
--Its Level is reduced by 1
4141
local e1=Effect.CreateEffect(c)
42+
e1:SetDescription(3313)
4243
e1:SetType(EFFECT_TYPE_SINGLE)
43-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
44+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
4445
e1:SetCode(EFFECT_UPDATE_LEVEL)
4546
e1:SetValue(-1)
4647
e1:SetReset(RESET_EVENT|RESETS_STANDARD)

official/c42338879.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function s.initial_effect(c)
1515
c:RegisterEffect(e1)
1616
--If your opponent controls a monster and you control no cards, you can Special Summon this card (from your hand) as a Level 4 monster
1717
local e2=e1:Clone()
18+
e2:SetDescription(aux.Stringid(id,1))
1819
e2:SetCondition(s.lv4spcon)
1920
e2:SetOperation(s.spop(4))
2021
e2:SetLabelObject({function(c) c:AssumeProperty(ASSUME_LEVEL,4) end})

official/c65398390.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ end
5858
function s.spop(e,tp,eg,ep,ev,re,r,rp)
5959
local c=e:GetHandler()
6060
if not c:IsRelateToEffect(e) then return end
61-
local tc=Duel.GetFirstTarget()
6261
c:AssumeProperty(ASSUME_TYPE,c:GetType()|TYPE_TUNER)
6362
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
6463
--Treated as a Tuner
@@ -69,7 +68,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
6968
e1:SetValue(TYPE_TUNER)
7069
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
7170
c:RegisterEffect(e1)
72-
if Duel.SpecialSummonComplete()>0 and tc:IsRelateToEffect(e) and tc:IsControler(tp) then
71+
if Duel.SpecialSummonComplete()==0 then return end
72+
local tc=Duel.GetFirstTarget()
73+
if tc:IsRelateToEffect(e) and tc:IsControler(tp) then
7374
if not c:EquipByEffectAndLimitRegister(e,tp,tc,nil,true) then return end
7475
--The equipped monster gains 500 ATK
7576
local e2=Effect.CreateEffect(tc)

official/c92099232.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ function s.initial_effect(c)
1414
c:RegisterEffect(e1)
1515
end
1616
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
17-
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
18-
Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_NORMAL|TYPE_TUNER,0,0,2,RACE_FIEND,ATTRIBUTE_EARTH) end
17+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
18+
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_NORMAL|TYPE_TUNER,0,0,2,RACE_FIEND,ATTRIBUTE_EARTH) end
1919
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,0)
2020
end
2121
function s.activate(e,tp,eg,ep,ev,re,r,rp)
2222
local c=e:GetHandler()
2323
if c:IsRelateToEffect(e) and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_NORMAL|TYPE_TUNER,0,0,2,RACE_FIEND,ATTRIBUTE_EARTH) then
24-
c:AddMonsterAttribute(TYPE_NORMAL+TYPE_TUNER+TYPE_TRAP)
24+
c:AddMonsterAttribute(TYPE_NORMAL|TYPE_TUNER|TYPE_TRAP)
2525
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP)
2626
c:AddMonsterAttributeComplete()
2727
Duel.SpecialSummonComplete()

pre-release/c100446034.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,17 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
5353
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
5454
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
5555
e1:SetTargetRange(1,0)
56-
e1:SetTarget(function(e,c) return (c:IsMonster() and not c:IsType(TYPE_TUNER)) or (c:IsMonsterCard() and not c:IsOriginalType(TYPE_TUNER)) end)
56+
e1:SetTarget(s.splimit)
5757
e1:SetReset(RESET_PHASE|PHASE_END)
5858
Duel.RegisterEffect(e1,tp)
5959
end
60+
function s.splimit(e,c)
61+
if c:IsMonster() then
62+
return not c:IsType(TYPE_TUNER)
63+
elseif c:IsMonsterCard() then
64+
return not c:IsOriginalType(TYPE_TUNER)
65+
end
66+
end
6067
function s.exctg(e,tp,eg,ep,ev,re,r,rp,chk)
6168
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>=2 and Duel.IsPlayerCanRemove(tp) end
6269
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_DECK)

pre-release/c100446039.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
4949
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
5050
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
5151
e1:SetTargetRange(1,0)
52-
e1:SetTarget(function(e,c) return (c:IsMonster() and not c:IsType(TYPE_TUNER)) or (c:IsMonsterCard() and not c:IsOriginalType(TYPE_TUNER)) end)
52+
e1:SetTarget(s.splimit)
5353
e1:SetReset(RESET_PHASE|PHASE_END)
5454
Duel.RegisterEffect(e1,tp)
55+
end
56+
function s.splimit(e,c)
57+
if c:IsMonster() then
58+
return not c:IsType(TYPE_TUNER)
59+
elseif c:IsMonsterCard() then
60+
return not c:IsOriginalType(TYPE_TUNER)
61+
end
5562
end

pre-release/c100446040.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@ function s.thspop(e,tp,eg,ep,ev,re,r,rp)
8080
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
8181
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
8282
e1:SetTargetRange(1,0)
83-
e1:SetTarget(function(e,c) return (c:IsMonster() and not c:IsType(TYPE_TUNER)) or (c:IsMonsterCard() and not c:IsOriginalType(TYPE_TUNER)) end)
83+
e1:SetTarget(s.splimit)
8484
e1:SetReset(RESET_PHASE|PHASE_END)
8585
Duel.RegisterEffect(e1,tp)
86+
end
87+
function s.splimit(e,c)
88+
if c:IsMonster() then
89+
return not c:IsType(TYPE_TUNER)
90+
elseif c:IsMonsterCard() then
91+
return not c:IsOriginalType(TYPE_TUNER)
92+
end
8693
end

pre-release/c100446041.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,14 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
104104
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
105105
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
106106
e1:SetTargetRange(1,0)
107-
e1:SetTarget(function(e,c) return (c:IsMonster() and not c:IsType(TYPE_TUNER)) or (c:IsMonsterCard() and not c:IsOriginalType(TYPE_TUNER)) end)
107+
e1:SetTarget(s.splimit)
108108
e1:SetReset(RESET_PHASE|PHASE_END)
109109
Duel.RegisterEffect(e1,tp)
110+
end
111+
function s.splimit(e,c)
112+
if c:IsMonster() then
113+
return not c:IsType(TYPE_TUNER)
114+
elseif c:IsMonsterCard() then
115+
return not c:IsOriginalType(TYPE_TUNER)
116+
end
110117
end

proc_workaround.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--Utilities to be added to the core
22

33
--[[
4-
If a non-activated effect allows a monster to be Summoned with a different property (e.g. "as a Level X monster") then that different property should be considered when any "cannot summon" type of effects are checked
4+
If a non-activated effect allows a monster to be Special Summoned with a different property (e.g. "as a Level X monster") then that different property should be considered when any "cannot summon" type of effects are checked
55
("Cockadoodledoo" vs "Evilswarm Ophion" workaround)
66
--]]
77
Card.RegisterEffect=(function()
@@ -12,31 +12,42 @@ Card.RegisterEffect=(function()
1212
local eff_code=e:GetCode()
1313
if eff_code==EFFECT_CANNOT_SUMMON or eff_code==EFFECT_CANNOT_SPECIAL_SUMMON then
1414
local base_tg=e:GetTarget()
15+
--if there's no target function in the effect then return early
1516
if not base_tg then return reg_e end
17+
--change the "cannot (special) summon" effect's target function to execute the specialised "assume" function, if it exists, before returning its regular check
18+
--as a result when the base target function is executed the relevant assume property call has already happened
1619
e:SetTarget(function(e,c,sump,sumtype,sumpos,targetp,sum_eff,sum_proc_eff)
20+
--'sum_proc_eff' exists only if it's a proc effect
1721
if sum_proc_eff then
22+
--the label object of the SS proc effect is a table containing a function that when executed calls "Card.AssumeProperty" on the passed card
1823
local assume_func=sum_proc_eff:GetLabelObject()
24+
--safety checks incase an SS proc effect has a label object for a different reason
1925
if assume_func and type(assume_func)=="table"
2026
and type(assume_func[1])=="function" then
2127
assume_func[1](c)
2228
end
2329
end
30+
--the summoning effects are always nil for the Normal Summon case
31+
--manually grab the proc effect and check the sumtype (added a '1' value in the cards' scripts to differentiate it from regular/other Normal Summons)
2432
if eff_code==EFFECT_CANNOT_SUMMON and sumtype==SUMMON_TYPE_NORMAL+1 then
2533
local ns_eff=c:IsHasEffect(EFFECT_SUMMON_PROC)
2634
if ns_eff then
2735
local assume_func=ns_eff:GetLabelObject()
36+
--safety checks same as above
2837
if assume_func and type(assume_func)=="table"
2938
and type(assume_func[1])=="function" then
3039
assume_func[1](c)
3140
end
3241
end
3342
end
43+
--execute the base target function at the end
3444
return base_tg(e,c,sump,sumtype,sumpos,targetp,sum_eff,sum_proc_eff)
3545
end)
3646
end
3747
return reg_e
3848
end
3949
end)()
50+
--same functionality as the 'Card' version above but for 'Duel' effects
4051
Duel.RegisterEffect=(function()
4152
local oldf=Duel.RegisterEffect
4253
return function(e,player,...)

unofficial/c511009126.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--白闘気海豚
2-
--White Aura Dolphin
1+
--白闘気海豚 (Manga)
2+
--White Aura Dolphin (Manga)
33
Duel.LoadScript("c420.lua")
44
local s,id=GetID()
55
function s.initial_effect(c)

0 commit comments

Comments
 (0)