Applies pain dissipation over time (requirement: -5 pain/second).
Pain naturally dissipates when not taking damage at a constant rate of -5 pain per second.
Current player state
Time elapsed in milliseconds
Updated player state with reduced pain
Applies pain effects to player state, including shock pain.
Modifies player stats based on current pain level. When shock pain is active, additional penalties are applied temporarily.
Current player state
OptionalshockEffect: ShockPainEffectOptional active shock pain effect
Modified player state with pain effects
Applies pain from combat damage with shock pain effects.
Calculates pain increase based on damage amount, vital point severity, and vital point category. Also determines if shock pain effect should be triggered.
Shock Pain: Instant 10-30% reduction for 2-3 seconds on significant hits (>=10 damage) Cumulative Trauma: Progressive pain accumulation that reduces performance Pain Overload: At >80 pain, chance of stun/unconsciousness
Current player state
Base damage amount
Optionalseverity: VitalPointSeverityOptional vital point severity
Optionalcategory: VitalPointCategoryOptional vital point category for more accurate pain calculation
Updated player state with increased pain and optional shock effect
// Normal hit
const result = system.applyPain(player, 10);
// Vital point neurological hit with shock pain
const result = system.applyPain(
player,
20,
VitalPointSeverity.MAJOR,
VitalPointCategory.NEUROLOGICAL
);
if (result.shockEffect) {
console.log(`Shock pain active for ${result.shockEffect.duration}ms`);
}
Gets effects for a specific pain level.
Pain level
Effects applied at that level
Gets description of pain level effects.
Pain level
Bilingual description
Gets bilingual name for pain level.
Pain level
Korean and English level names
Determines pain level from pain value.
Pain value (0-100)
Current pain level
Checks if player is incapacitated by pain.
Current player state
True if pain is at overload level
Checks if player is in pain overload state (>80 pain).
Current player state
True if pain is above overload threshold
Checks if pain overload should trigger stun.
At pain >80, there's a chance per hit to trigger stun based on pain level. Pain Overload level has 30% chance to trigger stun.
Current player state
True if player should be stunned from pain
Private ReadonlyBASE_Base pain dissipation rate per second (requirement: -5 pain/second).
Private ReadonlycategoryPain multipliers by vital point category.
Private ReadonlyDAMAGE_Private ReadonlyINTENSITY_Private ReadonlyMAX_Shock pain intensity constants.
Private ReadonlyMIN_Private ReadonlyPAIN_Pain overload threshold for stun chance (requirement: >80).
Private ReadonlyPAIN_Pain to damage ratio for cumulative trauma calculation.
Private ReadonlypainPain level effects and thresholds matching requirements.
Private ReadonlyseverityPain multipliers by vital point severity.
Private ReadonlySHOCK_Shock pain duration range in milliseconds (requirement: 2-3 seconds).
Private ReadonlySHOCK_Minimum damage to trigger shock pain.
Pain Response System managing cumulative pain effects.
Pain accumulates from all damage sources and reduces combat effectiveness progressively. High pain can incapacitate even if health remains adequate. Pain dissipates slowly over time.
Example
Korean
고통반응시스템