Implemented hyperspace jump cost
This commit is contained in:
+11
-5
@@ -1,7 +1,7 @@
|
|||||||
# awlite: POSIX AWK port of Text Elite 1.5
|
# awlite: POSIX AWK port of Text Elite 1.5
|
||||||
# Version 1.5.1-alpha
|
# Version 1.5.2
|
||||||
# Original C version by Ian Bell, 1999, 2015
|
# Original C version by Ian Bell, 1999, 2015
|
||||||
# Porting, corrections and optimizations by Luxferre, 2024
|
# Porting, corrections, improvements and optimizations by Luxferre, 2024
|
||||||
#
|
#
|
||||||
# Tested on: nawk/one-true-awk, busybox awk, gawk --posix, mawk -W posix
|
# Tested on: nawk/one-true-awk, busybox awk, gawk --posix, mawk -W posix
|
||||||
# Should run on any current POSIX-compliant AWK implementation but
|
# Should run on any current POSIX-compliant AWK implementation but
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
# Gameplay differences from the original C version of TE 1.5:
|
# Gameplay differences from the original C version of TE 1.5:
|
||||||
# - multiple typos corrected in text strings
|
# - multiple typos corrected in text strings
|
||||||
# - the "cash" and "sneak" commands are only available to the REPL if running with -v CHEAT=1
|
# - the "cash" and "sneak" commands are only available to the REPL if running with -v CHEAT=1
|
||||||
|
# - galaxy jumps are no longer free and cost 5000 credits each (like in OOlite)
|
||||||
# - alien items are available by default, can be overridden with -v NO_ALIEN_ITEMS=1
|
# - alien items are available by default, can be overridden with -v NO_ALIEN_ITEMS=1
|
||||||
# - economy names are no longer shortened
|
# - economy names are no longer shortened
|
||||||
# - the "politically correct" goods names are turned on with -v CENSORED=1
|
# - the "politically correct" goods names are turned on with -v CENSORED=1
|
||||||
@@ -387,9 +388,13 @@ function dosneak(s, kp, r) {
|
|||||||
|
|
||||||
# jump to next galaxy (planet number is preserved)
|
# jump to next galaxy (planet number is preserved)
|
||||||
function dogalhyp() {
|
function dogalhyp() {
|
||||||
player["galaxynum"]++
|
if(player["cash"] > game["galhypcost"]) {
|
||||||
if(player["galaxynum"] == 9) player["galaxynum"] = 1
|
player["cash"] -= game["galhypcost"]
|
||||||
buildgalaxy(player["galaxynum"], globalseeds) # build a new galaxy
|
player["galaxynum"]++
|
||||||
|
if(player["galaxynum"] == 9) player["galaxynum"] = 1
|
||||||
|
buildgalaxy(player["galaxynum"], globalseeds) # build a new galaxy
|
||||||
|
}
|
||||||
|
else printf("Not enough credits for hyperspace jump!\nMust have at least %.1f CR", game["galhypcost"]/10)
|
||||||
}
|
}
|
||||||
|
|
||||||
# print planet info
|
# print planet info
|
||||||
@@ -514,6 +519,7 @@ function gameinit() {
|
|||||||
|
|
||||||
split("",game) # overall game state is stored here
|
split("",game) # overall game state is stored here
|
||||||
game["use_native_rand"] = 1
|
game["use_native_rand"] = 1
|
||||||
|
game["galhypcost"] = 50000 # 5000 CR
|
||||||
game["fuelcost"] = 2 # 0.2 CR/lightyear
|
game["fuelcost"] = 2 # 0.2 CR/lightyear
|
||||||
game["maxfuel"] = 70 # 7.0 LY tank
|
game["maxfuel"] = 70 # 7.0 LY tank
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user