예제 #1
0
        public override int CompareTo(object o)
        {
            ResearchInfo toCompare = o as ResearchInfo;

            if (toCompare != null)
            {
                foreach (RequirementInfo req in this.Requirements.Values)
                {
                    if (req is RequiredResearch)
                    {
                        RequiredResearch reqRes = (RequiredResearch)req;
                        if (Translation.Translate(reqRes.Research) == toCompare.Name)
                        {
                            return(1);
                        }
                    }
                }
                foreach (RequirementInfo req in toCompare.Requirements.Values)
                {
                    if (req is RequiredResearch)
                    {
                        RequiredResearch reqRes = (RequiredResearch)req;
                        if (Translation.Translate(reqRes.Research) == this.Name)
                        {
                            return(-1);
                        }
                    }
                }
            }
            return(base.CompareTo(o));
        }
예제 #2
0
 public override string Format()
 {
     if (Count > 1)
     {
         return(Count.ToString() + " " + HtmlCompiler.GetPlural(Translation.Translate(Structure)));
     }
     return(Translation.Translate(Structure));
 }
예제 #3
0
 public override string Format()
 {
     if (Replace)
     {
         return(Translation.Translate(AddOn) + " (Replaced)");
     }
     return(Translation.Translate(AddOn));
 }
예제 #4
0
        public override string Format()
        {
            string output = "";

            if (Count > 1)
            {
                output += Count.ToString() + " ";
                output += HtmlCompiler.GetPlural(Translation.Translate(OwnName));
            }
            else
            {
                output = Translation.Translate(OwnName);
            }
            return(output);
        }
예제 #5
0
        public override string Compile()
        {
            string        output    = "";
            WeaponInfo    oldWeapon = null;
            WeaponInfo    newWeapon = null;
            BuildableInfo entity    = null;


            if (ApplicationType == ApplicationTypes.ApplyToEntity)
            {
                if (this.Parent.Parent is BuildableInfo)
                {
                    entity = ((BuildableInfo)Parent.Parent);
                }
            }
            else
            {
                entity = DataDumper.Units[Target] as BuildableInfo;
            }
            try
            {
                if (entity != null)
                {
                    WeaponHardPointInfo whpInfo = entity.WeaponHardPoints[HardPoint] as WeaponHardPointInfo;
                    oldWeapon = (WeaponInfo)whpInfo.Weapons[whpInfo.UpgradeValue];
                    whpInfo.UpgradeValue++;
                    newWeapon = (WeaponInfo)whpInfo.Weapons[whpInfo.UpgradeValue];
                    if (!oldWeapon.IsDummyWeapon())
                    {
                        if (ApplicationType == ApplicationTypes.ApplyToEntityType)
                        {
                            output += "Upgrades " + entity.Name + "'s " + Translation.Translate(oldWeapon.Name) + " to " + Translation.Translate(newWeapon.Name);
                        }
                        else if (ApplicationType == ApplicationTypes.ApplyToEntity)
                        {
                            output += "Upgrades " + Translation.Translate(oldWeapon.Name) + " to " + Translation.Translate(newWeapon.Name);
                        }
                    }
                    else
                    {
                        output += "Equips " + entity.Name + " with " + Translation.Translate(newWeapon.Name);
                    }
                }
            }
            catch {  }
            return(output);
        }
예제 #6
0
        public override string Compile()
        {
            string   output = "";
            string   Weapon = "";
            UnitInfo unit   = null;

            if (Target != null)
            {
                unit = DataDumper.Units[Target] as UnitInfo;
            }
            if (ApplicationType == ApplicationTypes.ApplyToEntity)
            {
                if (Parent is UnitInfo)
                {
                    unit = Parent as UnitInfo;
                }
                else if (this.Parent.Parent is UnitInfo)
                {
                    unit = this.Parent.Parent as UnitInfo;
                }
            }
            try
            {
                if (unit != null)
                {
                    WeaponHardPointInfo whpInfo = unit.WeaponHardPoints[HardPoint] as WeaponHardPointInfo;

                    Weapon = ((WeaponInfo)whpInfo.Weapons[0]).Name;

                    output += (Amount == -1) ? "Disables " : "Enables ";

                    if (ApplicationType != ApplicationTypes.ApplyToEntity)
                    {
                        output += unit.Name + "'s ";
                    }
                    output += Translation.Translate(Weapon);
                }
                else
                {
                    output += (Amount == -1) ? "Disables " : "Enables ";
                    output += "the main weapon.";
                }
            }
            catch { }
            return(output);
        }
예제 #7
0
        public string GetEntrenchInfo()
        {
            string   output   = "";
            UnitInfo original = this.Parent as UnitInfo;

            if (original != null && EntrenchedUnit != null)
            {
                if (EntrenchedUnit.ArmorType != original.ArmorType)
                {
                    output += "<li>Change the armor type to " + Translation.Translate(EntrenchedUnit.ArmorType.ToString()) + "</li>";
                }
                if (EntrenchedUnit.Mass > original.Mass)
                {
                    output += "<li>Increases the mass by " + (EntrenchedUnit.Mass - original.Mass) + "</li>";
                }

                if (EntrenchedUnit.Sight > original.Sight)
                {
                    output += "<li>Increases the Sight Radius by " + (EntrenchedUnit.Sight - original.Sight) + "</li>";
                }
                foreach (WeaponHardPointInfo whp in original.WeaponHardPoints.Values)
                {
                    foreach (WeaponInfo wInfo in whp.Weapons)
                    {
                        if (!wInfo.IsDummyWeapon())
                        {
                            output += "<li>Disables " + Translation.Translate(wInfo.Name) + "</li>";
                        }
                    }
                }
                foreach (WeaponHardPointInfo whp in EntrenchedUnit.WeaponHardPoints.Values)
                {
                    foreach (WeaponInfo wInfo in whp.Weapons)
                    {
                        if (!wInfo.IsDummyWeapon())
                        {
                            output += "<li>Enables " + Translation.Translate(wInfo.Name) + "</li>";
                        }
                    }
                }
            }
            return(output);
        }
예제 #8
0
        public override string Format()
        {
            string output = "";

            for (int i = 0; i < Squads.Length; i++)
            {
                output += Translation.Translate(Squads[i]);
                if (i == Squads.Length - 2)
                {
                    output += " and ";
                }
                else if (i == Squads.Length - 1)
                {
                    output += ".";
                }
                else
                {
                    output += ", ";
                }
            }
            return("Shared Cap of " + Cap + " with " + output);
        }
예제 #9
0
 public DirectSpawnInfo()
 {
     Name = "Spawn " + Translation.Translate(Spawn);
 }
예제 #10
0
 public override string Format()
 {
     return("Mutually exclusive with " + Translation.Translate(AddOn));
 }
예제 #11
0
        public void Parse(string lua, bool inherited, bool isChild)
        {
            if (lua != "" && !lua.EndsWith(".lua") && !lua.EndsWith(".nil"))
            {
                lua += ".lua";
            }
            IsChild = isChild;
            string path = DataPath.GetPath("abilities\\" + lua);

            if (path != "")
            {
                StreamReader file = new StreamReader(File.OpenRead(path), System.Text.Encoding.ASCII);
                file.BaseStream.Seek(0, SeekOrigin.Begin);

                string s = file.ReadToEnd();

                file.Close();

                #region CHILD ABILITY

                if (ChildSkill == null)
                {
                    Match mtc = Regex.Match(s, @"GameData\[""child_ability_name""\]\s=\s""(?<child>.*)""");
                    if (mtc.Success)
                    {
                        string child = mtc.Groups["child"].Value;

                        if (child != "" && CheckLoop(child))
                        {
                            ChildSkill             = new SkillInfo();
                            ChildSkill.Parent      = Parent;
                            ChildSkill.LuaName     = child;
                            ChildSkill.Name        = child;
                            ChildSkill.ParentSkill = this;

                            ChildSkill.Parse(child, false, true);
                        }
                    }
                }
                #endregion

                #region INHERITANCE
                Match mc = Regex.Match(s, @"GameData\s=\sInherit\(\[\[abilities\\(?<inherit>.*)\]\]\)");
                if (mc.Success)
                {
                    Group grp = mc.Groups["inherit"];
                    if (grp.Success && grp.Value != "")
                    {
                        Parse(grp.Value, true, isChild);
                    }
                }
                #endregion

                double numValue    = 0.0;
                string stringValue = "";


                if (LuaParser.ReadNumericValue(s, @"GameData\[""refresh_time""\]\s=\s(?<refresh>.*)", out numValue))
                {
                    Refresh = numValue;
                }

                if (LuaParser.ReadStringValue(s, @"GameData\[""activation""\]\s=\sReference\(\[\[type_abilityactivation\\(?<actvationType>.*)\.lua\]\]\)", out stringValue))
                {
                    ActivationType = stringValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""duration_time""\]\s=\s(?<duration>.*)", out numValue))
                {
                    Duration = numValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""initial_delay_time""\]\s=\s(?<duration>.*)", out numValue))
                {
                    Delay = numValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""recharge_time""\]\s=\s(?<duration>.*)", out numValue))
                {
                    RechargeTime = numValue;
                }
                if (Regex.Match(s, @"GameData\[""recharge_timer_global""\]\s=\strue").Success)
                {
                    GlobalTimer = true;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""fire_cost""\]\[""requisition""\]\s=\s(.*)", out numValue))
                {
                    RequisitionCost = (int)numValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""fire_cost""\]\[""power""\]\s=\s(.*)", out numValue))
                {
                    PowerCost = (int)numValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""area_effect""\]\[""area_effect_information""\]\[""radius""\]\s=\s(.*)", out numValue))
                {
                    Radius = numValue;
                }

                if (LuaParser.ReadNumericValue(s, @"GameData\[""range""\]\s=\s(.*)", out numValue))
                {
                    Range = numValue;
                }

                if (LuaParser.ReadNumericValue(s, @"GameData\[""time_cost""\]\[""cost""\]\[""power""\]\s=\s(.*)", out numValue))
                {
                    PowerCost = (int)numValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""time_cost""\]\[""time_seconds""\]\s=\s(.*)", out numValue))
                {
                    RechargeTime = (int)numValue;
                }

                if (LuaParser.ReadStringValue(s, @"GameData\[""area_effect""\]\[""area_effect_information""\]\[""area_type""\]\s=\sReference\(\[\[type_areaeffect\\(.*)\.lua\]\]\)", out stringValue))
                {
                    AreaType = GetAreaType(stringValue);
                }

                if (LuaParser.ReadStringValue(s, @"GameData\[""area_effect""\]\[""area_effect_information""\]\[""filter_type""\]\s=\sReference\(\[\[type_areafilter\\(.*)\.lua\]\]\)", out stringValue))
                {
                    AOEFilter = stringValue;
                }

                if (Regex.Match(s, @"GameData\[""target_ground""\]\s=\strue").Success)
                {
                    TargetGround = true;
                }

                if (LuaParser.ReadStringValue(s, @"GameData\[""spawned_entity_name""\]\s=\s""(?<spawn>.*\.lua)""", out stringValue))
                {
                    bool     loopcheck = true;
                    UnitInfo root      = null;
                    if (this.RootParent is UnitInfo)
                    {
                        root = RootParent as UnitInfo;
                        string spawnName = Regex.Replace(stringValue, @".*\\\\", "");
                        if (root.FileName == spawnName)
                        {
                            loopcheck = false;
                        }
                    }
                    if (loopcheck)
                    {
                        UnitInfo uInfo = new UnitInfo();
                        LuaParser.ParseUnit(DataPath.GetPath(Regex.Replace(stringValue, @"\\\\", "\\")), uInfo);
                        Spawn = uInfo;
                    }
                }
                if (LuaParser.ReadStringValue(s, @"GameData\[""ui_info""\]\[""icon_name""\]\s=\s""(.*)""", out stringValue))
                {
                    Icon = stringValue;
                }


                if (LuaParser.ReadNumericValue(s, @"GameData\[""area_effect""\]\[""weapon_damage""\]\[""armour_damage""\]\[""armour_piercing""\]\s=\s(.*)", out numValue))
                {
                    BasePiercing = numValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""area_effect""\]\[""weapon_damage""\]\[""armour_damage""\]\[""morale_damage""\]\s=\s(.*)", out numValue))
                {
                    MoraleDamage = numValue;
                }

                if (LuaParser.ReadNumericValue(s, @"\[""ui_info""\]\[""screen_name_id""\]\s=\s""\$(.*)""", out numValue))
                {
                    UI = (int)numValue;
                }

                string luaName = Regex.Replace(path, @".*\\", "");

                if (!inherited && !isChild)
                {
                    Name = Translation.Translate(UI, luaName);
                }


                MatchCollection mtcs = Regex.Matches(s, @"GameData\[""area_effect""\]\[""area_effect_information""\]\[""target_filter""\]\[""(?<filter_entry>entry_[0-9][0-9])""\]\s=\sReference\(\[\[type_armour\\(?<armour_type>.*)\.lua\]\]\)");
                foreach (Match m in mtcs)
                {
                    ArmorTypes armor;
                    string     entry      = m.Groups["filter_entry"].Value;
                    string     armourType = m.Groups["armour_type"].Value;
                    try
                    {
                        armor = (ArmorTypes)Enum.Parse(typeof(ArmorTypes), armourType);
                    }
                    catch { armor = ArmorTypes.unknown; }

                    if (!Filter.ContainsKey(entry))
                    {
                        Filter.Add(entry, armor);
                    }
                    else if (armor != ArmorTypes.unknown)
                    {
                        Filter[entry] = armor;
                    }
                    else
                    {
                        Filter.Remove(entry);
                    }
                }

                #region DPS

                if (LuaParser.ReadNumericValue(s, @"GameData\[""area_effect""\]\[""weapon_damage""\]\[""armour_damage""\]\[""min_damage""\]\s=\s(.*)", out numValue))
                {
                    MinDamage = numValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""area_effect""\]\[""weapon_damage""\]\[""armour_damage""\]\[""max_damage""\]\s=\s(.*)", out numValue))
                {
                    MaxDamage = numValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""area_effect""\]\[""throw_data""\]\[""force_min""\]\s=\s(.*)", out numValue))
                {
                    MinForce = numValue;
                }
                if (LuaParser.ReadNumericValue(s, @"GameData\[""area_effect""\]\[""throw_data""\]\[""force_max""\]\s=\s(.*)", out numValue))
                {
                    MaxForce = numValue;
                }


                MatchCollection aMcs = Regex.Matches(s, @"GameData\[""area_effect""\]\[""weapon_damage""\]\[""armour_damage""\]\[""armour_piercing_types""\]\[""entry_(?<armor_entry>[0-9][0-9])""\]\[""armour_type""\]\s=\sReference\(\[\[type_armour\\(?<armor_type>.*)\.lua\]\]\)");

                foreach (Match m in aMcs) // Retrieve ArmorTypes entries
                {
                    string armor = m.Groups["armor_type"].Value;


                    int armorEntry = System.Convert.ToInt32(Regex.Replace(m.Groups["armor_entry"].Value, "\b0", ""), LuaParser.NumberFormat);

                    if (!ArmorPiercingValues.Contains(armorEntry))
                    {
                        ArmorPiercing ap = new ArmorPiercing();
                        ap.Entry = armorEntry;
                        try
                        {
                            ap.ArmorType = (ArmorTypes)Enum.Parse(typeof(ArmorTypes), armor);
                        }
                        catch { ap.ArmorType = ArmorTypes.unknown; }
                        ArmorPiercingValues.Add(armorEntry, ap);
                    }
                    else
                    {
                        ArmorPiercing ap = ArmorPiercingValues[armorEntry] as ArmorPiercing;
                        ap.Entry = armorEntry;
                        try
                        {
                            ap.ArmorType = (ArmorTypes)Enum.Parse(typeof(ArmorTypes), armor);
                        }
                        catch { ap.ArmorType = ArmorTypes.unknown; }
                    }
                }

                foreach (ArmorPiercing ap in ArmorPiercingValues.Values)
                {
                    if (ap.ArmorType != ArmorTypes.unknown)
                    {
                        string subIndex = "";
                        int    j        = ap.Entry;
                        if (j < 10)
                        {
                            subIndex = "0" + j.ToString();
                        }
                        else
                        {
                            subIndex = j.ToString();
                        }
                        if (LuaParser.ReadNumericValue(s, @"GameData\[""area_effect""\]\[""weapon_damage""\]\[""armour_damage""\]\[""armour_piercing_types""\]\[""entry_+" + subIndex + @"""\]\[""armour_piercing_value""\]\s=\s(.*)", out numValue))
                        {
                            ap.PiercingValue = numValue;
                        }
                    }
                    else
                    {
                        ap.PiercingValue = 0.0;
                    }
                }
                #endregion


                LuaParser.ParseToolTips(s, this);
                LuaParser.ParseRequirements(s, this);
                LuaParser.ParseModifiers(s, this, this.Modifiers, AreaOfEffectTypes.area_effect);
            }
        }
예제 #12
0
 public override string Format()
 {
     return("Either " + Translation.Translate(Structure1) + " or " + Translation.Translate(Structure2));
 }
예제 #13
0
        public override void Compile(ref int index, ref string html)
        {
            if (Name != null && Name != "")
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, "<h4>" + Name + "</h4>");
            }
            else
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, "<h4>" + Translation.Translate(Replacement) + "</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>");
            if (Name != null && Name != "")
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<div class=""boxHeader skillHeader"">" + Name + "</div>");
            }
            else
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<div class=""boxHeader skillHeader"">" + Translation.Translate(Replacement) + "</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, "Possession");
            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 Possession
            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, @"<li>The " + ((BuildableInfo)Parent).Name + " is replaced by " + Translation.Translate(Replacement) + "</li>");
            if (Duration != 0)
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<li>Automatically starts after " + Duration + " seconds</li>");
            }
            HtmlCompiler.HtmlInsert(ref index, ref html, "</ul></td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
            #endregion

            #endregion

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

            HtmlCompiler.HtmlInsert(ref index, ref html, @"</div>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</td></tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</table>");
        }
예제 #14
0
 public override string Format()
 {
     return(Translation.Translate(Structure));
 }
예제 #15
0
        public string GetTarget(string prep)
        {
            // SQUAD
            if (Parent is SquadInfo)
            {
                if (ApplicationType == ApplicationTypes.ApplyToSquad)
                {
                    return(" " + prep + " the squad");
                }
            }
            // UNIT
            else if (Parent is UnitInfo)
            {
                switch (ApplicationType)
                {
                case ApplicationTypes.ApplyToSquad:
                    return(" " + prep + " the squad");

                case ApplicationTypes.ApplyToEntityType:
                    if (Target != "")
                    {
                        return(prep + " " + HtmlCompiler.GetPlural(TargetName));
                    }
                    break;

                case ApplicationTypes.ApplyToEntity:
                    if (Target != "")
                    {
                        return(prep + " " + Translation.Translate(((UnitInfo)Parent).Name));
                    }
                    break;
                }
            }
            // Abilities
            else if (Parent is SkillInfo)
            {
                SkillInfo sk       = Parent as SkillInfo;
                bool      aoe      = (sk.Radius > 0);
                bool      isTarget = (sk.ActivationType == "tp_ability_activation_targeted");

                if (isTarget)
                {
                    if (aoe)
                    {
                        return(prep + " each target in the area of effect");
                    }
                    else
                    {
                        switch (ApplicationType)
                        {
                        case ApplicationTypes.ApplyToSquad:
                            return(prep + " targeted squad");

                        case ApplicationTypes.ApplyToEntity:
                            return(prep + " the target ");
                        }
                    }
                }
                else
                {
                    switch (ApplicationType)
                    {
                    case ApplicationTypes.ApplyToEntity:
                    {
                        if (aoe)
                        {
                            return(prep + " each target in the area of effect");
                        }
                        break;
                    }

                    case ApplicationTypes.ApplyToWeaponType:
                        if (Target != "")
                        {
                            return(prep + " " + TargetName);
                        }
                        break;

                    case ApplicationTypes.ApplyToSquadType:
                        if (Target != "")
                        {
                            return(prep + " " + TargetName);
                        }
                        break;

                    case ApplicationTypes.ApplyToEntityType:
                        if (Target != "")
                        {
                            return(prep + " " + TargetName);
                        }
                        break;
                    }
                }
            }
            else if (Target != "")      // research and others
            {
                return(prep + " " + TargetName);
            }

            return("");
        }
예제 #16
0
        public string FormatFilter()
        {
            string output = "";
            string temp   = "";

            if (this.Radius > 0)
            {
            }

            int count = 0;

            foreach (ArmorTypes ar in Filter.Values)
            {
                if (ar >= ArmorTypes.tp_infantry_low && ar <= ArmorTypes.tp_infantry_heavy_high)
                {
                    count++;
                    temp += Translation.Translate(ar.ToString()) + "*";
                }
            }
            if (count >= 6)
            {
                output += "Infantry*";
            }
            else if (count > 0)
            {
                output += temp;
            }
            temp  = "";
            count = 0;
            foreach (ArmorTypes ar in Filter.Values)
            {
                if (ar >= ArmorTypes.tp_monster_low && ar <= ArmorTypes.tp_monster_high)
                {
                    count++;
                    temp += Translation.Translate(ar.ToString()) + "*";
                }
            }
            if (count == 3)
            {
                output += "Monsters*";
            }
            else if (count > 0)
            {
                output += temp;
            }
            temp  = "";
            count = 0;
            foreach (ArmorTypes ar in Filter.Values)
            {
                if (ar == ArmorTypes.tp_air_low || (ar >= ArmorTypes.tp_vehicle_low && ar <= ArmorTypes.tp_vehicle_high))
                {
                    count++;
                    temp += Translation.Translate(ar.ToString()) + "*";
                }
            }
            if (count == 4)
            {
                output += "Vehicles*";
            }
            else if (count > 0)
            {
                output += temp;
            }
            temp  = "";
            count = 0;
            foreach (ArmorTypes ar in Filter.Values)
            {
                if (ar >= ArmorTypes.tp_building_low && ar <= ArmorTypes.tp_building_high)
                {
                    count++;
                    temp += Translation.Translate(ar.ToString()) + "*";
                }
            }
            if (count == 3)
            {
                output += "Buildings*";
            }
            else if (count > 0)
            {
                output += temp;
            }
            ArrayList filtersList = new ArrayList(Filter.Values);

            if (filtersList.Contains(ArmorTypes.tp_commander))
            {
                output += "Commanders*";
            }

            output = Regex.Replace(output, @"\*(?<word>[^\*]*)\*$", @" and ${word}");
            output = Regex.Replace(output, @"\*$", @"");
            output = Regex.Replace(output, @"\*", @", ");


            if (this.Radius > 0)
            {
                if (ActivationType == "tp_ability_activation_targeted")
                {
                    output += " in the area of effect.";
                }
                else
                {
                    output += " in the surrounding area.";
                }
            }
            else if (Filter.Count > 0)
            {
                if (ActivationType != "tp_ability_activation_targeted")
                {
                    output += " in the squad.";
                }
            }

            return(output);
        }
예제 #17
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, "Self");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "</tr>");
            #endregion

            #region Recharge
            HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Recharge Time</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, Recharge + " seconds");
            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 EFFECTS
            HtmlCompiler.HtmlInsert(ref index, ref html, "<tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, "<td>Spawn</td>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<td><ul class=""innerInfoList"">");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"<li><a href=""" + "../units/" + Spawn + @".htm"">Spawns " + HtmlCompiler.Getarticle(Translation.Translate(Spawn)) + " " + Translation.Translate(Spawn) + @"</li>");
            if (HealthFraction > 0)
            {
                HtmlCompiler.HtmlInsert(ref index, ref html, @"<li>Each activation consumes " + HealthFraction * 100 + "% of the total health</li>");
            }

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

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

            HtmlCompiler.HtmlInsert(ref index, ref html, @"</div>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</td></tr>");
            HtmlCompiler.HtmlInsert(ref index, ref html, @"</table>");
        }
예제 #18
0
 public override string Format()
 {
     return(Translation.Translate(AddOn));
 }
예제 #19
0
        public string FormatFilter()
        {
            string output = "";
            string temp   = "";

            int count = 0;

            foreach (ArmorTypes ar in Filter)
            {
                if (ar >= ArmorTypes.tp_infantry_low && ar <= ArmorTypes.tp_infantry_heavy_high)
                {
                    count++;
                    temp += Translation.Translate(ar.ToString()) + "*";
                }
            }
            if (count >= 6)
            {
                output += "Infantry*";
            }
            else if (count > 0)
            {
                output += temp;
            }
            temp  = "";
            count = 0;
            foreach (ArmorTypes ar in Filter)
            {
                if (ar >= ArmorTypes.tp_monster_low && ar <= ArmorTypes.tp_monster_high)
                {
                    count++;
                    temp += Translation.Translate(ar.ToString()) + "*";
                }
            }
            if (count == 3)
            {
                output += "Monsters*";
            }
            else if (count > 0)
            {
                output += temp;
            }
            temp  = "";
            count = 0;
            foreach (ArmorTypes ar in Filter)
            {
                if (ar == ArmorTypes.tp_air_low || (ar >= ArmorTypes.tp_vehicle_low && ar <= ArmorTypes.tp_vehicle_high))
                {
                    count++;
                    temp += Translation.Translate(ar.ToString()) + "*";
                }
            }
            if (count == 4)
            {
                output += "Vehicles*";
            }
            else if (count > 0)
            {
                output += temp;
            }
            temp  = "";
            count = 0;
            foreach (ArmorTypes ar in Filter)
            {
                if (ar >= ArmorTypes.tp_building_low && ar <= ArmorTypes.tp_building_high)
                {
                    count++;
                    temp += Translation.Translate(ar.ToString()) + "*";
                }
            }
            if (count == 3)
            {
                output += "Buildings*";
            }
            else if (count > 0)
            {
                output += temp;
            }

            if (Filter.Contains(ArmorTypes.tp_commander))
            {
                output += "Commanders*";
            }

            output = Regex.Replace(output, @"\*(?<word>[^\*]*)\*$", @" and ${word}");
            output = Regex.Replace(output, @"\*$", @"");
            output = Regex.Replace(output, @"\*", @", ");


            if (this.Radius > 0)
            {
                output += " in the surrounding area.";
            }

            return(output);
        }
예제 #20
0
 public override string Format()
 {
     return(Translation.Translate(Research) + (MustNotBeCompleted?" must not be complete":""));
 }