diff --git a/Bundles/StandaloneWindows/skills b/Bundles/StandaloneWindows/skills new file mode 100644 index 00000000..84e8ddb0 Binary files /dev/null and b/Bundles/StandaloneWindows/skills differ diff --git a/Bundles/StandaloneWindows/skills.manifest b/Bundles/StandaloneWindows/skills.manifest new file mode 100644 index 00000000..0e3bc9f0 --- /dev/null +++ b/Bundles/StandaloneWindows/skills.manifest @@ -0,0 +1,17 @@ +ManifestFileVersion: 0 +CRC: 1871671801 +Hashes: + AssetFileHash: + serializedVersion: 2 + Hash: 06ad5785b8be973831962d480adc91ec + TypeTreeHash: + serializedVersion: 2 + Hash: 7859cd501ea75098bcf7e53f1b477c26 +HashAppended: 0 +ClassTypes: +- Class: 28 + Script: {instanceID: 0} +SerializeReferenceClassIdentifiers: [] +Assets: +- Assets/Web/Skills.png +Dependencies: [] diff --git a/Languages/English/Keyed/Keys.xml b/Languages/English/Keyed/Keys.xml index d75094c8..4152b07a 100644 --- a/Languages/English/Keyed/Keys.xml +++ b/Languages/English/Keyed/Keys.xml @@ -42,8 +42,8 @@ Manually start a duel between two friendly pawns with valid weapons. Prisoners cannot participate.\n\nThis is a friendly duel, nobody will be hurt. The duel spot is currently in use The duel spot is forbidden - {0} does not have a valid melee weapon - {0}'s weapon cannot be used to duel {1}, their weapons are incompatible + {0} does not have a valid melee weapon (must be long weapon, not short) + {0}'s weapon cannot be used to duel {1}, their weapons are incompatible (must be long weapons, not short) {0}'s current job cannot be interrupted {0} cannot reach the duel spot {0} cannot do a friendly duel for another {2} seconds diff --git a/Source/Bundles/Assets/Web/Skills.png b/Source/Bundles/Assets/Web/Skills.png new file mode 100644 index 00000000..7fb397c6 Binary files /dev/null and b/Source/Bundles/Assets/Web/Skills.png differ diff --git a/Source/ThingGenerator/AMSettings/Presets/NoLassos.cs b/Source/ThingGenerator/AMSettings/Presets/NoLassos.cs index 871245e8..7ea9e0b6 100644 --- a/Source/ThingGenerator/AMSettings/Presets/NoLassos.cs +++ b/Source/ThingGenerator/AMSettings/Presets/NoLassos.cs @@ -8,7 +8,8 @@ public class NoLassos : Settings * Adds melee attack animations. * Adds melee weapon idle animations * Adds duels - * Adds execution animations"; + * Adds execution animations + * Adds Unique Skills"; public NoLassos() { diff --git a/Source/ThingGenerator/AMSettings/Presets/VanillaPlus.cs b/Source/ThingGenerator/AMSettings/Presets/VanillaPlus.cs index 6fdbebad..28a90d27 100644 --- a/Source/ThingGenerator/AMSettings/Presets/VanillaPlus.cs +++ b/Source/ThingGenerator/AMSettings/Presets/VanillaPlus.cs @@ -16,5 +16,6 @@ public VanillaPlus() AutoExecute = false; ShowHands = false; LassoSpawnChance = 0f; + EnableUniqueSkills = false; } } \ No newline at end of file diff --git a/Source/ThingGenerator/AMSettings/Settings.cs b/Source/ThingGenerator/AMSettings/Settings.cs index 61b33db1..f86298be 100644 --- a/Source/ThingGenerator/AMSettings/Settings.cs +++ b/Source/ThingGenerator/AMSettings/Settings.cs @@ -21,6 +21,13 @@ public class Settings : SimpleSettingsBase [WebContent("AlwaysAnimate", true)] public bool AnimateAtIdle = true; + [Label("Enable Unique Skills")] + [Description("Enables or disables the Unique Skill system.\n" + + "Unique Skills are powerful attacks or abilities that are unlocked under certain conditions.\n" + + "Only your colonists can use these skills and they must be activated manually. See the Steam workshop page for more info.")] + [WebContent("Skills", false)] + public bool EnableUniqueSkills = true; + [Label("Animated Pawns Considered Invisible")] [Description("When in an animation, such as an execution, pawns are considered invisible by all other pawns and turrets: " + "they will not be actively targeted or shot at. This makes executions less risky.\n" + diff --git a/Source/ThingGenerator/Idle/IdleControllerComp.cs b/Source/ThingGenerator/Idle/IdleControllerComp.cs index 602bfeff..7dabfa88 100644 --- a/Source/ThingGenerator/Idle/IdleControllerComp.cs +++ b/Source/ThingGenerator/Idle/IdleControllerComp.cs @@ -131,6 +131,8 @@ public override void CompTick() var timer = new RefTimer(); try { + TickSkills(); + if (!ShouldBeActive(out var weapon)) { ClearAnimation(); @@ -139,8 +141,6 @@ public override void CompTick() TotalActive++; TickActive(weapon); - - TickSkills(); } catch (Exception e) { @@ -508,26 +508,33 @@ public override void PostExposeData() { base.PostExposeData(); - if (!ShouldHaveSkills()) - return; + try + { + if (!ShouldHaveSkills()) + return; - if (skills == null) - PopulateSkills(); + if (skills == null) + PopulateSkills(); - for (int i = 0; i < skills.Length; i++) - { - try - { - Scribe_Deep.Look(ref skills[i], skills[i].GetType().FullName); - } - catch (Exception e) + for (int i = 0; i < skills.Length; i++) { - Core.Error($"Exception exposing skill {skills[i]}:", e); + try + { + Scribe_Deep.Look(ref skills[i], skills[i].GetType().FullName); + } + catch (Exception e) + { + Core.Error($"Exception exposing skill {skills[i]}:", e); + } } } + catch (Exception e2) + { + Core.Error("Big ouch:", e2); + } } - private bool ShouldHaveSkills() => parent is Pawn p && (p.IsColonist || p.IsSlaveOfColony); + private bool ShouldHaveSkills() => Core.Settings.EnableUniqueSkills && parent is Pawn p && (p.IsColonist || p.IsSlaveOfColony); private void PopulateSkills() {