/// <summary> /// Fails the mission if the VIP dies /// </summary> /// <param name="npc">Npc.</param> public override void DestroyNpc(Npc npc) { TargetNpc target = npc as TargetNpc; if (target != null) { if (target.isPrimaryObjective) { Failed(); } } }
/// <summary> /// Game is failed when the primary target enters the zone /// </summary> /// <param name="zoneObject">Zone object.</param> public override void EntersZone(GameObject zoneObject, TargetZone zone) { TargetNpc target = zoneObject.GetComponent <TargetNpc>(); if (target == null) { return; } if (target.isPrimaryObjective) { Failed(); } }
/// <summary> /// Awards the achievement if the main target dies, but escort target does not. /// </summary> /// <param name="npc">Npc.</param> public override void DestroyNpc(Npc npc) { TargetNpc target = npc as TargetNpc; if (target != null) { if (!target.isPrimaryObjective) { m_FailedObjective = true; } if (target.isPrimaryObjective && !m_FailedObjective) { Achieved(); } } }
public bool IsValidTarget() { return(TargetNpc != null && TargetNpc.IsValid()); }