From 9a22c09da63d8c32327363602caf0728ce25a295 Mon Sep 17 00:00:00 2001 From: Avalon Date: Fri, 27 Dec 2024 10:05:15 -0500 Subject: [PATCH] Port Magic Crayon From Frontier (#2410) * ART * Update clown.yml * Loadout fixes, time req * loadout bgone * Fixes, moved things * fixoneoops * More fixes * CRAFTING WORKS! * Flipped slashes * UNTOUCHED! AT LAST * Fix comment * Mailladd * Webedit ops Signed-off-by: Avalon * untroll indent Signed-off-by: deltanedas <39013340+deltanedas@users.noreply.github.com> --------- Signed-off-by: Avalon Signed-off-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> --- Content.Client/Crayon/CrayonSystem.cs | 11 +++++ Content.Server/Crayon/CrayonSystem.cs | 11 +++-- .../en-US/_NF/crayon/crayon-component.ftl | 5 ++ .../Catalog/Fills/Items/toolboxes.yml | 2 + .../Prototypes/Catalog/Fills/Lockers/misc.yml | 2 + .../Entities/Objects/Specific/Mail/mail.yml | 2 + .../Objects/Specific/Mail/mail_civilian.yml | 2 + .../_NF/Entities/Objects/Fun/magic_crayon.yml | 31 ++++++++++++ .../Recipes/Crafting/Graphs/magic_crayon.yml | 28 +++++++++++ .../_NF/Recipes/Crafting/magic_crayon.yml | 10 ++++ .../Fun/magic_crayon.rsi/icon-inhand-left.png | Bin 0 -> 204 bytes .../magic_crayon.rsi/icon-inhand-right.png | Bin 0 -> 203 bytes .../_NF/Objects/Fun/magic_crayon.rsi/icon.png | Bin 0 -> 282 bytes .../Objects/Fun/magic_crayon.rsi/meta.json | 46 ++++++++++++++++++ 14 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 Resources/Locale/en-US/_NF/crayon/crayon-component.ftl create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Fun/magic_crayon.yml create mode 100644 Resources/Prototypes/_NF/Recipes/Crafting/Graphs/magic_crayon.yml create mode 100644 Resources/Prototypes/_NF/Recipes/Crafting/magic_crayon.yml create mode 100644 Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/icon-inhand-left.png create mode 100644 Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/icon-inhand-right.png create mode 100644 Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/icon.png create mode 100644 Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/meta.json diff --git a/Content.Client/Crayon/CrayonSystem.cs b/Content.Client/Crayon/CrayonSystem.cs index dc039794813..84749cf1f1b 100644 --- a/Content.Client/Crayon/CrayonSystem.cs +++ b/Content.Client/Crayon/CrayonSystem.cs @@ -57,6 +57,17 @@ protected override void FrameUpdate(FrameEventArgs args) } _parent.UIUpdateNeeded = false; + + // Frontier: unlimited crayon, Delta V Port + if (_parent.Capacity == int.MaxValue) + { + _label.SetMarkup(Robust.Shared.Localization.Loc.GetString("crayon-drawing-label-unlimited", + ("color", _parent.Color), + ("state", _parent.SelectedState))); + return; + } + // End Frontier, Delta V Port + _label.SetMarkup(Robust.Shared.Localization.Loc.GetString("crayon-drawing-label", ("color",_parent.Color), ("state",_parent.SelectedState), diff --git a/Content.Server/Crayon/CrayonSystem.cs b/Content.Server/Crayon/CrayonSystem.cs index 4257c436c23..e69d0f177a3 100644 --- a/Content.Server/Crayon/CrayonSystem.cs +++ b/Content.Server/Crayon/CrayonSystem.cs @@ -73,9 +73,14 @@ private void OnCrayonAfterInteract(EntityUid uid, CrayonComponent component, Aft if (component.UseSound != null) _audio.PlayPvs(component.UseSound, uid, AudioParams.Default.WithVariation(0.125f)); - // Decrease "Ammo" - component.Charges--; - Dirty(uid, component); + // Frontier: check if crayon is infinite, Delta V Port + if (component.Charges != int.MaxValue) + { + // Decrease "Ammo" + component.Charges--; + Dirty(uid, component); + } + // End Frontier, Delta V Port _adminLogger.Add(LogType.CrayonDraw, LogImpact.Low, $"{EntityManager.ToPrettyString(args.User):user} drew a {component.Color:color} {component.SelectedState}"); args.Handled = true; diff --git a/Resources/Locale/en-US/_NF/crayon/crayon-component.ftl b/Resources/Locale/en-US/_NF/crayon/crayon-component.ftl new file mode 100644 index 00000000000..146559f00a5 --- /dev/null +++ b/Resources/Locale/en-US/_NF/crayon/crayon-component.ftl @@ -0,0 +1,5 @@ + +## Entity + +crayon-drawing-label-unlimited = Drawing: [color={$color}]{$state}[/color] + diff --git a/Resources/Prototypes/Catalog/Fills/Items/toolboxes.yml b/Resources/Prototypes/Catalog/Fills/Items/toolboxes.yml index c484fee13f1..ba2b91df007 100644 --- a/Resources/Prototypes/Catalog/Fills/Items/toolboxes.yml +++ b/Resources/Prototypes/Catalog/Fills/Items/toolboxes.yml @@ -85,6 +85,8 @@ amount: 2 - id: CrayonMime - id: CrayonRainbow + - id: CrayonMagic # Delta V - A construction graph was made, but still can find in the wild + prob: .10 - type: entity id: ToolboxMechanicalFilled diff --git a/Resources/Prototypes/Catalog/Fills/Lockers/misc.yml b/Resources/Prototypes/Catalog/Fills/Lockers/misc.yml index 4c0a9826de7..00a9e25fc6e 100644 --- a/Resources/Prototypes/Catalog/Fills/Lockers/misc.yml +++ b/Resources/Prototypes/Catalog/Fills/Lockers/misc.yml @@ -134,6 +134,8 @@ children: - id: StrangePill prob: 0.20 + - id: CrayonMagic # Delta V - Just another way to get it + prob: .01 # Tools - !type:NestedSelector tableId: MaintToolsTable diff --git a/Resources/Prototypes/DeltaV/Entities/Objects/Specific/Mail/mail.yml b/Resources/Prototypes/DeltaV/Entities/Objects/Specific/Mail/mail.yml index 09b3a8ae88f..6ea56a91842 100644 --- a/Resources/Prototypes/DeltaV/Entities/Objects/Specific/Mail/mail.yml +++ b/Resources/Prototypes/DeltaV/Entities/Objects/Specific/Mail/mail.yml @@ -1555,6 +1555,8 @@ - type: Mail contents: - id: CrayonBox + - id: CrayonMagic + - prob: .10 - type: entity parent: BaseMail diff --git a/Resources/Prototypes/DeltaV/Entities/Objects/Specific/Mail/mail_civilian.yml b/Resources/Prototypes/DeltaV/Entities/Objects/Specific/Mail/mail_civilian.yml index ffc5801fc3b..5c0248f02fd 100644 --- a/Resources/Prototypes/DeltaV/Entities/Objects/Specific/Mail/mail_civilian.yml +++ b/Resources/Prototypes/DeltaV/Entities/Objects/Specific/Mail/mail_civilian.yml @@ -178,6 +178,8 @@ - id: CrayonBox - id: Paper maxAmount: 3 + - id: CrayonMagic + - prob: .2 - type: entity parent: BaseMail diff --git a/Resources/Prototypes/_NF/Entities/Objects/Fun/magic_crayon.yml b/Resources/Prototypes/_NF/Entities/Objects/Fun/magic_crayon.yml new file mode 100644 index 00000000000..35ac44cdcf5 --- /dev/null +++ b/Resources/Prototypes/_NF/Entities/Objects/Fun/magic_crayon.yml @@ -0,0 +1,31 @@ +- type: entity + parent: CrayonRainbow + id: CrayonMagic + name: magic crayon + description: Specially blended with bluespace crystals and certified non-toxic. + components: + - type: Sprite + sprite: _NF/Objects/Fun/magic_crayon.rsi + state: icon + - type: Item + sprite: _NF/Objects/Fun/magic_crayon.rsi + heldPrefix: icon + - type: Tag # Removing trash & recyclable + tags: + - Write + - Crayon + - type: Crayon + capacity: 2147483647 # int.MaxValue, infinite charges + - type: FlavorProfile + flavors: + - chewy + - magical + - type: SolutionContainerManager + solutions: + food: + reagents: + - ReagentId: Nothing + Quantity: 100 + - type: Construction + graph: magic_crayon + node: magicCrayon diff --git a/Resources/Prototypes/_NF/Recipes/Crafting/Graphs/magic_crayon.yml b/Resources/Prototypes/_NF/Recipes/Crafting/Graphs/magic_crayon.yml new file mode 100644 index 00000000000..5d5c4836781 --- /dev/null +++ b/Resources/Prototypes/_NF/Recipes/Crafting/Graphs/magic_crayon.yml @@ -0,0 +1,28 @@ +- type: constructionGraph + id: magic_crayon + start: start + graph: + - node: start + edges: + - to: magicCrayon + steps: + - material: Bluespace + amount: 1 + - tag: CrayonRed + name: red crayon + icon: + sprite: Objects/Fun/crayons.rsi + state: red + - tag: CrayonGreen + name: green crayon + icon: + sprite: Objects/Fun/crayons.rsi + state: green + - tag: CrayonBlue + name: blue crayon + icon: + sprite: Objects/Fun/crayons.rsi + state: blue + doAfter: 5 + - node: magicCrayon + entity: CrayonMagic diff --git a/Resources/Prototypes/_NF/Recipes/Crafting/magic_crayon.yml b/Resources/Prototypes/_NF/Recipes/Crafting/magic_crayon.yml new file mode 100644 index 00000000000..cb26164f471 --- /dev/null +++ b/Resources/Prototypes/_NF/Recipes/Crafting/magic_crayon.yml @@ -0,0 +1,10 @@ +- type: construction + name: Magic Crayon + id: CrayonMagic + graph: magic_crayon + startNode: start + targetNode: magicCrayon + category: construction-category-misc + description: A crayon that lasts forever! Pretty too + icon: { sprite: _NF/Objects/Fun/magic_crayon.rsi, state: icon } + objectType: Item diff --git a/Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/icon-inhand-left.png b/Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/icon-inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..a88404f0b202b9e258fa00a6f96b8050115f52a9 GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^2|(Py!3-o1GtKD$QbGYfA+A9B7Q=srh5t(aG5jm$ z|IfsKP?W7C$S;`TzYY*S=}ia)iX?lwIEG|2zP-7T_kaNhi$l-bzv1VYChqUJ zq*AWCX(3CkD8q;B#pl27J@-}eUikUX{MtSjGMl2TeFg6IUjXX2TXk6PPsMe%Bv3hnr>mdKI;Vst08%nbKmY&$ literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/icon-inhand-right.png b/Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/icon-inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..c337641453062383276b3656a5dc5c51dfa0db23 GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^2|(Py!3-o1GtKD$QbGYfA+A80Vd1}94FCTX^OyW% z_|L?|Z5)vY6l5z2@(X6r`LFZ;zxCrhIiN_Ar;B4qM&sLCJ9!Tn@Gv|4yj}k^rE!Mq z1hswHyp3AE4xtPOJfrUK?-zZRK4ZS_ll}?&=da&7fBl4bMR^8>zH9dX`tSEDnKW&1 y^p@W9-ejRMBg29BFIlS?85pKWE1SE0c*8V3k>Tn5BWJ}xuJUyCb6Mw<&;$U=o=Ecm literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/icon.png b/Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c520ae932500b2757cd8b4ced4aeb6d3e4ef40ac GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3-pya`gKGDct~{5LX~Q)A$U7@tK(n{}~ov zVqo~+wq2BA`}<=(Y%8A0Uayq-|A}E0P;@fGEe3`M@8_8UHSm`N`2{olM*&ZJ=Pd(D z^?JHEhGaCpy>$8$@nJHL#E$=kopU0tg)~^Lo?dq8lHa9hRnJT789y<9lKmw5 zsqmFFPx$=@7QfkkFV8pFf6UDPd-T2H*~@>gy?yD~%epUiFYEl@KhNCX^j-5s_=WWg z=Bs#4QmMUI)leGz_gB)(zwVEI^Dp_X>G^;EgfIWOft127`Ca)h)IBfNn;!~i;g#0a R1iGAo!PC{xWt~$(69CTof<6EM literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/meta.json b/Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/meta.json new file mode 100644 index 00000000000..21fc89b91f5 --- /dev/null +++ b/Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/meta.json @@ -0,0 +1,46 @@ +{ + "version": 1, + "license": "CC-BY-SA-4.0", + "copyright": "Taken from tgstation and modified by Swept at commit https://github.com/tgstation/tgstation/commit/c6e3401f2e7e1e55c57060cdf956a98ef1fefc24, tweaked by Ubaser and whatston3 (GitHub)", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon", + "delays": [ + [ + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2 + ] + ] + }, + { + "name": "icon-inhand-left", + "directions": 4, + "delays": [ + [ 0.2, 0.2, 0.2 ], + [ 0.2, 0.2, 0.2 ], + [ 0.2, 0.2, 0.2 ], + [ 0.2, 0.2, 0.2 ] + ] + }, + { + "name": "icon-inhand-right", + "directions": 4, + "delays": [ + [ 0.2, 0.2, 0.2 ], + [ 0.2, 0.2, 0.2 ], + [ 0.2, 0.2, 0.2 ], + [ 0.2, 0.2, 0.2 ] + ] + } + ] +} +