home · contact · privacy
Don't punish the player for moving towards an ocean tile.
[plomrogue] / roguelike-server
index 8ffa7a4ff1716892ac5b125469232de42f8d623b..87a68b39ccf5783e7e0ba8ad8a3e87e551f7ed4d 100755 (executable)
@@ -699,7 +699,9 @@ def decrement_lifepoints(t):
     Dying actors drop all their things.
     """
     # 7DRL: Return 1 if death, else 0.
+    # 7DRL: Re-spawn died-out species.
     t["T_LIFEPOINTS"] -= 1
+    live_type = t["T_TYPE"] # 7DRL
     if 0 == t["T_LIFEPOINTS"]:
         for id in t["T_CARRIES"]:
             t["T_CARRIES"].remove(id)
@@ -716,6 +718,16 @@ def decrement_lifepoints(t):
             t["T_MEMMAP"] = False
             t["T_MEMDEPTHMAP"] = False
             t["T_MEMTHING"] = []
+            n_species = len([id for id in world_db["Things"]  # #
+                             if world_db["Things"][id]["T_TYPE"] == live_type])
+            if 0 == n_species:  # #
+                id = id_setter(-1, "Things")
+                world_db["Things"][id] = new_Thing(live_type,
+                                                   world_db["altar"])
+                log("Species "
+                    + world_db["ThingTypes"][live_type]["TT_NAME"]
+                    + " has temporarily died out. "
+                    + "One new-born is spawned at the altar.")
         return world_db["ThingTypes"][t["T_TYPE"]]["TT_LIFEPOINTS"]  # #
     return 0  # #
 
@@ -1568,6 +1580,9 @@ def play_commander(action, args=False):
                                              t["T_POSY"], t["T_POSX"])
             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.")
+                    return
                 if (ord("X") == world_db["MAP"][pos]  # #
                     or ord("|") == world_db["MAP"][pos]):  # #
                     carries_axe = False  # #