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

View file

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

View file

@ -36,12 +36,6 @@
- goto: thx - goto: thx
- Leave me alone!: - Leave me alone!:
- goto: EXIT - 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? - How are you feeling?

View file

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

View file

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

View file

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