Skip to content

Commit

Permalink
Play house theme of attacker when initiating a combat (special thx to…
Browse files Browse the repository at this point in the history
… lilianne.coeverden)
  • Loading branch information
gereon77 committed Feb 8, 2024
1 parent 52adbd9 commit 3cfa8c0
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 5 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions agot-bg-game-server/src/client/IngameComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ import { houseColorFilters } from "./houseColorFilters";
import LocalStorageService from "./utils/localStorageService";
import SimpleInfluenceIconComponent from "./game-state-panel/utils/SimpleInfluenceIconComponent";
import VolumeSliderComponent from "./utils/VolumeSliderComponent";
import { houseThemes } from "./utils/SfxManager";

interface ColumnOrders {
gameStateColumn: number;
Expand Down Expand Up @@ -219,6 +220,7 @@ export default class IngameComponent extends Component<IngameComponentProps> {
unitImages.set("stark", unitImages.get("bolton"));
houseIconImages.set("stark", houseIconImages.get("bolton"));
houseColorFilters.set("stark", houseColorFilters.get("bolton"));
houseThemes.set("stark", houseThemes.get("bolton"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export default class CombatComponent extends Component<GameStateComponentProps<C
this.props.mapControls.modifyUnitsOnMap.push(this.modifyUnitsOnMapCallback = () => this.modifyUnitsOnMap());
this.props.mapControls.modifyOrdersOnMap.push(this.modifyOrdersOnMapCallback = () => this.modifyOrdersOnMap());

this.props.gameClient.sfxManager.playCombatSound();
this.props.gameClient.sfxManager.playCombatSound(this.props.gameState.attacker.id);
}

componentWillUnmount(): void {
Expand Down
28 changes: 26 additions & 2 deletions agot-bg-game-server/src/client/utils/SfxManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@ import voteSound from "../../../public/sounds/vote-started.ogg";
import introSound from "../../../public/sounds/game-of-thrones-intro.ogg";
import combatSound from "../../../public/sounds/combat.ogg";

import baratheonTheme from "../../../public/sounds/house-themes/baratheon.ogg"
import lannisterrTheme from "../../../public/sounds/house-themes/lannister.ogg"
import starkTheme from "../../../public/sounds/house-themes/stark.ogg"
import martellTheme from "../../../public/sounds/house-themes/martell.ogg"
import greyjoyTheme from "../../../public/sounds/house-themes/greyjoy.ogg"
import tyrellTheme from "../../../public/sounds/house-themes/tyrell.ogg"
import arrynTheme from "../../../public/sounds/house-themes/arryn.ogg"
import targaryenTheme from "../../../public/sounds/house-themes/targaryen.ogg"

import BetterMap from "../../utils/BetterMap";

export const houseThemes = new BetterMap([
["baratheon", baratheonTheme],
["lannister", lannisterrTheme],
["stark", starkTheme],
["martell", martellTheme],
["greyjoy", greyjoyTheme],
["tyrell", tyrellTheme],
["arryn", arrynTheme],
["targaryen", targaryenTheme],
["bolton", starkTheme]
]);

const soundsForKnights = [
intenseHorseStallionNeighSound,
footmanYesMyLordSound,
Expand Down Expand Up @@ -184,12 +207,13 @@ class SfxManager {
this.playMusic(introSound, this.gameClient.musicVolume, false);
}

playCombatSound(): void {
playCombatSound(attackerId?: string): void {
if (this.gameClient.musicMuted) {
return;
}

this.playMusic(combatSound, this.gameClient.musicVolume, false);
const sound = attackerId ? houseThemes.tryGet(attackerId, combatSound) : combatSound;
this.playMusic(sound, this.gameClient.musicVolume, false);
}

playSoundWhenClickingMarchOrder(region: Region): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ <h3 class="card-title">What is Swords and Ravens?</h3>
<ul>
<li><b>Flutterbit</b> and <b>mmasztalerczuk</b> for their contributions to the codebase.</li>
<li><b>Tex</b> for hosting communication about the game on the AGOT:BG Discord.</li>
<li><a href="https://liliannecoeverden.com/" target="_blank"><b>Lilianne Coeverden</b></a> for creating unique house themes and generously contributing them to this project.
Special thanks to her! Visit her <a href="https://www.youtube.com/@lilianne.coeverden" target="_blank">YouTube channel</a> for more content.</li>
<li>
<b>OrangePeanut</b>, <b>Marco Martell</b>, <b>DerSeynmaster</b>, <b>obmit</b>, <b>DemonInside</b>, <b>Jason77</b>, <b>Master
Falcao</b> and others for play-testing the game during the open beta-test.
<b>DerSeynmaster</b>, <b>Jason77</b> and others for play-testing the game during the open beta-test.
</li>
</ul>
</p>
Expand Down

0 comments on commit 3cfa8c0

Please sign in to comment.