// Updater public void SetZombieStat(Zombie_Identity zIdentity) { zIdentity.getHealthComponent().setMaxHealth(maxHealth.getValue()); zIdentity.getHealthComponent().setHealth(maxHealth.getValue()); zIdentity.getMovementComponent().setMovementSpeed(mobileSpeed.getValue()); zIdentity.setInfectiousness(infectiousness.getValue()); zIdentity.getEquipmentComponent().setDamageMultiplierPercent(damageMultiplierPercent.getValue()); }
/// <summary> /// Spread infectedness on human. Deals a portion of the specified damage. /// Deals no damage nor infection to armored unit. /// </summary> /// <param name="infectiousness"> Poison of bite (Increase tendancy to turn) </param> public void addInfection(float infectiousness, Zombie_Identity activator) { // Infect if (health.getArmor() <= 0.0f) { infectedness += infectiousness; } UnityAction infectedRelayCall = new UnityAction(activator.Func_OnInfectedSomeOne); OnInfectOnce.RemoveListener(infectedRelayCall); OnInfectOnce.AddListener(infectedRelayCall); }
public void inflict(AttackInfo attackInfo) { Abstract_Identity activator = attackInfo.activator; // Victim must be human Human_Identity victim = attackInfo.victim.GetComponent <Human_Identity>(); if (victim != null) { Infection victimInfectionComponent = victim.getInfectionComponent(); Assert.IsNotNull(victimInfectionComponent); Zombie_Identity activatorZomb = (Zombie_Identity)activator; Assert.IsNotNull(activatorZomb); // Infect float infectiousness = activatorZomb.GetInfectiousness(); victimInfectionComponent.addInfection(infectiousness, activatorZomb); } }