Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add magic crayon #2157

Merged
merged 8 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Content.Client/Crayon/CrayonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ protected override void FrameUpdate(FrameEventArgs args)
}

_parent.UIUpdateNeeded = false;

// Frontier: unlimited crayon
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

_label.SetMarkup(Robust.Shared.Localization.Loc.GetString("crayon-drawing-label",
("color",_parent.Color),
("state",_parent.SelectedState),
Expand Down
12 changes: 8 additions & 4 deletions Content.Server/Crayon/CrayonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;

namespace Content.Server.Crayon;
Expand Down Expand Up @@ -74,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
if (component.Charges != int.MaxValue)
{
// Decrease "Ammo"
component.Charges--;
Dirty(uid, component);
}
// End Frontier

_adminLogger.Add(LogType.CrayonDraw, LogImpact.Low, $"{EntityManager.ToPrettyString(args.User):user} drew a {component.Color:color} {component.SelectedState}");
args.Handled = true;
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_NF/crayon/crayon-component.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
crayon-drawing-label-unlimited = Drawing: [color={$color}]{$state}[/color]
28 changes: 28 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,28 @@
- 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: 40
dvir001 marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions Resources/Prototypes/_NF/Loadouts/Jobs/Contractor/fun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,12 @@
price: 10000
inhand:
- PetCarrierNPCEmotionalSupportSafe

- type: loadout
id: ContractorCrayonMagic
effects:
- !type:GroupLoadoutEffect
proto: ContractorT3
price: 30000
inhand:
- CrayonMagic
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@
- ContractorDawInstrumentFlatpack
- ContractorHoverbikeFlatpack
- ContractorEmotionalPetCarrier
- ContractorCrayonMagic

- type: loadoutGroup
id: ContractorFace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from Paradise Station",
"copyright": "Taken from Paradise (toy.dmi) at https://github.com/ParadiseSS13/Paradise/tree/dab6fc55044e4a86d2107629cf148229001c7cd2",
"size": {
"x": 32,
"y": 32
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from Paradise Station",
"copyright": "Taken from Paradise (toy.dmi) at https://github.com/ParadiseSS13/Paradise/tree/dab6fc55044e4a86d2107629cf148229001c7cd2",
"size": {
"x": 32,
"y": 32
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from Paradise Station",
"copyright": "Taken from Paradise (toy.dmi) at https://github.com/ParadiseSS13/Paradise/tree/dab6fc55044e4a86d2107629cf148229001c7cd2",
"size": {
"x": 32,
"y": 32
Expand Down
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 ]
]
}
]
}

2 changes: 1 addition & 1 deletion Resources/Textures/_NF/Objects/Fun/petrock.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from Paradise Station",
"copyright": "Taken from Paradise (toy.dmi) at https://github.com/ParadiseSS13/Paradise/tree/dab6fc55044e4a86d2107629cf148229001c7cd2",
"size": {
"x": 32,
"y": 32
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from Paradise Station",
"copyright": "Taken from Paradise (arcade.dmi) at https://github.com/ParadiseSS13/Paradise/tree/dab6fc55044e4a86d2107629cf148229001c7cd2",
"size": {
"x": 32,
"y": 32
Expand Down
2 changes: 1 addition & 1 deletion Resources/Textures/_NF/Objects/Fun/toys.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "plushie_jester, plushie_trystan, plushie_vulp: gentlejester-148196053781315584 / plushie_slips: mintymoo-449394523089403905 / gnome/ipc/grey/loveable/abductor/abductor_agent/deer - Taken from Paradise Station",
"copyright": "plushie_jester, plushie_trystan, plushie_vulp: gentlejester-148196053781315584 / plushie_slips: mintymoo-449394523089403905 / gnome/ipc/grey/loveable/abductor/abductor_agent/deer - Taken from Paradise (toy.dmi) at https://github.com/ParadiseSS13/Paradise/tree/dab6fc55044e4a86d2107629cf148229001c7cd2",
"size": {
"x": 32,
"y": 32
Expand Down
Loading