Table of Contents

Loggy's Horror related subjects reverse engineering notes

See also: horror-seed

The "global horror level" is defined as follows:

  1. Default is 1.
  2. If AC is active, that is boosted to 10
  3. If the cataclysm has hit, it is 20
  4. If it is the turn before the cataclysm hit, it is 10
  5. If it is 2 turns before the cataclysm hits AND AC is not up, it is 5

Spawning a horror:

  1. Calculate an upgrade value.
    1. By default this is 15
    2. If a province is involved, set this to (DRAIN scale in the province + 3) * 5
    3. Add the haunted unit's horror marks * 20 to this
    4. If the upgrade value is greater than 500, the upgrade value is set to 500 + floor((upgrade value -500) / 5) - Get the global horror level. If it is 1, consider it as if it were 3. Otherwise [if it was >1], set upgrade value to (upgrade value + floor(horror level / 2)) * floor(horror level / 2)
  2. If asking for a lesser horror:
    1. Get a random number 0-999
    2. If upgrade value ⇐ this random number, you get a lesser horror of some description, otherwise, continue as if you asked for a greater horror
  3. If looking for a greater horror:
    1. Greater horror upgrade value = max(global horror level, floor(upgrade level/10))
    2. If greater horror upgrade value ⇐ random number 0-999, make a greater horror, else continue as if asking for a doom horror
  4. If looking for a doom horror:
    1. complicated things

Astral Corruption and Cataclysm attacks

Technically, these happen any time the global horror level (as above) is greater than 1. They do not happen on things whose path is blood magic (but items with a mixed gem/slave component will still trigger for their gem part), nor do they happen to mindless or slave vessels. For items which take two different types of gems, the below is done independently for both parts. Cost reductions from forge bonuses apply to items.

  1. Calc some number that I'm going to call the "horror score". This is (horror marks * 20 + 1) - province drain scale + (what I assume to be the number of gems you are spending)
  2. Roll an exploding d(350/global horror level). If the die result <= the horror score, you get attacked
    1. Roll an exploding d250. If the horror score >= the result, you get attacked by a doom horror
    2. Otherwise, roll an exploding d100. If the horror score >= the result, you get attacked by a greater horror
    3. Otherwise you get attacked by a lesser horror

Horror Mark attacks (this time from the executable directly)

Eater of Gods

This means pretenders are 0.5% per turn to be attacked under AC or cataclysm even without marks

This proceeds in ascending nation ID order, and exits once someone gets attacked (so only 1 attack per turn)

Hunter of Heroes

(v5.54)

Time to revisit this now I understand how the hall of fame actually works, and there's a bit more to it:

This proceeds in ascending commander ID order, and exits once someone gets attacked (so only 1 attack per turn)

Cataclysm Doom Horror Map spawns

During AC or cataclysm, the horror deserter flag has a +75% chance to cause desertion unless the horror in question is on a throne.

Send lesser horror multiplier

Is actually:

[tens]d3 + [hundreds]d6 + [ones], non exploding