Skip to content

Commit dac0579

Browse files
committed
Use GetBinClassCount with "Awakening of the Possessed"
1 parent 5de2205 commit dac0579

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

official/c62256492.lua

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ function s.initial_effect(c)
88
e1:SetType(EFFECT_TYPE_ACTIVATE)
99
e1:SetCode(EVENT_FREE_CHAIN)
1010
c:RegisterEffect(e1)
11-
--Your monsters gain 300 ATK per different attribute you control
11+
--Monsters you control gain 300 ATK for each different Attribute you control
1212
local e2=Effect.CreateEffect(c)
1313
e2:SetType(EFFECT_TYPE_FIELD)
1414
e2:SetCode(EFFECT_UPDATE_ATTACK)
1515
e2:SetRange(LOCATION_SZONE)
1616
e2:SetTargetRange(LOCATION_MZONE,0)
1717
e2:SetValue(s.atkval)
1818
c:RegisterEffect(e2)
19-
--Your "Charmer" and "Familiar-Possessed" monsters cannot be destroyed by card effects
19+
--"Charmer" and "Familiar-Possessed" monsters you control cannot be destroyed by card effects
2020
local e3=Effect.CreateEffect(c)
2121
e3:SetType(EFFECT_TYPE_FIELD)
2222
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
@@ -43,18 +43,8 @@ function s.initial_effect(c)
4343
end
4444
s.listed_series={SET_CHARMER,SET_FAMILIAR_POSSESSED}
4545
function s.atkval(e,c)
46-
local tp=e:GetHandlerPlayer()
47-
local att=0
48-
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
49-
for tc in aux.Next(g) do
50-
att=(att|tc:GetAttribute())
51-
end
52-
local ct=0
53-
while att~=0 do
54-
if (att&0x1)~=0 then ct=ct+1 end
55-
att=(att>>1)
56-
end
57-
return ct*300
46+
local g=Duel.GetMatchingGroup(Card.IsFaceup,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
47+
return 300*g:GetBinClassCount(Card.GetAttribute)
5848
end
5949
function s.indtg(e,c)
6050
return c:IsFaceup() and c:IsSetCard({SET_CHARMER,SET_FAMILIAR_POSSESSED})
@@ -72,7 +62,6 @@ function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
7262
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
7363
end
7464
function s.drop(e,tp,eg,ep,ev,re,r,rp)
75-
if not e:GetHandler():IsRelateToEffect(e) then return end
7665
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
7766
Duel.Draw(p,d,REASON_EFFECT)
7867
end

0 commit comments

Comments
 (0)