magefree / magefree/mage

Counter's PT boost and gain ability must use layer's timestamps like other effects?

Open
#15,696 1 comment 0 reactions 0 assignees View on GitHub
refactoring
Dominant language
Java
Stars
2.4k
Forks
940
Avg merge
2d 12h
Merged PRs (30d)
160

Description

from #15695

No real bugs exists, for info only

xmage uses global `ApplyStatusEffect` to apply:
- PT boost from counters;
- gain ability from counters like manace counter;

It's called directly in each game cycle on related layers:
- `Layer.AbilityAddingRemovingEffects_6`
- `Layer.PTChangingEffects_7`

But there are potential problem with effects dependencies and timestamps -- all other effects apply by layers and timestamps thanks to paper rules and `getLayeredEffects`, but not `ApplyStatusEffect`

As example: if some potential counter's `AbilityAddingRemovingEffects_6` effect lookup for some gained ability (e.g. depends on it) then it will be buggy cause it applies first all the time instead effect's timestamp and dependency.

Image

One of the possible solution (if such bugs really exists): inject per permanent ApplyStatusEffect in getLayeredEffects.

P.S. related issue with "layers 7c and 7d have been merged": #11692

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading ApplyStatusEffect, Layer.AbilityAddingRemovingEffects_6, Layer.PTChangingEffects_7, and getLayeredEffects. Compare how counter effects are applied with the timestamp and dependency handling used by other layered effects. Done requires confirming whether the described ordering problem exists and agreeing on an implementation approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.