Skip to content

Commit afdad86

Browse files
Add a bouncy modifier
1 parent f4085ff commit afdad86

4 files changed

Lines changed: 51 additions & 4 deletions

File tree

Autoload/Items.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ func _ready():
161161
register_behavior_mod("impulse", "Impulse", "The next spell will have an impulse", preload("res://Sprites/Spells/Modifiers/Impulse.png"))
162162
register_behavior_mod("soul_wave_collider", "Soul Wave Collisions", "The next spell will summon a Soul Wave on every collision", preload("res://Sprites/Spells/Modifiers/SoulWaveCollider.png"))
163163
register_behavior_mod("explosion_collider", "Explosive Collisions", "The next spell will summon a Soul Wave on every collision", preload("res://Sprites/Spells/Modifiers/ExplosionCollider.png"))
164+
register_behavior_mod("bouncy", "BouncySpell", "The next spell will be bouncy", preload("res://Sprites/Spells/Modifiers/Bouncy.png"))
164165
# register_base_mod("grenade", "Grenade Cast", "Copies spells into a grenade wand\nCopied Spells: %s", preload("res://Sprites/Spells/Modifiers/Grenade.png"), [1, 6])
165166
# register_base_mod("landmine", "Landmine Cast", "Copies spells into a landmine wand\nCopied Spells: %s", preload("res://Sprites/Spells/Modifiers/Landmine.png"), [1, 6])
166167
register_behavior_mod("limited", "Limited Cast", "When applicable, casts will only have effect at the end of the wand", preload("res://Sprites/Spells/Modifiers/Limited.png"))

Spells/SpellBehaviors/ParticleMovement.gd

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ func _ready() -> void:
4646

4747
if spellcastinfo.modifiers.has("limited"):
4848
velocity = Vector2.ZERO
49-
if spellcastinfo.modifiers.has("down_gravity"):
50-
gravity = max(500, velocity.length() * 5)
51-
if spellcastinfo.modifiers.has("up_gravity"):
52-
gravity = -max(500, velocity.length() * 5)
5349
if spellcastinfo.modifiers.has("acceleration"):
5450
speed_multiplier *= 1.1
5551
if velocity.length() < 0.01:
@@ -70,6 +66,21 @@ func _ready() -> void:
7066
var spell_spawner := ExplodeOnCollide.new()
7167
connect("collision_happened", spell_spawner, "_on_collision_happened")
7268
get_parent().add_child(spell_spawner)
69+
if spellcastinfo.modifiers.has("bouncy"):
70+
max_bounces = 16
71+
if spellcastinfo.modifiers.has("up_gravity") or spellcastinfo.modifiers.has("down_gravity") and max_distance > 0:
72+
velocity = velocity.normalized() * max_distance * 10
73+
max_distance = -1
74+
if spellcastinfo.modifiers.has("down_gravity"):
75+
if velocity.length() > 800:
76+
gravity = velocity.length() * 20
77+
else:
78+
gravity = 500
79+
if spellcastinfo.modifiers.has("up_gravity"):
80+
if velocity.length() > 800:
81+
gravity = -velocity.length() * 20
82+
else:
83+
gravity = -500
7384

7485
velocity = velocity.rotated(spellcastinfo.angle_offset)
7586

323 Bytes
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/Bouncy.png-812c4746160e66bf5c32354de981e86c.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://Sprites/Spells/Modifiers/Bouncy.png"
13+
dest_files=[ "res://.import/Bouncy.png-812c4746160e66bf5c32354de981e86c.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=false
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
process/normal_map_invert_y=false
32+
stream=false
33+
size_limit=0
34+
detect_3d=false
35+
svg/scale=1.0

0 commit comments

Comments
 (0)