Torches + Cotton (#1246)
* torches add, wallmount crystals deletion * cotton * Update buy.yml * craftis * delete elemental quartz * energy crystal resprite and rewamp * fix * Update misc.yml * а * delete rituals * riat * Update migration.yml * Delete CP14ClientRitualSystem.cs * Update statues.yml * fix * Update wallmount_lamp.yml * fix
This commit is contained in:
@@ -59,7 +59,7 @@ public partial class CP14MagicEnergySystem
|
||||
if (TryComp<MobStateComponent>(uid, out var mobState) && !_mobState.IsAlive(uid, mobState))
|
||||
continue;
|
||||
|
||||
draw.NextUpdateTime = _gameTiming.CurTime + TimeSpan.FromSeconds(draw.Delay);
|
||||
draw.NextUpdateTime += TimeSpan.FromSeconds(draw.Delay);
|
||||
|
||||
ChangeEnergy((uid, magicContainer), draw.Energy, out _, out _, draw.Safe);
|
||||
}
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
using Content.Shared._CP14.MagicRitual;
|
||||
using Content.Shared._CP14.MagicRitualTrigger.Triggers;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Whitelist;
|
||||
|
||||
namespace Content.Server._CP14.MagicRitualTrigger;
|
||||
|
||||
|
||||
public partial class CP14RitualTriggerSystem
|
||||
{
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
||||
|
||||
private void InitializeSacrifice()
|
||||
{
|
||||
SubscribeLocalEvent<MobStateChangedEvent>(OnMobStateChanged);
|
||||
}
|
||||
|
||||
private void OnMobStateChanged(MobStateChangedEvent ev)
|
||||
{
|
||||
if (ev.NewMobState != MobState.Dead)
|
||||
return;
|
||||
|
||||
var deathXform = Transform(ev.Target);
|
||||
|
||||
SacrificeSpecies(ev, deathXform);
|
||||
SacrificeWhitelist(ev, deathXform);
|
||||
}
|
||||
|
||||
private void SacrificeSpecies(MobStateChangedEvent ev, TransformComponent deathXform)
|
||||
{
|
||||
|
||||
if (!TryComp<HumanoidAppearanceComponent>(ev.Target, out var humanoid))
|
||||
return;
|
||||
|
||||
var query = EntityQueryEnumerator<CP14RitualSacrificeSpeciesTriggerComponent, CP14MagicRitualPhaseComponent, TransformComponent>();
|
||||
while (query.MoveNext(out var uid, out var sacrifice, out var phase, out var xform))
|
||||
{
|
||||
if (!deathXform.Coordinates.TryDistance(EntityManager, xform.Coordinates, out var distance))
|
||||
continue;
|
||||
|
||||
foreach (var trigger in sacrifice.Triggers)
|
||||
{
|
||||
if (distance > trigger.Range)
|
||||
continue;
|
||||
|
||||
if (trigger.Edge is null)
|
||||
continue;
|
||||
|
||||
if (trigger.Species != humanoid.Species)
|
||||
continue;
|
||||
|
||||
TriggerRitualPhase((uid, phase), trigger.Edge.Value.Target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SacrificeWhitelist(MobStateChangedEvent ev, TransformComponent deathXform)
|
||||
{
|
||||
var query = EntityQueryEnumerator<CP14RitualSacrificeWhitelistTriggerComponent, CP14MagicRitualPhaseComponent, TransformComponent>();
|
||||
while (query.MoveNext(out var uid, out var sacrifice, out var phase, out var xform))
|
||||
{
|
||||
if (!deathXform.Coordinates.TryDistance(EntityManager, xform.Coordinates, out var distance))
|
||||
continue;
|
||||
|
||||
foreach (var trigger in sacrifice.Triggers)
|
||||
{
|
||||
if (distance > trigger.Range)
|
||||
continue;
|
||||
|
||||
if (trigger.Edge is null)
|
||||
continue;
|
||||
|
||||
var entProto = MetaData(ev.Target).EntityPrototype;
|
||||
|
||||
if (entProto is null)
|
||||
continue;
|
||||
|
||||
if (!_whitelist.IsValid(trigger.Whitelist, ev.Target))
|
||||
continue;
|
||||
|
||||
TriggerRitualPhase((uid, phase), trigger.Edge.Value.Target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using Content.Shared._CP14.MagicRitual;
|
||||
using Content.Shared._CP14.MagicRitualTrigger.Triggers;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server._CP14.MagicRitualTrigger;
|
||||
|
||||
|
||||
public partial class CP14RitualTriggerSystem
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
|
||||
private void InitializeTimer()
|
||||
{
|
||||
SubscribeLocalEvent<CP14RitualTimerTriggerComponent, MapInitEvent>(OnMapInit);
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<CP14RitualTimerTriggerComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
foreach (var trigger in ent.Comp.Triggers)
|
||||
{
|
||||
trigger.TriggerTime = _timing.CurTime + TimeSpan.FromSeconds(trigger.Delay);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTimer(float frameTime)
|
||||
{
|
||||
var query = EntityQueryEnumerator<CP14RitualTimerTriggerComponent, CP14MagicRitualPhaseComponent>();
|
||||
while (query.MoveNext(out var uid, out var timer, out var phase))
|
||||
{
|
||||
foreach (var trigger in timer.Triggers)
|
||||
{
|
||||
if (_timing.CurTime < trigger.TriggerTime || trigger.TriggerTime == TimeSpan.Zero)
|
||||
continue;
|
||||
|
||||
if (trigger.Edge is null)
|
||||
continue;
|
||||
|
||||
TriggerRitualPhase((uid, phase), trigger.Edge.Value.Target);
|
||||
trigger.TriggerTime = TimeSpan.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Content.Server.Speech;
|
||||
using Content.Shared._CP14.MagicRitual;
|
||||
using Content.Shared._CP14.MagicRitualTrigger.Triggers;
|
||||
|
||||
namespace Content.Server._CP14.MagicRitualTrigger;
|
||||
|
||||
public partial class CP14RitualTriggerSystem
|
||||
{
|
||||
private void InitializeVoice()
|
||||
{
|
||||
SubscribeLocalEvent<CP14RitualVoiceTriggerComponent, ListenEvent>(OnListenEvent);
|
||||
}
|
||||
|
||||
private void OnListenEvent(Entity<CP14RitualVoiceTriggerComponent> ent, ref ListenEvent args)
|
||||
{
|
||||
if (!TryComp<CP14MagicRitualPhaseComponent>(ent, out var phase))
|
||||
return;
|
||||
|
||||
// Lowercase the phrase and remove all punctuation marks
|
||||
var message = Regex.Replace(args.Message.Trim().ToLower(), @"[^\w\s]", "");
|
||||
|
||||
foreach (var trigger in ent.Comp.Triggers)
|
||||
{
|
||||
var triggerMessage = Regex.Replace(trigger.Message.ToLower(), @"[^\w\s]", "");
|
||||
|
||||
if (triggerMessage != message)
|
||||
continue;
|
||||
|
||||
if (trigger.Edge is null)
|
||||
continue;
|
||||
|
||||
TriggerRitualPhase((ent.Owner, phase), trigger.Edge.Value.Target);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using Content.Shared._CP14.MagicRitual;
|
||||
using Content.Shared._CP14.MagicRitualTrigger;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server._CP14.MagicRitualTrigger;
|
||||
|
||||
public partial class CP14RitualTriggerSystem : CP14SharedRitualTriggerSystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
InitializeTimer();
|
||||
InitializeVoice();
|
||||
InitializeSacrifice();
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
UpdateTimer(frameTime);
|
||||
}
|
||||
|
||||
private void TriggerRitualPhase(Entity<CP14MagicRitualPhaseComponent> ent, EntProtoId nextPhase)
|
||||
{
|
||||
var evConfirmed = new CP14RitualTriggerEvent(nextPhase);
|
||||
RaiseLocalEvent(ent, evConfirmed);
|
||||
}
|
||||
}
|
||||
@@ -1,167 +0,0 @@
|
||||
using System.Text;
|
||||
using Content.Server._CP14.MagicRituals.Components;
|
||||
using Content.Shared._CP14.MagicRitual;
|
||||
using Content.Shared.Paper;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server._CP14.MagicRituals;
|
||||
|
||||
public sealed partial class CP14RitualSystem
|
||||
{
|
||||
[Dependency] private readonly PaperSystem _paper = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
private void InitializeDescriber()
|
||||
{
|
||||
|
||||
SubscribeLocalEvent<CP14PaperPhaseDescriberComponent, GetVerbsEvent<Verb>>(OnDescriberVerbs);
|
||||
SubscribeLocalEvent<CP14PaperPhaseDescriberComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<CP14PaperPhaseDescriberComponent, ComponentShutdown>(OnShutdown);
|
||||
}
|
||||
|
||||
private void OnShutdown(Entity<CP14PaperPhaseDescriberComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
QueueDel(ent.Comp.CurrentPhase);
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<CP14PaperPhaseDescriberComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
SetPhase(ent, ent.Comp.StartPhase);
|
||||
}
|
||||
|
||||
private void SetPhase(Entity<CP14PaperPhaseDescriberComponent> ent, EntProtoId newProto, bool saveHistory = true)
|
||||
{
|
||||
var oldPhase = ent.Comp.CurrentPhase;
|
||||
if (oldPhase is not null && saveHistory)
|
||||
{
|
||||
var oldProto = MetaData(oldPhase.Value).EntityPrototype;
|
||||
if (oldProto is not null && oldProto != newProto)
|
||||
{
|
||||
ent.Comp.SearchHistory.Add(oldProto);
|
||||
if (ent.Comp.SearchHistory.Count > 50)
|
||||
ent.Comp.SearchHistory.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
QueueDel(oldPhase);
|
||||
var newPhase = Spawn(newProto, MapCoordinates.Nullspace);
|
||||
|
||||
ent.Comp.CurrentPhase = newPhase;
|
||||
|
||||
if (!TryComp<PaperComponent>(ent, out var paper))
|
||||
return;
|
||||
|
||||
_paper.SetContent((ent, paper), GetPhaseDescription(newPhase));
|
||||
_audio.PlayPvs(ent.Comp.UseSound, ent);
|
||||
}
|
||||
|
||||
private void BackPhase(Entity<CP14PaperPhaseDescriberComponent> ent)
|
||||
{
|
||||
if (ent.Comp.SearchHistory.Count > 0)
|
||||
SetPhase(ent, ent.Comp.SearchHistory[^1], false);
|
||||
}
|
||||
|
||||
private void OnDescriberVerbs(Entity<CP14PaperPhaseDescriberComponent> ent, ref GetVerbsEvent<Verb> args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
|
||||
if (!TryComp<CP14MagicRitualPhaseComponent>(ent.Comp.CurrentPhase, out var phase))
|
||||
return;
|
||||
|
||||
if (!TryComp<CP14MagicRitualPhaseComponent>(ent.Comp.CurrentPhase.Value, out var phaseComp))
|
||||
return;
|
||||
|
||||
foreach (var edge in phaseComp.Edges)
|
||||
{
|
||||
if (!_proto.TryIndex(edge.Target, out var indexedTarget))
|
||||
continue;
|
||||
|
||||
Verb verb = new()
|
||||
{
|
||||
Text = Loc.GetString("cp14-ritual-describer-verb-item", ("name", indexedTarget.Name)),
|
||||
Category = VerbCategory.CP14RitualBook,
|
||||
Priority = 1,
|
||||
Act = () => SetPhase(ent, edge.Target),
|
||||
};
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
foreach (var hyperlink in ent.Comp.Hyperlinks)
|
||||
{
|
||||
if (!_proto.TryIndex(hyperlink, out var indexedTarget))
|
||||
continue;
|
||||
|
||||
Verb verb = new()
|
||||
{
|
||||
Text = Loc.GetString("cp14-ritual-describer-verb-hyperlink", ("name", indexedTarget.Name)),
|
||||
Category = VerbCategory.CP14RitualBook,
|
||||
Priority = 0,
|
||||
Act = () => SetPhase(ent, hyperlink),
|
||||
};
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
if (ent.Comp.SearchHistory.Count > 0)
|
||||
{
|
||||
Verb verb = new()
|
||||
{
|
||||
Text = Loc.GetString("cp14-ritual-describer-verb-back"),
|
||||
Category = VerbCategory.CP14RitualBook,
|
||||
Priority = -1,
|
||||
Act = () => BackPhase(ent),
|
||||
};
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetPhaseDescription(EntityUid uid)
|
||||
{
|
||||
if (!TryComp<CP14MagicRitualPhaseComponent>(uid, out var phase))
|
||||
return string.Empty;
|
||||
|
||||
return GetPhaseDescription((uid, phase));
|
||||
}
|
||||
|
||||
private string GetPhaseDescription(Entity<CP14MagicRitualPhaseComponent> ent)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append($"[color=#e6a132][head=1]{MetaData(ent).EntityName}[/head][/color] \n \n");
|
||||
sb.Append($"[italic]{MetaData(ent).EntityDescription}[/italic] \n \n");
|
||||
|
||||
sb.Append(Loc.GetString("cp14-ritual-intro") + "\n \n \n");
|
||||
foreach (var edge in ent.Comp.Edges)
|
||||
{
|
||||
if (!_proto.TryIndex(edge.Target, out var targetIndexed))
|
||||
continue;
|
||||
|
||||
sb.Append($"[color=#b5783c][head=3]{targetIndexed.Name}[/head][/color]" + "\n");
|
||||
|
||||
//TRIGGERS
|
||||
if (edge.Triggers.Count > 0)
|
||||
{
|
||||
sb.Append($"[bold]{Loc.GetString("cp14-ritual-trigger-header")}[/bold] \n");
|
||||
foreach (var trigger in edge.Triggers)
|
||||
sb.Append(trigger.GetGuidebookTriggerDescription(_proto, _entitySystem) + "\n");
|
||||
}
|
||||
|
||||
//REQUIREMENTS
|
||||
if (edge.Requirements.Count > 0)
|
||||
{
|
||||
sb.Append($"[bold]{Loc.GetString("cp14-ritual-req-header")}[/bold] \n");
|
||||
foreach (var req in edge.Requirements)
|
||||
sb.Append(req.GetGuidebookRequirementDescription(_proto, _entitySystem) + "\n");
|
||||
}
|
||||
|
||||
//ACTIONS
|
||||
if (edge.Actions.Count > 0)
|
||||
{
|
||||
sb.Append($"[bold]{Loc.GetString("cp14-ritual-effect-header")}[/bold] \n");
|
||||
foreach (var act in edge.Actions)
|
||||
sb.Append(act.GetGuidebookEffectDescription(_proto, _entitySystem) + "\n");
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using Content.Shared._CP14.MagicRitual;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server._CP14.MagicRituals;
|
||||
|
||||
public sealed partial class CP14RitualSystem
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
private void InitializeVisuals()
|
||||
{
|
||||
SubscribeLocalEvent<CP14MagicRitualPhaseComponent, CP14RitualPhaseBoundEvent>(OnPhaseBound);
|
||||
}
|
||||
|
||||
private void OnPhaseBound(Entity<CP14MagicRitualPhaseComponent> ent, ref CP14RitualPhaseBoundEvent args)
|
||||
{
|
||||
if (!TryComp<CP14MagicRitualComponent>(args.Ritual, out var ritual))
|
||||
return;
|
||||
|
||||
_pointLight.SetColor(ent, ent.Comp.PhaseColor);
|
||||
_appearance.SetData(args.Ritual, RitualVisuals.Color, ent.Comp.PhaseColor);
|
||||
}
|
||||
}
|
||||
@@ -1,201 +0,0 @@
|
||||
using System.Text;
|
||||
using Content.Server.Speech.Components;
|
||||
using Content.Shared._CP14.MagicRitual;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server._CP14.MagicRituals;
|
||||
|
||||
public partial class CP14RitualSystem : CP14SharedRitualSystem
|
||||
{
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
|
||||
[Dependency] private readonly PointLightSystem _pointLight = default!;
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly TransformSystem _transform = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
InitializeDescriber();
|
||||
InitializeVisuals();
|
||||
|
||||
SubscribeLocalEvent<CP14MagicRitualComponent, CP14ActivateRitualDoAfter>(OnActivateRitual);
|
||||
SubscribeLocalEvent<CP14MagicRitualComponent, GetVerbsEvent<AlternativeVerb>>(OnAlternativeVerb);
|
||||
|
||||
SubscribeLocalEvent<CP14MagicRitualPhaseComponent, CP14RitualTriggerEvent>(OnPhaseTrigger);
|
||||
|
||||
SubscribeLocalEvent<CP14MagicRitualOrbComponent, ExaminedEvent>(OnOrbExamine);
|
||||
}
|
||||
|
||||
private void OnActivateRitual(Entity<CP14MagicRitualComponent> ent, ref CP14ActivateRitualDoAfter args)
|
||||
{
|
||||
//if (args.Cancelled || args.Handled)
|
||||
// return;
|
||||
//
|
||||
//args.Handled = true;
|
||||
//
|
||||
//StartRitual(ent);
|
||||
}
|
||||
|
||||
private void OnAlternativeVerb(Entity<CP14MagicRitualComponent> ent, ref GetVerbsEvent<AlternativeVerb> args)
|
||||
{
|
||||
//if (!args.CanInteract || ent.Comp.CurrentPhase is not null)
|
||||
// return;
|
||||
//
|
||||
//var user = args.User;
|
||||
//AlternativeVerb verb = new()
|
||||
//{
|
||||
// Act = () =>
|
||||
// {
|
||||
// var doAfterArgs =
|
||||
// new DoAfterArgs(EntityManager, user, ent.Comp.ActivationTime, new CP14ActivateRitualDoAfter(), ent, ent)
|
||||
// {
|
||||
// BreakOnDamage = true,
|
||||
// BreakOnMove = true,
|
||||
// };
|
||||
//
|
||||
// _doAfter.TryStartDoAfter(doAfterArgs);
|
||||
// },
|
||||
// Text = Loc.GetString("cp14-ritual-verb-text"),
|
||||
// Priority = 1,
|
||||
//};
|
||||
//args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
private void OnOrbExamine(Entity<CP14MagicRitualOrbComponent> ent, ref ExaminedEvent args)
|
||||
{
|
||||
//var sb = new StringBuilder();
|
||||
//sb.Append(Loc.GetString("cp14-ritual-orb-examine", ("name", MetaData(ent).EntityName)) + "\n");
|
||||
//foreach (var orbType in ent.Comp.Powers)
|
||||
//{
|
||||
// if (!_proto.TryIndex(orbType.Key, out var indexedType))
|
||||
// continue;
|
||||
//
|
||||
// sb.Append($"[color={indexedType.Color.ToHex()}]");
|
||||
// sb.Append(Loc.GetString("cp14-ritual-entry-item",
|
||||
// ("name", Loc.GetString(indexedType.Name)),
|
||||
// ("count", orbType.Value)));
|
||||
// sb.Append($"[/color] \n");
|
||||
//}
|
||||
//
|
||||
//args.PushMarkup(sb.ToString());
|
||||
}
|
||||
|
||||
private void OnPhaseTrigger(Entity<CP14MagicRitualPhaseComponent> phase, ref CP14RitualTriggerEvent args)
|
||||
{
|
||||
//if (phase.Comp.Ritual is null)
|
||||
// return;
|
||||
//
|
||||
//if (!TryComp<CP14MagicRitualComponent>(phase, out var ritualComp))
|
||||
// return;
|
||||
//
|
||||
//RitualPhaseEdge? selectedEdge = null;
|
||||
//foreach (var edge in phase.Comp.Edges)
|
||||
//{
|
||||
// if (edge.Target == args.NextPhase)
|
||||
// {
|
||||
// selectedEdge = edge;
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//if (selectedEdge is null)
|
||||
// return;
|
||||
//
|
||||
//var passed = true;
|
||||
//foreach (var req in selectedEdge.Value.Requirements)
|
||||
//{
|
||||
// if (!req.Check(EntityManager, phase, ritualComp.Stability)) //lol
|
||||
// {
|
||||
// ChangeRitualStability(phase.Comp.Ritual.Value, -req.FailStabilityCost);
|
||||
// passed = false;
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//if (!passed)
|
||||
// return;
|
||||
//
|
||||
//foreach (var action in selectedEdge.Value.Actions)
|
||||
//{
|
||||
// action.Effect(EntityManager, _transform, phase);
|
||||
//}
|
||||
//
|
||||
//ChangePhase(phase.Comp.Ritual.Value, args.NextPhase);
|
||||
}
|
||||
|
||||
public void StartRitual(EntityUid uid, CP14MagicRitualComponent? ritual = null)
|
||||
{
|
||||
//if (!Resolve(uid, ref ritual, false))
|
||||
// return;
|
||||
//
|
||||
//EndRitual(uid);
|
||||
//
|
||||
//var ev = new CP14RitualStartEvent(uid);
|
||||
//RaiseLocalEvent(uid, ev);
|
||||
//
|
||||
//ChangePhase(uid, ritual.StartPhase);
|
||||
//_appearance.SetData(uid, RitualVisuals.Enabled, true);
|
||||
}
|
||||
|
||||
private void ChangePhase(EntityUid uid, EntProtoId newPhase, CP14MagicRitualComponent? ritual = null)
|
||||
{
|
||||
//if (!Resolve(uid, ref ritual, false))
|
||||
// return;
|
||||
//
|
||||
//QueueDel(ritual.CurrentPhase);
|
||||
//
|
||||
//var newPhaseEnt = Spawn(newPhase, Transform(uid).Coordinates);
|
||||
//_transform.SetParent(newPhaseEnt, uid);
|
||||
//var newPhaseComp = EnsureComp<CP14MagicRitualPhaseComponent>(newPhaseEnt);
|
||||
//
|
||||
//ritual.CurrentPhase = newPhaseEnt;
|
||||
//newPhaseComp.Ritual = uid;
|
||||
//
|
||||
//foreach (var edge in newPhaseComp.Edges)
|
||||
//{
|
||||
// foreach (var trigger in edge.Triggers)
|
||||
// {
|
||||
// trigger.Initialize(EntityManager, ritual.CurrentPhase.Value, edge);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//var ev = new CP14RitualPhaseBoundEvent(uid, newPhaseEnt);
|
||||
//RaiseLocalEvent(uid, ev);
|
||||
//RaiseLocalEvent(newPhaseEnt, ev);
|
||||
//
|
||||
//if (newPhaseComp.DeadEnd)
|
||||
// EndRitual(uid);
|
||||
}
|
||||
|
||||
public void EndRitual(EntityUid uid, CP14MagicRitualComponent? ritual = null)
|
||||
{
|
||||
//if (!Resolve(uid, ref ritual, false))
|
||||
// return;
|
||||
//
|
||||
//if (ritual.CurrentPhase is null)
|
||||
// return;
|
||||
//
|
||||
//QueueDel(ritual.CurrentPhase);
|
||||
//ritual.CurrentPhase = null;
|
||||
//
|
||||
//var ev = new CP14RitualEndEvent(uid);
|
||||
//RaiseLocalEvent(uid, ev);
|
||||
//
|
||||
//_appearance.SetData(uid, RitualVisuals.Enabled, false);
|
||||
//
|
||||
//foreach (var orb in ritual.Orbs)
|
||||
//{
|
||||
// QueueDel(orb);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using Content.Shared._CP14.MagicRitual;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server._CP14.MagicRituals.Components;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14RitualSystem))]
|
||||
public sealed partial class CP14PaperPhaseDescriberComponent : Component
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public EntProtoId StartPhase = default!;
|
||||
|
||||
[DataField]
|
||||
public EntityUid? CurrentPhase = null;
|
||||
|
||||
public List<EntProtoId> SearchHistory = new();
|
||||
|
||||
[DataField]
|
||||
public List<EntProtoId> Hyperlinks = new();
|
||||
|
||||
public SoundSpecifier UseSound = new SoundCollectionSpecifier("CP14Book")
|
||||
{
|
||||
Params = AudioParams.Default
|
||||
.WithVariation(0.05f)
|
||||
.WithVolume(0.5f),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -37,7 +37,10 @@ public sealed partial class CP14FireplaceComponent : Component
|
||||
public float FuelDrainingPerUpdate = 1f;
|
||||
|
||||
[DataField]
|
||||
public TimeSpan UpdateFrequency = TimeSpan.FromSeconds(2f);
|
||||
public bool DeleteOnEmpty = false;
|
||||
|
||||
[DataField]
|
||||
public TimeSpan UpdateFrequency = TimeSpan.FromSeconds(1f);
|
||||
|
||||
[DataField]
|
||||
public TimeSpan NextUpdateTime = TimeSpan.Zero;
|
||||
|
||||
@@ -88,7 +88,7 @@ public sealed partial class CP14FireplaceSystem : EntitySystem
|
||||
if (_timing.CurTime <= fireplace.NextUpdateTime)
|
||||
continue;
|
||||
|
||||
fireplace.NextUpdateTime = _timing.CurTime + fireplace.UpdateFrequency;
|
||||
fireplace.NextUpdateTime += fireplace.UpdateFrequency;
|
||||
|
||||
if (fireplace.Fuel >= fireplace.FuelDrainingPerUpdate)
|
||||
{
|
||||
@@ -102,6 +102,12 @@ public sealed partial class CP14FireplaceSystem : EntitySystem
|
||||
ConsumeFuel(uid, fireplace, fuel.Value);
|
||||
|
||||
flammable.FirestackFade = -fireplace.FireFadeDelta;
|
||||
|
||||
if (flammable.FireStacks == 0 && fireplace.DeleteOnEmpty)
|
||||
{
|
||||
QueueDel(uid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user