Esempio n. 1
0
    public void RocketInfo(BulletInfo bi, int weaponIndex, bool isVisuals = false, bool isPlayer = false, int botID = -1)
    {
        gunID      = weaponIndex;
        damage     = bi.damage;
        speed      = bi.muzzleVelocity;
        gFactor    = bi.gravityFactor;
        isDisplay  = isVisuals;
        player     = (isPlayer && botID <= -1);
        botIndex   = botID;
        explRadius = bi.explosionRadius;

        friendlyFire = true;
        if (Topan.Network.isConnected && NetworkingGeneral.currentGameType.customSettings.ContainsKey("Friendly Fire"))
        {
            friendlyFire = DarkRef.ConvertStringToBool(NetworkingGeneral.currentGameType.customSettings["Friendly Fire"].currentValue);
        }
    }
Esempio n. 2
0
    public static object GetSettingValue(GameTypeSetting setting)
    {
        if (setting.settingType == SettingType.Slider)
        {
            return(int.Parse(setting.currentValue));
        }
        else if (setting.settingType == SettingType.Checkbox)
        {
            return(DarkRef.ConvertStringToBool(setting.currentValue));
        }
        else if (setting.settingType == SettingType.EnumPopup || setting.settingType == SettingType.TextField)
        {
            return(setting.currentValue);
        }

        return(null);
    }
Esempio n. 3
0
    public void SwitchTeams(byte pID, byte team)
    {
        Topan.NetworkPlayer p = Topan.Network.GetPlayerByID((int)pID);
        if (p.HasPlayerData("team") && ((byte)p.GetPlayerData("team") == (byte)team))
        {
            return;
        }

        bool autoBalance = true;

        if (NetworkingGeneral.currentGameType.customSettings.ContainsKey("Team Auto-Balance"))
        {
            autoBalance = DarkRef.ConvertStringToBool(NetworkingGeneral.currentGameType.customSettings["Team Auto-Balance"].currentValue);
        }

        if (autoBalance && !NetworkingGeneral.currentGameType.ValidTeamSwitch((int)team))
        {
            return;
        }

        NetworkingGeneral.currentGameType.RemovePlayer((int)pID);
        NetworkingGeneral.currentGameType.AddPlayer((int)pID, (int)team);
        p.SetPlayerData("team", team);
    }