mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'pets' of https://gitlab.com/veloren/veloren into pets
Former-commit-id: f6ab802ebcb24a6c9c5d1c4343ce6b4d68cf942d
This commit is contained in:
commit
b4e9359e3f
@ -266,7 +266,6 @@ fn handle_petwolf(server: &mut Server, entity: EcsEntity, args: String, action:
|
|||||||
.notify(entity, ServerMsg::Chat("You have no position!".to_owned())),
|
.notify(entity, ServerMsg::Chat("You have no position!".to_owned())),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_help(server: &mut Server, entity: EcsEntity, _args: String, _action: &ChatCommand) {
|
fn handle_help(server: &mut Server, entity: EcsEntity, _args: String, _action: &ChatCommand) {
|
||||||
for cmd in CHAT_COMMANDS.iter() {
|
for cmd in CHAT_COMMANDS.iter() {
|
||||||
server
|
server
|
||||||
|
@ -600,6 +600,57 @@ impl FigureMgr {
|
|||||||
|
|
||||||
state.update(renderer, pos.0, dir.0, col);
|
state.update(renderer, pos.0, dir.0, col);
|
||||||
|
|
||||||
|
state.update(renderer, pos.0, dir.0, col);
|
||||||
|
}
|
||||||
|
Body::QuadrupedMedium(body) => {
|
||||||
|
let state =
|
||||||
|
self.QuadrupedMedium_states
|
||||||
|
.entry(entity)
|
||||||
|
.or_insert_with(|| {
|
||||||
|
FigureState::new(renderer, QuadrupedMediumSkeleton::new())
|
||||||
|
});
|
||||||
|
|
||||||
|
let target_skeleton = match animation_history.current {
|
||||||
|
comp::Animation::Run => quadrupedmedium::RunAnimation::update_skeleton(
|
||||||
|
state.skeleton_mut(),
|
||||||
|
(vel.0.magnitude(), time),
|
||||||
|
animation_history.time,
|
||||||
|
),
|
||||||
|
comp::Animation::Idle => {
|
||||||
|
quadrupedmedium::IdleAnimation::update_skeleton(
|
||||||
|
state.skeleton_mut(),
|
||||||
|
time,
|
||||||
|
animation_history.time,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
comp::Animation::Jump => {
|
||||||
|
quadrupedmedium::JumpAnimation::update_skeleton(
|
||||||
|
state.skeleton_mut(),
|
||||||
|
(vel.0.magnitude(), time),
|
||||||
|
animation_history.time,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO!
|
||||||
|
_ => state.skeleton_mut().clone(),
|
||||||
|
};
|
||||||
|
|
||||||
|
state.skeleton.interpolate(&target_skeleton);
|
||||||
|
|
||||||
|
// Change in health as color!
|
||||||
|
let col = stats
|
||||||
|
.and_then(|stats| stats.hp.last_change)
|
||||||
|
.map(|(change_by, change_time)| Rgba::new(1.0, 0.7, 0.7, 1.0))
|
||||||
|
.unwrap_or(Rgba::broadcast(1.0));
|
||||||
|
|
||||||
|
// Change in health as color!
|
||||||
|
let col = stats
|
||||||
|
.and_then(|stats| stats.hp.last_change)
|
||||||
|
.map(|(change_by, change_time)| Rgba::new(1.0, 0.7, 0.7, 1.0))
|
||||||
|
.unwrap_or(Rgba::broadcast(1.0));
|
||||||
|
|
||||||
|
state.update(renderer, pos.0, dir.0, col);
|
||||||
|
|
||||||
state.update(renderer, pos.0, dir.0, col);
|
state.update(renderer, pos.0, dir.0, col);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user