예제 #1
0
        public int GetInfoColour( BaseFeat skill )
        {
            if( skill.HasThisFeat(m_Viewed) )
                return m_AcquiredFeat;

            return (skill.MeetsOurRequirements(m_Viewed) == true ? m_AvailableFeat : m_UnavailableFeat);
        }
예제 #2
0
        public void AddPurchaseInfo( BaseFeat skill )
        {
            string description = "Click on the golden check box in front of a skill to see its description or click on Next to see what skills it gives access to.";
            string name = "Skills";

            if( skill != null )
            {
                name = skill.Name;
                description = skill.FullDescription;

                if( m_Viewed != null && !skill.ShouldDisplayTo( m_Viewer ) )
                {
                    name = "???";
                    description = "???";
                }

                else if( m_Viewed != null && skill.ShouldDisplayTo( m_Viewer ) && skill is VampireAbilities )
                    description = "Use .vp for more info.";

                if( skill.CostLevel > FeatCost.None )
                {
                    AddButton( 512, 104, (skill.Level < 1 ? m_UnselectedSkill1 : m_SelectedSkill1), m_SelectedSkill1, (int)Buttons.Skill1, GumpButtonType.Reply, 0 );
                    AddButton( 512, 144, (skill.Level < 2 ? m_UnselectedSkill2 : m_SelectedSkill2), m_SelectedSkill2, (int)Buttons.Skill2, GumpButtonType.Reply, 0 );
                    AddButton( 512, 182, (skill.Level < 3 ? m_UnselectedSkill3 : m_SelectedSkill3), m_SelectedSkill3, (int)Buttons.Skill3, GumpButtonType.Reply, 0 );
                }
            }

            int labelOffset = Math.Max( 0, (60 - (name.Length * 3)) );
            int htmlOffset = (skill == null ? 33 : 0);

            AddHtml( 247, 98, 258 + htmlOffset, 125, description, (bool)true, (bool)true );
            AddLabel( 330 + labelOffset, 48, 2010, name );
        }
예제 #3
0
        public void AddSlaveInfo( BaseFeat[] list )
        {
            int height = 365;
            string name = "";

            for( int i = 0; (i + (m_Scroll * m_FeatsPerPage)) < list.Length && i < m_FeatsPerPage; i++ )
            {
                BaseFeat skill = list[i + (m_Scroll * m_FeatsPerPage)];

                if( m_Viewed != null && !skill.ShouldDisplayTo(m_Viewer) )
                    name = "???";

                else
                    name = skill.Name;

                AddLabel( 309, height, 0, name );
                AddButton( 272, (height + 2), GetCheckBox( skill.ListName ), m_UnselectedCheckBox, (i + (int)Buttons.PickSlave1), GumpButtonType.Reply, 0 );
                AddImage( 291, (height + 5), GetInfoColour(skill) );

                if( skill.Allows.Length > 0 )
                    AddButton( 455, (height + 2), 2469, 2470, (i + (int)Buttons.Next1), GumpButtonType.Reply, 0 );

                height += 30;
            }

            if( m_Scroll > 0 )
                AddButton( 489, 328, 250, 251, (int)Buttons.ScrollUp, GumpButtonType.Reply, 0 );

            if( list.Length > ((m_Scroll * m_FeatsPerPage) + m_FeatsPerPage) )
                AddButton( 489, 515, 252, 253, (int)Buttons.ScrollDown, GumpButtonType.Reply, 0 );
        }
예제 #4
0
        public static void WriteWebpage( BaseFeat skill )
        {
            string fileName = OldPages == true ? skill.Name.Replace(" ", "") : skill.Name.Replace(" ", "_").ToLower();
            string extension = OldPages == true ? ".htm" : ".txt";

            using ( StreamWriter op = new StreamWriter( Misc.StatusPage.WebFolder + WikiFolder + fileName + extension ) )
            {
                if( OldPages )
                {
                    op.WriteLine( "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" );
                    op.WriteLine( "<html xmlns=\"http://www.w3.org/1999/xhtml\">" );
                    op.WriteLine( "<head>" );
                    op.WriteLine( "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />" );
                    op.WriteLine( "<title>" + skill.Name + "</title>" );
                    op.WriteLine( "<link href=\"styles.css\" rel=\"stylesheet\" type=\"text/css\" />" );
                    op.WriteLine( "<style type=\"text/css\"></style></head><body><div id=\"main\">" );
                    op.WriteLine( GetWebpageDescription(skill) );
                    op.WriteLine( "</div></body></html>" );
                }

                else
                    PublishWikiPage( skill, op );
            }
        }
예제 #5
0
        public bool CanKeepThisFeatWithout( PlayerMobile m, BaseFeat toRemove )
        {
            if( IgnoreThisFeatWhenRemovingParent( m ) )
                return true;

            if( CostLevel == FeatCost.None )
            {
                for( int i = 0; i < toRemove.AssociatedFeats.Length; i++ )
                {
                    if( toRemove.AssociatedFeats[i] == ListName )
                        return true;
                }
            }

            for( int i = 0; i < Requires.Length; i++ )
            {
                if( Feats.Catalogue[Requires[i]].ListName != toRemove.ListName && m.Feats.GetFeatLevel(Requires[i]) > 2 )
                    return true;
            }

            return false;
        }
예제 #6
0
 public static string GetWebpageDescription( BaseFeat skill )
 {
     return
         "<p id=\"skillName\">" + skill.Name + " Level 1</p>" +
         "<span id=\"boldTopic\">Description:</span> " +
         skill.FirstDescription + "<br><br>" +
         "<span id=\"boldTopic\">Requires any of the following:</span><br><br>" +
         GetRequirements( skill ) + "<br><br>" +
         "<span id=\"boldTopic\">Available to:</span><br><br>" +
         GetRacialRequirements( skill ) + "<br><br>" +
         "<span id=\"boldTopic\">Cost:</span> " + skill.Cost1 + " CPs<br><br>" +
         "<span id=\"boldTopic\">Command:</span> " + skill.FirstCommand + "<br><br>" +
         "<p id=\"skillName\">" + skill.Name + " Level 2</p>" +
         "<span id=\"boldTopic\">Description: (Upgrade)</span> " +
         skill.SecondDescription + "<br><br>" +
         "<span id=\"boldTopic\">Cost:</span> " + skill.Cost2 + " CPs<br><br>" +
         "<span id=\"boldTopic\">Command:</span> " + skill.SecondCommand + "<br><br>" +
         "<p id=\"skillName\">" + skill.Name + " Level 3</p>" +
         "<span id=\"boldTopic\">Description: (Final)</span> " +
         skill.ThirdDescription + "<br><br>" +
         "<span id=\"boldTopic\">Cost:</span> " + skill.Cost3 + " CPs<br><br>" +
         "<span id=\"boldTopic\">Command:</span> " + skill.ThirdCommand + "<br><br>";
 }
예제 #7
0
 public static void PublishWikiPage( BaseFeat skill, StreamWriter op )
 {
     HandleString( "====== " + skill.Name + " Level 1 ======", op );
     HandleString( "**Description:** ", op );
     HandleString( skill.FirstDescription + "<br><br>", op );
     HandleString( "**Requires any of the following:**<br><br>", op );
     HandleString( GetRequirements( skill, true ) + "<br><br>", op );
     HandleString( "**Allows the following:**<br><br>", op );
     HandleString( GetAllowed( skill ) + "<br><br>", op );
     HandleString( "**Available to:**<br><br>", op );
     HandleString( GetRacialRequirements( skill ) + "<br><br>", op );
     HandleString( "**Cost:** " + skill.Cost1 + " CPs<br><br>", op );
     HandleString( "**Command:** " + skill.FirstCommand + "<br><br>", op );
     HandleString( "====== " + skill.Name + " Level 2 ======", op );
     HandleString( "**Description: (Upgrade)** ", op );
     HandleString( skill.SecondDescription + "<br><br>", op );
     HandleString( "**Cost:** " + skill.Cost2 + " CPs<br><br>", op );
     HandleString( "**Command:** " + skill.SecondCommand + "<br><br>", op );
     HandleString( "====== " + skill.Name + " Level 3 ======", op );
     HandleString( "**Description: (Final)** ", op );
     HandleString( skill.ThirdDescription + "<br><br>", op );
     HandleString( "**Cost:** " + skill.Cost3 + " CPs<br><br>", op );
     HandleString( "**Command:** " + skill.ThirdCommand, op );
 }
예제 #8
0
        public static string GetRequirements( BaseFeat skill, bool wiki )
        {
            string requirements = "None";

            for( int i = 0; i < skill.Requires.Length; i++ )
            {
                if( requirements == "None" )
                    requirements = "";

                else
                    requirements = requirements + "<br>";

                string name = Feats.ConvertFeatListToFeatObject( skill.Requires[i] ).Name;

                if( wiki )
                    requirements = requirements + "[[guides:skills:" + name.Replace(" ", "_").ToLower() + "|" + name + " Level 3]]";

                else
                    requirements = requirements + Feats.ConvertFeatListToFeatObject( skill.Requires[i] ).Name + " Level 3";
            }

            return requirements;
        }
예제 #9
0
 public static string GetRequirements( BaseFeat skill )
 {
     return GetRequirements( skill, false );
 }
예제 #10
0
        public static string GetRacialRequirements( BaseFeat skill )
        {
            string requirements = "All races";

            if( skill.IsRacialFeat )
            {
                for( int i = 0; i < skill.AllowedNations.Length; i++ )
                {
                    if( requirements == "All races" )
                        requirements = skill.AllowedNations[i].ToString();

                    else
                        requirements = requirements + "<br>" + skill.AllowedNations[i].ToString();

                    if( skill.AllowedNations[i] != Nation.Mhordul && skill.AllowedNations[i] != Nation.Khemetar )
                        requirements = requirements + "s";
                }
            }

            return requirements;
        }
예제 #11
0
        public static string GetFullDescription( BaseFeat skill )
        {
            string description = "<b>" + skill.Name + " Level 1</b><br><br>" +
                "<i>Description:</i> " +
                skill.FirstDescription + "<br><br>" +
                "<i>Requires any of the following:</i><br><br>" +
                GetRequirements( skill ) + "<br><br>" +
                "<i>Available to:</i><br><br>" +
                GetRacialRequirements( skill ) + "<br><br>" +
                "<i>Cost:</i> " + skill.Cost1 + " CPs<br><br>" +
                "<i>Command:</i> " + skill.FirstCommand + "<br><br>" +
                "<b>" + skill.Name + " Level 2</b><br><br>" +
                "<i>Description: (Upgrade)</i> " +
                skill.SecondDescription + "<br><br>" +
                "<i>Cost:</i> " + skill.Cost2 + " CPs<br><br>" +
                "<i>Command:</i> " + skill.SecondCommand + "<br><br>" +
                "<b>" + skill.Name + " Level 3</b><br><br>" +
                "<i>Description: (Final)</i> " +
                skill.ThirdDescription + "<br><br>" +
                "<i>Cost:</i> " + skill.Cost3 + " CPs<br><br>" +
                "<i>Command:</i> " + skill.ThirdCommand + "<br><br>";

            return description;
        }
예제 #12
0
        public static string GetAllowed( BaseFeat skill )
        {
            string allowed = "None";

            for( int i = 0; i < skill.Allows.Length; i++ )
            {
                if( allowed == "None" )
                    allowed = "";

                else
                    allowed = allowed + "<br>";

                string name = Feats.ConvertFeatListToFeatObject( skill.Allows[i] ).Name;
                allowed = allowed + "[[guides:skills:" + name.Replace(" ", "_").ToLower() + "|" + name + "]]";
            }

            return allowed;
        }