4ae0876e34
Per canon decisions 2026-08-07 (advisor CONCEPT.md f12cb15, falsifier response): charges now generate on kills (kills_per_charge, chemistry chain kills feed the hand; per-hit generation removed). Kills drop scrap as physical pickups (amber diamond, magnet radius 70, drift to mech, 20s fade; grunt 1 / burster 3) — collection is the positioning reward gradient. Cumulative collected scrap gates card levels 1-3 (thresholds 12/30; per-level radius x1.25/x1.5 and power x1.15/x1.5 — HEAT L3 hits one-cast detonation threshold). HUD: level notches under slots + scrap counter. Salvage spawn is call_deferred: death can fire inside a physics signal flush where Area2D setup is blocked. Smoke gate: charge accrual now kill-fed, salvage drop + collection + level gating phases added, heat-target selection made retry-tolerant. 4/4 green on nh3-dev headless 4.7.1.
37 lines
981 B
GDScript
37 lines
981 B
GDScript
extends Area2D
|
|
## KINETIC slug: damage plus knockback along its travel direction.
|
|
## Knockback is the load-bearing part — KINETIC is the one tag that
|
|
## touches the piloting layer, and the HEAT+KINETIC chemistry row
|
|
## (next slice) rides on impacts this weapon causes.
|
|
|
|
@export var speed := 420.0
|
|
@export var damage := 1.0
|
|
@export var knockback := 220.0
|
|
@export var lifetime := 0.8
|
|
|
|
var direction := Vector2.RIGHT
|
|
|
|
|
|
func _ready() -> void:
|
|
add_to_group("projectiles")
|
|
rotation = direction.angle()
|
|
body_entered.connect(_on_body_entered)
|
|
|
|
|
|
func _physics_process(delta: float) -> void:
|
|
position += direction * speed * delta
|
|
lifetime -= delta
|
|
if lifetime <= 0.0:
|
|
queue_free()
|
|
|
|
|
|
func _on_body_entered(body: Node) -> void:
|
|
if body.is_in_group("enemies"):
|
|
body.hit(damage, direction * knockback)
|
|
queue_free()
|
|
|
|
|
|
func _draw() -> void:
|
|
# KINETIC hue: pale steel-blue (placeholder — tag colors unassigned in canon).
|
|
draw_rect(Rect2(-5, -1.5, 10, 3), Color(0.75, 0.85, 0.95))
|