コード例 #1
0
        public override void Compile(ref int index, ref string html)
        {
            HtmlCompiler.HtmlInsert(ref index, ref html, "<h4>" + Name + "</h4>");
            HtmlCompiler.CompileToolTips(ref index, ref html, this);
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class=""box"">");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<div class=""boxHeader skillHeader"">" + Name + "</div>");
            if (Icon == null)
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<img class=""icon"" src=""../../../images/general/PassiveAbility_icon.jpg"">");
            }
            else
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<img class=""icon"" src=""../../../images/" + Icon + @".png"">");
            }


            HtmlCompiler.HtmlInsert(ref index, ref html, @"<div class=""innerInfo"">");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class=""innerInfoTable"">");


            #region SKILL INFO TABLE

            #region APPLICATION-TYPE

            HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Application Type</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "Activated Ability");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");

            #endregion

            #region target-TYPE

            HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Target types</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, FormatAlliance() + " " + FormatFilter());
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");

            #endregion

            #region REQUIREMENTS

            if (Requirements != null && Requirements.Count > 0)
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Requirements</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, HtmlCompiler.CompileRequirements(Requirements));
                HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
            }

            #endregion

            #region MODIFIERS

            string mod = "";
            mod += HtmlCompiler.CompileModifiers(Modifiers);


            if (mod != "")
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Effects</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td><ul class=""innerInfoList"">");
                HtmlCompiler.HtmlInsert(ref index, ref html, mod);
                HtmlCompiler.HtmlInsert(ref index, ref html, "</ul></td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
            }

            #endregion

            #region AREA OF EFFECT - RANGE

            if (Radius > 0)
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Area of Effect</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>" + Radius + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
            }

            #endregion

            #region DURATION AND RECHARGE TIME


            HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Duration</td>");

            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>" + Duration.ToString() + " seconds.</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");


            HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Recharge time</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>" + RechargeTime.ToString() + " seconds.</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");


            #endregion


            #endregion

            HtmlCompiler.HtmlInsert(ref index, ref html, @"</table>");

            #region DAMAGE

            if (Weapon.MoraleDamage > 0)
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class=""dpsTable skillDpsTable"">");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<th colspan=""8"">Damage values</th>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");

                #region DpsTables
                double dps = 0.0;
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");

                #region INFANTRY
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class =""dpsCell"">");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<th colspan=""3"" class=""armorClass"">Infantry</th>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Low</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Med</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">High</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                dps = 0;
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");

                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");

                HtmlCompiler.HtmlInsert(ref index, ref html, "</table>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");
                #endregion
                #region HEAVY INFANTRY
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class =""dpsCell"">");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<th colspan=""3"" class=""armorClass"">Heavy Infantry</th>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Low</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Med</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">High</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</table>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");;
                #endregion
                #region COMMANDERS

                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class =""dpsCell"">");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<th class=""armorClass"">Comm</th>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">&nbsp</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</table>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");

                #endregion
                #region VEHICLES
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class =""dpsCell"">");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<th colspan=""4"" class=""armorClass"">Vehicles</th>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">U.Low</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Low</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Med</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">High</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");

                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</table>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");;
                #endregion
                #region BUILDINGS
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class =""dpsCell"">");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<th colspan=""3"" class=""armorClass"">Buildings</th>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Low</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Med</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">High</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");

                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</table>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");;
                #endregion
                #region MONSTERS
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class =""dpsCell"">");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<th colspan=""3"" class=""armorClass"">Monsters</th>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Low</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">Med</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">High</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetDamageColor(dps) + @""">" + dps + "</td>");

                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</table>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");;
                #endregion
                #region MORALE
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class =""dpsCell"">");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<th class=""armorClass"">Morale</th>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">&nbsp</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                dps = this.Weapon.MoraleDamage;
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue " + HtmlCompiler.GetMoraleColor(dps) + @""">" + dps + "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</table>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");
                #endregion

                /*
                 #region Throw FORCE
                 * HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class =""dpsCell"">");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, @"<th class=""armorClass"">Throw</th>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""armorClass"">force</td>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, @"<td class=""dpsValue"">--</td>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, "</table>");
                 * HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");
                 #endregion
                 */
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</table>");
                #endregion
            }

            #endregion

            HtmlCompiler.HtmlInsert(ref index, ref html, @"</div>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</td></tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</table>");
        }
コード例 #2
0
        public override void Compile(ref int index, ref string html)
        {
            HtmlCompiler.HtmlInsert(ref index, ref html, "<h4>Entrench</h4>");
            HtmlCompiler.CompileToolTips(ref index, ref html, this);
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class=""box"">");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<div class=""boxHeader skillHeader"">Entrench</div>");
            if (Icon == null)
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<img class=""icon"" src=""../../../images/general/PassiveAbility_icon.jpg"">");
            }
            else
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<img class=""icon"" src=""../../../images/" + Icon + @".png"">");
            }


            HtmlCompiler.HtmlInsert(ref index, ref html, @"<div class=""innerInfo"">");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<table class=""innerInfoTable"">");
            #region SKILL INFO TABLE

            #region APPLICATION-TYPE

            HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Application Type</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "Toggled Ability");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");

            #endregion

            #region target-TYPE
            HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Target types</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "Self");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
            #endregion
            #region REQUIREMENTS

            if (Requirements != null && Requirements.Count > 0)
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Requirements</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "<td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, HtmlCompiler.CompileRequirements(Requirements));
                HtmlCompiler.HtmlInsert(ref index, ref html, "</td>");
                HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
            }

            #endregion

            #region Modifiers

            string mod = "<li>This unit becomes immobile</li>";
            mod += HtmlCompiler.CompileModifiers(Modifiers) + GetEntrenchInfo();



            HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Effects</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td><ul class=""innerInfoList"">");
            HtmlCompiler.HtmlInsert(ref index, ref html, mod);
            HtmlCompiler.HtmlInsert(ref index, ref html, "</ul></td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");


            #endregion

            #endregion
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</table></td></tr>");

            HtmlCompiler.HtmlInsert(ref index, ref html, "</table><br>");
        }