forked from team-sg/hero-mark-2
make death liquids not cause blood splatter (closes #140)
This commit is contained in:
parent
5a73af8887
commit
3b835b78f1
6 changed files with 45 additions and 29 deletions
|
@ -37,6 +37,8 @@ var velocity: Vector2 = Vector2.ZERO
|
|||
var snap: Vector2 = Vector2.ZERO
|
||||
# ladder currently attached to
|
||||
var _attached_ladder: Node2D = null
|
||||
# whether to skip blood splatter for this death
|
||||
var skip_blood: bool = false
|
||||
|
||||
|
||||
# NODE REFERENCES #
|
||||
|
@ -250,10 +252,13 @@ func _on_Dead_state_entered() -> void:
|
|||
emit_signal("died")
|
||||
state_chart.send_event("died")
|
||||
# spawn death particles
|
||||
var particles = DeathSplatter.instance()
|
||||
particles.global_position = death_splatter_position.global_position
|
||||
particles.emitting = true
|
||||
get_parent().add_child(particles)
|
||||
if not skip_blood:
|
||||
var particles = DeathSplatter.instance()
|
||||
particles.global_position = death_splatter_position.global_position
|
||||
particles.emitting = true
|
||||
get_parent().add_child(particles)
|
||||
else:
|
||||
skip_blood = false
|
||||
# fade into the ether
|
||||
graphics.visible = false
|
||||
state_chart.send_event("respawn")
|
||||
|
@ -427,6 +432,8 @@ func _process_floating_up(delta: float) -> void:
|
|||
# COLLISION CALLBACKS #
|
||||
func _on_Hitbox_body_entered(body: Node) -> void:
|
||||
if body.is_in_group("death"):
|
||||
if body.is_in_group("no_blood"):
|
||||
skip_blood = true
|
||||
die()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue