home · contact · privacy
7DRL: Some population balancing.
[plomrogue] / roguelike-server
index 80edd27f3249b071c2e9ff65bb265783cec89463..38da4a804a738967be8096acabd11bd1029d0666 100755 (executable)
@@ -688,6 +688,7 @@ def log_help():
     log("Use 'l' to toggle 'look' mode (move an exploration cursor instead of "
         + "the player over the map).")
     log("Use 'PgUp'/PgDn' to scroll the 'Things here' window.")
+    log("The stats window: T=TURN, H=HEALTH, S=SATIATION, G=GOD'S FAVOR.")
     log("See README file for more details.")
 
 
@@ -724,7 +725,7 @@ def decrement_lifepoints(t):
                 if world_db["FAVOR_STAGE"] >= 3 and \
                     live_type == world_db["ANIMAL_0"]:
                     world_db["GOD_FAVOR"] += 3000
-                    log("Congratulations! The "
+                    log("CONGRATULATIONS! The "
                         + world_db["ThingTypes"][live_type]["TT_NAME"]
                         + " species has died out. The Island God is pleased.")
                 else:
@@ -767,6 +768,9 @@ def enter_altar():  # #
              + "make yourself useful there. I will count each further "
              + world_db["ThingTypes"][world_db["PLANT_0"]]["TT_NAME"]
              + " that grows to your favor.\"")
+    elif world_db["FAVOR_STAGE"] == 1 and world_db["GOD_FAVOR"] < 100:
+        log("The Island God will talk again when it favors you to >=100 "
+             +" points.")
     elif world_db["FAVOR_STAGE"] == 1 and world_db["GOD_FAVOR"] >= 100:
         world_db["FAVOR_STAGE"] = 2
         log("The Island God speaks to you: \"You could have done worse so "
@@ -797,6 +801,9 @@ def enter_altar():  # #
         world_db["Things"][id] = new_Thing(world_db["PLANT_1"],
                                            world_db["altar"])
         world_db["GOD_FAVOR"] -= 250
+    elif world_db["FAVOR_STAGE"] == 2 and world_db["GOD_FAVOR"] < 500:
+        log("The Island God will talk again when it favors you to >=500 "
+             +" points.")
     elif world_db["FAVOR_STAGE"] == 2 and world_db["GOD_FAVOR"] >= 500:
         world_db["FAVOR_STAGE"] = 3
         log("The Island God speaks to you: \"The "
@@ -809,6 +816,9 @@ def enter_altar():  # #
             + "moving (maybe for an attack), \"u\": eating, \"p\": picking "
             + "something up; no letter: waiting).")
         world_db["EMPATHY"] = 1
+    elif world_db["FAVOR_STAGE"] == 3 and world_db["GOD_FAVOR"] < 5000:
+        log("The Island God will talk again when it favors you to >=5000 "
+             +" points.")
     elif world_db["FAVOR_STAGE"] == 3 and world_db["GOD_FAVOR"] >= 5000:
         world_db["FAVOR_STAGE"] = 4
         log("The Island God speaks to you: \"You know what animal I find the "
@@ -826,7 +836,11 @@ def enter_altar():  # #
         id = id_setter(-1, "Things")
         world_db["Things"][id] = new_Thing(world_db["TOOL_1"],
                                            world_db["altar"])
-    elif world_db["GOD_FAVOR"] > 20000:
+    elif world_db["GOD_FAVOR"] < 20000:
+        log("The Island God will talk again when it favors you to >=20000 "
+             +" points.")
+    elif world_db["GOD_FAVOR"] >= 20000:
+        world_db["FAVOR_STAGE"] = 9001
         log("The Island God speaks to you: \"You have proven yourself worthy"
              + " of my respect. You were a good citizen to the island, and "
              + "sometimes a better steward to its inhabitants than me. The "
@@ -867,11 +881,11 @@ def actor_move(t):
             hitted_type = world_db["Things"][hit_id]["T_TYPE"]
             if t == world_db["Things"][0]:
                 hitted_name = world_db["ThingTypes"][hitted_type]["TT_NAME"]
-                log("You wound " + hitted_name + ".")
+                log("You WOUND " + hitted_name + ".")
                 world_db["GOD_FAVOR"] -= 1  # #
             elif 0 == hit_id:
                 hitter_name = world_db["ThingTypes"][t["T_TYPE"]]["TT_NAME"]
-                log(hitter_name +" wounds you.")
+                log(hitter_name +" WOUNDS you.")
             test = decrement_lifepoints(world_db["Things"][hit_id])  # #(test=)
             if test and world_db["FAVOR_STAGE"] >= 3 and \
                hitted_type == world_db["ANIMAL_0"]:  # #
@@ -901,7 +915,7 @@ def actor_move(t):
                     or (not case_X and  # #
                              0 == int(rand.next() / (3 * chop_power))))):  # #
                     if t == world_db["Things"][0]:  # #
-                        log("You chop it down.")  # #
+                        log("You chop it DOWN.")  # #
                     if world_db["MAP"][pos] == ord("X"):  # #
                         world_db["GOD_FAVOR"] -= 10  # #
                     world_db["MAP"][pos] = ord(".")   # #
@@ -931,7 +945,7 @@ def actor_move(t):
                 move_result[2] == world_db["altar"][1]):  # #
                 enter_altar()  # #
     elif t == world_db["Things"][0]:
-        log("You fail to move " + dir + ".")
+        log("You FAIL to move " + dir + ".")
 
 
 def actor_pick_up(t):
@@ -970,11 +984,11 @@ def actor_pick_up(t):
                 world_db["Things"][id]["T_PLAYERDROP"] = 0  # #
             t["T_CARRIES"].append(id)
             if t == world_db["Things"][0]:
-                log("You pick up an object.")
+                log("You PICK UP an object.")
         elif t == world_db["Things"][0]:
             log("You try to pick up an object, but there is none.")
     elif t == world_db["Things"][0]: # #
-        log("Can't pick up object: No storage room to carry more.") # #
+        log("CAN'T pick up object: No storage room to carry more.") # #
 
 
 def actor_drop(t):
@@ -985,10 +999,10 @@ def actor_drop(t):
         t["T_CARRIES"].remove(id)
         world_db["Things"][id]["carried"] = False
         if t == world_db["Things"][0]:
-            log("You drop an object.")
+            log("You DROP an object.")
             world_db["Things"][id]["T_PLAYERDROP"] = 1  # #
     elif t == world_db["Things"][0]:
-       log("You try to drop an object, but you own none.")
+       log("You try to drop an object, but you own NONE.")
 
 
 def actor_use(t):
@@ -1014,14 +1028,14 @@ def actor_use(t):
             pos = t["T_POSY"] * world_db["MAP_LENGTH"] + t["T_POSX"]
             if (world_db["MAP"][pos] == ord("X")  # #
                 or world_db["MAP"][pos] == ord("|")):  # #
-                log("Can't build when standing on barrier.")  # #
+                log("CAN'T build when standing on barrier.")  # #
                 return
             for id in [id for id in world_db["Things"]
                        if not world_db["Things"][id] == t
                        if not world_db["Things"][id]["carried"]
                        if world_db["Things"][id]["T_POSY"] == t["T_POSY"]
                        if world_db["Things"][id]["T_POSX"] == t["T_POSX"]]:
-                 log("Can't build when standing objects.")  # #
+                 log("CAN'T build when standing objects.")  # #
                  return
             for id in t["T_CARRIES"]:  # #
                 type_tool = world_db["Things"][id]["T_TYPE"]  # #
@@ -1041,30 +1055,30 @@ def actor_use(t):
                 world_db["MAP"][pos] = ord("|")  # #
                 log("With your "  # #
                     + world_db["ThingTypes"][type_tool]["TT_NAME"]  # #
-                    + " you build a wooden barrier from your "  # #
+                    + " you build a WOODEN BARRIER from your "  # #
                     + world_db["ThingTypes"][type_material]["TT_NAME"]  # #
                     + ".")  # #
             else:  # #
-                log("You can't use a "  # #
+                log("You CAN'T use a "  # #
                     + world_db["ThingTypes"][type_tool]["TT_NAME"]  # #
                     + " without some wood in your inventory.")  # #
         elif world_db["ThingTypes"][type]["TT_TOOL"] == "fertilizer":  # #
             pos = t["T_POSY"] * world_db["MAP_LENGTH"] + t["T_POSX"]
             if world_db["MAP"][pos] == ord("."):
-                log("You create soil.")
+                log("You create SOIL.")
                 world_db["MAP"][pos] = ord(":")
             else:
-                log("Can only make soil out of non-soil earth.")
+                log("Can only make soil out of NON-SOIL earth.")
         elif world_db["ThingTypes"][type]["TT_TOOL"] == "food":
             t["T_CARRIES"].remove(id)
             del world_db["Things"][id]
             t["T_SATIATION"] += world_db["ThingTypes"][type]["TT_TOOLPOWER"]
             if t == world_db["Things"][0]:
-                log("You consume this object.")
+                log("You eat this thing.")
         elif t == world_db["Things"][0]:
-            log("You try to use this object, but fail.")
+            log("You try to use this object, but FAIL.")
     elif t == world_db["Things"][0]:
-        log("You try to use an object, but you own none.")
+        log("You try to use an object, but you own NONE.")
 
 
 def thingproliferation(t, prol_map):
@@ -1108,7 +1122,7 @@ def thingproliferation(t, prol_map):
                 world_db["GOD_FAVOR"] += 25  # #
             elif world_db["FAVOR_STAGE"] >= 4 and \
                  t["T_TYPE"] == world_db["ANIMAL_1"]:
-                log("The Island God smiles upon a new-born bear baby.")
+                log("The Island God SMILES upon a new-born bear baby.")
                 world_db["GOD_FAVOR"] += 750
 
 
@@ -1124,7 +1138,7 @@ def try_healing(t):
         if (testval <= 1 or 1 == (rand.next() % testval)):
             t["T_LIFEPOINTS"] += 1
             if t == world_db["Things"][0]:
-                log("You heal.")
+                log("You HEAL.")
 
 
 def hunger_per_turn(type_id):
@@ -1139,9 +1153,9 @@ def hunger(t):
     if 0 != t["T_SATIATION"] and 0 == int(rand.next() / abs(t["T_SATIATION"])):
         if t == world_db["Things"][0]:
             if t["T_SATIATION"] < 0:
-                log("You suffer from hunger.")
+                log("You SUFFER from hunger.")
             else:
-                log("You suffer from over-eating.")
+                log("You SUFFER from over-eating.")
         decrement_lifepoints(t)
 
 
@@ -1602,7 +1616,7 @@ def play_commander(action, args=False):
         if action == "drop":
             t = world_db["Things"][0]
             if 0 == len(t["T_CARRIES"]):
-                log("You have nothing to drop in your inventory.")
+                log("You have NOTHING to drop in your inventory.")
                 return
 
         elif action == "pick_up":
@@ -1612,12 +1626,12 @@ def play_commander(action, args=False):
                    if world_db["Things"][id]["T_POSY"] == t["T_POSY"]
                    if world_db["Things"][id]["T_POSX"] == t["T_POSX"]]
             if not len(ids):
-                log("No object to pick up.")
+                log("NOTHING to pick up.")
                 return
             used_slots = len(t["T_CARRIES"]) # #
             if used_slots >= world_db["ThingTypes"][t["T_TYPE"]] \
                 ["TT_STORAGE"]: # #
-                log("Can't pick up: No storage room to carry anything more.")
+                log("CAN'T pick up: No storage room to carry anything more.")
                 return
 
         elif action == "move":
@@ -1628,7 +1642,7 @@ def play_commander(action, args=False):
             if 1 == move_result[0]:
                 pos = (move_result[1] * world_db["MAP_LENGTH"]) + move_result[2]
                 if ord("~") == world_db["MAP"][pos]:
-                    log("You can't swim.")
+                    log("You can't SWIM.")
                     return
                 if (ord("X") == world_db["MAP"][pos]  # #
                     or ord("|") == world_db["MAP"][pos]):  # #
@@ -1639,10 +1653,10 @@ def play_commander(action, args=False):
                             carries_axe = True  # #
                             break  # #
                     if not carries_axe:  # #
-                        log("You can't move there.")
+                        log("You CAN'T move there.")
                         return
             else:
-                log("You can't move there.")
+                log("You CAN'T move there.")
                 return
 
         elif action == "use":
@@ -1658,14 +1672,14 @@ def play_commander(action, args=False):
                     pos = t["T_POSY"] * world_db["MAP_LENGTH"] + t["T_POSX"]
                     if (world_db["MAP"][pos] == ord("X")  # #
                         or world_db["MAP"][pos] == ord("|")):  # #
-                        log("Can't build when standing on barrier.")  # #
+                        log("CAN'T build when standing on barrier.")  # #
                         return
                     for id in [id for id in world_db["Things"]
                                if not world_db["Things"][id] == t
                                if not world_db["Things"][id]["carried"]
                                if world_db["Things"][id]["T_POSY"] == t["T_POSY"]
                                if world_db["Things"][id]["T_POSX"] ==t["T_POSX"]]:
-                         log("Can't build when standing objects.")  # #
+                         log("CAN'T build when standing objects.")  # #
                          return
                     for id in t["T_CARRIES"]:  # #
                         type_tool = world_db["Things"][id]["T_TYPE"]  # #
@@ -1680,20 +1694,20 @@ def play_commander(action, args=False):
                             wood_id = id  # #
                             break  # #
                     if wood_id == None:  # #
-                        log("You can't use a "  # #
+                        log("You CAN'T use a "  # #
                             + world_db["ThingTypes"][type_tool]["TT_NAME"]  # #
                             + " without some wood in your inventory.")  # #
                         return
                 elif world_db["ThingTypes"][type]["TT_TOOL"] == "fertilizer":  # #
                     pos = t["T_POSY"] * world_db["MAP_LENGTH"] + t["T_POSX"]
                     if not world_db["MAP"][pos] == ord("."):
-                        log("Can only make soil out of non-soil earth.")
+                        log("Can only make soil out of NON-SOIL earth.")
                         return
                 elif world_db["ThingTypes"][type]["TT_TOOL"] == "wood":  # #
-                        log("To use wood, you need a carpentry tool.")  # #
+                        log("To use wood, you NEED a carpentry tool.")  # #
                         return
             else:
-                log("You have nothing to use in your inventory.")
+                log("You have NOTHING to use in your inventory.")
                 return