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

Commit

Permalink
Adding NPCs around for demo purposes (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
porkbrain authored Jun 14, 2024
1 parent 79df69b commit 23e19e5
Show file tree
Hide file tree
Showing 21 changed files with 965 additions and 528 deletions.
2 changes: 2 additions & 0 deletions common/assets/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ pub mod character_atlases {
pub const BOLT: &str = "characters/atlases/bolt1.png";
pub const WHITE_CAT: &str = "characters/atlases/whitecat1.png";
pub const COOPER: &str = "characters/atlases/cooper1.png";
pub const OTTER: &str = "characters/atlases/otter1.png";
pub const PHOEBE: &str = "characters/atlases/phoebe1.png";

pub const WINNIE_COLS: usize = 12;
}
Expand Down
6 changes: 6 additions & 0 deletions common/story/src/dialog/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ pub enum TypedNamespace {
MarieBlabbering,
MrGoodWater,
InitialCooper,
InitialSamizdat,
InitialOtter,
InitialPhoebe,

// --------------------------------------------------------------
//
Expand All @@ -60,6 +63,9 @@ impl AsRef<str> for TypedNamespace {
MarieBlabbering => "marie_blabbering",
InElevator => "in_elevator",
InitialCooper => "initial_cooper",
InitialSamizdat => "initial_samizdat",
InitialOtter => "initial_otter",
InitialPhoebe => "initial_phoebe",
}
}
}
Expand Down
25 changes: 23 additions & 2 deletions common/story/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl Character {
Character::Emil => "Emil",
Character::Cooper => "Cooper",
Character::Samizdat => "Samizdat",
Character::Otter => "Otter",
Character::Otter => "Mr Otter",
}
}

Expand All @@ -152,6 +152,8 @@ impl Character {
Character::WhiteCat => WHITE_CAT,
Character::Bolt => BOLT,
Character::Cooper => COOPER,
Character::Otter => OTTER,
Character::Phoebe => PHOEBE,
_ => unimplemented!(),
}
}
Expand Down Expand Up @@ -204,11 +206,15 @@ impl Character {
}
Character::Bolt => Some((STANDARD_SIZE, 12, 1, default())),
Character::Marie => Some((STANDARD_SIZE, 15, 1, default())),
Character::Samizdat => Some((STANDARD_SIZE, 15, 1, default())),
Character::Samizdat => Some((STANDARD_SIZE, 12, 2, default())),
Character::WhiteCat => {
Some((Vec2::new(48.0, 46.0), 6, 1, default()))
}
Character::Cooper => Some((Vec2::new(25.0, 29.0), 2, 1, default())),
Character::Otter => Some((Vec2::new(36.0, 46.0), 7, 1, default())),
Character::Phoebe => {
Some((Vec2::new(25.0, 46.0), 12, 2, default()))
}
_ => None,
}
}
Expand Down Expand Up @@ -281,6 +287,16 @@ impl Character {
// after a few seconds, winnie puts her hands in her pockets
(Self::Winnie, Bottom) if how_long.as_secs() > 5 => WINNIE_COLS,

(Self::Otter, TopRight | Top | TopLeft | Left) => 2,
(Self::Otter, BottomRight | Bottom | BottomLeft | Right) => {
(3 * time.elapsed_wrapped().as_secs() as usize / 4) % 2
}

// after a few seconds, samizdat puts her hands in her pockets
(Self::Samizdat, _) if how_long.as_secs() > 2 => 12,

(Self::Phoebe, _) if how_long.as_secs() > 2 => 13,

(_, Bottom) => 0,
(_, Top) => 1,
(_, Right | TopRight | BottomRight) => 6,
Expand Down Expand Up @@ -323,6 +339,11 @@ impl Character {
(Self::Winnie, TopRight) => WINNIE_COLS + 7 + extra,
(Self::Winnie, TopLeft) => WINNIE_COLS + 10 + extra,

(Self::Otter, TopRight | Right | BottomRight) => 3 + extra,
(Self::Otter, TopLeft | Left | BottomLeft) => 5 + extra,
(Self::Otter, Bottom) => extra,
(Self::Otter, Top) => 2,

// defaults
(_, Top) => 2 + extra,
(_, Bottom) => 4 + extra,
Expand Down
4 changes: 4 additions & 0 deletions dev/visualize_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def visualize_dialog(dialog_toml):
image_path += "gingercat1.png"
case "Cooper":
image_path += "cooper1.png"
case "Samizdat":
image_path += "samizdat1.png"
case "Otter":
image_path += "otter1.png"
case _:
exit(f"Character {node['who']} not ready for visualization.")

Expand Down
Binary file modified main_game/assets/characters/atlases/otter1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions main_game/assets/dialogs/initial_otter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[root]
who = "Winnie"
en = "Hey"
[[node]]
who = "Otter"
en = "I don't have a dialog yet"
next = "_end_dialog"
7 changes: 7 additions & 0 deletions main_game/assets/dialogs/initial_phoebe.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[root]
who = "Winnie"
en = "Hey"
[[node]]
who = "Phoebe"
en = "I don't have a dialog yet"
next = "_end_dialog"
7 changes: 7 additions & 0 deletions main_game/assets/dialogs/initial_samizdat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[root]
who = "Winnie"
en = "Hey"
[[node]]
who = "Samizdat"
en = "I don't have a dialog yet"
next = "_end_dialog"
51 changes: 51 additions & 0 deletions main_game/assets/maps/downtown.ron
Original file line number Diff line number Diff line change
Expand Up @@ -4510,16 +4510,67 @@
(x: -1, y: -248): [Wall],
(x: -1, y: -247): [Wall],
(x: -1, y: -246): [Wall],
(x: 4, y: 49): [Wall],
(x: 4, y: 50): [Wall],
(x: 4, y: 51): [Wall],
(x: 4, y: 52): [Wall],
(x: 5, y: 49): [Wall],
(x: 5, y: 50): [Wall],
(x: 5, y: 51): [Wall],
(x: 5, y: 52): [Wall],
(x: 6, y: 49): [Wall],
(x: 6, y: 50): [Wall],
(x: 6, y: 51): [Wall],
(x: 6, y: 52): [Wall],
(x: 7, y: 49): [Wall],
(x: 7, y: 50): [Wall],
(x: 7, y: 51): [Wall],
(x: 7, y: 52): [Wall],
(x: 8, y: 49): [Wall],
(x: 8, y: 50): [Wall],
(x: 8, y: 51): [Wall],
(x: 8, y: 52): [Wall],
(x: 9, y: 49): [Wall],
(x: 9, y: 50): [Wall],
(x: 9, y: 51): [Wall],
(x: 9, y: 52): [Wall],
(x: 10, y: 49): [Wall],
(x: 10, y: 50): [Wall],
(x: 10, y: 51): [Wall],
(x: 10, y: 52): [Wall],
(x: 13, y: -291): [Wall],
(x: 13, y: -290): [Wall],
(x: 14, y: -291): [Wall],
(x: 14, y: -290): [Wall],
(x: 14, y: 46): [Wall],
(x: 14, y: 47): [Wall],
(x: 14, y: 48): [Wall],
(x: 14, y: 49): [Wall],
(x: 14, y: 50): [Wall],
(x: 14, y: 51): [Wall],
(x: 15, y: -291): [Wall],
(x: 15, y: -290): [Wall],
(x: 15, y: 45): [Wall],
(x: 15, y: 46): [Wall],
(x: 15, y: 47): [Wall],
(x: 15, y: 48): [Wall],
(x: 15, y: 49): [Wall],
(x: 15, y: 50): [Wall],
(x: 15, y: 51): [Wall],
(x: 16, y: -291): [Wall],
(x: 16, y: -290): [Wall],
(x: 16, y: 45): [Wall],
(x: 16, y: 46): [Wall],
(x: 16, y: 47): [Wall],
(x: 16, y: 48): [Wall],
(x: 16, y: 49): [Wall],
(x: 16, y: 50): [Wall],
(x: 17, y: -291): [Wall],
(x: 17, y: -290): [Wall],
(x: 17, y: 46): [Wall],
(x: 17, y: 47): [Wall],
(x: 17, y: 48): [Wall],
(x: 17, y: 49): [Wall],
(x: 17, y: 51): [Wall],
(x: 17, y: 52): [Wall],
(x: 17, y: 53): [Wall],
Expand Down
4 changes: 4 additions & 0 deletions main_game/assets/scenes/building1_player_floor.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ position = Vector2(-70, -63)
texture = ExtResource("31_wa4ug")

[node name="HallwayDoor3" type="AnimatedSprite2D" parent="."]
self_modulate = Color(0.0509804, 0.054902, 0.121569, 1)
position = Vector2(-165, 187)
sprite_frames = SubResource("SpriteFrames_j7cpw")

Expand All @@ -826,14 +827,17 @@ position = Vector2(-228, 128)
texture = ExtResource("36_458u3")

[node name="BedWooden" type="Sprite2D" parent="."]
self_modulate = Color(0.0509804, 0.054902, 0.121569, 1)
position = Vector2(161, 161)
texture = ExtResource("37_6lbmy")

[node name="BathHorizontal" type="Sprite2D" parent="."]
self_modulate = Color(0.0509804, 0.054902, 0.121569, 1)
position = Vector2(-180, 137)
texture = ExtResource("38_mdm3q")

[node name="Toilet2" type="Sprite2D" parent="."]
self_modulate = Color(0.0509804, 0.054902, 0.121569, 1)
position = Vector2(-199, 189)
texture = ExtResource("7_3q0vg")

Expand Down
Loading

0 comments on commit 23e19e5

Please sign in to comment.