Teslaloose and Singuloose counterplay (#23444)
* add tesla dissapear mechanic add field holobarrier * add PD * add crafting * spacing * added to cargo * Fix * resprite + damageable * oopsie * Update Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml Co-authored-by: Kara <lunarautomaton6@gmail.com> * Update Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml Co-authored-by: Kara <lunarautomaton6@gmail.com> * Update Resources/Locale/en-US/research/technologies.ftl Co-authored-by: Kara <lunarautomaton6@gmail.com> --------- Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -28,6 +28,18 @@ public sealed partial class TeslaEnergyBallComponent : Component
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float NeedEnergyToSpawn = 100f;
|
||||
|
||||
/// <summary>
|
||||
/// The amount of energy to which the tesla must reach in order to be destroyed.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float EnergyToDespawn = -100f;
|
||||
|
||||
/// <summary>
|
||||
/// Played when energy reaches the lower limit (and entity destroyed)
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public SoundSpecifier? SoundCollapse;
|
||||
|
||||
/// <summary>
|
||||
/// Entities that spawn when the energy limit is reached
|
||||
/// </summary>
|
||||
|
||||
@@ -47,5 +47,10 @@ public sealed class TeslaEnergyBallSystem : EntitySystem
|
||||
component.Energy -= component.NeedEnergyToSpawn;
|
||||
Spawn(component.SpawnProto, Transform(uid).Coordinates);
|
||||
}
|
||||
if (component.Energy < component.EnergyToDespawn)
|
||||
{
|
||||
_audio.PlayPvs(component.SoundCollapse, uid);
|
||||
QueueDel(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user