Skip to content

Commit e00a61e

Browse files
committed
"Possessed Partnerships" fix
fixed a bug where it would not count properly the number of attributes in the presence of monsters with multiple attributes
1 parent 9e7116e commit e00a61e

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

official/c65046521.lua

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--Scripted by Naim
44
local s,id=GetID()
55
function s.initial_effect(c)
6-
--Special Summon
6+
--Special Summon 1 Spellcaster with 1500 DEF from your hand or GY
77
local e1=Effect.CreateEffect(c)
88
e1:SetDescription(aux.Stringid(id,0))
99
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
@@ -14,53 +14,50 @@ function s.initial_effect(c)
1414
e1:SetTarget(s.target)
1515
e1:SetOperation(s.activate)
1616
c:RegisterEffect(e1)
17-
--Place "Possessed" Spell/Trap
17+
--Place 1 "Possessed" Continuous Spell/Trap face-up on your field
1818
local e2=Effect.CreateEffect(c)
1919
e2:SetDescription(aux.Stringid(id,1))
2020
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
2121
e2:SetType(EFFECT_TYPE_QUICK_O)
2222
e2:SetRange(LOCATION_GRAVE)
2323
e2:SetCode(EVENT_FREE_CHAIN)
2424
e2:SetCountLimit(1,id)
25-
e2:SetCost(aux.bfgcost)
25+
e2:SetCost(aux.SelfBanishCost)
2626
e2:SetTarget(s.tftg)
2727
e2:SetOperation(s.tfop)
2828
c:RegisterEffect(e2)
2929
end
30-
s.listed_series={0x0c0}
31-
function s.filter(c,e,tp)
32-
return c:IsRace(RACE_SPELLCASTER) and c:IsDefense(1500)
30+
s.listed_series={SET_POSSESSED}
31+
function s.spfilter(c,e,tp)
32+
return c:IsRace(RACE_SPELLCASTER) and c:IsDefense(1500)
3333
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
3434
end
3535
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
3636
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
37-
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
38-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND+LOCATION_GRAVE)
37+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end
38+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND|LOCATION_GRAVE)
3939
end
4040
function s.activate(e,tp,eg,ep,ev,re,r,rp)
4141
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
4242
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
43-
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
44-
local tc=g:GetFirst()
45-
if tc then
46-
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE) then
47-
if tc:IsFacedown() then
48-
Duel.ConfirmCards(1-tp,tc)
49-
end
50-
local cg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
51-
local dg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
52-
if #cg>1 and cg:GetClassCount(Card.GetAttribute)>1 and #dg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
53-
Duel.BreakEffect()
54-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
55-
local tc=dg:Select(tp,1,1,nil)
56-
Duel.HintSelection(tc)
57-
Duel.Destroy(tc,REASON_EFFECT)
58-
end
43+
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
44+
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)>0 then
45+
if tc:IsFacedown() then
46+
Duel.ConfirmCards(1-tp,tc)
47+
end
48+
local cg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
49+
local dg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
50+
if #cg>=1 and cg:GetBinClassCount(Card.GetAttribute)>=2 and #dg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
51+
Duel.BreakEffect()
52+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
53+
local tc=dg:Select(tp,1,1,nil)
54+
Duel.HintSelection(tc)
55+
Duel.Destroy(tc,REASON_EFFECT)
5956
end
6057
end
6158
end
6259
function s.tffilter(c,tp)
63-
return c:IsSpellTrap() and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0x0c0) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
60+
return c:IsContinuousSpellTrap() and c:IsSetCard(SET_POSSESSED) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
6461
end
6562
function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
6663
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tffilter(chkc,tp) end

0 commit comments

Comments
 (0)