コード例 #1
0
        private void LoadFrontCardStats(PlayerObj player)
        {
            m_frontTrait1.Visible = false;
            m_frontTrait2.Visible = false;
            var b = (byte)Game.PlayerStats.Traits.X;

            if (b != 0)
            {
                m_frontTrait1.Text    = TraitType.ToString(b) + ": " + TraitType.ProfileCardDescription(b);
                m_frontTrait1.Visible = true;
            }
            var b2 = (byte)Game.PlayerStats.Traits.Y;

            if (b2 != 0)
            {
                m_frontTrait2.Y = m_frontTrait1.Y;
                if (b != 0)
                {
                    m_frontTrait2.Y -= 20f;
                }
                m_frontTrait2.Text    = TraitType.ToString(b2) + ": " + TraitType.ProfileCardDescription(b2);
                m_frontTrait2.Visible = true;
            }
            m_playerName.Text  = Game.PlayerStats.PlayerName;
            m_playerStats.Text = (int)(player.Damage / 20f) + "/" + (int)(player.MaxHealth / 50f);
            m_levelClass.Text  = string.Concat("Lv. ", Game.PlayerStats.CurrentLevel, " - ",
                                               ClassType.ToString(Game.PlayerStats.Class, Game.PlayerStats.IsFemale));
            m_money.Text            = Game.PlayerStats.Gold.ToString();
            m_classDescription.Text = ClassType.ProfileCardDescription(Game.PlayerStats.Class);
        }
コード例 #2
0
        private void CheckSaveHeaders(ObjContainer container, byte profile)
        {
            var textObj  = container.GetChildAt(1) as TextObj;
            var textObj2 = container.GetChildAt(3) as TextObj;
            var textObj3 = container.GetChildAt(4) as TextObj;

            textObj2.Text = "";
            textObj3.Text = "";
            string text      = null;
            byte   classType = 0;
            var    num       = 0;
            var    flag      = false;
            var    num2      = 0;

            try
            {
                (ScreenManager.Game as Game).SaveManager.GetSaveHeader(profile, out classType, out text, out num,
                                                                       out flag, out num2);
                if (text == null)
                {
                    textObj.Text = "- START NEW LEGACY -";
                    container.ID = 0;
                }
                else
                {
                    var isFemale = text.Contains("Lady");
                    if (!flag)
                    {
                        textObj.Text = text + " the " + ClassType.ToString(classType, isFemale);
                    }
                    else
                    {
                        textObj.Text = text + " the Deceased";
                    }
                    textObj2.Text = "Lvl. " + num;
                    if (num2 > 0)
                    {
                        textObj3.Text = "NG+ " + num2;
                    }
                    container.ID = 1;
                }
            }
            catch
            {
                textObj.Text = "- START NEW LEGACY -";
                container.ID = 0;
            }
        }
コード例 #3
0
        public void UpdateClassRank()
        {
            var text = "the ";

            if (BeatenABoss)
            {
                text += "Legendary ";
            }
            else if (NumEnemiesKilled < 5)
            {
                text += "Useless ";
            }
            else if (NumEnemiesKilled >= 5 && NumEnemiesKilled < 10)
            {
                text += "Feeble ";
            }
            else if (NumEnemiesKilled >= 10 && NumEnemiesKilled < 15)
            {
                text += "Determined ";
            }
            else if (NumEnemiesKilled >= 15 && NumEnemiesKilled < 20)
            {
                text += "Stout ";
            }
            else if (NumEnemiesKilled >= 20 && NumEnemiesKilled < 25)
            {
                text += "Gallant ";
            }
            else if (NumEnemiesKilled >= 25 && NumEnemiesKilled < 30)
            {
                text += "Valiant ";
            }
            else if (NumEnemiesKilled >= 30 && NumEnemiesKilled < 35)
            {
                text += "Heroic ";
            }
            else
            {
                text += "Divine ";
            }
            text += ClassType.ToString(Class, IsFemale);
            m_classTextObj.Text = text;
        }
コード例 #4
0
        private void UpdateDescriptionPlate()
        {
            var lineageObj = m_currentBranchArray[m_selectedLineageIndex];
            var textObj    = m_descriptionPlate.GetChildAt(1) as TextObj;

            textObj.Text = lineageObj.PlayerName;
            var textObj2 = m_descriptionPlate.GetChildAt(2) as TextObj;

            textObj2.Text = "Class - " + ClassType.ToString(lineageObj.Class, lineageObj.IsFemale);
            var keyIconTextObj = m_descriptionPlate.GetChildAt(3) as KeyIconTextObj;

            keyIconTextObj.Text = ClassType.Description(lineageObj.Class);
            keyIconTextObj.WordWrap(340);
            var textObj3 = m_descriptionPlate.GetChildAt(4) as TextObj;

            textObj3.Y = keyIconTextObj.Y + keyIconTextObj.Height + 5f;
            var textObj4 = m_descriptionPlate.GetChildAt(5) as TextObj;

            textObj4.Y = textObj3.Y + 30f;
            var num = (int)textObj3.Y;

            if (lineageObj.Traits.X > 0f)
            {
                textObj3.Text = "Trait - " + TraitType.ToString((byte)lineageObj.Traits.X);
                textObj4.Text = TraitType.Description((byte)lineageObj.Traits.X, lineageObj.IsFemale);
                textObj4.WordWrap(340);
                num = (int)textObj4.Y + textObj4.Height + 5;
            }
            else
            {
                num           = (int)textObj3.Y + textObj3.Height + 5;
                textObj3.Text = "Traits - None";
                textObj4.Text = "";
            }
            var textObj5 = m_descriptionPlate.GetChildAt(6) as TextObj;

            textObj5.Y = textObj4.Y + textObj4.Height + 5f;
            var textObj6 = m_descriptionPlate.GetChildAt(7) as TextObj;

            textObj6.Y = textObj5.Y + 30f;
            if (lineageObj.Traits.Y > 0f)
            {
                textObj5.Text = "Trait - " + TraitType.ToString((byte)lineageObj.Traits.Y);
                textObj6.Text = TraitType.Description((byte)lineageObj.Traits.Y, lineageObj.IsFemale);
                textObj6.WordWrap(340);
                num = (int)textObj6.Y + textObj6.Height + 5;
            }
            else
            {
                textObj5.Text = "";
                textObj6.Text = "";
            }
            var textObj7 = m_descriptionPlate.GetChildAt(8) as TextObj;

            textObj7.Text = "Spell - " + SpellType.ToString(lineageObj.Spell);
            textObj7.Y    = num;
            var keyIconTextObj2 = m_descriptionPlate.GetChildAt(9) as KeyIconTextObj;

            keyIconTextObj2.Text = SpellType.Description(lineageObj.Spell);
            keyIconTextObj2.Y    = textObj7.Y + 30f;
            keyIconTextObj2.WordWrap(340);
        }
コード例 #5
0
        public LineageObj(LineageScreen screen, bool createEmpty = false)
        {
            Name                                      = "";
            m_frameSprite                             = new SpriteObj("LineageScreenFrame_Sprite");
            m_frameSprite.Scale                       = new Vector2(2.8f, 2.8f);
            m_frameSprite.DropShadow                  = new Vector2(4f, 6f);
            m_plaqueSprite                            = new SpriteObj("LineageScreenPlaque1Long_Sprite");
            m_plaqueSprite.Scale                      = new Vector2(1.8f, 2f);
            m_playerSprite                            = new ObjContainer("PlayerIdle_Character");
            m_playerSprite.AnimationDelay             = 0.1f;
            m_playerSprite.Scale                      = new Vector2(2f, 2f);
            m_playerSprite.OutlineWidth               = 2;
            m_playerSprite.GetChildAt(10).Visible     = false;
            m_playerSprite.GetChildAt(11).Visible     = false;
            m_playerSprite.GetChildAt(1).TextureColor = Color.Red;
            m_playerSprite.GetChildAt(7).TextureColor = Color.Red;
            m_playerSprite.GetChildAt(14).Visible     = false;
            m_playerSprite.GetChildAt(16).Visible     = false;
            var textureColor = new Color(251, 156, 172);

            m_playerSprite.GetChildAt(13).TextureColor = textureColor;
            m_playerName               = new TextObj(Game.JunicodeFont);
            m_playerName.FontSize      = 10f;
            m_playerName.Text          = "Sir Skunky IV";
            m_playerName.Align         = Types.TextAlign.Centre;
            m_playerName.OutlineColour = new Color(181, 142, 39);
            m_playerName.OutlineWidth  = 2;
            m_playerName.Y             = m_textYPos;
            m_playerName.LimitCorners  = true;
            AddChild(m_playerName);
            m_classTextObj               = new TextObj(Game.JunicodeFont);
            m_classTextObj.FontSize      = 8f;
            m_classTextObj.Align         = Types.TextAlign.Centre;
            m_classTextObj.OutlineColour = new Color(181, 142, 39);
            m_classTextObj.OutlineWidth  = 2;
            m_classTextObj.Text          = "the Knight";
            m_classTextObj.Y             = m_playerName.Y + m_playerName.Height - 8f;
            m_classTextObj.LimitCorners  = true;
            AddChild(m_classTextObj);
            m_trait1Title               = new TextObj(Game.JunicodeFont);
            m_trait1Title.FontSize      = 8f;
            m_trait1Title.Align         = Types.TextAlign.Centre;
            m_trait1Title.OutlineColour = new Color(181, 142, 39);
            m_trait1Title.OutlineWidth  = 2;
            m_trait1Title.Y             = m_classTextObj.Y + m_classTextObj.Height + 5f;
            m_trait1Title.Text          = "";
            m_trait1Title.LimitCorners  = true;
            AddChild(m_trait1Title);
            m_trait2Title              = (m_trait1Title.Clone() as TextObj);
            m_trait2Title.Y           += 20f;
            m_trait2Title.Text         = "";
            m_trait2Title.LimitCorners = true;
            AddChild(m_trait2Title);
            m_ageText              = (m_trait1Title.Clone() as TextObj);
            m_ageText.Text         = "xxx - xxx";
            m_ageText.Visible      = false;
            m_ageText.LimitCorners = true;
            AddChild(m_ageText);
            m_spellIcon = new SpriteObj("Blank_Sprite");
            m_spellIcon.OutlineWidth = 1;
            m_spellIconHolder        = new SpriteObj("BlacksmithUI_IconBG_Sprite");
            if (!createEmpty)
            {
                IsFemale = false;
                if (CDGMath.RandomInt(0, 1) > 0)
                {
                    IsFemale = true;
                }
                if (IsFemale)
                {
                    CreateFemaleName(screen);
                }
                else
                {
                    CreateMaleName(screen);
                }
                Traits = TraitType.CreateRandomTraits();
                Class  = ClassType.GetRandomClass();
                m_classTextObj.Text = "the " + ClassType.ToString(Class, IsFemale);
                while (Class == 7 || Class == 15)
                {
                    if (Traits.X != 12f && Traits.Y != 12f)
                    {
                        break;
                    }
                    Traits = TraitType.CreateRandomTraits();
                }
                while ((Class == 1 || Class == 9 || Class == 16) && (Traits.X == 31f || Traits.Y == 31f))
                {
                    Traits = TraitType.CreateRandomTraits();
                }
                var spellList = ClassType.GetSpellList(Class);
                do
                {
                    Spell = spellList[CDGMath.RandomInt(0, spellList.Length - 1)];
                } while ((Spell == 11 || Spell == 4 || Spell == 6) && (Traits.X == 31f || Traits.Y == 31f));
                Array.Clear(spellList, 0, spellList.Length);
                Age      = (byte)CDGMath.RandomInt(18, 30);
                ChildAge = (byte)CDGMath.RandomInt(2, 5);
                UpdateData();
            }
        }
コード例 #6
0
 public void UpdateData()
 {
     SetTraits(Traits);
     if (Traits.X == 8f || Traits.Y == 8f)
     {
         m_playerSprite.GetChildAt(7).Visible = false;
     }
     if (Traits.X == 20f || Traits.Y == 20f)
     {
         FlipPortrait = true;
     }
     m_classTextObj.Text = "the " + ClassType.ToString(Class, IsFemale);
     m_spellIcon.ChangeSprite(SpellType.Icon(Spell));
     if (Class == 0 || Class == 8)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleShield_Sprite");
     }
     else if (Class == 5 || Class == 13)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleLamp_Sprite");
     }
     else if (Class == 1 || Class == 9)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleBeard_Sprite");
     }
     else if (Class == 4 || Class == 12)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleHeadband_Sprite");
     }
     else if (Class == 2 || Class == 10)
     {
         m_playerSprite.GetChildAt(15).Visible = true;
         m_playerSprite.GetChildAt(15).ChangeSprite("PlayerIdleHorns_Sprite");
     }
     else
     {
         m_playerSprite.GetChildAt(15).Visible = false;
     }
     m_playerSprite.GetChildAt(0).Visible = false;
     if (Class == 16)
     {
         m_playerSprite.GetChildAt(0).Visible = true;
         m_playerSprite.GetChildAt(12).ChangeSprite("PlayerIdleHead" + 6 + "_Sprite");
     }
     if (Class == 17)
     {
         m_playerSprite.GetChildAt(12).ChangeSprite("PlayerIdleHead" + 7 + "_Sprite");
     }
     if (!IsFemale)
     {
         m_playerSprite.GetChildAt(5).Visible  = false;
         m_playerSprite.GetChildAt(13).Visible = false;
     }
     else
     {
         m_playerSprite.GetChildAt(5).Visible  = true;
         m_playerSprite.GetChildAt(13).Visible = true;
     }
     if (Traits.X == 6f || Traits.Y == 6f)
     {
         m_playerSprite.Scale = new Vector2(3f, 3f);
     }
     if (Traits.X == 7f || Traits.Y == 7f)
     {
         m_playerSprite.Scale = new Vector2(1.35f, 1.35f);
     }
     if (Traits.X == 10f || Traits.Y == 10f)
     {
         m_playerSprite.ScaleX *= 0.825f;
         m_playerSprite.ScaleY *= 1.25f;
     }
     if (Traits.X == 9f || Traits.Y == 9f)
     {
         m_playerSprite.ScaleX *= 1.25f;
         m_playerSprite.ScaleY *= 1.175f;
     }
     if (Class == 6 || Class == 14)
     {
         m_playerSprite.OutlineColour = Color.White;
         return;
     }
     m_playerSprite.OutlineColour = Color.Black;
 }
コード例 #7
0
        public override void OnEnter()
        {
            UpdatePauseScreenIcons();
            m_inputDelay = 0.5f;
            if (SoundManager.IsMusicPlaying)
            {
                SoundManager.PauseMusic();
            }
            SoundManager.PlaySound("Pause_Toggle");
            var levelScreen = (ScreenManager as RCScreenManager).GetLevelScreen();

            foreach (var current in m_infoObjList)
            {
                current.Reset();
                current.Visible = false;
            }
            var player       = (ScreenManager as RCScreenManager).Player;
            var pauseInfoObj = m_infoObjList[0];

            pauseInfoObj.Visible = true;
            pauseInfoObj.AddItem("Class: ", ClassType.ToString(Game.PlayerStats.Class, Game.PlayerStats.IsFemale));
            pauseInfoObj.AddItem("Strength: ", player.Damage.ToString());
            pauseInfoObj.AddItem("Magic: ", player.TotalMagicDamage.ToString());
            pauseInfoObj.AddItem("Armor: ", player.TotalArmor.ToString());
            pauseInfoObj.ResizePlate();
            pauseInfoObj.X = player.X - Camera.TopLeftCorner.X;
            pauseInfoObj.Y = player.Bounds.Bottom - Camera.TopLeftCorner.Y + pauseInfoObj.Height / 2f - 20f;
            if (!Game.PlayerStats.TutorialComplete)
            {
                pauseInfoObj.SetName("?????");
            }
            else
            {
                pauseInfoObj.SetName(Game.PlayerStats.PlayerName);
            }
            pauseInfoObj.SetNamePosition(new Vector2(pauseInfoObj.X, player.Bounds.Top - Camera.TopLeftCorner.Y - 40f));
            pauseInfoObj.Visible = player.Visible;
            var num = m_infoObjList.Count - 1;

            for (var i = num;
                 i < levelScreen.CurrentRoom.EnemyList.Count + levelScreen.CurrentRoom.TempEnemyList.Count;
                 i++)
            {
                m_infoObjList.Add(new PauseInfoObj
                {
                    Visible = false
                });
            }
            for (var j = 1; j < levelScreen.CurrentRoom.EnemyList.Count + 1; j++)
            {
                var enemyObj = levelScreen.CurrentRoom.EnemyList[j - 1];
                if (!enemyObj.NonKillable && !enemyObj.IsKilled && enemyObj.Visible)
                {
                    var pauseInfoObj2 = m_infoObjList[j];
                    pauseInfoObj2.Visible = true;
                    if (!LevelEV.CREATE_RETAIL_VERSION)
                    {
                        pauseInfoObj2.AddItem("Level: ", enemyObj.Level.ToString());
                    }
                    else
                    {
                        pauseInfoObj2.AddItem("Level: ", ((int)(enemyObj.Level * 2.75f)).ToString());
                    }
                    pauseInfoObj2.AddItem("Strength: ", enemyObj.Damage.ToString());
                    pauseInfoObj2.AddItem("Health: ", enemyObj.CurrentHealth + "/" + enemyObj.MaxHealth);
                    pauseInfoObj2.ResizePlate();
                    pauseInfoObj2.X = enemyObj.X - Camera.TopLeftCorner.X;
                    pauseInfoObj2.Y = enemyObj.Bounds.Bottom - Camera.TopLeftCorner.Y + pauseInfoObj2.Height / 2f - 20f;
                    pauseInfoObj2.SetName(enemyObj.Name);
                    pauseInfoObj2.SetNamePosition(new Vector2(pauseInfoObj2.X,
                                                              enemyObj.Bounds.Top - Camera.TopLeftCorner.Y - 40f));
                }
            }
            var count = levelScreen.CurrentRoom.EnemyList.Count;

            for (var k = 0; k < levelScreen.CurrentRoom.TempEnemyList.Count; k++)
            {
                var enemyObj2 = levelScreen.CurrentRoom.TempEnemyList[k];
                if (!enemyObj2.NonKillable && !enemyObj2.IsKilled)
                {
                    var pauseInfoObj3 = m_infoObjList[k + 1 + count];
                    pauseInfoObj3.Visible = true;
                    if (!LevelEV.CREATE_RETAIL_VERSION)
                    {
                        pauseInfoObj3.AddItem("Level: ", enemyObj2.Level.ToString());
                    }
                    else
                    {
                        pauseInfoObj3.AddItem("Level: ", ((int)(enemyObj2.Level * 2.75f)).ToString());
                    }
                    pauseInfoObj3.AddItem("Strength: ", enemyObj2.Damage.ToString());
                    pauseInfoObj3.AddItem("Health: ", enemyObj2.CurrentHealth + "/" + enemyObj2.MaxHealth);
                    pauseInfoObj3.ResizePlate();
                    pauseInfoObj3.X = enemyObj2.X - Camera.TopLeftCorner.X;
                    pauseInfoObj3.Y = enemyObj2.Bounds.Bottom - Camera.TopLeftCorner.Y + pauseInfoObj3.Height / 2f - 20f;
                    pauseInfoObj3.SetName(enemyObj2.Name);
                    pauseInfoObj3.SetNamePosition(new Vector2(pauseInfoObj3.X,
                                                              enemyObj2.Bounds.Top - Camera.TopLeftCorner.Y - 40f));
                }
            }
            base.OnEnter();
        }