mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2026-08-15 13:03:08 +00:00
[ci] apply-plugin-metadata-and-formatting
This commit is contained in:
parent
ebbd198628
commit
e67d891716
5 changed files with 627 additions and 519 deletions
|
|
@ -2426,6 +2426,62 @@
|
||||||
"md5sum": "d8002dfc93be74d71f8e6e4aacfe6fd1"
|
"md5sum": "d8002dfc93be74d71f8e6e4aacfe6fd1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"better_camera_shake": {
|
||||||
|
"description": "This plugin makes the camera only shake when an explosion hits a player character, begone excessive camera shaking!",
|
||||||
|
"external_url": "",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "DinoWattz",
|
||||||
|
"email": "",
|
||||||
|
"discord": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"versions": {
|
||||||
|
"1.0.0": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chat_bubbles": {
|
||||||
|
"description": "Adds whatever the players say above their character, includes a few other features too!",
|
||||||
|
"external_url": "",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "DinoWattz",
|
||||||
|
"email": "",
|
||||||
|
"discord": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"versions": {
|
||||||
|
"1.0.0": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enhanced_effects": {
|
||||||
|
"description": "Explosions affect character colors, slow-mo tnt, fair colored shields, a trippy background screen and maybe more in the future!",
|
||||||
|
"external_url": "",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "DinoWattz",
|
||||||
|
"email": "",
|
||||||
|
"discord": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"versions": {
|
||||||
|
"1.0.0": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sleep_on_afk": {
|
||||||
|
"description": "Staying idle for 40 seconds will make your character fall asleep, they need rest too..",
|
||||||
|
"external_url": "",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "DinoWattz",
|
||||||
|
"email": "",
|
||||||
|
"discord": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"versions": {
|
||||||
|
"1.0.0": null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -26,6 +26,8 @@ plugman = dict(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Camera shake only on player impact
|
# Camera shake only on player impact
|
||||||
|
|
||||||
|
|
||||||
def new__init__(
|
def new__init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
|
|
@ -359,9 +361,12 @@ def new__init__(
|
||||||
|
|
||||||
bs.timer(0.4, _extra_debris_sound)
|
bs.timer(0.4, _extra_debris_sound)
|
||||||
|
|
||||||
|
|
||||||
bomb.Blast.__init__ = new__init__
|
bomb.Blast.__init__ = new__init__
|
||||||
|
|
||||||
org_handlemessage = bomb.Blast.handlemessage
|
org_handlemessage = bomb.Blast.handlemessage
|
||||||
|
|
||||||
|
|
||||||
def new_handlemessage(self, msg: Any, *args, **kwargs) -> Any:
|
def new_handlemessage(self, msg: Any, *args, **kwargs) -> Any:
|
||||||
org_handlemessage(self, msg, *args, **kwargs)
|
org_handlemessage(self, msg, *args, **kwargs)
|
||||||
|
|
||||||
|
|
@ -377,5 +382,7 @@ def new_handlemessage(self, msg: Any, *args, **kwargs) -> Any:
|
||||||
bomb.Blast.handlemessage = new_handlemessage
|
bomb.Blast.handlemessage = new_handlemessage
|
||||||
|
|
||||||
# ba_meta export babase.Plugin
|
# ba_meta export babase.Plugin
|
||||||
|
|
||||||
|
|
||||||
class Plugin(babase.Plugin):
|
class Plugin(babase.Plugin):
|
||||||
pass
|
pass
|
||||||
|
|
@ -23,7 +23,8 @@ plugman = dict(
|
||||||
version="1.0.0",
|
version="1.0.0",
|
||||||
)
|
)
|
||||||
|
|
||||||
PRINT_CHAT_MESSAGES = True # Prints chat messages to the console as "[Character's Name] Player 1/Player 2: Hello World!"
|
# Prints chat messages to the console as "[Character's Name] Player 1/Player 2: Hello World!"
|
||||||
|
PRINT_CHAT_MESSAGES = True
|
||||||
BUBBLE_DURATION: float = 4.7 # 4.7 matches the default onscreen message duration
|
BUBBLE_DURATION: float = 4.7 # 4.7 matches the default onscreen message duration
|
||||||
SPEAK_VOLUME = 1.5
|
SPEAK_VOLUME = 1.5
|
||||||
SHOUT_VOLUME = 3.0
|
SHOUT_VOLUME = 3.0
|
||||||
|
|
@ -229,6 +230,8 @@ EASTER_EGGS = [
|
||||||
]
|
]
|
||||||
|
|
||||||
# Chat bubble functionality
|
# Chat bubble functionality
|
||||||
|
|
||||||
|
|
||||||
def create_bubble(player: bs.SessionPlayer, text: str, name: str):
|
def create_bubble(player: bs.SessionPlayer, text: str, name: str):
|
||||||
msg = normalize_message(text)
|
msg = normalize_message(text)
|
||||||
is_caps = len(text) > 1 and text.isupper()
|
is_caps = len(text) > 1 and text.isupper()
|
||||||
|
|
@ -240,11 +243,14 @@ def create_bubble(player: bs.SessionPlayer, text: str, name: str):
|
||||||
def _fallback_logic():
|
def _fallback_logic():
|
||||||
nonlocal handled, activityplayer
|
nonlocal handled, activityplayer
|
||||||
color = (1, 1, 0.4)
|
color = (1, 1, 0.4)
|
||||||
image_icon = {'texture': bs.gettexture("cuteSpaz"), 'tint_texture': bs.gettexture("cuteSpaz"), 'tint_color': (1.0, 1.0, 1.0), 'tint2_color': (1.0, 1.0, 1.0)}
|
image_icon = {'texture': bs.gettexture("cuteSpaz"), 'tint_texture': bs.gettexture(
|
||||||
|
"cuteSpaz"), 'tint_color': (1.0, 1.0, 1.0), 'tint2_color': (1.0, 1.0, 1.0)}
|
||||||
|
|
||||||
if activityplayer:
|
if activityplayer:
|
||||||
normal_highlight = bs.normalized_color( bs.safecolor(player.highlight, target_intensity=1.15) )
|
normal_highlight = bs.normalized_color(
|
||||||
saturated_highlight = bs.normalized_color( bs.safecolor(player.highlight, target_intensity=0.75) )
|
bs.safecolor(player.highlight, target_intensity=1.15))
|
||||||
|
saturated_highlight = bs.normalized_color(
|
||||||
|
bs.safecolor(player.highlight, target_intensity=0.75))
|
||||||
color = saturated_highlight if is_caps else normal_highlight
|
color = saturated_highlight if is_caps else normal_highlight
|
||||||
image_icon = activityplayer.get_icon()
|
image_icon = activityplayer.get_icon()
|
||||||
|
|
||||||
|
|
@ -312,8 +318,10 @@ def create_bubble(player: bs.SessionPlayer, text: str, name: str):
|
||||||
})
|
})
|
||||||
char_node.connectattr('torso_position', mnode, 'input2')
|
char_node.connectattr('torso_position', mnode, 'input2')
|
||||||
|
|
||||||
normal_highlight = bs.normalized_color( bs.safecolor(player.highlight, target_intensity=1.15) )
|
normal_highlight = bs.normalized_color(
|
||||||
saturated_highlight = bs.normalized_color( bs.safecolor(player.highlight, target_intensity=0.75) )
|
bs.safecolor(player.highlight, target_intensity=1.15))
|
||||||
|
saturated_highlight = bs.normalized_color(
|
||||||
|
bs.safecolor(player.highlight, target_intensity=0.75))
|
||||||
bubble_color = saturated_highlight if is_caps else normal_highlight
|
bubble_color = saturated_highlight if is_caps else normal_highlight
|
||||||
|
|
||||||
textnode = bs.newnode('text',
|
textnode = bs.newnode('text',
|
||||||
|
|
@ -366,7 +374,8 @@ def create_bubble(player: bs.SessionPlayer, text: str, name: str):
|
||||||
sound = random.choice(pickup_sounds)
|
sound = random.choice(pickup_sounds)
|
||||||
|
|
||||||
if sound:
|
if sound:
|
||||||
_play_chat_sound(actor, sound, SHOUT_VOLUME if is_caps else SPEAK_VOLUME)
|
_play_chat_sound(
|
||||||
|
actor, sound, SHOUT_VOLUME if is_caps else SPEAK_VOLUME)
|
||||||
|
|
||||||
# Animation logic
|
# Animation logic
|
||||||
if egg.get('messages') and actor.is_alive() and hasattr(actor, 'handlemessage'):
|
if egg.get('messages') and actor.is_alive() and hasattr(actor, 'handlemessage'):
|
||||||
|
|
@ -423,6 +432,7 @@ def create_bubble(player: bs.SessionPlayer, text: str, name: str):
|
||||||
_fallback_logic()
|
_fallback_logic()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def update_bubble_offsets(bubbles):
|
def update_bubble_offsets(bubbles):
|
||||||
for i, (tnode, mnode) in enumerate(reversed(bubbles)):
|
for i, (tnode, mnode) in enumerate(reversed(bubbles)):
|
||||||
y_offset = 1.2 + 0.25 * i
|
y_offset = 1.2 + 0.25 * i
|
||||||
|
|
@ -430,6 +440,8 @@ def update_bubble_offsets(bubbles):
|
||||||
mnode.input1 = (0, y_offset, 0)
|
mnode.input1 = (0, y_offset, 0)
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
|
|
||||||
|
|
||||||
def normalize_message(text):
|
def normalize_message(text):
|
||||||
msg = text.strip().lower()
|
msg = text.strip().lower()
|
||||||
msg = msg.translate(str.maketrans('', '', string.punctuation))
|
msg = msg.translate(str.maketrans('', '', string.punctuation))
|
||||||
|
|
@ -441,6 +453,8 @@ def normalize_message(text):
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
# ba_meta export babase.Plugin
|
# ba_meta export babase.Plugin
|
||||||
|
|
||||||
|
|
||||||
class Plugin(babase.Plugin):
|
class Plugin(babase.Plugin):
|
||||||
def on_app_running(self) -> None:
|
def on_app_running(self) -> None:
|
||||||
# Hook into chat message filtering
|
# Hook into chat message filtering
|
||||||
|
|
@ -451,6 +465,7 @@ class Plugin(babase.Plugin):
|
||||||
import bascenev1._hooks as _hooks
|
import bascenev1._hooks as _hooks
|
||||||
|
|
||||||
_org_filter_chat_message = _hooks.filter_chat_message
|
_org_filter_chat_message = _hooks.filter_chat_message
|
||||||
|
|
||||||
def _chat_bubbles_hook(msg: str, client_id: int, *args, **kwargs) -> str | None:
|
def _chat_bubbles_hook(msg: str, client_id: int, *args, **kwargs) -> str | None:
|
||||||
org_msg = _org_filter_chat_message(msg, client_id, *args, **kwargs)
|
org_msg = _org_filter_chat_message(msg, client_id, *args, **kwargs)
|
||||||
|
|
||||||
|
|
@ -513,7 +528,8 @@ class Plugin(babase.Plugin):
|
||||||
if PRINT_CHAT_MESSAGES:
|
if PRINT_CHAT_MESSAGES:
|
||||||
print(f"[{character}] {name}: {org_msg}")
|
print(f"[{character}] {name}: {org_msg}")
|
||||||
else:
|
else:
|
||||||
bs.logging.warning("Failed to create a chat bubble, using non-session player method now.")
|
bs.logging.warning(
|
||||||
|
"Failed to create a chat bubble, using non-session player method now.")
|
||||||
# Non-session players (in lobby or just spectating, this only works for servers)
|
# Non-session players (in lobby or just spectating, this only works for servers)
|
||||||
if not matched and not dead_bubble:
|
if not matched and not dead_bubble:
|
||||||
for client in roster:
|
for client in roster:
|
||||||
|
|
@ -550,7 +566,8 @@ class Plugin(babase.Plugin):
|
||||||
|
|
||||||
if getattr(owner, 'owner', None):
|
if getattr(owner, 'owner', None):
|
||||||
assert owner is not None
|
assert owner is not None
|
||||||
area_of_interest = False if getattr(owner.owner, 'is_area_of_interest', False) else True
|
area_of_interest = False if getattr(
|
||||||
|
owner.owner, 'is_area_of_interest', False) else True
|
||||||
else:
|
else:
|
||||||
area_of_interest = False if getattr(owner, 'is_area_of_interest', False) else True
|
area_of_interest = False if getattr(owner, 'is_area_of_interest', False) else True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ plugman = dict(
|
||||||
|
|
||||||
# Transparent Background (kinda hacky, works best on pc with high/higher quality 'visuals' setting)
|
# Transparent Background (kinda hacky, works best on pc with high/higher quality 'visuals' setting)
|
||||||
BACKGROUND_OPACITY = 0.5
|
BACKGROUND_OPACITY = 0.5
|
||||||
|
|
||||||
|
|
||||||
def __modified_background_init(
|
def __modified_background_init(
|
||||||
self,
|
self,
|
||||||
fade_time: float = 0.5,
|
fade_time: float = 0.5,
|
||||||
|
|
@ -112,6 +114,7 @@ def __modified_background_init(
|
||||||
timeval += random.random() * 0.1
|
timeval += random.random() * 0.1
|
||||||
bs.animate(cmb, 'input1', keys, loop=True)
|
bs.animate(cmb, 'input1', keys, loop=True)
|
||||||
|
|
||||||
|
|
||||||
def _modified_background_die(self, immediate: bool = False) -> None:
|
def _modified_background_die(self, immediate: bool = False) -> None:
|
||||||
session = self._session()
|
session = self._session()
|
||||||
if session is None and self.node:
|
if session is None and self.node:
|
||||||
|
|
@ -138,10 +141,13 @@ def _modified_background_die(self, immediate: bool = False) -> None:
|
||||||
)
|
)
|
||||||
bs.timer(self.fade_time + 0.1, self.node.delete)
|
bs.timer(self.fade_time + 0.1, self.node.delete)
|
||||||
|
|
||||||
|
|
||||||
Background.__init__ = __modified_background_init
|
Background.__init__ = __modified_background_init
|
||||||
Background._die = _modified_background_die
|
Background._die = _modified_background_die
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
|
|
||||||
|
|
||||||
def blend_toward(
|
def blend_toward(
|
||||||
rgb: tuple[float, float, float],
|
rgb: tuple[float, float, float],
|
||||||
target: tuple[float, float, float],
|
target: tuple[float, float, float],
|
||||||
|
|
@ -177,6 +183,8 @@ def blend_toward(
|
||||||
return tuple(clamp01(linear_to_srgb(c)) for c in blended_lin)
|
return tuple(clamp01(linear_to_srgb(c)) for c in blended_lin)
|
||||||
|
|
||||||
# ba_meta export babase.Plugin
|
# ba_meta export babase.Plugin
|
||||||
|
|
||||||
|
|
||||||
class Plugin(babase.Plugin):
|
class Plugin(babase.Plugin):
|
||||||
def on_app_running(self) -> None:
|
def on_app_running(self) -> None:
|
||||||
from bascenev1lib.actor.bomb import Blast, ExplodeHitMessage
|
from bascenev1lib.actor.bomb import Blast, ExplodeHitMessage
|
||||||
|
|
@ -190,7 +198,8 @@ class Plugin(babase.Plugin):
|
||||||
def equip_shields(self, decay: bool = False) -> None:
|
def equip_shields(self, decay: bool = False) -> None:
|
||||||
org_equip_shields(self, decay)
|
org_equip_shields(self, decay)
|
||||||
if self.shield is not None:
|
if self.shield is not None:
|
||||||
safe_highlight = bs.safecolor(getattr(self, '_original_highlight', self.node.highlight), target_intensity=0.75)
|
safe_highlight = bs.safecolor(
|
||||||
|
getattr(self, '_original_highlight', self.node.highlight), target_intensity=0.75)
|
||||||
self.shield.color = bs.normalized_color(safe_highlight)
|
self.shield.color = bs.normalized_color(safe_highlight)
|
||||||
|
|
||||||
Spaz.equip_shields = equip_shields
|
Spaz.equip_shields = equip_shields
|
||||||
|
|
@ -208,7 +217,8 @@ class Plugin(babase.Plugin):
|
||||||
|
|
||||||
# Pause
|
# Pause
|
||||||
gnode.paused = True
|
gnode.paused = True
|
||||||
self._pause_timer = bs.DisplayTimer(0.01, bs.CallPartial(setattr, gnode, 'paused', True), True)
|
self._pause_timer = bs.DisplayTimer(
|
||||||
|
0.01, bs.CallPartial(setattr, gnode, 'paused', True), True)
|
||||||
|
|
||||||
delay = 0.06
|
delay = 0.06
|
||||||
|
|
||||||
|
|
@ -217,12 +227,14 @@ class Plugin(babase.Plugin):
|
||||||
|
|
||||||
# Slow Motion
|
# Slow Motion
|
||||||
gnode.slow_motion = True
|
gnode.slow_motion = True
|
||||||
self._slow_motion_timer = bs.DisplayTimer(0.01, bs.CallPartial(setattr, gnode, 'slow_motion', True), True)
|
self._slow_motion_timer = bs.DisplayTimer(
|
||||||
|
0.01, bs.CallPartial(setattr, gnode, 'slow_motion', True), True)
|
||||||
|
|
||||||
delay += 0.14
|
delay += 0.14
|
||||||
|
|
||||||
bs.displaytimer(delay, bs.CallPartial(setattr, self, '_slow_motion_timer', None))
|
bs.displaytimer(delay, bs.CallPartial(setattr, self, '_slow_motion_timer', None))
|
||||||
bs.displaytimer(delay, bs.CallPartial(setattr, gnode, 'slow_motion', activity.slow_motion))
|
bs.displaytimer(delay, bs.CallPartial(
|
||||||
|
setattr, gnode, 'slow_motion', activity.slow_motion))
|
||||||
|
|
||||||
Blast.__init__ = new_init
|
Blast.__init__ = new_init
|
||||||
|
|
||||||
|
|
@ -269,9 +281,10 @@ class Plugin(babase.Plugin):
|
||||||
else:
|
else:
|
||||||
explosion_color = (0.07, 0.03, 0.0)
|
explosion_color = (0.07, 0.03, 0.0)
|
||||||
|
|
||||||
|
blend_color = blend_toward(node.color, explosion_color,
|
||||||
blend_color = blend_toward(node.color, explosion_color, explosion_intensity, True)
|
explosion_intensity, True)
|
||||||
blend_highlight = blend_toward(node.highlight, explosion_color, explosion_intensity-0.03, True)
|
blend_highlight = blend_toward(
|
||||||
|
node.highlight, explosion_color, explosion_intensity-0.03, True)
|
||||||
|
|
||||||
bs.animate_array(node, 'color', 3, {
|
bs.animate_array(node, 'color', 3, {
|
||||||
blend_time: blend_color,
|
blend_time: blend_color,
|
||||||
|
|
@ -284,7 +297,9 @@ class Plugin(babase.Plugin):
|
||||||
end_time: original_highlight
|
end_time: original_highlight
|
||||||
})
|
})
|
||||||
|
|
||||||
delegate._color_timer = bs.Timer(end_time, bs.CallPartial(delattr, delegate, '_original_color'))
|
delegate._color_timer = bs.Timer(
|
||||||
delegate._highlight_timer = bs.Timer(end_time, bs.CallPartial(delattr, delegate, '_original_highlight'))
|
end_time, bs.CallPartial(delattr, delegate, '_original_color'))
|
||||||
|
delegate._highlight_timer = bs.Timer(
|
||||||
|
end_time, bs.CallPartial(delattr, delegate, '_original_highlight'))
|
||||||
|
|
||||||
Blast.handlemessage = new_handlemessage
|
Blast.handlemessage = new_handlemessage
|
||||||
|
|
@ -19,6 +19,8 @@ plugman = dict(
|
||||||
INGAME_TIME = 40 # (in seconds)
|
INGAME_TIME = 40 # (in seconds)
|
||||||
|
|
||||||
# Spaz Changes
|
# Spaz Changes
|
||||||
|
|
||||||
|
|
||||||
def _afk_sleep_knockout(self, value: float) -> None:
|
def _afk_sleep_knockout(self, value: float) -> None:
|
||||||
if not self.node:
|
if not self.node:
|
||||||
return
|
return
|
||||||
|
|
@ -32,11 +34,16 @@ def _afk_sleep_knockout(self, value: float) -> None:
|
||||||
|
|
||||||
self.node.handlemessage('knockout', value)
|
self.node.handlemessage('knockout', value)
|
||||||
|
|
||||||
|
|
||||||
Spaz._afk_sleep_knockout = _afk_sleep_knockout # type: ignore
|
Spaz._afk_sleep_knockout = _afk_sleep_knockout # type: ignore
|
||||||
|
|
||||||
# Idle Checker
|
# Idle Checker
|
||||||
|
|
||||||
|
|
||||||
def idle_start(activity: bs.Activity):
|
def idle_start(activity: bs.Activity):
|
||||||
activity.customdata['afk_timer'] = bs.Timer(0.5, bs.CallStrict(idle_check, activity), repeat=True)
|
activity.customdata['afk_timer'] = bs.Timer(
|
||||||
|
0.5, bs.CallStrict(idle_check, activity), repeat=True)
|
||||||
|
|
||||||
|
|
||||||
def idle_check(current_activity: bs.Activity):
|
def idle_check(current_activity: bs.Activity):
|
||||||
current_session = current_activity.session
|
current_session = current_activity.session
|
||||||
|
|
@ -66,7 +73,8 @@ def idle_check(current_activity: bs.Activity):
|
||||||
if player_node.move_up_down != 0.0 or player_node.move_left_right != 0.0:
|
if player_node.move_up_down != 0.0 or player_node.move_left_right != 0.0:
|
||||||
player_data['last_input'] = current
|
player_data['last_input'] = current
|
||||||
elif player_turbo_times:
|
elif player_turbo_times:
|
||||||
highest_turbo_time = player_turbo_times.get(max(player_turbo_times, key=player_turbo_times.get))
|
highest_turbo_time = player_turbo_times.get(
|
||||||
|
max(player_turbo_times, key=player_turbo_times.get))
|
||||||
if highest_turbo_time > player_data.get('last_input', current):
|
if highest_turbo_time > player_data.get('last_input', current):
|
||||||
player_data.update({'last_input': highest_turbo_time})
|
player_data.update({'last_input': highest_turbo_time})
|
||||||
player_data['last_input'] = player_data.get('last_input', current)
|
player_data['last_input'] = player_data.get('last_input', current)
|
||||||
|
|
@ -81,7 +89,8 @@ def idle_check(current_activity: bs.Activity):
|
||||||
# print(wait_time)
|
# print(wait_time)
|
||||||
|
|
||||||
if afk_time >= wait_time:
|
if afk_time >= wait_time:
|
||||||
current_activity.customdata[str(player.id) +'_knockoutTimer'] = bs.Timer(0.1, bs.WeakCallStrict(player_actor._afk_sleep_knockout, 100.0), repeat=True)
|
current_activity.customdata[str(player.id) + '_knockoutTimer'] = bs.Timer(
|
||||||
|
0.1, bs.WeakCallStrict(player_actor._afk_sleep_knockout, 100.0), repeat=True)
|
||||||
|
|
||||||
# Make the player's node not an area of interest if it was one
|
# Make the player's node not an area of interest if it was one
|
||||||
if not getattr(player_actor, '_previous_is_area_of_interest', False):
|
if not getattr(player_actor, '_previous_is_area_of_interest', False):
|
||||||
|
|
@ -100,17 +109,21 @@ def idle_check(current_activity: bs.Activity):
|
||||||
if hasattr(player_actor, "_previous_is_area_of_interest"):
|
if hasattr(player_actor, "_previous_is_area_of_interest"):
|
||||||
delattr(player_actor, "_previous_is_area_of_interest")
|
delattr(player_actor, "_previous_is_area_of_interest")
|
||||||
|
|
||||||
|
|
||||||
# Setup new activity
|
# Setup new activity
|
||||||
org_on_begin = bs.Activity.on_begin
|
org_on_begin = bs.Activity.on_begin
|
||||||
|
|
||||||
|
|
||||||
def patched_on_begin(self, *args, **kwargs):
|
def patched_on_begin(self, *args, **kwargs):
|
||||||
idle_start(self)
|
idle_start(self)
|
||||||
|
|
||||||
return org_on_begin(self, *args, **kwargs)
|
return org_on_begin(self, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
bs.Activity.on_begin = patched_on_begin
|
bs.Activity.on_begin = patched_on_begin
|
||||||
|
|
||||||
# ba_meta export babase.Plugin
|
# ba_meta export babase.Plugin
|
||||||
|
|
||||||
|
|
||||||
class Plugin(babase.Plugin):
|
class Plugin(babase.Plugin):
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue