public override void Update(CharacterHealth characterHealth, Limb targetLimb, float deltaTime) { base.Update(characterHealth, targetLimb, deltaTime); character = characterHealth.Character; if (character == null) { return; } if (!subscribedToDeathEvent) { character.OnDeath += CharacterDead; subscribedToDeathEvent = true; } if (Strength < DormantThreshold) { DeactivateHusk(); if (Strength > Math.Min(1.0f, DormantThreshold)) { State = InfectionState.Dormant; } } else if (Strength < ActiveThreshold) { DeactivateHusk(); if (Prefab is AfflictionPrefabHusk { CauseSpeechImpediment : true })
public CoreBase(string name, GameFolder parent, InfectionState infectionState, ScanResult result) { Name = name; ContainingFolder = parent; InfectionState = infectionState; Result = result; }
public void Infect() { if (infectionState == InfectionState.Healthy) { infectionState = InfectionState.InitialInfection; numInfected++; } }
private void BecomeInfectedWith(int infectionType) { // Debug.Log ("Infected with cat " + infectionType); AudioSource.PlayClipAtPoint(miaows [Random.Range(0, miaows.Length)], Vector3.zero); meshRenderer.material = zoneMats[infectionType]; infectionState = (InfectionState)infectionType; infectionTimer = infectionTimerReset; }
public static bool HasInfectionState(Pawn pawn, InfectionState minState, InfectionState maxState) { return(pawn.health.hediffSet .GetHediffs <Hediff_Injury_ZombieBite>() .SelectMany(hediff => hediff.comps) .OfType <HediffComp_Zombie_TendDuration>() .Any(tendDuration => tendDuration.InfectionStateBetween(minState, maxState))); }
private void UpdateDormantState(float deltaTime, Character character) { if (state != InfectionState.Dormant) { DeactivateHusk(character); } state = InfectionState.Dormant; }
private void UpdateTransitionState(float deltaTime, Character character) { if (state != InfectionState.Transition) { DeactivateHusk(character); } state = InfectionState.Transition; }
public void MakeInfected() { infectionState = InfectionState.Infected; spriteRenderer.sprite = infectedPersonSprite; infectedTime = Time.timeSinceLevelLoad; // Let's not infect immediately lastInfection = Time.timeSinceLevelLoad + infectionCooldown; }
private void UpdateTransitionState(float deltaTime, Character character) { if (state != InfectionState.Transition) { DeactivateHusk(character); } IncubationTimer += deltaTime / IncubationDuration; state = InfectionState.Transition; }
private void UpdateActiveState(float deltaTime, Character character) { if (state != InfectionState.Active) { ActivateHusk(character); state = InfectionState.Active; } character.AddDamage(CauseOfDeath.Husk, 0.5f * deltaTime, null); }
private void UpdateTransitionState(float deltaTime, Character character) { IncubationTimer += deltaTime / IncubationDuration; if (state == InfectionState.Dormant && Character.Controlled == character) { new GUIMessageBox("", InfoTextManager.GetInfoText("HuskCantSpeak")); } state = InfectionState.Transition; }
private void UpdateActiveState(float deltaTime, Character character) { if (state != InfectionState.Active) { ActivateHusk(character); state = InfectionState.Active; } character.AddDamage(CauseOfDeath.Husk, GameMain.NilMod.PlayerHuskIncurableDrain * deltaTime, null, "Husk Infection"); //character.AddDamage(CauseOfDeath.Husk, 0.5f * deltaTime, null); }
private void Infect(Infectable target, InfectionState state, bool addToMap) { if (logInfections) { DebugHelper.Log(Color.red, "Infected {0}".Format(target.name)); } target.infectionState = state; if (addToMap) { AddInfectionMap(target.transform.position); } }
private void UpdateDormantState(float deltaTime, Character character) { if (state != InfectionState.Dormant) { DeactivateHusk(character); } float prevTimer = IncubationTimer; state = InfectionState.Dormant; IncubationTimer += deltaTime / IncubationDuration; }
private void CleanUp() { infectionTimer -= Time.deltaTime; if (infectionTimer <= 0) { // Debug.Log ("Is clean!"); meshRenderer.material = zoneMats[0]; infectionState = InfectionState.Clean; infectionTimer = infectionTimerReset; } }
public void IterateState() { int newState = (int)State; newState++; if (newState > 3) { newState -= 4; } State = (InfectionState)newState; }
public void Quarantine(float time, GameManager gManager) { manager = gManager; if (CoreElement.InfectionState != InfectionState.Quarantined) { prevState = CoreElement.InfectionState; } CoreElement.InfectionState = InfectionState.Quarantined; quarantineTime = time; elapsedQTime = 0f; GetComponent <TextMeshProUGUI>().color = Color.cyan; }
private void UpdateDormantState(float deltaTime, Character character) { float prevTimer = IncubationTimer; state = InfectionState.Dormant; IncubationTimer += deltaTime / IncubationDuration; if (Character.Controlled != character) { return; } }
private void UpdateTransitionState(float deltaTime, Character character) { if (state != InfectionState.Transition) { DeactivateHusk(character); } IncubationTimer += deltaTime / IncubationDuration; character.AddDamage(CauseOfDeath.Husk, GameMain.NilMod.PlayerHuskInfectedDrain * deltaTime, null, "Husk Infection"); state = InfectionState.Transition; }
public static bool HasInfectionState(Pawn pawn, InfectionState state) { if (pawn.RaceProps.Humanlike == false) { return(false); } return(pawn.health.hediffSet .GetHediffs <Hediff_Injury_ZombieBite>() .SelectMany(hediff => hediff.comps) .OfType <HediffComp_Zombie_TendDuration>() .Any(tendDuration => tendDuration.GetInfectionState() == state)); }
private void BecomeInfectedWith(int infectionType) { // Debug.Log ("Is cat " + infectionType); if (bodyMats.Length > 0) { meshRenderer.material = bodyMats[infectionType]; } else { Debug.LogWarning("No materials in the bodyMats array!"); } infectionState = (InfectionState)infectionType; }
IEnumerator ProcessInfectionState() { float incubatingTime = Random.Range(kIncubatingTimeRange.x, kIncubatingTimeRange.y); float asymptomaticTime = Random.Range(kAsymptomaticTimeRange.x, kAsymptomaticTimeRange.y); bool willShowSymptoms = Random.value < kChanceWillShowSymptoms; float symptomaticTime = Random.Range(kSyptomaticTimeRange.x, kSyptomaticTimeRange.y); bool willGoCritical = Random.value < kChanceWillGoCritical; float criticalTime = Random.Range(kCriticaltimeRange.x, kCriticaltimeRange.y); bool willDie = Random.value < kChanceWillDie; bool willDieWithoutSupport = Random.value < kChanceWillDieWithoutSupport; infectionState = InfectionState.Incubating; yield return(new WaitForSeconds(incubatingTime)); infectionState = InfectionState.Asymptomatic; yield return(new WaitForSeconds(asymptomaticTime)); if (willShowSymptoms) { infectionState = InfectionState.Symptomatic; spriteRenderer.sprite = kSickSprite; infectedAudioSource.Play(); yield return(new WaitForSeconds(symptomaticTime)); if (willGoCritical) { numCritical++; infectionState = InfectionState.Critical; spriteRenderer.sprite = kCriticalSprite; criticalAudioSource.Play(); rb.velocity = new Vector2(0, 0); yield return(new WaitForSeconds(criticalTime)); numCritical--; if (numCritical < kNumCriticalSupported ? willDie : willDieWithoutSupport) { deathAudioSource.Play(); yield return(new WaitForSeconds(0.3f)); numDeaths++; numHumans--; Destroy(gameObject); } } } numInfected--; infectionState = InfectionState.Recovered; spriteRenderer.sprite = kRecoveredSprite; }
public Material GetStatusMaterial(Infectable iv, InfectionState lastState) { switch (iv.infectionForm) { case InfectionForm.AGENT: return(agentInfectionMaterials[(int)lastState]); case InfectionForm.WAYPOINT: return(wayInfectionMaterials[(int)lastState]); default: return(wayInfectionMaterials[(int)lastState]); } }
private void UpdateActiveState(float deltaTime, Character character) { if (state != InfectionState.Active) { if (Character.Controlled == character) { new GUIMessageBox("", InfoTextManager.GetInfoText("HuskActivate")); } ActivateHusk(character); state = InfectionState.Active; } character.AddDamage(CauseOfDeath.Husk, 0.5f * deltaTime, null); }
private void CleanUpHuman() { infectionState = InfectionState.Clean; infectionTimerCatP1Red = infectionTimerCatP1RedConst; infectionTimerCatP2Blu = infectionTimerCatP2BluConst; infectionTimerCatP3Grn = infectionTimerCatP3GrnConst; if (cleanMats.Length > 0) { int randomMat = Random.Range(0, cleanMats.Length); meshRenderer.material = cleanMats [randomMat]; } else { Debug.LogWarning("No materials in the cleanMats array!"); } }
private void UpdateDormantState(float deltaTime, Character character) { float prevTimer = IncubationTimer; state = InfectionState.Dormant; IncubationTimer += deltaTime / IncubationDuration; if (Character.Controlled != character) { return; } if (prevTimer % 0.1f > 0.05f && IncubationTimer % 0.1f < 0.05f) { GUI.AddMessage(InfoTextManager.GetInfoText("HuskDormant"), Color.Red, 4.0f); } }
private void UpdateActiveState(float deltaTime, Character character) { if (state != InfectionState.Active) { ActivateHusk(character); state = InfectionState.Active; } foreach (Limb limb in character.AnimController.Limbs) { character.LastDamageSource = null; character.DamageLimb( limb.WorldPosition, limb, new List <Affliction>() { AfflictionPrefab.InternalDamage.Instantiate(0.5f * deltaTime / character.AnimController.Limbs.Length) }, 0.0f, false, 0.0f); } }
public override void Update(CharacterHealth characterHealth, Limb targetLimb, float deltaTime) { base.Update(characterHealth, targetLimb, deltaTime); character = characterHealth.Character; if (character == null) { return; } if (!subscribedToDeathEvent) { character.OnDeath += CharacterDead; subscribedToDeathEvent = true; } if (Strength < DormantThreshold) { DeactivateHusk(); State = InfectionState.Dormant; } else if (Strength < ActiveThreshold) { DeactivateHusk(); character.SpeechImpediment = 100; State = InfectionState.Transition; } else if (Strength < Prefab.MaxStrength) { if (State != InfectionState.Active) { character.SetStun(Rand.Range(2, 4)); } State = InfectionState.Active; ActivateHusk(); } else { State = InfectionState.Final; ActivateHusk(); ApplyDamage(deltaTime, applyForce: true); character.SetStun(1); } }
private void UpdateTransitionState(float deltaTime, Character character) { IncubationTimer += deltaTime / IncubationDuration; state = InfectionState.Transition; }
public void MakeRemoved() { infectionState = InfectionState.Removed; spriteRenderer.sprite = removedPersonSprite; }