mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 22:42:03 -08:00
Venture into abilities - added card hints about current dungeon and room (part of #12274);
This commit is contained in:
parent
e1ab0be505
commit
bf2c4cac15
43 changed files with 153 additions and 33 deletions
|
|
@ -0,0 +1,43 @@
|
|||
package mage.abilities.hint.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.CitysBlessingCondition;
|
||||
import mage.abilities.hint.ConditionHint;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Dungeon;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public enum CurrentDungeonHint implements Hint {
|
||||
|
||||
instance;
|
||||
private static final ConditionHint hint = new ConditionHint(CitysBlessingCondition.instance, "You have city's blessing");
|
||||
|
||||
@Override
|
||||
public String getText(Game game, Ability ability) {
|
||||
Player player = game.getPlayer(ability.getControllerId());
|
||||
if (player == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
Dungeon dungeon = game.getPlayerDungeon(ability.getControllerId());
|
||||
if (dungeon == null) {
|
||||
return "Current dungeon: not yet entered";
|
||||
}
|
||||
|
||||
String dungeonInfo = "Current dungeon: " + dungeon.getLogName();
|
||||
if (dungeon.getCurrentRoom() != null) {
|
||||
dungeonInfo += ", room: " + dungeon.getCurrentRoom().getName();
|
||||
}
|
||||
|
||||
return dungeonInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hint copy() {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package mage.designations;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.hint.common.CurrentDungeonHint;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Controllable;
|
||||
|
|
@ -113,6 +114,7 @@ class InitiativeVentureTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
InitiativeVentureTriggeredAbility() {
|
||||
super(Zone.ALL, new InitiativeUndercityEffect());
|
||||
addHint(CurrentDungeonHint.instance);
|
||||
}
|
||||
|
||||
private InitiativeVentureTriggeredAbility(final InitiativeVentureTriggeredAbility ability) {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public interface Game extends MageItem, Serializable, Copyable<Game> {
|
|||
|
||||
Dungeon getDungeon(UUID objectId);
|
||||
|
||||
Dungeon getPlayerDungeon(UUID objectId);
|
||||
Dungeon getPlayerDungeon(UUID playerId);
|
||||
|
||||
UUID getControllerId(UUID objectId);
|
||||
|
||||
|
|
@ -456,7 +456,12 @@ public interface Game extends MageItem, Serializable, Copyable<Game> {
|
|||
|
||||
Dungeon addDungeon(Dungeon dungeon, UUID playerId);
|
||||
|
||||
void ventureIntoDungeon(UUID playerId, boolean undercity);
|
||||
/**
|
||||
* Enter to dungeon or go to next room
|
||||
*
|
||||
* @param isEnterToUndercity - enter to Undercity instead choose a new dungeon
|
||||
*/
|
||||
void ventureIntoDungeon(UUID playerId, boolean isEnterToUndercity);
|
||||
|
||||
void temptWithTheRing(UUID playerId);
|
||||
|
||||
|
|
|
|||
|
|
@ -560,14 +560,14 @@ public abstract class GameImpl implements Game {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void ventureIntoDungeon(UUID playerId, boolean undercity) {
|
||||
public void ventureIntoDungeon(UUID playerId, boolean isEnterToUndercity) {
|
||||
if (playerId == null) {
|
||||
return;
|
||||
}
|
||||
if (replaceEvent(GameEvent.getEvent(GameEvent.EventType.VENTURE, playerId, null, playerId))) {
|
||||
return;
|
||||
}
|
||||
this.getOrCreateDungeon(playerId, undercity).moveToNextRoom(playerId, this);
|
||||
this.getOrCreateDungeon(playerId, isEnterToUndercity).moveToNextRoom(playerId, this);
|
||||
fireEvent(GameEvent.getEvent(GameEvent.EventType.VENTURED, playerId, null, playerId));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue