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;
        }
Exemple #4
0
        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;
            }
        }
Exemple #5
0
 public Heavy(Tank tank)
     : base(tank)
 {
 }
Exemple #6
0
 public MG(Tank tank)
     : base(tank)
 {
 }
 public abstract void OnCollected(Tank tank);
Exemple #8
0
 public Rocket(Tank tank)
     : base(tank)
 {
 }
Exemple #9
0
 public Chaingun(Tank tank)
     : base(tank)
 {
 }
Exemple #10
0
 public Autocannon(Tank tank)
     : base(tank)
 {
 }