18,700
edits
m (more copy-editing) |
(clarified <HurtSoundConstants>) |
||
Line 122: | Line 122: | ||
| <JumpDistanceSquares> | | <JumpDistanceSquares> | ||
| int8 | | int8 | ||
| Always 6 | | Always 6; unused | ||
|} | |} | ||
Line 209: | Line 209: | ||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
!width=150px| XML tag | !width=150px| XML tag | ||
!width=120px| | !width=120px| Content type | ||
! | ! Description | ||
|- | |- | ||
| <BasePercentage> | | <BasePercentage> | ||
| int16 | | int16 | ||
| | | Always 35; minimum chance of playing a pain sound (but the actual calculation is much more complicated; see below) | ||
|- | |- | ||
| <MaxPercentage> | | <MaxPercentage> | ||
| int16 | | int16 | ||
| | | Always 90; maximum chance of playing a pain sound | ||
|- | |- | ||
| <PercentageThreshold> | | <PercentageThreshold> | ||
| int16 | | int16 | ||
| | | Always 15; at least this much damage must be done to play a pain sound | ||
|- | |- | ||
| <Timer> | | <Timer> | ||
| int16 | | int16 | ||
| | | Always 120; time in ticks before the damage tracker used for this AI's pain sounds resets | ||
|- | |- | ||
| <MinTimer> | | <MinTimer> | ||
| int16 | | int16 | ||
| | | Always 35; time in ticks that must pass between pain sounds being played, no matter any other considerations | ||
|- | |- | ||
| <MaxLight> | | <MaxLight> | ||
| int16 | | int16 | ||
| | | Always 1; number of times that AI will play light pain sound before "upgrading" to a medium pain sound upon subsequent damage | ||
|- | |- | ||
| <MaxMedium> | | <MaxMedium> | ||
| int16 | | int16 | ||
| | | Always 2; number of times that AI will play medium pain sound before "upgrading" to a heavy pain sound upon subsequent damage | ||
|- | |- | ||
| <DeathChance> | | <DeathChance> | ||
| int16 | | int16 | ||
| | | Always 100; compared against a random number to determine whether to play a death sound | ||
|- | |- | ||
| <VolumeTreshold> | | <VolumeTreshold> | ||
| int16 | | int16 | ||
| | | Always 10; at least this much damage must be done for the AI to play the pain sound at maximum volume | ||
|- | |- | ||
| <MediumTreshold> | | <MediumTreshold> | ||
| int16 | | int16 | ||
| | | Always 12; after this much cumulative damage, a light pain sound gets upgraded to a medium pain sound | ||
|- | |- | ||
| <HeavyTreshold> | | <HeavyTreshold> | ||
| int16 | | int16 | ||
| | | Always 22; after this much cumulative damage, a medium pain sound gets upgraded to a heavy pain sound | ||
|- | |- | ||
| <MinVolume> | | <MinVolume> | ||
| float | | float | ||
| | | Minimal sound volume, e.g. 0.5, used when determining the volume of the pain sound to be played (before <VolumeTreshold> damage is reached and the volume becomes 100%) | ||
|- | |- | ||
| <LightSound> | | <LightSound> | ||
Line 277: | Line 277: | ||
|} | |} | ||
If the AI is in an alerted state, has not been hurt within the last <Timer> ticks, and the damage being done is at least <PercentageThreshold>, the chance of playing a pain sound is <BasePercentage> + (damage done * (<MaxPercentage> - <BasePercentage>)) / <PercentageThreshold>. This calculated chance is then compared against a random value before Oni finally decides whether to play it. If the AI is alerted and has already received damage within the last <Timer> ticks, they will not play a hurt sound. If the AI is ''not'' in an alerted state, they will always play a hurt sound. | |||
==<AIConstants>== | ==<AIConstants>== |