Delayed Regeneration


Biters/spitters, turrets, and spawners don't heal every tick, instead only healing after not taking damage for long enough. Configurable.

Tweaks
1 year, 7 months ago
0.17 - 1.1
829
Combat Enemies

Changelog

Version: 1.1.0
Date: 2022-09-25
  Changes:
    - removed unneeded migration code
Version: 1.0.1
Date: 2020-11-23
  General:
    - Factorio 1.1 release. Pls report any bugs
Version: 1.0.0
Date: 2020-09-20
  General:
    - removed an illogical pcall
    - increase version to Factorio 1.0
Version: 0.18.5
Date: 2020-02-01
  Additions:
    - search logic option - defaults to 'prototypes' which searches game.entity_prototypes
            (entity subgroup "enemies", an improvement over spawner logic)

    - added debugging command:
        reset, resets the prototypes table and determines new protoypes
              'prototypes' are from gamescript, spawned is runtime and empties table

    - added commands:
        loghealingdata, manually print settings (and heal amounts) to log
        targets, print current tick, your location, and,
              entities being healed: name, future heal tick, location
        heal_count, the number of entities being healed

    - worm turrets are now influenced by regen logic
        before they were using default healing - so still healing, but not by mod

  General:
    - commands start with DR_, so DR_healing_data, DR_targets
    - turrets now supported
    - better prototype logic

  Tweaks:
    - cleaned up code because of better understanding of control phases
    - trying new way to load settings, which includes generalizing the mod name
         and verifying setting exists
    - renamed "Bug Fix" from previous log entry to "Bug Fixes"
    - versions now 0.XX.n, where XX is major Factorio version

  Bug Fixes:
    - turrets weren't being changed (sort-of bug), as they don't spawn from a spawner
Version: 0.0.4
Date: 2019-12-30
  Tweaks:
    - code style inconsistencies
    - minor variable assignment on game load (nothing noticeable, just not what I wanted)
Version: 0.0.3
Date: 2019-12-30
  Bug Fixes:
    - Enemies might've started healing after 1 second not 10 on default settings
        whoops.

  Additions:
    - added setting for log print on_configuration_changed. added more information
Version: 0.0.2
Date: 2019-12-14
  General:
    - healing will always occur synchronously on interval ticks - design confirmation
        (should actually register to on_nth_ticks, but it's fine for now)

    - when configuration is changed, some log messages will be printed.

    - due to refactor, healing amounts will be recalculated on (any) settings change
        (prints healing amounts in log for identified types)

  Bug Fixes:
    - Forgot to remove a log message for flat healing (sorry for the flood! please update!)

  Optimizations:
    - healing style converts to flat amount per entity_prototype per interval.
       works for entity-prototypes with a fixed max health (if percent)
       (should I check the force bonus and have per-force regen?
         does it even affect non-character prototypes????
            I've seen mods with different max healths...)

      any way, it's the same behavior as before

  Notes:
    - a 0 health entity can raise a on_entity_damaged event - API *suggests* this
        is only in the event if a unit is "undamagable" because it's max health is 0

    - if I record the _next_ heal tick instead of calculating previous + delay, I'd save an addition
       per tick... probably a premature optimization, but is more streamlined, may do later

    - something I'm playing with can damage an entity but it doesn't raise the damaged event
        (normally stuff regenerates but not in this case)
        it is not acid puddles
        its not nibbles
        it shouldn't be spit
        don't know

    - may be able to use per-map settings now, to change healing on-the-fly if desired
          (never used them before, have to find examples)
Version: 0.0.1
Date: 2019-12-10
  General:
    - Initial release