mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
[ci] auto-format
This commit is contained in:
parent
83da21895d
commit
05ffa9fd0c
1 changed files with 31 additions and 28 deletions
|
|
@ -95,7 +95,7 @@ class TNTRespawnText(ba.Plugin):
|
||||||
args[0]._respawn_text = ba.newnode(
|
args[0]._respawn_text = ba.newnode(
|
||||||
'text',
|
'text',
|
||||||
attrs={
|
attrs={
|
||||||
'text': "", # we'll set the text later
|
'text': "", # we'll set the text later
|
||||||
'in_world': True,
|
'in_world': True,
|
||||||
'position': respawn_text_position,
|
'position': respawn_text_position,
|
||||||
'shadow': 1.0,
|
'shadow': 1.0,
|
||||||
|
|
@ -111,6 +111,7 @@ class TNTRespawnText(ba.Plugin):
|
||||||
# Timers don't like calling functions that are outside of the game's "universe".
|
# Timers don't like calling functions that are outside of the game's "universe".
|
||||||
# If we call the function directly, we get a PyCallable error.
|
# If we call the function directly, we get a PyCallable error.
|
||||||
# We make a dummy function to avoid this.
|
# We make a dummy function to avoid this.
|
||||||
|
|
||||||
def tnt_callback():
|
def tnt_callback():
|
||||||
TNTRespawnText.on_tnt_exploded(args[0])
|
TNTRespawnText.on_tnt_exploded(args[0])
|
||||||
|
|
||||||
|
|
@ -135,7 +136,7 @@ class TNTRespawnText(ba.Plugin):
|
||||||
# Check if our TNT box is still kickin'.
|
# Check if our TNT box is still kickin'.
|
||||||
tnt_alive = args[0]._tnt is not None and args[0]._tnt.node
|
tnt_alive = args[0]._tnt is not None and args[0]._tnt.node
|
||||||
|
|
||||||
func(*args, **kwargs) # original code
|
func(*args, **kwargs) # original code
|
||||||
|
|
||||||
# The first time this code executes, nothing happens.
|
# The first time this code executes, nothing happens.
|
||||||
# However once our text node is created properly, let's do some work.
|
# However once our text node is created properly, let's do some work.
|
||||||
|
|
@ -191,18 +192,20 @@ class TNTRespawnText(ba.Plugin):
|
||||||
|
|
||||||
# Make some sparks to draw the eye.
|
# Make some sparks to draw the eye.
|
||||||
ba.emitfx(
|
ba.emitfx(
|
||||||
position=args[0]._position,
|
position=args[0]._position,
|
||||||
count=int(5.0 + random.random() * 10),
|
count=int(5.0 + random.random() * 10),
|
||||||
scale=0.8,
|
scale=0.8,
|
||||||
spread=1.25,
|
spread=1.25,
|
||||||
chunk_type='spark',
|
chunk_type='spark',
|
||||||
)
|
)
|
||||||
# What if we still have our TNT box?
|
# What if we still have our TNT box?
|
||||||
else:
|
else:
|
||||||
# If the TNT box is fresly spawned spawned earlier in the function, chances are it doesn't have a callback.
|
# If the TNT box is fresly spawned spawned earlier in the function, chances are it doesn't have a callback.
|
||||||
# If it has, ignore. Otherwise let's add it.
|
# If it has, ignore. Otherwise let's add it.
|
||||||
# Cloning code that already exists in init is not very clean, but that'll do.
|
# Cloning code that already exists in init is not very clean, but that'll do.
|
||||||
if args[0].tnt_has_callback: return
|
if args[0].tnt_has_callback:
|
||||||
|
return
|
||||||
|
|
||||||
def tnt_callback():
|
def tnt_callback():
|
||||||
TNTRespawnText.on_tnt_exploded(args[0])
|
TNTRespawnText.on_tnt_exploded(args[0])
|
||||||
args[0]._tnt.node.add_death_action(tnt_callback)
|
args[0]._tnt.node.add_death_action(tnt_callback)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue