God part 4 (#1422)

* projectile spell improve

* mind improve
This commit is contained in:
Red
2025-06-14 14:21:25 +03:00
committed by GitHub
parent fc0beb5ccf
commit 7760e8f628
15 changed files with 244 additions and 28 deletions

View File

@@ -157,11 +157,18 @@ public abstract partial class CP14SharedMagicSystem
private void OnReligionRestrictedCheck(Entity<CP14MagicEffectReligionRestrictedComponent> ent, ref CP14CastMagicEffectAttemptEvent args)
{
if (!TryComp<CP14ReligionEntityComponent>(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();

View File

@@ -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<CP14SharedSkillSystem>();
skillSys.AddMemoryPoints(args.Target.Value, AddedPoints, Limit);
}
}

View File

@@ -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<SharedPhysicsSystem>();
var gunSystem = entManager.System<SharedGunSystem>();
var mapManager = IoCManager.Resolve<IMapManager>();
var random = IoCManager.Resolve<IRobustRandom>();
if (!entManager.TryGetComponent<TransformComponent>(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);
}
}
}

View File

@@ -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;
}
/// <summary>
/// Increases the number of memory points for a character, limited to a certain amount.
/// </summary>
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]

View File

@@ -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/"
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/"

Binary file not shown.

Binary file not shown.

View File

@@ -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:
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}

View File

@@ -14,4 +14,6 @@ cp14-research-recipe-list = Затраты на исследование:
cp14-research-craft = Исследовать
cp14-skill-desc-add-mana = Увеличивает объем маны вашего персонажа на {$mana}.
cp14-skill-desc-unlock-recipes = Открывает возможность создания:
cp14-skill-desc-unlock-recipes = Открывает возможность создания:
cp14-skill-popup-added-points = Границы вашего сознания расширяются. Новых очков памяти: {$count}

View File

@@ -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

View File

@@ -8,7 +8,7 @@
components:
- type: Sprite
noRot: true
drawdepth: Mobs
#drawdepth: Mobs
- type: Fixtures
fixtures:
fix1:

View File

@@ -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
#- 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

View File

@@ -87,4 +87,19 @@
- !type:NeedPrerequisite
prerequisite: LumeraT2
- !type:GodFollowerPercentage
percentage: 0.6
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

View File

@@ -19,6 +19,9 @@
{
"name": "mist"
},
{
"name": "mind_upgrade"
},
{
"name": "t1"
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B