1dot13 / source

Source code for the game executable of the Jagged Alliance 2 v1.13 project
102 stars 18 forks source link

Specific addictions and facility drug risks #226

Closed andrzejfalkowski closed 1 year ago

andrzejfalkowski commented 1 year ago

Added optional <drugtypes> and <drugitems> tags for backgrounds. Each tag can contain an unlimited number of specific <drugitem> and <drugtype> tags corresponding to Items and DrugTypes ids. If specified, only these items or items with these drug types, will be considered for all drug-use checks for the character with this background. If no <drugtypes> or <drugitems> are specified, all drug items will be relevant (default Larry's behaviour). It's now possible to add backgrounds for alcoholics, cokeheads, steroid users, etc.

Instead of relying on hardcoded sectors for drug use behavior, sectors with facilities and <DRUNK> risk will be considered "bar" sectors. This change is based on Sevenfm's check in Vengeance: Reloaded.

The <DRUNK> risk tag for facilities can also be given a list of <drugitems> that mercs will consume when the risk is triggered, instead of hardcoded alcohol item. If no items are detailed, alcohol will remain the default. This will allow the configuration of various bar types, opium dens, etc

AMBIENT assignment types can also trigger the <DRUNK> risk.

Facility custom drug items will interact with <drugtypes> and <drugitems> in backgrounds. Items and their types will be checked against the facility <drugtypes> if either are specified.

Minor bug fix: inventory loop for drug use wasn't checking if items were consumable, so Larry would try to eat some types of ammo.

Game dir: https://github.com/1dot13/gamedir/pull/62