# Released under the MIT License. See LICENSE for details. # """ game: Frozen One description: This game is basically Chosen One but instead of getting gloves and sheild, you become frozen and vulnerable. author: levyfellow tested on: 1.7 """ # ba_meta require api 7 from __future__ import annotations from typing import TYPE_CHECKING import ba from bastd.game.chosenone import ChosenOneGame, Player, Team if TYPE_CHECKING: from typing import Optional # ba_meta export game class FrozenOneGame(ChosenOneGame): """Game of Frozen One""" name = 'Frozen One' description = ('Be the Frozen One for a length of time to win.\n' 'Kill the Frozen one to become it.') available_settings = [ ba.IntSetting( 'Frozen One Time', min_value=10, default=30, increment=10, ), ba.IntChoiceSetting( 'Time Limit', choices=[ ('None', 0), ('1 Minute', 60), ('2 Minutes', 120), ('5 Minutes', 300), ('10 Minutes', 600), ('20 Minutes', 1200), ], default=0, ), ba.FloatChoiceSetting( 'Respawn Times', choices=[ ('Shorter', 0.25), ('Short', 0.5), ('Normal', 1.0), ('Long', 2.0), ('Longer', 4.0), ], default=1.0, ), ba.BoolSetting('Epic Mode', default=False), ] def __init__(self, settings: dict): # fix settings required for the Chosen One game we're modding settings['Chosen One Time'] = settings['Frozen One Time'] settings['Chosen One Gets Shield'] = False settings['Chosen One Gets Gloves'] = False # run the init for a Chosen One game super().__init__(settings) def _set_chosen_one_player(self, player: Optional[Player]) -> None: # This function runs when a player becomes the chosen (or in our case # frozen) one. We'll first run the normal chosen one function, then add # code to freeze the player super()._set_chosen_one_player(player) # Freeze the player if player and player.actor: player.actor.frozen = True player.actor.node.frozen = True