dance dance

This commit is contained in:
Maxicarlos08 2023-08-01 11:15:34 +02:00
parent ac68f0af7b
commit 6a4a6bab9f
No known key found for this signature in database
3 changed files with 23 additions and 12 deletions

View File

@ -88,7 +88,7 @@ impl<'a> System<'a> for Sys {
.filter(|(_, pos, _, _)| in_portal_range(pos.0, teleporter_pos.0))
})
{
if !matches!(character_state, CharacterState::Sit)
if !matches!(character_state, CharacterState::Dance)
|| (teleporter.requires_no_aggro && check_aggro(entity, pos.0))
{
if teleporting.is_some() {

View File

@ -2233,8 +2233,9 @@ impl Hud {
.map_or(Vec3::zero(), |e| e.0);
let over_pos = pos + Vec3::unit_z() * 1.5;
let is_campfire = body.is_campfire();
overitem::Overitem::new(
i18n.get_msg(if body.is_campfire() {
i18n.get_msg(if is_campfire {
"hud-crafting-campfire"
} else {
"hud-portal"
@ -2249,7 +2250,7 @@ impl Hud {
&global_state.window.key_layout,
vec![(
Some(GameInput::Interact),
i18n.get_msg("hud-sit").to_string(),
i18n.get_msg(if is_campfire { "hud-sit" } else { "gameinput-dance" }).to_string(),
)],
)
.x_y(0.0, 100.0)

View File

@ -1035,15 +1035,25 @@ impl PlayState for SessionState {
.is_some()
{
client.pick_up(*entity);
} else if client
.state()
.ecs()
.read_storage::<comp::Body>()
.get(*entity)
.map_or(false, |b| b.is_campfire())
{
// TODO: maybe start crafting instead?
client.toggle_sit();
} else if let Some(is_campfire) = {
let bodies = client
.state()
.ecs()
.read_storage::<comp::Body>();
bodies
.get(*entity)
.filter(|body| {
body.is_campfire() || body.is_portal()
})
.map(|body| body.is_campfire())
} {
if is_campfire {
// TODO: maybe start crafting instead?
client.toggle_sit();
} else {
client.toggle_dance();
}
} else {
client.npc_interact(*entity, Subject::Regular);
}