]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Species info in Guidebook and at chargen (#25844)
authorErrant <35878406+Errant-4@users.noreply.github.com>
Mon, 11 Mar 2024 03:01:32 +0000 (04:01 +0100)
committerGitHub <noreply@github.com>
Mon, 11 Mar 2024 03:01:32 +0000 (20:01 -0700)
* guidebook pages defined

* species info button in character profile editor

* if current species has no guidebook page then open the parent page

* skrek

* destroying evidence of secret vox plot

* icon size adjustment, no icon if guidebook page for species does not exist

* finished pages

* additional info

* weh

16 files changed:
Content.Client/Preferences/UI/HumanoidProfileEditor.xaml
Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs
Content.Client/Stylesheets/StyleNano.cs
Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs
Resources/Locale/en-US/guidebook/guides.ftl
Resources/Locale/en-US/preferences/ui/humanoid-profile-editor.ftl
Resources/Prototypes/Guidebook/species.yml [new file with mode: 0644]
Resources/Prototypes/Guidebook/ss14.yml
Resources/ServerInfo/Guidebook/Mobs/Arachnid.xml [new file with mode: 0644]
Resources/ServerInfo/Guidebook/Mobs/Diona.xml [new file with mode: 0644]
Resources/ServerInfo/Guidebook/Mobs/Dwarf.xml [new file with mode: 0644]
Resources/ServerInfo/Guidebook/Mobs/Human.xml [new file with mode: 0644]
Resources/ServerInfo/Guidebook/Mobs/Moth.xml [new file with mode: 0644]
Resources/ServerInfo/Guidebook/Mobs/Reptilian.xml [new file with mode: 0644]
Resources/ServerInfo/Guidebook/Mobs/SlimePerson.xml [new file with mode: 0644]
Resources/ServerInfo/Guidebook/Mobs/Species.xml [new file with mode: 0644]

index eb553de8e17b13591c7265abbfdb3d4516fd2583..d0dd02a58add776833f171a357799f32d14a226e 100644 (file)
@@ -58,6 +58,7 @@
                                 <BoxContainer HorizontalExpand="True">
                                     <Label Text="{Loc 'humanoid-profile-editor-species-label'}" />
                                     <Control HorizontalExpand="True"/>
+                                    <TextureButton Name="SpeciesInfoButton" Scale="0.3 0.3" VerticalAlignment="Center"></TextureButton>
                                     <OptionButton Name="CSpeciesButton" HorizontalAlignment="Right" />
                                 </BoxContainer>
                                 <!-- Age -->
index e91d9f616abfc0e81196c2d6d4369c843996afd7..afc9c6eb46ed5392baaecd7f656c0d108f9a77da 100644 (file)
@@ -1,11 +1,13 @@
 using System.Linq;
 using System.Numerics;
+using Content.Client.Guidebook;
 using Content.Client.Humanoid;
 using Content.Client.Lobby.UI;
 using Content.Client.Message;
 using Content.Client.Players.PlayTimeTracking;
 using Content.Client.Stylesheets;
 using Content.Client.UserInterface.Controls;
+using Content.Client.UserInterface.Systems.Guidebook;
 using Content.Shared.CCVar;
 using Content.Shared.GameTicking;
 using Content.Shared.Humanoid;
@@ -116,6 +118,8 @@ namespace Content.Client.Preferences.UI
             _configurationManager = configurationManager;
             _markingManager = IoCManager.Resolve<MarkingManager>();
 
+            SpeciesInfoButton.ToolTip = Loc.GetString("humanoid-profile-editor-guidebook-button-tooltip");
+
             #region Left
 
             #region Randomize
@@ -523,10 +527,30 @@ namespace Content.Client.Preferences.UI
 
             preferencesManager.OnServerDataLoaded += LoadServerData;
 
+            SpeciesInfoButton.OnPressed += OnSpeciesInfoButtonPressed;
+
+            UpdateSpeciesGuidebookIcon();
 
             IsDirty = false;
         }
 
+        private void OnSpeciesInfoButtonPressed(BaseButton.ButtonEventArgs args)
+        {
+            var guidebookController = UserInterfaceManager.GetUIController<GuidebookUIController>();
+            var species = Profile?.Species ?? SharedHumanoidAppearanceSystem.DefaultSpecies;
+            var page = "Species";
+            if (_prototypeManager.HasIndex<GuideEntryPrototype>(species))
+                page = species;
+
+            if (_prototypeManager.TryIndex<GuideEntryPrototype>("Species", out var guideRoot))
+            {
+                var dict = new Dictionary<string, GuideEntry>();
+                dict.Add("Species", guideRoot);
+                //TODO: Don't close the guidebook if its already open, just go to the correct page
+                guidebookController.ToggleGuidebook(dict, includeChildren:true, selected: page);
+            }
+        }
+
         private void ToggleClothes(BaseButton.ButtonEventArgs obj)
         {
             RebuildSpriteView();
@@ -790,6 +814,7 @@ namespace Content.Client.Preferences.UI
             CMarkings.SetSpecies(newSpecies); // Repopulate the markings tab as well.
             UpdateSexControls(); // update sex for new species
             RebuildSpriteView(); // they might have different inv so we need a new dummy
+            UpdateSpeciesGuidebookIcon();
             IsDirty = true;
             _needUpdatePreview = true;
         }
@@ -941,6 +966,25 @@ namespace Content.Client.Preferences.UI
 
         }
 
+        public void UpdateSpeciesGuidebookIcon()
+        {
+            SpeciesInfoButton.StyleClasses.Clear();
+
+            var species = Profile?.Species;
+            if (species is null)
+                return;
+
+            if (!_prototypeManager.TryIndex<SpeciesPrototype>(species, out var speciesProto))
+                return;
+
+            // Don't display the info button if no guide entry is found
+            if (!_prototypeManager.HasIndex<GuideEntryPrototype>(species))
+                return;
+
+            var style = speciesProto.GuideBookIcon;
+            SpeciesInfoButton.StyleClasses.Add(style);
+        }
+
         private void UpdateMarkings()
         {
             if (Profile == null)
index 46c054c00cfa8798c1afc268709dbcfd82696439..fcf68e502b8c8b19bb78644486607693614b38fb 100644 (file)
@@ -1392,6 +1392,14 @@ namespace Content.Client.Stylesheets
                     .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#753131")),
                 // ---
 
+                // Profile Editor
+                Element<TextureButton>().Class("SpeciesInfoDefault")
+                    .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
+
+                Element<TextureButton>().Class("SpeciesInfoWarning")
+                    .Prop(TextureButton.StylePropertyTexture, resCache.GetTexture("/Textures/Interface/info.svg.192dpi.png"))
+                    .Prop(Control.StylePropertyModulateSelf, Color.FromHex("#eeee11")),
+
                 // The default look of paper in UIs. Pages can have components which override this
                 Element<PanelContainer>().Class("PaperDefaultBorder")
                     .Prop(PanelContainer.StylePropertyPanel, paperBackground),
index da8d7c75cdf27fafe4eeb96a59c124c34aebd27e..3896839a06cdaaf1de6ec797d785b5efb9b71f60 100644 (file)
@@ -15,7 +15,7 @@ public sealed partial class SpeciesPrototype : IPrototype
     /// <summary>
     /// User visible name of the species.
     /// </summary>
-    [DataField("name", required: true)]
+    [DataField(required: true)]
     public string Name { get; private set; } = default!;
 
     /// <summary>
@@ -23,13 +23,13 @@ public sealed partial class SpeciesPrototype : IPrototype
     ///     for an eventual integration into IdentitySystem
     ///     (i.e., young human person, young lizard person, etc.)
     /// </summary>
-    [DataField("descriptor")]
+    [DataField]
     public string Descriptor { get; private set; } = "humanoid";
 
     /// <summary>
     /// Whether the species is available "at round start" (In the character editor)
     /// </summary>
-    [DataField("roundStart", required: true)]
+    [DataField(required: true)]
     public bool RoundStart { get; private set; } = false;
 
     // The below two are to avoid fetching information about the species from the entity
@@ -47,14 +47,14 @@ public sealed partial class SpeciesPrototype : IPrototype
     /// <summary>
     ///     Default skin tone for this species. This applies for non-human skin tones.
     /// </summary>
-    [DataField("defaultSkinTone")]
+    [DataField]
     public Color DefaultSkinTone { get; private set; } = Color.White;
 
     /// <summary>
     ///     Default human skin tone for this species. This applies for human skin tones.
     ///     See <see cref="SkinColor.HumanSkinTone"/> for the valid range of skin tones.
     /// </summary>
-    [DataField("defaultHumanSkinTone")]
+    [DataField]
     public int DefaultHumanSkinTone { get; private set; } = 20;
 
     /// <summary>
@@ -66,60 +66,66 @@ public sealed partial class SpeciesPrototype : IPrototype
     /// <summary>
     ///     Humanoid species variant used by this entity.
     /// </summary>
-    [DataField("prototype", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
+    [DataField(required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
     public string Prototype { get; private set; } = default!;
 
     /// <summary>
     /// Prototype used by the species for the dress-up doll in various menus.
     /// </summary>
-    [DataField("dollPrototype", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
+    [DataField(required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
     public string DollPrototype { get; private set; } = default!;
 
     /// <summary>
     /// Method of skin coloration used by the species.
     /// </summary>
-    [DataField("skinColoration", required: true)]
+    [DataField(required: true)]
     public HumanoidSkinColor SkinColoration { get; private set; }
 
-    [DataField("maleFirstNames")]
+    [DataField]
     public string MaleFirstNames { get; private set; } = "names_first_male";
 
-    [DataField("femaleFirstNames")]
+    [DataField]
     public string FemaleFirstNames { get; private set; } = "names_first_female";
 
-    [DataField("lastNames")]
+    [DataField]
     public string LastNames { get; private set; } = "names_last";
 
-    [DataField("naming")]
+    [DataField]
     public SpeciesNaming Naming { get; private set; } = SpeciesNaming.FirstLast;
 
-    [DataField("sexes")]
+    [DataField]
     public List<Sex> Sexes { get; private set; } = new() { Sex.Male, Sex.Female };
 
     /// <summary>
     ///     Characters younger than this are too young to be hired by Nanotrasen.
     /// </summary>
-    [DataField("minAge")]
+    [DataField]
     public int MinAge = 18;
 
     /// <summary>
     ///     Characters younger than this appear young.
     /// </summary>
-    [DataField("youngAge")]
+    [DataField]
     public int YoungAge = 30;
 
     /// <summary>
     ///     Characters older than this appear old. Characters in between young and old age appear middle aged.
     /// </summary>
-    [DataField("oldAge")]
+    [DataField]
     public int OldAge = 60;
 
     /// <summary>
     ///     Characters cannot be older than this. Only used for restrictions...
     ///     although imagine if ghosts could age people WYCI...
     /// </summary>
-    [DataField("maxAge")]
+    [DataField]
     public int MaxAge = 120;
+
+    /// <summary>
+    ///     The Style used for the guidebook info link in the character profile editor
+    /// </summary>
+    [DataField]
+    public string GuideBookIcon = "SpeciesInfoDefault";
 }
 
 public enum SpeciesNaming : byte
index e67331d8e4b8dda666e4a94dfb4d881aa0bc0f14..c30b49553c4ce2d9b1f459542383f96fc0821c33 100644 (file)
@@ -50,6 +50,7 @@ guide-entry-security = Security
 guide-entry-forensics = Forensics
 guide-entry-defusal = Large Bomb Defusal
 guide-entry-criminal-records = Criminal Records
+guide-entry-species = Species
 
 guide-entry-antagonists = Antagonists
 guide-entry-nuclear-operatives = Nuclear Operatives
index bc506e20bb217fc276e5aa614201e03ccf875eae..b1a695dbedc170e2e8f702c7915763b7db3df5a1 100644 (file)
@@ -31,6 +31,7 @@ humanoid-profile-editor-preference-jumpskirt = Jumpskirt
 humanoid-profile-editor-preference-backpack = Backpack
 humanoid-profile-editor-preference-satchel = Satchel
 humanoid-profile-editor-preference-duffelbag = Duffelbag
+humanoid-profile-editor-guidebook-button-tooltip = Click for more info
 
 # Spawn priority
 humanoid-profile-editor-preference-spawn-priority-none = None
diff --git a/Resources/Prototypes/Guidebook/species.yml b/Resources/Prototypes/Guidebook/species.yml
new file mode 100644 (file)
index 0000000..5b9efd0
--- /dev/null
@@ -0,0 +1,47 @@
+- type: guideEntry
+  id: Species
+  name: guide-entry-species
+  text: "/ServerInfo/Guidebook/Mobs/Species.xml"
+  children:
+    - Arachnid
+    - Diona
+    - Dwarf
+    - Human
+    - Moth
+    - Reptilian
+    - SlimePerson
+
+- type: guideEntry
+  id: Arachnid
+  name: species-name-arachnid
+  text: "/ServerInfo/Guidebook/Mobs/Arachnid.xml"
+
+- type: guideEntry
+  id: Diona
+  name: species-name-diona
+  text: "/ServerInfo/Guidebook/Mobs/Diona.xml"
+
+- type: guideEntry
+  id: Dwarf
+  name: species-name-dwarf
+  text: "/ServerInfo/Guidebook/Mobs/Dwarf.xml"
+
+- type: guideEntry
+  id: Human
+  name: species-name-human
+  text: "/ServerInfo/Guidebook/Mobs/Human.xml"
+
+- type: guideEntry
+  id: Moth
+  name: species-name-moth
+  text: "/ServerInfo/Guidebook/Mobs/Moth.xml"
+
+- type: guideEntry
+  id: Reptilian
+  name: species-name-reptilian
+  text: "/ServerInfo/Guidebook/Mobs/Reptilian.xml"
+
+- type: guideEntry
+  id: SlimePerson
+  name: species-name-slime
+  text: "/ServerInfo/Guidebook/Mobs/SlimePerson.xml"
index dfe072b3e03dbce3db34860955e2b26883d90647..c1017fefcae5ad854a6818d6eabfb081cc067c92 100644 (file)
@@ -8,6 +8,7 @@
   - Survival
   - Chemicals
   - Antagonists
+  - Species
   - Writing
   - Glossary
 
diff --git a/Resources/ServerInfo/Guidebook/Mobs/Arachnid.xml b/Resources/ServerInfo/Guidebook/Mobs/Arachnid.xml
new file mode 100644 (file)
index 0000000..a6fbf8d
--- /dev/null
@@ -0,0 +1,25 @@
+<Document>
+  # Arachnids
+
+  <Box>
+    <GuideEntityEmbed Entity="MobArachnid" Caption=""/>
+  </Box>
+
+  They have two additional Pocket slots in their inventory. They can eat raw meat without any ill effects, but some foods like chocolate and onion poisons them.
+  They suffocate 50% faster, and their Blue Blood can't be metabolised from Iron, being based on Copper instead.
+
+  Their unarmed attacks deal Piercing damage instead of Blunt.
+
+  ## Sericulture
+
+  <Box>
+    <GuideEntityEmbed Entity="MaterialWebSilk" Caption=""/>
+    <GuideEntityEmbed Entity="ClothingUniformJumpskirtWeb" Caption=""/>
+    <GuideEntityEmbed Entity="WebShield" Caption=""/>
+    <GuideEntityEmbed Entity="WallWeb" Caption=""/>
+  </Box>
+
+  Arachnids can create Websilk at the cost of getting more hungry. They (and only they) can craft bundles of websilk into various items from clothing and shields to entire walls.
+
+
+</Document>
diff --git a/Resources/ServerInfo/Guidebook/Mobs/Diona.xml b/Resources/ServerInfo/Guidebook/Mobs/Diona.xml
new file mode 100644 (file)
index 0000000..575fae5
--- /dev/null
@@ -0,0 +1,38 @@
+<Document>
+  # Diona
+
+  <Box>
+    <GuideEntityEmbed Entity="MobDiona" Caption=""/>
+  </Box>
+
+  They can't wear shoes, but are not slowed by Kudzu.
+  They get hungry and thirsty slower.
+  Their "blood" is normal water and can't be metabolised from Iron.
+  Being plants, Weed Killer poisons them, while Robust Harvest heals them (but not without risk when overused!)
+
+  They take [color=#1e90ff]30% less Blunt damage and 20% less Slash damage[/color];
+  but [color=#ffa500]50% more Heat damage, 20% more Shock damage, and they can easily
+  catch on fire when receiving enough Heat damage from *any* source.[/color]
+
+  ## Make Like A Tree And Leave
+  <Box>
+    <GuideEntityEmbed Entity="FloraTree06" Caption=""/>
+  </Box>
+  Being exposed to too much Robust Harvest will cause a Diona to grow out of control, turning into an immobile tree (dropping all their equipment).
+  Cutting down the tree will "restore" the Diona to their mobile state.
+
+  ## Diona Nymphs
+  <Box>
+    <GuideEntityEmbed Entity="MobDionaNymph" Caption=""/>
+    <GuideEntityEmbed Entity="MobDionaNymph" Caption=""/>
+    <GuideEntityEmbed Entity="MobDionaNymph" Caption=""/>
+  </Box>
+  After death, a Diona can voluntarily destroy their own body, releasing their "internal organs" as three Nymphs,
+  with the player taking control of the Brain Nymph.
+  It can talk but has no hands or inventory, and can't do much.
+
+  After 10 minutes, a Nymph can reform into a whole Diona. This will be a new randomised body with a random name,
+  and there will be little to no evidence beyond their word about who they were before.
+
+
+</Document>
diff --git a/Resources/ServerInfo/Guidebook/Mobs/Dwarf.xml b/Resources/ServerInfo/Guidebook/Mobs/Dwarf.xml
new file mode 100644 (file)
index 0000000..e5ac42c
--- /dev/null
@@ -0,0 +1,11 @@
+<Document>
+  # Dwarves
+
+  <Box>
+    <GuideEntityEmbed Entity="MobDwarf" Caption=""/>
+  </Box>
+
+  Dwarves are similar to humans in most respect, but tolerate alcohol better and are healed by it.
+
+
+</Document>
diff --git a/Resources/ServerInfo/Guidebook/Mobs/Human.xml b/Resources/ServerInfo/Guidebook/Mobs/Human.xml
new file mode 100644 (file)
index 0000000..7e0d989
--- /dev/null
@@ -0,0 +1,11 @@
+<Document>
+  # Humans
+
+  <Box>
+    <GuideEntityEmbed Entity="MobHumanDummy" Caption=""/>
+  </Box>
+
+  Depending on who you ask, humans are either unremarkable or the universal standard to which everything else is compared.
+  They have no special mechanics or notable attributes.
+
+</Document>
diff --git a/Resources/ServerInfo/Guidebook/Mobs/Moth.xml b/Resources/ServerInfo/Guidebook/Mobs/Moth.xml
new file mode 100644 (file)
index 0000000..d407d7a
--- /dev/null
@@ -0,0 +1,15 @@
+<Document>
+  # Moth People
+
+  <Box>
+    <GuideEntityEmbed Entity="MobMoth" Caption=""/>
+  </Box>
+
+  They can eat cotton, fabrics and clothing, but virtually none of the food that others would consider "edible". They prefer a somewhat lower temperature range than humans.
+  Their Insect Blood can't be metabolised from Iron like normal blood.
+
+  Their wings give them better acceleration if there is no gravity on the station, but they still can't move without equipment when floating out in space.
+
+  They take [color=#1e90ff]30% less Cold damage[/color] but [color=#ffa500]30% more Heat damage, and catch on fire more easily[/color].
+
+</Document>
diff --git a/Resources/ServerInfo/Guidebook/Mobs/Reptilian.xml b/Resources/ServerInfo/Guidebook/Mobs/Reptilian.xml
new file mode 100644 (file)
index 0000000..936cd9f
--- /dev/null
@@ -0,0 +1,16 @@
+<Document>
+  # Reptilians
+
+  <Box>
+    <GuideEntityEmbed Entity="MobReptilian" Caption=""/>
+  </Box>
+
+  They can ONLY eat fruits and meat, but can eat raw meat and drink blood without any ill effects.
+  They prefer a somewhat higher temperature range than humans.
+  They can drag objects with their tail, keeping both their hands free.
+
+  Their unarmed claw attacks deal Slash damage instead of Blunt.
+
+  They take [color=#ffa500]30% more Cold damage.[/color]
+
+</Document>
diff --git a/Resources/ServerInfo/Guidebook/Mobs/SlimePerson.xml b/Resources/ServerInfo/Guidebook/Mobs/SlimePerson.xml
new file mode 100644 (file)
index 0000000..fc72c60
--- /dev/null
@@ -0,0 +1,19 @@
+<Document>
+  # Slime People
+
+  <Box>
+    <GuideEntityEmbed Entity="MobSlimePerson" Caption=""/>
+  </Box>
+
+  They breathe nitrogen instead of oxygen, which is abundant in the station air, but harder to find compressed into gas tanks. They take significant damage if they are sprayed or splashed with water, but can
+  (and like other species, need to) drink it safely to stay hydrated.
+  They exhale nitrous oxide and are unaffected by it.
+  Their body can process 6 reagents at the same time instead of just 2.
+
+  Their Slime "blood" can not be regenerated from Iron. Slime Blood is technically a source of
+  moderately filling food for other species, although drinking the blood of your coworkers is usually frowned upon.
+  They suffocate 80% slower, but take pressure damage 9% faster. This makes them by far the species most capable to survive in hard vacuum. For a while.
+
+  They take [color=#1e90ff]80% less Cellular damage, 40% less Blunt damage and 20% less Poison damage[/color], but [color=#ffa500]50% more Cold damage, 20% more Slash damage and 20% more Piercing damage[/color].
+
+</Document>
diff --git a/Resources/ServerInfo/Guidebook/Mobs/Species.xml b/Resources/ServerInfo/Guidebook/Mobs/Species.xml
new file mode 100644 (file)
index 0000000..5fb4ca7
--- /dev/null
@@ -0,0 +1,18 @@
+<Document>
+  # Species
+
+  Nanotrasen employs a variety of sapient species.
+
+  <Box>
+  <GuideEntityEmbed Entity="MobArachnid" Caption="Arachnid"/>
+  <GuideEntityEmbed Entity="MobDiona" Caption="Diona"/>
+  <GuideEntityEmbed Entity="MobDwarf" Caption="Dwarf"/>
+  <GuideEntityEmbed Entity="MobHuman" Caption="Human"/>
+  </Box>
+  <Box>
+  <GuideEntityEmbed Entity="MobMoth" Caption="Moth Person"/>
+  <GuideEntityEmbed Entity="MobReptilian" Caption="Reptilian"/>
+  <GuideEntityEmbed Entity="MobSlimePerson" Caption="Slime Person"/>
+  </Box>
+
+</Document>