Compare commits

...

7 commits

7 changed files with 72 additions and 47 deletions

View file

@ -26,8 +26,8 @@ pub const CHATS: &[&str] = &[
include_str!("chats/thebe.yaml"),
];
pub const CONTACTS: &[&str] = &["icarus", "travel", "luna", "nox"];
pub const CONTACTS_PRETTY: &[&str] = &["Icarus", "FASTravel", "Luna", "Nox"];
pub const CONTACTS: &[&str] = &["travel", "luna"];
pub const CONTACTS_PRETTY: &[&str] = &["FASTravel", "Luna"];
pub const CONTACTS_UNKNOWN: &str = "[Unknown]";
pub const TEXT_CONTINUE: &str = "Continue...";
@ -902,6 +902,7 @@ pub fn handle_chat_scripts(
mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
mut ew_effect: EventWriter<visual::SpawnEffectEvent>,
mut ew_achievement: EventWriter<game::AchievementEvent>,
mut log: ResMut<hud::Log>,
id2pos: Res<game::Id2Pos>,
id2v: Res<game::Id2V>,
mut prefs: ResMut<Preferences>,
@ -1045,6 +1046,17 @@ pub fn handle_chat_scripts(
if CONTACTS.contains(&param1) {
let param1_string = param1.to_string();
if !prefs.contacts.contains(&param1_string) {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Achieve));
let name = if let Some(index) = CONTACTS.iter().position(|&x| x == param1) {
CONTACTS_PRETTY[index]
} else {
"ERROR"
};
log.add(
format!("Unlocked phone number: {name}!"),
"".to_string(),
hud::LogLevel::Achievement,
);
prefs.contacts.push(param1_string);
prefs.save();
}
@ -1053,6 +1065,7 @@ pub fn handle_chat_scripts(
}
}
"installlunabackup" => {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Achieve));
prefs.luna_backup = true;
prefs.save()
}

View file

@ -25,6 +25,7 @@
- label: interesting
- Serenity Station is famous for the best pizza across the Jovian Rings.
- Look for the neon sign of the pizzeria nearby.
- goto: fastravel
---
@ -40,6 +41,7 @@
- This area is an industrial paradise for asteroid miners.
- Though it has been recently abandoned due to the excessive particle radiation.
- I advise you to minimize the duration of your stay here.
- goto: fastravel
---
@ -53,25 +55,28 @@
- include: BusStops
- label: interesting
- The main attraction around here is the gorgeous view onto Jupiter from far up ahead.
- goto: fastravel
---
- chat: BusStops
- WHY IS EVERYTHING SO GREEN???:
- We advertise our services with the signature green cross.
- Thanks to this, you will find us even when your radio systems are damaged.
- FASTravel provides a beacon in the dark, creating a safer place for everybody.
- goto: fastravel
- Bus stop?! How does this work?:
- FASTravel is the most convenient way to travel the vast distances of space.
- Just activate your suit's built-in cryostasis. A FASTravel carrier will pick you up and you will wake up at your destination in the blink of an eye.
- Of course we will supply you with free oxygen and ensure your safety.
- goto: fastravel
- Can I take a spacecraft with me?:
- Absolutely.
- I wish I could use this shuttle service from anywhere!:
- Actually, you can!
- if phone$travel:
- Just give us a phone call, we'll pick you up!
- goto: fastravel
- script: registercontact travel
- Here's our phone number, call us any time and we'll pick you up!
- goto: fastravel
- if: $busstop != serenity
Take me to Serenity Station, please.:
- FASTravel wishes you a pleasant journey.
- script: cryofadeout
- sleep: 2
- script: cryotrip serenity
- goto: EXIT
- if: $busstop != farview
Take me to Farview Station, please.:
- FASTravel wishes you a pleasant journey.
@ -86,22 +91,27 @@
- sleep: 2
- script: cryotrip metisprime
- goto: EXIT
- if: $busstop != serenity
Take me to Serenity Station, please.:
- FASTravel wishes you a pleasant journey.
- script: cryofadeout
- sleep: 2
- script: cryotrip serenity
- goto: EXIT
- Can you please fill up my oxygen tank without taking me anywhere?:
- Can you please fill up my oxygen tank?:
- script: refilloxygen 1000
- Of course, you can count on FASTravel!
- I wish I could use your services from anywhere!:
- Actually, you can!
- script: registercontact travel
- Here's our phone number, call us any time!
- Is there anything interesting to do around here?:
- goto: interesting
- goto: fastravel
- I have some questions...:
- Of course, go ahead!
- WHY IS EVERYTHING SO GREEN???:
- We advertise our services with the signature green cross.
- Thanks to this, you will find us even when your radio systems are damaged.
- FASTravel provides a beacon in the dark, creating a safer place for everybody.
- goto: fastravel
- Bus stop?! How does this work?:
- FASTravel is the most convenient way to travel the vast distances of space.
- Just activate your suit's built-in cryostasis. A FASTravel carrier will pick you up and you will wake up at your destination in the blink of an eye.
- Of course we will supply you with free oxygen and ensure your safety.
- goto: fastravel
- Can I take a spacecraft with me?:
- Absolutely.
- goto: fastravel
- Is there anything interesting to do around here?:
- goto: interesting
- No, thank you.:
- Feel free to come back any time.
- goto: EXIT

View file

@ -36,12 +36,6 @@
- goto: thx
- Leave me alone!:
- goto: EXIT
- Micrometeorites?:
- Those tiny 混蛋 that fly right through you, leaving holes in your suit. And your body.
- Ouch! Thank you so much.:
- goto: thx
- Whatever... I didn't ask for this.:
- goto: didntask
- How are you feeling?

View file

@ -563,7 +563,7 @@ actor -3300 10 0 pizzeria
rotationy -90
pronoun he
actor 30 -12 -40 suitv2
actor 30 0 -40 suitv2
template person
relativeto player
name Icarus

View file

@ -150,9 +150,7 @@ impl Cycle {
Some(current_index - 1)
}
}
Cycle::Unchanged => {
Some(current_index)
}
Cycle::Unchanged => Some(current_index),
}
}
}
@ -288,9 +286,7 @@ pub fn handle_game_event(
pronoun: None,
talking_speed: 0.0,
};
ew_conv.send(chat::StartConversationEvent {
talker: talker,
});
ew_conv.send(chat::StartConversationEvent { talker: talker });
}
}
}

View file

@ -481,12 +481,20 @@ pub fn update_menu(
id2pos.0.get(cmd::ID_PLAYER),
id2pos.0.get(cmd::ID_JUPITER),
) {
let (clock_max, clock_current) =
nature::pos_to_orbit_time(*player_pos, *jupiter_pos, nature::JUPITER_MASS);
let clock = if player_pos.y.abs() < 1e7 && player_pos.distance(*jupiter_pos) < 1e10 {
let (clock_max, clock_current) =
nature::pos_to_orbit_time(*player_pos, *jupiter_pos, nature::JUPITER_MASS);
format!(
"{} of {}",
nature::format_seconds_to_hour_min(clock_current),
nature::format_seconds_to_hour_min(clock_max)
)
} else {
String::from("ERROR: Not in orbit around Jupiter.")
};
text.sections[0].value = format!(
"Orbital Clock:\n{} of {}\n{} {}",
nature::format_seconds_to_hour_min(clock_current),
nature::format_seconds_to_hour_min(clock_max),
"Orbital Clock:\n{}\n{} {}",
clock,
GAME_NAME,
settings.version.as_str()
);

View file

@ -263,5 +263,9 @@ pub fn pos_to_orbit_time(pos: DVec3, orbited_pos: DVec3, orbited_mass: f64) -> (
}
pub fn format_seconds_to_hour_min(seconds: f64) -> String {
return format!("{:02.0}:{:02.0}", seconds / 3600.0, (seconds % 3600.0) / 60.0);
return format!(
"{:02.0}:{:02.0}",
seconds / 3600.0,
(seconds % 3600.0) / 60.0
);
}