mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
* Nubody (#42419) * Nubody * fix test fails * gibbing * lung test returns * doc comment * hand organ test * giblet test * yaml formatting * returning * relocate * trimming * re-smite * oops thusd tweak * arachnids have slower metabolism i guess * never mind the old behaviour is bad actually * rider whyyy * style changes and allat * fix collision --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * C# files done * Visual nubody (humanoid appearance refactor) (#42476) * initial visual nubody * oops overlay * im so pheeming rn * conversion... * tests * comeback of the underwear * oops eyes * blabbl * zeds * yaml linted * search and visible count constraints * reordering * preserve previously selected markings colors * fix test * some ui niceties * ordering * make DB changes backwards-compatible/downgrade-friendly * fix things again * fix migration * vulpkanin markings limit increase * wrapping * code cleanup and more code cleanup and more code cleanup and more code cleanup and * fix slop ports * better sampling API * make filter work + use the method i made for its intended purpose * fix test fails real quick * magic mirror cleanup, remove TODO * don't 0-init the organ profile data * remove deltastates --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * Let vox eat trash again (#42503) * C# complete port * Getting closer * Harpy Nubody Port * Port Feroxi, Kitsune. Fix some yml typos and remove ipcs stuff * Port Oni * Port Rest, except Motorkind * Port Motorkind * Remove more surgery, restore too much deleted stuff * Fix Typos and change some organ names. Need to split eyes next * Harpy HAve Wings again * Some fixes, More Surgeyr Removal, Copying of eye organs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use correct Body imports * Markings Refactoring, Harpy Layering * Motorkind doesn't crash anymore. Some layer remappings. * Allow Organs to have Markings Displacements again. (#43604) * first shtep * readd markings support --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * Fix STalk eyes and several layerings * Fix sexed organs (#42554) * Fix markings for several species, fit them for sexed organs and rename some files to fit them for it * Additional IPC-related removals * Vulpkanin eyes are now correct again * Fix Subtle Cultist Marks on species * Fix Asakim Sprites (sexed) and make CD imports work * Migration, error fixes, and Height * Fix humanoid profile voice being broken (#42550) Fix humanoid appearance voice being broken * Change Kitsune SexChanged Event to with ref * Fix asakim issue, Respirator fix * Simplify hands UI code (#42534) * Simplify hands UI code * i remembered about SortedHands in the component * minor cleanup --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * Set size of Analyzer back to 350, Kitsune can't gib themselves no more. Migration * yml linter errors and an rudimentary onAdd Organ Functionality * Fixing it trying to remove nothing * midpoint migration * Why do you put so many organs everywhere * More missing prototypes * Migration of more organs * Forgot lungs * Move character preview handling into a specialized control (#41252) * Move character preview handling into a specialized control Co-authored-by: Quantum-cross <7065792+Quantum-cross@users.noreply.github.com> * Restore job name that I accidentally removed from character picker buttons * Just resolve dependencies the standard way --------- Co-authored-by: Quantum-cross <7065792+Quantum-cross@users.noreply.github.com> Co-authored-by: Janet Blackquill <uhhadd@gmail.com> * Drop ICharacterProfile/ICharacterAppearance interfaces (#42661) * Ensure profile loading only returns valid species (#42842) (Stable merge) (#42865) Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> * Changes to make it work for us. * No more bald Harpy * OperatingTables instead of null * Adding Delta V Comments, commenting out instead of deleting * Fix broken Height Scale. * Remove HumanoidSilicon Mention * Did an error. Readded, uncommented. * Clean up Marking data structure, add tests for Zombie transformation (#42756) * Clean up Marking data structure, add tests for Zombie transformation * empty * AAAAAAAAAAAAAAAA --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> * Fix markings colour setting (#42771) * Fix: Markings Color For Downstream * Comment out A Leg. Remove Todo * Revert to original hidden species code --------- Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Co-authored-by: Absotively <jen@jenpollock.ca> Co-authored-by: Quantum-cross <7065792+Quantum-cross@users.noreply.github.com> Co-authored-by: Myra <vasilis@pikachu.systems>
147 lines
5.0 KiB
C#
147 lines
5.0 KiB
C#
using Content.Server.Destructible;
|
|
using Content.Server.Polymorph.Components;
|
|
using Content.Server.Popups;
|
|
using Content.Shared.Body;
|
|
using Content.Shared.Damage.Systems;
|
|
using Content.Shared.Examine;
|
|
using Content.Shared.Gibbing;
|
|
using Content.Shared.Popups;
|
|
using Robust.Shared.Audio.Systems;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Map.Components;
|
|
using Robust.Shared.Physics.Components;
|
|
using Robust.Shared.Physics.Events;
|
|
using Robust.Shared.Physics.Systems;
|
|
using Robust.Shared.Random;
|
|
|
|
namespace Content.Server.ImmovableRod;
|
|
|
|
public sealed class ImmovableRodSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly IRobustRandom _random = default!;
|
|
|
|
[Dependency] private readonly GibbingSystem _gibbing = default!;
|
|
[Dependency] private readonly PopupSystem _popup = default!;
|
|
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
[Dependency] private readonly DamageableSystem _damageable = default!;
|
|
[Dependency] private readonly DestructibleSystem _destructible = default!;
|
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
|
[Dependency] private readonly SharedMapSystem _map = default!;
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
|
|
// we are deliberately including paused entities. rod hungers for all
|
|
foreach (var (rod, trans) in EntityQuery<ImmovableRodComponent, TransformComponent>(true))
|
|
{
|
|
if (!rod.DestroyTiles)
|
|
continue;
|
|
|
|
if (!TryComp<MapGridComponent>(trans.GridUid, out var grid))
|
|
continue;
|
|
|
|
_map.SetTile(trans.GridUid.Value, grid, trans.Coordinates, Tile.Empty);
|
|
}
|
|
}
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<ImmovableRodComponent, StartCollideEvent>(OnCollide);
|
|
SubscribeLocalEvent<ImmovableRodComponent, MapInitEvent>(OnMapInit);
|
|
SubscribeLocalEvent<ImmovableRodComponent, ExaminedEvent>(OnExamined);
|
|
}
|
|
|
|
private void OnMapInit(EntityUid uid, ImmovableRodComponent component, MapInitEvent args)
|
|
{
|
|
if (TryComp(uid, out PhysicsComponent? phys))
|
|
{
|
|
_physics.SetLinearDamping(uid, phys, 0f);
|
|
_physics.SetFriction(uid, phys, 0f);
|
|
_physics.SetBodyStatus(uid, phys, BodyStatus.InAir);
|
|
|
|
var xform = Transform(uid);
|
|
var (worldPos, worldRot) = _transform.GetWorldPositionRotation(uid);
|
|
var vel = worldRot.ToWorldVec() * component.MaxSpeed;
|
|
|
|
if (component.RandomizeVelocity)
|
|
{
|
|
vel = component.DirectionOverride.Degrees switch
|
|
{
|
|
0f => _random.NextVector2(component.MinSpeed, component.MaxSpeed),
|
|
_ => worldRot.RotateVec(component.DirectionOverride.ToVec()) * _random.NextFloat(component.MinSpeed, component.MaxSpeed)
|
|
};
|
|
}
|
|
|
|
_physics.ApplyLinearImpulse(uid, vel, body: phys);
|
|
xform.LocalRotation = (vel - worldPos).ToWorldAngle() + MathHelper.PiOver2;
|
|
}
|
|
}
|
|
|
|
private void OnCollide(EntityUid uid, ImmovableRodComponent component, ref StartCollideEvent args)
|
|
{
|
|
var ent = args.OtherEntity;
|
|
|
|
if (_random.Prob(component.HitSoundProbability))
|
|
{
|
|
_audio.PlayPvs(component.Sound, uid);
|
|
}
|
|
|
|
if (HasComp<ImmovableRodComponent>(ent))
|
|
{
|
|
// oh god.
|
|
var coords = Transform(uid).Coordinates;
|
|
_popup.PopupCoordinates(Loc.GetString("immovable-rod-collided-rod-not-good"), coords, PopupType.LargeCaution);
|
|
|
|
Del(uid);
|
|
Del(ent);
|
|
Spawn("Singularity", coords);
|
|
|
|
return;
|
|
}
|
|
|
|
// dont delete/hurt self if polymoprhed into a rod
|
|
if (TryComp<PolymorphedEntityComponent>(uid, out var polymorphed))
|
|
{
|
|
if (polymorphed.Parent == ent)
|
|
return;
|
|
}
|
|
|
|
// gib or damage em
|
|
if (HasComp<BodyComponent>(ent))
|
|
{
|
|
component.MobCount++;
|
|
_popup.PopupEntity(Loc.GetString("immovable-rod-penetrated-mob", ("rod", uid), ("mob", ent)), uid, PopupType.LargeCaution);
|
|
|
|
if (!component.ShouldGib)
|
|
{
|
|
if (component.Damage == null)
|
|
return;
|
|
|
|
_damageable.TryChangeDamage(ent, component.Damage, ignoreResistances: true);
|
|
return;
|
|
}
|
|
|
|
_gibbing.Gib(ent);
|
|
return;
|
|
}
|
|
|
|
_destructible.DestroyEntity(ent);
|
|
}
|
|
|
|
private void OnExamined(EntityUid uid, ImmovableRodComponent component, ExaminedEvent args)
|
|
{
|
|
if (component.MobCount == 0)
|
|
{
|
|
args.PushText(Loc.GetString("immovable-rod-consumed-none", ("rod", uid)));
|
|
}
|
|
else
|
|
{
|
|
args.PushText(Loc.GetString("immovable-rod-consumed-souls", ("rod", uid), ("amount", component.MobCount)));
|
|
}
|
|
}
|
|
}
|