heart containers
This commit is contained in:
@@ -79,6 +79,9 @@ pub(crate) enum Action {
|
||||
/// Add `n` to the player's gem count (negative subtracts; the count is
|
||||
/// clamped at 0). Zero time cost. Applied to `GameState::player_gems`.
|
||||
AddGems(i64),
|
||||
/// Add `dh` to the player's health (clamped to `[0, max_health]`). Zero time
|
||||
/// cost. Applied to `GameState::player_health`.
|
||||
AlterHealth(i64),
|
||||
/// Give (`true`) or take (`false`) the named key color from the player.
|
||||
///
|
||||
/// Color must be one of `"blue"`, `"green"`, `"cyan"`, `"red"`, `"purple"`,
|
||||
@@ -197,6 +200,10 @@ pub(crate) fn action_to_map(action: &Action) -> rhai::Map {
|
||||
m.insert("type".into(), ds("AddGems"));
|
||||
m.insert("n".into(), Dynamic::from(*n));
|
||||
}
|
||||
Action::AlterHealth(dh) => {
|
||||
m.insert("type".into(), ds("AlterHealth"));
|
||||
m.insert("dh".into(), Dynamic::from(*dh));
|
||||
}
|
||||
Action::SetKey(color, present) => {
|
||||
m.insert("type".into(), ds("SetKey"));
|
||||
m.insert("color".into(), Dynamic::from(color.clone()));
|
||||
|
||||
Reference in New Issue
Block a user