update
This commit is contained in:
@@ -13,7 +13,6 @@ var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
func _ready() -> void:
|
||||
spawn_position = global_position
|
||||
add_to_group("enemies")
|
||||
add_to_group("targetable")
|
||||
EventBus.entity_died.connect(_on_entity_died)
|
||||
|
||||
func _on_entity_died(entity: Node) -> void:
|
||||
|
||||
@@ -27,6 +27,11 @@ func _process(delta: float) -> void:
|
||||
var bonus_decay: float = aggro_table[player] * 0.01 * pow(2, seconds_outside) * delta
|
||||
decay += bonus_decay
|
||||
aggro_table[player] -= decay
|
||||
# Im Portal-Radius: Aggro bleibt bei mindestens 1
|
||||
if not outside_portal and enemy.portal and is_instance_valid(player):
|
||||
var player_dist: float = player.global_position.distance_to(enemy.portal.global_position)
|
||||
if player_dist <= PORTAL_RADIUS and aggro_table[player] < 1.0:
|
||||
aggro_table[player] = 1.0
|
||||
if aggro_table[player] <= 0:
|
||||
aggro_table.erase(player)
|
||||
|
||||
@@ -43,8 +48,8 @@ func _on_damage_dealt(attacker: Node, target: Node, amount: float) -> void:
|
||||
if target != enemy:
|
||||
return
|
||||
var multiplier := 1.0
|
||||
var player_class: Node = attacker.get_node_or_null("PlayerClass")
|
||||
if player_class and player_class.current_class == 0:
|
||||
var role: Node = attacker.get_node_or_null("Role")
|
||||
if role and role.current_role == 0:
|
||||
multiplier = 2.0
|
||||
add_aggro(attacker, amount * multiplier)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user