This commit is contained in:
2026-04-23 00:51:28 +03:00
parent 174e9dfb08
commit cdb0ffd6a5
22 changed files with 386 additions and 28 deletions
+40 -6
View File
@@ -11,7 +11,11 @@ signal health_changed(current: int, maximum: int)
@export var max_health: int = 100
var health: int = max_health
var tier: int = 0
var kick_tier: int = 1
var toughness_tier: int = 0
var has_stick_armor: bool = false
var has_leather_armor: bool = false
var has_plate_armor: bool = false
var kick_timer: float = 0.0
var invincible_timer: float = 0.0
var is_alive: bool = true
@@ -165,8 +169,8 @@ func _do_kick() -> void:
var best_diff := best.global_position - global_position
best_diff.y = 0.0
var best_dir := best_diff.normalized()
var obj_tier: int = best.get("tier") if best.get("tier") != null else 0
var diff_tier := tier - obj_tier
var obj_toughness: int = best.get("toughness_tier") if best.get("toughness_tier") != null else 0
var diff_tier := kick_tier - obj_toughness
var force: float
if diff_tier < 0:
force = 15.0
@@ -250,20 +254,50 @@ func apply_upgrade(id: String) -> void:
emit_signal("health_changed", health, max_health)
func apply_upgrade_boots(speed_bonus: float, _tier: int) -> void:
tier += _tier
kick_tier += 1
move_speed += speed_bonus
var tw := create_tween()
tw.tween_property(player_mat, "albedo_color", Color(1.0, 0.85, 0.2), 0.1)
tw.tween_property(player_mat, "albedo_color", BASE_COLOR, 0.4)
func apply_upgrade_armor() -> void:
tier += 1
kick_tier += 1
var tw := create_tween()
tw.tween_property(player_mat, "albedo_color", Color(0.7, 0.8, 1.0), 0.1)
tw.tween_property(player_mat, "albedo_color", BASE_COLOR, 0.5)
func apply_upgrade_enchant() -> void:
tier += 1
kick_tier += 1
var tw := create_tween()
tw.tween_property(player_mat, "albedo_color", Color(0.8, 0.2, 1.0), 0.1)
tw.tween_property(player_mat, "albedo_color", BASE_COLOR, 0.6)
func apply_stick_armor() -> bool:
if has_stick_armor:
return false
has_stick_armor = true
toughness_tier += 1
var tw := create_tween()
tw.tween_property(player_mat, "albedo_color", Color(0.7, 0.5, 0.2), 0.1)
tw.tween_property(player_mat, "albedo_color", BASE_COLOR, 0.4)
return true
func apply_leather_armor() -> bool:
if has_leather_armor:
return false
has_leather_armor = true
toughness_tier += 1
var tw := create_tween()
tw.tween_property(player_mat, "albedo_color", Color(0.8, 0.5, 0.2), 0.1)
tw.tween_property(player_mat, "albedo_color", BASE_COLOR, 0.4)
return true
func apply_plate_armor() -> bool:
if has_plate_armor:
return false
has_plate_armor = true
toughness_tier += 1
var tw := create_tween()
tw.tween_property(player_mat, "albedo_color", Color(0.6, 0.7, 1.0), 0.1)
tw.tween_property(player_mat, "albedo_color", BASE_COLOR, 0.5)
return true