示例#1
0
 private void InitPropertyDescription()
 {
     if (SpellID > 0)
     {
         CharacterSpell characterSpell = SpellFactory.CreateCharacterSpell((ECharacterSpell)SpellID);
         if (characterSpell != null)
         {
             GameConfig game = ConfigManager.Instance.Game;
             Single     p_magicFactor;
             if (ScrollTier == 1)
             {
                 p_magicFactor = game.ScrollNoviceMagicFactor;
             }
             else if (ScrollTier == 2)
             {
                 p_magicFactor = game.ScrollExpertMagicFactor;
             }
             else if (ScrollTier == 3)
             {
                 p_magicFactor = game.ScrollMasterMagicFactor;
             }
             else
             {
                 p_magicFactor = game.ScrollGrandmasterMagicFactor;
             }
             m_properties["SCROLL_EFFECT"]            = characterSpell.NameKey;
             m_properties["SCROLL_SPELL_DESCRIPTION"] = characterSpell.GetDescription(p_magicFactor);
         }
     }
 }
示例#2
0
        public void Fill(CharacterSpell p_spell)
        {
            m_name.UpdateText(LocaManager.GetText(p_spell.NameKey));
            Single num = m_outerPadding + m_name.Size.y + m_innerPadding;

            m_itemSlot.SetSpell(p_spell.StaticData.Icon);
            m_itemSlot.HideItem();
            m_itemSlot.UpdatePosition(new Vector3(-m_name.Size.x / 2f, -num, 0f));
            m_description.MinHeight     = m_itemSlot.Size.y;
            m_description.VerticalAlign = TooltipGroup.Align.CENTER;
            if (p_spell.StaticData.ManaCost > 0)
            {
                m_description.UpdateText(LocaManager.GetText("SPELLBOOK_SPELL_MANA", p_spell.StaticData.ManaCost));
            }
            else
            {
                m_description.UpdateText(LocaManager.GetText("SPELL_DESCRIPTION_MANA_ALL"));
            }
            m_description.UpdatePositionY(-num);
            num += m_description.Size.y + m_innerPadding;
            Character selectedCharacter = LegacyLogic.Instance.WorldManager.Party.SelectedCharacter;
            Single    magicFactor       = p_spell.GetMagicFactor(selectedCharacter, false, 0);

            m_details.UpdateText(p_spell.GetDescription(magicFactor));
            m_details.UpdatePositionY(-num);
            num += m_details.Size.y + m_innerPadding;
            m_requirements.SetVisible(true);
            SkillStaticData staticData = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, (Int32)p_spell.StaticData.SkillID);
            String          text       = LocaManager.GetText(staticData.Name);
            String          text2      = LocaManager.GetText("SKILL_TIER_" + (Int32)p_spell.StaticData.Tier);
            Boolean         flag;

            if (p_spell.StaticData.ClassOnly == EClass.NONE)
            {
                flag = IsSkillRequirementFulfilled((Int32)p_spell.StaticData.SkillID, p_spell.StaticData.Tier);
                m_requirements.UpdateText(LocaManager.GetText("SKILL_TIER_REQUIREMENT_TT", text, text2));
            }
            else
            {
                flag = selectedCharacter.Class.IsAdvanced;
                String str = (selectedCharacter.Gender != EGender.MALE) ? "_F" : "_M";
                if (p_spell.StaticData.SkillID == ESkillID.SKILL_WARFARE)
                {
                    m_requirements.UpdateText(LocaManager.GetText("ABILITY_REQUIREMENT_ADVANCED_CLASS" + str, selectedCharacter.Name, LocaManager.GetText(selectedCharacter.Class.AdvancedNameKey + str)));
                }
                else
                {
                    m_requirements.UpdateText(LocaManager.GetText("SPELL_REQUIREMENT_ADVANCED_CLASS" + str, selectedCharacter.Name, LocaManager.GetText(selectedCharacter.Class.AdvancedNameKey + str)));
                }
            }
            m_requirements.UpdatePositionY(-num);
            m_requirements.Label.color = ((!flag) ? Color.red : Color.white);
            num += m_requirements.Size.y + m_innerPadding;
            m_background.Scale(m_name.Size.x + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }