awlite

POSIX AWK port of Text Elite game
git clone git://git.luxferre.top/awlite.git
Log | Files | Refs | README

commit ccb3f2b18a1c76771a421ffa9c6b399fccb7e9f5
parent 026c365e50d9e602a5ec22501eb016a3ae515345
Author: Luxferre <lux@ferre>
Date:   Tue, 23 Jan 2024 15:04:06 +0200

1.6.2: fix hold display and buy/sell display

Diffstat:
MREADME | 2+-
Mawlite.awk | 10++++++----
2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/README b/README @@ -56,7 +56,7 @@ Fuel price is fixed at 0.2 CR/LY, you can hold 7LY of fuel at most. == Gameplay differences from the original TE 1.5 C version == -As of the current version, 1.6.1: +As of the current version, 1.6.2: * multiple typos corrected in text strings * the "cash" and "sneak" commands were removed since v1.6 diff --git a/awlite.awk b/awlite.awk @@ -1,5 +1,5 @@ # awlite: POSIX AWK port of Text Elite -# Version 1.6.1 +# Version 1.6.2 # Original high-level algorithms from Text Elite 1.5 by Ian Bell, 1999, 2015 # Porting, corrections, improvements and optimizations by Luxferre, 2024 # @@ -397,6 +397,8 @@ function dohold(a, t, i) { if(goods_units[i] == 0) t += shipshold[i] if(t > a) {printf("\nHold too full"); return 0} player["holdspace"] = a - t + player["cash"] -= game["cargoexpcost"] + printf("\nCargo bay expanded to %dt", game["cargoexpsize"]) return 1 } @@ -421,7 +423,7 @@ function dosell(s, sp, pname, pquant, i, t) { t = gamesell(i, pquant) pname = goods_names[i] # update real product name if(t > 0) { - printf("\nSelling %i%s of %s", t, goods_units[i], pname) + printf("\nSelling %i%s of %s", t, unitnames[goods_units[i]], pname) } else printf("\nCannot sell any %s", pname) return 1 } @@ -438,7 +440,7 @@ function dobuy(s, sp, pname, pquant, i, t) { t = gamebuy(i, pquant) pname = goods_names[i] # update real product name if(t > 0) { - printf("\nBuying %i%s of %s", t, goods_units[i], pname) + printf("\nBuying %i%s of %s", t, unitnames[goods_units[i]], pname) } else printf("\nCannot buy any %s", pname) return 1 } @@ -614,7 +616,7 @@ BEGIN { split("", globalseeds) # init galaxy seeds buildgalaxy(player["galaxynum"], globalseeds) # build the current galaxy genmarket(0, economies[player["currentplanet"]]) # build local market - printf("\nWelcome to awlite 1.6.1\n") + printf("\nWelcome to awlite 1.6.2\n") dohelp() # start the REPL printf("\n\nCash: %.1f> ", player["cash"]/10)