mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-21 22:33:58 +08:00
Merge pull request #4 from Dmitry450/master
Fixed easter egg hunt and onslaught. Fixed impact bomb
This commit is contained in:
commit
85769a036d
@ -1157,7 +1157,9 @@ class CoopScoreScreen(ba.Activity):
|
||||
self._tournament_time_remaining = max(
|
||||
0, self._tournament_time_remaining - 1)
|
||||
if self._tournament_time_remaining_text is not None:
|
||||
val = ba.timestring(self._tournament_time_remaining, centi=False)
|
||||
val = ba.timestring(self._tournament_time_remaining,
|
||||
suppress_format_warning=True,
|
||||
centi=False)
|
||||
self._tournament_time_remaining_text.node.text = val
|
||||
|
||||
def _show_world_rank(self, offs_x: float) -> None:
|
||||
|
||||
@ -147,7 +147,7 @@ class EasterEggHuntGame(ba.TeamGameActivity):
|
||||
player = (spaz.getplayer()
|
||||
if hasattr(spaz, 'getplayer') else None)
|
||||
if player and egg:
|
||||
player.get_team().gamedata['score'] += 1
|
||||
player.team.gamedata['score'] += 1
|
||||
|
||||
# Displays a +1 (and adds to individual player score in
|
||||
# teams mode).
|
||||
@ -186,9 +186,13 @@ class EasterEggHuntGame(ba.TeamGameActivity):
|
||||
xpos = random.uniform(-7.1, 6.0)
|
||||
ypos = random.uniform(3.5, 3.5)
|
||||
zpos = random.uniform(-8.2, 3.7)
|
||||
def _is_exists(egg: Egg) -> bool:
|
||||
if egg.node is None:
|
||||
return False
|
||||
return egg.node.exists()
|
||||
|
||||
# Prune dead eggs from our list.
|
||||
self._eggs = [e for e in self._eggs if e]
|
||||
self._eggs = [e for e in self._eggs if _is_exists(e)]
|
||||
|
||||
# Spawn more eggs if we've got space.
|
||||
if len(self._eggs) < int(self._max_eggs):
|
||||
|
||||
@ -258,7 +258,7 @@ class OnslaughtGame(ba.CoopGameActivity):
|
||||
{'entries': [
|
||||
{'type': spazbot.BomberBotStaticLite,
|
||||
'point': 'turret_bottom_left'},
|
||||
{'type': spazbot.TriggerBot, 'point': 'Left'},
|
||||
{'type': spazbot.TriggerBot, 'point': 'left'},
|
||||
{'type': spazbot.TriggerBot, 'point': 'left_lower'}
|
||||
if player_count > 1 else None,
|
||||
{'type': spazbot.TriggerBot, 'point': 'left_upper'}
|
||||
@ -405,8 +405,8 @@ class OnslaughtGame(ba.CoopGameActivity):
|
||||
{'type': spazbot.ExplodeyBot, 'point': 'top_left'},
|
||||
]},
|
||||
{'entries': [
|
||||
{'type': spazbot.ChargerBot, 'point': 'Left'},
|
||||
{'type': spazbot.ChargerBot, 'point': 'Right'},
|
||||
{'type': spazbot.ChargerBot, 'point': 'left'},
|
||||
{'type': spazbot.ChargerBot, 'point': 'right'},
|
||||
{'type': spazbot.ChargerBot, 'point': 'right_upper_more'}
|
||||
if player_count > 2 else None,
|
||||
{'type': spazbot.BomberBotProStatic,
|
||||
@ -454,9 +454,9 @@ class OnslaughtGame(ba.CoopGameActivity):
|
||||
{'type': spazbot.BrawlerBotProShielded,
|
||||
'point': 'right_upper_more'},
|
||||
{'type': 'delay', 'duration': 4.0},
|
||||
{'type': spazbot.ExplodeyBot, 'point': 'Left'},
|
||||
{'type': spazbot.ExplodeyBot, 'point': 'left'},
|
||||
{'type': 'delay', 'duration': 5.0},
|
||||
{'type': spazbot.ExplodeyBot, 'point': 'Right'},
|
||||
{'type': spazbot.ExplodeyBot, 'point': 'right'},
|
||||
]},
|
||||
{'entries': [
|
||||
{'type': spazbot.BomberBotProStatic,
|
||||
|
||||
@ -1051,6 +1051,8 @@ class RunaroundGame(ba.CoopGameActivity):
|
||||
# Yup; that's a lot of return statements right there.
|
||||
# pylint: disable=too-many-return-statements
|
||||
assert bot.node
|
||||
if not bot.is_alive() or not bot.node.exists():
|
||||
return True
|
||||
|
||||
# FIXME: Do this in a type safe way.
|
||||
r_walk_speed: float = bot.r_walk_speed # type: ignore
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user