Skip to content

Commit

Permalink
changed from common.VOX to joustsettings.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
adangert committed Aug 25, 2019
1 parent cc27e1c commit baa4fdb
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 113 deletions.
6 changes: 2 additions & 4 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ def __str__(self):
'color_lock',
'color_lock_choices',
'red_on_kill',
'random_teams'
'random_teams',
'menu_voice',
]

VOX = 'ivy'
# VOX = 'aaron'
19 changes: 10 additions & 9 deletions games/commander.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def __init__(self, moves, command_queue, ns, music, dead_moves, commander_intro,

self.command_queue = command_queue
self.ns = ns
self.voice = self.ns.settings['menu_voice']

self.sensitivity = self.ns.settings['sensitivity']
self.random_teams = self.ns.settings['random_teams']
Expand Down Expand Up @@ -404,9 +405,9 @@ def end_game(self):
def end_game_sound(self, winning_team):
#if self.game_mode == common.Games.JoustTeams:
if winning_team == Team.alpha.value:
team_win = Audio('audio/Commander/vox/' + common.VOX + '/red winner.wav')
team_win = Audio('audio/Commander/vox/' + self.voice + '/red winner.wav')
if winning_team == Team.bravo.value:
team_win = Audio('audio/Commander/vox/' + common.VOX + '/blue winner.wav')
team_win = Audio('audio/Commander/vox/' + self.voice + '/blue winner.wav')
team_win.start_effect()

def check_commander_select(self):
Expand Down Expand Up @@ -446,26 +447,26 @@ def update_team_powers(self):
if self.powers[Team.alpha.value].value >= 1.0:
self.powers_active[Team.alpha.value] = True
Audio('audio/Commander/sounds/power ready.wav').start_effect()
Audio('audio/Commander/vox/' + common.VOX + '/red power ready.wav').start_effect()
Audio('audio/Commander/vox/' + self.voice + '/red power ready.wav').start_effect()


if self.powers_active[Team.bravo.value] == False:
if self.powers[Team.bravo.value].value >= 1.0:
self.powers_active[Team.bravo.value] = True
Audio('audio/Commander/sounds/power ready.wav').start_effect()
Audio('audio/Commander/vox/' + common.VOX + '/blue power ready.wav').start_effect()
Audio('audio/Commander/vox/' + self.voice + '/blue power ready.wav').start_effect()


def overdrive(self, team):
Audio('audio/Commander/sounds/overdrive.wav').start_effect()
if team == Team.alpha.value:
self.alpha_overdrive.value = 1
self.activated_overdrive[Team.alpha.value] = time.time() + 10
Audio('audio/Commander/vox/' + common.VOX + '/red overdrive.wav').start_effect()
Audio('audio/Commander/vox/' + self.voice + '/red overdrive.wav').start_effect()
else:
self.bravo_overdrive.value = 1
self.activated_overdrive[Team.bravo.value] = time.time() + 10
Audio('audio/Commander/vox/' + common.VOX + '/blue overdrive.wav').start_effect()
Audio('audio/Commander/vox/' + self.voice + '/blue overdrive.wav').start_effect()



Expand Down Expand Up @@ -503,7 +504,7 @@ def check_everyone_in(self):


def commander_intro_audio(self):
intro_sound = Audio('audio/Commander/vox/' + common.VOX + '/commander intro.wav')
intro_sound = Audio('audio/Commander/vox/' + self.voice + '/commander intro.wav')
intro_sound.start_effect()
#need while loop here
play_last_one = True
Expand All @@ -516,7 +517,7 @@ def commander_intro_audio(self):

if time.time() > battle_ready_time and play_last_one:
play_last_one = False
Audio('audio/Commander/vox/' + common.VOX + '/10 seconds begins.wav').start_effect()
Audio('audio/Commander/vox/' + self.voice + '/10 seconds begins.wav').start_effect()
intro_sound.stop_effect()

if self.current_commander[Team.alpha.value] == '':
Expand All @@ -525,7 +526,7 @@ def commander_intro_audio(self):
self.change_random_commander(Team.bravo.value)


Audio('audio/Commander/vox/' + common.VOX + '/commanders chosen.wav').start_effect_and_wait()
Audio('audio/Commander/vox/' + self.voice + '/commanders chosen.wav').start_effect_and_wait()
self.reset_power(Team.alpha.value)
self.reset_power(Team.bravo.value)
self.commander_intro.value = 0
Expand Down
16 changes: 9 additions & 7 deletions games/fight_club.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def __init__(self, moves, command_queue, ns, music, show_team_colors, music_spee

self.command_queue = command_queue
self.ns = ns

self.voice = self.ns.settings['menu_voice']

self.sensitivity = self.ns.settings['sensitivity']
self.play_audio = self.ns.settings['play_audio']
Expand Down Expand Up @@ -345,7 +347,7 @@ def alive_move_count(self):
#more than one tied winner, have them face off
def face_off(self):

Audio('audio/Fight_Club/vox/' + common.VOX + '/tie_game.wav').start_effect()
Audio('audio/Fight_Club/vox/' + self.voice + '/tie_game.wav').start_effect()
for move in self.move_serials:
self.dead_moves[move].value = 0
for move in self.winning_moves:
Expand Down Expand Up @@ -391,9 +393,9 @@ def check_end_game(self):
if self.round_counter >= self.round_num:
self.check_winner()
if self.round_counter == self.round_num - 5:
Audio('audio/Fight_Club/vox/' + common.VOX + '/5_rounds.wav').start_effect()
Audio('audio/Fight_Club/vox/' + self.voice + '/5_rounds.wav').start_effect()
if self.round_counter == self.round_num - 1:
Audio('audio/Fight_Club/vox/' + common.VOX + '/last_round.wav').start_effect()
Audio('audio/Fight_Club/vox/' + self.voice + '/last_round.wav').start_effect()


def stop_tracking_moves(self):
Expand All @@ -406,7 +408,7 @@ def end_game(self):
h_value = 0
for move in self.move_serials:
self.dead_moves[move].value = 0
Audio('audio/Fight_Club/vox/' + common.VOX + '/game_over.wav').start_effect()
Audio('audio/Fight_Club/vox/' + self.voice + '/game_over.wav').start_effect()
#os.popen('espeak -ven -p 70 -a 200 "winner"')

while (time.time() < end_time):
Expand Down Expand Up @@ -504,11 +506,11 @@ def reset_round_timer(self):
self.current_winner = self.chosen_defender
saying = random.randint(0,2)
if saying == 0:
Audio('audio/Fight_Club/vox/' + common.VOX + '/defender_lead.wav').start_effect()
Audio('audio/Fight_Club/vox/' + self.voice + '/defender_lead.wav').start_effect()
elif saying == 1:
Audio('audio/Fight_Club/vox/' + common.VOX + '/defender_winning.wav').start_effect()
Audio('audio/Fight_Club/vox/' + self.voice + '/defender_winning.wav').start_effect()
elif saying == 2:
Audio('audio/Fight_Club/vox/' + common.VOX + '/Defender_high_score.wav').start_effect()
Audio('audio/Fight_Club/vox/' + self.voice + '/Defender_high_score.wav').start_effect()
self.check_end_game()


Expand Down
10 changes: 6 additions & 4 deletions games/speed_bomb.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def __init__(self, moves, command_queue, ns, music, bomb_color, game_start, five

self.command_queue = command_queue
self.ns = ns

self.voice = self.ns.settings['menu_voice']

self.play_audio = self.ns.settings['play_audio']
self.move_serials = moves
Expand Down Expand Up @@ -211,11 +213,11 @@ def __init__(self, moves, command_queue, ns, music, bomb_color, game_start, five
self.start_beep = Audio('audio/Joust/sounds/start.wav')
self.start_game = Audio('audio/Joust/sounds/start3.wav')
self.explosion = Audio('audio/Joust/sounds/Explosion34.wav')
self.fakedout = Audio('audio/Joust/vox/' + common.VOX + '/Fakedout.wav')
self.fakedout = Audio('audio/Joust/vox/' + self.voice + '/Fakedout.wav')
self.explosion40 = Audio('audio/Joust/sounds/Explosion40.wav')
self.countered = Audio('audio/Joust/vox/' + common.VOX + '/countered.wav')
self.Fakecountered = Audio('audio/Joust/vox/' + common.VOX + '/FakedoutCounter.wav')
self.explosiondeath = Audio('audio/Joust/vox/' + common.VOX + '/explosiondeath.wav')
self.countered = Audio('audio/Joust/vox/' + self.voice + '/countered.wav')
self.Fakecountered = Audio('audio/Joust/vox/' + self.voice + '/FakedoutCounter.wav')
self.explosiondeath = Audio('audio/Joust/vox/' + self.voice + '/explosiondeath.wav')

end = False
try:
Expand Down
24 changes: 12 additions & 12 deletions games/swapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def __init__(self, moves, command_queue, ns, music, controller_colors, dead_move

self.command_queue = command_queue
self.ns = ns

self.voice = self.ns.settings['menu_voice']
#save locally in case settings change from web
self.play_audio = self.ns.settings['play_audio']
self.sensitivity = self.ns.settings['sensitivity']
Expand Down Expand Up @@ -333,30 +333,30 @@ def end_game(self):
def end_game_sound(self, winning_team):
win_team_name = self.team_colors[winning_team].name
if win_team_name == 'Pink':
if common.VOX == 'aaron':
if self.voice == 'aaron':
os.popen('espeak -ven -p 70 -a 200 "And the winner is ...Pink Team')
else:
team_win = Audio('audio/Joust/vox/' + common.VOX + '/pink team win.wav')
team_win = Audio('audio/Joust/vox/' + self.voice + '/pink team win.wav')
if win_team_name == 'Magenta':
team_win = Audio('audio/Joust/vox/' + common.VOX + '/magenta team win.wav')
team_win = Audio('audio/Joust/vox/' + self.voice + '/magenta team win.wav')
if win_team_name == 'Orange':
if common.VOX == 'aaron':
if self.voice == 'aaron':
os.popen('espeak -ven -p 70 -a 200 "And the winner is ...Orange Team')
else:
team_win = Audio('audio/Joust/vox/' + common.VOX + '/orange team win.wav')
team_win = Audio('audio/Joust/vox/' + self.voice + '/orange team win.wav')
if win_team_name == 'Yellow':
team_win = Audio('audio/Joust/vox/' + common.VOX + '/yellow team win.wav')
team_win = Audio('audio/Joust/vox/' + self.voice + '/yellow team win.wav')
if win_team_name == 'Green':
team_win = Audio('audio/Joust/vox/' + common.VOX + '/green team win.wav')
team_win = Audio('audio/Joust/vox/' + self.voice + '/green team win.wav')
if win_team_name == 'Turquoise':
team_win = Audio('audio/Joust/vox/' + common.VOX + '/cyan team win.wav')
team_win = Audio('audio/Joust/vox/' + self.voice + '/cyan team win.wav')
if win_team_name == 'Blue':
team_win = Audio('audio/Joust/vox/' + common.VOX + '/blue team win.wav')
team_win = Audio('audio/Joust/vox/' + self.voice + '/blue team win.wav')
if win_team_name == 'Purple':
if common.VOX == 'aaron':
if self.voice == 'aaron':
os.popen('espeak -ven -p 70 -a 200 "And the winner is ...Purple Team')
else:
team_win = Audio('audio/Joust/vox/' + common.VOX + '/purple team win.wav')
team_win = Audio('audio/Joust/vox/' + self.voice + '/purple team win.wav')
team_win.start_effect()

def game_loop(self):
Expand Down
18 changes: 9 additions & 9 deletions games/zombie.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def __init__(self, cont_alive, command_queue, ns, music,restart, zombie_opts):

self.command_queue = command_queue
self.ns = ns

self.voice = self.ns.settings['menu_voice']
self.sensitivity = self.ns.settings['sensitivity']
self.play_audio = self.ns.settings['play_audio']

Expand Down Expand Up @@ -258,19 +258,19 @@ def reward(self, random_bullet_chance):

def audio_cue(self):
if self.win_time - (time.time() - self.start_time) <= 10 and self.effect_cue <= 4:
Audio('audio/Zombie/vox/' + common.VOX + '/10 seconds left.wav').start_effect()
Audio('audio/Zombie/vox/' + self.voice + '/10 seconds left.wav').start_effect()
self.effect_cue = 5
elif self.win_time - (time.time() - self.start_time) <= 30 and self.effect_cue <= 3:
Audio('audio/Zombie/vox/' + common.VOX + '/30 seconds.wav').start_effect()
Audio('audio/Zombie/vox/' + self.voice + '/30 seconds.wav').start_effect()
self.effect_cue = 4
elif self.win_time - (time.time() - self.start_time) <= 1*60 and self.effect_cue <= 2:
Audio('audio/Zombie/vox/' + common.VOX + '/1 minute.wav').start_effect()
Audio('audio/Zombie/vox/' + self.voice + '/1 minute.wav').start_effect()
self.effect_cue = 3
elif self.win_time - (time.time() - self.start_time) <= 3*60 and self.effect_cue <= 1:
Audio('audio/Zombie/vox/' + common.VOX + '/3 minutes.wav').start_effect()
Audio('audio/Zombie/vox/' + self.voice + '/3 minutes.wav').start_effect()
self.effect_cue = 2
#elif self.win_time - (time.time() - self.start_time) <= 5*60 and self.effect_cue <= 0:
# Audio('audio/Zombie/vox/' + common.VOX + '/5 minutes.wav').start_effect()
# Audio('audio/Zombie/vox/' + self.voice + '/5 minutes.wav').start_effect()
# self.effect_cue = 1


Expand Down Expand Up @@ -298,9 +298,9 @@ def Start(self):
self.restart.value = 0
print("started the controllers")
if self.play_audio:
human_victory = Audio('audio/Zombie/vox/' + common.VOX + '/human_victory.wav')
zombie_victory = Audio('audio/Zombie/vox/' + common.VOX + '/zombie_victory.wav')
death = Audio('audio/Zombie/vox/' + common.VOX + '/zombie_death.wav')
human_victory = Audio('audio/Zombie/vox/' + self.voice + '/human_victory.wav')
zombie_victory = Audio('audio/Zombie/vox/' + self.voice + '/zombie_victory.wav')
death = Audio('audio/Zombie/vox/' + self.voice + '/zombie_death.wav')
pistol = Audio('audio/Zombie/sounds/pistol.wav')
shotgun = Audio('audio/Zombie/sounds/shotgun.wav')
molotov = Audio('audio/Zombie/sounds/molotov.wav')
Expand Down
Loading

0 comments on commit baa4fdb

Please sign in to comment.