public static Vector3 GetNext3Spells() { var spellList = ClassType.GetSpellList(9); var list = new List <byte>(); var array = spellList; for (var i = 0; i < array.Length; i++) { var item = array[i]; list.Add(item); } var num = list.IndexOf(Game.PlayerStats.Spell); list.Clear(); var array2 = new byte[3]; for (var j = 0; j < 3; j++) { array2[j] = spellList[num]; num++; if (num >= spellList.Length) { num = 0; } } return(new Vector3(array2[0], array2[1], array2[2])); }
private void RandomizeItem() { if (Game.PlayerStats.Class != 16 && Game.PlayerStats.Class != 17) { var spellList = ClassType.GetSpellList(Game.PlayerStats.Class); do { Spell = spellList[CDGMath.RandomInt(0, spellList.Length - 1)]; } while ((Game.PlayerStats.Traits.X == 31f || Game.PlayerStats.Traits.Y == 31f) && (Spell == 6 || Spell == 4 || Spell == 11)); Array.Clear(spellList, 0, spellList.Length); ID = Spell; } else if (Game.PlayerStats.Class == 16) { ID = 13; Spell = 13; } else if (Game.PlayerStats.Class == 17) { ID = 14; Spell = 14; } m_icon.ChangeSprite(SpellType.Icon(Spell)); }
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(); } }