Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Ginger cat in the mall sells you water (#162)
Browse files Browse the repository at this point in the history
* Starting dialog with the ginger cat

* Fixing broken private items docs

* Adding visualization for GingerCat
  • Loading branch information
porkbrain authored May 18, 2024
1 parent 4ac6b58 commit 03ace25
Show file tree
Hide file tree
Showing 26 changed files with 568 additions and 114 deletions.
1 change: 1 addition & 0 deletions common/assets/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub mod portraits {
pub const BOLT: &str = "characters/portraits/bolt1.png";
pub const CAPY: &str = "characters/portraits/capy1.png";
pub const CAT: &str = "characters/portraits/cat1.png";
pub const GINGER_CAT: &str = "characters/portraits/gingercat1.png";
pub const EMIL: &str = "characters/portraits/emil1.png";
pub const MASTER: &str = "characters/portraits/master1.png";
pub const POOPER: &str = "characters/portraits/pooper1.png";
Expand Down
6 changes: 3 additions & 3 deletions common/story/src/dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,10 @@ impl Dialog {
cmd,
store,
if self.current_node == NodeName::Root {
error!("NextNodes::None in the root");
error!("Branching::None in the root");
NodeName::EndDialog
} else {
warn!("NextNodes::None, emerging");
warn!("Branching::None, emerging");
NodeName::Root
},
);
Expand Down Expand Up @@ -519,7 +519,7 @@ impl Dialog {
AdvanceOutcome::AwaitingPlayerChoice
}
} else {
warn!("NextNodes::Choice stopped all branches, emerging");
warn!("Branching::Choice stopped all branches, emerging");
self.transition_to(cmd, store, NodeName::Root);
AdvanceOutcome::Transition
}
Expand Down
8 changes: 4 additions & 4 deletions common/story/src/dialog/guard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ pub(crate) enum GuardCmd {
/// this command might not result in transition.
TryTransition(NodeName),
/// We want to show player choices in dialog.
/// This command says: in the [`Dialog::next_nodes`] array, at the
/// specified index, give us string that we should show to the player
/// as a choice.
/// This command says: in the [`Dialog::branching`]'s [`Branching::Choice`]
/// vector, at the specified index, give us string that we should show
/// to the player as a choice.
/// It's possible that the guard will decide to stop the current branch
/// with [`NextNode::Stop`].
/// with [`BranchStatus::Stop`].
PlayerChoice {
node_name: NodeName,
next_branch_index: usize,
Expand Down
2 changes: 2 additions & 0 deletions common/story/src/dialog/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct Namespace {
pub enum TypedNamespace {
BoltIsMean,
MarieBlabbering,
MrGoodWater,

// --------------------------------------------------------------
//
Expand All @@ -53,6 +54,7 @@ impl AsRef<str> for TypedNamespace {
fn as_ref(&self) -> &str {
use TypedNamespace::*;
match self {
MrGoodWater => "mr_good_water",
BoltIsMean => "bolt_is_mean",
MarieBlabbering => "marie_blabbering",
InElevator => "in_elevator",
Expand Down
4 changes: 4 additions & 0 deletions common/story/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ pub enum Character {
/// A character.
Cat,
/// A character.
GingerCat,
/// A character.
Emil,
/// A character.
Pooper,
Expand Down Expand Up @@ -136,6 +138,7 @@ impl Character {
Character::Bolt => "Bolt",
Character::Capy => "Capy",
Character::Cat => "Cat",
Character::GingerCat => "Rolo",
Character::Emil => "Emil",
Character::Pooper => "Pooper",
Character::Samizdat => "Samizdat",
Expand Down Expand Up @@ -185,6 +188,7 @@ impl Character {
Character::Bolt => BOLT,
Character::Capy => CAPY,
Character::Cat => CAT,
Character::GingerCat => GINGER_CAT,
Character::Emil => EMIL,
Character::Master => MASTER,
Character::Pooper => POOPER,
Expand Down
2 changes: 1 addition & 1 deletion common/visuals/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub enum AtlasAnimationEnd {
pub struct AtlasAnimationTimer {
pub(crate) inner: Timer,
/// 0 => means current is [`AtlasAnimation::play`].
/// 1 => extra_steps[0]
/// 1 => `extra_steps[0]`
/// and so on...
pub(crate) current_step: usize,
}
Expand Down
2 changes: 1 addition & 1 deletion dev/check
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ cargo clippy -- -D warnings

cargo test

RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --offline
RUSTDOCFLAGS="-D warnings" cargo doc --document-private-items --no-deps --offline
2 changes: 2 additions & 0 deletions dev/visualize_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def visualize_dialog(dialog_toml):
image_path += "marie1.png"
case "Bolt":
image_path += "bolt1.png"
case "GingerCat":
image_path += "gingercat1.png"
case _:
exit(f"Character {node['who']} not ready for visualization.")

Expand Down
69 changes: 69 additions & 0 deletions main_game/assets/dialogs/mr_good_water.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[root]
who = "GingerCat"
en = """*With what you percieved as a substantial effort the cat's eyes meet yours.
This cat is clearly out of it.*"""
[[node]]
en = "Good Water."
[[node]]
en = "You buy some?"
next = ["taste_test", "yes_water", "no_water"]

[[node]]
name = "yes_water"
who = "Winnie"
en = "Sure, let me have some. How much is it?"
next = "cost"

[[node]]
name = "taste_test"
who = "Winnie"
en = "Isn't this a taste test stand?"
# TODO: here's where we can add a roll
[[node]]
who = "GingerCat"
en = "No, it's a water stand."
next = "cost"

[[node]]
who = "GingerCat"
name = "cost"
en = "A bag of peas, please."
[[node]]
who = "Winnie"
en = "Peas? Do you not accept cash?"
[[node]]
who = "GingerCat"
en = "No peas no cash, please."
[[node]]
who = "Winnie"
en = "What? Anyway, I don't have no peas."
# TODO: We can add a note to the player's quest log here, and if they come with
# peas that can be obtained in the cult's garden, they can go to the next dialog
# with the cat.
[[node]]
who = "GingerCat"
en = "Then no water, please."
next = "get_ignored"

[[node]]
name = "no_water"
who = "Winnie"
en = "I'm good, thanks."
next = "get_ignored"

[[node]]
name = "get_ignored"
who = "GingerCat"
en = "*proceeds to stare past you as if you weren't even there*"
next = ["aggressive_leave", "leave"]

[[node]]
name = "aggressive_leave"
who = "Winnie"
en = "One rude little kitty"
next = "_end_dialog"

[[node]]
name = "leave"
en = "*leave*"
next = "_end_dialog"
Loading

0 comments on commit 03ace25

Please sign in to comment.