Rename to Work-Death Balance, add mascot favicon and rebalance rifle/grenade damage

This commit is contained in:
enne2
2026-10-15 17:15:16 +02:00
parent 2606fc5cc2
commit 21a1d5bf79
22 changed files with 352 additions and 39 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ signal detonated
const MAX_LIFETIME := 15.0
const Explosion = preload("res://scripts/grenade_explosion.gd")
const BLAST_RADIUS := 5.0
const MAX_DAMAGE := 160.0
const MAX_DAMAGE := 320.0
const Audio = preload("res://scripts/hl_audio.gd")
const Blood = preload("res://scripts/blood_effects.gd")
var age := 0.0
+2 -1
View File
@@ -5,6 +5,7 @@ var damage_pivot: Node3D
var damage_feedback: CanvasLayer
const DamageFeedback = preload("res://scripts/damage_feedback.gd")
const MAX_HP := 100.0
const BULLET_DAMAGE := 17.5
var hp := MAX_HP
var invulnerable := false # only enabled by the explicit native boss simulation flag
var _regen_elapsed := 0.0
@@ -189,7 +190,7 @@ func shoot() -> void:
var hit := get_world_3d().direct_space_state.intersect_ray(query)
if hit and hit.collider.has_method("take_damage"):
Blood.impact(get_parent(), hit.position, -camera.global_basis.z)
hit.collider.take_damage(35, hit.position.y)
hit.collider.take_damage(BULLET_DAMAGE, hit.position.y)
if ammo <= 0:
start_reload()
+15 -2
View File
@@ -5,6 +5,7 @@ extends RefCounted
## IndexedDB di Godot puo' non essere sincronizzata). Chiavi: zombie_fps_*.
## Il nome, una volta scelto, resta bloccato: non viene piu' richiesto.
const PATH := "user://zombie_fps_profile.cfg"
const LEGACY_PROJECT_NAME := "Zombie Room FPS"
const DEFAULT_NAME := "Giocatore"
const NAME_MAX := 16
const KEY_NAME := "zombie_fps_name"
@@ -14,10 +15,19 @@ const KEY_LOCKED := "zombie_fps_locked"
## Legge il profilo (o i valori predefiniti) e lo riscrive, cosi' il primo avvio
## lascia sempre un id stabile e le chiavi del browser allineate.
static func load_profile(path := PATH) -> Dictionary:
static func load_profile(path := PATH, legacy_path := "") -> Dictionary:
var data := {"name": DEFAULT_NAME, "player_id": "", "best": 0, "locked": false}
var config := ConfigFile.new()
if config.load(path) == OK:
var loaded := config.load(path)
# Renaming application/config/name moves native user://. Import the old file
# only when the new one does not exist; never change/delete the source profile.
# Explicit legacy_path enables isolated migration tests using temporary files.
if loaded != OK and not FileAccess.file_exists(path):
if legacy_path == "" and path == PATH and not OS.has_feature("web"):
legacy_path = legacy_profile_path()
if legacy_path != "" and legacy_path != ProjectSettings.globalize_path(path):
loaded = config.load(legacy_path)
if loaded == OK:
var raw_name := text_of(config.get_value("player", "name", DEFAULT_NAME))
# Una versione precedente poteva salvare la stringa "null": in quel caso il
# nome va considerato non scelto e il blocco rimosso (riparazione automatica).
@@ -35,6 +45,9 @@ static func load_profile(path := PATH) -> Dictionary:
save_profile(data, path)
return data
static func legacy_profile_path() -> String:
return OS.get_user_data_dir().get_base_dir().path_join(LEGACY_PROJECT_NAME).path_join(PATH.get_file())
static func save_profile(data: Dictionary, path := PATH) -> void:
var raw_name := text_of(data.get("name"))
var name := sanitize_name(raw_name) if is_stored_name_usable(raw_name) else DEFAULT_NAME
+1 -1
View File
@@ -49,7 +49,7 @@ func _build_ui() -> void:
column.add_theme_constant_override("separation", 10 if touch_mode else 14)
center.add_child(column)
var title := _label("ZOMBIE ROOM FPS", 34 if touch_mode else 44, AMBER, HORIZONTAL_ALIGNMENT_CENTER)
var title := _label("Work-Death Balance", 34 if touch_mode else 44, AMBER, HORIZONTAL_ALIGNMENT_CENTER)
column.add_child(title)
column.add_child(_label("MatGames — classifica globale", 15, DIM, HORIZONTAL_ALIGNMENT_CENTER))