Skip to content

Commit

Permalink
Merge branch 'master' into lava
Browse files Browse the repository at this point in the history
  • Loading branch information
PyotrIgn authored Dec 31, 2024
2 parents 29597d8 + ddd2cc6 commit 2098db2
Show file tree
Hide file tree
Showing 75 changed files with 1,597 additions and 430 deletions.
1 change: 1 addition & 0 deletions Content.Client/ADT/Heretic/Ritual.CustomBehaviors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Content.Client.Heretic;
// - john

public sealed partial class RitualAshAscendBehavior : RitualSacrificeBehavior { }
public sealed partial class RitualBladeAscendBehavior : RitualSacrificeBehavior { }
public sealed partial class RitualMuteGhoulifyBehavior : RitualSacrificeBehavior { }

[Virtual] public partial class RitualSacrificeBehavior : RitualCustomBehavior
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ public sealed partial class HereticRuleComponent : Component
public readonly List<ProtoId<StoreCategoryPrototype>> StoreCategories = new()
{
"HereticPathAsh",
//"HereticPathLock", //TODO
//"HereticPathLock",
"HereticPathFlesh",
//"HereticPathBlade", //TODO
"HereticPathBlade",
"HereticPathVoid",
//"HereticPathRust", //TODO
"HereticPathSide"
};

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/ADT/GameTicking/Rules/HereticRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void OnAntagSelect(Entity<HereticRuleComponent> ent, ref AfterAntagEntit
{
TryMakeHeretic(args.EntityUid, ent.Comp);

for (int i = 0; i < _rand.Next(6, 12); i++)
for (int i = 0; i < _rand.Next(4, 8); i++)
if (TryFindRandomTile(out var _, out var _, out var _, out var coords))
Spawn("EldritchInfluence", coords);
}
Expand Down
41 changes: 29 additions & 12 deletions Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Ash.cs
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 @@ -14,12 +18,13 @@ private void SubscribeAsh()
{
SubscribeLocalEvent<HereticComponent, EventHereticAshenShift>(OnJaunt);
SubscribeLocalEvent<GhoulComponent, EventHereticAshenShift>(OnJauntGhoul);
SubscribeLocalEvent<HereticComponent, PolymorphRevertEvent>(OnJauntEnd);

SubscribeLocalEvent<HereticComponent, EventHereticVolcanoBlast>(OnVolcano);
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 All @@ -40,10 +45,6 @@ private bool TryDoJaunt(EntityUid ent)
return false;
return true;
}
private void OnJauntEnd(Entity<HereticComponent> ent, ref PolymorphRevertEvent args)
{
Spawn("PolymorphAshJauntEndAnimation", Transform(ent).Coordinates);
}

private void OnVolcano(Entity<HereticComponent> ent, ref EventHereticVolcanoBlast args)
{
Expand Down Expand Up @@ -74,7 +75,8 @@ private void OnNWRebirth(Entity<HereticComponent> ent, ref EventHereticNightwatc
if (!TryUseAbility(ent, args))
return;

var lookup = _lookup.GetEntitiesInRange(ent, 5f);
var power = ent.Comp.CurrentPath == "Ash" ? ent.Comp.PathStage : 2.5f;
var lookup = _lookup.GetEntitiesInRange(ent, power);

foreach (var look in lookup)
{
Expand All @@ -86,18 +88,18 @@ private void OnNWRebirth(Entity<HereticComponent> ent, ref EventHereticNightwatc
{
if (flam.OnFire && TryComp<DamageableComponent>(ent, out var dmgc))
{
// heals everything by 10 for each burning target
_stam.TryTakeStamina(ent, -10);
// heals everything by base + power for each burning target
_stam.TryTakeStamina(ent, -(10 + power));
var dmgdict = dmgc.Damage.DamageDict;
foreach (var key in dmgdict.Keys)
dmgdict[key] = -10f;
dmgdict[key] -= 10f + power;

var dmgspec = new DamageSpecifier() { DamageDict = dmgdict };
_dmg.TryChangeDamage(ent, dmgspec, true, false, dmgc);
}

if (!flam.OnFire)
_flammable.AdjustFireStacks(look, 5, flam, true);
_flammable.AdjustFireStacks(look, power, flam, true);

if (TryComp<MobStateComponent>(look, out var mobstat))
if (mobstat.CurrentState == MobState.Critical)
Expand Down Expand Up @@ -126,7 +128,7 @@ private void OnCascade(Entity<HereticComponent> ent, ref EventHereticCascade arg

// yeah. it just generates a ton of plasma which just burns.
// lame, but we don't have anything fire related atm, so, it works.
var tilepos = _xform.GetGridOrMapTilePosition(ent, Transform(ent));
var tilepos = _transform.GetGridOrMapTilePosition(ent, Transform(ent));
var enumerator = _atmos.GetAdjacentTileMixtures(Transform(ent).GridUid!.Value, tilepos, false, false);
while (enumerator.MoveNext(out var mix))
{
Expand All @@ -139,4 +141,19 @@ 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
// this does NOT protect you against lasers and whatnot. for now. when i figure out THIS STUPID FUCKING LIMB SYSTEM!!!
// regards.
}
}
75 changes: 75 additions & 0 deletions Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Blade.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using Content.Server.Heretic.Components.PathSpecific;
using Content.Shared.Body.Part;
using Content.Shared.Damage.Components;
using Content.Shared.Heretic;
using Content.Shared.Slippery;

namespace Content.Server.Heretic.Abilities;

public sealed partial class HereticAbilitySystem : EntitySystem
{
private void SubscribeBlade()
{
SubscribeLocalEvent<HereticComponent, HereticDanceOfTheBrandEvent>(OnDanceOfTheBrand);
SubscribeLocalEvent<HereticComponent, EventHereticRealignment>(OnRealignment);
SubscribeLocalEvent<HereticComponent, HereticChampionStanceEvent>(OnChampionStance);
SubscribeLocalEvent<HereticComponent, EventHereticFuriousSteel>(OnFuriousSteel);

SubscribeLocalEvent<HereticComponent, HereticAscensionBladeEvent>(OnAscensionBlade);
}

private void OnDanceOfTheBrand(Entity<HereticComponent> ent, ref HereticDanceOfTheBrandEvent args)
{
EnsureComp<RiposteeComponent>(ent);
}
private void OnRealignment(Entity<HereticComponent> ent, ref EventHereticRealignment args)
{
if (!TryUseAbility(ent, args))
return;

_statusEffect.TryRemoveStatusEffect(ent, "Stun");
_statusEffect.TryRemoveStatusEffect(ent, "KnockedDown");
_statusEffect.TryRemoveStatusEffect(ent, "ForcedSleep");
_statusEffect.TryRemoveStatusEffect(ent, "Drowsiness");

if (TryComp<StaminaComponent>(ent, out var stam))
{
if (stam.StaminaDamage >= stam.CritThreshold)
{
_stam.ExitStamCrit(ent, stam);
}

stam.StaminaDamage = 0;
RemComp<ActiveStaminaComponent>(ent);
Dirty(ent, stam);
}

_statusEffect.TryAddStatusEffect(ent, "Pacified", TimeSpan.FromSeconds(10f), true);

args.Handled = true;
}

private void OnChampionStance(Entity<HereticComponent> ent, ref HereticChampionStanceEvent args)
{

EnsureComp<ChampionStanceComponent>(ent);
}
private void OnFuriousSteel(Entity<HereticComponent> ent, ref EventHereticFuriousSteel args)
{
if (!TryUseAbility(ent, args))
return;

for (int i = 0; i < 3; i++)
_pblade.AddProtectiveBlade(ent);

args.Handled = true;
}

private void OnAscensionBlade(Entity<HereticComponent> ent, ref HereticAscensionBladeEvent args)
{
EnsureComp<NoSlipComponent>(ent); // epic gamer move
RemComp<StaminaComponent>(ent); // no stun

EnsureComp<SilverMaelstromComponent>(ent);
}
}
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>(OnFleshAscendPolymorph);
}

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 OnFleshAscendPolymorph(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;
}
}
29 changes: 29 additions & 0 deletions Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Lock.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Content.Shared.Heretic;

namespace Content.Server.Heretic.Abilities;

public sealed partial class HereticAbilitySystem : EntitySystem
{
private void SubscribeLock()
{
SubscribeLocalEvent<HereticComponent, EventHereticBulglarFinesse>(OnBulglarFinesse);
SubscribeLocalEvent<HereticComponent, EventHereticLastRefugee>(OnLastRefugee);
// add eldritch id here

SubscribeLocalEvent<HereticComponent, HereticAscensionLockEvent>(OnAscensionLock);
}

private void OnBulglarFinesse(Entity<HereticComponent> ent, ref EventHereticBulglarFinesse args)
{

}
private void OnLastRefugee(Entity<HereticComponent> ent, ref EventHereticLastRefugee args)
{

}

private void OnAscensionLock(Entity<HereticComponent> ent, ref HereticAscensionLockEvent args)
{

}
}
23 changes: 16 additions & 7 deletions Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.Void.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Server.Atmos.Components;
using Content.Server.Body.Components;
using Content.Server.Heretic.Components;
using Content.Server.Heretic.Components.PathSpecific;
using Content.Server.Magic;
using Content.Server.Temperature.Components;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
Expand Down Expand Up @@ -42,6 +43,8 @@ private void OnVoidBlast(Entity<HereticComponent> ent, ref HereticVoidBlastEvent
return;

var rod = Spawn("ImmovableVoidRod", Transform(ent).Coordinates);
if (TryComp<ImmovableVoidRodComponent>(rod, out var vrod))
vrod.User = ent;

if (TryComp(rod, out PhysicsComponent? phys))
{
Expand All @@ -64,18 +67,22 @@ private void OnVoidBlink(Entity<HereticComponent> ent, ref HereticVoidBlinkEvent
if (!TryUseAbility(ent, args))
return;

var condition = ent.Comp.CurrentPath == "Void";

var power = condition ? 1.5f + ent.Comp.PathStage / 5f : 1.5f;

_aud.PlayPvs(new SoundPathSpecifier("/Audio/Effects/tesla_consume.ogg"), ent);

foreach (var pookie in GetNearbyPeople(ent, 2f))
_stun.TryKnockdown(pookie, TimeSpan.FromSeconds(2.5f), true);
foreach (var pookie in GetNearbyPeople(ent, power))
_stun.TryKnockdown(pookie, TimeSpan.FromSeconds(power), true);

_transform.SetCoordinates(ent, args.Target);

// repeating for both sides
_aud.PlayPvs(new SoundPathSpecifier("/Audio/Effects/tesla_consume.ogg"), ent);

foreach (var pookie in GetNearbyPeople(ent, 2f))
_stun.TryKnockdown(pookie, TimeSpan.FromSeconds(2.5f), true);
foreach (var pookie in GetNearbyPeople(ent, power))
_stun.TryKnockdown(pookie, TimeSpan.FromSeconds(power), true);

args.Handled = true;
}
Expand All @@ -89,14 +96,16 @@ private void OnVoidPull(Entity<HereticComponent> ent, ref HereticVoidPullEvent a
var midPriority = GetNearbyPeople(ent, 2.5f);
var farPriority = GetNearbyPeople(ent, 5f);

var power = ent.Comp.CurrentPath == "Void" ? 10f + ent.Comp.PathStage * 2 : 10f;

// damage closest ones
foreach (var pookie in topPriority)
{
if (!TryComp<DamageableComponent>(pookie, out var dmgComp))
continue;

// total damage + 20 divided by all damage types.
var damage = (dmgComp.TotalDamage + 20f) / _prot.EnumeratePrototypes<DamageTypePrototype>().Count();
// total damage + power divided by all damage types.
var damage = (dmgComp.TotalDamage + power) / _prot.EnumeratePrototypes<DamageTypePrototype>().Count();

// apply gaming.
_dmg.SetAllDamage(pookie, dmgComp, damage);
Expand Down
7 changes: 5 additions & 2 deletions Content.Server/ADT/Heretic/Abilities/HereticAbilitySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Content.Shared.Damage.Systems;
using Content.Shared.DoAfter;
using Content.Shared.Heretic;
using Content.Shared.Inventory;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Store.Components;
Expand All @@ -32,6 +31,7 @@
using Robust.Shared.Audio;
using Content.Shared.Mobs.Components;
using Robust.Shared.Prototypes;
using Content.Server.Heretic.EntitySystems;

namespace Content.Server.Heretic.Abilities;

Expand All @@ -50,7 +50,6 @@ public sealed partial class HereticAbilitySystem : EntitySystem
[Dependency] private readonly DamageableSystem _dmg = default!;
[Dependency] private readonly StaminaSystem _stam = default!;
[Dependency] private readonly AtmosphereSystem _atmos = default!;
[Dependency] private readonly SharedTransformSystem _xform = default!;
[Dependency] private readonly SharedAudioSystem _aud = default!;
[Dependency] private readonly DoAfterSystem _doafter = default!;
[Dependency] private readonly FlashSystem _flash = default!;
Expand All @@ -65,6 +64,8 @@ public sealed partial class HereticAbilitySystem : EntitySystem
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly IMapManager _mapMan = default!;
[Dependency] private readonly IPrototypeManager _prot = default!;
[Dependency] private readonly ProtectiveBladeSystem _pblade = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffect = default!;

private List<EntityUid> GetNearbyPeople(Entity<HereticComponent> ent, float range)
{
Expand Down Expand Up @@ -102,6 +103,8 @@ public override void Initialize()
SubscribeAsh();
SubscribeFlesh();
SubscribeVoid();
SubscribeBlade();
SubscribeLock();
}

private bool TryUseAbility(EntityUid ent, BaseActionEvent args)
Expand Down
9 changes: 0 additions & 9 deletions Content.Server/ADT/Heretic/Components/AristocratComponent.cs
Original file line number Diff line number Diff line change
@@ -1,9 +0,0 @@
namespace Content.Server.Heretic.Components;

[RegisterComponent]
public sealed partial class AristocratComponent : Component
{
public float UpdateTimer = 0f;
[DataField] public float UpdateDelay = 1.5f;
[DataField] public float Range = 2.5f;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Content.Server.Heretic.Components;

[RegisterComponent]
public sealed partial class MansusInfusedComponent : Component
{
[DataField] public float MaxCharges = 5f;
[ViewVariables(VVAccess.ReadWrite)] public float AvailableCharges = 5f;
}
Loading

0 comments on commit 2098db2

Please sign in to comment.