public override void OnlyLoadoutWeapons(HTNPlayer target) { if (target == null || target.IsDestroyed || target.IsDead() || target.IsWounded() || target.inventory == null || target.inventory.containerBelt == null || target.inventory.containerMain == null || target.inventory.containerWear == null) { return; } if (this.loadouts == null || this.loadouts.Length == 0) { UnityEngine.Debug.LogWarning(string.Concat("Loadout for NPC ", base.name, " was empty.")); } else { PlayerInventoryProperties playerInventoryProperty = this.loadouts[UnityEngine.Random.Range(0, (int)this.loadouts.Length)]; if (playerInventoryProperty != null) { foreach (ItemAmount itemAmount in playerInventoryProperty.belt) { if (itemAmount.itemDef.category != ItemCategory.Weapon) { continue; } target.inventory.GiveItem(ItemManager.Create(itemAmount.itemDef, (int)itemAmount.amount, (ulong)0), target.inventory.containerBelt); } target.StartCoroutine(this.EquipWeapon(target)); return; } } }
public override void StartVoices(HTNPlayer target) { if (this._isRadioEffectRunning) { return; } this._isRadioEffectRunning = true; target.StartCoroutine(this.RadioChatter(target)); }
public override void Loadout(HTNPlayer target) { if (target == null || target.IsDestroyed || target.IsDead() || target.IsWounded() || target.inventory == null || target.inventory.containerBelt == null || target.inventory.containerMain == null || target.inventory.containerWear == null) { return; } if (this.loadouts == null || this.loadouts.Length == 0) { UnityEngine.Debug.LogWarning(string.Concat("Loadout for NPC ", base.name, " was empty.")); } else { PlayerInventoryProperties playerInventoryProperty = this.loadouts[UnityEngine.Random.Range(0, (int)this.loadouts.Length)]; if (playerInventoryProperty != null) { playerInventoryProperty.GiveToPlayer(target); target.StartCoroutine(this.EquipWeapon(target)); return; } } }