2023-04-02 16:48:32 +03:00
|
|
|
using Robust.Shared.Audio;
|
|
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Weapons.Reflect;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entities with this component have a chance to reflect projectiles and hitscan shots
|
2024-07-11 05:55:56 +00:00
|
|
|
/// Uses <c>ItemToggleComponent</c> to control reflection.
|
2023-04-02 16:48:32 +03:00
|
|
|
/// </summary>
|
2023-05-15 15:21:05 +10:00
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
|
|
|
public sealed partial class ReflectComponent : Component
|
2023-04-02 16:48:32 +03:00
|
|
|
{
|
2023-05-15 15:21:05 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// What we reflect.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("reflects")]
|
|
|
|
|
public ReflectType Reflects = ReflectType.Energy | ReflectType.NonEnergy;
|
|
|
|
|
|
2023-04-02 16:48:32 +03:00
|
|
|
/// <summary>
|
2024-06-23 12:16:08 +10:00
|
|
|
/// Probability for a projectile to be reflected.
|
2023-04-02 16:48:32 +03:00
|
|
|
/// </summary>
|
2023-05-15 15:21:05 +10:00
|
|
|
[DataField("reflectProb"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
|
|
|
|
public float ReflectProb = 0.25f;
|
2023-04-02 16:48:32 +03:00
|
|
|
|
2024-06-23 12:16:08 +10:00
|
|
|
[DataField("spread"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
|
|
|
|
public Angle Spread = Angle.FromDegrees(45);
|
Weapon Reflection Movement Mechanic (#27219)
* Weapon Reflection Movement Mechanic
Adds a movement mechanic to deflection.
Standing still gives you your best chance of deflecting a shot.
Moving lowers this to 2/3rds. Sprinting to 1/3rd.
This allows for robust players to express better and provides
counterplay to someone finding a goober-strong deflection
weapon, giving more design space.
As part of this PR I've also touched the numbers of a few swords,
shields, etc. and modified some descriptions to make them read
better. The balance numbers are not remotely final, but as intent:
1. All the sidearm swords (katana, cutlass, captain's sabre) have the same damage. There's no good reason the "ceremonial" blade the captain has doing more damage than a katana.
2. The Captain's Sabre has a 30% reflect chance, dropping to 20% when moving and 10% when sprinting. This one is controversial due to the recent nerf, I suspect: This could easily be 15->10->5?
3. The Energy Katana has a flat 30% reflect chance.
4. The meme Throngler has a 30% reflect chance, dropping to 20% when moving and 10% when sprinting.
5. The E-Sword has a 30% reflect chance, dropping to 20% when moving and 10% when sprinting.
6. The Double E-Sword has a mighty 75% reflect chance, dropping to 50% and then 25%.
7. Both reflective shields - Mirror and Energy - have a 95% deflect chance, dropping to 63% then 31%.
* Resolve PR comments.
* Weh?
* Reign in double esword a tad
* Shield nerfs no longer real
* Improve Mirror Cult desc
* Simple alert for deflection! No art yet.
* Added a new icon for deflecting
2024-05-07 19:14:58 +01:00
|
|
|
|
2024-06-23 12:16:08 +10:00
|
|
|
[DataField("soundOnReflect")]
|
|
|
|
|
public SoundSpecifier? SoundOnReflect = new SoundPathSpecifier("/Audio/Weapons/Guns/Hits/laser_sear_wall.ogg");
|
2023-04-02 16:48:32 +03:00
|
|
|
}
|
|
|
|
|
|
2023-05-15 15:21:05 +10:00
|
|
|
[Flags]
|
|
|
|
|
public enum ReflectType : byte
|
2023-04-02 16:48:32 +03:00
|
|
|
{
|
2023-05-15 15:21:05 +10:00
|
|
|
None = 0,
|
|
|
|
|
NonEnergy = 1 << 0,
|
|
|
|
|
Energy = 1 << 1,
|
2023-04-02 16:48:32 +03:00
|
|
|
}
|