Compare commits
3 commits
f4c25352b4
...
e9a1580ce7
Author | SHA1 | Date | |
---|---|---|---|
yuni | e9a1580ce7 | ||
yuni | 9a578e1093 | ||
yuni | a618414a1a |
|
@ -112,6 +112,7 @@ pub struct Talker {
|
||||||
pub chat_name: String,
|
pub chat_name: String,
|
||||||
pub actor_id: String,
|
pub actor_id: String,
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
|
pub counts_towards_achievement: bool,
|
||||||
pub pronoun: Option<String>,
|
pub pronoun: Option<String>,
|
||||||
pub talking_speed: f32,
|
pub talking_speed: f32,
|
||||||
}
|
}
|
||||||
|
@ -654,9 +655,11 @@ pub fn handle_new_conversations(
|
||||||
}
|
}
|
||||||
match (*chatdb).get_chat_by_id(&event.talker.chat_name) {
|
match (*chatdb).get_chat_by_id(&event.talker.chat_name) {
|
||||||
Ok(chat_id) => {
|
Ok(chat_id) => {
|
||||||
|
if event.talker.counts_towards_achievement {
|
||||||
if let Some(name) = &event.talker.name {
|
if let Some(name) = &event.talker.name {
|
||||||
ew_achievement.send(game::AchievementEvent::TalkTo(name.clone()));
|
ew_achievement.send(game::AchievementEvent::TalkTo(name.clone()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
let mut chat = Chat {
|
let mut chat = Chat {
|
||||||
internal_id: chat_id,
|
internal_id: chat_id,
|
||||||
position: vec![0],
|
position: vec![0],
|
||||||
|
|
|
@ -822,3 +822,10 @@
|
||||||
- Phew, that was close. Take care of yourself!
|
- Phew, that was close. Take care of yourself!
|
||||||
- Anything else?
|
- Anything else?
|
||||||
- goto: entrypoint
|
- goto: entrypoint
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
- chat: OxygenTank
|
||||||
|
- script: refilloxygen 1
|
||||||
|
- system: Oxygen refilled
|
||||||
|
|
14
src/cmd.rs
14
src/cmd.rs
|
@ -80,6 +80,7 @@ struct ParserState {
|
||||||
angular_momentum: DVec3,
|
angular_momentum: DVec3,
|
||||||
pronoun: Option<String>,
|
pronoun: Option<String>,
|
||||||
message_on_entry: Option<String>,
|
message_on_entry: Option<String>,
|
||||||
|
chat_counts_towards_achievements: bool,
|
||||||
is_sphere: bool,
|
is_sphere: bool,
|
||||||
is_player: bool,
|
is_player: bool,
|
||||||
is_lifeform: bool,
|
is_lifeform: bool,
|
||||||
|
@ -140,6 +141,7 @@ impl Default for ParserState {
|
||||||
angular_momentum: DVec3::new(0.03, 0.3, 0.09),
|
angular_momentum: DVec3::new(0.03, 0.3, 0.09),
|
||||||
pronoun: None,
|
pronoun: None,
|
||||||
message_on_entry: None,
|
message_on_entry: None,
|
||||||
|
chat_counts_towards_achievements: true,
|
||||||
is_sphere: false,
|
is_sphere: false,
|
||||||
is_player: false,
|
is_player: false,
|
||||||
is_lifeform: false,
|
is_lifeform: false,
|
||||||
|
@ -482,6 +484,9 @@ pub fn load_defs(mut ew_spawn: EventWriter<SpawnEvent>) {
|
||||||
["chatid", chat] => {
|
["chatid", chat] => {
|
||||||
state.chat = chat.to_string();
|
state.chat = chat.to_string();
|
||||||
}
|
}
|
||||||
|
["chat_achievement", "no"] => {
|
||||||
|
state.chat_counts_towards_achievements = false;
|
||||||
|
}
|
||||||
["scale", scale] => {
|
["scale", scale] => {
|
||||||
if let Ok(scale_float) = scale.parse::<f32>() {
|
if let Ok(scale_float) = scale.parse::<f32>() {
|
||||||
state.model_scale = scale_float;
|
state.model_scale = scale_float;
|
||||||
|
@ -832,6 +837,12 @@ fn spawn_scenes(
|
||||||
// command: density 2000
|
// command: density 2000
|
||||||
state.density = 2000.0;
|
state.density = 2000.0;
|
||||||
|
|
||||||
|
// command: chatid OxygenTank
|
||||||
|
state.chat = String::from("OxygenTank");
|
||||||
|
|
||||||
|
// command: chat_achievement no
|
||||||
|
state.chat_counts_towards_achievements = false;
|
||||||
|
|
||||||
// command: pointofinterest yes
|
// command: pointofinterest yes
|
||||||
ew_spawn.send(SpawnEvent(state));
|
ew_spawn.send(SpawnEvent(state));
|
||||||
}
|
}
|
||||||
|
@ -1085,12 +1096,15 @@ fn spawn_entities(
|
||||||
chat_name: state.chat.clone(),
|
chat_name: state.chat.clone(),
|
||||||
name: state.name.clone(),
|
name: state.name.clone(),
|
||||||
pronoun: state.pronoun.clone(),
|
pronoun: state.pronoun.clone(),
|
||||||
|
counts_towards_achievement: state.chat_counts_towards_achievements,
|
||||||
talking_speed: 1.0,
|
talking_speed: 1.0,
|
||||||
});
|
});
|
||||||
|
if state.chat_counts_towards_achievements {
|
||||||
if let Some(name) = &state.name {
|
if let Some(name) = &state.name {
|
||||||
achievement_tracker.all_people.insert(name.clone());
|
achievement_tracker.all_people.insert(name.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if state.is_vehicle {
|
if state.is_vehicle {
|
||||||
actor.insert(actor::Vehicle::default());
|
actor.insert(actor::Vehicle::default());
|
||||||
if let Some(name) = &state.name {
|
if let Some(name) = &state.name {
|
||||||
|
|
|
@ -575,6 +575,7 @@ actor -300 0 40 suitv2
|
||||||
id Drifter
|
id Drifter
|
||||||
name "梓涵"
|
name "梓涵"
|
||||||
chatid Drifter
|
chatid Drifter
|
||||||
|
chat_achievement no
|
||||||
alive no
|
alive no
|
||||||
wants maxvelocity none
|
wants maxvelocity none
|
||||||
oxygen 0.08
|
oxygen 0.08
|
||||||
|
@ -755,6 +756,7 @@ actor 100 -18000 2000 clippy
|
||||||
wants matchvelocitywith orbbusstopserenity
|
wants matchvelocitywith orbbusstopserenity
|
||||||
name "Rudy"
|
name "Rudy"
|
||||||
chatid NPCinCryoStasis
|
chatid NPCinCryoStasis
|
||||||
|
chat_achievement no
|
||||||
pronoun he
|
pronoun he
|
||||||
|
|
||||||
actor -184971e3 149410e3 -134273e3 clippy
|
actor -184971e3 149410e3 -134273e3 clippy
|
||||||
|
|
Loading…
Reference in a new issue