Skip to content

Commit

Permalink
Port Magic Crayon From Frontier (DeltaV-Station#2410)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* untroll indent

Signed-off-by: deltanedas <[email protected]>

---------

Signed-off-by: Avalon <[email protected]>
Signed-off-by: deltanedas <[email protected]>
Co-authored-by: deltanedas <[email protected]>
  • Loading branch information
Avalon-Proto and deltanedas authored Dec 27, 2024
1 parent ae03a72 commit 9a22c09
Show file tree
Hide file tree
Showing 14 changed files with 147 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Content.Client/Crayon/CrayonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
11 changes: 8 additions & 3 deletions Content.Server/Crayon/CrayonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions Resources/Locale/en-US/_NF/crayon/crayon-component.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

## Entity

crayon-drawing-label-unlimited = Drawing: [color={$color}]{$state}[/color]
2 changes: 2 additions & 0 deletions Resources/Prototypes/Catalog/Fills/Items/toolboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Catalog/Fills/Lockers/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,8 @@
- type: Mail
contents:
- id: CrayonBox
- id: CrayonMagic
- prob: .10

- type: entity
parent: BaseMail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@
- id: CrayonBox
- id: Paper
maxAmount: 3
- id: CrayonMagic
- prob: .2

- type: entity
parent: BaseMail
Expand Down
31 changes: 31 additions & 0 deletions Resources/Prototypes/_NF/Entities/Objects/Fun/magic_crayon.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions Resources/Prototypes/_NF/Recipes/Crafting/Graphs/magic_crayon.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions Resources/Prototypes/_NF/Recipes/Crafting/magic_crayon.yml
Original file line number Diff line number Diff line change
@@ -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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions Resources/Textures/_NF/Objects/Fun/magic_crayon.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -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 ]
]
}
]
}

0 comments on commit 9a22c09

Please sign in to comment.