diff --git a/controller_process.py b/controller_process.py index 994f8f63..916a4e5c 100644 --- a/controller_process.py +++ b/controller_process.py @@ -4,7 +4,7 @@ def main_track_move(menu, restart, move_serial, move_num, move_opts, force_color, battery, dead_count, game_mode, \ team, team_color_enum, controller_sensitivity, dead_move, music_speed, werewolf_reveal, show_team_colors, red_on_kill, zombie_opt,\ commander_intro, commander_move_opt, commander_powers, commander_overdrive,five_controller_opt, swapper_team_colors,\ - invincibility, fight_club_color, num_teams,bomb_color,game_start,false_color, faked, rumble, kill_proc): + invincibility, fight_club_color, num_teams,bomb_color,game_start,false_color, faked, rumble, dead_invince, kill_proc): print("starting Controller Process") move = common.get_move(move_serial, move_num) @@ -30,5 +30,5 @@ def main_track_move(menu, restart, move_serial, move_num, move_opts, force_color speed_bomb.track_move(move, dead_move, force_color,bomb_color, five_controller_opt, game_start, false_color, faked, rumble, menu, restart) else: joust.track_move(move, game_mode.value, team.value, team_color_enum, dead_move, force_color, \ - music_speed, werewolf_reveal, show_team_colors, red_on_kill, restart, menu, controller_sensitivity) + music_speed, werewolf_reveal, show_team_colors, red_on_kill, restart, menu, controller_sensitivity, dead_invince) diff --git a/joust.py b/joust.py index 3f181bca..adb86ab4 100644 --- a/joust.py +++ b/joust.py @@ -51,7 +51,7 @@ def track_move(move, game_mode, team, team_color_enum, dead_move, force_color, \ - music_speed, werewolf_reveal, show_team_colors, red_on_kill, restart, menu, controller_sensitivity): + music_speed, werewolf_reveal, show_team_colors, red_on_kill, restart, menu, controller_sensitivity, dead_invince): SLOW_MAX = controller_sensitivity[0] SLOW_WARNING = controller_sensitivity[1] @@ -63,6 +63,8 @@ def track_move(move, game_mode, team, team_color_enum, dead_move, force_color, \ WERE_FAST_MAX = controller_sensitivity[6] WERE_FAST_WARNING = controller_sensitivity[7] + dead_invince.value = False + start = False no_rumble = time.time() + 2 move_last_value = None @@ -153,15 +155,19 @@ def track_move(move, game_mode, team, team_color_enum, dead_move, force_color, \ move.set_leds(*my_team_colors) #move.set_rumble(0) - - if change > threshold: + + if change > threshold and not dead_invince.value: if time.time() > no_rumble: + dead_invince.value = True if red_on_kill: move.set_leds(*colors.Colors.Red.value) else: move.set_leds(*colors.Colors.Black.value) move.set_rumble(90) dead_move.value = 0 + move.update_leds() + time.sleep(0.75) + dead_invince.value = False elif change > warning and not vibrate: if time.time() > no_rumble: diff --git a/piparty.py b/piparty.py index 7e43d98f..8fce29a9 100644 --- a/piparty.py +++ b/piparty.py @@ -300,6 +300,7 @@ def __init__(self): self.rumble = {} self.kill_controller_proc = {} self.controller_sensitivity = Array('d', [0] *10) + self.dead_invince = Value('b', False) self.i = 0 #load audio now so it converts before the game begins @@ -401,7 +402,7 @@ def pair_move(self, move, move_num): self.music_speed, self.werewolf_reveal, self.show_team_colors, self.red_on_kill,zombie_opt,\ self.commander_intro, commander_move_opt, self.commander_powers, self.commander_overdrive,\ five_controller_opt, self.swapper_team_colors, invincibility, fight_club_color, self.num_teams,\ - self.bomb_color,self.game_start,false_color, faked, rumble, kill_proc)) + self.bomb_color,self.game_start,false_color, faked, rumble, self.dead_invince, kill_proc)) proc.start() self.move_opts[move_serial] = opts