Many changes
Handle it
This commit is contained in:
parent
bf09402bc5
commit
214e0aa5e0
366 changed files with 24353 additions and 2096 deletions
18
player/modifiers/piercing.gd
Normal file
18
player/modifiers/piercing.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class_name PiercingModifier extends Modifier
|
||||
|
||||
@export var pierce_count: int = 2
|
||||
|
||||
func _init():
|
||||
id = "piercing"
|
||||
display_name = "Piercing Shot"
|
||||
description = "Projectiles pass through %d enemies" % pierce_count
|
||||
|
||||
func modify_projectile(projectile):
|
||||
projectile.pierce_count = pierce_count
|
||||
projectile.connect("on_hit", _on_projectile_hit)
|
||||
|
||||
func _on_projectile_hit(projectile, _target):
|
||||
projectile.pierce_count -= 1
|
||||
if projectile.pierce_count <= 0:
|
||||
projectile.pierce_count = 0
|
||||
projectile.set_piercing(false)
|
||||
Loading…
Add table
Add a link
Reference in a new issue