Skip to content

Commit 4ac779f

Browse files
committed
"Like the Diabell" fix
- fixed a bug where it would be possible to activate the card even when it would leave the player without a zone to set the card - fixed a bug where it could be activated from the hand if it was the only card that could be set
1 parent 9ef4f1e commit 4ac779f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

official/c65289956.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,19 @@ end
3434
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
3535
return re and re:IsActivated() and eg:IsExists(s.setconfilter,1,nil)
3636
end
37-
function s.setfilter(c)
38-
return c:IsSpellTrap() and c:IsSSetable()
37+
function s.setfilter(c,ft)
38+
return c:IsSpellTrap() and c:IsSSetable() and (ft>0 or c:IsFieldSpell())
3939
end
4040
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
41-
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil) end
41+
local c=e:GetHandler()
42+
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
43+
if c:IsLocation(LOCATION_HAND) then ft=ft-1 end
44+
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,c,ft) end
4245
end
4346
function s.setop(e,tp,eg,ep,ev,re,r,rp)
47+
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
4448
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
45-
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil):GetFirst()
49+
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,ft):GetFirst()
4650
if sc and Duel.SSet(tp,sc,tp,false)>0 then
4751
--It cannot be activated this turn
4852
local e1=Effect.CreateEffect(e:GetHandler())

0 commit comments

Comments
 (0)