Experimental Anomaly Vessel (#22233)

* experimental anomaly vessel

* sprote changes
This commit is contained in:
Nemanja
2023-12-08 13:50:41 -05:00
committed by GitHub
parent ea441ae876
commit e7e7974a24
20 changed files with 112 additions and 33 deletions

View File

@@ -20,7 +20,6 @@ public sealed partial class AnomalySystem
{
SubscribeLocalEvent<AnomalyVesselComponent, ComponentShutdown>(OnVesselShutdown);
SubscribeLocalEvent<AnomalyVesselComponent, MapInitEvent>(OnVesselMapInit);
SubscribeLocalEvent<AnomalyVesselComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<AnomalyVesselComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing);
SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined);
@@ -68,12 +67,6 @@ public sealed partial class AnomalySystem
UpdateVesselAppearance(uid, component);
}
private void OnRefreshParts(EntityUid uid, AnomalyVesselComponent component, RefreshPartsEvent args)
{
var modifierRating = args.PartRatings[component.MachinePartPointModifier] - 1;
component.PointMultiplier = MathF.Pow(component.PartRatingPointModifier, modifierRating);
}
private void OnUpgradeExamine(EntityUid uid, AnomalyVesselComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("anomaly-vessel-component-upgrade-output", component.PointMultiplier);
@@ -93,6 +86,7 @@ public sealed partial class AnomalySystem
component.Anomaly = scanner.ScannedAnomaly;
anomalyComponent.ConnectedVessel = uid;
_radiation.SetSourceEnabled(uid, true);
UpdateVesselAppearance(uid, component);
Popup.PopupEntity(Loc.GetString("anomaly-vessel-component-anomaly-assigned"), uid);
}
@@ -120,6 +114,7 @@ public sealed partial class AnomalySystem
component.Anomaly = null;
UpdateVesselAppearance(ent, component);
_radiation.SetSourceEnabled(ent, false);
if (!args.Supercritical)
continue;