mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[MOM] Implement Inga and Esika
This commit is contained in:
parent
0f46bf32b7
commit
d94e699d0e
3 changed files with 109 additions and 0 deletions
|
|
@ -36,6 +36,7 @@ public class ManaPaidSourceWatcher extends Watcher {
|
|||
private int greenSnow = 0;
|
||||
private int colorlessSnow = 0;
|
||||
private int treasure = 0;
|
||||
private int creature = 0;
|
||||
|
||||
private ManaPaidTracker() {
|
||||
super();
|
||||
|
|
@ -50,6 +51,7 @@ public class ManaPaidSourceWatcher extends Watcher {
|
|||
this.greenSnow = tracker.greenSnow;
|
||||
this.colorlessSnow = tracker.colorlessSnow;
|
||||
this.treasure = tracker.treasure;
|
||||
this.creature = tracker.creature;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -62,6 +64,9 @@ public class ManaPaidSourceWatcher extends Watcher {
|
|||
if (sourceObject != null && sourceObject.hasSubtype(SubType.TREASURE, game)) {
|
||||
treasure++;
|
||||
}
|
||||
if (sourceObject != null && sourceObject.isCreature(game)) {
|
||||
creature++;
|
||||
}
|
||||
if (sourceObject != null && !sourceObject.isSnow()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -144,6 +149,11 @@ public class ManaPaidSourceWatcher extends Watcher {
|
|||
return watcher == null ? 0 : watcher.manaMap.getOrDefault(sourceId, emptyTracker).treasure;
|
||||
}
|
||||
|
||||
public static int getCreaturePaid(UUID sourceId, Game game) {
|
||||
ManaPaidSourceWatcher watcher = game.getState().getWatcher(ManaPaidSourceWatcher.class);
|
||||
return watcher == null ? 0 : watcher.manaMap.getOrDefault(sourceId, emptyTracker).creature;
|
||||
}
|
||||
|
||||
public static int getSnowPaid(UUID sourceId, Game game) {
|
||||
ManaPaidSourceWatcher watcher = game.getState().getWatcher(ManaPaidSourceWatcher.class);
|
||||
return watcher == null ? 0 : watcher.manaMap.getOrDefault(sourceId, emptyTracker).getSnow();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue