Inheritance: MonoBehaviour
Beispiel #1
0
        public void initialize(Vector3 position, Vector3 headingDirection, float speed, float strength, float strengthUp, GameMode gameMode)
        {
            base.initialize(position, headingDirection, speed);
            healthAmount = (int)(GameConstants.HealingAmount * strength * strengthUp);

            this.gameMode = gameMode;
            if (gameMode == GameMode.MainGame)
            {
                this.graphicDevice = PlayGameScene.GraphicDevice;
                this.gameCamera = PlayGameScene.gameCamera;
                this.spriteBatch = PoseidonGame.spriteBatch;
            }
            else if (gameMode == GameMode.ShipWreck)
            {
                this.graphicDevice = ShipWreckScene.GraphicDevice;
                this.gameCamera = ShipWreckScene.gameCamera;
                this.spriteBatch = PoseidonGame.spriteBatch;
            }
            else if (gameMode == GameMode.SurvivalMode)
            {
                this.graphicDevice = SurvivalGameScene.GraphicDevice;
                this.gameCamera = SurvivalGameScene.gameCamera;
                this.spriteBatch = PoseidonGame.spriteBatch;
            }

            laserBeamTexture = IngamePresentation.healLaserBeamTexture;

            Vector3 direction2D = graphicDevice.Viewport.Project(position + headingDirection, gameCamera.ProjectionMatrix, gameCamera.ViewMatrix, Matrix.Identity)
                - graphicDevice.Viewport.Project(position, gameCamera.ProjectionMatrix, gameCamera.ViewMatrix, Matrix.Identity);
            direction2D.Normalize();
            this.forwardDir = (float)Math.Atan2(direction2D.X, direction2D.Y);
        }
Beispiel #2
0
        protected override void OnResuming(GameMode last)
        {
            base.OnResuming(last);

            textContainer.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutExpo);
            Content.FadeIn(transition_time, EasingTypes.OutExpo);
        }
 /// <summary>
 /// Sets the <see cref="GameMode"/>s compatible to the <paramref name="modes"/> provided.
 /// </summary>
 /// <param name="modes">A variable number of <see cref="GameMode"/>s.</param>
 public CapabilitiesAttribute(params GameMode[] modes)
 {
     foreach (var mode in modes)
     {
         Capabilities |= mode;
     }
 }
 void Start()
 {
     k = 0;
     currentWaveTanksNumber = 5;
     spawnPoint = GameObject.Find("SpawnPoint").GetComponent<Transform>();
     gameModeScript = GameObject.Find("ManagerScripts").GetComponent<GameMode>();
 }
Beispiel #5
0
        public void Initialize()
        {
            inGame = new InGame();
            inGame.Initialize();

            gameMode = GameMode.InGameState;
        }
Beispiel #6
0
        public void Activated(GameMode gameMode)
        {
            _contentManager = new ContentManager(GameCore.GameController.Instance.Services, gameMode.TexturePath);
            _textures = new Dictionary<string, Texture2D>();

            _gameMode = gameMode;
        }
Beispiel #7
0
	void Start () {
		if (gameModeIndexSet) {
			gameMode = (GameMode)gameModeIndex;
		}
		if (gameMode == GameMode.Regular) {
			GetComponent<Clock>().StartClock();
		}

		Board.SetPositionFromFen (Definitions.gameStartFen,true);

		ZobristKey.Init ();
		Evaluation.Init ();
		if (regenerateOpeningBook) {
			OpeningBookGenerator.GenerateBook ();
		}
		if (useOpeningBook) {
			OpeningBookReader.Init ();
		}

		playerManager = GetComponent<MoveManager> ();

		playerManager.CreatePlayers ();

		Board.SetPositionFromFen (Definitions.gameStartFen,true);

	}
 public StatsFilter(Guid? deck, StatsRegion region, GameMode mode, TimeFrame time)
 {
     Deck = deck;
     Region = region;
     Mode = mode;
     TimeFrame = time;
 }
Beispiel #9
0
        public void Start(GameMode gameMode)
        {
            Native.RegisterExtension(new TestExtension());

            Console.WriteLine("Call OnTest183()");
            new NativeFunction("CallLocalFunction", typeof (string), typeof (string)).Invoke("OnTest183", "");
        }
 public static void EndGame()
 {
     if (GameObject.Find ("CutsceneCam").GetComponent<Cutscene> ().time_to_complete == 0f) {
         GameObject.Find ("CutsceneCam").GetComponent<Cutscene> ().StartScene ();
         mode = GameMode.EndGame;
     }
 }
Beispiel #11
0
        public void Start(GameMode gameMode)
        {
            int playercount = GtaPlayer.All.Count;
            bool success = true;

            GtaPlayer player = GtaPlayer.Create(499);

            if (GtaPlayer.All.Count - 1 != playercount)
            {
                Console.WriteLine("DisposureTest: Adding didn't add player to pool.");
                success = false;
            }
            player.Dispose();

            if (GtaPlayer.All.Count != playercount)
            {
                Console.WriteLine("DisposureTest: Disposing didn't remove player from pool.");
                success = false;
            }
            try
            {
                player.SetChatBubble("Test!", Color.Yellow, 100, 10);

                Console.WriteLine("DisposureTest: Passed SetChatBubble.");
                success = false;
            }
            catch (ObjectDisposedException)
            {
                Console.WriteLine("DisposureTest: Exception thrown.");
            }

            Console.WriteLine("DisposureTest successful: {0}", success);
        }
    void OnLevelWasLoaded(int levelIndex)
    {
        //reset the game mode reference from the new gamemode object
        if (aGameMode == null || gameModeObject == null)
        {
            //look for game mode object in scene
            if (gameModeObject == null)
                gameModeObject = GameObject.Find("GameMode");

            //if there's no game mode object, make a default one
            if (gameModeObject == null)
            {
                gameModeObject = new GameObject("GameMode");
                aGameMode = gameModeObject.AddComponent<GameMode>();
            }

            //if game mode object exists, get its game mode component or make one
            else
            {
                aGameMode = gameModeObject.GetComponent<GameMode>();
                if (aGameMode == null)
                    aGameMode = gameModeObject.AddComponent<GameMode>();
            }
        }
    }
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerResult" /> class.
 /// </summary>
 /// <param name="level">The level this server is running.</param>
 /// <param name="gameMode">The game mode this server is running.</param>
 /// <param name="gamePreset">The game preset this server is running.</param>
 /// <param name="url">The URL to the server on BattleLog.</param>
 public ServerResult(GameLevel level, GameMode gameMode, GamePreset gamePreset, string url)
 {
     Level = level;
     GameMode = gameMode;
     GamePreset = gamePreset;
     Url = url;
 }
        public void AddCommandBindings(GameMode mode)
        {
            // add common bindings
            m_mainWindow.CommandBindings.AddRange(new CommandBinding[] {
                new CommandBinding(ClientCommands.AutoAdvanceTurnCommand, AutoAdvanceTurnHandler),
                new CommandBinding(ClientCommands.OpenConsoleCommand, OpenConsoleHandler),
                new CommandBinding(ClientCommands.OpenFocusDebugCommand, OpenFocusDebugHandler),
            });

            // add mode specific bindings
            switch (mode)
            {
                case GameMode.Fortress:
                    foreach (var kvp in ClientTools.ToolDatas)
                    {
                        var toolMode = kvp.Value.Mode;
                        m_mainWindow.CommandBindings.Add(new CommandBinding(kvp.Value.Command,
                            (s, e) => m_mainWindow.ClientTools.ToolMode = toolMode));
                    }
                    break;

                case GameMode.Adventure:
                    m_mainWindow.CommandBindings.AddRange(new CommandBinding[] {
                        new CommandBinding(ClientCommands.DropItemCommand, DropItemHandler),
                        new CommandBinding(ClientCommands.GetItemCommand, GetItemHandler),
                        new CommandBinding(ClientCommands.RemoveItemCommand, RemoveItemHandler),
                        new CommandBinding(ClientCommands.WearItemCommand, WearItemHandler),
                        new CommandBinding(ClientCommands.InventoryCommand, InventoryHandler),
                    });
                    break;
            }
        }
Beispiel #15
0
    void EndTurn()
    {
        var intGameMode = (int) GameMode;
        intGameMode++;

        GameMode = (GameMode) (intGameMode % Enum.GetNames(typeof (GameMode)).Length);
    }
Beispiel #16
0
 public static ChangeGameState ChangeGameMode(GameMode mode)
 {
     ChangeGameState n = new ChangeGameState();
     n.Reason = GameState.ChangeGameMode;
     n.Value = (float)mode;
     return n;
 }
 public void changeModeToGameover()
 {
     gmode = GameMode.GAMEOVER;
     gameoverText.gameObject.active = true;
     touchtostartText.gameObject.active = true;
     ShipInstance.gameObject.active = false;
 }
Beispiel #18
0
 public Game(ref Player playerA,ref Player playerB,Difficulty difficulty,GameMode gameMode)
 {
     current_game = this;
     board = new PlayerType[3,3]{{PlayerType.NONE,PlayerType.NONE,PlayerType.NONE},
                                 {PlayerType.NONE,PlayerType.NONE,PlayerType.NONE},
                                 {PlayerType.NONE,PlayerType.NONE,PlayerType.NONE}};
     this.playerA = playerA;
     this.playerA.score = 0;
     this.playerB = playerB;
     this.difficulty = difficulty;
     this.game_mode = gameMode;
     if (game_mode == GameMode.SINGLE_PLAYER)
     {
         //playerA.name = "User";
         playerB.name = "Computer";
         playerA.moveAllowed = true;
         playerB.moveAllowed = false;
     }else if(game_mode == GameMode.MULTI_PLAYER_STANDALONE){
         //playerA.name = "Ball";
         playerB.name = "Cross";
         //playerA.moveAllowed = true;
         playerB.moveAllowed = false;
         this.difficulty = Difficulty.NONE;
     }
     else if (game_mode == GameMode.MULTI_PLAYER)
     {
         this.difficulty = Difficulty.NONE;
     }
     this.current_player = playerA;
     this.connected = false;
 }
        public AiReportOneObject(HitObjectBase h, BeenCorrectedDelegate corrected, Severity severity, string information, int weblink, GameMode Mode = GameMode.All)
            : base(h.StartTime, severity, information, weblink, corrected, Mode)
        {
            this.h1 = h;

            RelatedHitObjects.Add(h);
        }
Beispiel #20
0
 public static GameMode GetProperty(string property, GameMode defaultValue)
 {
     try
     {
         string gm = ReadString(property);
         switch (gm.ToLower())
         {
             case "1":
             case "creative":
                 return GameMode.Creative;
             case "0":
             case "survival":
                 return GameMode.Survival;
             case "2":
             case "adventure":
                 return GameMode.Adventure;
             case "3":
             case "spectator":
                 return GameMode.Spectator;
             default:
                 return defaultValue;
         }
     }
     catch
     {
         return defaultValue;
     }
 }
Beispiel #21
0
 void Update()
 {
     if (mode == GameMode.playing && Down_Floor.floorNext) {
         mode = GameMode.levelEnd;
         Invoke ("NextLevel", .5f);
     }
 }
        public void Launch(string segueId, GameMode mode, GameDifficulty difficulty, Filter filter)
        {
            SegueId = segueId;
              SelectedMode = mode;
              SelectedDifficulty = difficulty;
              SelectedFilter = filter;

              if (SelectedFilter == null)
              {
            SelectedFilter = new Filter("0", "Siphon filter", "defaultIcon");
              }

              UIViewController.InvokeInBackground(() => {
            int gamesCount = SelectedFilter.Load();

            mController.BeginInvokeOnMainThread(() => {
              if (gamesCount < 30)
              {
            Dialogs.ShowDebugFilterTooRestrictive();
              }
              else
              {
            mController.PerformSegue(SegueId, mController);
              }
            });
              });
        }
Beispiel #23
0
 public PlayerItem(Guid uuid, string name, GameMode mode, int ping)
 {
     this.UUID = uuid;
     this.Name = name;
     this.Gamemode = mode;
     this.Ping = ping;
 }
Beispiel #24
0
    public static void ResetLevel()
    {
        mode = GameMode.Pause;
        previousGameMode = GameMode.Chase;

        gameModeTimer = 0.0f;
    }
    public void Apply(GameModeManagerDef _def)
    {
        if (_def.mode != null)
        {
            if ( ! _def.mode.overrideMode)
            {
                if (mode != null || m_ModeToSet != null)
                {
                    Debug.Log("Mode is already exist. ");
                }
            }

            m_ModeToSet = _def.mode;

            CancelInvoke("SetupProc");

            if (setupDelay <= 0f)
            {
                Debug.LogWarning("Setup mode without delay. Sure?");
                SetupProc();
            }
            else
            {
                Invoke("SetupProc", setupDelay);
            }
        }
    }
    public static void UploadScoreToServer(string name, UInt32 score, GameMode gameMode, string levelName)
    {
        if (name.Length != 3) return;
        try
        {
            ScoreGameType gameType = gameTypeLookup[gameMode];
            ScoreLevel level = levelLookup[levelName];
            
            byte[] buffer = new byte[9];

            new ASCIIEncoding().GetBytes(name).CopyTo(buffer, 0);

            // Convert score to bytes
            buffer[3] = (byte)((score & 0xFF000000) >> 24);
            buffer[4] = (byte)((score & 0x00FF0000) >> 16);
            buffer[5] = (byte)((score & 0x0000FF00) >>  8);
            buffer[6] = (byte)((score & 0x000000FF) >>  0);

            buffer[7] = (byte)gameType;
            buffer[8] = (byte)level;

            Coroutiner.StartCoroutine(SendData(GetEncryptedBytes(buffer)));
        }
        catch (Exception) { Debug.Log("Error uploading score to server"); }
    }
Beispiel #27
0
 public ScoreDTO(int player_id, int score, Difficulty difficulty, GameMode game_mode)
 {
     this.player_id = player_id;
     this.score = score;
     this.difficulty = difficulty;
     this.game_mode = game_mode;
 }
Beispiel #28
0
        /**
         * Constructor
         */
        public Arena(Game g, GameMode mode)
            : base(g)
        {
            this.mode = mode;
            Init();
            bounds = new Rectangle(0, 0, (int)Constants.GAME_WORLD_WIDTH, (int)Constants.GAME_WORLD_HEIGHT);
            this.scale = (float)Constants.GAME_WORLD_WIDTH / (float)background.index.Width;
            player1.LoadContent();
            background = game.getSprite("clouds");
            maxLeft = game.maxLeft;
            maxRight = game.maxRight;
            maxTop = game.maxTop;
            maxButtom = game.maxButtom;
            gui = new GUI(g);
            buttons = new Button[g.blockCounter-9];
            int bCounter = 0;

            foreach (String i in g.blockList)
            {
                Button b ;
                if(bCounter%3==0)
                    b = new Button(g, new Vector2(10, (5 + 50 * bCounter)/3), bCounter, i);
                else if(bCounter%3==1)
                    b = new Button(g, new Vector2(50, (5 + 50 * (bCounter-1))/3), bCounter, i);
                else
                    b = new Button(g, new Vector2(90, (5 + 50 * (bCounter - 2)) / 3), bCounter, i);
                //gamaddEntity(b);
                buttons[bCounter] = b;
                bCounter++;
            }
            deathBall = game.getSprite("deathBall");
        }
Beispiel #29
0
 private void CheckForGameStart()
 {
     if(m_gameMode == GameMode.ReadyUp && m_playerReady[0] && m_playerReady[1])
     {
         m_gameMode = GameMode.Play;
     }
 }
Beispiel #30
0
        public Submarine(GameMode gameMode)
            : base()
        {
            speed = (float)(GameConstants.EnemySpeed * 1.5);
            damage = GameConstants.TerminatorShootingDamage;
            timeBetweenFire = 2.0f;
            isBigBoss = true;
            random = new Random();
            health = 6000;
            //health = 1;

            //if (PlayGameScene.currentLevel > 10)
            //    perceptionRadius = GameConstants.BossPerceptionRadius * (HydroBot.gamePlusLevel + 1);
            //else
            perceptionRadius = GameConstants.BossPerceptionRadius;
            basicExperienceReward = 2000;

            if (PoseidonGame.gamePlus)
            {
                speed *= (1.0f + (float)HydroBot.gamePlusLevel / 4);
                damage *= (HydroBot.gamePlusLevel + 1);
                timeBetweenFire /= (1 + HydroBot.gamePlusLevel * 0.25f);
                health += (HydroBot.gamePlusLevel * 3000);
                basicExperienceReward *= (HydroBot.gamePlusLevel + 1);
                timeBetweenPowerUse /= (1 + (float)HydroBot.gamePlusLevel * 0.25f);
            }
            maxHealth = health;
            //basicExperienceReward = 1;
            this.gameMode = gameMode;
        }
 public LotteryDataDerivation(GameMode gameMode)
 {
     this.gameMode           = gameMode;
     this.lotteryScheduleDao = LotteryScheduleDaoImpl.GetInstance();
 }
Beispiel #32
0
/*    void OnBodyChanged(Transform transform)
 *  {
 *      skinHolder = transform;
 *  }*/

    private void OnGameModeChanged(GameMode gameMode)
    {
        _gameMode     = gameMode;
        currentConfig = LoadConf(_characterSex, _gameMode);
        PutOnClothes(currentConfig);
    }
Beispiel #33
0
    ClothesConfig LoadConf(Gender gender, GameMode gameMode)
    {
        string key = gender.ToString() + gameMode.ToString();

        return(SaveManager.Instance.LoadClothesSet(key));
    }
Beispiel #34
0
 public static void Reset()
 {
     difficulty = Difficulty.EASY;
     gamemode   = GameMode.SOLO;
 }
Beispiel #35
0
        protected static Dictionary <int, List <T> > SplitPlayersIntoTeams <T>(List <T> players, GameMode gameMode)
            where T : UnfinishedMatchPlayer
        {
            var teams = players.GroupBy(x => x.team)
                        .ToDictionary(x => x.Key, x => x.ToList());

            if (teams.Count() == 1)
            {
                var totalPlayers  = players.Count;
                var playersInTeam = totalPlayers / GetNumberOfTeamsFromGameMode(gameMode);

                int team = 0;
                for (int i = 0; i < totalPlayers; i += playersInTeam)
                {
                    var playersTeam = new List <T>();
                    playersTeam.AddRange(players.Skip(playersInTeam).Take(playersInTeam));
                    teams[team] = playersTeam;

                    team++;
                }
            }

            return(teams);
        }
 // -------------------------------------------------------------------
 // Constructor
 // -------------------------------------------------------------------
 public EventSwitchGameMode(GameMode mode)
 {
     this.Mode = mode;
 }
Beispiel #37
0
 public GameManager()
 {
     m_pGameMode         = null;
     m_gameManagerObject = new GameObject("Game Manager");
     Object.DontDestroyOnLoad(m_gameManagerObject);
 }
Beispiel #38
0
        public Task <List <Rank> > SearchPlayerOfLeague(string searchFor, int season, GateWay gateWay, GameMode gameMode)
        {
            var search = searchFor.ToLower();

            return(JoinWith(rank =>
                            rank.PlayerId.ToLower().Contains(search) &&
                            rank.Gateway == gateWay &&
                            (gameMode == GameMode.Undefined || rank.GameMode == gameMode) &&
                            rank.Season == season));
        }
Beispiel #39
0
 public Task <List <Rank> > LoadPlayersOfLeague(int leagueId, int season, GateWay gateWay, GameMode gameMode)
 {
     return(JoinWith(rank =>
                     rank.League == leagueId &&
                     rank.Gateway == gateWay &&
                     rank.GameMode == gameMode &&
                     rank.Season == season));
 }
Beispiel #40
0
 public void SetGameMode(int gameMode)
 {
     mode = (GameMode)gameMode;
 }
Beispiel #41
0
        public static async Task <Beatmaps> GetBeatmapAsync(ulong beatmapId, BeatmapType bmType = BeatmapType.ByDifficulty, GameMode gameMode = GameMode.Standard)
        {
            string mode    = UserMode.ToString(gameMode);
            string type    = Beatmap.ToString(bmType);
            string request = await GetAsync($"{GET_BEATMAPS_URL}{API_KEY_PARAMETER}{ApiKey}{type}{beatmapId}{mode}");

            List <Beatmaps> r = JsonConvert.DeserializeObject <List <Beatmaps> >(request);

            return(r.Count > 0 ? r[0] : null);
        }
Beispiel #42
0
        public async Task <List <Rank> > LoadPlayersOfCountry(string countryCode, int season, GateWay gateWay, GameMode gameMode)
        {
            var personalSettings = _personalSettingsProvider.GetPersonalSettings();

            var battleTags = personalSettings.Where(ps => (ps.CountryCode ?? ps.Location) == countryCode).Select(ps => ps.Id);

            return(await JoinWith(rank => rank.Gateway == gateWay &&
                                  rank.GameMode == gameMode &&
                                  rank.Season == season &&
                                  (battleTags.Contains(rank.Player1Id) || battleTags.Contains(rank.Player2Id))));
        }
Beispiel #43
0
        public static async Task <List <UserRecent.UserRecent> > GetUserRecentByUseridAsync(ulong userid, GameMode gameMode = GameMode.Standard, int limit = 10)
        {
            string mode    = UserMode.ToString(gameMode);
            string request = await GetAsync($"{GET_USER_RECENT_URL}{API_KEY_PARAMETER}{ApiKey}{USER_PARAMETER}{userid}{mode}{LIMIT_PARAMETER}{limit}");

            return(JsonConvert.DeserializeObject <List <UserRecent.UserRecent> >(request));
        }
Beispiel #44
0
        public static async Task <List <Beatmaps> > GetBeatmapsAsync(ulong id, BeatmapType bmType = BeatmapType.ByBeatmap, GameMode gameMode = GameMode.Standard, int limit = 500)
        {
            string mode    = UserMode.ToString(gameMode);
            string type    = Beatmap.ToString(bmType);
            string request = await GetAsync($"{GET_BEATMAPS_URL}{API_KEY_PARAMETER}{ApiKey}{type}{id}{LIMIT_PARAMETER}{limit}{mode}");

            return(JsonConvert.DeserializeObject <List <Beatmaps> >(request));
        }
Beispiel #45
0
            protected override void OnReload(GameMode currentGameMode)
            {
                BodyGUID     = null;
                PenisGUID    = null;
                BallsGUID    = null;
                DisplayPenis = ChaControl.sex == 0;
                DisplayBalls = ChaControl.sex == 0;

                var data = GetExtendedData();

                if (data != null)
                {
                    if (data.version == 1)
                    {
                        if (data.data.TryGetValue("DisplayBalls", out var loadedDisplayBalls))
                        {
                            DisplayBalls = (bool)loadedDisplayBalls;
                        }
                        if (data.data.TryGetValue("UncensorGUID", out var loadedUncensorGUID) && loadedUncensorGUID != null)
                        {
                            string UncensorGUID = loadedUncensorGUID.ToString();
                            if (!UncensorGUID.IsNullOrWhiteSpace() && MigrationDictionary.TryGetValue(UncensorGUID, out MigrationData migrationData))
                            {
                                BodyGUID  = migrationData.BodyGUID;
                                PenisGUID = migrationData.PenisGUID;
                                BallsGUID = migrationData.BallsGUID;
                                if (PenisGUID != null)
                                {
                                    DisplayPenis = true;
                                }
                            }
                        }
                    }
                    else
                    {
                        if (data.data.TryGetValue("BodyGUID", out var loadedUncensorGUID) && loadedUncensorGUID != null)
                        {
                            BodyGUID = loadedUncensorGUID.ToString();
                        }

                        if (data.data.TryGetValue("PenisGUID", out var loadedPenisGUID) && loadedPenisGUID != null)
                        {
                            PenisGUID = loadedPenisGUID.ToString();
                        }

                        if (data.data.TryGetValue("BallsGUID", out var loadedBallsGUID) && loadedBallsGUID != null)
                        {
                            BallsGUID = loadedBallsGUID.ToString();
                        }

                        if (data.data.TryGetValue("DisplayPenis", out var loadedDisplayPenis))
                        {
                            DisplayPenis = (bool)loadedDisplayPenis;
                        }

                        if (data.data.TryGetValue("DisplayBalls", out var loadedDisplayBalls))
                        {
                            DisplayBalls = (bool)loadedDisplayBalls;
                        }
                    }
                }

                if (BodyGUID.IsNullOrWhiteSpace())
                {
                    BodyGUID = null;
                }
                if (PenisGUID.IsNullOrWhiteSpace())
                {
                    PenisGUID = null;
                }
                if (BallsGUID.IsNullOrWhiteSpace())
                {
                    BallsGUID = null;
                }

                if (MakerAPI.InsideAndLoaded)
                {
                    DoDropdownEvents = false;
                    if (MakerAPI.GetCharacterLoadFlags().Body)
                    {
                        if (MakerAPI.GetMakerBase().chaCtrl == ChaControl)
                        {
                            //Update the UI to match the loaded character
                            if (BodyGUID == null || BodyList.IndexOf(BodyGUID) == -1)
                            {
                                //The loaded uncensor isn't on the list, possibly due to being forbidden
                                BodyDropdown.Value = 0;
                                BodyGUID           = null;
                            }
                            else
                            {
                                BodyDropdown.Value = BodyList.IndexOf(BodyGUID);
                            }

                            if (PenisGUID == null || PenisList.IndexOf(PenisGUID) == -1)
                            {
                                PenisDropdown.Value = DisplayPenis ? 0 : 1;
                                PenisGUID           = null;
                            }
                            else
                            {
                                PenisDropdown.Value = PenisList.IndexOf(PenisGUID);
                            }

                            if (BallsGUID == null || BallsList.IndexOf(BallsGUID) == -1)
                            {
                                BallsDropdown.Value = DisplayBalls ? 0 : 1;
                                BallsGUID           = null;
                            }
                            else
                            {
                                BallsDropdown.Value = BallsList.IndexOf(BallsGUID);
                            }
                        }
                    }
                    else
                    {
                        //Set the uncensor stuff to whatever is set in the maker
                        BodyGUID     = BodyDropdown.Value == 0 ? null : BodyList[BodyDropdown.Value];
                        PenisGUID    = PenisDropdown.Value == 0 || PenisDropdown.Value == 1 ? null : PenisList[PenisDropdown.Value];
                        BallsGUID    = BallsDropdown.Value == 0 || BallsDropdown.Value == 1 ? null : BallsList[BallsDropdown.Value];
                        DisplayPenis = PenisDropdown.Value == 1 ? false : true;
                        DisplayBalls = BallsDropdown.Value == 1 ? false : true;
                    }
                    DoDropdownEvents = true;
                }
                //Update the uncensor on every load or reload
                UpdateUncensor();
            }
Beispiel #46
0
        public static async Task <Replay> GetReplayByUseridAsync(ulong beatmapid, ulong userid, GameMode gameMode = GameMode.Standard)
        {
            string mode    = UserMode.ToString(gameMode);
            string request = await GetAsync($"{GET_REPLAY_URL}{API_KEY_PARAMETER}{ApiKey}{mode}{BEATMAP_PARAMETER}{beatmapid}{USER_PARAMETER}{userid}");

            List <Replay> r = JsonConvert.DeserializeObject <List <Replay> >(request);

            return(r.Count > 0 ? r[0] : null);
        }
            protected override void OnReload(GameMode currentGameMode)
            {
                bool hasSavedBaseData = false;
                var  flags            = MakerAPI.GetCharacterLoadFlags();
                bool clothesFlag      = flags == null || flags.Clothes;
                bool bodyFlag         = flags == null || flags.Body;

                if (bodyFlag)
                {
                    BaseData       = new BodyData(ChaControl.fileBody);
                    LoadedBaseData = new BodyData(ChaControl.fileBody);
                    BaseData.CopyTo(LoadedBaseData);
                    CurrentPushupData = new BodyData(ChaControl.fileBody);
                }

                if (clothesFlag)
                {
                    //Load the data only if clothes is checked to be loaded
                    BraDataDictionary = new Dictionary <int, ClothData>();
                    TopDataDictionary = new Dictionary <int, ClothData>();

                    var data = GetExtendedData();
                    if (data != null && data.data.TryGetValue(PushupConstants.Pushup_BraData, out var loadedBraData) && loadedBraData != null)
                    {
                        BraDataDictionary = MessagePackSerializer.Deserialize <Dictionary <int, ClothData> >((byte[])loadedBraData);
                    }

                    if (data != null && data.data.TryGetValue(PushupConstants.Pushup_TopData, out var loadedTopData) && loadedTopData != null)
                    {
                        TopDataDictionary = MessagePackSerializer.Deserialize <Dictionary <int, ClothData> >((byte[])loadedTopData);
                    }

                    if (data != null && data.data.TryGetValue(PushupConstants.Pushup_BodyData, out var loadedBodyData) && loadedBodyData != null)
                    {
                        hasSavedBaseData = true;
                        LoadedBaseData   = MessagePackSerializer.Deserialize <BodyData>((byte[])loadedBodyData);
                    }

                    //Reset advanced mode stuff and disable it when not loading the body in character maker
                    if (!bodyFlag)
                    {
                        foreach (var clothData in BraDataDictionary.Values)
                        {
                            BaseData.CopyTo(clothData);
                            clothData.UseAdvanced = false;
                        }
                        foreach (var clothData in TopDataDictionary.Values)
                        {
                            BaseData.CopyTo(clothData);
                            clothData.UseAdvanced = false;
                        }
                    }
                    if (!hasSavedBaseData)
                    {
                        if (data?.data != null)
                        {
                            data.data.Add(PushupConstants.Pushup_BodyData, MessagePackSerializer.Serialize(BaseData));
                            SetExtendedData(data);
                        }
                    }
                }

                //Apply the saved data to the base body data since it sometimes gets overwritten in the main game
                if (KoikatuAPI.GetCurrentGameMode() == GameMode.MainGame)
                {
                    LoadedBaseData.CopyTo(BaseData);
                }

                RecalculateBody();
                base.OnReload(currentGameMode);
            }
Beispiel #48
0
        public static async Task <Scores> GetScoreByUsernameAsync(ulong beatmapid, string username, GameMode gameMode = GameMode.Standard)
        {
            string mode    = UserMode.ToString(gameMode);
            string request = await GetAsync($"{GET_SCORES_URL}{API_KEY_PARAMETER}{ApiKey}{mode}{USER_PARAMETER}{username}{BEATMAP_PARAMETER}{beatmapid}");

            List <Scores> r = JsonConvert.DeserializeObject <List <Scores> >(request);

            return(r.Count > 0 ? r[0] : null);
        }
Beispiel #49
0
 public void SetCurrentMap(MapInfo mapInfo, GameMode mode)
 {
     currentMapInfo = mapInfo;
     this.gameMode  = mode;
 }
Beispiel #50
0
        public static void ExportHitsounds(List <HitsoundEvent> hitsounds, string baseBeatmap, string exportFolder, string exportMapName, GameMode exportGameMode, bool useGreenlines, bool useStoryboard)
        {
            var     editor  = EditorReaderStuff.GetNewestVersionOrNot(baseBeatmap);
            Beatmap beatmap = editor.Beatmap;

            if (useStoryboard)
            {
                beatmap.StoryboardSoundSamples.Clear();
                foreach (var h in hitsounds.Where(h => !string.IsNullOrEmpty(h.Filename)))
                {
                    beatmap.StoryboardSoundSamples.Add(new StoryboardSoundSample((int)Math.Round(h.Time), 0, h.Filename, h.Volume * 100));
                }
            }
            else
            {
                // Make new timing points
                // Add red lines
                List <TimingPoint>        timingPoints        = beatmap.BeatmapTiming.GetAllRedlines();
                List <TimingPointsChange> timingPointsChanges = timingPoints.Select(tp =>
                                                                                    new TimingPointsChange(tp, mpb: true, meter: true, unInherited: true, omitFirstBarLine: true))
                                                                .ToList();

                // Add hitsound stuff
                // Replace all hitobjects with the hitsounds
                beatmap.HitObjects.Clear();
                foreach (HitsoundEvent h in hitsounds)
                {
                    if (useGreenlines)
                    {
                        TimingPoint tp = beatmap.BeatmapTiming.GetTimingPointAtTime(h.Time + 5).Copy();
                        tp.Offset      = h.Time;
                        tp.SampleIndex = h.CustomIndex;
                        h.CustomIndex  = 0; // Set it to default value because it gets handled by greenlines now
                        tp.Volume      = Math.Round(tp.Volume * h.Volume);
                        h.Volume       = 0; // Set it to default value because it gets handled by greenlines now
                        timingPointsChanges.Add(new TimingPointsChange(tp, index: true, volume: true));
                    }

                    beatmap.HitObjects.Add(new HitObject(h.Pos, h.Time, 5, h.GetHitsounds(), h.SampleSet, h.Additions,
                                                         h.CustomIndex, h.Volume * 100, h.Filename));
                }

                // Replace the old timingpoints
                beatmap.BeatmapTiming.TimingPoints.Clear();
                TimingPointsChange.ApplyChanges(beatmap.BeatmapTiming, timingPointsChanges);
            }

            // Change version to hitsounds
            beatmap.General["StackLeniency"] = new TValue("0.0");
            beatmap.General["Mode"]          = new TValue(((int)exportGameMode).ToInvariant());
            beatmap.Metadata["Version"]      = new TValue(exportMapName);

            if (exportGameMode == GameMode.Mania)
            {
                // Count the number of distinct X positions
                int numXPositions = new HashSet <double>(hitsounds.Select(h => h.Pos.X)).Count;
                int numKeys       = MathHelper.Clamp(numXPositions, 1, 18);

                beatmap.Difficulty["CircleSize"] = new TValue(numKeys.ToInvariant());
            }
            else
            {
                beatmap.Difficulty["CircleSize"] = new TValue("4");
            }

            // Save the file to the export folder
            editor.SaveFile(Path.Combine(exportFolder, beatmap.GetFileName()));
        }
Beispiel #51
0
 public static BasePoolGame Create(GameMode mode)
 {
     return(Instantiate(AO.Utilities.PrefabUtil.Create <BasePoolGame>(mode.GetStringValue(), "PoolGame")));
 }
Beispiel #52
0
 public void SetCurrentMap(int mapID, GameMode mode)
 {
     currentMapInfo = mapInfoList[mapID];
     this.gameMode  = mode;
 }
Beispiel #53
0
 // Start is called before the first frame update
 void Start()
 {
     mode = GameMode.loading;
     WordList.INIT();
 }
Beispiel #54
0
 public void SetCurrentMap(List <BuildingInfo> buildingInfoList, GameMode mode)
 {
     currentMapInfo = new MapInfo(buildingInfoList);
     this.gameMode  = mode;
 }
Beispiel #55
0
 public void SubWordSearchComplete()
 {
     mode = GameMode.levelPrep;
     Layout();
 }
        public WpfRobot2RouesInterface(GameMode gamemode)
        {
            gameMode = gamemode;
            InitializeComponent();

            //Among other settings, this code may be used
            CultureInfo ci = CultureInfo.CurrentUICulture;

            try
            {
                //Override the default culture with something from app settings
                ci = new CultureInfo("Fr");
            }
            catch { }
            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            //Here is the important part for databinding default converters
            FrameworkElement.LanguageProperty.OverrideMetadata(
                typeof(FrameworkElement),
                new FrameworkPropertyMetadata(
                    XmlLanguage.GetLanguage(ci.IetfLanguageTag)));

            //Among other code
            if (CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator != ".")
            {
                //Handler attach - will not be done if not needed
                PreviewKeyDown += new KeyEventHandler(MainWindow_PreviewKeyDown);
            }

            var currentDir    = Directory.GetCurrentDirectory();
            var racineProjets = Directory.GetParent(currentDir);
            var imagePath     = racineProjets.Parent.Parent.FullName.ToString() + "\\Images\\";

            if (gameMode == GameMode.Eurobot)
            {
                worldMapDisplayStrategy.Init(gameMode, LocalWorldMapDisplayType.StrategyMap);
                worldMapDisplayStrategy.SetFieldImageBackGround(imagePath + "Eurobot2020.png");
                worldMapDisplayWaypoint.Init(gameMode, LocalWorldMapDisplayType.WayPointMap);
                worldMapDisplayWaypoint.SetFieldImageBackGround(imagePath + "Eurobot2020.png");
            }
            else if (gameMode == GameMode.RoboCup)
            {
                //worldMapDisplayStrategy.Init(gameMode, LocalWorldMapDisplayType.StrategyMap, imagePath + "RoboCup.png");
                //worldMapDisplayWaypoint.Init(gameMode, LocalWorldMapDisplayType.WayPointMap, imagePath + "RoboCup.png");
            }

            worldMapDisplayStrategy.InitTeamMate((int)TeamId.Team1 + (int)RobotId.Robot1, GameMode.Eurobot, "Wally");
            worldMapDisplayWaypoint.InitTeamMate((int)TeamId.Team1 + (int)RobotId.Robot1, GameMode.Eurobot, "Wally");

            worldMapDisplayStrategy.OnCtrlClickOnHeatMapEvent += WorldMapDisplay_OnCtrlClickOnHeatMapEvent;
            worldMapDisplayWaypoint.OnCtrlClickOnHeatMapEvent += WorldMapDisplay_OnCtrlClickOnHeatMapEvent;


            //foreach (string s in SerialPort.GetPortNames())
            //{
            //    Console.WriteLine("   {0}", s);
            //}

            timerAffichage.Interval = new TimeSpan(0, 0, 0, 0, 50);
            timerAffichage.Tick    += TimerAffichage_Tick;
            timerAffichage.Start();

            //oscilloX.SetTitle("Consigne / Vitesse Linéaire");
            oscilloX.AddOrUpdateLine(0, 100, "Vitesse X Consigne");
            oscilloX.AddOrUpdateLine(1, 500, "Vitesse X");
            //oscilloX.AddOrUpdateLine(2, 100, "Accel X");
            oscilloX.ChangeLineColor("Vitesse X", Colors.Red);
            oscilloX.ChangeLineColor("Vitesse X Consigne", Colors.Blue);

            //oscilloTheta.SetTitle("Consigne / Vitesse Angulaire");
            oscilloTheta.AddOrUpdateLine(0, 100, "Vitesse Theta Consigne");
            oscilloTheta.AddOrUpdateLine(1, 500, "Vitesse Theta");
            //oscilloTheta.AddOrUpdateLine(2, 100, "Gyr Z");
            oscilloTheta.ChangeLineColor(1, Colors.Red);
            oscilloTheta.ChangeLineColor(0, Colors.Blue);

            //oscilloLidar.SetTitle("Lidar");
            oscilloLidar.AddOrUpdateLine(0, 20000, "Lidar RSSI", false);
            oscilloLidar.AddOrUpdateLine(1, 20000, "Lidar Distance");
            //oscilloLidar.AddOrUpdateLine(2, 20000, "Balise Points");
            oscilloLidar.ChangeLineColor(0, Colors.SeaGreen);
            oscilloLidar.ChangeLineColor(1, Colors.IndianRed);
            oscilloLidar.ChangeLineColor(2, Colors.LightGoldenrodYellow);

            asservPositionDisplay.SetTitle("Asservissement Position");
            asserv2WheelsSpeedDisplay.SetTitle("Asservissement Vitesse");
        }
 public int GetRank(GameMode mode, int score)
 {
     return(rank);
 }
Beispiel #58
0
    void Layout()
    {
        wyrds = new List <Wyrd>();
        GameObject go;
        Letter     lett;
        string     word;
        Vector3    pos;
        float      left        = 0;
        float      columnWidth = 3;
        char       c;
        Color      col;
        Wyrd       wyrd;

        int numRows = Mathf.RoundToInt(wordArea.height / letterSize);


        for (int i = 0; i < currLevel.subWords.Count; i++)
        {
            wyrd = new Wyrd();

            word = currLevel.subWords[i];


            columnWidth = Mathf.Max(columnWidth, word.Length);


            for (int j = 0; j < word.Length; j++)
            {
                c = word[j];

                go = Instantiate <GameObject>(PrefabLetter);

                go.transform.SetParent(letterAnchor);

                lett = go.GetComponent <Letter>();

                lett.c = c; // Set the c of the Letter


                pos = new Vector3(wordArea.x + left + j * letterSize, wordArea.y, 0);


                pos.y -= (i % numRows) * letterSize;

                lett.posImmediate = pos + Vector3.up * (20 + i % numRows);

                lett.pos       = pos;
                lett.timeStart = Time.time + i * 0.5f;

                go.transform.localScale = Vector3.one * letterSize;



                wyrd.Add(lett);
            }

            if (showAllWyrds)
            {
                wyrd.visible = true;
            }
            wyrd.color = wyrdPalette[word.Length - WordList.WORD_LENGTH_MIN];
            wyrds.Add(wyrd);


            if (i % numRows == numRows - 1)
            {
                left += (columnWidth + 0.5f) * letterSize;
            }
        }
        bigLetters = new List <Letter>();

        bigLettersActive = new List <Letter>();
        for (int i = 0; i < currLevel.word.Length; i++)
        {
            // This is similar to the process for a normal Letter

            c = currLevel.word[i];

            go = Instantiate <GameObject>(PrefabLetter);

            go.transform.SetParent(bigLetterAnchor);

            lett = go.GetComponent <Letter>();

            lett.c = c;

            go.transform.localScale = Vector3.one * bigLetterSize;



            // Set the initial position of the big Letters below screen

            pos             = new Vector3(0, -100, 0);
            lett.pos        = pos;
            lett.timeStart  = Time.time + currLevel.subWords.Count * 0.05f;
            lett.easingCuve = Easing.Sin + "-.18";
            col             = bigColorDim;
            lett.color      = col;
            lett.visible    = true; // This is always true for big letters
            lett.big        = true;
            bigLetters.Add(lett);
        }

        bigLetters = ShuffleLetters(bigLetters);

        ArrangeBigLetters();

        mode = GameMode.inLevel;
    }
Beispiel #59
0
 public void Gamemode(OpenPlayer player, GameMode gameMode)
 {
     player.SetGamemode(gameMode);
     player.SendMessage($"Gamemode set to: {gameMode}");
 }
Beispiel #60
0
 public void WordListParseComplete()
 {
     leveler++;
     mode      = GameMode.makeLevel;
     currLevel = MakeWordLevel();
 }