Merge pull request #4 from Dmitry450/master

Fixed easter egg hunt and onslaught. Fixed impact bomb
This commit is contained in:
Eric Froemling 2020-04-07 12:01:28 -07:00 committed by GitHub
commit 85769a036d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 8 deletions

View File

@ -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:

View File

@ -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):

View File

@ -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,

View File

@ -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