Exemplo n.º 1
0
 private void CreateLineageObjDebug()
 {
     int num = 700;
     int num2 = 400;
     int num3 = 0;
     for (int i = 0; i < 10; i++)
     {
         FamilyTreeNode familyTreeNode;
         if (i > Game.PlayerStats.FamilyTreeArray.Count - 1)
         {
             familyTreeNode = new FamilyTreeNode
             {
                 Age = (byte)CDGMath.RandomInt(15, 30),
                 ChildAge = (byte)CDGMath.RandomInt(15, 30),
                 Name = Game.NameArray[CDGMath.RandomInt(0, Game.NameArray.Count - 1)],
                 HeadPiece = (byte)CDGMath.RandomInt(1, 5),
                 ShoulderPiece = (byte)CDGMath.RandomInt(1, 5),
                 ChestPiece = (byte)CDGMath.RandomInt(1, 5)
             };
         }
         else
         {
             familyTreeNode = Game.PlayerStats.FamilyTreeArray[i];
         }
         LineageObj lineageObj = new LineageObj(null, true);
         lineageObj.IsDead = true;
         lineageObj.Age = familyTreeNode.Age;
         lineageObj.ChildAge = familyTreeNode.ChildAge;
         lineageObj.Class = familyTreeNode.Class;
         lineageObj.PlayerName = familyTreeNode.Name;
         lineageObj.IsFemale = familyTreeNode.IsFemale;
         lineageObj.SetPortrait(familyTreeNode.HeadPiece, familyTreeNode.ShoulderPiece, familyTreeNode.ChestPiece);
         lineageObj.NumEnemiesKilled = familyTreeNode.NumEnemiesBeaten;
         lineageObj.BeatenABoss = familyTreeNode.BeatenABoss;
         lineageObj.SetTraits(familyTreeNode.Traits);
         lineageObj.UpdateAge(num);
         lineageObj.UpdateData();
         lineageObj.UpdateClassRank();
         num += (int)lineageObj.Age;
         lineageObj.X = (float)num3;
         num3 += num2;
         this.m_lineageArray.Add(lineageObj);
     }
 }
Exemplo n.º 2
0
 public override void OnEnter()
 {
     this.m_playerFrame.Opacity = 0f;
     this.m_playerFrame.Position = this.m_player.Position;
     this.m_playerFrame.SetTraits(Game.PlayerStats.Traits);
     this.m_playerFrame.IsFemale = Game.PlayerStats.IsFemale;
     this.m_playerFrame.Class = Game.PlayerStats.Class;
     this.m_playerFrame.Y -= 120f;
     this.m_playerFrame.SetPortrait(Game.PlayerStats.HeadPiece, Game.PlayerStats.ShoulderPiece, Game.PlayerStats.ChestPiece);
     this.m_playerFrame.UpdateData();
     Tween.To(this.m_playerFrame, 1f, new Easing(Tween.EaseNone), new string[]
     {
         "delay",
         "4",
         "Opacity",
         "1"
     });
     FamilyTreeNode item = new FamilyTreeNode
     {
         Name = Game.PlayerStats.PlayerName,
         Age = Game.PlayerStats.Age,
         ChildAge = Game.PlayerStats.ChildAge,
         Class = Game.PlayerStats.Class,
         HeadPiece = Game.PlayerStats.HeadPiece,
         ChestPiece = Game.PlayerStats.ChestPiece,
         ShoulderPiece = Game.PlayerStats.ShoulderPiece,
         NumEnemiesBeaten = Game.PlayerStats.NumEnemiesBeaten,
         BeatenABoss = Game.PlayerStats.NewBossBeaten,
         Traits = Game.PlayerStats.Traits,
         IsFemale = Game.PlayerStats.IsFemale
     };
     Vector2 traits = Game.PlayerStats.Traits;
     Game.PlayerStats.FamilyTreeArray.Add(item);
     if (Game.PlayerStats.CurrentBranches != null)
     {
         Game.PlayerStats.CurrentBranches.Clear();
     }
     Game.PlayerStats.IsDead = true;
     Game.PlayerStats.Traits = Vector2.Zero;
     Game.PlayerStats.NewBossBeaten = false;
     Game.PlayerStats.RerolledChildren = false;
     Game.PlayerStats.HasArchitectFee = false;
     Game.PlayerStats.NumEnemiesBeaten = 0;
     Game.PlayerStats.LichHealth = 0;
     Game.PlayerStats.LichMana = 0;
     Game.PlayerStats.LichHealthMod = 1f;
     Game.PlayerStats.TimesDead++;
     Game.PlayerStats.LoadStartingRoom = true;
     Game.PlayerStats.EnemiesKilledInRun.Clear();
     if (Game.PlayerStats.SpecialItem != 1 && Game.PlayerStats.SpecialItem != 9 && Game.PlayerStats.SpecialItem != 10 && Game.PlayerStats.SpecialItem != 11 && Game.PlayerStats.SpecialItem != 12 && Game.PlayerStats.SpecialItem != 13)
     {
         Game.PlayerStats.SpecialItem = 0;
     }
     (base.ScreenManager.Game as Game).SaveManager.SaveFiles(new SaveType[]
     {
         SaveType.PlayerData,
         SaveType.Lineage,
         SaveType.MapData
     });
     (base.ScreenManager.Game as Game).SaveManager.SaveAllFileTypes(true);
     Game.PlayerStats.Traits = traits;
     if (Game.PlayerStats.TimesDead >= 20)
     {
         GameUtil.UnlockAchievement("FEAR_OF_LIFE");
     }
     SoundManager.StopMusic(0.5f);
     this.m_droppingStats = false;
     this.m_lockControls = false;
     SoundManager.PlaySound("Player_Death_FadeToBlack");
     this.m_continueText.Text = "Press [Input:" + 0 + "] to move on";
     this.m_player.Visible = true;
     this.m_player.Opacity = 1f;
     this.m_continueText.Opacity = 0f;
     this.m_dialoguePlate.Opacity = 0f;
     this.m_playerGhost.Opacity = 0f;
     this.m_spotlight.Opacity = 0f;
     this.m_playerGhost.Position = new Vector2(this.m_player.X - (float)(this.m_playerGhost.Width / 2), (float)(this.m_player.Bounds.Top - 20));
     Tween.RunFunction(3f, typeof(SoundManager), "PlaySound", new object[]
     {
         "Player_Ghost"
     });
     Tween.To(this.m_playerGhost, 0.5f, new Easing(Linear.EaseNone), new string[]
     {
         "delay",
         "3",
         "Opacity",
         "0.4"
     });
     Tween.By(this.m_playerGhost, 2f, new Easing(Linear.EaseNone), new string[]
     {
         "delay",
         "3",
         "Y",
         "-150"
     });
     this.m_playerGhost.Opacity = 0.4f;
     Tween.To(this.m_playerGhost, 0.5f, new Easing(Linear.EaseNone), new string[]
     {
         "delay",
         "4",
         "Opacity",
         "0"
     });
     this.m_playerGhost.Opacity = 0f;
     this.m_playerGhost.PlayAnimation(true);
     Tween.To(this, 0.5f, new Easing(Linear.EaseNone), new string[]
     {
         "BackBufferOpacity",
         "1"
     });
     Tween.To(this.m_spotlight, 0.1f, new Easing(Linear.EaseNone), new string[]
     {
         "delay",
         "1",
         "Opacity",
         "1"
     });
     Tween.AddEndHandlerToLastTween(typeof(SoundManager), "PlaySound", new object[]
     {
         "Player_Death_Spotlight"
     });
     Tween.RunFunction(1.2f, typeof(SoundManager), "PlayMusic", new object[]
     {
         "GameOverStinger",
         false,
         0.5f
     });
     Tween.To(base.Camera, 1f, new Easing(Quad.EaseInOut), new string[]
     {
         "X",
         this.m_player.AbsX.ToString(),
         "Y",
         (this.m_player.Bounds.Bottom - 10).ToString(),
         "Zoom",
         "1"
     });
     Tween.RunFunction(2f, this.m_player, "RunDeathAnimation1", new object[0]);
     if (Game.PlayerStats.Traits.X == 13f || Game.PlayerStats.Traits.Y == 13f)
     {
         (this.m_dialoguePlate.GetChildAt(2) as TextObj).Text = "#)!(%*#@!%^";
         (this.m_dialoguePlate.GetChildAt(2) as TextObj).RandomizeSentence(true);
     }
     else
     {
         (this.m_dialoguePlate.GetChildAt(2) as TextObj).Text = GameEV.GAME_HINTS[CDGMath.RandomInt(0, GameEV.GAME_HINTS.Length - 1)];
     }
     (this.m_dialoguePlate.GetChildAt(3) as TextObj).Text = "-" + Game.PlayerStats.PlayerName + "'s Parting Words";
     Tween.To(this.m_dialoguePlate, 0.5f, new Easing(Tween.EaseNone), new string[]
     {
         "delay",
         "2",
         "Opacity",
         "1"
     });
     Tween.RunFunction(4f, this, "DropStats", new object[0]);
     Tween.To(this.m_continueText, 0.4f, new Easing(Linear.EaseNone), new string[]
     {
         "delay",
         "4",
         "Opacity",
         "1"
     });
     base.OnEnter();
 }
Exemplo n.º 3
0
 public void SetPlayerData()
 {
     FamilyTreeNode item = new FamilyTreeNode
     {
         Name = Game.PlayerStats.PlayerName,
         Age = Game.PlayerStats.Age,
         ChildAge = Game.PlayerStats.ChildAge,
         Class = Game.PlayerStats.Class,
         HeadPiece = Game.PlayerStats.HeadPiece,
         ChestPiece = Game.PlayerStats.ChestPiece,
         ShoulderPiece = Game.PlayerStats.ShoulderPiece,
         NumEnemiesBeaten = Game.PlayerStats.NumEnemiesBeaten,
         BeatenABoss = true,
         Traits = Game.PlayerStats.Traits,
         IsFemale = Game.PlayerStats.IsFemale
     };
     Game.PlayerStats.FamilyTreeArray.Add(item);
     Game.PlayerStats.NewBossBeaten = false;
     Game.PlayerStats.RerolledChildren = false;
     Game.PlayerStats.NumEnemiesBeaten = 0;
     Game.PlayerStats.LichHealth = 0;
     Game.PlayerStats.LichMana = 0;
     Game.PlayerStats.LichHealthMod = 1f;
     Game.PlayerStats.LoadStartingRoom = true;
     Game.PlayerStats.LastbossBeaten = true;
     Game.PlayerStats.CharacterFound = false;
     Game.PlayerStats.TimesCastleBeaten++;
     (this.m_target.AttachedLevel.ScreenManager.Game as Game).SaveManager.SaveFiles(new SaveType[]
     {
         SaveType.PlayerData
     });
 }
Exemplo n.º 4
0
 private void InitializeFirstChild()
 {
     FamilyTreeNode item = new FamilyTreeNode
     {
         Name = "Johannes",
         Age = 30,
         ChildAge = 20,
         Class = 0,
         HeadPiece = 8,
         ChestPiece = 1,
         ShoulderPiece = 1,
         NumEnemiesBeaten = 0,
         BeatenABoss = true,
         IsFemale = false,
         Traits = Vector2.Zero
     };
     this.FamilyTreeArray.Add(item);
 }