Added bosses, improved secret object spawn rates

This commit is contained in:
Joshua Barretto
2019-08-02 19:56:37 +01:00
parent 6ff75dcf0b
commit 677c5781ba
13 changed files with 73 additions and 16 deletions

View File

@ -270,6 +270,17 @@ impl Server {
// Handle chunk supplement
for npc in supplement.npcs {
let mut stats = comp::Stats::new("Test".to_string());
let mut body = comp::Body::QuadrupedMedium(comp::quadruped_medium::Body::random());
let mut scale = 1.0;
if npc.boss {
stats.health.set_maximum(400);
stats.health.set_current(400);
scale = 2.5;
body = comp::Body::Humanoid(comp::humanoid::Body::random());
}
self.state
.ecs_mut()
.create_entity_synced()
@ -277,11 +288,11 @@ impl Server {
.with(comp::Vel(Vec3::zero()))
.with(comp::Ori(Vec3::unit_y()))
.with(comp::Controller::default())
.with(comp::Body::Humanoid(comp::humanoid::Body::random()))
.with(comp::Stats::new("Test".to_string()))
.with(body)
.with(stats)
.with(comp::ActionState::default())
.with(comp::Agent::Enemy { target: None })
.with(comp::ForceUpdate)
.with(comp::Agent::enemy())
.with(comp::Scale(scale))
.build();
}
}