X-Git-Url: https://plomlompom.com/repos/todo?a=blobdiff_plain;f=plomrogue-server.py;h=2b65287478bdfd3f462974d97e11ae341600fc8a;hb=20da835cb5f85fc3416caef6e70bd74711bd75d0;hp=a44f751313a057e04c432f5ba48df264a9d4e222;hpb=566bdd3865b368d85c31ac765aa9ff35e0129534;p=plomrogue diff --git a/plomrogue-server.py b/plomrogue-server.py index a44f751..2b65287 100755 --- a/plomrogue-server.py +++ b/plomrogue-server.py @@ -465,7 +465,7 @@ def remake_map(): # This all-too-precise replica of the original C code misses iter_limit(). -def update_map_memory(t): +def update_map_memory(t, age_map=True): """Update t's T_MEMMAP with what's in its FOV now,age its T_MEMMEPTHMAP.""" if not t["T_MEMMAP"]: t["T_MEMMAP"] = bytearray(b' ' * (world_db["MAP_LENGTH"] ** 2)) @@ -477,7 +477,7 @@ def update_map_memory(t): if " " == chr(t["T_MEMMAP"][pos]): t["T_MEMMAP"][pos] = world_db["MAP"][pos] continue - if ord('0') <= t["T_MEMDEPTHMAP"][pos] \ + if age_map and ord('0') <= t["T_MEMDEPTHMAP"][pos] \ and ord('9') > t["T_MEMDEPTHMAP"][pos] \ and not rand.next() % (2 ** (t["T_MEMDEPTHMAP"][pos] - 48)): t["T_MEMDEPTHMAP"][pos] += 1 @@ -485,7 +485,8 @@ def update_map_memory(t): if "v" == chr(t["fovmap"][(mt[1] * world_db["MAP_LENGTH"]) + mt[2]])]: t["T_MEMTHING"].remove(mt) - for id in world_db["Things"]: + for id in [id for id in world_db["Things"] + if not world_db["Things"][id]["carried"]]: type = world_db["Things"][id]["T_TYPE"] if not world_db["ThingTypes"][type]["TT_LIFEPOINTS"]: y = world_db["Things"][id]["T_POSY"] @@ -667,8 +668,6 @@ def actor_use(t): t["T_CARRIES"].remove(id) del world_db["Things"][id] t["T_SATIATION"] += world_db["ThingTypes"][type]["TT_CONSUMABLE"] - t["T_LIFEPOINTS"] += 1 - # Wrongly increment HPs is a replica of the original code. strong_write(io_db["file_out"], "LOG You consume this object.\n") else: strong_write(io_db["file_out"], "LOG You try to use this object," +