1 using Microsoft.Xna.Framework;
12 private float invertControlsCooldown = 60.0f;
13 private float stunCoolDown = 60.0f;
14 private float invertControlsTimer;
16 private float invertControlsToggleTimer;
24 base.Update(characterHealth, targetLimb, deltaTime);
28 invertControlsCooldown -= deltaTime;
29 if (invertControlsCooldown <= 0.0f)
33 invertControlsCooldown = (180.0f -
Strength) * Rand.Range(0.7f, 1.3f);
34 invertControlsTimer = MathHelper.Lerp(10.0f, 60.0f,
Strength / 100.0f) * Rand.Range(0.7f, 1.3f);
36 else if (invertControlsTimer > 0.0f)
39 invertControlsToggleTimer -= deltaTime;
40 if (invertControlsToggleTimer <= 0.0f)
42 invertControlsToggleTimer = 5.0f;
43 if (Rand.Range(0.0f, 1.0f) < 0.5f)
49 var invertControlsAffliction =
AfflictionPrefab.
List.FirstOrDefault(ap => ap.Identifier ==
"invertcontrols");
54 invertControlsTimer -= deltaTime;
60 stunCoolDown -= deltaTime;
61 if (stunCoolDown <= 0.0f)
65 stunCoolDown = (180.0f -
Strength) * Rand.Range(0.7f, 1.3f);
66 float stunDuration = MathHelper.Lerp(3.0f, 10.0f,
Strength / 100.0f) * Rand.Range(0.7f, 1.3f);
Affliction(AfflictionPrefab prefab, float strength)
AfflictionPrefab is a prefab that defines a type of affliction that can be applied to a character....
static IEnumerable< AfflictionPrefab > List
A special affliction type that periodically inverts the character's controls and stuns the character....
AfflictionSpaceHerpes(AfflictionPrefab prefab, float strength)
override void Update(CharacterHealth characterHealth, Limb targetLimb, float deltaTime)
void ApplyAffliction(Limb targetLimb, Affliction affliction, bool allowStacking=true, bool ignoreUnkillability=false, bool recalculateVitality=true)
readonly Character Character
void ReduceAfflictionOnAllLimbs(Identifier afflictionIdOrType, float amount, ActionType? treatmentAction=null, Character attacker=null)
void SetStun(float newStun, bool allowStunDecrease=false, bool isNetworkMessage=false)
static NetworkMember NetworkMember