Ejemplo n.º 1
0
        public void OnKills(DyingEventArgs ev)
        {
            if (ev.HitInformation.GetDamageType() == DamageTypes.MicroHid && !FFREVERSE.Instance.Config.FFMicro)
            {
                return;
            }

            if (ev.Killer != null && ev.Killer.UserId != ev.Target.UserId && Round.IsStarted)
            {
                PlayerInfo            pinfo = PlayerInfoDict[ev.Killer.UserId];
                Exiled.API.Enums.Side aTeam = pinfo.lastSide;
                Exiled.API.Enums.Side tTeam = PlayerInfoDict[ev.Target.UserId].lastSide;
                if (aTeam == tTeam)
                {
                    pinfo.teamKills++;
                }
            }
        }
Ejemplo n.º 2
0
        public void OnDamage(HurtingEventArgs ev)
        {
            if (!PlayerInfoDict.ContainsKey(ev.Attacker.UserId))
            {
                return;
            }

            if (ev.DamageType == DamageTypes.MicroHid && !FFREVERSE.Instance.Config.FFMicro)
            {
                return;
            }
            PlayerInfo pinfo = PlayerInfoDict[ev.Attacker.UserId];

            Exiled.API.Enums.Side aTeam = pinfo.lastSide;
            Exiled.API.Enums.Side tTeam = PlayerInfoDict[ev.Target.UserId].lastSide;
            if (aTeam == tTeam && ev.Attacker.Id != ev.Target.Id && Round.IsStarted)
            {
                double dmg        = ev.Amount;
                double multiplier = FFREVERSE.Instance.Config.FFMultiplier;
                if (pinfo.teamKills >= FFREVERSE.Instance.Config.FFKills || pinfo.teamDamage >= FFREVERSE.Instance.Config.FFDamage)
                {
                    ev.Attacker.ShowHint("<size=35><b><color=#F52929>Инверсия \"огня по своим\" включена</color></b></size> \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", 5);
                    if (ev.DamageType == DamageTypes.Grenade)
                    {
                        Timing.CallDelayed(0.4f, () => ev.Attacker.Hurt((float)(dmg * multiplier), ev.DamageType));
                    }
                    else
                    {
                        ev.Attacker.Hurt((float)(dmg * multiplier), ev.DamageType /**ev.Attacker?.Nickname,ev.Attacker.Id**/);
                    }
                    ev.Attacker.EnableEffect("Bleeding", 1);
                    ev.IsAllowed = false;
                }
                else
                {
                    if (pinfo.teamDamage > 50)
                    {
                        ev.Attacker.ShowHint("<size=35><color=#fad106>Не наносите урон своим союзникам</color></size> \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", 3);
                    }
                    pinfo.teamDamage += (float)(dmg * multiplier);
                }
            }
        }