Skip to content

Commit

Permalink
fix a lot of things (Heretics newstore fix)
Browse files Browse the repository at this point in the history
Точнее части которые не меняют магазин

Co-Authored-By: username <[email protected]>
  • Loading branch information
1 parent 5bf334e commit ed583be
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
using Content.Shared.Damage;
using Content.Shared.Atmos;
using Content.Server.Polymorph.Systems;
using Content.Server.Temperature.Components;
using Content.Shared.Temperature.Components;
using Content.Server.Body.Components;
using Content.Shared.Armor;

namespace Content.Server.Heretic.Abilities;

Expand All @@ -20,6 +24,8 @@ private void SubscribeAsh()
SubscribeLocalEvent<HereticComponent, EventHereticNightwatcherRebirth>(OnNWRebirth);
SubscribeLocalEvent<HereticComponent, EventHereticFlames>(OnFlames);
SubscribeLocalEvent<HereticComponent, EventHereticCascade>(OnCascade);

SubscribeLocalEvent<HereticComponent, HereticAscensionAshEvent>(OnAscensionAsh);
}

private void OnJaunt(Entity<HereticComponent> ent, ref EventHereticAshenShift args)
Expand Down Expand Up @@ -139,4 +145,17 @@ private void OnCascade(Entity<HereticComponent> ent, ref EventHereticCascade arg

args.Handled = true;
}


private void OnAscensionAsh(Entity<HereticComponent> ent, ref HereticAscensionAshEvent args)
{
RemComp<TemperatureComponent>(ent);
RemComp<TemperatureSpeedComponent>(ent);
RemComp<RespiratorComponent>(ent);
RemComp<BarotraumaComponent>(ent);

// fire immunity
var flam = EnsureComp<FlammableComponent>(ent);
flam.Damage = new(); // reset damage dict
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private void SubscribeFlesh()
{
SubscribeLocalEvent<HereticComponent, EventHereticFleshSurgery>(OnFleshSurgery);
SubscribeLocalEvent<HereticComponent, EventHereticFleshSurgeryDoAfter>(OnFleshSurgeryDoAfter);
SubscribeLocalEvent<HereticComponent, EventHereticFleshAscend>(OnFleshAscendPolymorph);
SubscribeLocalEvent<HereticComponent, HereticAscensionFleshEvent>(OnAscensionFlesh);
}

private void OnFleshSurgery(Entity<HereticComponent> ent, ref EventHereticFleshSurgery args)
Expand Down Expand Up @@ -99,17 +99,12 @@ private void OnFleshSurgeryDoAfter(Entity<HereticComponent> ent, ref EventHereti
_dmg.SetAllDamage((EntityUid) args.Target, dmg, 0);
args.Handled = true;
}
private void OnFleshAscendPolymorph(Entity<HereticComponent> ent, ref EventHereticFleshAscend args)
private void OnAscensionFlesh(Entity<HereticComponent> ent, ref HereticAscensionFleshEvent args)
{
if (!TryUseAbility(ent, args))
return;

var urist = _poly.PolymorphEntity(ent, "EldritchHorror");
if (urist == null)
return;

_aud.PlayPvs(new SoundPathSpecifier("/Audio/Animals/space_dragon_roar.ogg"), (EntityUid) urist, AudioParams.Default.AddVolume(2f));

args.Handled = true;
}
}
34 changes: 0 additions & 34 deletions Content.Server/_Goobstation/Heretic/EntitySystems/HereticSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
using Content.Shared.Heretic.Prototypes;
using Content.Server.Chat.Systems;
using Robust.Shared.Audio;
using Content.Server.Temperature.Components;
using Content.Server.Body.Components;
using Content.Server.Atmos.Components;
using Content.Shared.Damage;
using Content.Server.Heretic.Components;
using Content.Server.Antag;
Expand All @@ -20,9 +17,7 @@
using Robust.Server.Player;
using Content.Server.Revolutionary.Components;
using Content.Shared.Random.Helpers;
using Content.Shared.Roles.Jobs;
using Robust.Shared.Prototypes;
using Content.Shared.Roles;

namespace Content.Server.Heretic.EntitySystems;

Expand Down Expand Up @@ -52,9 +47,6 @@ public override void Initialize()
SubscribeLocalEvent<HereticComponent, EventHereticAscension>(OnAscension);

SubscribeLocalEvent<HereticComponent, BeforeDamageChangedEvent>(OnBeforeDamage);
SubscribeLocalEvent<HereticComponent, DamageModifyEvent>(OnDamage);


}

public override void Update(float frameTime)
Expand Down Expand Up @@ -170,19 +162,6 @@ private void OnAscension(Entity<HereticComponent> ent, ref EventHereticAscension
var pathLoc = ent.Comp.CurrentPath!.ToLower();
var ascendSound = new SoundPathSpecifier($"/Audio/_Goobstation/Heretic/Ambience/Antag/Heretic/ascend_{pathLoc}.ogg");
_chat.DispatchGlobalAnnouncement(Loc.GetString($"heretic-ascension-{pathLoc}"), Name(ent), true, ascendSound, Color.Pink);

// do other logic, e.g. make heretic immune to whatever
switch (ent.Comp.CurrentPath!)
{
case "Ash":
RemComp<TemperatureComponent>(ent);
RemComp<RespiratorComponent>(ent);
RemComp<BarotraumaComponent>(ent);
break;

default:
break;
}
}

#endregion
Expand All @@ -195,19 +174,6 @@ private void OnBeforeDamage(Entity<HereticComponent> ent, ref BeforeDamageChange
if (args.Origin.HasValue && HasComp<HereticBladeComponent>(args.Origin))
args.Cancelled = true;
}
private void OnDamage(Entity<HereticComponent> ent, ref DamageModifyEvent args)
{
if (!ent.Comp.Ascended)
return;

switch (ent.Comp.CurrentPath)
{
case "Ash":
// nullify heat damage because zased
args.Damage.DamageDict["Heat"] = 0;
break;
}
}

#endregion
}
4 changes: 2 additions & 2 deletions Content.Shared/Armor/ArmorComponent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Shared.Damage;
using Content.Shared.Damage;
using Robust.Shared.GameStates;
using Robust.Shared.Utility;

Expand All @@ -7,7 +7,7 @@ namespace Content.Shared.Armor;
/// <summary>
/// Used for clothing that reduces damage when worn.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedArmorSystem))]
[RegisterComponent, NetworkedComponent] // goob edit - remove access restrictions
public sealed partial class ArmorComponent : Component
{
/// <summary>
Expand Down
12 changes: 9 additions & 3 deletions Content.Shared/Armor/SharedArmorSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Shared.Damage;
using Content.Shared.Damage;
using Content.Shared.Examine;
using Content.Shared.Inventory;
using Content.Shared.Silicons.Borgs;
Expand All @@ -19,12 +19,18 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ArmorComponent, InventoryRelayedEvent<DamageModifyEvent>>(OnDamageModify);
SubscribeLocalEvent<ArmorComponent, DamageModifyEvent>(OnDamageModify); // goob edit - why hasn't anyone done this yet?
SubscribeLocalEvent<ArmorComponent, InventoryRelayedEvent<DamageModifyEvent>>(OnRelayDamageModify);
SubscribeLocalEvent<ArmorComponent, BorgModuleRelayedEvent<DamageModifyEvent>>(OnBorgDamageModify);
SubscribeLocalEvent<ArmorComponent, GetVerbsEvent<ExamineVerb>>(OnArmorVerbExamine);
}

private void OnDamageModify(EntityUid uid, ArmorComponent component, InventoryRelayedEvent<DamageModifyEvent> args)
// goob edit - why hasn't anyone done this yet?
private void OnDamageModify(EntityUid uid, ArmorComponent component, DamageModifyEvent args)
{
args.Damage = DamageSpecifier.ApplyModifierSet(args.Damage, component.Modifiers);
}
private void OnRelayDamageModify(EntityUid uid, ArmorComponent component, InventoryRelayedEvent<DamageModifyEvent> args)
{
args.Args.Damage = DamageSpecifier.ApplyModifierSet(args.Args.Damage, component.Modifiers);
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Store/ListingLocalisationHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Prototypes;

namespace Content.Shared.Store;

Expand Down
11 changes: 9 additions & 2 deletions Content.Shared/_Goobstation/Heretic/Heretic.Abilites.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,19 @@ public sealed partial class EventHereticCascade : InstantActionEvent { }

// flesh
public sealed partial class EventHereticFleshSurgery : EntityTargetActionEvent { }
public sealed partial class EventHereticFleshAscend : InstantActionEvent { }


// void (including upgrades)
[Serializable, NetSerializable, DataDefinition] public sealed partial class HereticAristocratWayEvent : EntityEventArgs { }
[Serializable, NetSerializable, DataDefinition] public sealed partial class HereticAscensionVoidEvent : EntityEventArgs { }

public sealed partial class HereticVoidBlastEvent : InstantActionEvent { }
public sealed partial class HereticVoidBlinkEvent : WorldTargetActionEvent { }
public sealed partial class HereticVoidPullEvent : InstantActionEvent { }

// ascensions
[Serializable, NetSerializable, DataDefinition] public sealed partial class HereticAscensionAshEvent : EntityEventArgs { }
[Serializable, NetSerializable, DataDefinition] public sealed partial class HereticAscensionVoidEvent : EntityEventArgs { }
[Serializable, NetSerializable, DataDefinition] public sealed partial class HereticAscensionFleshEvent : EntityEventArgs { }
[Serializable, NetSerializable, DataDefinition] public sealed partial class HereticAscensionLockEvent : EntityEventArgs { }
[Serializable, NetSerializable, DataDefinition] public sealed partial class HereticAscensionBladeEvent : EntityEventArgs { }
#endregion
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,4 @@
sprite: _Goobstation/Heretic/abilities_heretic.rsi
state: flesh_surgery
- type: HereticAction
messageLoc: heretic-speech-flesh-surgery

- type: entity
id: ActionPolymorphHereticHorror
name: REALITY UNCOIL
description: Transform into an eldritch horror.
components:
- type: InstantAction
useDelay: 60
event: !type:EventHereticFleshAscend
itemIconStyle: NoItem
icon:
sprite: _Goobstation/Heretic/abilities_heretic.rsi
state: final_hymn
- type: HereticAction
messageLoc: heretic-speech-flesh-worm
messageLoc: heretic-speech-flesh-surgery
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@

# heretic ascend flesh form
- type: entity
parent: BaseMob
parent: [ SimpleSpaceMobBase, FlyingMobBase ]
id: MobHereticFleshAscend
name: eldritch horror
description: An incomprehensible mess of limbs and eyes. You can feel it's stare into your soul.
suffix: DO NOT MAP
components:
- type: Bloodstream
bloodMaxVolume: 1984
- type: NpcFactionMember
factions:
- Heretic
Expand Down Expand Up @@ -115,7 +117,6 @@
- type: MobThresholds
thresholds:
0: Alive
500: Critical
1000: Dead
- type: Damageable
damageContainer: Biological
Expand All @@ -139,7 +140,7 @@
foodPreference: Humanoid
shouldStoreDevoured: true
chemical: Ichor
healRate: 15.0
healRate: 50.0
whitelist:
components:
- MobState
Expand Down Expand Up @@ -170,3 +171,15 @@
- Mansus
- type: Examiner
- type: Pullable
- type: Reflect
reflectProb: 0.7
reflects:
- Energy
- type: FootstepModifier
footstepSoundCollection:
collection: FootstepThud
- type: Flammable
damage:
types: {}
- type: Puller
needsHands: false
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
actionPrototypes:
- ActionHereticAscension1
- ActionHereticAscension2
event: !type:HereticAscensionAshEvent

### flesh path
- type: hereticKnowledge
Expand Down Expand Up @@ -161,8 +162,7 @@
id: PriestFinalHymn
path: Flesh
stage: 10
actionPrototypes:
- ActionPolymorphHereticHorror
event: !type:HereticAscensionFleshEvent

### void path
- type: hereticKnowledge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
configuration:
entity: MobHereticFleshAscend
transferName: true
transferDamage: true
transferDamage: false
revertOnCrit: false
revertOnDeath: false

0 comments on commit ed583be

Please sign in to comment.