Merge pull request #119 from Guggs0408/Guggs0408-patch-1

Fix: Correct Bomb init arguments and animate_array parameter in elPat…
This commit is contained in:
Ayush Saini 2025-06-19 21:57:31 +05:30 committed by GitHub
commit 2ddb00383c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,8 @@ from bascenev1lib.mainmenu import (MainMenuActivity, MainMenuSession)
from bascenev1lib.actor.popuptext import PopupText from bascenev1lib.actor.popuptext import PopupText
from bauiv1lib.confirm import ConfirmWindow from bauiv1lib.confirm import ConfirmWindow
from bascenev1lib.actor.spaz import * from bascenev1lib.actor.spaz import *
from bascenev1lib.actor.bomb import BombFactory
if TYPE_CHECKING: if TYPE_CHECKING:
pass pass
@ -38,9 +40,9 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"English": "Powerups", "English": "Powerups",
"Portuguese": "Powerups"}, "Portuguese": "Powerups"},
"Action 2": "Action 2":
{"Spanish": "Configuración", {"Spanish": "Configuración",
"English": "Settings", "English": "Settings",
"Portuguese": "Definições"}, "Portuguese": "Definições"},
"Action 3": "Action 3":
{"Spanish": "Extras", {"Spanish": "Extras",
"English": "Extras", "English": "Extras",
@ -50,9 +52,9 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"English": "Store", "English": "Store",
"Portuguese": "Loja"}, "Portuguese": "Loja"},
"Action 5": "Action 5":
{"Spanish": "Canjear código", {"Spanish": "Canjear código",
"English": "Enter Code", "English": "Enter Code",
"Portuguese": "³digo promocional"}, "Portuguese": "ƒÂ³digo promocional"},
"Custom": "Custom":
{"Spanish": "", {"Spanish": "",
"English": "Customize", "English": "Customize",
@ -78,25 +80,25 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"English": "Expansive bombs", "English": "Expansive bombs",
"Portuguese": "Bombas expansivas"}, "Portuguese": "Bombas expansivas"},
"Goodbye": "Goodbye":
{"Spanish": "¡Hasta luego!", {"Spanish": "¡Hasta luego!",
"English": "Goodbye!", "English": "Goodbye!",
"Portuguese": "Adeus!"}, "Portuguese": "Adeus!"},
"Healing Damage": "Healing Damage":
{"Spanish": "Auto-curación", {"Spanish": "Auto-curación",
"English": "Healing Damage", "English": "Healing Damage",
"Portuguese": "Auto-cura"}, "Portuguese": "Auto-cura"},
"Tank Shield": "Tank Shield":
{"Spanish": "ºper blindaje", {"Spanish": "ƒÂºper blindaje",
"English": "Reinforced shield", "English": "Reinforced shield",
"Portuguese": "Escudo reforçado"}, "Portuguese": "Escudo reforçado"},
"Tank Shield PTG": "Tank Shield PTG":
{"Spanish": "Porcentaje de disminución", {"Spanish": "Porcentaje de disminución",
"English": "Percentage decreased", "English": "Percentage decreased",
"Portuguese": "Percentual reduzido"}, "Portuguese": "Percentual reduzido"},
"Healing Damage PTG": "Healing Damage PTG":
{"Spanish": "Porcentaje de recuperación de salud", {"Spanish": "Porcentaje de recuperación de salud",
"English": "Percentage of health recovered", "English": "Percentage of health recovered",
"Portuguese": "Porcentagem de recuperação de saúde"}, "Portuguese": "Porcentagem de recuperação de saúde"},
"SY: BALL": "SY: BALL":
{"Spanish": "Esfera", {"Spanish": "Esfera",
"English": "Sphere", "English": "Sphere",
@ -110,7 +112,7 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"English": "Egg shape", "English": "Egg shape",
"Portuguese": "Ovo"}, "Portuguese": "Ovo"},
"Powerup Scale": "Powerup Scale":
{"Spanish": "Tamaño del potenciador", {"Spanish": "Tamaño del potenciador",
"English": "Powerups size", "English": "Powerups size",
"Portuguese": "Tamanho de powerups"}, "Portuguese": "Tamanho de powerups"},
"Powerup With Shield": "Powerup With Shield":
@ -120,7 +122,7 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"Powerup Time": "Powerup Time":
{"Spanish": "Mostrar Temporizador", {"Spanish": "Mostrar Temporizador",
"English": "Show end time", "English": "Show end time",
"Portuguese": "Mostrar cronômetro"}, "Portuguese": "Mostrar cronômetro"},
"Powerup Style": "Powerup Style":
{"Spanish": "Forma de los potenciadores", {"Spanish": "Forma de los potenciadores",
"English": "Shape of powerup", "English": "Shape of powerup",
@ -134,7 +136,7 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"English": "Show percentage", "English": "Show percentage",
"Portuguese": "Mostrar porcentagem"}, "Portuguese": "Mostrar porcentagem"},
"Only Items": "Only Items":
{"Spanish": "³lo Accesorios", {"Spanish": "ƒÂ³lo Accesorios",
"English": "Only utensils", "English": "Only utensils",
"Portuguese": "Apenas utensilios"}, "Portuguese": "Apenas utensilios"},
"New": "New":
@ -142,7 +144,7 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"English": "New", "English": "New",
"Portuguese": "Novo"}, "Portuguese": "Novo"},
"Only Bombs": "Only Bombs":
{"Spanish": "³lo Bombas", {"Spanish": "ƒÂ³lo Bombas",
"English": "Only bombs", "English": "Only bombs",
"Portuguese": "Apenas bombas"}, "Portuguese": "Apenas bombas"},
"Coins 0": "Coins 0":
@ -154,7 +156,7 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"English": "Successful purchase", "English": "Successful purchase",
"Portuguese": "Compra Bem Sucedida"}, "Portuguese": "Compra Bem Sucedida"},
"Double Product": "Double Product":
{"Spanish": "Ya has comprado este artículo", {"Spanish": "Ya has comprado este artículo",
"English": "You've already bought this", "English": "You've already bought this",
"Portuguese": "Voce ja comprou isto"}, "Portuguese": "Voce ja comprou isto"},
"Bought": "Bought":
@ -163,13 +165,13 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"Portuguese": "Comprou"}, "Portuguese": "Comprou"},
"Confirm Purchase": "Confirm Purchase":
{ {
"Spanish": f'Tienes {subs} monedas. {_sp_} ¿Deseas comprar esto?', "Spanish": f'Tienes {subs} monedas. {_sp_} ¿Deseas comprar esto?',
"English": f'You have {subs} coins. {_sp_} Do you want to buy this?', "English": f'You have {subs} coins. {_sp_} Do you want to buy this?',
"Portuguese": f'Você tem {subs} moedas. {_sp_} Deseja comprar isto?'}, "Portuguese": f'Você tem {subs} moedas. {_sp_} Deseja comprar isto?'},
"FireBombs Store": "FireBombs Store":
{"Spanish": 'Bombas de fuego', {"Spanish": 'Bombas de fuego',
"English": 'Fire bombs', "English": 'Fire bombs',
"Portuguese": 'Bombas de incêndio'}, "Portuguese": 'Bombas de incêndio'},
"Timer Store": "Timer Store":
{"Spanish": 'Temporizador', {"Spanish": 'Temporizador',
"English": 'Timer', "English": 'Timer',
@ -180,43 +182,43 @@ def getlanguage(text, subs: str = None, almacen: list = []):
"Portuguese": 'Extras'}, "Portuguese": 'Extras'},
"Block Option Store": "Block Option Store":
{ {
"Spanish": f"Uuups..{_sp_}Esta opción está bloqueada.{_sp_} Para acceder a ella puedes {_sp_} comprarla en la tienda.{_sp_} Gracias...", "Spanish": f"Uuups..{_sp_}Esta opción está bloqueada.{_sp_} Para acceder a ella puedes {_sp_} comprarla en la tienda.{_sp_} Gracias...",
"English": f"Oooops...{_sp_}This option is blocked. {_sp_} To access it you can buy {_sp_} it in the store.{_sp_} Thank you...", "English": f"Oooops...{_sp_}This option is blocked. {_sp_} To access it you can buy {_sp_} it in the store.{_sp_} Thank you...",
"Portuguese": f"Ooops...{_sp_}Esta opção está bloqueada. {_sp_} Para acessá-lo, você pode {_sp_} comprá-lo na loja.{_sp_} Obrigado..."}, "Portuguese": f"Ooops...{_sp_}Esta opção está bloqueada. {_sp_} Para acessá-lo, você pode {_sp_} comprá-lo na loja.{_sp_} Obrigado..."},
"True Code": "True Code":
{"Spanish": "¡Código canjeado!", {"Spanish": "¡Código canjeado!",
"English": "Successful code!", "English": "Successful code!",
"Portuguese": "¡Código válido!"}, "Portuguese": "¡Código válido!"},
"False Code": "False Code":
{"Spanish": "³digo ya canjeado", {"Spanish": "ƒÂ³digo ya canjeado",
"English": "Expired code", "English": "Expired code",
"Portuguese": "³digo expirado"}, "Portuguese": "ƒÂ³digo expirado"},
"Invalid Code": "Invalid Code":
{"Spanish": "³digo inválido", {"Spanish": "ƒÂ³digo inválido",
"English": "Invalid code", "English": "Invalid code",
"Portuguese": "³digo inválido"}, "Portuguese": "ƒÂ³digo inválido"},
"Reward Code": "Reward Code":
{"Spanish": f"¡Felicitaciones! ¡Ganaste {subs} monedas!", {"Spanish": f"¡Felicitaciones! ¡Ganaste {subs} monedas!",
"English": f"Congratulations! You've {subs} coins", "English": f"Congratulations! You've {subs} coins",
"Portuguese": f"Parabéns! Você tem {subs} moedas"}, "Portuguese": f"Parabéns! Você tem {subs} moedas"},
"Creator": "Creator":
{"Spanish": "Mod creado por @PatrónModz", {"Spanish": "Mod creado por @PatrónModz",
"English": "Mod created by @PatrónModz", "English": "Mod created by @PatrónModz",
"Portuguese": "Mod creado by @PatrónModz"}, "Portuguese": "Mod creado by @PatrónModz"},
"Mod Info": "Mod Info":
{ {
"Spanish": f"Un mod genial que te permite gestionar {_sp_} los potenciadores a tu antojo. {_sp_} también incluye 8 potenciadores extra{_sp_} dejando 17 en total... ¡Guay!", "Spanish": f"Un mod genial que te permite gestionar {_sp_} los potenciadores a tu antojo. {_sp_} también incluye 8 potenciadores extra{_sp_} dejando 17 en total... ¡Guay!",
"English": f"A cool mod that allows you to manage {_sp_} powerups at your whims. {_sp_} also includes 8 extra powerups{_sp_} leaving 17 in total... Wow!", "English": f"A cool mod that allows you to manage {_sp_} powerups at your whims. {_sp_} also includes 8 extra powerups{_sp_} leaving 17 in total... Wow!",
"Portuguese": f"Um mod legal que permite que você gerencie os{_sp_} powerups de de acordo com seus caprichos. {_sp_} também inclui 8 powerups extras,{_sp_} deixando 17 no total... Uau!"}, "Portuguese": f"Um mod legal que permite que você gerencie os{_sp_} powerups de de acordo com seus caprichos. {_sp_} também inclui 8 powerups extras,{_sp_} deixando 17 no total... Uau!"},
"Coins Message": "Coins Message":
{"Spanish": f"Recompensa: {subs} Monedas", {"Spanish": f"Recompensa: {subs} Monedas",
"English": f"Reward: {subs} Coins", "English": f"Reward: {subs} Coins",
"Portuguese": f"Recompensa: {subs} Moedas"}, "Portuguese": f"Recompensa: {subs} Moedas"},
"Coins Limit Message": "Coins Limit Message":
{ {
"Spanish": f"Ganaste {almacen[0]} Monedas.{_sp_} Pero has superado el límite de {almacen[1]}", "Spanish": f"Ganaste {almacen[0]} Monedas.{_sp_} Pero has superado el límite de {almacen[1]}",
"English": f"You won {almacen[0]} Coins. {_sp_} But you have exceeded the limit of {almacen[1]}", "English": f"You won {almacen[0]} Coins. {_sp_} But you have exceeded the limit of {almacen[1]}",
"Portuguese": f"Você ganhou {almacen[0]} Moedas. {_sp_} Mas você excedeu o limite de {almacen[1]}"}, "Portuguese": f"Você ganhou {almacen[0]} Moedas. {_sp_} Mas você excedeu o limite de {almacen[1]}"},
} }
languages = ['Spanish', 'Portuguese', 'English'] languages = ['Spanish', 'Portuguese', 'English']
if lang not in languages: lang = 'English' if lang not in languages: lang = 'English'
@ -611,15 +613,18 @@ def _bomb_init(self,
bomb_scale: float = 1.0, bomb_scale: float = 1.0,
source_player: bs.Player = None, source_player: bs.Player = None,
owner: bs.Node = None): owner: bs.Node = None):
self.bm_type = bomb_type self.bm_type = bomb_type
new_bomb_type = bomb_type new_bomb_type = 'ice' if bomb_type in ['ice_bubble', 'impairment', 'fire', 'fly'] else bomb_type
bombs = ['ice_bubble', 'impairment', 'fire', 'fly']
if bomb_type in bombs: # Call original __init__
new_bomb_type = 'ice' self._pm_old_bomb(position=position,
velocity=velocity,
self._pm_old_bomb(position, velocity, new_bomb_type, blast_radius, bomb_type=new_bomb_type,
bomb_scale, source_player, owner) blast_radius=blast_radius,
bomb_scale=bomb_scale,
source_player=source_player,
owner=owner)
tex = self.node.color_texture tex = self.node.color_texture
@ -627,21 +632,21 @@ def _bomb_init(self,
self.bomb_type = self.bm_type self.bomb_type = self.bm_type
self.node.mesh = None self.node.mesh = None
self.shield_ice = bs.newnode('shield', owner=self.node, self.shield_ice = bs.newnode('shield', owner=self.node,
attrs={'color': (0.5, 1.0, 7.0), attrs={'color': (0.5, 1.0, 7.0), 'radius': 0.6})
'radius': 0.6})
self.node.connectattr('position', self.shield_ice, 'position') self.node.connectattr('position', self.shield_ice, 'position')
elif self.bm_type == 'fire': elif self.bm_type == 'fire':
self.bomb_type = self.bm_type self.bomb_type = self.bm_type
self.node.mesh = None self.node.mesh = None
self.shield_fire = bs.newnode('shield', owner=self.node, self.shield_fire = bs.newnode('shield', owner=self.node,
attrs={'color': (6.5, 6.5, 2.0), attrs={'color': (6.5, 6.5, 2.0), 'radius': 0.6})
'radius': 0.6})
self.node.connectattr('position', self.shield_fire, 'position') self.node.connectattr('position', self.shield_fire, 'position')
self.fire_effect_time = bs.Timer(0.1, babase.Call(fire_effect, self), self.fire_effect_time = bs.Timer(0.1, babase.Call(fire_effect, self), repeat=True)
repeat=True)
elif self.bm_type == 'impairment': elif self.bm_type == 'impairment':
self.bomb_type = self.bm_type self.bomb_type = self.bm_type
tex = bs.gettexture('eggTex3') tex = bs.gettexture('eggTex3')
elif self.bm_type == 'fly': elif self.bm_type == 'fly':
self.bomb_type = self.bm_type self.bomb_type = self.bm_type
tex = bs.gettexture('eggTex1') tex = bs.gettexture('eggTex1')
@ -655,6 +660,8 @@ def _bomb_init(self,
self.blast_radius *= 2.2 self.blast_radius *= 2.2
def bomb_handlemessage(self, msg: Any) -> Any: def bomb_handlemessage(self, msg: Any) -> Any:
assert not self.expired assert not self.expired
@ -814,7 +821,7 @@ def _pbx_(self, position: Sequence[float] = (0.0, 1.0, 0.0),
0.6: (0, 1, 0), 0.6: (0, 1, 0),
0.8: (0, 1, 1), 0.8: (0, 1, 1),
1.0: (1, 0, 1), 1.0: (1, 0, 1),
1.2: (1, 0, 0)}, True) 1.2: (1, 0, 0)})
def update_time(time): def update_time(time):
if self.texts['Time'].exists(): if self.texts['Time'].exists():