diff --git a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.Checks.cs b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.Checks.cs index c80a3e0cce..8ce8d72002 100644 --- a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.Checks.cs +++ b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.Checks.cs @@ -157,11 +157,18 @@ public abstract partial class CP14SharedMagicSystem private void OnReligionRestrictedCheck(Entity ent, ref CP14CastMagicEffectAttemptEvent args) { - if (!TryComp(args.Performer, out var religionComp)) return; - if (args.Position is not null && _god.InVision(args.Position.Value, (args.Performer, religionComp))) + var position = args.Position; + + if (args.Target is not null) + position ??= Transform(args.Target.Value).Coordinates; + + if (position is null) + return; + + if (_god.InVision(position.Value, (args.Performer, religionComp))) return; args.Cancel(); diff --git a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellAddMemoryPoint.cs b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellAddMemoryPoint.cs new file mode 100644 index 0000000000..590a699fd0 --- /dev/null +++ b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellAddMemoryPoint.cs @@ -0,0 +1,22 @@ +using Content.Shared._CP14.Skill; + +namespace Content.Shared._CP14.MagicSpell.Spells; + +public sealed partial class CP14SpellAddMemoryPoint : CP14SpellEffect +{ + [DataField] + public float AddedPoints = 0.5f; + + [DataField] + public float Limit = 6.5f; + + public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args) + { + if (args.Target is null) + return; + + var skillSys = entManager.System(); + + skillSys.AddMemoryPoints(args.Target.Value, AddedPoints, Limit); + } +} diff --git a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellProjectile.cs b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellProjectile.cs index 50deac91d5..1e77e3991c 100644 --- a/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellProjectile.cs +++ b/Content.Shared/_CP14/MagicSpell/Spells/CP14SpellProjectile.cs @@ -1,7 +1,9 @@ +using System.Numerics; using Content.Shared.Weapons.Ranged.Systems; using Robust.Shared.Map; using Robust.Shared.Physics.Systems; using Robust.Shared.Prototypes; +using Robust.Shared.Random; namespace Content.Shared._CP14.MagicSpell.Spells; @@ -10,6 +12,15 @@ public sealed partial class CP14SpellProjectile : CP14SpellEffect [DataField(required: true)] public EntProtoId Prototype; + [DataField] + public float ProjectileSpeed = 20f; + + [DataField] + public float Spread = 0f; + + [DataField] + public int ProjectileCount = 1; + public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args) { EntityCoordinates? targetPoint = null; @@ -27,6 +38,7 @@ public sealed partial class CP14SpellProjectile : CP14SpellEffect var physics = entManager.System(); var gunSystem = entManager.System(); var mapManager = IoCManager.Resolve(); + var random = IoCManager.Resolve(); if (!entManager.TryGetComponent(args.User, out var xform)) return; @@ -40,14 +52,24 @@ public sealed partial class CP14SpellProjectile : CP14SpellEffect // If applicable, this ensures the projectile is parented to grid on spawn, instead of the map. var fromMap = transform.ToMapCoordinates(fromCoords); + var spawnCoords = mapManager.TryFindGridAt(fromMap, out var gridUid, out _) ? transform.WithEntityId(fromCoords, gridUid) : new(mapManager.GetMapEntityId(fromMap.MapId), fromMap.Position); + for (var i = 0; i < ProjectileCount; i++) + { + //Apply spread to target point + var offsetedTargetPoint = targetPoint.Value.Offset(new Vector2( + (float) (random.NextDouble() * 2 - 1) * Spread, + (float) (random.NextDouble() * 2 - 1) * Spread)); - var ent = entManager.SpawnAtPosition(Prototype, spawnCoords); - var direction = targetPoint.Value.ToMapPos(entManager, transform) - - spawnCoords.ToMapPos(entManager, transform); - gunSystem.ShootProjectile(ent, direction, userVelocity, args.User.Value, args.User); + var ent = entManager.SpawnAtPosition(Prototype, spawnCoords); + + var direction = offsetedTargetPoint.ToMapPos(entManager, transform) - + spawnCoords.ToMapPos(entManager, transform); + + gunSystem.ShootProjectile(ent, direction, userVelocity, args.User.Value, args.User, ProjectileSpeed); + } } } diff --git a/Content.Shared/_CP14/Skill/CP14SharedSkillSystem.cs b/Content.Shared/_CP14/Skill/CP14SharedSkillSystem.cs index 0a581fc08c..575903e9e1 100644 --- a/Content.Shared/_CP14/Skill/CP14SharedSkillSystem.cs +++ b/Content.Shared/_CP14/Skill/CP14SharedSkillSystem.cs @@ -3,6 +3,7 @@ using System.Text; using Content.Shared._CP14.Skill.Components; using Content.Shared._CP14.Skill.Prototypes; using Content.Shared.FixedPoint; +using Content.Shared.Popups; using Robust.Shared.Prototypes; namespace Content.Shared._CP14.Skill; @@ -268,6 +269,20 @@ public abstract partial class CP14SharedSkillSystem : EntitySystem } return true; } + + /// + /// Increases the number of memory points for a character, limited to a certain amount. + /// + public void AddMemoryPoints(EntityUid target, FixedPoint2 points, FixedPoint2 limit, CP14SkillStorageComponent? component = null) + { + if (!Resolve(target, ref component, false)) + return; + + component.ExperienceMaxCap = FixedPoint2.Min(component.ExperienceMaxCap + points, limit); + Dirty(target, component); + + _popup.PopupEntity(Loc.GetString("cp14-skill-popup-added-points", ("count", points)), target, target); + } } [ByRefEvent] diff --git a/Resources/Audio/_CP14/Effects/attributions.yml b/Resources/Audio/_CP14/Effects/attributions.yml index 1c3c18d4ea..2962b1a785 100644 --- a/Resources/Audio/_CP14/Effects/attributions.yml +++ b/Resources/Audio/_CP14/Effects/attributions.yml @@ -91,4 +91,9 @@ - files: ["cash.ogg"] license: "CC0-1.0" copyright: 'Created by Zott820 on Freesound.org' - source: "https://freesound.org/people/Zott820/sounds/209578/" \ No newline at end of file + source: "https://freesound.org/people/Zott820/sounds/209578/" + +- files: ["ritual_begin.ogg", "ritual_end.ogg"] + license: "CC-BY-4.0" + copyright: 'Created by SilverIllusionist on Freesound.org' + source: "https://freesound.org/people/SilverIllusionist/sounds/671928/" \ No newline at end of file diff --git a/Resources/Audio/_CP14/Effects/ritual_begin.ogg b/Resources/Audio/_CP14/Effects/ritual_begin.ogg new file mode 100644 index 0000000000..1c56bd3fa1 Binary files /dev/null and b/Resources/Audio/_CP14/Effects/ritual_begin.ogg differ diff --git a/Resources/Audio/_CP14/Effects/ritual_end.ogg b/Resources/Audio/_CP14/Effects/ritual_end.ogg new file mode 100644 index 0000000000..bc433868fd Binary files /dev/null and b/Resources/Audio/_CP14/Effects/ritual_end.ogg differ diff --git a/Resources/Locale/en-US/_CP14/skill/ui.ftl b/Resources/Locale/en-US/_CP14/skill/ui.ftl index c7a86baaa5..ff7a558384 100644 --- a/Resources/Locale/en-US/_CP14/skill/ui.ftl +++ b/Resources/Locale/en-US/_CP14/skill/ui.ftl @@ -14,4 +14,6 @@ cp14-research-recipe-list = Research costs: cp14-research-craft = Research cp14-skill-desc-add-mana = Increases your character's mana amount by {$mana}. -cp14-skill-desc-unlock-recipes = Opens up the possibility of crafting: \ No newline at end of file +cp14-skill-desc-unlock-recipes = Opens up the possibility of crafting: + +cp14-skill-popup-added-points = The boundaries of your consciousness are expanding. New memory points: {$count} \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/skill/ui.ftl b/Resources/Locale/ru-RU/_CP14/skill/ui.ftl index 10933366e6..012506991f 100644 --- a/Resources/Locale/ru-RU/_CP14/skill/ui.ftl +++ b/Resources/Locale/ru-RU/_CP14/skill/ui.ftl @@ -14,4 +14,6 @@ cp14-research-recipe-list = Затраты на исследование: cp14-research-craft = Исследовать cp14-skill-desc-add-mana = Увеличивает объем маны вашего персонажа на {$mana}. -cp14-skill-desc-unlock-recipes = Открывает возможность создания: \ No newline at end of file +cp14-skill-desc-unlock-recipes = Открывает возможность создания: + +cp14-skill-popup-added-points = Границы вашего сознания расширяются. Новых очков памяти: {$count} \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Demigods/Lumera/mind_upgrade.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Demigods/Lumera/mind_upgrade.yml new file mode 100644 index 0000000000..438a70effe --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Demigods/Lumera/mind_upgrade.yml @@ -0,0 +1,123 @@ +- type: entity + id: CP14ActionSpellGodLumeraMindUpgrade + name: Expansion of consciousness + description: "You expand the boundaries of what is possible for the chosen creature, revealing to it the secrets of the universe. The target gains +0.5 memory points, up to a maximum of 6.5" + components: + - type: CP14MagicEffectReligionRestricted + - type: CP14MagicEffectManaCost + manaCost: 300 + - type: CP14MagicEffect + telegraphyEffects: + - !type:CP14SpellSpawnEntityOnTarget + spawns: + - CP14RuneMindImprove + - !type:CP14SpellApplyEntityEffect + effects: + - !type:ChemVomit + - !type:Jitter + time: 16 + - !type:HealthChange + damage: + types: + Slash: 10 + Blunt: 10 + Piercing: 10 + - !type:MovespeedModifier + walkSpeedModifier: 0.02 + sprintSpeedModifier: 0.02 + statusLifetime: 19 + effects: + - !type:CP14SpellSpawnEntityOnTarget + spawns: + - CP14LumeraMindImproveImpact + - !type:CP14SpellAddMemoryPoint + - !type:CP14SpellApplyEntityEffect + effects: + - !type:Jitter + time: 16 + - !type:Paralyze + paralyzeTime: 16 + - !type:Drunk + boozePower: 20 + - !type:HealthChange + damage: + types: + Slash: 10 + Blunt: 10 + Piercing: 10 + - !type:MovespeedModifier + walkSpeedModifier: 0.5 + sprintSpeedModifier: 0.5 + statusLifetime: 30 + - type: EntityTargetAction + canTargetSelf: false + blacklist: + components: + - CP14ReligionEntity + whitelist: + components: + - CP14SkillStorage + range: 100 + itemIconStyle: BigAction + checkCanAccess: false + sound: !type:SoundPathSpecifier + path: /Audio/Magic/rumble.ogg + icon: + sprite: _CP14/Actions/DemigodSpells/lumera.rsi + state: mind_upgrade + event: !type:CP14DelayedEntityTargetActionEvent + cooldown: 300 + castDelay: 16 + breakOnMove: false + breakOnDamage: false + +- type: entity + id: CP14RuneMindImprove + parent: CP14BaseMagicRune + categories: [ HideSpawnMenu ] + save: false + components: + - type: TimedDespawn + lifetime: 16 + - type: PointLight + color: "#586dcc" + radius: 5 + energy: 8 + - type: LightFade + duration: 10 + - type: Sprite + layers: + - state: medium_circle + scale: 1.5, 1.5 + color: "#586dcc" + shader: unshaded + - type: EmitSoundOnSpawn + sound: + path: /Audio/_CP14/Effects/ritual_begin.ogg + +- type: entity + id: CP14LumeraMindImproveImpact + categories: [ ForkFiltered ] + name: fese + parent: CP14BaseMagicImpact + save: false + components: + - type: PointLight + color: "#3843a8" + enabled: true + radius: 15 + energy: 8 + netsync: false + - type: Sprite + layers: + - state: stars + scale: 2, 2 + color: "#9fb0fc" + shader: unshaded + - type: LightFade + duration: 1 + - type: TimedDespawn + lifetime: 3 + - type: EmitSoundOnSpawn + sound: + path: /Audio/_CP14/Effects/ritual_end.ogg \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Religion/base.yml b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Religion/base.yml index 5debef049a..fb2d3fb87f 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Religion/base.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Religion/base.yml @@ -8,7 +8,7 @@ components: - type: Sprite noRot: true - drawdepth: Mobs + #drawdepth: Mobs - type: Fixtures fixtures: fix1: diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Religion/primordial.yml b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Religion/primordial.yml index e140e91fb5..7e442e0c9c 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Religion/primordial.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Religion/primordial.yml @@ -16,20 +16,20 @@ - type: SpawnPoint job_id: CP14GodLumera -- type: entity - parent: CP14BaseAltarPrimordial - id: CP14AltarPrimordialGodMerkas - name: primordial statue of Merkas - description: A beautiful, overgrown statue of Sylvania, revered as a goddess of nature. - components: - - type: Sprite - sprite: Structures/Furniture/Altars/Gods/nanotrasen.rsi - layers: - - state: druid - - type: CP14ReligionAltar - religion: Merkas - - type: CP14ReligionObserver - observation: - Merkas: 10 - - type: SpawnPoint - job_id: CP14GodMerkas \ No newline at end of file +#- type: entity +# parent: CP14BaseAltarPrimordial +# id: CP14AltarPrimordialGodMerkas +# name: primordial statue of Merkas +# description: A beautiful, overgrown statue of Sylvania, revered as a goddess of nature. +# components: +# - type: Sprite +# sprite: Structures/Furniture/Altars/Gods/nanotrasen.rsi +# layers: +# - state: druid +# - type: CP14ReligionAltar +# religion: Merkas +# - type: CP14ReligionObserver +# observation: +# Merkas: 10 +# - type: SpawnPoint +# job_id: CP14GodMerkas \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Skill/Demigods/lumera.yml b/Resources/Prototypes/_CP14/Skill/Demigods/lumera.yml index 71040be411..5e2a31fcfb 100644 --- a/Resources/Prototypes/_CP14/Skill/Demigods/lumera.yml +++ b/Resources/Prototypes/_CP14/Skill/Demigods/lumera.yml @@ -87,4 +87,19 @@ - !type:NeedPrerequisite prerequisite: LumeraT2 - !type:GodFollowerPercentage - percentage: 0.6 \ No newline at end of file + percentage: 0.6 + +- type: cp14Skill + id: LumeraMindUpgrade + skillUiPosition: 12, 3 + tree: GodLumera + learnCost: 1.0 + icon: + sprite: _CP14/Actions/DemigodSpells/lumera.rsi + state: mind_upgrade + effects: + - !type:AddAction + action: CP14ActionSpellGodLumeraMindUpgrade + restrictions: + - !type:NeedPrerequisite + prerequisite: LumeraT3 \ No newline at end of file diff --git a/Resources/Textures/_CP14/Actions/DemigodSpells/lumera.rsi/meta.json b/Resources/Textures/_CP14/Actions/DemigodSpells/lumera.rsi/meta.json index c43657ae34..2f53f3b097 100644 --- a/Resources/Textures/_CP14/Actions/DemigodSpells/lumera.rsi/meta.json +++ b/Resources/Textures/_CP14/Actions/DemigodSpells/lumera.rsi/meta.json @@ -19,6 +19,9 @@ { "name": "mist" }, + { + "name": "mind_upgrade" + }, { "name": "t1" }, diff --git a/Resources/Textures/_CP14/Actions/DemigodSpells/lumera.rsi/mind_upgrade.png b/Resources/Textures/_CP14/Actions/DemigodSpells/lumera.rsi/mind_upgrade.png new file mode 100644 index 0000000000..a24589c274 Binary files /dev/null and b/Resources/Textures/_CP14/Actions/DemigodSpells/lumera.rsi/mind_upgrade.png differ