Exemplo n.º 1
0
 public static PointClickerDaemon.PointClickerGameState LoadFromString(string save)
 {
     PointClickerDaemon.PointClickerGameState clickerGameState = new PointClickerDaemon.PointClickerGameState(0);
     string[] strArray = save.Split(Utils.newlineDelim);
     clickerGameState.points = Convert.ToInt64(strArray[0]);
     clickerGameState.currentStoryElement = Convert.ToInt32(strArray[1]);
     foreach (string str in strArray[2].Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries))
     {
         clickerGameState.upgradeCounts.Add(Convert.ToInt32(str));
     }
     return(clickerGameState);
 }
Exemplo n.º 2
0
        private void DrawWelcome(Rectangle bounds, SpriteBatch sb)
        {
            float     num1 = (float)this.logoRenderBase.Height / (float)this.logoRenderBase.Width;
            int       num2 = 45;
            Rectangle dest = new Rectangle(bounds.X - num2 + 20, bounds.Y, bounds.Width + num2, (int)((double)(bounds.Width + 2 * num2) * (double)num1));

            this.DrawLogo(dest, sb);
            Rectangle rectangle = new Rectangle(bounds.X, dest.Y + dest.Height, bounds.Width, 60);

            sb.Draw(this.scanlinesTextBackground, rectangle, Utils.AddativeWhite * 0.2f);
            for (int index = 0; index < this.Stars.Count; ++index)
            {
                this.DrawStar(rectangle, sb, this.Stars[index]);
            }
            rectangle.X     += 100;
            rectangle.Width  = bounds.Width - 200;
            rectangle.Y     += 13;
            rectangle.Height = 35;
            if (Button.doButton(98373721, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, "GO!", new Color?(Utils.AddativeWhite)))
            {
                this.activeState = (PointClickerDaemon.PointClickerGameState)null;
                string str = this.os.defaultUser.name.Replace(" ", "_");
                for (int index = 0; index < this.savesFolder.files.Count; ++index)
                {
                    if (this.savesFolder.files[index].name.StartsWith(str))
                    {
                        this.userFilePath = this.savesFolder.files[index].name;
                        this.activeState  = PointClickerDaemon.PointClickerGameState.LoadFromString(this.savesFolder.files[index].data);
                        break;
                    }
                }
                if (this.activeState == null)
                {
                    this.activeState = new PointClickerDaemon.PointClickerGameState(this.upgradeNames.Count);
                    FileEntry fileEntry = new FileEntry(this.activeState.ToSaveString(), str + ".pcsav");
                    this.savesFolder.files.Add(fileEntry);
                    this.userFilePath = fileEntry.name;
                }
                this.state       = PointClickerDaemon.PointClickerScreenState.Main;
                this.currentRate = 0.0f;
                this.ActiveStory = "";
                this.UpdateRate();
                this.UpdateStory();
                this.UpdatePoints();
            }
            if (!Button.doButton(98373732, bounds.X + 2, bounds.Y + bounds.Height - 19, 180, 18, LocaleTerms.Loc("Exit") + "  :<", new Color?(this.os.lockedColor)))
            {
                return;
            }
            this.os.display.command = "connect";
        }
Exemplo n.º 3
0
 private void AddSaveForName(string name, bool isSuperHighScore = false)
 {
     PointClickerDaemon.PointClickerGameState clickerGameState = new PointClickerDaemon.PointClickerGameState(this.upgradeValues.Count);
     for (int index = 0; index < clickerGameState.upgradeCounts.Count; ++index)
     {
         clickerGameState.upgradeCounts[index] = (int)(10.0 * ((double)Utils.randm(1f) * ((double)index / (double)clickerGameState.upgradeCounts.Count)));
         if (isSuperHighScore)
         {
             clickerGameState.upgradeCounts[index] = 900 + (int)((double)Utils.randm(1f) * 99.9000015258789);
         }
     }
     clickerGameState.points = (long)Utils.random.Next();
     clickerGameState.currentStoryElement = Utils.random.Next(this.storyBeats.Count);
     this.savesFolder.files.Add(new FileEntry(clickerGameState.ToSaveString(), name + ".pcsav"));
 }