Skip to content

Commit

Permalink
Halloween: Cauldron to replace deep fryers (#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
arimah authored Oct 17, 2024
1 parent 4eda96d commit 79626e3
Show file tree
Hide file tree
Showing 23 changed files with 238 additions and 1 deletion.
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 @@ -329,4 +329,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.

0 comments on commit 79626e3

Please sign in to comment.