Skip to content
Permalink
Browse files

made fight club less aggressive, bug fixes

  • Loading branch information...
adangert committed Jan 5, 2018
1 parent 802cfed commit 20456033a83d448ba1afa15ebfc91326332f0c1d
Showing with 46 additions and 21 deletions.
  1. +18 −4 games/fight_club.py
  2. +28 −17 joust.py
@@ -212,17 +212,23 @@ def __init__(self, moves, command_queue, ns, music):
self.chosen_defender = self.fighter_list.pop()
self.chosen_fighter = self.fighter_list.pop()

self.round_num = len(self.move_serials)*3
self.round_counter = 0
self.round_num = len(self.move_serials)*2

#-1 because we reset at the beginning of the game
self.round_counter = -1

self.round_time = time.time()
self.round_limit = 16
self.round_limit = 22
self.score = {}
self.add_initial_score()
self.timer_beep = 4
self.high_score = 1
self.current_winner = ""

self.revive_noise = True
#just for the sound effects
self.revive_time = time.time() + 4

self.colors = {}


@@ -234,6 +240,7 @@ def __init__(self, moves, command_queue, ns, music):
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.revive = Audio('audio/Commander/sounds/revive.wav')

end = False
self.audio = music
@@ -341,9 +348,13 @@ def check_music_speed(self):

def check_end_round(self):
if self.play_audio:
if time.time() > self.round_time - (2.3 * (self.timer_beep/4)):
if time.time() > self.round_time - (3 * (self.timer_beep/4)):
self.loud_beep.start_effect()
self.timer_beep -= 1
if time.time() > self.revive_time and self.revive_noise:
self.revive_noise = False
self.revive.start_effect()



if time.time() > self.round_time:
@@ -522,6 +533,9 @@ def set_highest_score_color(self):


def reset_round_timer(self):
self.revive_time = time.time() + 4
self.revive_noise = True

self.round_counter += 1
self.round_time = time.time() + self.round_limit
self.timer_beep = 4
@@ -324,6 +324,8 @@ def generate_random_teams(self, num_teams):
random_choice = random.choice(team_pick)
if self.game_mode == common.Games.Traitor and traitor_pick:
self.teams[serial] = (random_choice * -1) - 1
#Turn this off for 3 traitors vs 1
traitor_pick = False
else:
self.teams[serial] = random_choice
## print("doing random choice")
@@ -528,23 +530,32 @@ def end_game_sound(self, winning_team):
team_win.start_effect()
elif self.game_mode != common.Games.JoustFFA and self.game_mode != common.Games.NonStop:
win_team_name = self.team_colors[winning_team].name
if win_team_name == 'Pink':
team_win = Audio('audio/Joust/sounds/human win.wav')
if win_team_name == 'Magenta':
team_win = Audio('audio/Joust/sounds/magenta team win.wav')
if win_team_name == 'Orange':
team_win = Audio('audio/Joust/sounds/human win.wav')
if win_team_name == 'Yellow':
team_win = Audio('audio/Joust/sounds/yellow team win.wav')
if win_team_name == 'Green':
team_win = Audio('audio/Joust/sounds/green team win.wav')
if win_team_name == 'Turquoise':
team_win = Audio('audio/Joust/sounds/cyan team win.wav')
if win_team_name == 'Blue':
team_win = Audio('audio/Joust/sounds/blue team win.wav')
if win_team_name == 'Purple':
team_win = Audio('audio/Joust/sounds/human win.wav')
team_win.start_effect()
if winning_team == -1:
team_win = Audio('audio/Joust/sounds/traitor win.wav')
else:
if win_team_name == 'Pink':
os.popen('espeak -ven -p 70 -a 200 "And the winner is ...Pink Team')
#team_win = Audio('audio/Joust/sounds/human win.wav')
if win_team_name == 'Magenta':
team_win = Audio('audio/Joust/sounds/magenta team win.wav')
if win_team_name == 'Orange':
os.popen('espeak -ven -p 70 -a 200 "And the winner is ... Orange team"')
#team_win = Audio('audio/Joust/sounds/human win.wav')
if win_team_name == 'Yellow':
team_win = Audio('audio/Joust/sounds/yellow team win.wav')
if win_team_name == 'Green':
team_win = Audio('audio/Joust/sounds/green team win.wav')
if win_team_name == 'Turquoise':
team_win = Audio('audio/Joust/sounds/cyan team win.wav')
if win_team_name == 'Blue':
team_win = Audio('audio/Joust/sounds/blue team win.wav')
if win_team_name == 'Purple':
os.popen('espeak -ven -p 70 -a 200 "And the winner is ... Purple team"')
#team_win = Audio('audio/Joust/sounds/human win.wav')
try:
team_win.start_effect()
except:
pass

def werewolf_intro(self):
#don't wait so colors change during prompts

0 comments on commit 2045603

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