using Content.Shared.Decals;
+using Content.Shared.Random.Helpers;
using Content.Shared.Sprite;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
if (component.Available.Count == 0)
return;
- var groups = new List<Dictionary<string, (string, string?)>>();
+ var groups = new List<Dictionary<string, Dictionary<string, string?>>>();
if (component.GetAllGroups)
{
groups = component.Available;
component.Selected.EnsureCapacity(groups.Count);
+ Color? previousColor = null;
+
foreach (var group in groups)
{
foreach (var layer in group)
{
Color? color = null;
- if (!string.IsNullOrEmpty(layer.Value.Item2))
- color = _random.Pick(_prototype.Index<ColorPalettePrototype>(layer.Value.Item2).Colors.Values);
+ var selectedState = _random.Pick(layer.Value);
+ if (!string.IsNullOrEmpty(selectedState.Value))
+ {
+ if (selectedState.Value == $"Inherit")
+ color = previousColor;
+ else
+ {
+ color = _random.Pick(_prototype.Index<ColorPalettePrototype>(selectedState.Value).Colors.Values);
+ previousColor = color;
+ }
+ }
- component.Selected.Add(layer.Key, (layer.Value.Item1, color));
+ component.Selected.Add(layer.Key, (selectedState.Key, color));
}
}
/// Stored as a list so we can have groups of random sprites (e.g. tech_base + tech_flare for holoparasite)
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("available")]
- public List<Dictionary<string, (string State, string? Color)>> Available = new();
+ public List<Dictionary<string, Dictionary<string, string?>>> Available = new();
/// <summary>
/// Selected colors
name: kobold
id: MobKobold
parent: MobMonkey
- description: Cousins to the sentient race of lizard people, kobolds blend in with industrial tiling and are as nasty as monkeys; ready to pull out your hair and stab you to death.
+ description: Cousins to the sentient race of lizard people, kobolds blend in with their natural habitat and are as nasty as monkeys; ready to pull out your hair and stab you to death.
components:
- type: LizardAccent
- type: Speech # I don't know how to get it to work and i want someone to make them speak like a lizard with normal accents (or optionally another language altogether)
drawdepth: Mobs
layers:
- map: ["enum.DamageStateVisualLayers.Base"]
+ sprite: Mobs/Animals/kobold.rsi
state: kobold
+ - map: [ "outline" ]
sprite: Mobs/Animals/kobold.rsi
+ state: outline
+ - map: [ "horns" ]
+ sprite: Mobs/Customization/reptilian_parts.rsi
+ state: horns_short
- map: [ "enum.HumanoidVisualLayers.Handcuffs" ]
color: "#ffffff"
sprite: Objects/Misc/handcuffs.rsi
sprite: "Effects/creampie.rsi"
state: "creampie_human"
visible: false
+ - type: RandomSprite
+ getAllGroups: true
+ available:
+ - enum.DamageStateVisualLayers.Base:
+ kobold: KoboldColors
+ - horns:
+ horns_curled: KoboldHornColors
+ horns_ram: KoboldHornColors
+ horns_short: KoboldHornColors
+ horns_myrsore: KoboldHornColors
+ horns_bighorn: KoboldHornColors
+ horns_argali: KoboldHornColors
+ horns_ayrshire: KoboldHornColors
+ horns_floppy_kobold_ears: Inherit
+ horns_double: Inherit
+ horns_kobold_ears: Inherit
- type: Butcherable
butcheringType: Spike
spawned:
--- /dev/null
+- type: palette
+ id: KoboldColors
+ name: KoboldColors
+ colors:
+ ForestA: "#71a457"
+ ForestB: "#536f18"
+ ForestC: "#1e5026"
+ ForestD: "#519b71"
+ ForestE: "#61a003"
+ ForestF: "#729953"
+ DesertA: "#999453"
+ DesertB: "#daa976"
+ DesertC: "#a4582f"
+ DesertD: "#af9369"
+ DesertE: "#c27d3b"
+ DesertF: "#ddc3a1"
+ SwampA: "#635033"
+ SwampB: "#455132"
+ SwampC: "#4a4d12"
+ SwampD: "#452d1d"
+ SwampE: "#5f544c"
+ SwampF: "#413b0a"
+ CaveA: "#4a4260"
+ CaveB: "#3f3330"
+ CaveC: "#4a4542"
+ CaveD: "#413d32"
+ CaveE: "#726f6a"
+ CaveF: "#d4c8bf"
+ TechniRed: "#b32828"
+ TechniOrange: "#da8929"
+ TechniGreen: "#28df58"
+ TechniBlue: "#144bb3"
+ TechniCyan: "#1ddfbe"
+ TechniPurple: "#792da9"
+ TechniFuchsia: "#d11a82"
+
+- type: palette
+ id: KoboldHornColors
+ name: KoboldHornColors
+ colors:
+ HornA: "#d4c8bf"
+ hornB: "#eec7ab"
+ hornC: "#ad9584"
"y": 32
},
"license": "CC-BY-SA-3.0",
- "copyright": "Drawn by Ubaser",
+ "copyright": "Drawn by Ubaser, modified by Bhijn and Myr",
"states": [
{
"name": "kobold",
"directions": 4
+ },
+ {
+ "name": "outline",
+ "directions": 4
}
]
}