Card-Forge / Card-Forge/forge

Protection from spells checks can fail

Open
#5,262 5 comments 0 reactions 2 assignees Claimed by @tool4ever View on GitHub
Game Mechanics keep Rules compliance
Dominant language
Java
Stars
2.7k
Forks
1.1k
Avg merge
1d 1h
Merged PRs (30d)
163

Description

_Devoted Caretaker_ can give protection from instant + sorcery **spells**[^1]

Case A:
➡️ the cast trigger of _The Beast, Deathless Prince_ will be from a spell source, so it shouldn't be able to target it now

Case B:
➡️ but the trigger from _Kozilek's Return_ should be allowed to damage it, since the ability triggers in the GY

Ideas:
1. I think ideally `Card.isSpell()` could be changed from
- `isInstant() || isSorcery() || (isAura() && !isInZone(ZoneType.Battlefield))`
to just
- `isInZone(ZoneType.Stack)`
But I'm not sure if some that would fail some logic checks?

2. Maybe just scripting it as `Protection:Instant.inZoneStack,Sorcery.inZoneStack` is the safer alternative

3. Otherwise `getProtectionValid` will need a bigger rework as it also needs to provide SA valids:
- but not for all parts
- Damage replacement would somehow need to check the Cause instead (but only if DamageSource is its host?) 🤔

[^1]: So it's different from e. g. _Petrified Wood-Kin_ which has "Protection from instants", here only the type should matter

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.