add a chat for Luna, he now repairs suit and refills oxygen tank

This commit is contained in:
yuni 2024-07-31 05:04:21 +02:00
parent a6c88e1344
commit 398266ea83
3 changed files with 32 additions and 3 deletions

View file

@ -958,5 +958,10 @@ pub fn update_chat_variables(
"player_oxygen_seconds", "player_oxygen_seconds",
(suit.oxygen / nature::OXY_S).to_string(), (suit.oxygen / nature::OXY_S).to_string(),
); );
vars.set_in_scope(
"$",
"player_suit_health_percent",
((suit.integrity * 100.0).round() as u8).to_string(),
);
} }
} }

View file

@ -345,10 +345,33 @@
- chat: Luna - chat: Luna
- "if $$player_suit_health_percent < 100":
- Holy shit!
- Look at all those scratches and tears on your suit!
- Let me fix that!
- set: grateful
- script: repairsuit
- "if $$player_oxygen_seconds <= 2000":
- And I topped off your oxygen tank while I'm at it.
- script: refilloxygen 1
- goto: mainnode
- "if $$player_oxygen_seconds <= 2000":
- Hey, do I see an empty oxygen tank? Have a refill, buddy!
- script: refilloxygen 1
- set: grateful
- goto: mainnode
- Oh hey you! - Oh hey you!
- include: generic_help_oxygen_entrypoint - label: mainnode
- goto: EXIT - if: "$grateful"
- include: generic_help_oxygen_handler Thank you so much!:
- No problem at all!
- set: grateful 0
- What are you up to?:
- I'm running a workshop here. Come by if you need any repairs!
- See you around!:
- Bye!
- goto: EXIT
- goto: mainnode
--- ---

View file

@ -272,6 +272,7 @@ scene 10 -30 20 test
relativeto player relativeto player
actor 700 -100 -1100 suitv2 actor 700 -100 -1100 suitv2
template person
relativeto player relativeto player
name Luna name Luna
id Luna id Luna