mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-10-16 12:02:51 +00:00
Add files via upload
This commit is contained in:
parent
aa6a5d8bd9
commit
78e7d1669f
1 changed files with 25 additions and 0 deletions
25
dist/ba_root/mods/features/snow_fall.py
vendored
Normal file
25
dist/ba_root/mods/features/snow_fall.py
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import random
|
||||
import ba
|
||||
|
||||
def snowfall_generator(activity, count=10, fall_speed=0.1, scale=0.3):
|
||||
def generate_snowfall():
|
||||
for _ in range(count):
|
||||
p = (-10 + (random.random() * 30), 15, -10 + (random.random() * 30))
|
||||
v = ((-5.0 + random.random() * 30.0) * (-1.0 if p[0] > 0 else 1.0), -50.0 * fall_speed,
|
||||
(-5.0 + random.random() * 30.0) * (-1.0 if p[0] > 0 else 1.0) * fall_speed)
|
||||
snowfall = ba.emitfx(position=p,
|
||||
velocity=v,
|
||||
count=10,
|
||||
scale=scale + random.random() * 0.1, # Random scale between scale and scale + 0.1
|
||||
spread=0.0,
|
||||
chunk_type='ice') # Emit particles that stick to surfaces
|
||||
if snowfall is not None:
|
||||
# Add a timer to delete the snowfall particles after falling
|
||||
ba.timer(random.uniform(1.0, 3.0), snowfall.delete)
|
||||
activity.snowfall_particles.append(snowfall)
|
||||
|
||||
# Generate snowfall continuously
|
||||
ba.timer(0.1, generate_snowfall, repeat=True)
|
||||
|
||||
# Attach the snowfall_generator function to the Activity class
|
||||
ba._activity.Activity.snowfall_generator = snowfall_generator
|
||||
Loading…
Add table
Add a link
Reference in a new issue