Nivel de prueba reimplementado
This commit is contained in:
1 parent
8fc8925151
commit
1e70a99224
24 files changed
+2384
-164
No files matched your search
+8
-1
@@ -4,6 +4,9 @@ extends CharacterBody2D
|
||||
signal health_changed(current_health: int, max_health: int)
|
||||
signal died
|
||||
signal special_charge_changed(current_charge: int, max_charge: int)
|
||||
## Emitted only after an object successfully applies its effect.
|
||||
## The test level uses this signal to count items actually collected.
|
||||
signal pickup_collected(data: PickupData)
|
||||
|
||||
|
||||
# Collision layers used by this first playable slice.
|
||||
@@ -148,7 +151,8 @@ const ENEMY_HURTBOX_MASK: int = 1 << 4
|
||||
## Maximum damage dealt by the special (at full charge, closest to player).
|
||||
@export_range(0, 100, 1) var special_max_damage: int = 30
|
||||
|
||||
## Radius no longer used for full-screen special; kept for backwards compatibility.
|
||||
## Optional hard cutoff for the special. Very large = previous full-screen behaviour.
|
||||
## The Level 01 test sets a smaller radius to keep encounters independent.
|
||||
@export var special_radius: float = 100000.0
|
||||
|
||||
|
||||
@@ -508,6 +512,8 @@ func _apply_special_attack(charge_used: int = special_max_charge) -> void:
|
||||
continue
|
||||
|
||||
var distance: float = global_position.distance_to(enemy.global_position)
|
||||
if special_radius > 0.0 and distance > special_radius:
|
||||
continue
|
||||
# Damage falls off with distance: maximum at the player, lower farther away
|
||||
# affects the whole screen (no hard circle cutoff)
|
||||
var distance_factor: float = 1.0 - clamp(distance / max_distance, 0.0, 1.0)
|
||||
@@ -578,6 +584,7 @@ func collect_pickup(data: PickupData) -> bool:
|
||||
_:
|
||||
push_warning("Unknown pickup effect: %s" % data.effect_type)
|
||||
return false
|
||||
pickup_collected.emit(data)
|
||||
return true
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user