Files
Delta-v/Content.Shared/GhostTypes/LastBodyDamageComponent.cs
T
DisposableCrewmember42andThinbug 0ce8d934f4 cherry-pick: upstream's damage-dependent ghost sprites (#5516)
Ghost types  (space-wizards/space-station-14#37949)

* Empty commit

* yeah thingi

* added a GetHighestDamageTypes thingi to the DamageableSystem

* no idea why those files names are different only in github so just in case readding them

* yeah doing that

* first steps of moving the logic somewhere nicer

* still plenty to do

* gosh such a mess but getting progress done

* small fixie push

* big mess of bunch of stuff

* dealing with a conflict and fixing the random numbers

* testing if github will update now

* dealing with the other conflict

* github please update i beg you

* dealing with more conflicts

* hopefully this fixes it

* fixing conflicts again

* cleaning up stuffies

* sprite fixie

* general cleanup

* doing the small fixies first

* getting rid of the new event, gotta handle ashing next

* adding spaces to comments before i forget

* handling ashing

* think that did it?

* small fixies

* more small fixies

* last batch of quickie fixies before i gotta handle the bigger stuff

* last bunch of fixies i do understand

* small bit of progress yknow may as well yeah

* renaming and moving stuff to shared

* comment fixiees

* saving damage in a new component instead of in MindComponent

* protoid's and dict usage instead of the previously ickier methods

* small fixie before biggie fixie

* more fixies im slepy gosh

* thinkie that should fixie it

* smoothed the damage storage systeem so its less repetitive and icki and now itss cooler and i can go eepy

* lots of stuffies x3

* first step of getting git to detect my file name changes

* thinkie that should fixie it

* fixies

* just getting rid of the merge conflict, will check damageable later

* small thingies first

* more small stuffiees

* now all of the sprites have at leeast a 0

* dirtying the lastbody comp

* more fixies

* small thingi first

* another small fixie and a minor sprite fixie

* rng fixie

* moving the damage storage system to shared

* smoothing out code thats likely to be replaced soon but its good to do for now

* just showing progress bcus yis

* general progress stuffies mhm

* pushie

* small cleanup

* general progress :3

* in progress push for helpie

* proper pushie with progress and workies

* removed unnecessary usage of the storedamage component

* minor fixiees

* extra comments

* replaced a couple strings for ProtoId's

* gibbing related fixies :3

Signed-off-by: DisposableCrewmember42 <disposablecrewmember42@proton.me>
Co-authored-by: Thinbug <101073555+Thinbug0@users.noreply.github.com>
2026-04-04 21:39:24 +02:00

49 lines
1.7 KiB
C#

using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.GhostTypes;
/// <summary>
/// Added to the Mind of an entity by the StoreDamageTakenOnMindSystem, allowing storage of the damage values their body had.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class LastBodyDamageComponent : Component
{
/// <summary>
/// Dictionary DamageGroupPrototype proto ids to how much damage was received from that damage type.
/// </summary>
[DataField, AutoNetworkedField]
public Dictionary<ProtoId<DamageGroupPrototype>, FixedPoint2>? DamagePerGroup;
/// <summary>
/// Collection of possible damage types, stored by the StoreDamageTakenOnMind.
/// </summary>
[DataField, AutoNetworkedField]
public DamageSpecifier? Damage;
/// <summary>
/// Special death cause that's saved after an event related to it is triggered
/// For example, a BeforeExplodeEvent will save "Explosion" as the special cause of death
/// </summary>
[DataField, AutoNetworkedField]
public ProtoId<SpecialCauseOfDeathPrototype>? SpecialCauseOfDeath = null;
}
/// <summary>
/// Prototype for special causes of death (such as "Explosion")
/// </summary>
[Prototype]
public sealed partial class SpecialCauseOfDeathPrototype : IPrototype
{
[ViewVariables, IdDataField]
public string ID { get; private set; } = string.Empty;
// Specifies the amount of possible sprites for a special cause of death
// These values are set up in the special_cause_of_death_types.yml file
[DataField]
public int NumOfStates;
}