another status bit

Accept four digits for spell power rather than hide the amount
exceeding 999.
This commit is contained in:
PatR
2016-01-15 21:05:58 -08:00
parent 6d53aaa6ff
commit cd2f4ac225
2 changed files with 9 additions and 10 deletions

View File

@@ -9,10 +9,10 @@
* than COLNO
*
* longest practical second status line at the moment is
Astral Plane \GXXXXNNNN:123456 HP:1000(1000) Pw:111(111) AC:-127
Astral Plane \GXXXXNNNN:123456 HP:1234(1234) Pw:1234(1234) AC:-127
Xp:30/123456789 T:123456 Stone Slime Strngl FoodPois TermIll
Satiated Overloaded Blind Deaf Stun Conf Hallu Lev Ride
* -- or a bit under 185 characters. '$' gets encoded even when it
* -- or about 185 characters. '$' gets encoded even when it
* could be used as-is. The first five status conditions are fatal
* so it's rare to have more than one at a time.
*

View File

@@ -91,10 +91,9 @@ bot2()
/*
* Various min(x,9999)'s are to avoid having excessive values
* violate the field width assumptions in botl.h and should not
* impact normal play [not too sure about limiting spell power
* to 3 digits]. Particularly 64-bit long for gold which could
* require many more digits if someone figures out a way to get
* and carry a really large (or negative) amount of it.
* impact normal play. Particularly 64-bit long for gold which
* could require many more digits if someone figures out a way
* to get and carry a really large (or negative) amount of it.
* Turn counter is also long, but we'll risk that.
*/
@@ -102,7 +101,7 @@ bot2()
(void) describe_level(dloc); /* includes at least one trailing space */
if ((money = money_cnt(invent)) < 0L)
money = 0L; /* ought to issue impossible() and then discard gold */
Sprintf(eos(dloc), "%s:%-2ld",
Sprintf(eos(dloc), "%s:%-2ld", /* strongest hero can lift ~300000 gold */
encglyph(objnum_to_glyph(GOLD_PIECE)), min(money, 999999L));
dln = strlen(dloc);
/* '$' encoded as \GXXXXNNNN is 9 chars longer than display will need */
@@ -115,7 +114,7 @@ bot2()
hp = 0;
Sprintf(hlth, "HP:%d(%d) Pw:%d(%d) AC:%-2d",
min(hp, 9999), min(hpmax, 9999),
min(u.uen, 999), min(u.uenmax, 999), u.uac);
min(u.uen, 9999), min(u.uenmax, 9999), u.uac);
hln = strlen(hlth);
/* experience */
@@ -546,8 +545,8 @@ bot()
valset[BL_GOLD] = TRUE; /* indicate val already set */
/* Power (magical energy) */
blstats[idx][BL_ENE].a.a_int = min(u.uen, 999);
blstats[idx][BL_ENEMAX].a.a_int = min(u.uenmax, 999);
blstats[idx][BL_ENE].a.a_int = min(u.uen, 9999);
blstats[idx][BL_ENEMAX].a.a_int = min(u.uenmax, 9999);
/* Armor class */
blstats[idx][BL_AC].a.a_int = u.uac;