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

Halloween: Cauldron to replace deep fryers #2240

Merged
merged 4 commits into from
Oct 17, 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
3 changes: 3 additions & 0 deletions Content.Server/Holiday/HolidayPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public sealed partial class HolidayPrototype : IPrototype
[DataField("celebrate")]
private IHolidayCelebrate? _celebrate = null;

[DataField("entityReplacements")] // Frontier
public Dictionary<EntProtoId, EntProtoId>? EntityReplacements = null; // Frontier

public bool ShouldCelebrate(DateTime date)
{
return _shouldCelebrate.ShouldCelebrate(date, this);
Expand Down
16 changes: 16 additions & 0 deletions Content.Server/Holiday/HolidaySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Shared.CCVar;
using Content.Shared.Holiday;
using Robust.Shared.Configuration;
using Robust.Shared.Map.Events;
using Robust.Shared.Prototypes;

namespace Content.Server.Holiday
Expand All @@ -26,6 +27,7 @@ public override void Initialize()
Subs.CVar(_configManager, CCVars.HolidaysEnabled, OnHolidaysEnableChange);
SubscribeLocalEvent<GameRunLevelChangedEvent>(OnRunLevelChanged);
SubscribeLocalEvent<HolidayVisualsComponent, ComponentInit>(OnVisualsInit);
SubscribeLocalEvent<BeforeEntityReadEvent>(OnBeforeRead);
}

public void RefreshCurrentHolidays()
Expand Down Expand Up @@ -115,6 +117,20 @@ private void OnVisualsInit(Entity<HolidayVisualsComponent> ent, ref ComponentIni
break;
}
}

private void OnBeforeRead(BeforeEntityReadEvent ev)
{
foreach (var holiday in _currentHolidays)
{
if (holiday.EntityReplacements is { } replacements)
{
foreach (var (original, replacement) in replacements)
{
ev.RenamedPrototypes.TryAdd(original, replacement);
}
}
}
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,18 @@
machine_board: !type:Container
machine_parts: !type:Container
- type: PowerSwitch

# Frontier: Halloween special
- type: entity
id: KitchenDeepFryerCauldron
parent: KitchenDeepFryer
name: cauldron
description: A mysterious and mystical cauldron, sputtering with magical energy. Or is that oil?
suffix: Holiday Special
components:
- type: Sprite
sprite: _NF/Structures/Machines/cauldron.rsi
snapCardinals: true
- type: SolutionContainerVisuals
maxFillLevels: 8
# End Frontier
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,14 @@
suffix: POI
components:
- type: Machine
board: Null
board: Null

- type: entity
id: KitchenDeepFryerCauldronPOI
parent:
- BaseStructureDisableToolUse
- KitchenDeepFryerCauldron
suffix: Holiday Special, POI
components:
- type: Machine
board: null
3 changes: 3 additions & 0 deletions Resources/Prototypes/holidays.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@
greet:
!type:Custom
text: holiday-custom-halloween
entityReplacements: # Frontier
KitchenDeepFryer: KitchenDeepFryerCauldron # Frontier
KitchenDeepFryerPOI: KitchenDeepFryerCauldronPOI # Frontier

- type: holiday
id: VeganDay
Expand Down
190 changes: 190 additions & 0 deletions Resources/Textures/_NF/Structures/Machines/cauldron.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Made by Bing Guss (gentlebutter) for Frontier Station 14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "off-0"
},
{
"name": "off-1"
},
{
"name": "off-2"
},
{
"name": "off-3"
},
{
"name": "off-4"
},
{
"name": "off-5"
},
{
"name": "off-6"
},
{
"name": "off-7"
},
{
"name": "off-8"
},
{
"name": "on-1",
"delays": [
[
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125
]
]
},
{
"name": "on-2",
"delays": [
[
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125
]
]
},
{
"name": "on-3",
"delays": [
[
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125
]
]
},
{
"name": "on-4",
"delays": [
[
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125
]
]
},
{
"name": "on-5",
"delays": [
[
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125
]
]
},
{
"name": "on-6",
"delays": [
[
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125
]
]
},
{
"name": "on-7",
"delays": [
[
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125
]
]
},
{
"name": "on-8",
"delays": [
[
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125,
0.125
]
]
}
]
}
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.
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.
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.
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.
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.
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