public override void TriggerEffect(WeaponModifiers weaponModifiers) { var shots = Mathf.FloorToInt(weaponModifiers.Multiplier); if (shots >= 1) { Shoot(shots, weaponModifiers); } }
public virtual void Trigger(WeaponModifiers weaponModifiers, ShipProperties shipProperties) { if (!(this.timeUntilTrigger <= 0)) { return; } this.timeUntilTrigger = 0; TriggerEffect(weaponModifiers, shipProperties); this.timeUntilTrigger += this.TriggerRate * weaponModifiers.Speed; }
public void Trigger(WeaponModifiers weaponModifiers) { if (!(this.timeUntilTrigger <= 0)) { return; } this.timeUntilTrigger = 0; TriggerEffect(weaponModifiers); this.timeUntilTrigger += this.TriggerRate * weaponModifiers.Speed; }
//gives Struct when called and does checks (call this from weapon when attacking). True is melee and False is ranged public void getMods(WeaponModifiers weaponMods) { weaponMods.meleeDamageAddition = weaponModifiers.meleeDamageAddition; weaponMods.meleeDamageMultiplier = weaponModifiers.meleeDamageMultiplier; weaponMods.rangedDamageAddition = weaponModifiers.rangedDamageAddition; weaponMods.rangedDamageMultiplier = weaponModifiers.rangedDamageMultiplier; weaponMods.meleeSizeAddition = weaponModifiers.meleeSizeAddition; weaponMods.meleeSizeMultiplier = weaponModifiers.meleeSizeMultiplier; weaponMods.rangedSpeedAddition = weaponModifiers.rangedSpeedAddition; weaponMods.rangedSpeedMultiplier = weaponModifiers.rangedSpeedMultiplier; weaponMods.projectileLifetimeAddition = weaponModifiers.projectileLifetimeAddition; weaponMods.projectileLifetimeMultiplier = weaponModifiers.projectileLifetimeMultiplier; }
public IEnumerable <Sprite> GetIcons(WeaponModifiers type) { var count = Enum.GetValues(typeof(WeaponModifiers)).Length; var t = (int)type; for (int i = 0; i < count - 1; i++) { if (1 << i == (1 << i & t)) { yield return(WeaponModifierIcons[i + 1]); } } }
private void ShootFanShots( int shots, float angle, WeaponModifiers weaponModifiers, Quaternion rotation) { for (var i = 0; i < shots; i++) { rotation.eulerAngles = new Vector3(0, angle); Instantiate(this.Projectile.ApplyModifiers(weaponModifiers), this.transform.position, rotation); rotation.eulerAngles = new Vector3(0, -angle); Instantiate(this.Projectile, this.transform.position, rotation); angle += angle; } }
private void Shoot(int shots, WeaponModifiers weaponModifiers) { var isEven = shots % 2 < 1; if (!isEven) { Instantiate(this.Projectile, this.transform.position, this.transform.rotation); } if (shots == 1) { return; } var halfShots = (shots - (isEven ? 0 : 1)) / 2f; var angle = 90 / (halfShots * 2); var rotation = this.transform.rotation; this.ShootFanShots(shots, angle, weaponModifiers, rotation); }
public override Projectile ApplyModifiers(WeaponModifiers weaponModifiers) { this.Damage += weaponModifiers.Damage; return(this); }
public virtual Projectile ApplyModifiers(WeaponModifiers weaponModifiers) { return(this); }
public override void ActivateEffect(WeaponModifiers weaponModifiers, ShipProperties shipProperties) { weaponModifiers.Multiplier += 1; }
public WeaponModifier GetWeaponModifierByName(string name) { return(WeaponModifiers.First(o => o.NamePrefix == name)); }
public virtual void TriggerEffect(WeaponModifiers weaponModifiers, ShipProperties shipProperties) { }
public virtual void ActivateEffect(WeaponModifiers weaponModifiers, ShipProperties shipProperties) { }
public bool HasMod(WeaponModifiers mod) { return(EnumHelper.ContainsFlag(weaponMods, mod)); }
public bool WeaponModifierExists(string namePrefix) { return(WeaponModifiers.Any(o => o.NamePrefix == namePrefix)); }
public virtual void TriggerEffect(WeaponModifiers weaponModifiers) { Instantiate(this.Projectile, this.transform.position, Quaternion.identity); }
public override void ActivateEffect(WeaponModifiers weaponModifiers, ShipProperties shipProperties) { weaponModifiers.Speed -= 0.1f; }