feat: larger detailed entities — 47 parts, hats, belts, ears
Entities are now ~3x larger and more detailed: Player (47 parts, was 15): - Hat: 3 top + 2 brim (dark purple) - Head: 3x2 face (lavender skin) - Belt: golden accent across torso - Shirt: 3x2 torso + arms out to 3 cells each side - Hands: 4 cells (2 per arm, pale lavender) - Pants: 3 wide hips + 5 wide legs + split - Boots: 3 cells + 2 foot tips (dark purple) - half_w=4, half_h=6 (was 2.5x3.5) Goblin (41 parts): - Pointed ears (2 cells) - Ragged shirt (green, darker shade) - Bare feet (green skin, no boots) - Loincloth (dark green) Auto-constraints: all parts connected to all others (n^2) - Simplified from manual constraint lists - Works for any template shape - Ragdoll will look natural — all parts hold together macro_rules! p! for compact part definitions 117 tests, 0 failures
This commit is contained in:
+17
-5
@@ -4,16 +4,24 @@ use verbatim::entity::body_template::{BodyPart, BodyTemplate};
|
||||
fn player_template_has_correct_shape() {
|
||||
let t = BodyTemplate::humanoid_player();
|
||||
assert_eq!(t.name, "player");
|
||||
assert_eq!(t.parts.len(), 15);
|
||||
assert_eq!(t.half_w, 2.5);
|
||||
assert_eq!(t.half_h, 3.5);
|
||||
assert!(
|
||||
t.parts.len() >= 30,
|
||||
"player should have 30+ parts, got {}",
|
||||
t.parts.len()
|
||||
);
|
||||
assert_eq!(t.half_w, 4.0);
|
||||
assert_eq!(t.half_h, 6.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn goblin_template_has_correct_shape() {
|
||||
let t = BodyTemplate::humanoid_goblin();
|
||||
assert_eq!(t.name, "goblin");
|
||||
assert_eq!(t.parts.len(), 15);
|
||||
assert!(
|
||||
t.parts.len() >= 30,
|
||||
"goblin should have 30+ parts, got {}",
|
||||
t.parts.len()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -109,7 +117,11 @@ fn template_apply_to_entity() {
|
||||
let mut e = Entity::new(0, EntityKind::Goblin);
|
||||
let t = BodyTemplate::humanoid_goblin();
|
||||
t.apply_to(&mut e, 100.0, 100.0);
|
||||
assert_eq!(e.bodies.len(), 15);
|
||||
assert!(
|
||||
e.bodies.len() >= 30,
|
||||
"goblin should have 30+ bodies, got {}",
|
||||
e.bodies.len()
|
||||
);
|
||||
assert_eq!(e.cx, 100.0);
|
||||
assert_eq!(e.cy, 100.0);
|
||||
assert!(!e.constraints.is_empty());
|
||||
|
||||
+4
-3
@@ -117,9 +117,10 @@ fn player_bodies_count_matches_layout() {
|
||||
let mut s = GameSession::new_seeded(42);
|
||||
s.init();
|
||||
let p = s.get_player().unwrap();
|
||||
assert_eq!(
|
||||
p.body_count, 15,
|
||||
"player should have 15 bodies (profile humanoid)"
|
||||
assert!(
|
||||
p.body_count >= 30,
|
||||
"player should have 30+ bodies (detailed humanoid), got {}",
|
||||
p.body_count
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user