summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorskylar <me@casper>2026-11-11 15:24:37 -0800
committerskylar <me@casper>2026-11-11 15:24:37 -0800
commit9ccf951473e21a8b90c25161156fa09a9b227a7b (patch)
treee7bd9858a4cdbc5ae50069db8ca0cf868e436dec /src/main.rs
parentd36c54d996f3c14ae811312dbbe621e12a39edde (diff)
Orrery 0.1.0: the galaxy, flight, cities, inventory and saves
Grows the derelict crawler into the whole game, and gets it ready to publish. - A galaxy of star systems joined by lanes, split between four peoples' territories, with a star map and a system map. Systems are modelled with Kepler orbits, moons inside their Hill spheres, belts past the frost line and stations at Lagrange points. - Flight around one place at a time: arcade flight with a throttle fallback where held keys can't be detected, mining rocks for ore, landing, docking at stations, and boarding wrecks that come and go by the calendar. - Your ship to walk about, and capital cities to land at: generated plans with walls, quarters and streets, building interiors, shops, taverns, scholars and armourers. - Fighting with a weapon and a gun ready, six damage types and how each monster takes them, and armour that guards, wears and can be mended. - Everything you own has a weight: a vim-keyed inventory, a pack and the ship's lockers, and trade in ore, salvage, arms and fuel. - Characters with a people and a ship of their own, saved as versioned JSON on every scene change and on quit, with a character sheet, a saves list and a pause menu wherever you are. - `orrery weapons`, `armour`, `galaxy`, `system` and `town` print the generators' output without the TUI. - Release: README install steps for macOS and Linux, a Makefile whose install also works with macOS's install, an MIT licence, and Cargo metadata with rust-version 1.88. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index e2b74d3..e46a1e6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,22 +1,27 @@
//! Orrery: an ASCII sci-fi-fantasy game.
//!
-//! `orrery` plays; `orrery names` and `orrery ship` print what the
-//! generators make, without the TUI.
+//! `orrery` plays; `orrery names`, `ship`, `galaxy`, `system` and `town` print
+//! what the generators make, without the TUI.
mod app;
mod cli;
mod dungeon;
+mod items;
mod names;
+mod save;
mod scenes;
mod seed;
+mod space;
mod term;
+mod town;
+mod trade;
use std::process::ExitCode;
fn main() -> ExitCode {
let args: Vec<String> = std::env::args().skip(1).collect();
match cli::parse(&args) {
- Ok(cli::Command::Play { seed }) => match app::run(seed.unwrap_or_else(seed::from_clock)) {
+ Ok(cli::Command::Play { seed }) => match app::run(seed) {
Ok(()) => ExitCode::SUCCESS,
Err(e) => {
eprintln!("orrery: {e}");
@@ -31,6 +36,26 @@ fn main() -> ExitCode {
cli::print_ship(seed, which);
ExitCode::SUCCESS
}
+ Ok(cli::Command::Weapons { seed, count }) => {
+ cli::print_weapons(seed, count);
+ ExitCode::SUCCESS
+ }
+ Ok(cli::Command::Armour { seed, count }) => {
+ cli::print_armour(seed, count);
+ ExitCode::SUCCESS
+ }
+ Ok(cli::Command::Galaxy { seed }) => {
+ cli::print_galaxy(seed);
+ ExitCode::SUCCESS
+ }
+ Ok(cli::Command::System { seed, which }) => {
+ cli::print_system(seed, which);
+ ExitCode::SUCCESS
+ }
+ Ok(cli::Command::Town { seed, which, inside }) => {
+ cli::print_town(seed, which, inside);
+ ExitCode::SUCCESS
+ }
Ok(cli::Command::Help) => {
print!("{}", cli::USAGE);
ExitCode::SUCCESS