public override void OnCollected(Tank tank) { User = tank; User.IsBoosting = true; TimeRemaining = 5; User.SpeedMultiplier *= SpeedMultiplier; ReceiveUpdates = true; }
public override void OnUpdate() { if (User != null && !User.IsDestroyed) { var heal = HealthRestoration * Time.DeltaTime * (1 / RestorationTime); remainingHeal -= heal; User.Heal(heal); if(remainingHeal <= 0) User = null; } }
public override void OnCollected(Tank tank) { User = tank; //Debug.LogAlways("Tank {0} collected health", LastUser.Name); remainingHeal = HealthRestoration; User.OnDamaged += (damage, type) => { // cancel heal if user was damaged by someone User = null; }; ReceiveUpdates = true; }
public TankTurret(Tank owner) { Owner = owner; Attachment = Owner.GetAttachment("turret"); Attachment.UseEntityRotation = true; Attachment.LoadObject(Model); Attachment.Material = Material.Find("objects/tanks/tank_turrets_" + Owner.Team); Attachment.OnDestroyed += (x) => { Destroy(); }; if (Owner.IsLocalClient) { // Temp hax for right mouse events not working Input.ActionmapEvents.Add("attack2", (e) => { switch (e.KeyEvent) { case KeyEvent.OnPress: if (AutomaticFire) m_rightFiring = true; break; case KeyEvent.OnRelease: if (AutomaticFire) m_rightFiring = false; else FireRight(); break; } }); Input.MouseEvents += ProcessMouseEvents; } }
public Heavy(Tank tank) : base(tank) { }
public MG(Tank tank) : base(tank) { }
public abstract void OnCollected(Tank tank);
public Rocket(Tank tank) : base(tank) { }
public Chaingun(Tank tank) : base(tank) { }
public Autocannon(Tank tank) : base(tank) { }