edc40f9008
- Touch controls: direct InputEventScreenTouch in shop_ui (bypass relay) - ItemDB: static preload list instead of DirAccess scan (export fix) - All 18 items with EN localisation (name_en, desc_en, category_en) - Ship playstyles: NOVA-1 shield, INFERNO ram, AURORA agile/tank - Quasar: SMBH visual, jet boost, merge, push, BH-eating - Atlas & UI text updated EN+DE Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
51 lines
2.6 KiB
GDScript
51 lines
2.6 KiB
GDScript
extends RefCounted
|
||
class_name ShipStats
|
||
|
||
# All multiplicative / additive upgrades for one player's run.
|
||
# Stats stack: each item applies via apply_item_def(def) oder apply_item(effects).
|
||
|
||
var ship_id: String = "" # set at game start; used for per-ship runtime mechanics
|
||
var speed_mult: float = 1.0 # scales THRUST and MAX_SPEED
|
||
var turn_mult: float = 1.0 # scales TURN_SPEED
|
||
var fire_rate_mult: float = 1.0 # divides BULLET_COOLDOWN_MAX (higher = faster fire)
|
||
var damage_mult: float = 1.0 # scales bullet hit radius; >= 2.0 → pierce
|
||
var bullet_speed_mult: float = 1.0 # scales bullet travel speed
|
||
var bullet_count: int = 1 # shots per trigger press
|
||
var shield_charges: int = 0 # absorbs N hits before death
|
||
var invuln_mult: float = 1.0 # scales INVULN_FRAMES after hit
|
||
var bh_resist: float = 0.0 # 0.0–0.9: fraction of BH pull negated
|
||
var wipe_mult: float = 1.0 # scales BigWipe hold-time requirement
|
||
var credit_bonus: float = 1.0 # multiplier on all credits earned
|
||
|
||
# ─── Werkstatt-spezifische Felder ─────────────────────────────────────────────
|
||
var hull_scale: float = 3.0 # px per hull pixel (Basis 3.0, Max 4.5)
|
||
var owned_item_ids: Array = [] # IDs für visuelle Attachments am Schiff
|
||
var has_boost: bool = false # ist Boost-Taste aktiviert? (TITAN)
|
||
var boost_cooldown_max: float = 5.0 # Sekunden zwischen Boosts
|
||
|
||
# Wendet einen rohen effects-Dict an (Legacy-Shop-Path).
|
||
func apply_item(effects: Dictionary) -> void:
|
||
for key: String in effects:
|
||
var val = effects[key]
|
||
match key:
|
||
"speed_mult": speed_mult *= float(val)
|
||
"turn_mult": turn_mult *= float(val)
|
||
"fire_rate_mult": fire_rate_mult *= float(val)
|
||
"damage_mult": damage_mult *= float(val)
|
||
"bullet_speed_mult": bullet_speed_mult *= float(val)
|
||
"bullet_count": bullet_count += int(val)
|
||
"shield_charges": shield_charges = max(0, shield_charges + int(val))
|
||
"invuln_mult": invuln_mult *= float(val)
|
||
"bh_resist": bh_resist = min(0.9, bh_resist + float(val))
|
||
"wipe_mult": wipe_mult *= float(val)
|
||
"credit_bonus": credit_bonus *= float(val)
|
||
# Clamp bullet_count auf minimum 1
|
||
bullet_count = max(1, bullet_count)
|
||
|
||
# Wendet einen ItemDef an (neuer Werkstatt-Path).
|
||
func apply_item_def(def: ItemDef) -> void:
|
||
if def == null: return
|
||
apply_item(def.effects)
|
||
hull_scale = min(4.5, hull_scale + def.hull_size_bonus)
|
||
owned_item_ids.append(def.id)
|