feat(enemy): sistema d'HP declaratiu i nou enemic big_pentagon
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
name: big_pentagon
|
||||
ai_type: big_pentagon # Validat contra el directori; mapeja a EnemyType::BIG_PENTAGON.
|
||||
|
||||
# Reusa la shape de pentagon però a escala 2.0 — primer enemic gegant del joc.
|
||||
shape:
|
||||
path: enemy_pentagon.shp
|
||||
scale: 2.0
|
||||
collision_factor: 1.0
|
||||
|
||||
physics:
|
||||
mass: 20.0 # Massa gran: la bala el frena poc, els trossos volen amb la força de la bala.
|
||||
speed: 30.0 # Avanç lent, com a "tanc carregant".
|
||||
rotation_delta_min: 0.3
|
||||
rotation_delta_max: 1.5
|
||||
restitution: 1.0
|
||||
linear_damping: 0.0
|
||||
angular_damping: 0.0
|
||||
|
||||
ai:
|
||||
# Persecució lenta del ship més proper: amb chase_strength baix la inèrcia
|
||||
# és molt notable, fa el comportament del "boss lent" característic.
|
||||
movement:
|
||||
type: chase
|
||||
chase_strength: 0.3
|
||||
|
||||
animation:
|
||||
pulse:
|
||||
trigger_prob_per_second: 0.01
|
||||
duration_min: 1.0
|
||||
duration_max: 3.0
|
||||
amplitude_min: 0.08
|
||||
amplitude_max: 0.20
|
||||
frequency_min: 1.5
|
||||
frequency_max: 3.0
|
||||
rotation_accel:
|
||||
trigger_prob_per_second: 0.02
|
||||
duration_min: 3.0
|
||||
duration_max: 8.0
|
||||
multiplier_min: 0.3
|
||||
multiplier_max: 4.0
|
||||
|
||||
wounded:
|
||||
duration: 1.5 # Una mica més llarg que els altres (és un boss).
|
||||
blink_hz: 10.0
|
||||
|
||||
spawn:
|
||||
invulnerability_duration: 3.0
|
||||
invulnerability_brightness_start: 0.3
|
||||
invulnerability_brightness_end: 0.7
|
||||
invulnerability_scale_start: 0.0
|
||||
invulnerability_scale_end: 1.0
|
||||
safety_distance: 72.0 # Doble del normal — és el doble de gran.
|
||||
|
||||
colors:
|
||||
normal: [0, 180, 255] # Blau elèctric per distingir-lo del pentagon cyan.
|
||||
wounded: [255, 220, 60]
|
||||
|
||||
score: 500 # 5x un enemic normal: aguanta 10x més.
|
||||
|
||||
# Estrenant el sistema HP: 10 unitats. Cada bala fa decrease_health + flash
|
||||
# + create_debris_partial (xip a 0.3x). En el 10è hit, on_no_health
|
||||
# encadena set_hurt (entra wounded). Wound expira → destroy → on_destroy
|
||||
# fa l'explosió completa.
|
||||
health: 10
|
||||
|
||||
events:
|
||||
on_hit:
|
||||
- action: decrease_health # primer: si arriba a 0 dispara on_no_health
|
||||
- action: flash # feedback visual de damage parcial
|
||||
- action: create_debris_partial # xip a 0.3x mida (sense ser letal)
|
||||
- action: apply_impulse # empenta el cos (sense will_die és segur en hit no-letal)
|
||||
on_no_health:
|
||||
- action: set_hurt # entra wounded; segon hit durant wounded matarà
|
||||
on_hurt_end:
|
||||
- action: destroy
|
||||
on_destroy:
|
||||
- action: add_score
|
||||
- action: create_debris # explosió completa
|
||||
- action: create_fireworks
|
||||
@@ -55,10 +55,14 @@ colors:
|
||||
score: 100
|
||||
|
||||
events:
|
||||
# Comportament clàssic: dos impactes per matar (set_hurt entra wounded;
|
||||
# el segon hit detecta wounded i destrueix automàticament).
|
||||
# HP=1 (default): decrement → on_no_health → set_hurt → wounded → mort.
|
||||
# decrease_health primer perquè si la mort cau aquí (segon hit durant wounded),
|
||||
# el dispatcher salta la resta del chain (incloent apply_impulse) sobre el
|
||||
# cos ja destruït.
|
||||
on_hit:
|
||||
- action: decrease_health
|
||||
- action: apply_impulse
|
||||
on_no_health:
|
||||
- action: set_hurt
|
||||
on_hurt_end:
|
||||
- action: destroy
|
||||
|
||||
@@ -55,8 +55,11 @@ colors:
|
||||
score: 200
|
||||
|
||||
events:
|
||||
# HP=1 (default): decrement → on_no_health → set_hurt → wounded → mort.
|
||||
on_hit:
|
||||
- action: decrease_health
|
||||
- action: apply_impulse
|
||||
on_no_health:
|
||||
- action: set_hurt
|
||||
on_hurt_end:
|
||||
- action: destroy
|
||||
|
||||
@@ -56,8 +56,11 @@ colors:
|
||||
score: 150
|
||||
|
||||
events:
|
||||
# HP=1 (default): decrement → on_no_health → set_hurt → wounded → mort.
|
||||
on_hit:
|
||||
- action: decrease_health
|
||||
- action: apply_impulse
|
||||
on_no_health:
|
||||
- action: set_hurt
|
||||
on_hurt_end:
|
||||
- action: destroy
|
||||
|
||||
@@ -66,8 +66,10 @@ score: 100
|
||||
|
||||
events:
|
||||
# STAR: mor al primer impacte, sense passar per wounded.
|
||||
# HP=1 (default): decrement → on_no_health → destroy directe (sense wounded).
|
||||
on_hit:
|
||||
- action: apply_impulse
|
||||
- action: decrease_health
|
||||
on_no_health:
|
||||
- action: destroy
|
||||
on_destroy:
|
||||
- action: add_score
|
||||
|
||||
@@ -7,7 +7,7 @@ metadata:
|
||||
description: "Progressive difficulty curve from novice to expert"
|
||||
|
||||
stages:
|
||||
# STAGE 1: Tutorial - Mix de tots 4 tipus al 25% per mostrar-los junts
|
||||
# STAGE 1: Tutorial - Mix de tots 5 tipus per mostrar-los junts (inclou big_pentagon)
|
||||
- stage_id: 1
|
||||
total_enemies: 50
|
||||
spawn_config:
|
||||
@@ -15,10 +15,11 @@ stages:
|
||||
initial_delay: 0.3
|
||||
spawn_interval: 0.4
|
||||
enemy_distribution:
|
||||
pentagon: 25
|
||||
cuadrado: 25
|
||||
molinillo: 25
|
||||
star: 25
|
||||
pentagon: 20
|
||||
cuadrado: 20
|
||||
molinillo: 20
|
||||
star: 20
|
||||
big_pentagon: 20
|
||||
difficulty_multipliers:
|
||||
speed_multiplier: 0.7
|
||||
rotation_multiplier: 0.8
|
||||
|
||||
Reference in New Issue
Block a user