mirror of
https://github.com/Freaku17/BombSquad-Mods-byFreaku
synced 2025-10-19 20:20:40 +00:00
Rename & update arms_race.py to 1.7.37+ (API 9)
• Fixed a warning error getting on curse_time being less than zero.
This commit is contained in:
parent
1797a07115
commit
ffc325ee5d
1 changed files with 19 additions and 23 deletions
|
|
@ -1,11 +1,4 @@
|
|||
# Ported by your friend: Freaku
|
||||
|
||||
#Join BCS:
|
||||
# https://discord.gg/ucyaesh
|
||||
|
||||
|
||||
|
||||
# ba_meta require api 8
|
||||
# ba_meta require api 9
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
|
@ -13,11 +6,9 @@ from typing import TYPE_CHECKING
|
|||
|
||||
import babase
|
||||
import bascenev1 as bs
|
||||
from bascenev1lib.actor.playerspaz import PlayerSpaz
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any, Type, List, Dict, Tuple, Union, Sequence, Optional
|
||||
|
||||
from typing import Any, Type, List, Union, Sequence
|
||||
|
||||
|
||||
class State:
|
||||
|
|
@ -36,11 +27,14 @@ class State:
|
|||
def apply(self, spaz):
|
||||
spaz.disconnect_controls_from_player()
|
||||
spaz.connect_controls_to_player(enable_punch=self.punch,
|
||||
enable_bomb=self.bomb,
|
||||
enable_pickup=self.grab)
|
||||
enable_bomb=self.bomb,
|
||||
enable_pickup=self.grab)
|
||||
if self.curse:
|
||||
spaz.curse_time = -1
|
||||
spaz.curse()
|
||||
try:
|
||||
spaz.curse_time = -1
|
||||
spaz.curse()
|
||||
except:
|
||||
pass
|
||||
if self.bomb:
|
||||
spaz.bomb_type = self.bomb
|
||||
spaz.set_score_text(self.name)
|
||||
|
|
@ -49,16 +43,18 @@ class State:
|
|||
return (self.name)
|
||||
|
||||
|
||||
states = [ State(bomb='normal', name='Basic Bombs'),
|
||||
State(bomb='ice', name='Frozen Bombs'),
|
||||
State(bomb='sticky', name='Sticky Bombs'),
|
||||
State(bomb='impact', name='Impact Bombs'),
|
||||
State(grab=True, name='Grabbing only'),
|
||||
State(punch=True, name='Punching only'),
|
||||
State(curse=True, name='Cursed', final=True) ]
|
||||
states = [State(bomb='normal', name='Basic Bombs'),
|
||||
State(bomb='ice', name='Frozen Bombs'),
|
||||
State(bomb='sticky', name='Sticky Bombs'),
|
||||
State(bomb='impact', name='Impact Bombs'),
|
||||
State(grab=True, name='Grabbing only'),
|
||||
State(punch=True, name='Punching only'),
|
||||
State(curse=True, name='Cursed', final=True)]
|
||||
|
||||
|
||||
class Player(bs.Player['Team']):
|
||||
"""Our player type for this game."""
|
||||
|
||||
def __init__(self):
|
||||
self.state = None
|
||||
|
||||
|
|
@ -192,4 +188,4 @@ class ArmsRaceGame(bs.TeamGameActivity[Player, Team]):
|
|||
results = bs.GameResults()
|
||||
for team in self.teams:
|
||||
results.set_team_score(team, team.score)
|
||||
self.end(results=results)
|
||||
self.end(results=results)
|
||||
Loading…
Add table
Add a link
Reference in a new issue