Пример #1
0
        public override void OnCollected(Tank tank)
        {
            User = tank;

            User.IsBoosting = true;

            TimeRemaining = 5;
            User.SpeedMultiplier *= SpeedMultiplier;

            ReceiveUpdates = true;
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
        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;
        }
Пример #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;
            }
        }
Пример #5
0
 public Heavy(Tank tank)
     : base(tank)
 {
 }
Пример #6
0
 public MG(Tank tank)
     : base(tank)
 {
 }
Пример #7
0
 public abstract void OnCollected(Tank tank);
Пример #8
0
 public Rocket(Tank tank)
     : base(tank)
 {
 }
Пример #9
0
 public Chaingun(Tank tank)
     : base(tank)
 {
 }
Пример #10
0
 public Autocannon(Tank tank)
     : base(tank)
 {
 }