public void Start() { thrustButton = new Button_Mouse(0); thrust = new float_field(5.0f); ShipModule_Projectile basicAttack = new ShipModule_Projectile(bulletPrefab, 0.2f, 3.0f, 10, 5.0f, 1, 5.0f, false, new Button_Mouse(1), this); ShipModule_Beam beamAttack = new ShipModule_Beam(qBeam, 1, new Button_Key(KeyCode.Q), this); ShipModule_TimedSwitch frenzy = new ShipModule_TimedSwitch ( 3.0f, new Button_Key(KeyCode.W), this, new List <IEffect>() { basicAttack.damage + 10, basicAttack.bulletsPerShot + 4, basicAttack.firingRate + 10, basicAttack.automatic.Setter(true), thrust + 5, } ); modules = new ShipModule[] { basicAttack, beamAttack, frenzy }; foreach (ShipModule module in modules) { module.Start(); } }
public ShipModule_Projectile(GameObject bulletPrefab, float baseSpeed, float baseRange, float baseDamage, float baseSpread, int bulletsPerShot, float baseFiringRate, bool automatic, Button button, BasicShip ship) : base(button, ship) { this.bulletPrefab = bulletPrefab; this.speed = new float_field(baseSpeed); this.range = new float_field(baseRange); this.damage = new float_field(baseDamage); this.spread = new float_field(baseSpread); this.bulletsPerShot = new int_field(bulletsPerShot); this.firingRate = new float_field(baseFiringRate); this.automatic = new bool_field(automatic); }
public ShipModule_Beam(LineRenderer beam, float baseDamage, Button button, BasicShip ship) : base(button, ship) { this.qBeam = beam; damage = new float_field(baseDamage); }