forked from WWhiteDreamProject/wwdpublic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* resomi * locale + fix sprites * displacements * add sprites (not full (need to check up)) + agillity skill * some stuff * -_- * фыф * add * fix * Add sprites * localisation * fix * вы нахуй меня дрочите?!! --------- Co-authored-by: AwareFoxy <[email protected]>
- Loading branch information
1 parent
91b2252
commit a69214a
Showing
403 changed files
with
2,582 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
Content.Server/_CorvaxNext/Resomi/Abilities/AgillitySkillSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
using Content.Shared.Actions; | ||
using Content.Shared.Alert; | ||
using Content.Shared.Maps; | ||
using Robust.Shared.Containers; | ||
using Robust.Shared.Map; | ||
using Robust.Shared.Timing; | ||
using Content.Shared._CorvaxNext.Resomi; | ||
using Content.Shared.Movement.Components; | ||
using Content.Shared.Movement.Systems; | ||
using Content.Shared._CorvaxNext.Resomi.Abilities; | ||
using Content.Shared.Damage.Components; | ||
using Robust.Shared.Physics; | ||
|
||
namespace Content.Server._CorvaxNext.Resomi.Abilities; | ||
|
||
public sealed class AgillitySkillSystem : SharedAgillitySkillSystem | ||
{ | ||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!; | ||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!; | ||
|
||
private Entity<BaseActionComponent> action; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<AgillitySkillComponent, ComponentInit>(OnComponentInit); | ||
SubscribeLocalEvent<AgillitySkillComponent, SwitchAgillityActionEvent>(SwitchAgility); | ||
SubscribeLocalEvent<AgillitySkillComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovespeed); | ||
} | ||
|
||
private void OnComponentInit(Entity<AgillitySkillComponent> ent, ref ComponentInit args) | ||
{ | ||
_actionsSystem.AddAction(ent.Owner, ref ent.Comp.SwitchAgilityActionEntity, ent.Comp.SwitchAgilityAction, ent.Owner); | ||
} | ||
|
||
private void SwitchAgility(Entity<AgillitySkillComponent> ent, ref SwitchAgillityActionEvent args) | ||
{ | ||
action = args.Action; | ||
|
||
if (!ent.Comp.Active) | ||
{ | ||
ActivateAgility(ent, action); | ||
} | ||
else | ||
{ | ||
DeactivateAgility(ent.Owner, ent.Comp, action); | ||
} | ||
} | ||
|
||
private void ActivateAgility(Entity<AgillitySkillComponent> ent, Entity<BaseActionComponent> action) | ||
{ | ||
if (!TryComp<MovementSpeedModifierComponent>(ent.Owner, out var comp)) | ||
return; | ||
|
||
_popup.PopupEntity(Loc.GetString("agility-activated-massage"), ent.Owner); | ||
|
||
ent.Comp.SprintSpeedCurrent += ent.Comp.SprintSpeedModifier; // adding a modifier to the base running speed | ||
_movementSpeedModifier.RefreshMovementSpeedModifiers(ent.Owner); | ||
|
||
ent.Comp.Active = !ent.Comp.Active; | ||
|
||
var ev = new SwitchAgillity(action, ent.Comp.Active); | ||
RaiseLocalEvent(ent.Owner, ref ev); | ||
} | ||
|
||
private void DeactivateAgility(EntityUid uid, AgillitySkillComponent component, Entity<BaseActionComponent> action) | ||
{ | ||
if (!TryComp<MovementSpeedModifierComponent>(uid, out var comp)) | ||
return; | ||
|
||
_popup.PopupEntity(Loc.GetString("agility-deactivated-massage"), uid); | ||
|
||
component.SprintSpeedCurrent = 1f; // return the base running speed to normal | ||
_movementSpeedModifier.RefreshMovementSpeedModifiers(uid); | ||
|
||
_actions.SetCooldown(action.Owner, component.CooldownDelay); | ||
|
||
component.Active = !component.Active; | ||
|
||
var ev = new SwitchAgillity(action, component.Active); | ||
RaiseLocalEvent(uid, ref ev); | ||
} | ||
|
||
private void OnRefreshMovespeed(Entity<AgillitySkillComponent> ent, ref RefreshMovementSpeedModifiersEvent args) | ||
{ | ||
args.ModifySpeed(1f, ent.Comp.SprintSpeedCurrent); | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
var query = EntityQueryEnumerator<AgillitySkillComponent>(); | ||
while (query.MoveNext(out var uid, out var resomiComp)) | ||
{ | ||
if (!TryComp<StaminaComponent>(uid, out var stamina) | ||
|| !resomiComp.Active | ||
|| Timing.CurTime < resomiComp.NextUpdateTime) | ||
continue; | ||
|
||
resomiComp.NextUpdateTime = Timing.CurTime + resomiComp.UpdateRate; | ||
|
||
_stamina.TryTakeStamina(uid, resomiComp.StaminaDamagePassive); | ||
if (stamina.StaminaDamage > stamina.CritThreshold * 0.50f) | ||
DeactivateAgility(uid, resomiComp, action); | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
Content.Server/_CorvaxNext/Speech/Components/ResomiAccentComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
namespace Content.Server._CorvaxNext.Speech.Components; | ||
|
||
[RegisterComponent] | ||
public sealed partial class ResomiAccentComponent : Component; |
61 changes: 61 additions & 0 deletions
61
Content.Server/_CorvaxNext/Speech/EntitySystems/ResomiAccentSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System.Text.RegularExpressions; | ||
using Content.Server._CorvaxNext.Speech.Components; | ||
using Content.Server.Speech; | ||
using Robust.Shared.Random; | ||
|
||
namespace Content.Server._CorvaxNext.Speech.EntitySystems; | ||
|
||
public sealed class ResomiAccentSystem : EntitySystem | ||
{ | ||
|
||
[Dependency] private readonly IRobustRandom _random = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<ResomiAccentComponent, AccentGetEvent>(OnAccent); | ||
} | ||
|
||
private void OnAccent(EntityUid uid, ResomiAccentComponent component, AccentGetEvent args) | ||
{ | ||
var message = args.Message; | ||
|
||
// ш => шшш | ||
message = Regex.Replace( | ||
message, | ||
"ш+", | ||
_random.Pick(new List<string>() { "шш", "шшш" }) | ||
); | ||
// Ш => ШШШ | ||
message = Regex.Replace( | ||
message, | ||
"Ш+", | ||
_random.Pick(new List<string>() { "ШШ", "ШШШ" }) | ||
); | ||
// ч => щщщ | ||
message = Regex.Replace( | ||
message, | ||
"ч+", | ||
_random.Pick(new List<string>() { "щщ", "щщщ" }) | ||
); | ||
// Ч => ЩЩЩ | ||
message = Regex.Replace( | ||
message, | ||
"Ч+", | ||
_random.Pick(new List<string>() { "ЩЩ", "ЩЩЩ" }) | ||
); | ||
// р => ррр | ||
message = Regex.Replace( | ||
message, | ||
"р+", | ||
_random.Pick(new List<string>() { "рр", "ррр" }) | ||
); | ||
// Р => РРР | ||
message = Regex.Replace( | ||
message, | ||
"Р+", | ||
_random.Pick(new List<string>() { "РР", "РРР" }) | ||
); | ||
args.Message = message; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Content.Shared.Chat; | ||
/// <summary> | ||
/// Corvax-Next-Resomi | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class ChatModifierComponent : Component | ||
{ | ||
[DataField("whisperListeningRange")] | ||
public int WhisperListeningRange = SharedChatSystem.WhisperClearRange; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Content.Shared.Flash.Components; | ||
|
||
|
||
/// <summary> | ||
/// Corvax-Next-Resomi | ||
/// </summary> | ||
|
||
[RegisterComponent] | ||
public sealed partial class FlashModifierComponent : Component | ||
{ | ||
[DataField] | ||
public float Modifier = 1f; | ||
} |
2 changes: 1 addition & 1 deletion
2
Content.Shared/Weapons/Ranged/Events/GunRefreshModifiersEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
Content.Shared/_CorvaxNext/Resomi/Abilities/SharedAgillitySkillComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
|
||
namespace Content.Shared._CorvaxNext.Resomi.Abilities; | ||
|
||
[RegisterComponent, NetworkedComponent] | ||
[AutoGenerateComponentState] | ||
public sealed partial class AgillitySkillComponent : Component | ||
{ | ||
[AutoNetworkedField, DataField] | ||
public Dictionary<string, int> DisabledJumpUpFixtureMasks = new(); | ||
[AutoNetworkedField, DataField] | ||
public Dictionary<string, int> DisabledJumpDownFixtureMasks = new(); | ||
|
||
[DataField("active")] | ||
public bool Active = false; | ||
|
||
/// <summary> | ||
/// if we want the ability to not give the opportunity to jump on the tables and only accelerate | ||
/// </summary> | ||
[DataField("jumpEnabled")] | ||
public bool JumpEnabled = true; | ||
|
||
[DataField("switchAgilityAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] | ||
public string? SwitchAgilityAction = "SwitchAgilityAction"; | ||
|
||
[DataField("switchAgilityActionEntity")] public EntityUid? SwitchAgilityActionEntity; | ||
|
||
/// <summary> | ||
/// how much stamina will be spent for each jump | ||
/// </summary> | ||
[DataField("staminaDamageOnJump")] | ||
public float StaminaDamageOnJump = 10f; | ||
|
||
/// <summary> | ||
/// how much stamina will be passive spent while abilitty is activated | ||
/// </summary> | ||
[DataField("staminaDamagePassive")] | ||
public float StaminaDamagePassive = 3f; | ||
|
||
[DataField("sprintSpeedModifier")] | ||
public float SprintSpeedModifier = 0.1f; //+10% | ||
public float SprintSpeedCurrent = 1f; | ||
|
||
/// <summary> | ||
/// once in how many seconds is our stamina taken away while the ability is on | ||
/// </summary> | ||
[DataField("delay")] | ||
public double Delay = 1.0; | ||
public TimeSpan UpdateRate => TimeSpan.FromSeconds(Delay); | ||
public TimeSpan NextUpdateTime; | ||
|
||
/// <summary> | ||
/// cooldown of ability. Called when the ability is disabled | ||
/// </summary> | ||
[DataField("cooldown")] | ||
public double Cooldown = 20.0; | ||
public TimeSpan CooldownDelay => TimeSpan.FromSeconds(Cooldown); | ||
} |
45 changes: 45 additions & 0 deletions
45
Content.Shared/_CorvaxNext/Resomi/Abilities/SharedAgillitySkillSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Robust.Shared.Timing; | ||
using Robust.Shared.Physics.Systems; | ||
using Robust.Shared.Physics; | ||
using Content.Shared.Physics; | ||
using Content.Shared.Popups; | ||
using Robust.Shared.Physics.Events; | ||
using Robust.Shared.Log; | ||
using Content.Shared.Climbing.Systems; | ||
using Content.Shared.Damage.Systems; | ||
using Content.Shared.Actions; | ||
|
||
namespace Content.Shared._CorvaxNext.Resomi.Abilities; | ||
|
||
public abstract class SharedAgillitySkillSystem : EntitySystem | ||
{ | ||
[Dependency] protected readonly IGameTiming Timing = default!; | ||
[Dependency] protected readonly SharedPopupSystem _popup = default!; | ||
[Dependency] protected readonly ClimbSystem _climb = default!; | ||
[Dependency] protected readonly StaminaSystem _stamina = default!; | ||
[Dependency] protected readonly SharedActionsSystem _actions = default!; | ||
|
||
protected const int BaseCollisionGroup = (int)(CollisionGroup.MobMask); | ||
|
||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<AgillitySkillComponent, StartCollideEvent>(DoJump); | ||
SubscribeLocalEvent<AgillitySkillComponent, SwitchAgillity>(OnHandleStateChange); | ||
} | ||
|
||
private void DoJump(Entity<AgillitySkillComponent> ent, ref StartCollideEvent args) | ||
{ | ||
if (!ent.Comp.Active || !ent.Comp.JumpEnabled | ||
|| args.OurFixture.CollisionMask != BaseCollisionGroup | ||
|| args.OtherFixture.CollisionMask != (int)CollisionGroup.TableMask) | ||
return; | ||
|
||
_stamina.TryTakeStamina(ent.Owner, ent.Comp.StaminaDamageOnJump); | ||
_climb.ForciblySetClimbing(ent.Owner, args.OtherEntity); | ||
} | ||
|
||
private void OnHandleStateChange(Entity<AgillitySkillComponent> ent, ref SwitchAgillity args) | ||
{ | ||
_actions.SetToggled(args.action.Owner, args.toggled); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Content.Shared/_CorvaxNext/Resomi/Abilities/WeaponsUseInabilityComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Content.Shared._CorvaxNext.Resomi.Abilities; | ||
|
||
|
||
/// <summary> | ||
/// It does not allow you to fire a weapon that requires two hands. | ||
/// Increases the spread, as if shooting was conducted from one hand. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class WeaponsUseInabilityComponent : Component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Content.Shared.Actions; | ||
using Content.Shared.DoAfter; | ||
using Robust.Shared.Serialization; | ||
|
||
namespace Content.Shared._CorvaxNext.Resomi; | ||
|
||
public sealed partial class SwitchAgillityActionEvent : InstantActionEvent; | ||
|
||
/// <summary> | ||
/// Rises when the action state changes | ||
/// </summary> | ||
/// <param name="action"> Entity of Action that we want change the state</param> | ||
/// <param name="toggled"> </param> | ||
[ByRefEvent] | ||
public readonly record struct SwitchAgillity(Entity<BaseActionComponent> action, bool toggled); |
Binary file not shown.
Oops, something went wrong.