Tesla (#21124)
* upload all textures
finished easiest part - TeslaGenerator
* Added Tesla energy logic
* add lightning pulse priority
* work
* optimise lightning arc system
* now tesla moving to LightningTarget entity and consume it
* some audio work
add airlock and computers to the LightningTarget
* add nice visual and explosions
add crashing to game
* rsi meta fix
* disabling explosions (crashing server)
I'll get back to that problem later.
* adding important admin logging
* a little bit of cleaning and documentation
* Persistent attempts to fix the server crashing on explosions. Accidental cleaning of everything I see.
* now the tesla incinerates everything it touches except the containment field.
* colliders work
* fix falling tesla on ground after being exploded
* add consume sound, add spawn and collapses sound
* added TeslaGenerator to cargo trading console
* add all tesla part to cargo trading console
* Tesla coils: Turn on and off, get energy from lightning, give energy to the grid.
* tesla coil is ready
* tesla grounding rod is ready
* clean up
* clean up 2
* grounding rods now working without power
* add LightningResistance parameter for LightningTarget Component
* add chaotic teleport
* eletrocution remove?
* deltanedas fix pack
* more fixes
* FIXES
* FIIIXEEES
* The "Grounding Rod" component is removed, and replaced with "LightiningSparking", which is responsible for changing the visuals when hit by lightning. Duplicate code from the coil is removed.
* ops
* fix
* nah, is escaped anyway
* increase tesla collider size
* keron bb
* try fix test?
* fix
* bruh
* check turn off sus comp
* prototype cleaning
* FIIX
* return and fix sus component
* fix tesla eating lightnings, now mini tesla is electrocuted
* commented some issues
* remove linq sorting
fix jumping system
minor fixes
* fix second Linq
* fix tesla colliders! Yeah, it works
* fix componentregistration
* Just retests
* not fix
* FIX TESLA
* fixes
* store targets
* back
* make dictionary of hashsets
* some sloth fixes
* stump
* playtest balance energy generation, return to unpotimized (but working) lightning shoot
* parity
* work on
* some new fix, some new bug (chasingComponent not chasing)
* comment
* fix ChasingWalkSystem
* fix collider tesla problem
* revert old unoptimized shoot lightning
* new fix pack
---------
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-12-28 16:11:50 +03:00
|
|
|
using Content.Server.Explosion.EntitySystems;
|
|
|
|
|
using Content.Server.Lightning;
|
|
|
|
|
using Content.Server.Lightning.Components;
|
2024-01-01 10:33:48 +03:00
|
|
|
using Content.Shared.Damage;
|
Tesla (#21124)
* upload all textures
finished easiest part - TeslaGenerator
* Added Tesla energy logic
* add lightning pulse priority
* work
* optimise lightning arc system
* now tesla moving to LightningTarget entity and consume it
* some audio work
add airlock and computers to the LightningTarget
* add nice visual and explosions
add crashing to game
* rsi meta fix
* disabling explosions (crashing server)
I'll get back to that problem later.
* adding important admin logging
* a little bit of cleaning and documentation
* Persistent attempts to fix the server crashing on explosions. Accidental cleaning of everything I see.
* now the tesla incinerates everything it touches except the containment field.
* colliders work
* fix falling tesla on ground after being exploded
* add consume sound, add spawn and collapses sound
* added TeslaGenerator to cargo trading console
* add all tesla part to cargo trading console
* Tesla coils: Turn on and off, get energy from lightning, give energy to the grid.
* tesla coil is ready
* tesla grounding rod is ready
* clean up
* clean up 2
* grounding rods now working without power
* add LightningResistance parameter for LightningTarget Component
* add chaotic teleport
* eletrocution remove?
* deltanedas fix pack
* more fixes
* FIXES
* FIIIXEEES
* The "Grounding Rod" component is removed, and replaced with "LightiningSparking", which is responsible for changing the visuals when hit by lightning. Duplicate code from the coil is removed.
* ops
* fix
* nah, is escaped anyway
* increase tesla collider size
* keron bb
* try fix test?
* fix
* bruh
* check turn off sus comp
* prototype cleaning
* FIIX
* return and fix sus component
* fix tesla eating lightnings, now mini tesla is electrocuted
* commented some issues
* remove linq sorting
fix jumping system
minor fixes
* fix second Linq
* fix tesla colliders! Yeah, it works
* fix componentregistration
* Just retests
* not fix
* FIX TESLA
* fixes
* store targets
* back
* make dictionary of hashsets
* some sloth fixes
* stump
* playtest balance energy generation, return to unpotimized (but working) lightning shoot
* parity
* work on
* some new fix, some new bug (chasingComponent not chasing)
* comment
* fix ChasingWalkSystem
* fix collider tesla problem
* revert old unoptimized shoot lightning
* new fix pack
---------
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-12-28 16:11:50 +03:00
|
|
|
|
|
|
|
|
namespace Content.Server.Tesla.EntitySystems;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The component allows lightning to strike this target. And determining the behavior of the target when struck by lightning.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class LightningTargetSystem : EntitySystem
|
|
|
|
|
{
|
2024-01-01 10:33:48 +03:00
|
|
|
[Dependency] private readonly DamageableSystem _damageable = default!;
|
Tesla (#21124)
* upload all textures
finished easiest part - TeslaGenerator
* Added Tesla energy logic
* add lightning pulse priority
* work
* optimise lightning arc system
* now tesla moving to LightningTarget entity and consume it
* some audio work
add airlock and computers to the LightningTarget
* add nice visual and explosions
add crashing to game
* rsi meta fix
* disabling explosions (crashing server)
I'll get back to that problem later.
* adding important admin logging
* a little bit of cleaning and documentation
* Persistent attempts to fix the server crashing on explosions. Accidental cleaning of everything I see.
* now the tesla incinerates everything it touches except the containment field.
* colliders work
* fix falling tesla on ground after being exploded
* add consume sound, add spawn and collapses sound
* added TeslaGenerator to cargo trading console
* add all tesla part to cargo trading console
* Tesla coils: Turn on and off, get energy from lightning, give energy to the grid.
* tesla coil is ready
* tesla grounding rod is ready
* clean up
* clean up 2
* grounding rods now working without power
* add LightningResistance parameter for LightningTarget Component
* add chaotic teleport
* eletrocution remove?
* deltanedas fix pack
* more fixes
* FIXES
* FIIIXEEES
* The "Grounding Rod" component is removed, and replaced with "LightiningSparking", which is responsible for changing the visuals when hit by lightning. Duplicate code from the coil is removed.
* ops
* fix
* nah, is escaped anyway
* increase tesla collider size
* keron bb
* try fix test?
* fix
* bruh
* check turn off sus comp
* prototype cleaning
* FIIX
* return and fix sus component
* fix tesla eating lightnings, now mini tesla is electrocuted
* commented some issues
* remove linq sorting
fix jumping system
minor fixes
* fix second Linq
* fix tesla colliders! Yeah, it works
* fix componentregistration
* Just retests
* not fix
* FIX TESLA
* fixes
* store targets
* back
* make dictionary of hashsets
* some sloth fixes
* stump
* playtest balance energy generation, return to unpotimized (but working) lightning shoot
* parity
* work on
* some new fix, some new bug (chasingComponent not chasing)
* comment
* fix ChasingWalkSystem
* fix collider tesla problem
* revert old unoptimized shoot lightning
* new fix pack
---------
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-12-28 16:11:50 +03:00
|
|
|
[Dependency] private readonly ExplosionSystem _explosionSystem = default!;
|
|
|
|
|
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
SubscribeLocalEvent<LightningTargetComponent, HitByLightningEvent>(OnHitByLightning);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnHitByLightning(Entity<LightningTargetComponent> uid, ref HitByLightningEvent args)
|
|
|
|
|
{
|
2024-01-01 10:33:48 +03:00
|
|
|
DamageSpecifier damage = new();
|
|
|
|
|
damage.DamageDict.Add("Structural", uid.Comp.DamageFromLightning);
|
|
|
|
|
_damageable.TryChangeDamage(uid, damage, true);
|
Tesla (#21124)
* upload all textures
finished easiest part - TeslaGenerator
* Added Tesla energy logic
* add lightning pulse priority
* work
* optimise lightning arc system
* now tesla moving to LightningTarget entity and consume it
* some audio work
add airlock and computers to the LightningTarget
* add nice visual and explosions
add crashing to game
* rsi meta fix
* disabling explosions (crashing server)
I'll get back to that problem later.
* adding important admin logging
* a little bit of cleaning and documentation
* Persistent attempts to fix the server crashing on explosions. Accidental cleaning of everything I see.
* now the tesla incinerates everything it touches except the containment field.
* colliders work
* fix falling tesla on ground after being exploded
* add consume sound, add spawn and collapses sound
* added TeslaGenerator to cargo trading console
* add all tesla part to cargo trading console
* Tesla coils: Turn on and off, get energy from lightning, give energy to the grid.
* tesla coil is ready
* tesla grounding rod is ready
* clean up
* clean up 2
* grounding rods now working without power
* add LightningResistance parameter for LightningTarget Component
* add chaotic teleport
* eletrocution remove?
* deltanedas fix pack
* more fixes
* FIXES
* FIIIXEEES
* The "Grounding Rod" component is removed, and replaced with "LightiningSparking", which is responsible for changing the visuals when hit by lightning. Duplicate code from the coil is removed.
* ops
* fix
* nah, is escaped anyway
* increase tesla collider size
* keron bb
* try fix test?
* fix
* bruh
* check turn off sus comp
* prototype cleaning
* FIIX
* return and fix sus component
* fix tesla eating lightnings, now mini tesla is electrocuted
* commented some issues
* remove linq sorting
fix jumping system
minor fixes
* fix second Linq
* fix tesla colliders! Yeah, it works
* fix componentregistration
* Just retests
* not fix
* FIX TESLA
* fixes
* store targets
* back
* make dictionary of hashsets
* some sloth fixes
* stump
* playtest balance energy generation, return to unpotimized (but working) lightning shoot
* parity
* work on
* some new fix, some new bug (chasingComponent not chasing)
* comment
* fix ChasingWalkSystem
* fix collider tesla problem
* revert old unoptimized shoot lightning
* new fix pack
---------
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-12-28 16:11:50 +03:00
|
|
|
|
2024-01-01 10:33:48 +03:00
|
|
|
if (uid.Comp.LightningExplode)
|
|
|
|
|
{
|
|
|
|
|
_explosionSystem.QueueExplosion(
|
|
|
|
|
Transform(uid).MapPosition,
|
|
|
|
|
uid.Comp.ExplosionPrototype,
|
|
|
|
|
uid.Comp.TotalIntensity, uid.Comp.Dropoff,
|
|
|
|
|
uid.Comp.MaxTileIntensity,
|
|
|
|
|
canCreateVacuum: false);
|
|
|
|
|
}
|
Tesla (#21124)
* upload all textures
finished easiest part - TeslaGenerator
* Added Tesla energy logic
* add lightning pulse priority
* work
* optimise lightning arc system
* now tesla moving to LightningTarget entity and consume it
* some audio work
add airlock and computers to the LightningTarget
* add nice visual and explosions
add crashing to game
* rsi meta fix
* disabling explosions (crashing server)
I'll get back to that problem later.
* adding important admin logging
* a little bit of cleaning and documentation
* Persistent attempts to fix the server crashing on explosions. Accidental cleaning of everything I see.
* now the tesla incinerates everything it touches except the containment field.
* colliders work
* fix falling tesla on ground after being exploded
* add consume sound, add spawn and collapses sound
* added TeslaGenerator to cargo trading console
* add all tesla part to cargo trading console
* Tesla coils: Turn on and off, get energy from lightning, give energy to the grid.
* tesla coil is ready
* tesla grounding rod is ready
* clean up
* clean up 2
* grounding rods now working without power
* add LightningResistance parameter for LightningTarget Component
* add chaotic teleport
* eletrocution remove?
* deltanedas fix pack
* more fixes
* FIXES
* FIIIXEEES
* The "Grounding Rod" component is removed, and replaced with "LightiningSparking", which is responsible for changing the visuals when hit by lightning. Duplicate code from the coil is removed.
* ops
* fix
* nah, is escaped anyway
* increase tesla collider size
* keron bb
* try fix test?
* fix
* bruh
* check turn off sus comp
* prototype cleaning
* FIIX
* return and fix sus component
* fix tesla eating lightnings, now mini tesla is electrocuted
* commented some issues
* remove linq sorting
fix jumping system
minor fixes
* fix second Linq
* fix tesla colliders! Yeah, it works
* fix componentregistration
* Just retests
* not fix
* FIX TESLA
* fixes
* store targets
* back
* make dictionary of hashsets
* some sloth fixes
* stump
* playtest balance energy generation, return to unpotimized (but working) lightning shoot
* parity
* work on
* some new fix, some new bug (chasingComponent not chasing)
* comment
* fix ChasingWalkSystem
* fix collider tesla problem
* revert old unoptimized shoot lightning
* new fix pack
---------
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-12-28 16:11:50 +03:00
|
|
|
}
|
|
|
|
|
}
|