TriggerPainChance

From ZDoom Wiki
Jump to navigation Jump to search

Bool TriggerPainChance (Name MOD, Bool ForcedPain = False)

Usage

Makes the caller have pain inflicted on them, without actually harming them.

Parameters

  • MOD: The name of the damage type to hurt the caller with. To make them enter any specific pain states such as Pain.Fire.
  • ForcedPain: False by default, when true, the caller will always be hurt when the function is called. Regardless of their pain chance. This still doesn't make actors with NOPAIN flinch.

Examples

This Archvile forcibly hurts their target with the Fire damage type the moment it begins tracking them with its' flames.

Class PainfulArchvile : Archvile Replaces Archvile
{
	States
	{
		Missile:
			VILE G 0 BRIGHT A_VileStart();
			VILE G 10 BRIGHT A_FaceTarget();
			VILE H 8 BRIGHT
			{
				A_VileTarget();
				If (Target)
 					Target.TriggerPainChance' ('Fire',True);
			}
			VILE IJKLMN 8 BRIGHT
 			{
				A_FaceTarget();
				If (Target)
					Target.TriggerPainChance ('Fire',True);
			}
			VILE O 8 BRIGHT A_VileAttack();
 			VILE P 20 BRIGHT;
			Goto See;
	}
}