diff --git a/OpenRA.Mods.Common/Traits/Encyclopedia.cs b/OpenRA.Mods.Common/Traits/Encyclopedia.cs new file mode 100644 index 0000000000..b2eccf7956 --- /dev/null +++ b/OpenRA.Mods.Common/Traits/Encyclopedia.cs @@ -0,0 +1,35 @@ +#region Copyright & License Information +/* + * Copyright 2007-2022 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. For more + * information, see COPYING. + */ +#endregion + +using OpenRA.Traits; + +namespace OpenRA.Mods.Common.Traits +{ + public class EncyclopediaInfo : TraitInfo + { + [Desc("Explains the purpose in the in-game encyclopedia.")] + public readonly string Description = null; + + [Desc("Number for ordering the list.")] + public readonly int Order; + + [Desc("Group under this heading.")] + public readonly string Category; + + public override object Create(ActorInitializer init) { return Encyclopedia.Instance; } + } + + public class Encyclopedia + { + public static readonly Encyclopedia Instance = new Encyclopedia(); + Encyclopedia() { } + } +} diff --git a/OpenRA.Mods.Common/Widgets/Logic/EncyclopediaLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/EncyclopediaLogic.cs new file mode 100644 index 0000000000..1c6fcf4459 --- /dev/null +++ b/OpenRA.Mods.Common/Widgets/Logic/EncyclopediaLogic.cs @@ -0,0 +1,182 @@ +#region Copyright & License Information +/* + * Copyright 2007-2022 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. For more + * information, see COPYING. + */ +#endregion + +using System; +using System.Collections.Generic; +using System.Linq; +using OpenRA.Graphics; +using OpenRA.Mods.Common.Traits; +using OpenRA.Mods.Common.Traits.Render; +using OpenRA.Primitives; +using OpenRA.Widgets; + +namespace OpenRA.Mods.Common.Widgets.Logic +{ + public class EncyclopediaLogic : ChromeLogic + { + readonly World world; + readonly ModData modData; + + readonly ScrollPanelWidget descriptionPanel; + readonly LabelWidget descriptionLabel; + readonly SpriteFont descriptionFont; + + readonly ScrollPanelWidget actorList; + readonly ScrollItemWidget headerTemplate; + readonly ScrollItemWidget template; + readonly ActorPreviewWidget previewWidget; + + ActorInfo selectedActor; + ScrollItemWidget firstItem; + + [ObjectCreator.UseCtor] + public EncyclopediaLogic(Widget widget, World world, ModData modData, Action onExit) + { + this.world = world; + this.modData = modData; + + actorList = widget.Get("ACTOR_LIST"); + + headerTemplate = widget.Get("HEADER"); + template = widget.Get("TEMPLATE"); + + widget.Get("ACTOR_INFO").IsVisible = () => selectedActor != null; + + previewWidget = widget.Get("ACTOR_PREVIEW"); + previewWidget.IsVisible = () => selectedActor != null; + + descriptionPanel = widget.Get("ACTOR_DESCRIPTION_PANEL"); + + descriptionLabel = descriptionPanel.Get("ACTOR_DESCRIPTION"); + descriptionFont = Game.Renderer.Fonts[descriptionLabel.Font]; + + actorList.RemoveChildren(); + + var actorEncyclopediaPair = GetFilteredActorEncyclopediaPairs(); + var categories = actorEncyclopediaPair.Select(a => a.Value.Category).Distinct(). + OrderBy(string.IsNullOrWhiteSpace).ThenBy(s => s); + foreach (var category in categories) + { + CreateActorGroup(category, actorEncyclopediaPair + .Where(a => a.Value.Category == category) + .OrderBy(a => a.Value.Order) + .Select(a => a.Key)); + } + + widget.Get("BACK_BUTTON").OnClick = () => + { + Game.Disconnect(); + Ui.CloseWindow(); + onExit(); + }; + } + + IEnumerable> GetFilteredActorEncyclopediaPairs() + { + var actors = new List>(); + foreach (var actor in modData.DefaultRules.Actors.Values) + { + if (!actor.TraitInfos().Any()) + continue; + + var statistics = actor.TraitInfoOrDefault(); + if (statistics != null && !string.IsNullOrEmpty(statistics.OverrideActor)) + continue; + + var encyclopedia = actor.TraitInfoOrDefault(); + if (encyclopedia == null) + continue; + + actors.Add(new KeyValuePair(actor, encyclopedia)); + } + + return actors; + } + + void CreateActorGroup(string title, IEnumerable actors) + { + var header = ScrollItemWidget.Setup(headerTemplate, () => true, () => { }); + header.Get("LABEL").GetText = () => title; + actorList.AddChild(header); + + foreach (var actor in actors) + { + var item = ScrollItemWidget.Setup(template, + () => selectedActor != null && selectedActor.Name == actor.Name, + () => SelectActor(actor)); + + var label = item.Get("TITLE"); + var name = actor.TraitInfoOrDefault()?.Name; + if (!string.IsNullOrEmpty(name)) + WidgetUtils.TruncateLabelToTooltip(label, name); + + if (firstItem == null) + { + firstItem = item; + SelectActor(actor); + } + + actorList.AddChild(item); + } + } + + void SelectActor(ActorInfo actor) + { + selectedActor = actor; + + var typeDictionary = new TypeDictionary() + { + new OwnerInit(world.WorldActor.Owner), + new FactionInit(world.WorldActor.Owner.PlayerReference.Faction) + }; + + foreach (var actorPreviewInit in actor.TraitInfos()) + foreach (var inits in actorPreviewInit.ActorPreviewInits(actor, ActorPreviewType.ColorPicker)) + typeDictionary.Add(inits); + + previewWidget.SetPreview(actor, typeDictionary); + + var text = ""; + + var buildable = actor.TraitInfoOrDefault(); + if (buildable != null) + { + var prerequisites = buildable.Prerequisites.Select(a => ActorName(modData.DefaultRules, a)) + .Where(s => !s.StartsWith("~", StringComparison.Ordinal) && !s.StartsWith("!", StringComparison.Ordinal)); + if (prerequisites.Any()) + text += $"Requires {prerequisites.JoinWith(", ")}\n\n"; + } + + var info = actor.TraitInfoOrDefault(); + if (info != null && !string.IsNullOrEmpty(info.Description)) + text += WidgetUtils.WrapText(info.Description.Replace("\\n", "\n") + "\n\n", descriptionLabel.Bounds.Width, descriptionFont); + + var height = descriptionFont.Measure(text).Y; + descriptionLabel.Text = text; + descriptionLabel.Bounds.Height = height; + descriptionPanel.Layout.AdjustChildren(); + + descriptionPanel.ScrollToTop(); + } + + static string ActorName(Ruleset rules, string name) + { + if (rules.Actors.TryGetValue(name.ToLowerInvariant(), out var actor)) + { + var actorTooltip = actor.TraitInfos().FirstOrDefault(info => info.EnabledByDefault); + if (actorTooltip != null) + return actorTooltip.Name; + } + + return name; + } + } +} diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index 1c605b3c8d..2d190b1de6 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -121,6 +121,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic loadButton.IsDisabled = () => !GameSaveBrowserLogic.IsLoadPanelEnabled(modData.Manifest); loadButton.OnClick = OpenGameSaveBrowserPanel; + var encyclopediaButton = singleplayerMenu.GetOrNull("ENCYCLOPEDIA_BUTTON"); + if (encyclopediaButton != null) + encyclopediaButton.OnClick = OpenEncyclopediaPanel; + singleplayerMenu.Get("BACK_BUTTON").OnClick = () => SwitchMenu(MenuType.Main); // Extras menu @@ -466,6 +470,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic }); } + void OpenEncyclopediaPanel() + { + SwitchMenu(MenuType.None); + Game.OpenWindow("ENCYCLOPEDIA_PANEL", new WidgetArgs + { + { "onExit", () => SwitchMenu(MenuType.Singleplayer) } + }); + } + void OpenSkirmishLobbyPanel() { SwitchMenu(MenuType.None); diff --git a/mods/d2k/chrome/encyclopedia.yaml b/mods/d2k/chrome/encyclopedia.yaml new file mode 100644 index 0000000000..464dc0b9c6 --- /dev/null +++ b/mods/d2k/chrome/encyclopedia.yaml @@ -0,0 +1,85 @@ +Background@ENCYCLOPEDIA_PANEL: + Logic: EncyclopediaLogic + X: (WINDOW_RIGHT - WIDTH) / 2 + Y: (WINDOW_BOTTOM - HEIGHT) / 2 + Width: 900 + Height: 600 + Children: + Container@ENCYCLOPEDIA_CONTENT: + Width: PARENT_RIGHT - 40 + Height: PARENT_BOTTOM - 80 + X: 20 + Y: 20 + Children: + Label@ENCYCLOPEDIA_TITLE: + Width: PARENT_RIGHT + Height: 25 + Text: Mentat + Align: Center + Font: Bold + ScrollPanel@ACTOR_LIST: + Y: 30 + Width: 190 + Height: PARENT_BOTTOM - 25 + Children: + ScrollItem@HEADER: + BaseName: scrollheader + Width: PARENT_RIGHT - 27 + Height: 13 + X: 2 + Visible: false + Children: + Label@LABEL: + Font: TinyBold + Width: PARENT_RIGHT + Height: 13 + Align: Center + ScrollItem@TEMPLATE: + Width: PARENT_RIGHT - 27 + Height: 25 + X: 2 + EnableChildMouseOver: True + Children: + LabelWithTooltip@TITLE: + X: 10 + Width: PARENT_RIGHT - 20 + Height: 25 + TooltipContainer: TOOLTIP_CONTAINER + TooltipTemplate: SIMPLE_TOOLTIP + Container@ACTOR_INFO: + X: PARENT_RIGHT - WIDTH + Y: 30 + Width: PARENT_RIGHT - 190 - 10 + Height: PARENT_BOTTOM - 25 + Children: + Background@ACTOR_BG: + Width: 150 + Height: 150 + Background: dialog3 + Children: + ActorPreview@ACTOR_PREVIEW: + X: 1 + Y: 1 + Width: PARENT_RIGHT - 2 + Height: PARENT_BOTTOM - 2 + ScrollPanel@ACTOR_DESCRIPTION_PANEL: + X: 150 + 10 + Width: PARENT_RIGHT - 150 - 10 + Height: 150 + TopBottomSpacing: 8 + Children: + Label@ACTOR_DESCRIPTION: + X: 8 + Y: 8 + Width: PARENT_RIGHT - 32 + VAlign: Top + Font: Regular + Button@BACK_BUTTON: + X: PARENT_RIGHT - 180 + Y: PARENT_BOTTOM - 45 + Width: 160 + Height: 25 + Text: Back + Font: Bold + Key: escape + TooltipContainer@TOOLTIP_CONTAINER: diff --git a/mods/d2k/chrome/mainmenu.yaml b/mods/d2k/chrome/mainmenu.yaml index cdac71bd53..3fca20cf24 100644 --- a/mods/d2k/chrome/mainmenu.yaml +++ b/mods/d2k/chrome/mainmenu.yaml @@ -108,6 +108,13 @@ Container@MAINMENU: Height: 30 Text: Load Font: Bold + Button@ENCYCLOPEDIA_BUTTON: + X: PARENT_RIGHT / 2 - WIDTH / 2 + Y: 180 + Width: 140 + Height: 30 + Text: Mentat + Font: Bold Button@BACK_BUTTON: X: PARENT_RIGHT / 2 - WIDTH / 2 Key: escape diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index fc30fbca6e..d67dd4ff98 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -120,6 +120,7 @@ ChromeLayout: common|chrome/gamesave-browser.yaml common|chrome/gamesave-loading.yaml common|chrome/text-notifications.yaml + d2k|chrome/encyclopedia.yaml Translations: common|languages/en.ftl diff --git a/mods/d2k/rules/aircraft.yaml b/mods/d2k/rules/aircraft.yaml index 5d9959c8ce..fce48fd4dd 100644 --- a/mods/d2k/rules/aircraft.yaml +++ b/mods/d2k/rules/aircraft.yaml @@ -57,6 +57,10 @@ carryall: BeforeLoadDelay: 10 BeforeUnloadDelay: 15 LocalOffset: 0, 0, -128 + Encyclopedia: + Description: Carryalls will automatically transport Harvesters back and forth from the Spice Fields to the Refineries. They will also pick up units and deliver them to the Repair Pad, when ordered to.\n\nThe Carryall is a lightly armored transport aircraft. They are vulnerable to missiles and can only be hit by anti-aircraft weapons. + Order: 230 + Category: Units Aircraft: MinAirborneAltitude: 400 RevealsShroud@lifting_low: @@ -95,6 +99,8 @@ frigate: ornithopter: Inherits: ^Plane + Buildable: + Prerequisites: upgrade.hightech AttackBomber: FacingTolerance: 8 Armament: @@ -103,6 +109,10 @@ ornithopter: HP: 9000 Armor: Type: light + Encyclopedia: + Description: The fastest aircraft on Dune, the Ornithopther is lightly armored and capable of dropping 500lb bombs. This unit is most effective against infantry and lightly armored targets, but also damages armored targets. + Order: 240 + Category: Units Aircraft: Speed: 224 TurnSpeed: 8 diff --git a/mods/d2k/rules/infantry.yaml b/mods/d2k/rules/infantry.yaml index 0cd3b997fa..1425c0fb4f 100644 --- a/mods/d2k/rules/infantry.yaml +++ b/mods/d2k/rules/infantry.yaml @@ -19,6 +19,10 @@ light_inf: Speed: 43 Armament: Weapon: LMG + Encyclopedia: + Description: Light Infantry are lightly armored foot soldiers, equipped with 9mm RP assault rifles. Light Infantry are effective against other infantry and lightly armored vehicles.\n\nLight Infantry are resistant to missiles and large caliber guns, but very vulnerable to high explosives, fire and bullet weapons. + Order: 0 + Category: Units WithInfantryBody: DefaultAttackSequence: shoot @@ -49,6 +53,10 @@ engineer: Captures: CaptureTypes: building PlayerExperience: 50 + Encyclopedia: + Description: Engineers can be used to capture enemy buildings.\n\nEngineers are resistant to anti-tank weaponry but very vulnerable to high explosives, fire and bullet weapons. + Order: 30 + Category: Units -RevealOnFire: Voiced: VoiceSet: EngineerVoice @@ -79,6 +87,10 @@ trooper: Armament: Weapon: Bazooka LocalOffset: 128,0,256 + Encyclopedia: + Description: Armed with missile launchers, Troopers fire wire guided armor-piercing warheads. These units are particularly effective against vehicles (especially armored ones) and buildings. However, this unit is largely useless against infantry.\n\nTroopers are resistant to anti-tank weaponry but very vulnerable to high explosives, fire and bullet weapons. + Order: 10 + Category: Units TakeCover: ProneOffset: 324,0,-204 WithInfantryBody: @@ -113,6 +125,10 @@ thumper: UndeployOnMove: true Facing: 512 AllowedTerrainTypes: Sand, Spice, Dune, SpiceSand + Encyclopedia: + Description: Deploys a noisy hammering device which will attract sand worms to this area. + Order: 40 + Category: Units WithInfantryBody: RequiresCondition: undeployed WithSpriteBody@DEPLOYED: @@ -161,6 +177,10 @@ fremen: Weapon: Fremen_S Armament@SECONDARY: Weapon: Fremen_L + Encyclopedia: + Description: Fremen are the native desert warriors of Dune. Fremen ground units carry 10mm Assault Rifles and Rockets. Their firepower is equally effective against infantry and vehicles.\n\nFremen units are very vulnerable to high explosive and bullet weapons. + Order: 70 + Category: Units WithInfantryBody: DefaultAttackSequence: shoot Cloak: @@ -200,6 +220,10 @@ grenadier: Weapon: grenade LocalOffset: 192,0,224 FireDelay: 3 + Encyclopedia: + Description: Grenadiers are an infantry artillery unit which are strong against buildings. They have a chance to explode on death, so don't group them together. + Order: 50 + Category: Units TakeCover: ProneOffset: 96,100,-64 WithInfantryBody: @@ -236,6 +260,10 @@ sardaukar: Weapon: M_LMG Armament@SECONDARY: Weapon: M_HMG + Encyclopedia: + Description: These powerful heavy troopers have a machine gun that's effective against infantry, and a rocket launcher for vehicles. + Order: 60 + Category: Units Voiced: VoiceSet: GenericVoice Explodes: @@ -260,6 +288,8 @@ mpsardaukar: Weapon: M_HMG_H RenderSprites: Image: sardaukar + UpdatesPlayerStatistics: + OverrideActor: sardaukar saboteur: Inherits: ^Infantry @@ -276,6 +306,10 @@ saboteur: AddToArmyValue: true Health: HP: 4000 + Encyclopedia: + Description: The Saboteur is a special military unit acquired by House Ordos. A single Saboteur can destroy any enemy building once he moves into it, though also destroys himself! A Saboteur can be stealthed by deploying itself.\n\nThe Saboteur is resistant to anti-tank weaponry, but very vulnerable to high explosives, fire, and bullet weapons. + Order: 80 + Category: Units Mobile: Speed: 43 Demolition: @@ -308,3 +342,5 @@ nsfremen: Image: fremen -Cloak: -GrantConditionOnDamageState@UNCLOAK: + UpdatesPlayerStatistics: + OverrideActor: fremen diff --git a/mods/d2k/rules/misc.yaml b/mods/d2k/rules/misc.yaml index 651559d613..6394ba738d 100644 --- a/mods/d2k/rules/misc.yaml +++ b/mods/d2k/rules/misc.yaml @@ -175,6 +175,7 @@ carryall.colorpicker: InitialFacing: 416 -Buildable: -MapEditorData: + -Encyclopedia: RenderSprites: Image: carryall Palette: colorpicker @@ -331,3 +332,18 @@ upgrade.hightech: RenderSprites: Image: hightech.atreides ProvidesPrerequisite@upgradename: + +deathhand: + AlwaysVisible: + Interactable: + Tooltip: + Name: Death Hand + Encyclopedia: + Description: The Death Hand Missiles' warhead carries atomic cluster munitions. It detonates above the target, inflicting great damage over a wide area. + Order: 250 + Category: Super Weapons + Buildable: + Prerequisites: palace + RenderSprites: + WithSpriteBody: + Sequence: up diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index 06df6d4e15..30f98e17c5 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -27,6 +27,10 @@ concretea: Dimensions: 2,2 Tooltip: Name: Concrete Slab + Encyclopedia: + Description: If buildings are not placed on concrete, they will be damaged. Buildings can be repaired, but unless the building sits completely on concrete, the building will suffer continual weathering damage from the erosive desert environment.\n\nConcrete is vulnerable to most weapon types. Concrete cannot be repaired if damaged. + Category: Buildings + Order: 10 Valued: Cost: 20 Buildable: @@ -34,6 +38,8 @@ concretea: Prerequisites: ~!global-auto-concrete BuildDuration: 62 BuildDurationModifier: 100 + WithSpriteBody: + Sequence: preview concreteb: Inherits: ^concrete @@ -61,6 +67,10 @@ construction_yard: Dimensions: 3,3 LocalCenterOffset: 0,-512,0 -ConcretePrerequisites: + Encyclopedia: + Description: The Construction Yard is the foundation of any base built on Arrakis. Construction Yards produce a small amount of power and are required for the building of any new structures. Protect this structure! It is critical to the success of your base.\n\nConstruction yards are fairly strong, but vulnerable in varying degrees to all types of weapons. + Category: Buildings + Order: 0 WithBuildingBib: Selectable: Bounds: 3072, 2048 @@ -125,6 +135,10 @@ wind_trap: Footprint: xx xx == Dimensions: 2,3 LocalCenterOffset: 0,-512,0 + Encyclopedia: + Description: Wind Traps provide power and water to an installation. Large, above-ground ducts funnel wind currents underground into massive turbines which power generators and humidity extractors.\n\nWind Traps are vulnerable to most types of weapons. + Category: Buildings + Order: 20 Health: HP: 30000 HitShape: @@ -174,6 +188,10 @@ barracks: Footprint: xx xx == Dimensions: 2,3 LocalCenterOffset: 0,-512,0 + Encyclopedia: + Description: Barracks are required to produce and train light infantry units. Barracks can be upgraded for the production of more advanced infantry in later missions.\n\nBarracks are vulnerable to most types of weapons. + Category: Buildings + Order: 30 Health: HP: 32000 HitShape: @@ -242,6 +260,10 @@ refinery: Footprint: =xx xx= === Dimensions: 3,3 LocalCenterOffset: 0,-512,0 + Encyclopedia: + Description: The Refinery is the basis of all Spice production on Dune. Harvesters transport mined Spice to the Refinery where it is converted into credits. Refined Spice is automatically distributed among the Silos and Refineries for storage. A refinery can store 2000 spice. A Spice Harvester is delivered via Carryall once a Refinery is built.\n\nRefineries are vulnerable to most types of weapons. + Category: Buildings + Order: 40 Health: HP: 30000 HitShape: @@ -303,6 +325,10 @@ silo: Description: Stores excess harvested Spice. Selectable: Bounds: 1024, 1024 + Encyclopedia: + Description: The Spice Silo allows the player to store 1500 harvested Spice. When a Refinery completes processing, excess Spice is automatically distributed evenly among the Silos and Refineries. When harvested Spice exceeds Silo capacity, the excess will be lost. When Spice Silos are destroyed or captured, the amount stored will be dispersed among other Silos and Refineries unless there is insufficient storage capacity.\n\nThe Spice Silo is vulnerable to most types of weapons. + Category: Buildings + Order: 50 Valued: Cost: 120 Tooltip: @@ -366,6 +392,10 @@ light_factory: Footprint: xxx xx= === Dimensions: 3,3 LocalCenterOffset: 0,-512,0 + Encyclopedia: + Description: The Light Factory is required for the production of small, lightly armored, combat vehicles. The Light Factory can be upgraded to produce more advanced light vehicles in later missions.\n\nA Light Factory is vulnerable to most types of weapons. + Category: Buildings + Order: 60 Health: HP: 33000 HitShape: @@ -445,6 +475,10 @@ heavy_factory: Footprint: _x_ xxx =xX === Dimensions: 3,4 LocalCenterOffset: 0,-512,0 + Encyclopedia: + Description: The Heavy Factory allows the player to build heavy vehicles such as Harvesters and Combat Tanks. When upgraded, this facility allows the construction of advanced vehicles, though some vehicles also require other buildings.\n\nThe Heavy Factory is vulnerable to most types of weapons. + Category: Buildings + Order: 70 Health: HP: 35000 HitShape: @@ -534,6 +568,10 @@ outpost: Footprint: xxx xxx === Dimensions: 3,3 LocalCenterOffset: 0,-512,0 + Encyclopedia: + Description: If the player has sufficient power, the Radar Outpost will generate a radar map. Radar is automatically activated when construction of the Outpost is complete.\n\nThe Radar Outpost is vulnerable to most types of weapons. + Category: Buildings + Order: 80 Health: HP: 35000 HitShape: @@ -581,6 +619,10 @@ starport: D2kBuilding: Footprint: xxx x=x =x= Dimensions: 3,3 + Encyclopedia: + Description: The Starport allows you to engage in intergalactic trading with the C.H.O.A.M. Merchants' Guild. The Starport provides a trading market for vehicles and airborne units at varying rates. You cannot purchase units from the Guild without this facility.\n\nArmor is heavy, but the Starport is vulnerable to most types of weapons. + Category: Buildings + Order: 90 Selectable: Bounds: 3072, 3072 Health: @@ -672,6 +714,10 @@ wall: D2kBuilding: BuildSounds: CHUNG.WAV TerrainTypes: Rock, Concrete + Encyclopedia: + Description: Base defense. Concrete walls are the most effective barriers on Dune. Concrete walls will block tank bullets and impede unit movement.\n\nWalls can only be damaged by explosive weapons, missiles and shells. Like concrete slabs, walls cannot be repaired if damaged. + Category: Buildings + Order: 15 FootprintPlaceBuildingPreview: LineBuildFootprintAlpha: 0.65 RequiresBuildableArea: @@ -736,6 +782,10 @@ medium_gun_turret: DecorationBounds: 1024, 1280, 0, -256 Health: HP: 27000 + Encyclopedia: + Description: The Gun Turret has a medium range gun which is effective against vehicles, especially heavily armored vehicles. The Gun Turret will fire on any enemy unit within range.\n\nThe Gun Turret is resistant to bullet and explosive weapons, but vulnerable to missiles and high-caliber guns. + Category: Buildings + Order: 100 Armor: Type: heavy RevealsShroud: @@ -773,6 +823,10 @@ large_gun_turret: Cost: 750 Tooltip: Name: Rocket Turret + Encyclopedia: + Description: The substantially improved Rocket Turret has a longer range and a higher rate of fire than the Gun Turret. The Rocket Turret's advanced targeting equipment requires power to operate.\n\nThe Rocket Turret is resistant to bullet and explosive weapons, but vulnerable to missiles and high caliber guns. + Category: Buildings + Order: 110 RequiresBuildableArea: Adjacent: 4 Selectable: @@ -816,6 +870,10 @@ repair_pad: D2kBuilding: Footprint: +++ +++ +++ Dimensions: 3,3 + Encyclopedia: + Description: With a Repair Pad, vehicles can be repaired for a varying price.\n\nThe Repair Pad is vulnerable to most types of weapons. + Category: Buildings + Order: 120 Health: HP: 30000 HitShape: @@ -886,6 +944,10 @@ high_tech_factory: Footprint: _X_ xxx XXX === Dimensions: 3,4 LocalCenterOffset: 0,-512,0 + Encyclopedia: + Description: The High Tech Factory produces airborne units, and is required for the production of Carryalls. House Atreides can upgrade the High Tech Factory to build Ornithopters for an air strike in later missions.\n\nThe High Tech Factory is vulnerable to most types of weapons. + Category: Buildings + Order: 130 Health: HP: 35000 HitShape: @@ -960,6 +1022,10 @@ research_centre: Footprint: _X_ xxx XXX === Dimensions: 3,4 LocalCenterOffset: 0,-512,0 + Encyclopedia: + Description: The IX Research Center provides technology upgrades for structures and vehicles. This facility is required for production of a number of advanced special weapons and prototypes.\n\nThe IX Research Center is vulnerable to most types of weapons. + Category: Buildings + Order: 140 Health: HP: 25000 HitShape: @@ -1011,6 +1077,10 @@ palace: D2kBuilding: Footprint: xx= xxx =xx Dimensions: 3,3 + Encyclopedia: + Description: The Palace serves as the command center once it is constructed. Palaces feature unique additional options, making available advanced special weapons.\n\nArmor is heavy, but the Palace is vulnerable to most types of weapons. + Category: Buildings + Order: 150 Health: HP: 40000 HitShape: @@ -1164,6 +1234,8 @@ conyard.atreides: RenderSprites: Image: conyard.atreides -FactionImages: + UpdatesPlayerStatistics: + OverrideActor: construction_yard conyard.harkonnen: Inherits: construction_yard @@ -1175,6 +1247,8 @@ conyard.harkonnen: RenderSprites: Image: conyard.harkonnen -FactionImages: + UpdatesPlayerStatistics: + OverrideActor: construction_yard conyard.ordos: Inherits: construction_yard @@ -1186,3 +1260,5 @@ conyard.ordos: RenderSprites: Image: conyard.ordos -FactionImages: + UpdatesPlayerStatistics: + OverrideActor: construction_yard diff --git a/mods/d2k/rules/vehicles.yaml b/mods/d2k/rules/vehicles.yaml index 8858e7e9bd..ea762c83fe 100644 --- a/mods/d2k/rules/vehicles.yaml +++ b/mods/d2k/rules/vehicles.yaml @@ -19,6 +19,10 @@ mcv: HP: 45000 Armor: Type: light + Encyclopedia: + Description: The Mobile Construction Vehicle must be driven to a suitable deployment area. After locating an appropriate area of rock, the MCV can be transformed into a Construction Yard.\n\nMCVs are resistant to bullets and some high explosives. They are vulnerable to missiles and high caliber guns. + Order: 180 + Category: Units Mobile: Speed: 31 RevealsShroud: @@ -77,6 +81,10 @@ harvester: HP: 45000 Armor: Type: harvester + Encyclopedia: + Description: Harvesters are resistant to bullets, and to some degree, high explosives. These units are vulnerable to missiles and high caliber guns.\n\nA Harvester is included with a Refinery. + Order: 130 + Category: Units Mobile: Speed: 43 RevealsShroud: @@ -129,6 +137,10 @@ trike: HP: 9000 Armor: Type: wood + Encyclopedia: + Description: Trikes are lightly armored, three-wheeled vehicles equipped with heavy machine guns, effective against infantry and lightly armored vehicles.\n\nTrikes are vulnerable to most weapons, though high caliber guns are slightly less effective against them. + Order: 90 + Category: Units Mobile: TurnSpeed: 40 Speed: 128 @@ -179,6 +191,10 @@ quad: Armament: Weapon: Rocket LocalOffset: 128,64,64, 128,-64,64 + Encyclopedia: + Description: Stronger than the Trike in both armor and firepower, the Quad is a four-wheeled vehicle firing armor-piercing rockets. The Quad is effective against most vehicles.\n\nQuads are resistant to bullets and high explosives, to a lesser degree. However, Quads are vulnerable to missiles and high caliber guns. + Order: 110 + Category: Units AttackFrontal: FacingTolerance: 0 Explodes: @@ -210,6 +226,10 @@ siege_tank: HP: 12000 Armor: Type: light + Encyclopedia: + Description: Siege Tanks are very effective against infantry and lightly armored vehicles - but very weak against heavily armored targets. They fire over a long range.\n\nSiege Tanks are resistant to bullets, and to some degree, high explosives. These units are vulnerable to missiles and high caliber guns. + Order: 170 + Category: Units Mobile: Speed: 43 TurnSpeed: 12 @@ -266,6 +286,10 @@ missile_tank: HP: 13000 Armor: Type: wood + Encyclopedia: + Description: The Missile Tank is anti-aircraft capable and effective against most targets, except infantry units.\n\nMissile Tanks are vulnerable to most weapons, though high caliber guns are slightly less effective. + Order: 190 + Category: Units RevealsShroud: Range: 6c768 Armament: @@ -316,6 +340,10 @@ sonic_tank: Armament: Weapon: Sound LocalOffset: 600,0,427 + Encyclopedia: + Description: The Sonic Tank is most effective against infantry and lightly armored vehicles - but weaker against armored targets.\n\nThe Sonic Tank will damage all units in its firing path.\n\nThey are very resistant to bullets and high explosives, but vulnerable to missiles and high caliber guns. + Order: 200 + Category: Units AttackFrontal: FacingTolerance: 0 Explodes: @@ -363,6 +391,10 @@ devastator: Weapon: DevBullet LocalOffset: 640,0,32 MuzzleSequence: muzzle + Encyclopedia: + Description: The Devastator is the most powerful tank on Dune - powerfully effective against most units, but slow - and slow to fire. Nuclear powered, the Devastator fires dual plasma charges and may be ordered to self-destruct, damaging surrounding units and structures.\n\nThe Devastator is very resistant to bullet and high explosives, but vulnerable to missiles and high caliber guns. + Order: 220 + Category: Units AttackFrontal: FacingTolerance: 0 WithMuzzleOverlay: @@ -416,6 +448,10 @@ raider: Cost: 350 Tooltip: Name: Raider Trike + Encyclopedia: + Description: Raiders are similar to Trikes, but the Ordos have refined their fire power, speed and armor to create a powerful and maneuverable scout. With dual 20mm cannons, Raiders are most effective against infantry and lightly armored vehicles.\n\nRaiders are vulnerable to most types of weaponry, though high caliber guns are slightly less effective. + Order: 100 + Category: Units UpdatesPlayerStatistics: AddToArmyValue: true Health: @@ -466,6 +502,10 @@ stealth_raider: GrantConditionOnDamageState@UNCLOAK: Condition: cloak-force-disabled ValidDamageStates: Critical + Encyclopedia: + Description: A cloaked version of the raider, good for stealth attacks. Will uncloak when firing its machine guns. + Order: 120 + Category: Units AutoTarget: InitialStance: HoldFire InitialStanceAI: ReturnFire @@ -495,6 +535,10 @@ deviator: HP: 11000 Armor: Type: wood + Encyclopedia: + Description: The Deviator's missiles discharge a silicon cloud that interferes with vehicle controls - temporarily changing the allegiance of the targeted unit. Personnel are not seriously effected by the cloud.\n\nThe Deviator is vulnerable to most types of weapon, though high caliber guns are slightly less effective. + Order: 210 + Category: Units RevealsShroud: Range: 4c768 Armament: @@ -564,6 +608,12 @@ deviator: combat_tank_a: Inherits: ^combat_tank + Tooltip: + Name: Atreides Combat Tank + Encyclopedia: + Description: The Combat Tank is effective against most vehicles, less so against lightly armored vehicles.\n\nAtreides Combat Tanks are very resistant to bullet and heavy explosives, but vulnerable to missiles and high caliber guns. + Order: 140 + Category: Units Buildable: Prerequisites: ~heavy.atreides_combat Armament: @@ -573,6 +623,12 @@ combat_tank_a: combat_tank_h: Inherits: ^combat_tank + Tooltip: + Name: Harkonnen Combat Tank + Encyclopedia: + Description: The Combat Tank is effective against most vehicles, less so against lightly armored vehicles.\n\nThe Harkonnen Combat Tank is stronger but slower. + Order: 160 + Category: Units Buildable: Prerequisites: ~heavy.harkonnen_combat Armament: @@ -586,10 +642,16 @@ combat_tank_h: combat_tank_o: Inherits: ^combat_tank + Tooltip: + Name: Ordos Combat Tank Buildable: Prerequisites: ~heavy.ordos_combat Turreted: TurnSpeed: 20 + Encyclopedia: + Description: The Combat Tank is effective against most vehicles, less so against lightly armored vehicles.\n\nThe Ordos Combat Tank is faster but weaker. + Order: 150 + Category: Units Armament: Weapon: 80mm_O Mobile: diff --git a/mods/d2k/sequences/misc.yaml b/mods/d2k/sequences/misc.yaml index 7f3d2f0806..e43ea6263f 100644 --- a/mods/d2k/sequences/misc.yaml +++ b/mods/d2k/sequences/misc.yaml @@ -270,6 +270,9 @@ deathhand: Start: 2148 ZOffset: 1023 Offset: -1,0 + icon: DATA.R8 + Start: 4296 + Offset: -30,-24 fire: 1: DATA.R8 diff --git a/mods/d2k/sequences/structures.yaml b/mods/d2k/sequences/structures.yaml index 72b83e14af..86216ffc23 100644 --- a/mods/d2k/sequences/structures.yaml +++ b/mods/d2k/sequences/structures.yaml @@ -2,6 +2,8 @@ concretea: icon: DATA.R8 Start: 4314 Offset: -30,-24 + preview: BLOXBASE.R8 + Start: 657 concreteb: icon: DATA.R8