public bool OnFire(float angle, Weapon weapon, WeaponStats _) { if (Randomf.Chance(Intensity * weapon.cooldown)) { GameObject mine = SpawnPrefab(weapon.transform.position, new Vector3(0, 0, angle), weapon.transform.parent); Landmine landmine = mine.GetComponent <Landmine>(); landmine.Activate(Intensity * 2, Intensity * 5, weapon.GetComponent <BaseController>()); return(true); } return(false); }
public bool Fire(EnemyController self, out float angle) { angle = 0; if (self.FireReady && self.Weapon) { if (!self.target || !ShootTarget(self, out angle)) { if (Randomf.Chance(50)) { return(false); } angle = Random.Range(0, 360); } return(true); } return(false); }
public void PlayRandom(GameObject obj) { if (clips.Length == 0) { Debug.LogWarning($"RandomCLips {name} in {obj.name} has no clips"); return; } AudioEntity ae = clips.Length == 1 ? clips[0] : Randomf.Element(clips); if (!ae.clip) { Debug.LogWarning($"Random AudioEntity in {obj.name} is missing a clip"); return; } ae.Play(obj); }
public static Perk Random() { Type type = Randomf.Element(types); return((Perk)Activator.CreateInstance(type)); }
protected override System.Type RandomArchetype() { System.Type[] array = EyeOrbiterType.types.Values.ToArray(); return(Randomf.Element(array)); }