mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Arrows shouldn't turn into loot, staff shoots fireballs again
This commit is contained in:
parent
50e96efe6b
commit
835f3f5fe3
@ -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![
|
||||
|
@ -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
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user