Gods part 6 (#1425)

* Skill scanning + bugfixes

* memory point examining

* Update base.yml

* predict skill examining

* moon beam lumera action

* balance
This commit is contained in:
Red
2025-06-15 01:50:16 +03:00
committed by GitHub
parent 71abce8db8
commit 4be22326ce
21 changed files with 213 additions and 79 deletions

View File

@@ -1,6 +1,6 @@
using Content.Shared._CP14.MagicEssence;
using Content.Shared._CP14.MagicSpell.Events;
using Content.Shared._CP14.ResearchTable;
using Content.Shared._CP14.Skill;
using Content.Shared.Armor;
using Content.Shared.Atmos;
using Content.Shared.Chat;

View File

@@ -1,78 +1,12 @@
using System.Text;
using Content.Shared._CP14.Skill;
using Content.Shared._CP14.Skill.Components;
using Content.Shared._CP14.Skill.Prototypes;
using Content.Shared.DoAfter;
using Content.Shared.Examine;
using Content.Shared.Inventory;
using Content.Shared.Verbs;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared._CP14.ResearchTable;
public abstract class CP14SharedResearchSystem : EntitySystem
{
[Dependency] private readonly ExamineSystemShared _examine = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly CP14SharedSkillSystem _skill = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CP14SkillScannerComponent, CP14SkillScanEvent>(OnSkillScan);
SubscribeLocalEvent<CP14SkillScannerComponent, InventoryRelayedEvent<CP14SkillScanEvent>>((e, c, ev) => OnSkillScan(e, c, ev.Args));
SubscribeLocalEvent<CP14SkillStorageComponent, GetVerbsEvent<ExamineVerb>>(OnExamined);
}
private void OnExamined(Entity<CP14SkillStorageComponent> ent, ref GetVerbsEvent<ExamineVerb> args)
{
var scanEvent = new CP14SkillScanEvent();
RaiseLocalEvent(args.User, scanEvent);
if (!scanEvent.CanScan)
return;
var markup = GetSkillExamine(ent);
_examine.AddDetailedExamineVerb(
args,
ent.Comp,
markup,
Loc.GetString("cp14-skill-examine"),
"/Textures/Interface/students-cap.svg.192dpi.png");
}
private FormattedMessage GetSkillExamine(Entity<CP14SkillStorageComponent> ent)
{
var msg = new FormattedMessage();
var sb = new StringBuilder();
sb.Append(Loc.GetString("cp14-skill-examine-title") + "\n");
foreach (var skill in ent.Comp.LearnedSkills)
{
if (!_proto.TryIndex(skill, out var indexedSkill))
continue;
if(!_proto.TryIndex(indexedSkill.Tree, out var indexedTree))
continue;
var skillName = _skill.GetSkillName(skill);
sb.Append($"• [color={indexedTree.Color.ToHex()}]{skillName}[/color]\n");
}
msg.AddMarkupOrThrow(sb.ToString());
return msg;
}
private void OnSkillScan(EntityUid uid, CP14SkillScannerComponent component, CP14SkillScanEvent args)
{
args.CanScan = true;
}
}
[Serializable, NetSerializable]
@@ -83,9 +17,3 @@ public sealed partial class CP14ResearchDoAfterEvent : DoAfterEvent
public override DoAfterEvent Clone() => this;
}
public sealed class CP14SkillScanEvent : EntityEventArgs, IInventoryRelayEvent
{
public bool CanScan;
public SlotFlags TargetSlots { get; } = SlotFlags.EYES;
}

View File

@@ -3,7 +3,6 @@ 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;
@@ -22,6 +21,7 @@ public abstract partial class CP14SharedSkillSystem : EntitySystem
InitializeAdmin();
InitializeChecks();
InitializeScanning();
}
private void OnMapInit(Entity<CP14SkillStorageComponent> ent, ref MapInitEvent args)

View File

@@ -0,0 +1,75 @@
using System.Text;
using Content.Shared._CP14.Skill.Components;
using Content.Shared.Examine;
using Content.Shared.Inventory;
using Content.Shared.Verbs;
using Robust.Shared.Utility;
namespace Content.Shared._CP14.Skill;
public abstract partial class CP14SharedSkillSystem
{
[Dependency] private readonly ExamineSystemShared _examine = default!;
private void InitializeScanning()
{
SubscribeLocalEvent<CP14SkillScannerComponent, CP14SkillScanEvent>(OnSkillScan);
SubscribeLocalEvent<CP14SkillScannerComponent, InventoryRelayedEvent<CP14SkillScanEvent>>((e, c, ev) => OnSkillScan(e, c, ev.Args));
SubscribeLocalEvent<CP14SkillStorageComponent, GetVerbsEvent<ExamineVerb>>(OnExamined);
}
private void OnExamined(Entity<CP14SkillStorageComponent> ent, ref GetVerbsEvent<ExamineVerb> args)
{
var scanEvent = new CP14SkillScanEvent();
RaiseLocalEvent(args.User, scanEvent);
if (!scanEvent.CanScan)
return;
var markup = GetSkillExamine(ent);
_examine.AddDetailedExamineVerb(
args,
ent.Comp,
markup,
Loc.GetString("cp14-skill-info-title"),
"/Textures/Interface/students-cap.svg.192dpi.png");
}
private FormattedMessage GetSkillExamine(Entity<CP14SkillStorageComponent> ent)
{
var msg = new FormattedMessage();
var sb = new StringBuilder();
sb.Append(Loc.GetString("cp14-skill-examine-title") + "\n");
foreach (var skill in ent.Comp.LearnedSkills)
{
if (!_proto.TryIndex(skill, out var indexedSkill))
continue;
if(!_proto.TryIndex(indexedSkill.Tree, out var indexedTree))
continue;
var skillName = GetSkillName(skill);
sb.Append($"• [color={indexedTree.Color.ToHex()}]{skillName}[/color]\n");
}
sb.Append($"\n{Loc.GetString("cp14-skill-menu-level")} {ent.Comp.SkillsSumExperience}/{ent.Comp.ExperienceMaxCap}\n");
msg.AddMarkupOrThrow(sb.ToString());
return msg;
}
private void OnSkillScan(EntityUid uid, CP14SkillScannerComponent component, CP14SkillScanEvent args)
{
args.CanScan = true;
}
}
public sealed class CP14SkillScanEvent : EntityEventArgs, IInventoryRelayEvent
{
public bool CanScan;
public SlotFlags TargetSlots { get; } = SlotFlags.EYES;
}

View File

@@ -96,4 +96,9 @@
- 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/"
source: "https://freesound.org/people/SilverIllusionist/sounds/671928/"
- files: ["moon_strike1.ogg", "moon_strike2.ogg", "moon_strike3.ogg", "moon_strike4.ogg"]
license: "CC-BY-4.0"
copyright: 'Created by EminYILDIRIM on Freesound.org'
source: "https://freesound.org/people/EminYILDIRIM/sounds/668244/"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -18,5 +18,4 @@ 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}
cp14-skill-examine-verb = Learn the character's skills
cp14-skill-examine-title = This character has the following skills:

View File

@@ -18,5 +18,4 @@ cp14-skill-desc-unlock-recipes = Открывает возможность со
cp14-skill-popup-added-points = Границы вашего сознания расширяются. Новых очков памяти: {$count}
cp14-skill-examine-verb = Изучить навыки персонажа
cp14-skill-examine-title = Этот персонаж владеет следующими навыками:

View File

@@ -0,0 +1,23 @@
- type: entity
id: CP14ActionSpellGodLumeraMoonStrike
name: Lunar strike
description: You focus the concentrated light of the stars into a single point, blinding and damaging everything that comes within reach of the angry goddess.
components:
- type: CP14MagicEffectReligionRestricted
- type: CP14MagicEffectManaCost
manaCost: 20
- type: CP14MagicEffect
effects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14SkyLumeraStrike
- type: WorldTargetAction
repeat: true
checkCanAccess: false
range: 100
itemIconStyle: BigAction
icon:
sprite: _CP14/Actions/DemigodSpells/lumera.rsi
state: moon_beam
event: !type:CP14WorldTargetActionEvent
cooldown: 0.5

View File

@@ -4,6 +4,8 @@
description: You renounce your patron by severing your connection with him. After that, you can never become his follower again, but you can become a follower of another patron.
components:
- type: InstantAction
checkCanInteract: false
checkConsciousness: false
icon:
sprite: _CP14/Interface/Alerts/divine_offer.rsi
state: unoffer

View File

@@ -91,3 +91,50 @@
variation: 0.2
volume: -5
- type: entity
id: CP14SkyLumeraStrike
categories: [ ForkFiltered ]
name: lumera strike
save: false
components:
- type: Sprite
sprite: _CP14/Effects/lumera_strike.rsi
drawdepth: Mobs
noRot: true
offset: 0,3
layers:
- state: pewpew
shader: unshaded
- type: TimedDespawn
lifetime: 2
- type: Tag
tags:
- HideContextMenu
- type: PointLight
color: "#7ca5d8"
enabled: true
radius: 10
energy: 8
netsync: false
- type: LightFade
duration: 1
- type: CP14AreaEntityEffect
range: 1
effects:
- !type:CP14SpellApplyEntityEffect
effects:
- !type:Jitter
- !type:HealthChange
damage:
types:
Heat: 10
- type: TriggerOnSpawn
- type: FlashOnTrigger
range: 4
- type: CP14FarSound
closeSound:
collection: CP14MoonStrike
params:
variation: 0.2
maxDistance: 20
volume: 20

View File

@@ -23,6 +23,7 @@
- type: CP14ReligionAltar
- type: ActiveListener
range: 1
- type: InteractionOutline
- type: entity
parent: CP14BaseAltar

View File

@@ -73,7 +73,7 @@
- !type:NeedPrerequisite
prerequisite: LumeraT1
- !type:GodFollowerPercentage
percentage: 0.3
percentage: 0.25
- type: cp14Skill
id: LumeraDarkMist
@@ -90,6 +90,21 @@
- !type:NeedPrerequisite
prerequisite: LumeraT2
- type: cp14Skill
id: LumeraMoonStrike
skillUiPosition: 8, 3
tree: GodLumera
learnCost: 1.0
icon:
sprite: _CP14/Actions/DemigodSpells/lumera.rsi
state: moon_beam
effects:
- !type:AddAction
action: CP14ActionSpellGodLumeraMoonStrike
restrictions:
- !type:NeedPrerequisite
prerequisite: LumeraT2
# T3
- type: cp14Skill
@@ -105,7 +120,7 @@
- !type:NeedPrerequisite
prerequisite: LumeraT2
- !type:GodFollowerPercentage
percentage: 0.6
percentage: 0.5
- type: cp14Skill
id: LumeraMindUpgrade

View File

@@ -42,3 +42,11 @@
- /Audio/_CP14/Effects/coin_impact2.ogg
- /Audio/_CP14/Effects/coin_impact3.ogg
- type: soundCollection
id: CP14MoonStrike
files:
- /Audio/_CP14/Effects/moon_strike1.ogg
- /Audio/_CP14/Effects/moon_strike2.ogg
- /Audio/_CP14/Effects/moon_strike3.ogg
- /Audio/_CP14/Effects/moon_strike4.ogg

View File

@@ -25,6 +25,9 @@
{
"name": "mind_scan"
},
{
"name": "moon_beam"
},
{
"name": "t1"
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

View File

@@ -0,0 +1,29 @@
{
"version": 1,
"copyright": "Created bby TheShuEd",
"license": "CC-BY-SA-3.0",
"size": {
"x": 38,
"y": 200
},
"states": [
{
"name": "pewpew",
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
2
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB