Exemple #1
0
        public static bool IsTeamkill(PlayerHurtEvent ev)
        {
            RoleType killer = ev.Attacker.Role;
            RoleType target = ev.Player.Role;

            if (ev.Attacker.UserId == ev.Player.UserId)
            {
                return(false);
            }
            if (killer.GetTeam() == target.GetTeam())
            {
                return(true);
            }
            if (killer == RoleType.ChaosInsurgency && target == RoleType.ClassD)
            {
                return(true);
            }
            if (killer == RoleType.FacilityGuard && target == RoleType.NtfCadet)
            {
                return(true);
            }
            if (killer == RoleType.NtfCommander && target == RoleType.FacilityGuard)
            {
                return(true);
            }
            if (killer == RoleType.NtfLieutenant && target == RoleType.FacilityGuard)
            {
                return(true);
            }
            if (killer == RoleType.NtfScientist && target == RoleType.FacilityGuard)
            {
                return(true);
            }
            if (killer.GetTeam() == Vigilance.Enums.TeamType.NineTailedFox && target == RoleType.Scientist)
            {
                return(true);
            }
            return(false);
        }
Exemple #2
0
 /// <summary>
 /// Get a <see cref="RoleType">role's</see> <see cref="Side"/>.
 /// </summary>
 /// <param name="role">The <see cref="RoleType"/> to check the side of.</param>
 /// <returns><see cref="Side"/>.</returns>
 public static Side GetSide(this RoleType role) => role.GetTeam().GetSide();
Exemple #3
0
    public static List <Vector3> GetSpawnPoints(this RoleType role)
    {
        List <Vector3> spawnPointsPose = new List <Vector3>();

        GameObject[] spawnPoints = null;
        switch (role.GetTeam())
        {
        case Team.SCP:
            switch (role)
            {
            case RoleType.Scp106:
                spawnPoints = GameObject.FindGameObjectsWithTag("SP_106");
                break;

            case RoleType.Scp049:
                spawnPoints = GameObject.FindGameObjectsWithTag("SP_049");
                break;

            case RoleType.Scp079:
                spawnPoints = GameObject.FindGameObjectsWithTag("SP_079");
                break;

            case RoleType.Scp096:
                spawnPoints = GameObject.FindGameObjectsWithTag("SCP_096");         // Idk why his switch from SP to SCP
                break;

            case RoleType.Scp93953:
            case RoleType.Scp93989:
                spawnPoints = GameObject.FindGameObjectsWithTag("SCP_939");
                break;

            case RoleType.Scp173:
                spawnPoints = GameObject.FindGameObjectsWithTag("SP_173");
                break;

            default: return(null);
            }
            break;

        case Team.MTF:
            spawnPoints = GameObject.FindGameObjectsWithTag(role == RoleType.FacilityGuard ? "SP_GUARD" : "SP_MTF");
            break;

        case Team.CHI:
            spawnPoints = GameObject.FindGameObjectsWithTag("SP_CI");
            break;

        case Team.RSC:
            spawnPoints = GameObject.FindGameObjectsWithTag("SP_RSC");
            break;

        case Team.CDP:
            spawnPoints = GameObject.FindGameObjectsWithTag("SP_CDP");
            break;

        case Team.TUT:
            spawnPoints = GameObject.FindGameObjectsWithTag("TUT Spawn");
            break;

        default: return(null);
        }

        spawnPoints.ToList().ForEach(spawnPoint => spawnPointsPose.Add(spawnPoint.transform.position));
        return(spawnPointsPose);
    }
Exemple #4
0
 /// <summary>
 /// Gets the <see cref="ReferenceHub">player</see>'s <see cref="Side">side</see> they're currently in.
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static Side GetSide(this RoleType type) => type.GetTeam().GetSide();