update
This commit is contained in:
5
scripts/enemy/boss.gd
Normal file
5
scripts/enemy/boss.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
extends "res://scripts/enemy/enemy.gd"
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
add_to_group("boss")
|
||||
1
scripts/enemy/boss.gd.uid
Normal file
1
scripts/enemy/boss.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bkehq3dqyp2yd
|
||||
@@ -10,6 +10,7 @@ var seconds_outside := 0.0
|
||||
func _ready() -> void:
|
||||
EventBus.damage_dealt.connect(_on_damage_dealt)
|
||||
EventBus.entity_died.connect(_on_entity_died)
|
||||
EventBus.heal_requested.connect(_on_heal_requested)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var outside_portal := false
|
||||
@@ -53,6 +54,12 @@ func _on_damage_dealt(attacker: Node, target: Node, amount: float) -> void:
|
||||
multiplier = 2.0
|
||||
add_aggro(attacker, amount * multiplier)
|
||||
|
||||
func _on_heal_requested(healer: Node, _target: Node, amount: float) -> void:
|
||||
if not healer.is_in_group("player"):
|
||||
return
|
||||
if healer in aggro_table:
|
||||
add_aggro(healer, amount * 0.5)
|
||||
|
||||
func _on_entity_died(entity: Node) -> void:
|
||||
aggro_table.erase(entity)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user