Skip to content
Permalink
Browse files

changed from common.VOX to joustsettings.yaml

  • Loading branch information...
adangert committed Aug 25, 2019
1 parent cc27e1c commit baa4fdb9183dfd642f052f6bf30d1c86a23febbd
Showing with 119 additions and 113 deletions.
  1. +2 −4 common.py
  2. +10 −9 games/commander.py
  3. +9 −7 games/fight_club.py
  4. +6 −4 games/speed_bomb.py
  5. +12 −12 games/swapper.py
  6. +9 −9 games/zombie.py
  7. +21 −21 joust.py
  8. +43 −40 piparty.py
  9. +7 −7 update.py
@@ -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'
@@ -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']
@@ -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):
@@ -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()



@@ -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
@@ -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] == '':
@@ -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
@@ -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']
@@ -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:
@@ -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):
@@ -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):
@@ -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()


@@ -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
@@ -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:
@@ -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']
@@ -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):
@@ -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']

@@ -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


@@ -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')

0 comments on commit baa4fdb

Please sign in to comment.
You can’t perform that action at this time.