mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
[ci] auto-format
This commit is contained in:
parent
1668115069
commit
546a8d0a4a
5 changed files with 1138 additions and 1111 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# Ported to api 8 by brostos using baport.(https://github.com/bombsquad-community/baport)
|
||||
# ba_meta require api 8
|
||||
|
||||
#Copy pasted from ExplodoRun by Blitz,just edited Bots and map 😝
|
||||
# Copy pasted from ExplodoRun by Blitz,just edited Bots and map 😝
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
|
|
@ -19,20 +19,24 @@ if TYPE_CHECKING:
|
|||
from typing import Any, Type, Dict, List, Optional
|
||||
|
||||
## MoreMinigames.py support ##
|
||||
|
||||
|
||||
def ba_get_api_version():
|
||||
return 6
|
||||
|
||||
|
||||
def ba_get_levels():
|
||||
return [babase._level.Level(
|
||||
'Infinite Ninjas',gametype=InfiniteNinjasGame,
|
||||
'Infinite Ninjas', gametype=InfiniteNinjasGame,
|
||||
settings={},
|
||||
preview_texture_name = 'footballStadiumPreview'),
|
||||
preview_texture_name='footballStadiumPreview'),
|
||||
babase._level.Level(
|
||||
'Epic Infinite Ninjas',gametype=InfiniteNinjasGame,
|
||||
settings={'Epic Mode':True},
|
||||
preview_texture_name = 'footballStadiumPreview')]
|
||||
'Epic Infinite Ninjas', gametype=InfiniteNinjasGame,
|
||||
settings={'Epic Mode': True},
|
||||
preview_texture_name='footballStadiumPreview')]
|
||||
## MoreMinigames.py support ##
|
||||
|
||||
|
||||
class Player(bs.Player['Team']):
|
||||
"""Our player type for this game."""
|
||||
|
||||
|
|
@ -41,6 +45,8 @@ class Team(bs.Team[Player]):
|
|||
"""Our team type for this game."""
|
||||
|
||||
# ba_meta export bascenev1.GameActivity
|
||||
|
||||
|
||||
class InfiniteNinjasGame(bs.TeamGameActivity[Player, Team]):
|
||||
name = "Infinite Ninjas"
|
||||
description = "How long can you survive from Ninjas??"
|
||||
|
|
@ -49,8 +55,8 @@ class InfiniteNinjasGame(bs.TeamGameActivity[Player, Team]):
|
|||
scoretype=bs.ScoreType.MILLISECONDS,
|
||||
lower_is_better=False)
|
||||
default_music = bs.MusicType.TO_THE_DEATH
|
||||
|
||||
def __init__(self, settings:dict):
|
||||
|
||||
def __init__(self, settings: dict):
|
||||
settings['map'] = "Football Stadium"
|
||||
self._epic_mode = settings.get('Epic Mode', False)
|
||||
if self._epic_mode:
|
||||
|
|
@ -61,27 +67,28 @@ class InfiniteNinjasGame(bs.TeamGameActivity[Player, Team]):
|
|||
self._won = False
|
||||
self._bots = SpazBotSet()
|
||||
self.wave = 1
|
||||
|
||||
|
||||
def on_begin(self) -> None:
|
||||
super().on_begin()
|
||||
|
||||
|
||||
self._timer = OnScreenTimer()
|
||||
bs.timer(2.5, self._timer.start)
|
||||
|
||||
#Bots Hehe
|
||||
bs.timer(2.5,self.street)
|
||||
|
||||
# Bots Hehe
|
||||
bs.timer(2.5, self.street)
|
||||
|
||||
def street(self):
|
||||
for a in range(self.wave):
|
||||
p1 = random.choice([-5,-2.5,0,2.5,5])
|
||||
p3 = random.choice([-4.5,-4.14,-5,-3])
|
||||
time = random.choice([1,1.5,2.5,2])
|
||||
self._bots.spawn_bot(ChargerBot, pos=(p1,0.4,p3),spawn_time = time)
|
||||
p1 = random.choice([-5, -2.5, 0, 2.5, 5])
|
||||
p3 = random.choice([-4.5, -4.14, -5, -3])
|
||||
time = random.choice([1, 1.5, 2.5, 2])
|
||||
self._bots.spawn_bot(ChargerBot, pos=(p1, 0.4, p3), spawn_time=time)
|
||||
self.wave += 1
|
||||
|
||||
|
||||
def botrespawn(self):
|
||||
if not self._bots.have_living_bots():
|
||||
self.street()
|
||||
|
||||
def handlemessage(self, msg: Any) -> Any:
|
||||
|
||||
# A player has died.
|
||||
|
|
@ -89,7 +96,7 @@ class InfiniteNinjasGame(bs.TeamGameActivity[Player, Team]):
|
|||
super().handlemessage(msg) # Augment standard behavior.
|
||||
self._won = True
|
||||
self.end_game()
|
||||
|
||||
|
||||
# A spaz-bot has died.
|
||||
elif isinstance(msg, SpazBotDiedMessage):
|
||||
# Unfortunately the bot-set will always tell us there are living
|
||||
|
|
@ -130,5 +137,3 @@ class InfiniteNinjasGame(bs.TeamGameActivity[Player, Team]):
|
|||
|
||||
# Ends the activity.
|
||||
self.end(results)
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue