refactor(enemies): renombrar big_pentagon a orb i enemy_big_orb a enemy_orb
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
name: big_pentagon
|
||||
ai_type: big_pentagon # Validat contra el directori; mapeja a EnemyType::BIG_PENTAGON.
|
||||
name: orb
|
||||
ai_type: orb # Validat contra el directori; mapeja a EnemyType::ORB.
|
||||
|
||||
# Shape circular pròpia (anell exterior + anell interior + 6 radis + nucli),
|
||||
# pensada per llegir-se com a "reactor / orb" amb més detall que els enemics
|
||||
# petits.
|
||||
shape:
|
||||
path: enemy_big_orb.shp
|
||||
scale: 1.5
|
||||
path: enemy_orb.shp
|
||||
scale: 1.0
|
||||
collision_factor: 1.0
|
||||
|
||||
physics:
|
||||
@@ -1,4 +1,4 @@
|
||||
# enemy_big_orb.shp - ORNI enemic gegant (orb circular, doble anell amb radis)
|
||||
# enemy_orb.shp - ORNI enemic gegant (orb circular, doble anell amb radis)
|
||||
# © 2026 JailDesigner
|
||||
#
|
||||
# Forma "reactor / boss circular" — més detall que els enemics petits perquè
|
||||
@@ -9,7 +9,7 @@
|
||||
# - Petit "+" central com a nucli.
|
||||
# Bounding radius natiu = 20 (alineat amb la resta d'enemics).
|
||||
|
||||
name: enemy_big_orb
|
||||
name: enemy_orb
|
||||
scale: 1.0
|
||||
center: 0, 0
|
||||
|
||||
+12
-12
@@ -9,7 +9,7 @@
|
||||
# - { timeout: T } → quan han passat T segons des de l'inici de la wave.
|
||||
# - { all_dead: true, timeout: T } → el que arribe abans (amuntegament si vas lent).
|
||||
#
|
||||
# Tipus d'enemic: pentagon, square (alias: cuadrado), pinwheel (alias: molinillo), star, big_pentagon.
|
||||
# Tipus d'enemic: pentagon, square (alias: cuadrado), pinwheel (alias: molinillo), star, orb.
|
||||
|
||||
metadata:
|
||||
version: "2.0"
|
||||
@@ -47,14 +47,14 @@ stages:
|
||||
spawn_interval: 0.5
|
||||
next: end
|
||||
|
||||
# STAGE 3 — Primer big_pentagon (HP=10).
|
||||
# STAGE 3 — Primer orb (HP=10).
|
||||
- stage_id: 3
|
||||
multipliers: { velocity: 1.0, rotation: 1.0, tracking: 0.5 }
|
||||
waves:
|
||||
- spawn: [pentagon, pentagon, square]
|
||||
spawn_interval: 0.4
|
||||
next: all_dead
|
||||
- spawn: [big_pentagon]
|
||||
- spawn: [orb]
|
||||
next: { all_dead: true, timeout: 12.0 }
|
||||
- spawn: [pinwheel, pinwheel]
|
||||
spawn_interval: 0.5
|
||||
@@ -76,7 +76,7 @@ stages:
|
||||
- spawn: [pinwheel, pinwheel, pinwheel]
|
||||
spawn_interval: 0.4
|
||||
next: all_dead
|
||||
- spawn: [big_pentagon, pentagon, pentagon]
|
||||
- spawn: [orb, pentagon, pentagon]
|
||||
spawn_interval: 0.5
|
||||
next: end
|
||||
|
||||
@@ -93,7 +93,7 @@ stages:
|
||||
- spawn: [pinwheel, pinwheel, star, star]
|
||||
spawn_interval: 0.4
|
||||
next: all_dead
|
||||
- spawn: [big_pentagon, square, square]
|
||||
- spawn: [orb, square, square]
|
||||
spawn_interval: 0.5
|
||||
next: end
|
||||
|
||||
@@ -110,7 +110,7 @@ stages:
|
||||
- spawn: [pinwheel, pinwheel, pinwheel]
|
||||
spawn_interval: 0.3
|
||||
next: all_dead
|
||||
- spawn: [big_pentagon, pinwheel, pinwheel]
|
||||
- spawn: [orb, pinwheel, pinwheel]
|
||||
spawn_interval: 0.4
|
||||
next: end
|
||||
|
||||
@@ -127,7 +127,7 @@ stages:
|
||||
- spawn: [star, star, star]
|
||||
spawn_interval: 0.4
|
||||
next: all_dead
|
||||
- spawn: [big_pentagon, pinwheel, pinwheel, square]
|
||||
- spawn: [orb, pinwheel, pinwheel, square]
|
||||
spawn_interval: 0.5
|
||||
next: end
|
||||
|
||||
@@ -141,7 +141,7 @@ stages:
|
||||
- spawn: [square, square, star, star]
|
||||
spawn_interval: 0.3
|
||||
next: { all_dead: true, timeout: 5.0 }
|
||||
- spawn: [big_pentagon]
|
||||
- spawn: [orb]
|
||||
next: { all_dead: true, timeout: 8.0 }
|
||||
- spawn: [pinwheel, pinwheel, square, star, pentagon]
|
||||
spawn_interval: 0.3
|
||||
@@ -154,13 +154,13 @@ stages:
|
||||
- spawn: [pinwheel, pinwheel, star, star]
|
||||
spawn_interval: 0.3
|
||||
next: { all_dead: true, timeout: 4.0 }
|
||||
- spawn: [big_pentagon, square, square]
|
||||
- spawn: [orb, square, square]
|
||||
spawn_interval: 0.4
|
||||
next: { all_dead: true, timeout: 8.0 }
|
||||
- spawn: [pinwheel, pinwheel, pinwheel, pinwheel]
|
||||
spawn_interval: 0.3
|
||||
next: { all_dead: true, timeout: 5.0 }
|
||||
- spawn: [big_pentagon, pinwheel, pinwheel, square, star]
|
||||
- spawn: [orb, pinwheel, pinwheel, square, star]
|
||||
spawn_interval: 0.4
|
||||
next: end
|
||||
|
||||
@@ -171,12 +171,12 @@ stages:
|
||||
- spawn: [pinwheel, pinwheel, pinwheel, pinwheel]
|
||||
spawn_interval: 0.25
|
||||
next: { all_dead: true, timeout: 4.0 }
|
||||
- spawn: [big_pentagon, square, star]
|
||||
- spawn: [orb, square, star]
|
||||
spawn_interval: 0.4
|
||||
next: { all_dead: true, timeout: 6.0 }
|
||||
- spawn: [pinwheel, pinwheel, star, star, square]
|
||||
spawn_interval: 0.3
|
||||
next: { all_dead: true, timeout: 5.0 }
|
||||
- spawn: [big_pentagon, big_pentagon, pinwheel, pinwheel, star]
|
||||
- spawn: [orb, orb, pinwheel, pinwheel, star]
|
||||
spawn_interval: 0.4
|
||||
next: end
|
||||
|
||||
@@ -17,11 +17,11 @@ class Ship;
|
||||
|
||||
// Tipo de enemy
|
||||
enum class EnemyType : uint8_t {
|
||||
PENTAGON = 0, // Pentágono esquivador (zigzag)
|
||||
SQUARE = 1, // Square perseguidor (tracks ship)
|
||||
PINWHEEL = 2, // Molinillo agresivo (rápido, girando)
|
||||
STAR = 3, // Estrella de 5 puntes (clone visual de Pentagon, comportament zigzag)
|
||||
BIG_PENTAGON = 4, // Pentàgon gegant tough (HP=10, chase lent — primer enemic HP>1)
|
||||
PENTAGON = 0, // Pentágono esquivador (zigzag)
|
||||
SQUARE = 1, // Square perseguidor (tracks ship)
|
||||
PINWHEEL = 2, // Molinillo agresivo (rápido, girando)
|
||||
STAR = 3, // Estrella de 5 puntes (clone visual de Pentagon, comportament zigzag)
|
||||
ORB = 4, // Orb gegant tough (HP=10, chase lent — primer enemic HP>1)
|
||||
};
|
||||
|
||||
// Forward declaration — EnemyConfig viu a enemy_config.hpp i s'inclou només a enemy.cpp.
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace {
|
||||
if (s == "square") { return EnemyType::SQUARE; }
|
||||
if (s == "pinwheel") { return EnemyType::PINWHEEL; }
|
||||
if (s == "star") { return EnemyType::STAR; }
|
||||
if (s == "big_pentagon") { return EnemyType::BIG_PENTAGON; }
|
||||
if (s == "orb") { return EnemyType::ORB; }
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
@@ -353,8 +353,8 @@ namespace {
|
||||
out.movement.rotation_proximity_multiplier = legacy.rotation_proximity_multiplier;
|
||||
out.movement.proximity_distance = legacy.proximity_distance;
|
||||
break;
|
||||
case EnemyType::BIG_PENTAGON:
|
||||
// Sense legacy fallback: el YAML del big_pentagon ha de definir
|
||||
case EnemyType::ORB:
|
||||
// Sense legacy fallback: el YAML de l'orb ha de definir
|
||||
// ai.movement explícitament. Default chase lent perquè el switch
|
||||
// siga exhaustiu i no falli si algú omet el bloc ai.
|
||||
out.movement.type = MovementType::CHASE;
|
||||
|
||||
@@ -13,7 +13,7 @@ EnemyConfig EnemyRegistry::pentagon_config;
|
||||
EnemyConfig EnemyRegistry::square_config;
|
||||
EnemyConfig EnemyRegistry::pinwheel_config;
|
||||
EnemyConfig EnemyRegistry::star_config;
|
||||
EnemyConfig EnemyRegistry::big_pentagon_config;
|
||||
EnemyConfig EnemyRegistry::orb_config;
|
||||
bool EnemyRegistry::loaded = false;
|
||||
|
||||
namespace {
|
||||
@@ -40,7 +40,7 @@ auto EnemyRegistry::loadAll() -> bool {
|
||||
loadOne("square", EnemyType::SQUARE, square_config) &&
|
||||
loadOne("pinwheel", EnemyType::PINWHEEL, pinwheel_config) &&
|
||||
loadOne("star", EnemyType::STAR, star_config) &&
|
||||
loadOne("big_pentagon", EnemyType::BIG_PENTAGON, big_pentagon_config);
|
||||
loadOne("orb", EnemyType::ORB, orb_config);
|
||||
loaded = OK;
|
||||
if (OK) {
|
||||
std::cout << "[EnemyRegistry] 5 configuracions d'enemic carregades.\n";
|
||||
@@ -62,8 +62,8 @@ auto EnemyRegistry::get(EnemyType type) -> const EnemyConfig& {
|
||||
return pinwheel_config;
|
||||
case EnemyType::STAR:
|
||||
return star_config;
|
||||
case EnemyType::BIG_PENTAGON:
|
||||
return big_pentagon_config;
|
||||
case EnemyType::ORB:
|
||||
return orb_config;
|
||||
}
|
||||
std::cerr << "[EnemyRegistry] FATAL: tipus desconegut\n";
|
||||
std::exit(EXIT_FAILURE);
|
||||
|
||||
@@ -27,6 +27,6 @@ class EnemyRegistry {
|
||||
static EnemyConfig square_config;
|
||||
static EnemyConfig pinwheel_config;
|
||||
static EnemyConfig star_config;
|
||||
static EnemyConfig big_pentagon_config;
|
||||
static EnemyConfig orb_config;
|
||||
static bool loaded;
|
||||
};
|
||||
|
||||
@@ -219,8 +219,8 @@ namespace StageSystem {
|
||||
out = EnemyType::PINWHEEL;
|
||||
} else if (type_str == "star") {
|
||||
out = EnemyType::STAR;
|
||||
} else if (type_str == "big_pentagon") {
|
||||
out = EnemyType::BIG_PENTAGON;
|
||||
} else if (type_str == "orb") {
|
||||
out = EnemyType::ORB;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace Systems::Collision {
|
||||
processWoundedDeaths(ctx); // expiran ANTES de ser tocadas por bala este frame
|
||||
detectBulletEnemy(ctx);
|
||||
// Wounded chain desactivat: era massa fàcil que un enemic ferit topés
|
||||
// amb el big_pentagon (10 HP) i el matés instantàniament. La regla
|
||||
// amb l'orb (10 HP) i el matés instantàniament. La regla
|
||||
// "ferit-toca-sa → ferit" queda permanentment fora.
|
||||
detectShipEnemy(ctx);
|
||||
detectBulletPlayer(ctx);
|
||||
|
||||
Reference in New Issue
Block a user