mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Sound System: Added to enumeration and implemented support for the AddCounter, Damage, Destroy, Discard, Equip, LifeLoss, ManaBurn, Regen, RemoveCounter, and Sacrifice sound effects. Also, some minor fixes.
This commit is contained in:
@@ -1257,6 +1257,9 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
Singletons.getModel().getGame().getTriggerHandler().runTrigger(TriggerType.CounterAdded, runParams);
|
||||
}
|
||||
|
||||
// play the Add Counter sound
|
||||
Sounds.AddCounter.play();
|
||||
|
||||
this.updateObservers();
|
||||
}
|
||||
|
||||
@@ -1290,6 +1293,9 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
Singletons.getModel().getGame().getTriggerHandler().runTrigger(TriggerType.CounterAdded, runParams);
|
||||
}
|
||||
|
||||
// play the Add Counter sound
|
||||
Sounds.AddCounter.play();
|
||||
|
||||
this.updateObservers();
|
||||
}
|
||||
|
||||
@@ -1360,6 +1366,10 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// play the Subtract Counter sound
|
||||
Sounds.RemoveCounter.play();
|
||||
|
||||
this.updateObservers();
|
||||
}
|
||||
}
|
||||
@@ -3855,6 +3865,9 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
this.addEquipping(c);
|
||||
c.addEquippedBy(this);
|
||||
this.equip();
|
||||
|
||||
// Play the Equip sound
|
||||
Sounds.Equip.play();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1254,6 +1254,9 @@ public class GameAction {
|
||||
|
||||
if (c.getCounters(Counters.LOYALTY) <= 0) {
|
||||
Singletons.getModel().getGame().getAction().moveToGraveyard(c);
|
||||
|
||||
// Play the Destroy sound
|
||||
Sounds.Destroy.play();
|
||||
}
|
||||
|
||||
final ArrayList<String> types = c.getType();
|
||||
@@ -1298,6 +1301,9 @@ public class GameAction {
|
||||
for (int i = 0; i < b.size(); i++) {
|
||||
Singletons.getModel().getGame().getAction().sacrificeDestroy(b.get(i));
|
||||
}
|
||||
|
||||
// Play the Destroy sound
|
||||
Sounds.Destroy.play();
|
||||
}
|
||||
}
|
||||
} // destroyLegendaryCreatures()
|
||||
@@ -1325,6 +1331,9 @@ public class GameAction {
|
||||
}
|
||||
this.sacrificeDestroy(c);
|
||||
|
||||
// Play the Sacrifice sound
|
||||
Sounds.Sacrifice.play();
|
||||
|
||||
// Run triggers
|
||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||
runParams.put("Card", c);
|
||||
@@ -1376,6 +1385,8 @@ public class GameAction {
|
||||
GameAction.this.destroy(crd);
|
||||
card.setDamage(0);
|
||||
|
||||
// Play the Destroy sound
|
||||
Sounds.Destroy.play();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1388,6 +1399,9 @@ public class GameAction {
|
||||
}
|
||||
} // totem armor
|
||||
|
||||
// Play the Destroy sound
|
||||
Sounds.Destroy.play();
|
||||
|
||||
return this.sacrificeDestroy(c);
|
||||
}
|
||||
|
||||
@@ -1533,6 +1547,10 @@ public class GameAction {
|
||||
c.tap();
|
||||
c.addRegeneratedThisTurn();
|
||||
game.getCombat().removeFromCombat(c);
|
||||
|
||||
// Play the Regeneration sound
|
||||
Sounds.Regen.play();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1560,11 +1578,18 @@ public class GameAction {
|
||||
|
||||
c.setDamage(0);
|
||||
this.destroy(crd);
|
||||
|
||||
// Play the Destroy sound
|
||||
Sounds.Destroy.play();
|
||||
|
||||
System.out.println("Totem armor destroyed instead of original card");
|
||||
return false;
|
||||
}
|
||||
} // totem armor
|
||||
|
||||
// Play the Destroy sound
|
||||
Sounds.Destroy.play();
|
||||
|
||||
return this.sacrificeDestroy(c);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ import forge.game.player.Player;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.GuiChoose;
|
||||
import forge.gui.match.CMatchUI;
|
||||
import forge.sound.Sounds;
|
||||
import forge.util.MyRandom;
|
||||
|
||||
|
||||
@@ -609,6 +610,9 @@ public final class GameActionUtil {
|
||||
final boolean winFlip = flip == choice.equals("heads");
|
||||
final String winMsg = winFlip ? " wins flip." : " loses flip.";
|
||||
|
||||
// Play the Flip A Coin sound
|
||||
Sounds.FlipCoin.play();
|
||||
|
||||
JOptionPane.showMessageDialog(null, source.getName() + " - " + caller + winMsg, source.getName(),
|
||||
JOptionPane.PLAIN_MESSAGE);
|
||||
return winFlip;
|
||||
@@ -689,6 +693,9 @@ public final class GameActionUtil {
|
||||
Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(ability);
|
||||
}
|
||||
}
|
||||
|
||||
// Play the Damage sound
|
||||
Sounds.Damage.play();
|
||||
}
|
||||
|
||||
// this is for cards like Sengir Vampire
|
||||
@@ -852,6 +859,9 @@ public final class GameActionUtil {
|
||||
}
|
||||
|
||||
c.getDamageHistory().registerCombatDamage(player);
|
||||
|
||||
// Play the Life Loss sound
|
||||
Sounds.LifeLoss.play();
|
||||
} // executeCombatDamageToPlayerEffects
|
||||
|
||||
/**
|
||||
|
||||
@@ -424,6 +424,9 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable {
|
||||
int burn = p.getManaPool().clearPool(true);
|
||||
if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_MANABURN)) {
|
||||
p.loseLife(burn);
|
||||
|
||||
// Play the Mana Burn sound
|
||||
Sounds.ManaBurn.play();
|
||||
}
|
||||
p.updateObservers();
|
||||
}
|
||||
|
||||
@@ -1597,8 +1597,14 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
|
||||
+ "counters on it instead of putting it into your graveyard."))
|
||||
&& (null != sa) && !c.getController().equals(sa.getSourceCard().getController())) {
|
||||
game.getAction().discardPutIntoPlayInstead(c);
|
||||
|
||||
// Play the corresponding Put into Play sound
|
||||
SoundUtils.playCardSoundEffect(c, sa);
|
||||
} else {
|
||||
game.getAction().moveToGraveyard(c);
|
||||
|
||||
// Play the Discard sound
|
||||
Sounds.Discard.play();
|
||||
}
|
||||
|
||||
// Run triggers
|
||||
|
||||
@@ -50,13 +50,13 @@ public final class SoundUtils {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sa.isSpell()) {
|
||||
// if there's a specific effect for this particular card, play it and
|
||||
// we're done.
|
||||
if (playSpecificCardEffect(source)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sa.isSpell()) {
|
||||
if (source.isCreature() && source.isArtifact()) {
|
||||
Sounds.ArtifactCreature.play();
|
||||
} else if (source.isCreature()) {
|
||||
|
||||
@@ -36,28 +36,32 @@ import forge.properties.ForgePreferences.FPref;
|
||||
public enum Sounds {
|
||||
// Sounds must be listed in alphabetic order.
|
||||
|
||||
AddCounter("res/sound/add_counter.wav"),
|
||||
Artifact("res/sound/artifact.wav"),
|
||||
ArtifactCreature("res/sound/artifact_creature.wav"),
|
||||
BlackLand("res/sound/black_land.wav"),
|
||||
BlueLand("res/sound/blue_land.wav"),
|
||||
Counter("res/sound/counter.wav"), /* NOT IMPLEMENTED YET */
|
||||
Creature("res/sound/creature.wav"),
|
||||
Damage("res/sound/damage.wav"), /* NOT IMPLEMENTED YET */
|
||||
Discard("res/sound/discard.wav"), /* NOT IMPLEMENTED YET */
|
||||
Damage("res/sound/damage.wav"),
|
||||
Destroy("res/sound/destroy.wav"),
|
||||
Discard("res/sound/discard.wav"),
|
||||
Draw("res/sound/draw.wav"),
|
||||
Enchantment("res/sound/enchant.wav"), /* NOT IMPLEMENTED YET */
|
||||
Enchantment("res/sound/enchant.wav"),
|
||||
EndOfTurn("res/sound/end_of_turn.wav"),
|
||||
Equip("res/sound/equip.wav"),
|
||||
FlipCoin("res/sound/flip_coin.wav"),
|
||||
GreenLand("res/sound/green_land.wav"),
|
||||
Instant("res/sound/instant.wav"),
|
||||
LifeLoss("res/sound/life_loss.wav"),
|
||||
LoseDuel("res/sound/lose_duel.wav"),
|
||||
ManaBurn("res/sound/mana_burn.wav"),
|
||||
OtherLand("res/sound/other_land.wav"),
|
||||
Planeswalker("res/sound/planeswalker.wav"),
|
||||
Poison("res/sound/poison.wav"),
|
||||
RedLand("res/sound/red_land.wav"),
|
||||
Regen("res/sound/regeneration.wav"), /* NOT IMPLEMENTED YET */
|
||||
Sacrifice("res/sound/sacrifice.wav"), /* NOT IMPLEMENTED YET */
|
||||
Regen("res/sound/regeneration.wav"),
|
||||
RemoveCounter("res/sound/remove_counter.wav"),
|
||||
Sacrifice("res/sound/sacrifice.wav"),
|
||||
Sorcery("res/sound/sorcery.wav"),
|
||||
Shuffle("res/sound/shuffle.wav"),
|
||||
Tap("res/sound/tap.wav"),
|
||||
|
||||
Reference in New Issue
Block a user