Arrows shouldn't turn into loot, staff shoots fireballs again

This commit is contained in:
timokoesters 2020-03-20 11:25:53 +01:00
parent 50e96efe6b
commit 835f3f5fe3
2 changed files with 54 additions and 28 deletions

View File

@ -114,11 +114,31 @@ impl ToolData {
recover_duration: Duration::from_millis(400),
base_damage: 5,
}],
Staff(_) => vec![BasicMelee {
buildup_duration: Duration::from_millis(400),
recover_duration: Duration::from_millis(300),
base_damage: 7,
}],
Staff(_) => vec![
BasicMelee {
buildup_duration: Duration::from_millis(400),
recover_duration: Duration::from_millis(300),
base_damage: 7,
},
BasicRanged {
projectile: Projectile {
hit_ground: vec![projectile::Effect::Vanish],
hit_wall: vec![projectile::Effect::Vanish],
hit_entity: vec![
projectile::Effect::Damage(HealthChange {
// TODO: This should not be fixed (?)
amount: -8,
cause: HealthSource::Item,
}),
projectile::Effect::Vanish,
],
time_left: Duration::from_secs(5),
owner: None,
},
projectile_body: Body::Object(object::Body::BoltFire),
recover_duration: Duration::from_millis(800),
},
],
Shield(_) => vec![BasicBlock],
Debug(kind) => match kind {
DebugKind::Boost => vec![

View File

@ -91,29 +91,35 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
.write_storage::<comp::CharacterState>()
.insert(entity, comp::CharacterState::default());
} else {
// Replace npc with loot
let _ = state
.ecs()
.write_storage()
.insert(entity, Body::Object(object::Body::Pouch));
let _ = state.ecs().write_storage().insert(
entity,
assets::load_expect_cloned::<Item>("common.items.cheese"),
);
state.ecs().write_storage::<comp::Stats>().remove(entity);
state.ecs().write_storage::<comp::Agent>().remove(entity);
state
.ecs()
.write_storage::<comp::LightEmitter>()
.remove(entity);
state
.ecs()
.write_storage::<comp::CharacterState>()
.remove(entity);
state
.ecs()
.write_storage::<comp::Controller>()
.remove(entity);
if state.ecs().read_storage::<comp::Agent>().contains(entity) {
// Replace npc with loot
let _ = state
.ecs()
.write_storage()
.insert(entity, Body::Object(object::Body::Pouch));
let _ = state.ecs().write_storage().insert(
entity,
assets::load_expect_cloned::<Item>("common.items.cheese"),
);
state.ecs().write_storage::<comp::Stats>().remove(entity);
state.ecs().write_storage::<comp::Agent>().remove(entity);
state
.ecs()
.write_storage::<comp::LightEmitter>()
.remove(entity);
state
.ecs()
.write_storage::<comp::CharacterState>()
.remove(entity);
state
.ecs()
.write_storage::<comp::Controller>()
.remove(entity);
} else {
if let Err(err) = state.delete_entity_recorded(entity) {
error!("Failed to delete destroyed entity: {:?}", err);
}
}
// TODO: Add Delete(time_left: Duration) component
/*