Ну а чо я? Я ничо
This commit is contained in:
parent
7b5d899388
commit
2a523b73d3
7 changed files with 88 additions and 1 deletions
|
|
@ -125,6 +125,7 @@ namespace Content.Client.Entry
|
|||
_prototypeManager.RegisterIgnore("nukeopsRole");
|
||||
_prototypeManager.RegisterIgnore("stationGoal"); // Sunrise-StationGoal
|
||||
_prototypeManager.RegisterIgnore("sponsorLoadout"); // Sunrise-Sponsors
|
||||
_prototypeManager.RegisterIgnore("holidayGiveawayItem"); // Sunrise-Edit
|
||||
_prototypeManager.RegisterIgnore("ghostRoleRaffleDecider");
|
||||
|
||||
_componentFactory.GenerateNetIds();
|
||||
|
|
|
|||
19
Content.Server/Holiday/HolidayGiveawayItemPrototype.cs
Normal file
19
Content.Server/Holiday/HolidayGiveawayItemPrototype.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Holiday
|
||||
{
|
||||
[Prototype("holidayGiveawayItem")]
|
||||
public sealed partial class HolidayGiveawayItemPrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
[DataField("holiday", customTypeSerializer:typeof(PrototypeIdSerializer<HolidayPrototype>))]
|
||||
public string Holiday { get; private set; } = string.Empty;
|
||||
|
||||
[DataField("prototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string Prototype { get; private set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
|
@ -38,6 +38,11 @@ namespace Content.Server.Holiday
|
|||
[DataField("greet")]
|
||||
private IHolidayGreet _greet = new DefaultHolidayGreet();
|
||||
|
||||
// Sunrise-Start
|
||||
[DataField("greetColor")]
|
||||
private Color? _color;
|
||||
// Sunrise-End
|
||||
|
||||
[DataField("celebrate")]
|
||||
private IHolidayCelebrate? _celebrate = null;
|
||||
|
||||
|
|
@ -51,6 +56,13 @@ namespace Content.Server.Holiday
|
|||
return _greet.Greet(this);
|
||||
}
|
||||
|
||||
// Sunrise-Start
|
||||
public Color? GreetColor()
|
||||
{
|
||||
return _color;
|
||||
}
|
||||
// Sunrise-End
|
||||
|
||||
/// <summary>
|
||||
/// Called before the round starts to set up any festive shenanigans.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace Content.Server.Holiday
|
|||
{
|
||||
foreach (var holiday in _currentHolidays)
|
||||
{
|
||||
_chatManager.DispatchServerAnnouncement(holiday.Greet());
|
||||
_chatManager.DispatchServerAnnouncement(holiday.Greet(), holiday.GreetColor()); // Sunrise-Edit
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Linq;
|
||||
using Content.Server.Access.Systems;
|
||||
using Content.Server.DetailExaminable;
|
||||
using Content.Server.Holiday;
|
||||
using Content.Server.Humanoid;
|
||||
using Content.Server.IdentityManagement;
|
||||
using Content.Server.Mind.Commands;
|
||||
|
|
@ -13,6 +14,7 @@ using Content.Shared.Access.Components;
|
|||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Humanoid.Prototypes;
|
||||
using Content.Shared.PDA;
|
||||
|
|
@ -226,6 +228,25 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
|
|||
{
|
||||
jobSpecial.AfterEquip(entity);
|
||||
}
|
||||
|
||||
// Sunrise-Start
|
||||
foreach (var giveaway in _prototypeManager.EnumeratePrototypes<HolidayGiveawayItemPrototype>())
|
||||
{
|
||||
if (string.IsNullOrEmpty(giveaway.Holiday) || string.IsNullOrEmpty(giveaway.Prototype))
|
||||
return;
|
||||
|
||||
var sysMan = IoCManager.Resolve<IEntitySystemManager>();
|
||||
|
||||
if (!sysMan.GetEntitySystem<HolidaySystem>().IsCurrentlyHoliday(giveaway.Holiday))
|
||||
return;
|
||||
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
var ent = entMan.SpawnEntity(giveaway.Prototype, entMan.GetComponent<TransformComponent>(entity).Coordinates);
|
||||
|
||||
sysMan.GetEntitySystem<SharedHandsSystem>().PickupOrDrop(entity, ent);
|
||||
}
|
||||
// Sunrise-End
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
holiday-name-vigers-ray-birthday = дня рождения VigersRay
|
||||
holiday-custom-vigers-ray-birthday = Сегодня день рождения у Великого и Ужасного VigersRay!
|
||||
paper-text-vigers-ray-birthday = [color=red][head=3]VigersRay приглашает вас на свой день рождения![/head][/color]
|
||||
31
Resources/Prototypes/_Sunrise/holidays.yml
Normal file
31
Resources/Prototypes/_Sunrise/holidays.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
- type: holiday
|
||||
id: VigersRayBirthday
|
||||
name: holiday-name-vigers-ray-birthday
|
||||
beginDay: 2
|
||||
beginMonth: October
|
||||
greet:
|
||||
!type:Custom
|
||||
text: holiday-custom-vigers-ray-birthday
|
||||
greetColor: gold
|
||||
|
||||
|
||||
- type: holidayGiveawayItem
|
||||
id: VigersRayBirthdayGiveawayPresent
|
||||
holiday: VigersRayBirthday
|
||||
prototype: PresentRandomInsane
|
||||
|
||||
|
||||
- type: holidayGiveawayItem
|
||||
id: VigersRayBirthdayGiveawayInvitation
|
||||
holiday: VigersRayBirthday
|
||||
prototype: PaperVigersRayBirthdayInvitation
|
||||
|
||||
|
||||
- type: entity
|
||||
id: PaperVigersRayBirthdayInvitation
|
||||
name: Приглашение на день рождения
|
||||
description: Кто-то пригласил вас на праздник...
|
||||
parent: Paper
|
||||
components:
|
||||
- type: Paper
|
||||
content: paper-text-vigers-ray-birthday
|
||||
Loading…
Add table
Reference in a new issue