Commit Graph
100 Commits
Author SHA1 Message Date
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
Pasi Kallinen 40648503b2 Increment EDITLEVEL due to safe_wait 2020-10-02 19:11:15 +03:00
Pasi Kallinen fac154d364 Fix some Guidebook.tex errors 2020-10-02 19:00:40 +03:00
Pasi Kallinen 396b819988 Add safe_wait to toggle search and wait prevention 2020-10-02 19:00:40 +03:00
Pasi Kallinen 6a35a84c56 Fire sources can ignite candles, lamps, and potions of oil
... on the floor, in monster inventory, and in hero's inventory.

Items in your inventory being ignited produce a message even if you're
blind - you can see the lit-state by viewing inventory anyway, so just
give player the message.

(via xNetHack)
2020-09-30 19:49:10 +03:00
Pasi Kallinen fb7b578af1 Make piranhas faster and more bitey
Piranhas are pretty bland, so make them faster and give them
an extra bite attack.

(via xNetHack)
2020-09-30 19:05:02 +03:00
Pasi Kallinen 476990b303 Fixes and lua doc 2020-09-29 17:35:16 +03:00
Pasi Kallinen 6348a53bd8 Fixes doc 2020-09-28 18:28:19 +03:00
Pasi Kallinen 441bb345d7 Fixes doc of the recent pull requests 2020-09-27 22:26:39 +03:00
Pasi Kallinen 978cf23cc9 Fixes entry 2020-04-25 19:19:36 +03:00
Pasi Kallinen 52a15daaf6 Tests: Wishing for sprig of wolfsbane etc 2020-04-21 20:00:26 +03:00
Pasi Kallinen dc42b0f7a5 Add Pillars themeroom 2020-04-21 19:52:39 +03:00
Pasi Kallinen 907e7dead1 Adjust some themerooms 2020-04-21 18:59:43 +03:00
Pasi Kallinen 54aa84eeea Prevent branch stairs generating in unjoined room 2020-04-21 18:41:08 +03:00
Pasi Kallinen c0cbe21c4e Prevent stairs in Mausoleum themeroom
... by making the mausoleum part into an unjoined subroom
2020-04-21 17:57:49 +03:00
Pasi Kallinen 2d67aaebb8 Clear saved lua_State from dungeons
These will be recreated if necessary in makerooms
2020-04-20 16:48:56 +03:00
Pasi Kallinen 776ebd809e No trying themed rooms if lua init failed 2020-04-20 16:34:22 +03:00