This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
user:loggy:misc [2022/12/29 04:07] loggy rpcost algorithm: mistake on slaves |
user:loggy:misc [2023/12/12 13:05] loggy digging for the apostasy bug |
||
---|---|---|---|
Line 3: | Line 3: | ||
<color # | <color # | ||
- | Things that are checked every round: | ||
- | |||
- | * affliction 2^40 makes you take 1 AN internal damage. Being undead makes it go up to 2. If you are taking 1, it has a 20% chance to end | ||
* <color # | * <color # | ||
- | | + | |
- | * <color # | + | * CATEGORY Check to Win Things: |
- | * Affliction 2^50 (netted?) is str + DRN vs 20 | + | |
- | * False fetters is MR + DRN vs 20, win to escape | + | * Affliction 2^50 (netted?) is str + DRN vs 20 |
- | * Slime is 22 | + | * False fetters is MR + DRN vs 20, win to escape |
+ | * Slime is 22 | ||
+ | * size/ | ||
+ | | ||
+ | |||
+ | * CATEGORY Decompiler Nerd Things: | ||
+ | * Effect modifier 4611686018427387904 is 1/3 strength added | ||
+ | * Spec 0x100000000000000 or 72057594037927936 readds magic damage | ||
+ | * 0x4000000000000000 or 4611686018427387904 adds 1/3 strength | ||
+ | * 0x800000000 or 34359738368 is added to all effects with aoe > 0 | ||
+ | * 0x40000000 or 1073741824 is simply added to all spells | ||
+ | * 144115188075855872 makes projectiles stick to the ground rather than fly normally | ||
+ | * 0x400000000 or 17179869184 is weapon #range050 | ||
+ | * 0x8000000000000 or 2251799813685248 may be for flaming projectiles | ||
+ | * 141837069189120 is not construct immune, it actually prevents the user hitting themselves | ||
+ | |||
+ | |||
+ | * CATEGORY Behavior Afflictions: | ||
+ | * Rage: 50% chance to attack a random adjacent square | ||
+ | * Dementia: 25% to make units do nothing for 3650 ticks | ||
+ | * Confusion: 30% to stand and do nothing, 20% to attack a random adjacent square | ||
+ | * Stupid: 10% chance to do nothing (and wait for half a round), 10% to attack something adjacent at random. | ||
+ | |||
* Unknown affliction 2^38 is cleared every combat round and doesn' | * Unknown affliction 2^38 is cleared every combat round and doesn' | ||
+ | |||
+ | * affliction 2^40 makes you take 1 AN internal damage. Being undead makes it go up to 2. If you are taking 1, it has a 20% chance to end | ||
+ | |||
* <color # | * <color # | ||
* <color # | * <color # | ||
+ | |||
* <color # | * <color # | ||
+ | |||
* <color # | * <color # | ||
+ | |||
* <color # | * <color # | ||
+ | |||
* <color # | * <color # | ||
- | | + | |
+ | | ||
* <color # | * <color # | ||
- | * size/ | + | |
* Looming Hell has a 5% chance per candle in the affected unit's province to not use one of its 5 " | * Looming Hell has a 5% chance per candle in the affected unit's province to not use one of its 5 " | ||
- | * Dementia is 25% to make units do nothing for 3650 ticks | + | |
* Picus/ | * Picus/ | ||
- | | + | * ?? |
+ | |||
+ | | ||
* The chance to spawn a guardian spirit in percent is (10 * holy level) + innate guardian spirit modifier + (1 * number of candles, negative if hostile). | * The chance to spawn a guardian spirit in percent is (10 * holy level) + innate guardian spirit modifier + (1 * number of candles, negative if hostile). | ||
+ | |||
* There is a 15% chance per cold scale for a battle to take place in a snowstorm. If temp is between neutral and heat 2 inclusive, there is a (5 + growth*5)% chance for the battle to take place in a regular rain storm. UW, in the Void and in caves, there is always no natural weather. | * There is a 15% chance per cold scale for a battle to take place in a snowstorm. If temp is between neutral and heat 2 inclusive, there is a (5 + growth*5)% chance for the battle to take place in a regular rain storm. UW, in the Void and in caves, there is always no natural weather. | ||
+ | |||
* Fatigue from flying is (flight distance * enc)/20, doubled in rain or snow (but only if you don't have storm immunity or storm power). Curse of stones is a flat 2d6 nonexploding every time you fly. Flight distance is simply dx + dy, capped to a maximum of 20 for this calculation. | * Fatigue from flying is (flight distance * enc)/20, doubled in rain or snow (but only if you don't have storm immunity or storm power). Curse of stones is a flat 2d6 nonexploding every time you fly. Flight distance is simply dx + dy, capped to a maximum of 20 for this calculation. | ||
- | | + | |
+ | | ||
* Remote checks contribute (pop/20) + d50+, capped to the province' | * Remote checks contribute (pop/20) + d50+, capped to the province' | ||
* Local province: pop/10 + d100+, capped to pop. Population is drained, but scales have no impact. | * Local province: pop/10 + d100+, capped to pop. Population is drained, but scales have no impact. | ||
* Final slave total = (local contribution + remote contribution + d10 nonexploding - 1)/9 | * Final slave total = (local contribution + remote contribution + d10 nonexploding - 1)/9 | ||
- | | + | |
- | * Effect modifier 4611686018427387904 is 1/3 strength added | + | |
* <color # | * <color # | ||
+ | |||
* <color # | * <color # | ||
+ | |||
* <color # | * <color # | ||
* <color # | * <color # | ||
Line 42: | Line 80: | ||
* <color # | * <color # | ||
* <color # | * <color # | ||
+ | |||
* AoE spread: get anything adjacent (including diagonal) to the last square hit. If you already hit the square, get another one adjacent to the square you just checked and try again. Upon finding an empty square, hit that, and then start again at the origin. Repeat until the desired number of squares are hit. | * AoE spread: get anything adjacent (including diagonal) to the last square hit. If you already hit the square, get another one adjacent to the square you just checked and try again. Upon finding an empty square, hit that, and then start again at the origin. Repeat until the desired number of squares are hit. | ||
- | | + | |
- | * Stupid is 10% chance to do nothing (and wait for half a round), 10% to attack something adjacent at random. | + | |
- | * Rage: 50% chance to attack a random adjacent square | + | |
- | * Confusion: 30% to stand and do nothing, 20% to attack a random adjacent square | + | |
* Blood slave usage range looks to be 8 squares along either axis so the total usage area is square and not circular | * Blood slave usage range looks to be 8 squares along either axis so the total usage area is square and not circular | ||
- | | + | |
+ | | ||
+ | * A bad result that is mindless lowers your paths to F4A4W4E4S3D4N3B4 if any of them were higher than that | ||
+ | * Even when you fail both and die, you still get transformed into something, which feebleminds you or applies the path limiting above anyway. | ||
+ | * %%The chance of getting a pathboost in percent is (can't push you above X10) is ((10 - drain scale) * attuned percentage * 10)/100. Magic scales count for negative drain. Attuned values are a chassis attribute, for instance cave drakes have 50% earth attuned.%% | ||
* Spell interruption chance in percent is interruptdamage + 25 + (damage*100)/ | * Spell interruption chance in percent is interruptdamage + 25 + (damage*100)/ | ||
+ | |||
* Effect order notes: | * Effect order notes: | ||
* Mirror image is bypassed by the following spec values: 131072 (no effect on mindless), 1073741824, 34359738368, | * Mirror image is bypassed by the following spec values: 131072 (no effect on mindless), 1073741824, 34359738368, | ||
Line 100: | Line 144: | ||
* If the unit died, it adds one to the province' | * If the unit died, it adds one to the province' | ||
* If the unit was not undead and not inanimate, and haunted forest is active, and the battle is taking place in the relevant dominion, you get a manikin for someone (probably the enchantment owner) | * If the unit was not undead and not inanimate, and haunted forest is active, and the battle is taking place in the relevant dominion, you get a manikin for someone (probably the enchantment owner) | ||
- | * Spec 0x100000000000000 or 72057594037927936 readds magic damage | + | |
- | * 0x4000000000000000 or 4611686018427387904 adds 1/3 strength | + | |
- | * 0x800000000 or 34359738368 is added to all effects with aoe > 0 | + | |
- | * 0x40000000 or 1073741824 is simply added to all spells | + | |
- | * 144115188075855872 makes projectiles stick to the ground rather than fly normally | + | |
- | * 0x400000000 or 17179869184 is weapon #range050 | + | |
- | * 0x8000000000000 or 2251799813685248 may be for flaming projectiles | + | |
- | * 141837069189120 is not construct immune, it actually prevents the user hitting themselves (but doesn' | + | |
* Communion fatigue calc | * Communion fatigue calc | ||
* (Take spell fatigue * 10)/(num slaves + 1). If the casting master was innate, double this | * (Take spell fatigue * 10)/(num slaves + 1). If the casting master was innate, double this | ||
Line 116: | Line 153: | ||
* If slave path level == master' | * If slave path level == master' | ||
* The final fatigue added to the slave is (the above value + a random number between 0-9 inclusive) / 10, rounded down, to a minimum of 1 | * The final fatigue added to the slave is (the above value + a random number between 0-9 inclusive) / 10, rounded down, to a minimum of 1 | ||
+ | |||
* Acid damage: | * Acid damage: | ||
* Chance of rust is 4% per damage | * Chance of rust is 4% per damage | ||
* The manual' | * The manual' | ||
+ | |||
* Looks like death by homesickness, | * Looks like death by homesickness, | ||
+ | |||
* Precision (all distance/ | * Precision (all distance/ | ||
* Roll a d100. | * Roll a d100. | ||
Line 130: | Line 170: | ||
* For each number of squares to deviate, offset each coordinate by a random number between -1 and 1 | * For each number of squares to deviate, offset each coordinate by a random number between -1 and 1 | ||
* Continue this process up to 100 times if the projectile would be landing more than 2 units out of the original range of the attack or spell | * Continue this process up to 100 times if the projectile would be landing more than 2 units out of the original range of the attack or spell | ||
+ | |||
* Spells have their number of effects subtracted from their effective precision, to a maximum of -5 at 5+ effects. | * Spells have their number of effects subtracted from their effective precision, to a maximum of -5 at 5+ effects. | ||
+ | |||
* Tartarians are 50% to feeblemind, 20% to be a commander. Then, 50% to add extra afflictions (equal odds of major and minor). Continue rolling 50%s until an affliction was not added. | * Tartarians are 50% to feeblemind, 20% to be a commander. Then, 50% to add extra afflictions (equal odds of major and minor). Continue rolling 50%s until an affliction was not added. | ||
- | | + | |
+ | | ||
* Fails if targeted province has no population | * Fails if targeted province has no population | ||
* Final damage is (spell damage) or (province pop/10 * 5), whichever is less | * Final damage is (spell damage) or (province pop/10 * 5), whichever is less | ||
Line 143: | Line 186: | ||
* Land gives you Madmen, Flagellants and Mad Priests | * Land gives you Madmen, Flagellants and Mad Priests | ||
* Water gives Mad Deep One, Fanatic Deep One, Holy Deep One | * Water gives Mad Deep One, Fanatic Deep One, Holy Deep One | ||
+ | |||
* Event req_minpd and req_maxpd variance is indeed ±25% as per the mod manual | * Event req_minpd and req_maxpd variance is indeed ±25% as per the mod manual | ||
- | | + | |
* Being set on fire from fire damage is 4% per point of initial damage, but you cannot burn if you are ethereal, have unknown unit flag 0x10, fire immunity, chill aura by buff, mistform, or underwater, or have 5+ FR. Fatigue damage is 1% per point instead | * Being set on fire from fire damage is 4% per point of initial damage, but you cannot burn if you are ethereal, have unknown unit flag 0x10, fire immunity, chill aura by buff, mistform, or underwater, or have 5+ FR. Fatigue damage is 1% per point instead | ||
+ | |||
* Being frozen by cold damage is 4% per point of initial damage, and you cannot be frozen if ethereal, undead, chill aura by buff, mistform, fire shield, or 5+ CR. Fatigue damage is 1% per point instead. | * Being frozen by cold damage is 4% per point of initial damage, and you cannot be frozen if ethereal, undead, chill aura by buff, mistform, fire shield, or 5+ CR. Fatigue damage is 1% per point instead. | ||
* The manual is also lying about the thaw rate, it is actually 25% + cold res + (cold scale*6), NOT 5x cold res, to a minimum of 25% thawing rate | * The manual is also lying about the thaw rate, it is actually 25% + cold res + (cold scale*6), NOT 5x cold res, to a minimum of 25% thawing rate | ||
+ | |||
* stun chance on salt vuln is (dmg * 500)/(max hp + 10) percent. This is done before salt vuln caps damage | * stun chance on salt vuln is (dmg * 500)/(max hp + 10) percent. This is done before salt vuln caps damage | ||
* stun chance on shock hp damage is (dmg * 200)/(max hp + 5) percent. This is done before any capped damage | * stun chance on shock hp damage is (dmg * 200)/(max hp + 5) percent. This is done before any capped damage | ||
* stun chance of shock fatigue damage is (dmg * 100)/(max hp + 5) | * stun chance of shock fatigue damage is (dmg * 100)/(max hp + 5) | ||
* ... so this is why tweaps stuns everything it touches (1 AN capped shock, 3 AN fatigue) | * ... so this is why tweaps stuns everything it touches (1 AN capped shock, 3 AN fatigue) | ||
+ | |||
* Movement collisions: | * Movement collisions: | ||
* Calc chassis value for commanders and squads MOVING into each other. Units standing still don't count. | * Calc chassis value for commanders and squads MOVING into each other. Units standing still don't count. | ||
Line 157: | Line 205: | ||
* For each side, roll an openended d(total chassis value on this side). Divide the original number by 10 and add the die result to it. | * For each side, roll an openended d(total chassis value on this side). Divide the original number by 10 and add the die result to it. | ||
* Compare this value. The loser gets stopped and the fight happens where they are. In the very unlikely event of a tie, the one starting in the highest province ID wins and pushes the other. | * Compare this value. The loser gets stopped and the fight happens where they are. In the very unlikely event of a tie, the one starting in the highest province ID wins and pushes the other. | ||
+ | |||
* Special province IDs | * Special province IDs | ||
* -18 - dead twiceborned commanders | * -18 - dead twiceborned commanders | ||
Line 169: | Line 218: | ||
* -6 - dead immortals | * -6 - dead immortals | ||
* -2 - special merc home province | * -2 - special merc home province | ||
+ | |||
* Poison fatigue damage on size 3+ is reduced to (dmg*2)/ | * Poison fatigue damage on size 3+ is reduced to (dmg*2)/ | ||
- | | + | |
+ | | ||
* Sea fathers turn into soulless# | * Sea fathers turn into soulless# | ||
* Cyclops#156 turn into tartarian cyclops (!) | * Cyclops#156 turn into tartarian cyclops (!) | ||
Line 258: | Line 309: | ||
* if that kind of resource cost is 3-14, 914 | * if that kind of resource cost is 3-14, 914 | ||
* otherwise, 915 | * otherwise, 915 | ||
- | | + | |
+ | | ||
* You get (nreff + crossbreeding bonus) creatures. | * You get (nreff + crossbreeding bonus) creatures. | ||
* Quality is (Luck * 5) + 17 + crossbreeding bonus. | * Quality is (Luck * 5) + 17 + crossbreeding bonus. | ||
* There is a (quality/ | * There is a (quality/ | ||
+ | |||
* Hero arrival: chance is 3% + luck scale | * Hero arrival: chance is 3% + luck scale | ||
* First roll for normal heroes, if that misses you roll for multihero; if a normal hero is blocked by minimum arrival turn the roll is ignored as if it never succeeded | * First roll for normal heroes, if that misses you roll for multihero; if a normal hero is blocked by minimum arrival turn the roll is ignored as if it never succeeded | ||
- | | + | |
+ | | ||
* First, the site searching. | * First, the site searching. | ||
* Check each province that you own and has friendly dominion. | * Check each province that you own and has friendly dominion. | ||
Line 278: | Line 332: | ||
* If the victim is an astral mage, both sides roll current Astral level (this will include boosters) + closed d6. The global caster wins ties, and the loser is feebleminded. Unlike magic duel, a tie only feebleminds the victim and leaves the caster intact. | * If the victim is an astral mage, both sides roll current Astral level (this will include boosters) + closed d6. The global caster wins ties, and the loser is feebleminded. Unlike magic duel, a tie only feebleminds the victim and leaves the caster intact. | ||
* If the global caster got feebleminded, | * If the global caster got feebleminded, | ||
- | | + | |
+ | | ||
* Special AoE values: | * Special AoE values: | ||
* 666 all squares | * 666 all squares | ||
Line 285: | Line 341: | ||
* 663 50% | * 663 50% | ||
* 662 5% | * 662 5% | ||
+ | |||
* Raid order: | * Raid order: | ||
* Get the lowest combat speed of all the raiders/ | * Get the lowest combat speed of all the raiders/ | ||
Line 300: | Line 357: | ||
* Message for the raider: "%s has raided in %s. %d people were killed and %d gold were confiscated." | * Message for the raider: "%s has raided in %s. %d people were killed and %d gold were confiscated." | ||
* Message for the raided: "An enemy force has raided %s. %d people were killed." | * Message for the raided: "An enemy force has raided %s. %d people were killed." | ||
+ | |||
* Upkeep and desertion: | * Upkeep and desertion: | ||
- | * Calc your upkeep for everything (units banished to other planes don't count). If your final gold total is negative and your upkeep was nonzero, it's desertion time. | + | * Calc your upkeep for everything (units banished to other planes don't count). If your final gold total is negative and your upkeep was nonzero, it's desertion time. The "gold per year" displayed under the morale section on a unit card is actually (actual upkeep per turn*12 + 7)/15 rounded down |
* Calculate (negative gold total * -25) / (total upkeep). This is the desertion chance in % | * Calculate (negative gold total * -25) / (total upkeep). This is the desertion chance in % | ||
* If that was was 11+, set it to 10. | * If that was was 11+, set it to 10. | ||
Line 309: | Line 367: | ||
* Report the number of deserters in the message. | * Report the number of deserters in the message. | ||
* Set your gold count to 0 from whatever negative value it was. | * Set your gold count to 0 from whatever negative value it was. | ||
+ | |||
* Pathfinding, | * Pathfinding, | ||
* When you click a commander, seemingly for each province on the map (some may be skipped, it's unclear what the criteria are for this though as the disassembler can't tell me what writes to the variable that is checked) | * When you click a commander, seemingly for each province on the map (some may be skipped, it's unclear what the criteria are for this though as the disassembler can't tell me what writes to the variable that is checked) | ||
Line 328: | Line 387: | ||
* Continue this process " | * Continue this process " | ||
* Side note, checking for cold scales iterates over the enchantment arrays twice, once for illwinter and again for second sun | * Side note, checking for cold scales iterates over the enchantment arrays twice, once for illwinter and again for second sun | ||
- | | + | |
+ | | ||
* Lifedrain does 1/4 damage (rounded down) to inanimates | * Lifedrain does 1/4 damage (rounded down) to inanimates | ||
+ | |||
* %%Bleeding inflicts 10 fatigue and ((max hp + closed d20 - 1)/20, rounded down) HP damage per tick, the chance of it stopping really is (10 + regen percentage)%, | * %%Bleeding inflicts 10 fatigue and ((max hp + closed d20 - 1)/20, rounded down) HP damage per tick, the chance of it stopping really is (10 + regen percentage)%, | ||
+ | |||
* Therodos spectre reanimation is 4/9 for hoplites, 2/9 for archers, 2/9 for peltasts, 1/9 for kouretes | * Therodos spectre reanimation is 4/9 for hoplites, 2/9 for archers, 2/9 for peltasts, 1/9 for kouretes | ||
+ | |||
* Target rear: | * Target rear: | ||
* For each unit in the game (in ascending ID order): | * For each unit in the game (in ascending ID order): | ||
Line 342: | Line 406: | ||
* Either you do not have a ranged weapon, your ranged weapon can affect mindless beings, or the target is not mindless | * Either you do not have a ranged weapon, your ranged weapon can affect mindless beings, or the target is not mindless | ||
* Either < | * Either < | ||
+ | |||
* Popkill by events (eg, black death) generates 1 unarmed corpse per 10 pop killed | * Popkill by events (eg, black death) generates 1 unarmed corpse per 10 pop killed | ||
+ | |||
* Summon animals rituals (in order of priority, so swamp/ | * Summon animals rituals (in order of priority, so swamp/ | ||
* Swamp: 2/3 giant spider, 1/3 horned serpent | * Swamp: 2/3 giant spider, 1/3 horned serpent | ||
Line 375: | Line 441: | ||
* 1/6: goat | * 1/6: goat | ||
* 1/6: deer | * 1/6: deer | ||
+ | |||
* MA ctis miasma is < | * MA ctis miasma is < | ||
+ | |||
* Supplies and starvation: This stuff is rolled independently for each non-commander that has to eat | * Supplies and starvation: This stuff is rolled independently for each non-commander that has to eat | ||
* Chance of bad things = %%min(90, ((supp usage - supplies) * 100)/ | * Chance of bad things = %%min(90, ((supp usage - supplies) * 100)/ | ||
Line 391: | Line 459: | ||
* If anyone was hurt due to already having disease, or someone started starving (and the above messages didn't trigger), "There is a lack of supplies in %s. Diseases are afflicting the troops." | * If anyone was hurt due to already having disease, or someone started starving (and the above messages didn't trigger), "There is a lack of supplies in %s. Diseases are afflicting the troops." | ||
* Otherwise, no message | * Otherwise, no message | ||
- | * Beckoning targeting: goes for the main province owner. If that is the same as the caster' | + | |
* Precision: | * Precision: | ||
* First add together all modifiers except experience stars. | * First add together all modifiers except experience stars. | ||
Line 399: | Line 467: | ||
* Mist or mist of deception or both (don't do this twice for both) | * Mist or mist of deception or both (don't do this twice for both) | ||
* Add experience modifier | * Add experience modifier | ||
+ | |||
* Innate Flyers (not by buff etc) can only be charged by other flyers (that can fly for any reason, incl buffs). Everyone else " | * Innate Flyers (not by buff etc) can only be charged by other flyers (that can fly for any reason, incl buffs). Everyone else " | ||
+ | |||
* Pebbleskin suit is 2% per turn to transform you, but not if you're inanimate | * Pebbleskin suit is 2% per turn to transform you, but not if you're inanimate | ||
- | | + | |
+ | | ||
* UW always gets 409 = size 5 water | * UW always gets 409 = size 5 water | ||
* Cold 2 gets 833 = size 4 ice | * Cold 2 gets 833 = size 4 ice | ||
Line 409: | Line 480: | ||
* If the victim is inanimate or not in a freshwater province, you get 412 = size 2 water | * If the victim is inanimate or not in a freshwater province, you get 412 = size 2 water | ||
* Otherwise, 411 = size 3 water | * Otherwise, 411 = size 3 water | ||
- | | + | |
+ | | ||
* Total up the number of nonsneaking commanders of all nations in the target province, except those that are on the same team as the caster | * Total up the number of nonsneaking commanders of all nations in the target province, except those that are on the same team as the caster | ||
* Each nation rolls (closed d100 + 49) * number of commanders, the highest value " | * Each nation rolls (closed d100 + 49) * number of commanders, the highest value " | ||
* In the event of a tie, the lower nation ID takes precedence | * In the event of a tie, the lower nation ID takes precedence | ||
* If you have no nonsneaking commanders you cannot be hit | * If you have no nonsneaking commanders you cannot be hit | ||
+ | |||
* Turmoil summon is an exploding d%%((turmoil * 3) + 5)%% every turn | * Turmoil summon is an exploding d%%((turmoil * 3) + 5)%% every turn | ||
- | | + | |
- | * Ghost ship armada: | + | |
+ | |||
+ | * ??Ghost Ship Armada??: | ||
* For each unlocked armada... | * For each unlocked armada... | ||
* Pick a random province. | * Pick a random province. | ||
Line 449: | Line 524: | ||
* Possible bug: it seems like only the gold generated by the last armada counts... also the message only reports the last popkill value... | * Possible bug: it seems like only the gold generated by the last armada counts... also the message only reports the last popkill value... | ||
* Every 350 gold unlocks another armada, up to the max of 5 | * Every 350 gold unlocks another armada, up to the max of 5 | ||
+ | |||
* Each step the AI goes from normal modifies the amount of design points they get by ±50 | * Each step the AI goes from normal modifies the amount of design points they get by ±50 | ||
+ | |||
* Global enchantment dispelling/ | * Global enchantment dispelling/ | ||
- | | + | |
+ | | ||
* Start with 10 attempts remaining | * Start with 10 attempts remaining | ||
* If attempts remaining & 1 == 0, look at province ID 1. Otherwise, look at a random province ID | * If attempts remaining & 1 == 0, look at province ID 1. Otherwise, look at a random province ID | ||
Line 480: | Line 558: | ||
* Dire Wolf commander, 1d10 + 10 Wolves | * Dire Wolf commander, 1d10 + 10 Wolves | ||
* If these lesser attacks fail, nothing happens to the global enchantment. | * If these lesser attacks fail, nothing happens to the global enchantment. | ||
- | | + | |
+ | | ||
* 2 spawn chances. Pick a random province, it fails if provinces is UW, not cold, or owned by the caster or his team. Equal chances for: | * 2 spawn chances. Pick a random province, it fails if provinces is UW, not cold, or owned by the caster or his team. Equal chances for: | ||
* Niefel Giant commander with closed d4 - 1 Niefel Giant troops | * Niefel Giant commander with closed d4 - 1 Niefel Giant troops | ||
Line 486: | Line 565: | ||
* Werewolf commander with open ended 2d20 Wolf troops | * Werewolf commander with open ended 2d20 Wolf troops | ||
* Jotun Wolf commander with open ended 2d6 Dire Wolf troops | * Jotun Wolf commander with open ended 2d6 Dire Wolf troops | ||
- | | + | |
+ | | ||
* Roll closed 2d6, add the game era [a range 1-3] and subtract 1. Going to call this the era value for now | * Roll closed 2d6, add the game era [a range 1-3] and subtract 1. Going to call this the era value for now | ||
* Roll open 1d4, subtract 2, add the number of effects, and half your adept crossbreeder value rounded down. This value can't be lower than 1. This turns out to be the number of units made | * Roll open 1d4, subtract 2, add the number of effects, and half your adept crossbreeder value rounded down. This value can't be lower than 1. This turns out to be the number of units made | ||
Line 497: | Line 577: | ||
* If exactly 7, you get Hell Spawn# | * If exactly 7, you get Hell Spawn# | ||
* If 8+ you get Hell Spawn# | * If 8+ you get Hell Spawn# | ||
+ | |||
* UW flight needs: | * UW flight needs: | ||
* the innate chassis ability to fly, not via buff or item, AND... | * the innate chassis ability to fly, not via buff or item, AND... | ||
* either innate chassis aquatic or amphibiousness, | * either innate chassis aquatic or amphibiousness, | ||
+ | |||
* Effects that trigger magic phase battles on the targeted province: | * Effects that trigger magic phase battles on the targeted province: | ||
* 37 remote summon permanent units | * 37 remote summon permanent units | ||
Line 510: | Line 592: | ||
* 19 teleport | * 19 teleport | ||
* 114 treelord | * 114 treelord | ||
- | | + | |
- | * Hidden in Snow: | + | |
+ | |||
+ | * ??Hidden in Snow??: | ||
* Always 1 unfrozen lord | * Always 1 unfrozen lord | ||
* You get (8 - drain) + turmoil + closed d8 unfrozen warriors | * You get (8 - drain) + turmoil + closed d8 unfrozen warriors | ||
Line 517: | Line 601: | ||
* %%There is a (3 * (25 - misfortune))% chance to get a mage%% | * %%There is a (3 * (25 - misfortune))% chance to get a mage%% | ||
* There is a second, independent (3*misfortune + 25)% chance to get a mage | * There is a second, independent (3*misfortune + 25)% chance to get a mage | ||
- | | + | |
+ | | ||
* Always 1 leader | * Always 1 leader | ||
* %%((8 - drain) - turmoil) + closed d8 good troops%% | * %%((8 - drain) - turmoil) + closed d8 good troops%% | ||
Line 523: | Line 608: | ||
* (-3 * misfortune + 85)% chance for a mage | * (-3 * misfortune + 85)% chance for a mage | ||
* second (-2 * misfortune + 15)% chance for a mage | * second (-2 * misfortune + 15)% chance for a mage | ||
+ | |||
* Dome order: | * Dome order: | ||
* Celestial rainbow | * Celestial rainbow | ||
Line 531: | Line 617: | ||
* Air | * Air | ||
* Forest | * Forest | ||
- | | + | |
+ | | ||
* Get first valid hero in HoF that is dead and owned by the caster' | * Get first valid hero in HoF that is dead and owned by the caster' | ||
* Get resource size, if set. Otherwise, use " | * Get resource size, if set. Otherwise, use " | ||
Line 538: | Line 625: | ||
* Otherwise: become the spell' | * Otherwise: become the spell' | ||
* Prophet status is removed if you made another prophet, but not H3. | * Prophet status is removed if you made another prophet, but not H3. | ||
- | | + | |
+ | | ||
* Final nreff = min(spell nreff, the number of units in the province belonging to the fort owner) | * Final nreff = min(spell nreff, the number of units in the province belonging to the fort owner) | ||
* Forest survival does provide immunity | * Forest survival does provide immunity | ||
* Otherwise, affected units roll morale + DRN vs 10 + DRN, victim wins ties | * Otherwise, affected units roll morale + DRN vs 10 + DRN, victim wins ties | ||
* If they fail that, they suffer the damage/spec of the spell as effect 2 (so for vanilla it's 999 damage, MRN, uses caster' | * If they fail that, they suffer the damage/spec of the spell as effect 2 (so for vanilla it's 999 damage, MRN, uses caster' | ||
- | | + | |
+ | | ||
+ | |||
+ | * ??Stygian Paths?? | ||
* Stygian Guide value = the highest value of stygian guide of the commander and all troops under their leadership | * Stygian Guide value = the highest value of stygian guide of the commander and all troops under their leadership | ||
* All units take 1 AN magic damage | * All units take 1 AN magic damage | ||
* The stygian guide value offers a % chance to avoid the MR or die effect | * The stygian guide value offers a % chance to avoid the MR or die effect | ||
* If any given unit is stealthy, it has a (stealthy)% chance to avoid the MR or die effect, to a maximum of 90% evasion at 90+ stealth. | * If any given unit is stealthy, it has a (stealthy)% chance to avoid the MR or die effect, to a maximum of 90% evasion at 90+ stealth. | ||
- | | + | |
+ | | ||
* Units with base twiceborn shapes defined use that | * Units with base twiceborn shapes defined use that | ||
* If you have a # | * If you have a # | ||
Line 573: | Line 665: | ||
* If the unit is size 1, not innately flying, and female, it becomes a Wight Mage#3449 [size 1 vaetti female] | * If the unit is size 1, not innately flying, and female, it becomes a Wight Mage#3449 [size 1 vaetti female] | ||
* Otherwise (the unit is size 1 and innately flying) it becomes a Wight Mage#3447 [zotz] | * Otherwise (the unit is size 1 and innately flying) it becomes a Wight Mage#3447 [zotz] | ||
+ | |||
* Non-permenant affliction notes: | * Non-permenant affliction notes: | ||
* Slime | * Slime | ||
Line 590: | Line 683: | ||
* Encase in ice: set to 0 | * Encase in ice: set to 0 | ||
* Sleep: set to 0 | * Sleep: set to 0 | ||
+ | |||
* Defence modifiers on action rate: | * Defence modifiers on action rate: | ||
* quickness x2 | * quickness x2 | ||
Line 596: | Line 690: | ||
* If final action rate > 1, +2 def | * If final action rate > 1, +2 def | ||
* If final action rate < 1, -2 def | * If final action rate < 1, -2 def | ||
+ | |||
* Disease damage/ | * Disease damage/ | ||
+ | |||
* Chain lightning spread: | * Chain lightning spread: | ||
* A new jump happens every 120 ticks | * A new jump happens every 120 ticks | ||
* Cannot hit the same victim twice in a row | * Cannot hit the same victim twice in a row | ||
* Will prefer to jump to a random target within 1 square reach, but can travel up to 2 squares (using pythagorus, rounding down) | * Will prefer to jump to a random target within 1 square reach, but can travel up to 2 squares (using pythagorus, rounding down) | ||
+ | |||
* Independent gem regeneration: | * Independent gem regeneration: | ||
* Occurs immediately after player incomes are calculated. Happens for every alive commander with an owning nation of less than 5 (so will include special monsters) that has a positive province ID (so not commanders in other planes). | * Occurs immediately after player incomes are calculated. Happens for every alive commander with an owning nation of less than 5 (so will include special monsters) that has a positive province ID (so not commanders in other planes). | ||
Line 607: | Line 704: | ||
* Otherwise, add 1 gem, and repeat the above step again, EXCEPT deduct one from their path level. | * Otherwise, add 1 gem, and repeat the above step again, EXCEPT deduct one from their path level. | ||
* Example: a F3 mage has no gems. The first gem is added if 9 - 0 > a random number 0-19. If this happens, the check for the second gem is 6 [F3, minus one as one gem was added this turn] - 1 [one fire gem now owned] | * Example: a F3 mage has no gems. The first gem is added if 9 - 0 > a random number 0-19. If this happens, the check for the second gem is 6 [F3, minus one as one gem was added this turn] - 1 [one fire gem now owned] | ||
+ | |||
* Projectiles and hitzones: | * Projectiles and hitzones: | ||
* This is for spells and ranged weapons with AoE: one person | * This is for spells and ranged weapons with AoE: one person | ||
Line 615: | Line 713: | ||
* 20% to hit arms, if no arms then hit body | * 20% to hit arms, if no arms then hit body | ||
* 10% to hit head, if no head then hit body | * 10% to hit head, if no head then hit body | ||
+ | |||
* Melee hitzones: | * Melee hitzones: | ||
* Reduced weapon length = (length of weapon - 1), to a minimum of 0 | * Reduced weapon length = (length of weapon - 1), to a minimum of 0 | ||
Line 634: | Line 733: | ||
* If victim doesn' | * If victim doesn' | ||
* Otherwise, you successfully hit the legs. | * Otherwise, you successfully hit the legs. | ||
+ | |||
* Defence negates rolls an openended 3d6. If this is less than the unit's defence skill, not including fatigue or modifiers from weapons, with shields subtracting their encumbrance value from the score (and not adding their parry value), the effect is negated. Trample' | * Defence negates rolls an openended 3d6. If this is less than the unit's defence skill, not including fatigue or modifiers from weapons, with shields subtracting their encumbrance value from the score (and not adding their parry value), the effect is negated. Trample' | ||
+ | |||
* Retreating and death: | * Retreating and death: | ||
* For my benefit only because this is really confusing: flags initially set are 8, 9, c, d, e, f, 16, 17, 18... 12 can be set later, all others are not relevant for this | * For my benefit only because this is really confusing: flags initially set are 8, 9, c, d, e, f, 16, 17, 18... 12 can be set later, all others are not relevant for this | ||
Line 644: | Line 745: | ||
* If you have can't pass rivers (eg vampires), you die | * If you have can't pass rivers (eg vampires), you die | ||
* If you die when taken underwater, can't teleport, can't fly, lack the swimming tag, Sea of Ice is not active, or either side of the river is not cold 1+, you die | * If you die when taken underwater, can't teleport, can't fly, lack the swimming tag, Sea of Ice is not active, or either side of the river is not cold 1+, you die | ||
+ | |||
* Ind's poptypes: | * Ind's poptypes: | ||
* The " | * The " | ||
Line 656: | Line 758: | ||
* In other cases, you get feminie if random determinant is even, or piconye if random determinant is odd | * In other cases, you get feminie if random determinant is even, or piconye if random determinant is odd | ||
* This means that you should in theory, after one piconye, feminie or mountain cyno fort, identify if the random component itself is even or odd, and be able to predict all randomness after that | * This means that you should in theory, after one piconye, feminie or mountain cyno fort, identify if the random component itself is even or odd, and be able to predict all randomness after that | ||
+ | |||
* Mapmove function (IE: what the inspector needs to implement to show correct mapmoves) | * Mapmove function (IE: what the inspector needs to implement to show correct mapmoves) | ||
* If 0 or negative, it isn't changed | * If 0 or negative, it isn't changed | ||
Line 682: | Line 785: | ||
* Add mapspeed bonuses (eg from items), if any | * Add mapspeed bonuses (eg from items), if any | ||
* If you can fly, and have a value for unit effect 0xe6 (which seems to be only used for " | * If you can fly, and have a value for unit effect 0xe6 (which seems to be only used for " | ||
- | | + | |
+ | | ||
+ | * This is seemingly identical (I have not looked TOO hard) to the function below for commanders, | ||
+ | * TODO check more carefully. I don't really know where my adventures in writing the below took me | ||
+ | |||
+ | * " | ||
* Get base max age. If one isn't set on the chassis data: | * Get base max age. If one isn't set on the chassis data: | ||
* Default: 50. Otherwise, take the first one of these that applies | * Default: 50. Otherwise, take the first one of these that applies | ||
Line 702: | Line 810: | ||
* Base startage = maxage/3 + something2 | * Base startage = maxage/3 + something2 | ||
* The following is used only when not used in " | * The following is used only when not used in " | ||
- | * ... some stuff I don't understand | + | * Stuff I don't understand |
* If good leader (80 base leadership), | * If good leader (80 base leadership), | ||
* If expert leader (120 base leadership), | * If expert leader (120 base leadership), | ||
Line 709: | Line 817: | ||
* If no startage modifier, and base RP cost is 500+: | * If no startage modifier, and base RP cost is 500+: | ||
* Get the unit's base gold cost. If it is 15000+, subtract 10000 from it. Calling this the reduced gold cost, I guess? | * Get the unit's base gold cost. If it is 15000+, subtract 10000 from it. Calling this the reduced gold cost, I guess? | ||
- | * Get the unit's base recpoint cost, divide it by 1000. Calling this the reduced recpoint cost | + | * Get the unit's base recpoint cost, add 500 then divide it by 1000. Calling this the reduced recpoint cost |
- | * Something4 = %%((reduced goldcost - reduced recpoints)*10)/ | + | * Something4 = %%((reduced goldcost - reduced recpoints)*10)/ |
* If the result is beyond the range -5 to 5, move it to the closest value | * If the result is beyond the range -5 to 5, move it to the closest value | ||
* Add to base start age. | * Add to base start age. | ||
Line 716: | Line 824: | ||
* If the chassis has undocumented 0x2a1 (this is on two Hag heroes with a value of 350), and this is MA or LA, add %%((closed d50 + 74)*attribute' | * If the chassis has undocumented 0x2a1 (this is on two Hag heroes with a value of 350), and this is MA or LA, add %%((closed d50 + 74)*attribute' | ||
* If the chassis has add random age: | * If the chassis has add random age: | ||
- | * In [what context? it's some, but not newunit calls] some contexts, this always adds attribute value/3 | + | * In [what context? it's some, but not newunit calls] some contexts, this always adds attribute value/3. [This includes the recpoint autocalc algorithm] |
* Otherwise, add an openended d(value) | * Otherwise, add an openended d(value) | ||
* If you are a commander, and startage is not set: | * If you are a commander, and startage is not set: | ||
Line 742: | Line 850: | ||
* If the commander is not being viewed in a UI preview window, add (variance) + closed d(variance/ | * If the commander is not being viewed in a UI preview window, add (variance) + closed d(variance/ | ||
* If this is a UI preview window, add variance + (variance/ | * If this is a UI preview window, add variance + (variance/ | ||
+ | |||
* <color # | * <color # | ||
+ | |||
* The arena is technically a wasteland, but I don't know any reason why this is important | * The arena is technically a wasteland, but I don't know any reason why this is important | ||
+ | |||
* Arena fights always proceed like: | * Arena fights always proceed like: | ||
* Pick a random nation that entered | * Pick a random nation that entered | ||
* Pick a random nation that entered and that isn't the first nation | * Pick a random nation that entered and that isn't the first nation | ||
* Repeat until there' | * Repeat until there' | ||
+ | |||
* Field sizes: | * Field sizes: | ||
* The Void, Inferno, Kokytos, Arenas, are always 40x20 | * The Void, Inferno, Kokytos, Arenas, are always 40x20 | ||
Line 760: | Line 872: | ||
* Width = 40 + (total size - 4400)/260 | * Width = 40 + (total size - 4400)/260 | ||
* Neither dimension may exceed 198 | * Neither dimension may exceed 198 | ||
+ | |||
* Both kinds of corpses decay to 80% of their values every turn | * Both kinds of corpses decay to 80% of their values every turn | ||
+ | |||
* Growth/ | * Growth/ | ||
* The scale growth mod (which is 20 by default but can be modded) is multiplied by the province' | * The scale growth mod (which is 20 by default but can be modded) is multiplied by the province' | ||
* the amount subtracted from the displayed ingame province' | * the amount subtracted from the displayed ingame province' | ||
+ | |||
* <color # | * <color # | ||
+ | |||
* Recpoint autocalc - applies to non-commanders, | * Recpoint autocalc - applies to non-commanders, | ||
* If set RP is less than 500, use that and don't do any more of this. | * If set RP is less than 500, use that and don't do any more of this. | ||
Line 781: | Line 897: | ||
* If E is less than 2, set it to 2. | * If E is less than 2, set it to 2. | ||
* E is the final RP cost. | * E is the final RP cost. | ||
+ | |||
* Innate casters: | * Innate casters: | ||
* Operate on a clock that starts at 0, and goes up by 1 every 1880 ticks. | * Operate on a clock that starts at 0, and goes up by 1 every 1880 ticks. | ||
Line 793: | Line 910: | ||
* ... so a commander with a unit ID of 3014 would have a delay of 3014 mod 188 = 6; 6 - 1 * 10 = **50 ticks** from the above | * ... so a commander with a unit ID of 3014 would have a delay of 3014 mod 188 = 6; 6 - 1 * 10 = **50 ticks** from the above | ||
* Timestop changes all this, not looked at that yet | * Timestop changes all this, not looked at that yet | ||
+ | |||
* The delay for a normal guy going from preparing to actually casting a spell is (75 * spell' | * The delay for a normal guy going from preparing to actually casting a spell is (75 * spell' | ||
+ | |||
* Initial delay: | * Initial delay: | ||
* Units roll a (closed d1000 - 1) for each squad member, and get the lowest result | * Units roll a (closed d1000 - 1) for each squad member, and get the lowest result | ||
* Commanders just get one swing on a d1000-1 | * Commanders just get one swing on a d1000-1 | ||
- | | + | |
+ | | ||
* Spellcasting AI scans squares in lines going down the length of the battlefield. It starts at the top left corner, goes all the way right, then moves down a line, and repeats. | * Spellcasting AI scans squares in lines going down the length of the battlefield. It starts at the top left corner, goes all the way right, then moves down a line, and repeats. | ||
* This is relevant because in the case of a TIED score, the first square checked is always retained, making magic duel somewhat biased towards things on rows closer to the top of the battlefield (and to a lesser extent, things on the left of these rows). | * This is relevant because in the case of a TIED score, the first square checked is always retained, making magic duel somewhat biased towards things on rows closer to the top of the battlefield (and to a lesser extent, things on the left of these rows). | ||
Line 805: | Line 925: | ||
* Multiply score by 15, then divide by 15 or the distance to the target, whichever is greater, then round down. | * Multiply score by 15, then divide by 15 or the distance to the target, whichever is greater, then round down. | ||
* Being close to the caster and/or closer to the top of the screen will make you more likely to be the target of a magic duel. | * Being close to the caster and/or closer to the top of the screen will make you more likely to be the target of a magic duel. | ||
+ | |||
* Tartarian/ | * Tartarian/ | ||
* This affects all types of order 63, which are: "Build mausoleum" | * This affects all types of order 63, which are: "Build mausoleum" | ||
Line 815: | Line 936: | ||
* Otherwise, there is a %%(((death path + 3) - candles) * 5)% chance%% to subtract 1 candle from the dominion strength of the province. | * Otherwise, there is a %%(((death path + 3) - candles) * 5)% chance%% to subtract 1 candle from the dominion strength of the province. | ||
* If the shattered souler was in a candleless province and there was no unholy nation, nothing happens. | * If the shattered souler was in a candleless province and there was no unholy nation, nothing happens. | ||
+ | |||
* " | * " | ||
* This is all varieties of (regular insanity) order 62: " | * This is all varieties of (regular insanity) order 62: " | ||
* The unholy nation this time is LA rlyeh/ | * The unholy nation this time is LA rlyeh/ | ||
* This is the same as the above, except %%((holy path * 2) + 2) is used to replace all instances of (death path + 3)%% | * This is the same as the above, except %%((holy path * 2) + 2) is used to replace all instances of (death path + 3)%% | ||
+ | |||
* Ice fort melting: | * Ice fort melting: | ||
* Roll a random number -2 to 0 inclusive. | * Roll a random number -2 to 0 inclusive. | ||
Line 827: | Line 950: | ||
* If the fort has been damaged 10+ times, it permenantly becomes a half melted fort: "The %s in %s has mostly melted away due to the prolonged heat. The damage is now beyond repair and the half melted fort has to be destroyed so a new and better fort can be built." | * If the fort has been damaged 10+ times, it permenantly becomes a half melted fort: "The %s in %s has mostly melted away due to the prolonged heat. The damage is now beyond repair and the half melted fort has to be destroyed so a new and better fort can be built." | ||
* In cold 1+, a fort at any level of destruction instead gets (3 * cold scale) subtracted from its damage count. This cannot lower the damage count below 0. If this lowers the damage progress to zero and the fort is not half melted: "The %s in %s has fully recovered from the earlier melting." | * In cold 1+, a fort at any level of destruction instead gets (3 * cold scale) subtracted from its damage count. This cannot lower the damage count below 0. If this lowers the damage progress to zero and the fort is not half melted: "The %s in %s has fully recovered from the earlier melting." | ||
+ | |||
* Mirror image and exact chances | * Mirror image and exact chances | ||
* Num images = max(1, 2 * air level), as would be expected | * Num images = max(1, 2 * air level), as would be expected | ||
Line 835: | Line 959: | ||
* 21 images: 4% [unrounded values would have you say 4.76%] | * 21 images: 4% [unrounded values would have you say 4.76%] | ||
* So I guess Really Stupid Large numbers of images get the most out of the slight rounding error... | * So I guess Really Stupid Large numbers of images get the most out of the slight rounding error... | ||
+ | |||
* Assassinations and bodyguards: | * Assassinations and bodyguards: | ||
* The chance of each bodyguard showing up in percent is 50, +10 per bodyguard point the unit has, -10 per patience point the assassin has. The chance can't fall below 5% or exceed 95%. This is rolled individually per unit bodyguarding the commander. | * The chance of each bodyguard showing up in percent is 50, +10 per bodyguard point the unit has, -10 per patience point the assassin has. The chance can't fall below 5% or exceed 95%. This is rolled individually per unit bodyguarding the commander. | ||
* Warning doesn' | * Warning doesn' | ||
+ | |||
* Reaper/ | * Reaper/ | ||
* Add up the total reaper/ | * Add up the total reaper/ | ||
Line 850: | Line 976: | ||
* Kill (total reaper and active plague doctors/2)% of the province population. | * Kill (total reaper and active plague doctors/2)% of the province population. | ||
* Add %%((killed population/ | * Add %%((killed population/ | ||
+ | |||
* Marignon innate dompushing (nation attribute 41, MA/LA Marignon both have this with a value of 1) | * Marignon innate dompushing (nation attribute 41, MA/LA Marignon both have this with a value of 1) | ||
* Only in owned provinces in hostile (not neutral) dominion, also applies to friendly forts under siege | * Only in owned provinces in hostile (not neutral) dominion, also applies to friendly forts under siege | ||
* Chance to deduct a hostile dominion candle is 30%, or 60% if a temple is present. If there' | * Chance to deduct a hostile dominion candle is 30%, or 60% if a temple is present. If there' | ||
* This can also spread dominion to a max of 1 white candle (or 2 if a temple is present). The chance of adding one is 20%, or 40% if a temple is present. | * This can also spread dominion to a max of 1 white candle (or 2 if a temple is present). The chance of adding one is 20%, or 40% if a temple is present. | ||
+ | |||
* On dominion spreading: | * On dominion spreading: | ||
* If the province has hostile dominion, there is a (50 + (5* dom conflict bonus) + (5 * pretender' | * If the province has hostile dominion, there is a (50 + (5* dom conflict bonus) + (5 * pretender' | ||
Line 859: | Line 987: | ||
* The chance to add to dominion in the province where the check originated is %%((10 - candles) * 3)%.%% This cannot happen if the province is already up to your current dominion strength. | * The chance to add to dominion in the province where the check originated is %%((10 - candles) * 3)%.%% This cannot happen if the province is already up to your current dominion strength. | ||
* Otherwise, pick an adjacent province and repeat up to 1500 times per temple check. | * Otherwise, pick an adjacent province and repeat up to 1500 times per temple check. | ||
+ | |||
* Capital starting population (before the adjustment some nation like popkillers get) is 10 * (2950 + closed d100) | * Capital starting population (before the adjustment some nation like popkillers get) is 10 * (2950 + closed d100) | ||
+ | |||
* Capital starting resources is 78 + closed d5 | * Capital starting resources is 78 + closed d5 | ||
+ | |||
* Path loss on recall | * Path loss on recall | ||
* This whole section doesn' | * This whole section doesn' | ||
Line 879: | Line 1010: | ||
* If you are B3 or lower and you didn't lose blood, and didn't gain either death or astral, there is a 1% chance you gain 1 blood level | * If you are B3 or lower and you didn't lose blood, and didn't gain either death or astral, there is a 1% chance you gain 1 blood level | ||
* If losing candles, you do NOT roll to gain paths unless the above loop of 1000 attempts failed to find a path to remove from you and had to resort to taking a candle instead. | * If losing candles, you do NOT roll to gain paths unless the above loop of 1000 attempts failed to find a path to remove from you and had to resort to taking a candle instead. | ||
+ | |||
* Passive unrest reduction due to dom/ | * Passive unrest reduction due to dom/ | ||
* First, PD does its thing: Reduces unrest by %%((pd / 10) - 15), the amount shown on the PD UI ingame%% | * First, PD does its thing: Reduces unrest by %%((pd / 10) - 15), the amount shown on the PD UI ingame%% | ||
Line 888: | Line 1020: | ||
* Subtract from the unrest total: (remaining unrest/ | * Subtract from the unrest total: (remaining unrest/ | ||
* Patrolling happens next. | * Patrolling happens next. | ||
+ | |||
* The mod command domunrest (both Phlegras have this at 5) adds (closed d10 - 1 + candles * value)/10 rounded down unrest per turn. | * The mod command domunrest (both Phlegras have this at 5) adds (closed d10 - 1 + candles * value)/10 rounded down unrest per turn. | ||
+ | |||
* Spec 70368744177664 (no effect on flyers/ | * Spec 70368744177664 (no effect on flyers/ | ||
* Units that are innately flying all the time | * Units that are innately flying all the time | ||
Line 894: | Line 1028: | ||
* Units with the flight buff | * Units with the flight buff | ||
* It does NOT care about flying by other means such as fly-when-blessed (eagle warriors) | * It does NOT care about flying by other means such as fly-when-blessed (eagle warriors) | ||
+ | |||
* Casters and deciding how many gems to use | * Casters and deciding how many gems to use | ||
* The conservative gem usage setting is ignored and assumed to be off for the attacking side, in assassinations, | * The conservative gem usage setting is ignored and assumed to be off for the attacking side, in assassinations, | ||
Line 920: | Line 1055: | ||
* Upon adding an extra gem, recalculate the fatigue after casting (each extra gem increases the fatigue divisor by 1) | * Upon adding an extra gem, recalculate the fatigue after casting (each extra gem increases the fatigue divisor by 1) | ||
* Keep adding gems until one of the above three conditions are not met. If the number of total gems spent exceeds the caster' | * Keep adding gems until one of the above three conditions are not met. If the number of total gems spent exceeds the caster' | ||
+ | |||
* Pillage | * Pillage | ||
* A unit's pillage strength is: | * A unit's pillage strength is: | ||
Line 937: | Line 1073: | ||
* The unrest generated is 4d(this size) | * The unrest generated is 4d(this size) | ||
* The gold generated is %%(final pillage strength - closed d(final pillage strength/2, rounded down))%% | * The gold generated is %%(final pillage strength - closed d(final pillage strength/2, rounded down))%% | ||
+ | |||
* FIXME Does the pillage bonus trait just not do what the game says it does? I can't find anywhere where it's checked here | * FIXME Does the pillage bonus trait just not do what the game says it does? I can't find anywhere where it's checked here | ||
+ | * Unit id allocation: | ||
+ | * If the highest unit ID is less than 25000, simply increase highest unit ID by 1 and assign the next new unit the old highest value | ||
+ | * Otherwise, go through all existing IDs in order until you find one for a unit that is dead and removable, then take that old unit's ID | ||
+ | |||
+ | * Pretenders at game creation are given consecutive unit IDs. These go in ascending order of nation IDs in the game. They are not the first things to be created though, so for the purposes of innate spellcasting offsets, a clean multiple of 188 might happen to fall in the middle of this process. It still very very heavily biases two innate pretenders' | ||
+ | |||
+ | Undocumented hotkeys | ||
+ | |||
+ | * Many many not-really useful things, like " | ||
+ | * $ with -d or higher on the strategic map desplays your " | ||
+ | * C on the " | ||
+ | * F9 on strategic map displays thrones | ||
+ | * T on player setup tries to force teams of 4, with nations assigned by internal ID | ||
+ | * d on send messages retracts all messages | ||
+ | * i on the army setup screen will invert the selection of units in the selected squad | ||
+ | * ctrl-p on army setup writes something to the blind log | ||
+ | * r, s, m, l on the map selection screen for a new game do something. I'm not certain what, might be selecting random map sizes | ||
+ | |||
+ | Armor defeating (" | ||
+ | |||
+ | * Looks a bit different to the dom4 stuff. | ||
+ | * Applies only if: | ||
+ | * Trying to do more than -900 damage (this likely has some internal significance) | ||
+ | * The attack is not AN | ||
+ | * One of the following: | ||
+ | * Final prot DRN is 0-2 inclusive | ||
+ | * Final prot DRN is 0-3 inclusive AND the victim' | ||
+ | * Final prot DRN is 0-4 inclusive AND the victim is immobilised, | ||
+ | * The result is the victim' | ||
+ | |||
+ | Graphs. I am not too confident on these... | ||
+ | |||
+ | * Army size graph looks to plot (total size of all units you own)/4 to a max of 65000. This counts base unit type size, so enlarge/ | ||
+ | * Dominion graph looks to plot (total of all candles, +10 for each province that has your candles)/2 to a max of 65000. | ||
+ | |||
+ | Melee weapons and items: | ||
+ | * the first weapon is skipped if you have 2+ shields from items and the weapon is nonintrinsic | ||
+ | * the second weapon is skipped if you have any shields from items and the weapon is nonintrinsic | ||
+ | * the third weapon is skipped if you have 3+ shields from items and the weapon is nonintrinsic | ||
+ | * the fourth weapon is skipped if you have 4+ shields from items the weapon is nonintrinsic | ||
+ | * This looks backwards, but if you swapped 1st and 2nd consider that any human with a sword and shield would lose their shield if given a magic shield, it's weird but is what it is | ||
+ | * Weapon attribute 657 seems to be "needs accessible horns to use" and weapons with this are removed if a crown is equipped | ||
+ | |||
+ | It looks like moving off the field simulates 100 rounds of affliction and regen processing, this specifically includes poison, decay, That Mystery Affliction that Does More To Undead, uwdamage, landdamage, burning, bleeding, freezing, desiccation, | ||
+ | |||
+ | Assassinations: | ||
+ | * This function processes all commanders in ascending commander ID order. | ||
+ | * Infiltration for graphs: is just 50% to succeed | ||
+ | * Cause unrest: creates openended d20 unrest | ||
+ | * Seduction: two map commander orders (72, seduction; 58: corruptor) do this. | ||
+ | * Get a commander to target. This looks properly randomised (builds a list on the stack and then picks one randomly). This respects Scale Walls. Sneaking commanders are not valid targets, as many players probably know from experience. | ||
+ | * If dream seduction, penbase = 13 + (pen bonus from items, bless etc), moralebase = <value of dream seduction> | ||
+ | * If nondream seduction (overwrites dream if you give a unit both), penbase = 99, moralebase = <value of seduction ability> | ||
+ | * If the unit is female (including via cat charm): | ||
+ | * Add the amount of the gender changing effect to the morale base | ||
+ | * If action is corrupt: penbase=99, moralebase=< | ||
+ | * Make 1000 attempts to pick an adjacent province you can retreat to. I could look into this in more detail if required. | ||
+ | * If no province found, you get "With nowhere to run with the victim afterwards, %s aborted the seduction attempt." | ||
+ | * The MR check is always rolled, even for corruption and non-dream seduction (though with a base pen of 99 they probably can't really ever fail). Specifically, | ||
+ | * If you have nowhere to walk to, but can fly and your size is less than your target' | ||
+ | * If the seducer and victim are the same gender, you head towards a fail state that presumably corruption will undo later (result=-1, result2=1) | ||
+ | * If the victim is something that can't be converted (ie is a god or prophet), result1=-1, result2=0 | ||
+ | * If the victim is immobile result=-3, result2=0 | ||
+ | * Otherwise you pass (result=1, result2=0) | ||
+ | * Roll the morale check: if moralebase + DRN > victim' | ||
+ | * Otherwise, result1 becomes -1 if any of the following are true: this is corruption (not seduction), or the seducer' | ||
+ | * If result1 == 1: The seduction succeeded: "%s disappeared one night and was never seen again." | ||
+ | * If result1 == 0: The (dream) seduction failed. "%s tried to project %s wonderful dreams at %s, but the target resisted and no real seduction could be done." The victim' | ||
+ | * If result1 == -2: "%s tried to seduce %s, but %s could not shy away from %s duties. However %s did not want %s to get caught and did not give %s away." | ||
+ | * If result1 == -3: You failed due to " | ||
+ | * If result1 is anything else, and result2==0, and the victim has less than 20 morale: "%s failed to %s %s and a battle ensued." | ||
+ | * Any other case: "%s failed to %s %s and a battle ensued. In fact %s wasn't even remotely interested in the offer." | ||
+ | * Order 61 (I think this is " | ||
+ | * Pick a commander to assassinate. | ||
+ | * This also requires mixed genders. | ||
+ | * MR: attempt fails if 16 + DRN < victim MR + DRN | ||
+ | * Morale: attempt fails if <lure ability value> + DRN < victim morale + DRN | ||
+ | * Also fails if victim is prophet or god | ||
+ | * If you succeeded this far: | ||
+ | * If this attempt is using Jorogumo' | ||
+ | * If victim' | ||
+ | * If the victim does not die when taken underwater, you end up fighting later. | ||
+ | * All fights take place underwater (add terrain mask 4) but seemingly without setting the assassination flag and the 50% chance of darkness. **This looks like it includes the Jorogumo fight if you pass the strength check, which is probably a bug** | ||
+ | * Much like seduction, there' | ||
+ | * MR/Morale checks passed: | ||
+ | * Jorogumo type: | ||
+ | * "%s encountered an alluring woman that tried to seduce %s. But %s did not leave %s post." - Victim gets this | ||
+ | * "%s failed to lure %s into her trap." - user gets this if victim has <20 morale | ||
+ | * "%s failed to lure an enemy called %s into her trap. In fact %s wasn't attracted at all to this most beautiful song." - victim has 20+ morale | ||
+ | * Normal type: | ||
+ | * "%s managed to resist a magically alluring song that was heard from the water." | ||
+ | * "%s failed to lure %s into the sea." | ||
+ | * Complete Success: | ||
+ | * Jorogumo type: | ||
+ | * "%s successfully lured %s into the her webs and dragged him into the water where he drowned." | ||
+ | * The victim can get two messages, with a coin flip between them: "%s disappeared one night and was never seen again. This night some people say they saw a glimpse of an extraordinarily beautiful woman." | ||
+ | * Normal lure: | ||
+ | * "%s successfully lured %s into the sea where he drowned." | ||
+ | * Victim can have two messages: | ||
+ | * 75%: "%s disappeared one night and was never seen again. This night some people heard the most beautiful song." | ||
+ | * 25%: "%s disappeared one night and was never seen again." | ||
+ | * Other failures: | ||
+ | * Jorogumo type: | ||
+ | * "%s disappeared one night when he followed an enticing young woman. He suddenly found himself trapped in spider webs, but no web is strong enough to hold %s for long. After breaking free he attacked the woman that lured him into this trap." - Victim, passed strength check | ||
+ | * "%s successfully lured an enemy commander called %s into her web. Unfortunately he broke free from the web and a battle ensued." | ||
+ | * "%s successfully lured an enemy commander called %s into her web. All seemed well as she dragged the helpless victim into the nearby pool of water. Unfortunately the victim later emerged unharmed from the water and attacked her." - User, victim does not die underwater | ||
+ | * "%s disappeared one night when he followed an enticing young woman. He suddenly found himself trapped in spider webs and dragged into a pool of water. Unable to drown, %s could free himself as the web started to dissolve. After breaking free he emerged from the water and attacked the woman that lured him into this trap." - Victim, if does not die underwater | ||
+ | * Regular lure: | ||
+ | * "%s successfully lured an enemy commander called %s into the sea. Unfortunately he didn't drown and a battle ensued." | ||
+ | * "%s disappeared one night and entered the sea. This night some people heard the most beautiful song. %s was disappointed to find a fish being instead of the beautiful female he had envisioned. He attacked her in rage and disappointment." | ||
+ | * Regular assassination: | ||
+ | * Seduction/ | ||
+ | * Looks like Jorogumo' | ||
+ | |||
+ | * A side's " | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * This is really confusing, but it's maybe the basis of the one commander and their retinue line? | ||
+ | * 1x 10hp guy, 100hp of retinue | ||
+ | * real=110 | ||
+ | * tempflag1 = 100 | ||
+ | * permanent = 10 | ||
+ | * The conditionis true, so tempflag1=10 | ||
+ | * actual total = 20 | ||
+ | * pd (temp flag=3) contribute hp/4 rounded up | ||
+ | * slaves contribute hp/2 rounded up | ||
+ | |||
+ | Blastsquare (and the apostasy bug) | ||
+ | * A = size points in square + open 2d6 | ||
+ | * A gets 999 added if battle enchant/ | ||
+ | * If spell doesn' | ||
+ | * %%B = (2 - victim fatigue/20 rounded down) + open 2d6%% | ||
+ | * Get your shield defence/ | ||
+ | * If spec has either "flail spec" 4 or AN 128, shield defence/ | ||
+ | * Calc effective shield prot: fetch the value, if spec has AP, halve it, if spell is AN or ignores shields then this is zero. | ||
+ | * If spec has neither flail spec 4 or AN 128, and the victim is standing on a fort wall | ||
+ | * If shield defence/ | ||
+ | * If shield prot was less than 30, set it to 30. Then, if the effect was AP, half it. (this seemingly introduces an order of operations bug - if you have a prot 36 shield vs AP, you'll use the wall bonus instead despite it being worse) | ||
+ | * If you have air shield, there' | ||
+ | * If A < B, the victim avoids all damage. | ||
+ | * If A < (B + the shield' | ||
FIXME look at what sets the assassination flag, very likely there is a bug in the spells that don't use it (which will cause casting AI to not have the reduced buff preference) | FIXME look at what sets the assassination flag, very likely there is a bug in the spells that don't use it (which will cause casting AI to not have the reduced buff preference) |