Update my minigames for 1.7.37+ (API 9)

arms_race:
• Fixed a warning error getting on curse_time being less than zero.
This commit is contained in:
! Freaku 2025-02-08 16:53:59 +05:30 committed by GitHub
parent 7fa1149944
commit ca8fcd8c22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 28 additions and 19 deletions

View file

@ -1,3 +1,10 @@
# Ported by your friend: Freaku
#Join BCS:
# https://discord.gg/ucyaesh
# ba_meta require api 9 # ba_meta require api 9
from __future__ import annotations from __future__ import annotations
@ -30,8 +37,11 @@ class State:
enable_bomb=self.bomb, enable_bomb=self.bomb,
enable_pickup=self.grab) enable_pickup=self.grab)
if self.curse: if self.curse:
spaz.curse_time = -1 try:
spaz.curse() spaz.curse_time = -1
spaz.curse()
except:
pass
if self.bomb: if self.bomb:
spaz.bomb_type = self.bomb spaz.bomb_type = self.bomb
spaz.set_score_text(self.name) spaz.set_score_text(self.name)

View file

@ -6,7 +6,7 @@ import bascenev1 as bs
from bascenev1lib.game.chosenone import Player, ChosenOneGame from bascenev1lib.game.chosenone import Player, ChosenOneGame
# ba_meta require api 8 # ba_meta require api 9
# ba_meta export bascenev1.GameActivity # ba_meta export bascenev1.GameActivity
class FrozenOneGame(ChosenOneGame): class FrozenOneGame(ChosenOneGame):
name = 'Frozen One' name = 'Frozen One'

View file

@ -2,20 +2,19 @@
import babase import babase
import bascenev1 as bs import bascenev1 as bs, random
import random
from bascenev1lib.actor.bomb import Bomb from bascenev1lib.actor.bomb import Bomb
from bascenev1lib.game.meteorshower import Player, MeteorShowerGame from bascenev1lib.game.meteorshower import Player, MeteorShowerGame
# ba_meta require api 8 # ba_meta require api 9
# ba_meta export bascenev1.GameActivity # ba_meta export bascenev1.GameActivity
class IcyEmitsGame(MeteorShowerGame): class IcyEmitsGame(MeteorShowerGame):
name = 'Icy Emits' name = 'Icy Emits'
@classmethod @classmethod
def get_supported_maps(cls, sessiontype): def get_supported_maps(cls, sessiontype):
return ['Lake Frigid', 'Hockey Stadium'] return ['Lake Frigid','Hockey Stadium']
def _drop_bomb_cluster(self) -> None: def _drop_bomb_cluster(self) -> None:
delay = 0.0 delay = 0.0
@ -25,24 +24,23 @@ class IcyEmitsGame(MeteorShowerGame):
pos = (-7.3 + 15.3 * random.random(), 5.3, pos = (-7.3 + 15.3 * random.random(), 5.3,
-5.5 + 2.1 * random.random()) -5.5 + 2.1 * random.random())
dropdir = (-1.0 if pos[0] > 0 else 1.0) dropdir = (-1.0 if pos[0] > 0 else 1.0)
vel = (0, 10, 0) vel = (0,10,0)
bs.timer(delay, babase.Call(self._drop_bomb, pos, vel)) bs.timer(delay, babase.Call(self._drop_bomb, pos, vel))
delay += 0.1 delay += 0.1
self._set_meteor_timer() self._set_meteor_timer()
def _drop_bomb(self, position, velocity): def _drop_bomb(self, position, velocity):
random_xpositions = [-10, -9, -8, -7, -6, -5, - random_xpositions = [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10]
4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] random_zpositions = [-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5]
random_zpositions = [-5, -4.5, -4, -3.5, -3, -2.5, -2, - bomb_position = (random.choice(random_xpositions), 0.2,random.choice(random_zpositions))
1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5] Bomb(position=bomb_position, velocity=velocity, bomb_type = 'ice').autoretain()
bomb_position = (random.choice(random_xpositions), 0.2, random.choice(random_zpositions))
Bomb(position=bomb_position, velocity=velocity, bomb_type='ice').autoretain()
# ba_meta export plugin # ba_meta export plugin
class byFreaku(babase.Plugin): class byFreaku(babase.Plugin):
def __init__(self): def __init__(self):
## Campaign support ## ## Campaign support ##
randomPic = ['lakeFrigidPreview', 'hockeyStadiumPreview'] randomPic = ['lakeFrigidPreview','hockeyStadiumPreview']
babase.app.classic.add_coop_practice_level(bs.Level( babase.app.classic.add_coop_practice_level(bs.Level(name='Icy Emits', displayname='${GAME}', gametype=IcyEmitsGame, settings={}, preview_texture_name=random.choice(randomPic)))
name='Icy Emits', displayname='${GAME}', gametype=IcyEmitsGame, settings={}, preview_texture_name=random.choice(randomPic)))

View file

@ -16,7 +16,7 @@ from __future__ import annotations
# def spawnAllMap(self) # def spawnAllMap(self)
# ba_meta require api 8 # ba_meta require api 9
from typing import TYPE_CHECKING, overload from typing import TYPE_CHECKING, overload
import _babase import _babase
import babase import babase
@ -27,6 +27,7 @@ if TYPE_CHECKING:
from typing import Any, Sequence, Optional, List, Dict, Type, Union, Any, Literal from typing import Any, Sequence, Optional, List, Dict, Type, Union, Any, Literal
class OnTimer(bs.Actor): class OnTimer(bs.Actor):
"""Timer which counts but doesn't show on-screen""" """Timer which counts but doesn't show on-screen"""

View file

@ -31,7 +31,7 @@ class Team(bs.Team[Player]):
self.score = 0 self.score = 0
# ba_meta require api 8 # ba_meta require api 9
# ba_meta export bascenev1.GameActivity # ba_meta export bascenev1.GameActivity
class MFGame(bs.TeamGameActivity[Player, Team]): class MFGame(bs.TeamGameActivity[Player, Team]):
name = 'Musical Flags' name = 'Musical Flags'