luciensadi / AwakeMUD

The Community Edition fork of the 'Awakened Worlds' Shadowrun 3 MUD codebase.
Other
56 stars 32 forks source link

Various fixes #709

Closed jdevnull closed 1 year ago

jdevnull commented 1 year ago

The save_char function calls unequip_char, obj_from_cyberware, obj_from_bioware, obj_to_cyberware, obj_to_bioware, and equip_char for every item worn or installed into the character. Every one of these function calls result in an affect_total call. In addition to the performance hit for the many redundant calls, this causes hacking pool and spell pool allocations to be reduced/reset every time save_char is called (e.g., through point_update every 2 minutes).

This solution gives unequip_char, obj_from_cyberware, obj_from_bioware, obj_to_cyberware, obj_to_bioware, and equip_char a new recalc parameter (which defaults to TRUE) that controls whether affect_total is called.

Unless there are other extra calls to affect_total that I missed, this solves the long-standing hacking pool resets as well as the more recent spell pool resets.

jdevnull commented 1 year ago

Added a fix to stim patch behavior.

Previously, we stored the mental value before a stim patch activates, and then if the patch was removed early, we returned to the stored mental value. This could be exploited to negate predictable sources of stun. Example: you have an upcoming nitro crash, you use a stim patch to save your current stun track, you then take the crash, and then remove the stim patch to immediately heal back to where you were.

jdevnull commented 1 year ago

Fixed dragonslayer conjuring bonus and added missing firebringer conjuring bonus.

jdevnull commented 1 year ago

When somebody who actually is mortally wounded is dragged into a recovery room, and then they attempt to DIE, they end up having a positive physical track but still mortally wounded. This fixes that by also setting their position (depending on mental track).

This answers https://discord.com/channels/564618629467996170/788953927269613608/1152077677352734761

jdevnull commented 1 year ago

Character health boxes are tracked to 2 decimal places. The heal spell was capping successes to boxes, round down, thus preventing the last box of health from being healed. This fix changes this line to round up so that the last box of health can be healed. Note that this won't allow the heal spell to exceed max since spell_modify caps to GET_MAX_PHYSICAL.

This answers https://discord.com/channels/564618629467996170/788953927269613608/1153333686629052496

luciensadi commented 1 year ago

Can you pull the master branch on both PRs please? That'll allow GH Actions to compile-test the code.

jdevnull commented 1 year ago

Previously, there were inconsistencies in 'ware compatibilities, where some 'ware combinations were permitted when installed in one order but forbidden if the same 'ware were installed in a different order. This fix makes things consistent.

Need confirmation that the following is what is intended:

jdevnull commented 1 year ago

Setting net successes to zero does not actually prevent a counterstrike against an adept using distance strike. The fix here is to just return false instead.

jdevnull commented 1 year ago

When the attacker is prone, the melee penalty should be applied to the attacker, not the defender.

jdevnull commented 1 year ago

It's possible to be fighting while prone, so this changes the feedback message when POS_FIGHTING but not AFF_PRONE to something more reasonable.

luciensadi commented 1 year ago

Merging for testing on buildport, thanks!