diff --git a/Content.Shared/Damage/Systems/StaminaSystem.cs b/Content.Shared/Damage/Systems/StaminaSystem.cs index 472c387ad9..ea9c618620 100644 --- a/Content.Shared/Damage/Systems/StaminaSystem.cs +++ b/Content.Shared/Damage/Systems/StaminaSystem.cs @@ -265,7 +265,7 @@ public sealed partial class StaminaSystem : EntitySystem if (oldDamage < slowdownThreshold && component.StaminaDamage > slowdownThreshold) { - _stunSystem.TrySlowdown(uid, TimeSpan.FromSeconds(3), true, 0.8f, 0.8f); + //_stunSystem.TrySlowdown(uid, TimeSpan.FromSeconds(3), true, 0.8f, 0.8f); //CP14 remove stamina slowdown } SetStaminaAlert(uid, component); diff --git a/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectComponent.cs b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectComponent.cs index 8afff4cdd8..8e06b0f1e3 100644 --- a/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectComponent.cs +++ b/Content.Shared/_CP14/MagicSpell/Components/CP14MagicEffectComponent.cs @@ -1,6 +1,7 @@ using Content.Shared._CP14.MagicRitual.Prototypes; using Content.Shared._CP14.MagicSpell.Spells; using Content.Shared._CP14.MagicSpellStorage; +using Content.Shared._CP14.MagicSpellStorage.Components; using Content.Shared.DoAfter; using Robust.Shared.Prototypes; diff --git a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnTarget.cs b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnTarget.cs index 6545f85b7e..9020e0e294 100644 --- a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnTarget.cs +++ b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellSpawnEntityOnTarget.cs @@ -13,7 +13,7 @@ public sealed partial class CP14SpellSpawnEntityOnTarget : CP14SpellEffect EntityCoordinates? targetPoint = null; if (args.Position is not null) targetPoint = args.Position.Value; - else if (args.Target is not null && entManager.TryGetComponent(args.Target.Value, out var transformComponent)) + if (args.Target is not null && entManager.TryGetComponent(args.Target.Value, out var transformComponent)) targetPoint = transformComponent.Coordinates; if (targetPoint is null) diff --git a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageSystem.Access.cs b/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageSystem.Access.cs new file mode 100644 index 0000000000..605ffa9861 --- /dev/null +++ b/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageSystem.Access.cs @@ -0,0 +1,73 @@ +using Content.Shared._CP14.MagicAttuning; +using Content.Shared._CP14.MagicSpellStorage.Components; +using Content.Shared.Clothing; +using Content.Shared.Clothing.Components; +using Content.Shared.Hands; + +namespace Content.Shared._CP14.MagicSpellStorage; + +public sealed partial class CP14SpellStorageSystem +{ + private void InitializeAccess() + { + SubscribeLocalEvent(OnEquippedHand); + SubscribeLocalEvent(OnHandAddedAttune); + + SubscribeLocalEvent(OnClothingAddedAttune); + SubscribeLocalEvent(OnClothingEquipped); + SubscribeLocalEvent(OnClothingUnequipped); + } + + private void OnEquippedHand(Entity ent, ref GotEquippedHandEvent args) + { + if (!TryComp(ent, out var spellStorage)) + return; + + TryGrantAccess((ent, spellStorage), args.User); + } + + private void OnHandAddedAttune(Entity ent, ref AddedAttuneToMindEvent args) + { + if (!TryComp(ent, out var spellStorage)) + return; + + if (args.User is null) + return; + + if (!_hands.IsHolding(args.User.Value, ent)) + return; + + TryGrantAccess((ent, spellStorage), args.User.Value); + } + + private void OnClothingAddedAttune(Entity ent, ref AddedAttuneToMindEvent args) + { + if (!TryComp(ent, out var spellStorage)) + return; + + if (args.User is null) + return; + + if (!TryComp(ent, out var clothing)) + return; + + if (clothing.InSlot is null || Transform(ent).ParentUid != args.User) + return; + + TryGrantAccess((ent, spellStorage), args.User.Value); + } + + private void OnClothingEquipped(Entity ent, ref ClothingGotEquippedEvent args) + { + if (!TryComp(ent, out var spellStorage)) + return; + + TryGrantAccess((ent, spellStorage), args.Wearer); + } + + private void OnClothingUnequipped(Entity ent, ref ClothingGotUnequippedEvent args) + { + _actions.RemoveProvidedActions(args.Wearer, ent); + } + +} diff --git a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageSystem.cs b/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageSystem.cs index dcf728ce37..b7606b1b7f 100644 --- a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageSystem.cs +++ b/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageSystem.cs @@ -1,11 +1,9 @@ using Content.Shared._CP14.MagicAttuning; using Content.Shared._CP14.MagicSpell.Components; using Content.Shared._CP14.MagicSpell.Events; +using Content.Shared._CP14.MagicSpellStorage.Components; using Content.Shared.Actions; -using Content.Shared.Clothing; -using Content.Shared.Clothing.Components; using Content.Shared.Damage; -using Content.Shared.Hands; using Content.Shared.Hands.EntitySystems; using Content.Shared.Mind; using Robust.Shared.Network; @@ -27,18 +25,12 @@ public sealed partial class CP14SpellStorageSystem : EntitySystem public override void Initialize() { + InitializeAccess(); + SubscribeLocalEvent(OnMagicStorageInit); SubscribeLocalEvent(OnMagicStorageShutdown); SubscribeLocalEvent(OnSpellUsed); - - SubscribeLocalEvent(OnEquippedHand); - SubscribeLocalEvent(OnHandAddedAttune); - - SubscribeLocalEvent(OnClothingAddedAttune); - SubscribeLocalEvent(OnClothingEquipped); - SubscribeLocalEvent(OnClothingUnequipped); - SubscribeLocalEvent(OnRemovedAttune); } @@ -79,58 +71,6 @@ public sealed partial class CP14SpellStorageSystem : EntitySystem } } - private void OnEquippedHand(Entity ent, ref GotEquippedHandEvent args) - { - if (!TryComp(ent, out var spellStorage)) - return; - - TryGrantAccess((ent, spellStorage), args.User); - } - - private void OnHandAddedAttune(Entity ent, ref AddedAttuneToMindEvent args) - { - if (!TryComp(ent, out var spellStorage)) - return; - - if (args.User is null) - return; - - if (!_hands.IsHolding(args.User.Value, ent)) - return; - - TryGrantAccess((ent, spellStorage), args.User.Value); - } - - private void OnClothingAddedAttune(Entity ent, ref AddedAttuneToMindEvent args) - { - if (!TryComp(ent, out var spellStorage)) - return; - - if (args.User is null) - return; - - if (!TryComp(ent, out var clothing)) - return; - - if (clothing.InSlot is null || Transform(ent).ParentUid != args.User) - return; - - TryGrantAccess((ent, spellStorage), args.User.Value); - } - - private void OnClothingEquipped(Entity ent, ref ClothingGotEquippedEvent args) - { - if (!TryComp(ent, out var spellStorage)) - return; - - TryGrantAccess((ent, spellStorage), args.Wearer); - } - - private void OnClothingUnequipped(Entity ent, ref ClothingGotUnequippedEvent args) - { - _actions.RemoveProvidedActions(args.Wearer, ent); - } - private bool TryGrantAccess(Entity storage, EntityUid user) { if (!_mind.TryGetMind(user, out var mindId, out var mind)) diff --git a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageAccessHoldingComponent.cs b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageAccessHoldingComponent.cs similarity index 80% rename from Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageAccessHoldingComponent.cs rename to Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageAccessHoldingComponent.cs index 204adaa393..82983faf6f 100644 --- a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageAccessHoldingComponent.cs +++ b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageAccessHoldingComponent.cs @@ -1,4 +1,4 @@ -namespace Content.Shared._CP14.MagicSpellStorage; +namespace Content.Shared._CP14.MagicSpellStorage.Components; /// /// Denotes that this item's spells can be accessed while holding it in your hand diff --git a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageAccessWearingComponent.cs b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageAccessWearingComponent.cs similarity index 80% rename from Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageAccessWearingComponent.cs rename to Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageAccessWearingComponent.cs index e58a9bf7b7..c1ecd74ae1 100644 --- a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageAccessWearingComponent.cs +++ b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageAccessWearingComponent.cs @@ -1,4 +1,4 @@ -namespace Content.Shared._CP14.MagicSpellStorage; +namespace Content.Shared._CP14.MagicSpellStorage.Components; /// /// Denotes that this item's spells can be accessed while wearing it on your body diff --git a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageComponent.cs b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageComponent.cs similarity index 90% rename from Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageComponent.cs rename to Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageComponent.cs index 3aec79a052..6421024518 100644 --- a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageComponent.cs +++ b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageComponent.cs @@ -1,6 +1,6 @@ using Robust.Shared.Prototypes; -namespace Content.Shared._CP14.MagicSpellStorage; +namespace Content.Shared._CP14.MagicSpellStorage.Components; /// /// A component that allows you to store spells in items diff --git a/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageInteractionComponent.cs b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageInteractionComponent.cs new file mode 100644 index 0000000000..a5992aebf7 --- /dev/null +++ b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageInteractionComponent.cs @@ -0,0 +1,14 @@ +namespace Content.Shared._CP14.MagicSpellStorage.Components; + +/// +/// The component allows you to use actions nested in an object not through hotbar, but through direct interaction with the object. +/// +[RegisterComponent, Access(typeof(CP14SpellStorageSystem))] +public sealed partial class CP14SpellStorageInteractionComponent : Component +{ + /// + /// The selected action will automatically attempt to be used when interacting with the item. + /// + [DataField] + public int SelectedAction; +} diff --git a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageRequireAttuneComponent.cs b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageRequireAttuneComponent.cs similarity index 80% rename from Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageRequireAttuneComponent.cs rename to Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageRequireAttuneComponent.cs index f81ce3851e..b3af633fae 100644 --- a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageRequireAttuneComponent.cs +++ b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageRequireAttuneComponent.cs @@ -1,4 +1,4 @@ -namespace Content.Shared._CP14.MagicSpellStorage; +namespace Content.Shared._CP14.MagicSpellStorage.Components; /// /// The ability to access spellcasting is limited by the attuning requirement diff --git a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageUseDamageComponent.cs b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageUseDamageComponent.cs similarity index 88% rename from Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageUseDamageComponent.cs rename to Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageUseDamageComponent.cs index 59281c2ca4..3c86b59f52 100644 --- a/Content.Shared/_CP14/MagicSpellStorage/CP14SpellStorageUseDamageComponent.cs +++ b/Content.Shared/_CP14/MagicSpellStorage/Components/CP14SpellStorageUseDamageComponent.cs @@ -1,6 +1,6 @@ using Content.Shared.Damage; -namespace Content.Shared._CP14.MagicSpellStorage; +namespace Content.Shared._CP14.MagicSpellStorage.Components; /// /// Causes damage to the Spell storage when spells from it are used diff --git a/Resources/Prototypes/_CP14/Catalog/Fills/closets.yml b/Resources/Prototypes/_CP14/Catalog/Fills/closets.yml index 0cd091de39..a62b68b859 100644 --- a/Resources/Prototypes/_CP14/Catalog/Fills/closets.yml +++ b/Resources/Prototypes/_CP14/Catalog/Fills/closets.yml @@ -119,6 +119,8 @@ contents: - id: CP14Rope - id: CP14Rope + - id: Bola + - id: Bola - id: CP14ModularGuardHalberd - id: CP14BaseShield - id: CP14ModularGripIronLongGuard @@ -142,6 +144,8 @@ contents: - id: CP14Rope - id: CP14Rope + - id: Bola + - id: Bola - id: CP14ModularGuardHalberd - id: CP14BaseShield - id: CP14ModularGripIronLongGuard diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/T0_Sprint.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/T0_Sprint.yml new file mode 100644 index 0000000000..db3aec41e6 --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Physical/T0_Sprint.yml @@ -0,0 +1,29 @@ +- type: entity + id: CP14ActionSpellSprint + name: Sprint + description: At the cost of heavy stamina expenditure, you accelerate significantly in movement. + components: + - type: Sprite + sprite: _CP14/Effects/Magic/spells_icons.rsi + state: sprint + - type: CP14MagicEffectCastSlowdown + speedMultiplier: 1.6 + - type: CP14MagicEffectStaminaCost + stamina: 3 + - type: CP14MagicEffect + effects: + - !type:CP14SpellSpawnEntityOnTarget + spawns: + - CP14DustEffect + - type: InstantAction + itemIconStyle: BigAction + sound: !type:SoundPathSpecifier + path: /Audio/Magic/rumble.ogg + icon: + sprite: _CP14/Effects/Magic/spells_icons.rsi + state: sprint + event: !type:CP14ToggleableInstantActionEvent + effectFrequency: 0.2 + cooldown: 10 + castTime: 10 + hidden: true \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Effects/visual_effect.yml b/Resources/Prototypes/_CP14/Entities/Effects/visual_effect.yml index 42b6aab2d7..5c4c544d70 100644 --- a/Resources/Prototypes/_CP14/Entities/Effects/visual_effect.yml +++ b/Resources/Prototypes/_CP14/Entities/Effects/visual_effect.yml @@ -44,7 +44,7 @@ - type: TimedDespawn lifetime: 0.4 - type: Sprite - drawdepth: Effects + drawdepth: Items sprite: _CP14/Effects/dust.rsi state: dust - type: EffectVisuals diff --git a/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml b/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml index 0e78292bc9..eacc418147 100644 --- a/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml +++ b/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml @@ -437,6 +437,7 @@ - CP14ActionSpellShadowGrab - CP14ActionSpellWaterCreation - CP14ActionSpellBeerCreation + - CP14ActionSpellSprint - type: loadout id: CP14ActionSpellFlameCreation @@ -507,4 +508,10 @@ requirement: !type:RoleTimeRequirement role: CP14JobInnkeeper - time: 7200 # 2 hour \ No newline at end of file + time: 7200 # 2 hour + +- type: loadout + id: CP14ActionSpellSprint + dummyEntity: CP14ActionSpellSprint + actions: + - CP14ActionSpellSprint \ No newline at end of file diff --git a/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/meta.json b/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/meta.json index 7be75098dc..ef0a5e8225 100644 --- a/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/meta.json +++ b/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/meta.json @@ -5,7 +5,7 @@ "y": 32 }, "license": "CLA", - "copyright": "Created by .kreks., cure_poison, cure_burn, mana_gift, water creation, beer creation and resurrection by TheShuEd", + "copyright": "Created by .kreks., cure_poison, cure_burn, mana_gift, water creation, beer creation, sprint and resurrection by TheShuEd", "states": [ { "name": "beer_creation" @@ -55,6 +55,9 @@ { "name": "sphere_of_light" }, + { + "name": "sprint" + }, { "name": "water_creation" } diff --git a/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/sprint.png b/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/sprint.png new file mode 100644 index 0000000000..a2b8da2c42 Binary files /dev/null and b/Resources/Textures/_CP14/Effects/Magic/spells_icons.rsi/sprint.png differ