Skip to content

Commit 9e48bb1

Browse files
authored
Some script fixes
- Dragonecro Nethersoul Dragon: The battle protection should apply to your monsters too, if this card battles one of them due to another effect. Fixed an issue where the ATK changing effect would sometimes cause a script error. - Neutron Blast: Fixed an issue where the "cannot activate" effect would be applied even if the targeted monster leaves the field, returns, and then attacks again in the same turn. Also, should be able to target a monster that can attack multiple times, but not a monster that has already had the effect of "Neutron Blast" applied to it. - Witchcrafter Collaboration: Should be able to target a monster that can attack multiple times, but not a monster that has already had the effect of "Witchcrafter Collaboration" applied to it. - Witchcrafter Genni: Shouldn't be able to copy the effect of "Witchcrafter Collaboration" if the player cannot conduct their Battle Phase that turn.
1 parent 8cfa355 commit 9e48bb1

File tree

4 files changed

+114
-121
lines changed

4 files changed

+114
-121
lines changed

official/c10805153.lua

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,85 @@
11
--ウィッチクラフト・コラボレーション
22
--Witchcrafter Collaboration
33
--Scripted by Naim
4-
54
local s,id=GetID()
65
function s.initial_effect(c)
76
--Activate
87
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
99
e1:SetType(EFFECT_TYPE_ACTIVATE)
10-
e1:SetCode(EVENT_FREE_CHAIN)
1110
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
11+
e1:SetCode(EVENT_FREE_CHAIN)
1212
e1:SetCountLimit(1,id)
13-
e1:SetCondition(s.condition)
1413
e1:SetTarget(s.target)
15-
e1:SetOperation(s.operation)
14+
e1:SetOperation(s.activate)
1615
c:RegisterEffect(e1)
17-
--Add this card from GY to hand
16+
--Add this card to the hand
1817
local e2=Effect.CreateEffect(c)
19-
e2:SetDescription(aux.Stringid(id,0))
18+
e2:SetDescription(aux.Stringid(id,1))
2019
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_LEAVE_GRAVE)
2120
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
2221
e2:SetCode(EVENT_PHASE+PHASE_END)
2322
e2:SetRange(LOCATION_GRAVE)
2423
e2:SetCountLimit(1,id)
25-
e2:SetCondition(s.thcon2)
26-
e2:SetTarget(s.thtg2)
27-
e2:SetOperation(s.thop2)
24+
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_WITCHCRAFTER),tp,LOCATION_MZONE,0,1,nil) end)
25+
e2:SetTarget(s.thtg)
26+
e2:SetOperation(s.thop)
2827
c:RegisterEffect(e2)
2928
end
30-
s.listed_series={0x128}
31-
32-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
33-
return Duel.IsAbleToEnterBP()
34-
end
29+
s.listed_series={SET_WITCHCRAFTER}
3530
function s.tgfilter(c)
36-
return c:IsFaceup() and c:IsSetCard(0x128) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK)
31+
return c:IsSetCard(SET_WITCHCRAFTER) and c:IsFaceup() and not c:HasFlagEffect(id)
3732
end
3833
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
3934
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc) end
40-
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
41-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
35+
if chk==0 then return (Duel.IsAbleToEnterBP() or (Duel.IsBattlePhase() and not Duel.IsPhase(PHASE_BATTLE)))
36+
and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
37+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO)
4238
Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
4339
end
44-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
40+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
4541
local tc=Duel.GetFirstTarget()
4642
if tc:IsRelateToEffect(e) then
47-
--Can make a second attack
48-
local e1=Effect.CreateEffect(e:GetHandler())
43+
local c=e:GetHandler()
44+
tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1)
45+
--It can make a second attack during each Battle Phase this turn
46+
local e1=Effect.CreateEffect(c)
47+
e1:SetDescription(aux.Stringid(id,2))
4948
e1:SetType(EFFECT_TYPE_SINGLE)
50-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
49+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
5150
e1:SetCode(EFFECT_EXTRA_ATTACK)
52-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
5351
e1:SetValue(1)
52+
e1:SetReset(RESETS_STANDARD_PHASE_END)
5453
tc:RegisterEffect(e1)
55-
tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,3201)
56-
--Opponent cannot activate spells/traps until end of damage step
57-
local e2=Effect.CreateEffect(e:GetHandler())
54+
--If it attacks this turn your opponent cannot activate Spell/Trap Cards until the end of the Damage Step
55+
local e2=Effect.CreateEffect(c)
5856
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
57+
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
5958
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
60-
e2:SetOperation(s.atkop)
61-
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
59+
e2:SetOperation(s.limop)
60+
e2:SetReset(RESETS_STANDARD_PHASE_END)
6261
tc:RegisterEffect(e2)
6362
end
6463
end
65-
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
64+
function s.limop(e,tp,eg,ep,ev,re,r,rp)
65+
--Your opponent cannot activate Spell/Trap Cards until the end of the Damage Step
6666
local e1=Effect.CreateEffect(e:GetHandler())
6767
e1:SetType(EFFECT_TYPE_FIELD)
6868
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
6969
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
7070
e1:SetTargetRange(0,1)
71-
e1:SetValue(s.aclimit)
72-
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
71+
e1:SetValue(function(e,re,tp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) end)
72+
e1:SetReset(RESET_PHASE|PHASE_DAMAGE)
7373
Duel.RegisterEffect(e1,tp)
7474
end
75-
function s.aclimit(e,re,tp)
76-
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and not re:GetHandler():IsImmuneToEffect(e)
77-
end
78-
function s.thcon2(e,tp,eg,ep,ev,re,r,rp)
79-
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,0x128),tp,LOCATION_MZONE,0,1,nil) and Duel.GetTurnPlayer()==tp
80-
end
81-
function s.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
75+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
8276
local c=e:GetHandler()
8377
if chk==0 then return c:IsAbleToHand() end
84-
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,LOCATION_GRAVE)
78+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,0)
8579
end
86-
function s.thop2(e,tp,eg,ep,ev,re,r,rp,chk)
80+
function s.thop(e,tp,eg,ep,ev,re,r,rp,chk)
8781
local c=e:GetHandler()
8882
if c:IsRelateToEffect(e) then
89-
Duel.SendtoHand(c,tp,REASON_EFFECT)
83+
Duel.SendtoHand(c,nil,REASON_EFFECT)
9084
end
9185
end

official/c43845801.lua

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,57 @@ local s,id=GetID()
44
function s.initial_effect(c)
55
--Activate
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetType(EFFECT_TYPE_ACTIVATE)
8-
e1:SetCode(EVENT_FREE_CHAIN)
99
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
10-
e1:SetCondition(s.condition)
10+
e1:SetCode(EVENT_FREE_CHAIN)
1111
e1:SetTarget(s.target)
1212
e1:SetOperation(s.activate)
1313
c:RegisterEffect(e1)
1414
end
15-
s.listed_names={23995346}
16-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
17-
return Duel.IsAbleToEnterBP()
18-
end
19-
function s.filter(c)
20-
return c:IsFaceup() and c:IsSummonType(SUMMON_TYPE_FUSION)
21-
and c:IsCode(23995346) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK)
15+
s.listed_names={23995346} --"Blue-Eyes Ultimate Dragon"
16+
function s.tgfilter(c)
17+
return c:IsCode(23995346) and c:IsSummonType(SUMMON_TYPE_FUSION) and c:IsFaceup() and not c:HasFlagEffect(id)
2218
end
2319
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
24-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
25-
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
26-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
27-
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
20+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc) end
21+
if chk==0 then return (Duel.IsAbleToEnterBP() or (Duel.IsBattlePhase() and not Duel.IsPhase(PHASE_BATTLE)))
22+
and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
23+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO)
24+
Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
2825
end
2926
function s.activate(e,tp,eg,ep,ev,re,r,rp)
3027
local tc=Duel.GetFirstTarget()
3128
if tc:IsRelateToEffect(e) then
32-
local e1=Effect.CreateEffect(e:GetHandler())
33-
e1:SetDescription(aux.Stringid(id,0))
29+
local c=e:GetHandler()
30+
tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1)
31+
--It can make a second and third attack during each Battle Phase this turn
32+
local e1=Effect.CreateEffect(c)
33+
e1:SetDescription(aux.Stringid(id,1))
3434
e1:SetType(EFFECT_TYPE_SINGLE)
35-
e1:SetCode(EFFECT_EXTRA_ATTACK)
3635
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
36+
e1:SetCode(EFFECT_EXTRA_ATTACK)
3737
e1:SetValue(2)
38-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
38+
e1:SetReset(RESETS_STANDARD_PHASE_END)
3939
tc:RegisterEffect(e1)
40-
local e2=Effect.CreateEffect(e:GetHandler())
41-
e2:SetType(EFFECT_TYPE_FIELD)
42-
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
43-
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
44-
e2:SetTargetRange(0,1)
45-
e2:SetLabelObject(tc)
46-
e2:SetValue(1)
47-
e2:SetCondition(s.actcon)
48-
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
49-
Duel.RegisterEffect(e2,tp)
40+
--If it attacks this turn your opponent's cards and effects cannot be activated until the end of the Damage Step
41+
local e2=Effect.CreateEffect(c)
42+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
43+
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
44+
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
45+
e2:SetOperation(s.limop)
46+
e2:SetReset(RESETS_STANDARD_PHASE_END)
47+
tc:RegisterEffect(e2)
5048
end
5149
end
52-
function s.actcon(e)
53-
return Duel.GetAttacker()==e:GetLabelObject()
54-
end
50+
function s.limop(e,tp,eg,ep,ev,re,r,rp)
51+
--Your opponent's cards and effects cannot be activated until the end of the Damage Step
52+
local e1=Effect.CreateEffect(e:GetHandler())
53+
e1:SetType(EFFECT_TYPE_FIELD)
54+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
55+
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
56+
e1:SetTargetRange(0,1)
57+
e1:SetValue(1)
58+
e1:SetReset(RESET_PHASE|PHASE_DAMAGE)
59+
Duel.RegisterEffect(e1,tp)
60+
end

official/c64756282.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
5656
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
5757
local sc=Duel.SelectTarget(tp,s.copyfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
5858
Duel.Remove(Group.FromCards(sc,c),POS_FACEUP,REASON_COST)
59-
local te,ceg,cep,cev,cre,cr,crp=sc:CheckActivateEffect(false,true,true)
59+
local te,ceg,cep,cev,cre,cr,crp=sc:CheckActivateEffect(true,true,true)
6060
Duel.ClearTargetCard()
6161
local tg=te:GetTarget()
6262
e:SetProperty(te:GetProperty())

official/c8198620.lua

Lines changed: 43 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,72 @@
11
--冥界龍 ドラゴネクロ
22
--Dragonecro Nethersoul Dragon
33
local s,id=GetID()
4+
local TOKEN_DARK_SOUL=id+1
45
function s.initial_effect(c)
5-
c:SetUniqueOnField(1,0,id)
6-
--fusion material
76
c:EnableReviveLimit()
7+
--Fusion Materials: 2 Zombie monsters
88
Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsRace,RACE_ZOMBIE),2)
9-
--spsummon condition
9+
c:AddMustFirstBeFusionSummoned()
10+
--You can only control 1 "Dragonecro Nethersoul Dragon"
11+
c:SetUniqueOnField(1,0,id)
12+
--Monsters cannot be destroyed by battle with this card
1013
local e1=Effect.CreateEffect(c)
11-
e1:SetType(EFFECT_TYPE_SINGLE)
12-
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
13-
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
14-
e1:SetRange(LOCATION_EXTRA)
15-
e1:SetValue(s.splimit)
14+
e1:SetType(EFFECT_TYPE_FIELD)
15+
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
16+
e1:SetRange(LOCATION_MZONE)
17+
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
18+
e1:SetTarget(function(e,c) return c==e:GetHandler():GetBattleTarget() end)
19+
e1:SetValue(1)
1620
c:RegisterEffect(e1)
17-
--battle
21+
--Change the ATK of a monster this card battles to 0 and Special Summon 1 "Dark Soul Token"
1822
local e2=Effect.CreateEffect(c)
1923
e2:SetDescription(aux.Stringid(id,0))
2024
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
2125
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
2226
e2:SetCode(EVENT_DAMAGE_STEP_END)
23-
e2:SetTarget(s.attg)
24-
e2:SetOperation(s.atop)
27+
e2:SetTarget(s.atktg)
28+
e2:SetOperation(s.atkop)
2529
c:RegisterEffect(e2)
26-
--indes
27-
local e3=Effect.CreateEffect(c)
28-
e3:SetType(EFFECT_TYPE_FIELD)
29-
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
30-
e3:SetRange(LOCATION_MZONE)
31-
e3:SetTargetRange(0,LOCATION_MZONE)
32-
e3:SetTarget(s.indestg)
33-
e3:SetValue(1)
34-
c:RegisterEffect(e3)
35-
end
36-
s.listed_names={8198621}
37-
function s.splimit(e,se,sp,st)
38-
return not e:GetHandler():IsLocation(LOCATION_EXTRA) or st&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
3930
end
40-
function s.attg(e,tp,eg,ep,ev,re,r,rp,chk)
31+
s.listed_names={id,TOKEN_DARK_SOUL}
32+
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
4133
local bc=e:GetHandler():GetBattleTarget()
4234
if chk==0 then return bc and bc:IsRelateToBattle() end
43-
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
44-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
35+
Duel.SetTargetCard(bc)
36+
if bc:GetOriginalLevel()>0 then
37+
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
38+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
39+
end
4540
end
46-
function s.atop(e,tp,eg,ep,ev,re,r,rp)
47-
local c=e:GetHandler()
48-
local bc=c:GetBattleTarget()
49-
if bc:IsRelateToBattle() and bc:IsFaceup() then
41+
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
42+
local bc=Duel.GetFirstTarget()
43+
if bc:IsRelateToEffect(e) and bc:IsFaceup() then
44+
local c=e:GetHandler()
5045
local atk=bc:GetBaseAttack()
51-
--Change ATK to 0
46+
--Change that monster's ATK to 0
5247
local e1=Effect.CreateEffect(c)
5348
e1:SetType(EFFECT_TYPE_SINGLE)
49+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
5450
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
5551
e1:SetValue(0)
56-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
52+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
5753
bc:RegisterEffect(e1)
5854
local lv=bc:GetOriginalLevel()
5955
if lv>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
60-
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,-2,0,0,RACE_ZOMBIE,ATTRIBUTE_DARK) then
61-
local token=Duel.CreateToken(tp,id+1)
62-
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
63-
local e1=Effect.CreateEffect(c)
64-
e1:SetType(EFFECT_TYPE_SINGLE)
65-
e1:SetCode(EFFECT_SET_BASE_ATTACK)
66-
e1:SetValue(atk)
67-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
68-
token:RegisterEffect(e1)
69-
local e2=e1:Clone()
70-
e2:SetCode(EFFECT_CHANGE_LEVEL)
71-
e2:SetValue(lv)
72-
token:RegisterEffect(e2)
56+
and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_DARK_SOUL,0,TYPES_TOKEN,atk,0,lv,RACE_ZOMBIE,ATTRIBUTE_DARK) then
57+
local token=Duel.CreateToken(tp,TOKEN_DARK_SOUL)
58+
token:Level(lv)
59+
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) then
60+
--Set the Token's original ATK to the original ATK of the monster that this card battled
61+
local e1=Effect.CreateEffect(c)
62+
e1:SetType(EFFECT_TYPE_SINGLE)
63+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
64+
e1:SetCode(EFFECT_SET_BASE_ATTACK)
65+
e1:SetValue(atk)
66+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
67+
token:RegisterEffect(e1)
68+
end
7369
Duel.SpecialSummonComplete()
7470
end
7571
end
76-
end
77-
function s.indestg(e,c)
78-
return c==e:GetHandler():GetBattleTarget()
79-
end
72+
end

0 commit comments

Comments
 (0)