diff options
author | metamuffin <metamuffin@disroot.org> | 2025-09-30 14:31:51 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-09-30 14:31:51 +0200 |
commit | 7fc0484a680ab777174aec1c1ffcbb61cd19c479 (patch) | |
tree | 9816795e0f509ae1675241937961024f1906692c | |
parent | 792227a1c7398c903efe54213a9a290bb564509d (diff) | |
download | hurrycurry-7fc0484a680ab777174aec1c1ffcbb61cd19c479.tar hurrycurry-7fc0484a680ab777174aec1c1ffcbb61cd19c479.tar.bz2 hurrycurry-7fc0484a680ab777174aec1c1ffcbb61cd19c479.tar.zst |
tile decl conveyors; migrate duplex
-rw-r--r-- | data/maps/duplex.yaml | 88 | ||||
-rw-r--r-- | server/src/data/mod.rs | 26 |
2 files changed, 51 insertions, 63 deletions
diff --git a/data/maps/duplex.yaml b/data/maps/duplex.yaml index f7103741..8b4fecfb 100644 --- a/data/maps/duplex.yaml +++ b/data/maps/duplex.yaml @@ -37,72 +37,40 @@ map: tiles: "#": counter - "f": counter - "p": counter - "P": counter - ">": conveyor - "<": conveyor + "f": counter -i=foodprocessor + "p": counter -i=plate + "P": counter -i=pot + ">": conveyor --conveyor=1,0 + "<": conveyor --conveyor=-1,0 "t": table - "‹": counter-window:blue - "›": counter-window:blue - "«": counter-window:red - "»": counter-window:red + "‹": counter-window:blue --conveyor=-1,0 + "›": counter-window:blue --conveyor=1,0 + "«": counter-window:red --conveyor=-1,0 + "»": counter-window:red --conveyor=1,0 "s": sink "o": oven - "S": stove + "S": stove -i=pot "C": cutting-board - "R": rice-crate - "D": coconut-crate - "T": tomato-crate - "F": flour-crate - "L": leek-crate - "X": trash + "R": rice-crate -x + "D": coconut-crate -x + "T": tomato-crate -x + "F": flour-crate -x + "L": leek-crate -x + "X": trash -x - "c": chair - ".": floor - "'": grass - "=": fence - "*": tree - "~": path - "!": path - "_": path - "d": door:blue - "e": door:red - "█": wall:blue - "▒": wall:red - -tile_entities: - ">": !conveyor { dir: [1, 0] } - "<": !conveyor { dir: [-1, 0] } - "›": !conveyor { dir: [1, 0] } - "‹": !conveyor { dir: [-1, 0] } - "»": !conveyor { dir: [1, 0] } - "«": !conveyor { dir: [-1, 0] } - -items: - "S": pot - "P": pot - "w": plate - "p": plate - "f": foodprocessor + "c": chair -w + ".": floor -w + "'": grass -w + "=": fence -c + "*": tree -c + "~": path -w --chef-spawn + "!": path -w --customer-spawn + "_": path -w + "d": door:blue -w + "e": door:red -w + "█": wall:blue -c + "▒": wall:red -c entities: - !customers scaling_factor: 0.25 - -chef_spawn: "~" -customer_spawn: "~" - -walkable: - - door:blue - - door:red - - floor - - chair - - grass - - path - -collider: - - wall:blue - - wall:red - - tree - - fence diff --git a/server/src/data/mod.rs b/server/src/data/mod.rs index 2b3c9a69..74fae62c 100644 --- a/server/src/data/mod.rs +++ b/server/src/data/mod.rs @@ -91,6 +91,8 @@ struct TileArgs { customer_spawn: bool, #[clap(short = 'i', long)] item: Option<String>, + #[clap(long)] + conveyor: Option<String>, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -291,15 +293,33 @@ pub fn build_data( if tile_spec.customer_spawn { customer_spawn = Some(pos.as_vec2() + Vec2::splat(0.5)); } - if tile_spec.book { - entities.push(construct_entity(Some(pos), &EntityDecl::Book, ®)?); - } if tile_spec.walkable { tile_walkable.insert(tile); } if tile_spec.walkable || tile_spec.collider || tile_spec.exclusive { exclusive_tiles.entry(tile).or_default().extend(item); } + if tile_spec.book { + entities.push(construct_entity(Some(pos), &EntityDecl::Book, ®)?); + } + if let Some(off) = &tile_spec.conveyor { + let (x, y) = off + .split_once(",") + .ok_or(anyhow!("conveyor offset invalid format"))?; + let dir = IVec2::new(x.parse()?, y.parse()?); + entities.push(construct_entity( + Some(pos), + &EntityDecl::Conveyor { + dir: Some(dir), + filter: None, + filter_dir: None, + from: None, + speed: None, + to: None, + }, + ®, + )?); + } } } |