Commit Graph
100 Commits
Author SHA1 Message Date
Pasi Kallinen 5dcd6b2e17 Unify polymorph traps 2020-12-10 19:04:30 +02:00
Pasi Kallinen 6eb89c6b44 Unify anti magic traps 2020-12-10 19:04:30 +02:00
Pasi Kallinen ed3a736bd8 Unify fire traps 2020-12-10 19:04:30 +02:00
Pasi Kallinen c15d062502 Unify statue traps 2020-12-10 19:04:30 +02:00
Pasi Kallinen eb58352860 Unify webs 2020-12-10 19:04:30 +02:00
Pasi Kallinen 3bd60d6d54 Unify holes, level teleport and teleport traps 2020-12-10 19:04:30 +02:00
Pasi Kallinen afa1fef1ff Unify pits 2020-12-10 19:04:30 +02:00
Pasi Kallinen 5773f49dfe Unify fire trap 2020-12-10 19:04:30 +02:00
Pasi Kallinen c78e873c7c Unify rust trap 2020-12-10 19:04:30 +02:00
Pasi Kallinen 4974a57832 Unify sleeping gas trap 2020-12-10 19:04:30 +02:00
Pasi Kallinen 0a47c3d4f2 Unify bear trap 2020-12-10 19:04:29 +02:00
Pasi Kallinen e07968e8e5 Unify squeaky board 2020-12-10 19:04:29 +02:00
Pasi Kallinen a1227cefb3 Unify rocktrap 2020-12-10 19:04:29 +02:00
Pasi Kallinen 485985968e Unify dart trap 2020-12-10 19:04:29 +02:00
Pasi Kallinen 640be5ff7e Unify arrow trap 2020-12-10 19:04:29 +02:00
Pasi Kallinen b5cfd8333f Split trap effects out of dotrap 2020-12-10 19:04:29 +02:00
Pasi Kallinen 2a181c3955 Detection map redisplay routine code deduplication 2020-12-08 17:08:57 +02:00
Pasi Kallinen 13359648dd Remove duplicate wallify_map code 2020-12-06 18:36:37 +02:00
Pasi Kallinen 452dc3da26 Unify spitmu and spitmm 2020-12-06 13:57:50 +02:00
Pasi Kallinen 0462a2088c Increment EDITLEVEL
Forgot to increment EDITLEVEL when I did the stairs change,
and again after fixing the Oracle bones stairs. Lets do it now.
2020-12-05 19:38:20 +02:00
Pasi Kallinen 44920d4650 Remove duplicate lines 2020-12-05 19:00:19 +02:00
Pasi Kallinen 55b4946305 Fix AD_DCAY mhitm armor erosion type 2020-12-04 19:05:24 +02:00
Pasi Kallinen d28489e55d Fixes bit for mhitm/uhitm/mhitu unification 2020-12-04 09:49:24 +02:00
Pasi Kallinen 1f6a7a5eef Init the done variable to false 2020-12-04 09:30:22 +02:00
Pasi Kallinen 4fb370ee79 Remove unused variables 2020-12-04 09:30:21 +02:00
Pasi Kallinen b797baba7a Make return values use defines 2020-12-04 09:30:21 +02:00
Pasi Kallinen 3ef3b425ad Unify the ad type switches 2020-12-04 09:30:21 +02:00
Pasi Kallinen 88e333a3a8 Unify ad_ssex 2020-12-04 09:30:21 +02:00
Pasi Kallinen 1696019361 Unify ad_sedu 2020-12-04 09:30:21 +02:00
Pasi Kallinen 376593dad5 Unify ad_dise 2020-12-04 09:30:21 +02:00
Pasi Kallinen 4118a7ea44 Unify ad_samu 2020-12-04 09:30:21 +02:00
Pasi Kallinen d679d3a029 Unify ad_dgst 2020-12-04 09:30:20 +02:00
Pasi Kallinen d4625266a7 Remove unused goto label 2020-12-04 09:30:20 +02:00
Pasi Kallinen e777bd9670 Unify ad_legs 2020-12-04 09:30:20 +02:00
Pasi Kallinen 337e7da049 Unify ad_stun 2020-12-04 09:30:19 +02:00
Pasi Kallinen 12ee144936 Unify ad_heal 2020-12-04 09:30:19 +02:00
Pasi Kallinen 4901c8027c Unify ad_were 2020-12-04 09:30:19 +02:00
Pasi Kallinen a6a676f720 Unify ad_ston 2020-12-04 09:30:19 +02:00
Pasi Kallinen 20b6ea602b Unify ad_phys 2020-12-04 09:30:19 +02:00
Pasi Kallinen ac5822fe69 Unify ad_halu 2020-12-04 09:30:19 +02:00
Pasi Kallinen 36bb52466d Unify ad_deth 2020-12-04 09:30:19 +02:00
Pasi Kallinen 2999233332 Unify ad_pest 2020-12-04 09:30:18 +02:00
Pasi Kallinen cb55d7c30f Unify ad_famn 2020-12-04 09:30:18 +02:00
Pasi Kallinen 618feabd88 Unify ad_poly 2020-12-04 09:30:18 +02:00
Pasi Kallinen fda63d145b Unify ad_conf 2020-12-04 09:30:18 +02:00
Pasi Kallinen 558ec78b3a Unify ad_slow 2020-12-04 09:30:18 +02:00
Pasi Kallinen b80c30bcf1 Unify ad_ench 2020-12-04 09:30:18 +02:00
Pasi Kallinen 96a4d14a36 Unify ad_slim 2020-12-04 09:30:17 +02:00
Pasi Kallinen eb5508ba58 Unify ad_slee 2020-12-04 09:30:17 +02:00
Pasi Kallinen 654220f840 Unify ad_plys 2020-12-04 09:30:17 +02:00
Pasi Kallinen 7914237fbf Unify ad_wrap 2020-12-04 09:30:17 +02:00
Pasi Kallinen bfb8931188 Unify ad_stck 2020-12-04 09:30:17 +02:00
Pasi Kallinen b4ed25da46 Unify ad_drin 2020-12-04 09:30:17 +02:00
Pasi Kallinen 1ca0165bb9 Unify ad_drst 2020-12-04 09:30:16 +02:00
Pasi Kallinen dba9aaf424 Unify ad_curs 2020-12-04 09:30:16 +02:00
Pasi Kallinen d325e2cc60 Unify ad_blnd 2020-12-04 09:30:16 +02:00
Pasi Kallinen 607d1bcd96 Unify ad_tlpt 2020-12-04 09:30:16 +02:00
Pasi Kallinen bfe773812e Unify ad_sgld 2020-12-04 09:30:16 +02:00
Pasi Kallinen b7899ee014 Unify ad_acid 2020-12-04 09:30:15 +02:00
Pasi Kallinen 8a78c49fea Unify ad_elec 2020-12-04 09:30:15 +02:00
Pasi Kallinen 6abfe7e548 Unify ad_cold 2020-12-04 09:30:15 +02:00
Pasi Kallinen 6712876801 Unify ad_fire 2020-12-04 09:30:14 +02:00
Pasi Kallinen cfd819f1c1 Unify ad_drli 2020-12-04 09:30:14 +02:00
Pasi Kallinen 518798d0d2 Unify ad_dren 2020-12-04 09:30:14 +02:00
Pasi Kallinen 6436ea1532 Unify ad_dcay 2020-12-04 09:30:14 +02:00
Pasi Kallinen 0d445a7a7c Unify monster-hits-monster 2020-12-04 09:30:14 +02:00
Pasi Kallinen cf88808285 Fix stairs on oracle level bones
Recent change to the stairs structure now lets each stair keep
the destination level number and dungeon where the stairs go to.

When a level that can be on different depth (such as the Oracle)
became a bones level, and it was loaded in another game at different
depth, the stairs were still pointing to the old level number.

Save it as relative to the current level instead of absolute.
2020-12-03 16:38:20 +02:00
Pasi Kallinen d79b5388ce Remove dealloc_obj b&c sanity checking 2020-12-01 22:18:48 +02:00
Pasi Kallinen 30b59acc40 More wish tests 2020-11-30 15:07:44 +02:00
Pasi Kallinen a8ed1ab5fd Test wishing "bags of tricks" 2020-11-30 12:06:37 +02:00
Pasi Kallinen 74565c890d Split readobjnam into multiple functions
Also add several new tests for it
2020-11-29 19:08:30 +02:00
Pasi Kallinen f2218839a3 Move some function names to start of line 2020-11-29 14:10:25 +02:00
Pasi Kallinen fb188dc1aa Unify mfndpos monster movement flags 2020-11-28 12:49:18 +02:00
Pasi Kallinen 36d977f61f Unify HP loss and passing out from overexertion 2020-11-27 23:43:59 +02:00
Pasi Kallinen bbb3d35252 Unify enlightenment self-knowledgeable effect 2020-11-27 19:59:16 +02:00
Pasi Kallinen 2a7cb3c4b6 Split some parts of getobj into functions 2020-11-27 18:10:47 +02:00
Pasi Kallinen 229930e505 Fixes and sanity checks for monster undetected and trapped states
Adds sanity checks for mtrapped and mundetected states.

Fixes cases where those were left in wrong state.

1. Trapped monster (eg. a nymph) teleported out of a trap
2. Monster was hiding under ball or chain, which then got removed
3. While restoring a level, a zombie corpse revived while monster
   was hiding under it
4. A general case where the only object was deleted off floor and
   a monster was hiding under it

Monsters hiding under ball or chain will now get revealed when
the b or c are moved.
2020-11-24 19:37:43 +02:00
Pasi Kallinen e100d1a137 More unpolyable unifying
... and fix the potion dipping case.
2020-11-17 18:00:43 +02:00
Pasi Kallinen d81e1672aa Unify unpolyable objects to single define 2020-11-16 18:42:12 +02:00
Pasi Kallinen ccb5bc4b55 Avoid hard-coded bit twiddling 2020-11-15 19:56:35 +02:00
Pasi Kallinen d6384f4061 Use enums instead of magic values 2020-11-15 19:32:21 +02:00
Pasi Kallinen 0dc44ad210 Update comment about xchar 2020-11-15 14:25:45 +02:00
Pasi Kallinen deb730d9b5 More hypothetical type mismatches 2020-11-15 13:51:47 +02:00
Pasi Kallinen 7cfc5a7142 Fix buffer underrun in curses 2020-11-15 13:22:45 +02:00
Pasi Kallinen 289c8d654d Futureproofing hypothetical type mismatches
If we ever want huge maps with COLNO or ROWNO larger than signed char,
this will at least allow the game to compile and start when typedef'ing
xchar to int. Trying to use huge maps exposes more bugs.
2020-11-14 13:53:09 +02:00
Pasi Kallinen 6ec55a3624 Rework stairs structure
Use a linked list to store stair and ladder information, instead
of having fixed up/down stairs/ladders and a single "special" (branch)
stair.

Breaks saves and bones.

Adds information to migrating objects and monsters for the dungeon
and level where they are migrating from.
2020-11-13 20:27:17 +02:00
Pasi Kallinen c9ac5bc48a Increase EDITLEVEL post Zombie Apocalypse
I forgot to increase EDITLEVEL, as the Zombie Apocalypse added a timeout
routine, messing up saves and bones.
2020-11-04 11:36:52 +02:00
Pasi Kallinen 05263bc276 Fix memory leak when adding basic color menucolors 2020-10-30 23:04:22 +02:00
Pasi Kallinen 91c46ab54b Restful sleep regenerates hp
When sleeping due to wearing an amulet of restful sleep,
hit points will regenerate, one point faster than with normal regeneration.
2020-10-29 19:14:32 +02:00
Pasi Kallinen 22ca1ae4da Fix monster hiding under hatching egg staying hidden 2020-10-24 18:32:08 +03:00
Pasi Kallinen aeb0ea65e3 Mild Zombie Apocalypse
When a zombie (or lich) kills a monster in melee without a weapon,
the monster can rise few turns later as a zombie.

The only creatures that can be zombified are ones that actually have
a zombie counterpart monster. A zombie cannot turn a jackal into
a zombie, for instance. But it could turn a shopkeeper into a human
zombie, or a dwarf king into a dwarf zombie.

Zombies will fight with monsters that can be turned into zombies.

Originally this was a SliceHack feature, but this is based on xNetHack
version of it, with some modifications.
2020-10-23 19:47:10 +03:00
Pasi Kallinen 566dde8683 Match object description via single function
making the code more readable.

Instead of doing strcmp(OBJ_DESCR(objects[otyp]), "foo"),
just call objdescr_is(obj, "foo")

(via xNetHack)
2020-10-20 19:19:57 +03:00
Pasi Kallinen 3a31587ca9 Prevent ghosts from being renamed
(via xNetHack)
2020-10-18 20:28:32 +03:00
Pasi Kallinen f38cb63714 Spitting monsters try to stay away from melee range 2020-10-18 19:18:38 +03:00
Pasi Kallinen fc6b491303 Fix thinko in reset travel dest condition 2020-10-17 16:48:07 +03:00
Pasi Kallinen 5ddafa5c81 Only reset if we actually went to travel destination 2020-10-17 12:13:17 +03:00
Pasi Kallinen a9e4904131 Reset travel destination if reached via teleport 2020-10-17 12:08:51 +03:00
Pasi Kallinen b6125b8f78 Pre-populate teleport destination prompt with travel destination
This has been implemented in multiple variants, and seems like
a small but useful quality of life improvement.
2020-10-16 19:14:01 +03:00
Pasi Kallinen 3d6551a70e Lua: Allow matching any wall
A 'w' in a map fragment will match any wall (IS_WALL macro):

   des.replace_terrain({ mapfragment = "w", toterrain = "F" });
2020-10-10 11:31:16 +03:00
Pasi Kallinen 37339abebd Fix dropping const from params 2020-10-05 17:17:07 +03:00