mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Fixed the Phasing icon not appearing immediately when the card phases in/out.
- Added support for an additional sound effect that is played when a card phases in/out (phasing.wav is played if available). - Added the "CHEAT_WITH_MANA_ON_SHUFFLE" option to the stock AI profiles (not used yet, to be implemented soon). - Organized the AI profile config files a little bit by sorting the options.
This commit is contained in:
@@ -86,6 +86,8 @@ import forge.game.trigger.TriggerType;
|
||||
import forge.game.trigger.ZCTrigger;
|
||||
import forge.game.zone.Zone;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.events.UiEventCardPhased;
|
||||
import forge.gui.match.CMatchUI;
|
||||
import forge.item.IPaperCard;
|
||||
import forge.item.PaperCard;
|
||||
import forge.util.Expressions;
|
||||
@@ -4912,6 +4914,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
aura.phase(false);
|
||||
}
|
||||
}
|
||||
|
||||
CMatchUI.SINGLETON_INSTANCE.fireEvent(new UiEventCardPhased(this, this.isPhasedOut()));
|
||||
}
|
||||
|
||||
private boolean switchPhaseState() {
|
||||
|
||||
@@ -3,5 +3,5 @@ package forge.gui.events;
|
||||
public interface IUiEventVisitor<T> {
|
||||
T visit(UiEventBlockerAssigned event);
|
||||
T visit(UiEventAttackerDeclared event);
|
||||
|
||||
T visit(UiEventCardPhased event);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package forge.gui.events;
|
||||
|
||||
import forge.game.card.Card;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
*
|
||||
*/
|
||||
public class UiEventCardPhased extends UiEvent {
|
||||
|
||||
public final Card phasingCard;
|
||||
public final boolean phaseState;
|
||||
|
||||
public UiEventCardPhased(Card card, boolean state) {
|
||||
phasingCard = card;
|
||||
phaseState = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T visit(IUiEventVisitor<T> visitor) {
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return phasingCard != null ? phasingCard.toString() : "(unknown)" + " changed its phased-out state to " + phaseState;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ import forge.gui.events.IUiEventVisitor;
|
||||
import forge.gui.events.UiEvent;
|
||||
import forge.gui.events.UiEventAttackerDeclared;
|
||||
import forge.gui.events.UiEventBlockerAssigned;
|
||||
import forge.gui.events.UiEventCardPhased;
|
||||
import forge.gui.framework.EDocID;
|
||||
import forge.gui.framework.FScreen;
|
||||
import forge.gui.framework.ICDoc;
|
||||
@@ -407,16 +408,22 @@ public enum CMatchUI implements ICDoc, IMenuProvider {
|
||||
uiEvents.post(uiEvent);
|
||||
}
|
||||
|
||||
public class MatchUiEventVisitor implements IUiEventVisitor<Void> {
|
||||
@Override
|
||||
public Void visit(UiEventBlockerAssigned event) {
|
||||
updateSingleCard(event.blocker);
|
||||
return null;
|
||||
}
|
||||
public class MatchUiEventVisitor implements IUiEventVisitor<Void> {
|
||||
@Override
|
||||
public Void visit(UiEventBlockerAssigned event) {
|
||||
updateSingleCard(event.blocker);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visit(UiEventAttackerDeclared event) {
|
||||
updateSingleCard(event.attacker);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visit(UiEventAttackerDeclared event) {
|
||||
updateSingleCard(event.attacker);
|
||||
public Void visit(UiEventCardPhased event) {
|
||||
updateSingleCard(event.phasingCard);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import forge.game.zone.ZoneType;
|
||||
import forge.gui.events.IUiEventVisitor;
|
||||
import forge.gui.events.UiEventAttackerDeclared;
|
||||
import forge.gui.events.UiEventBlockerAssigned;
|
||||
import forge.gui.events.UiEventCardPhased;
|
||||
import forge.net.FServer;
|
||||
import forge.util.maps.MapOfLists;
|
||||
|
||||
@@ -207,4 +208,8 @@ public class EventVisualizer extends IGameEventVisitor.Base<SoundEffectType> imp
|
||||
public SoundEffectType visit(UiEventAttackerDeclared event) {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public SoundEffectType visit(UiEventCardPhased event) {
|
||||
return SoundEffectType.Phasing;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,44 +36,44 @@ package forge.sound;
|
||||
public enum SoundEffectType {
|
||||
// Sounds must be listed in alphabetic order.
|
||||
|
||||
AddCounter("add_counter.wav", true),
|
||||
Artifact("artifact.wav", false),
|
||||
ArtifactCreature("artifact_creature.wav", false),
|
||||
BlackLand("black_land.wav", false),
|
||||
Block("block.wav", false),
|
||||
BlueLand("blue_land.wav", false),
|
||||
Creature("creature.wav", false),
|
||||
Damage("damage.wav", true),
|
||||
Destroy("destroy.wav", true),
|
||||
Discard("discard.wav", false),
|
||||
Draw("draw.wav", false),
|
||||
Enchantment("enchant.wav", false),
|
||||
EndOfTurn("end_of_turn.wav", false),
|
||||
Equip("equip.wav", false),
|
||||
Exile("exile.wav", false),
|
||||
FlipCoin("flip_coin.wav", false),
|
||||
GreenLand("green_land.wav", false),
|
||||
Instant("instant.wav", false),
|
||||
LifeGain("life_gain.wav", true),
|
||||
LifeLoss("life_loss.wav", true),
|
||||
LoseDuel("lose_duel.wav", false),
|
||||
ManaBurn("mana_burn.wav", false),
|
||||
OtherLand("other_land.wav", false),
|
||||
Planeswalker("planeswalker.wav", false),
|
||||
Poison("poison.wav", true),
|
||||
RedLand("red_land.wav", false),
|
||||
Regen("regeneration.wav", false),
|
||||
RemoveCounter("remove_counter.wav", true),
|
||||
Sacrifice("sacrifice.wav", true),
|
||||
ScriptedEffect("", false), // Plays the effect defined by SVar:SoundEffect
|
||||
Shuffle("shuffle.wav", false),
|
||||
Sorcery("sorcery.wav", false),
|
||||
Tap("tap.wav", false),
|
||||
Token("token.wav", true),
|
||||
Untap("untap.wav", true),
|
||||
WhiteLand("white_land.wav", false),
|
||||
WinDuel("win_duel.wav", false);
|
||||
|
||||
AddCounter("add_counter.wav", true),
|
||||
Artifact("artifact.wav", false),
|
||||
ArtifactCreature("artifact_creature.wav", false),
|
||||
BlackLand("black_land.wav", false),
|
||||
Block("block.wav", false),
|
||||
BlueLand("blue_land.wav", false),
|
||||
Creature("creature.wav", false),
|
||||
Damage("damage.wav", true),
|
||||
Destroy("destroy.wav", true),
|
||||
Discard("discard.wav", false),
|
||||
Draw("draw.wav", false),
|
||||
Enchantment("enchant.wav", false),
|
||||
EndOfTurn("end_of_turn.wav", false),
|
||||
Equip("equip.wav", false),
|
||||
Exile("exile.wav", false),
|
||||
FlipCoin("flip_coin.wav", false),
|
||||
GreenLand("green_land.wav", false),
|
||||
Instant("instant.wav", false),
|
||||
LifeGain("life_gain.wav", true),
|
||||
LifeLoss("life_loss.wav", true),
|
||||
LoseDuel("lose_duel.wav", false),
|
||||
ManaBurn("mana_burn.wav", false),
|
||||
OtherLand("other_land.wav", false),
|
||||
Phasing("phasing.wav", true),
|
||||
Planeswalker("planeswalker.wav", false),
|
||||
Poison("poison.wav", true),
|
||||
RedLand("red_land.wav", false),
|
||||
Regen("regeneration.wav", false),
|
||||
RemoveCounter("remove_counter.wav", true),
|
||||
Sacrifice("sacrifice.wav", true),
|
||||
ScriptedEffect("", false), // Plays the effect defined by SVar:SoundEffect
|
||||
Shuffle("shuffle.wav", false),
|
||||
Sorcery("sorcery.wav", false),
|
||||
Tap("tap.wav", false),
|
||||
Token("token.wav", true),
|
||||
Untap("untap.wav", true),
|
||||
WhiteLand("white_land.wav", false),
|
||||
WinDuel("win_duel.wav", false);
|
||||
|
||||
private final String resourceFileName;
|
||||
private final boolean isSync;
|
||||
|
||||
Reference in New Issue
Block a user