Guildmaster 2 spells (#842)

* merge movement and gate magic types into darkness new

* demiplane infiltration spell

* Update CP14SharedDemiplanSytem.cs

* finish

* locale
This commit is contained in:
Ed
2025-02-05 22:52:50 +03:00
committed by GitHub
parent fed38041e0
commit 35303d7d80
22 changed files with 339 additions and 61 deletions

View File

@@ -6,6 +6,7 @@ using Content.Shared._CP14.Demiplane;
using Content.Shared._CP14.Demiplane.Components;
using Content.Shared.Popups;
using Robust.Server.Audio;
using Robust.Shared.Audio;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
@@ -82,7 +83,7 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem
/// <param name="demiplane">The demiplane the entity will be teleported to</param>
/// <param name="entity">The entity to be teleported</param>
/// <returns></returns>
public bool TryTeleportIntoDemiplane(Entity<CP14DemiplaneComponent> demiplane, EntityUid? entity)
public override bool TryTeleportIntoDemiplane(Entity<CP14DemiplaneComponent> demiplane, EntityUid? entity)
{
if (entity is null)
return false;
@@ -93,21 +94,34 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem
return false;
}
var targetCoord = Transform(entryPoint.Value).Coordinates;
_flash.Flash(entity.Value, null, null, 3000f, 0.5f);
_transform.SetCoordinates(entity.Value, targetCoord);
_audio.PlayGlobal(demiplane.Comp.ArrivalSound, entity.Value);
TeleportEntityToCoordinate(entity.Value, Transform(entryPoint.Value).Coordinates, demiplane.Comp.ArrivalSound);
return true;
}
/// <summary>
/// Simple teleportation, with common special effects for all the game's teleportation mechanics
/// </summary>
/// <param name="entity"></param>
/// <param name="coordinates"></param>
/// <param name="sound"></param>
public void TeleportEntityToCoordinate(EntityUid? entity, EntityCoordinates coordinates, SoundSpecifier? sound = null)
{
if (entity is null)
return;
_flash.Flash(entity.Value, null, null, 3000f, 0.5f);
_transform.SetCoordinates(entity.Value, coordinates);
_audio.PlayGlobal(sound, entity.Value);
}
/// <summary>
/// Teleports an entity from the demiplane to the real world, to one of the random exit points in the real world.
/// </summary>
/// <param name="demiplane">The demiplane from which the entity will be teleported</param>
/// <param name="entity">An entity that will be teleported into the real world. This entity must be in the demiplane, otherwise the function will not work.</param>
/// <returns></returns>
public bool TryTeleportOutDemiplane(Entity<CP14DemiplaneComponent> demiplane, EntityUid? entity)
public override bool TryTeleportOutDemiplane(Entity<CP14DemiplaneComponent> demiplane, EntityUid? entity)
{
if (entity is null)
return false;
@@ -121,11 +135,7 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem
return false;
}
var targetCoord = Transform(connection.Value).Coordinates;
_flash.Flash(entity.Value, null, null, 3000f, 0.5f);
_transform.SetCoordinates(entity.Value, targetCoord);
_audio.PlayGlobal(demiplane.Comp.DepartureSound, entity.Value);
TeleportEntityToCoordinate(entity.Value, Transform(connection.Value).Coordinates, demiplane.Comp.DepartureSound);
return true;
}

View File

@@ -1,4 +1,5 @@
using Content.Server._CP14.Demiplane;
using Content.Server._CP14.RoundEnd;
using Content.Server.Interaction;
using Content.Server.Mind;
using Content.Server.Popups;
@@ -28,13 +29,74 @@ public sealed partial class CP14DemiplaneTravelingSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<CP14DemiplaneRadiusTimedPasswayComponent, MapInitEvent>(RadiusMapInit);
SubscribeLocalEvent<CP14MonolithTimedPasswayComponent, MapInitEvent>(MonolithMapInit);
SubscribeLocalEvent<CP14DemiplaneRiftOpenedComponent, CP14DemiplanPasswayUseDoAfter>(OnOpenRiftInteractDoAfter);
}
// !!!SHITCODE WARNING!!!
// This whole module is saturated with shieldcode, code duplication and other delights. Why? Because.
//TODO: Refactor this shitcode
public override void Update(float frameTime)
{
base.Update(frameTime);
DemiplaneTeleportUpdate();
var query = EntityQueryEnumerator<CP14MonolithTimedPasswayComponent>();
while (query.MoveNext(out var uid, out var passWay))
{
if (_timing.CurTime < passWay.NextTimeTeleport)
continue;
passWay.NextTimeTeleport = _timing.CurTime + passWay.Delay;
//Get all teleporting entities
HashSet<EntityUid> teleportedEnts = new();
var nearestEnts = _lookup.GetEntitiesInRange(uid, passWay.Radius);
foreach (var ent in nearestEnts)
{
if (HasComp<GhostComponent>(ent))
continue;
if (!_mind.TryGetMind(ent, out var mindId, out var mind))
continue;
if (!_interaction.InRangeUnobstructed(ent, uid))
continue;
teleportedEnts.Add(ent);
}
while (teleportedEnts.Count > passWay.MaxEntities)
{
teleportedEnts.Remove(_random.Pick(teleportedEnts));
}
//Aaaand teleport it
var monoliths = EntityQueryEnumerator<CP14MagicContainerRoundFinisherComponent>();
while (monoliths.MoveNext(out var monolithUid, out var monolith))
{
var coord = Transform(monolithUid).Coordinates;
//Shitcode select first one
foreach (var ent in teleportedEnts)
{
if (TryComp<PullerComponent>(ent, out var puller))
_demiplan.TeleportEntityToCoordinate(puller.Pulling, coord);
_demiplan.TeleportEntityToCoordinate(ent, coord);
_audio.PlayPvs(passWay.ArrivalSound, ent);
}
break;
}
_audio.PlayPvs(passWay.DepartureSound, Transform(uid).Coordinates);
QueueDel(uid);
}
}
private void DemiplaneTeleportUpdate()
{
//Radius passway
var query = EntityQueryEnumerator<CP14DemiplaneRadiusTimedPasswayComponent, CP14DemiplaneRiftComponent>();
while (query.MoveNext(out var uid, out var passWay, out var rift))
@@ -111,6 +173,11 @@ public sealed partial class CP14DemiplaneTravelingSystem : EntitySystem
radiusPassWay.Comp.NextTimeTeleport = _timing.CurTime + radiusPassWay.Comp.Delay;
}
private void MonolithMapInit(Entity<CP14MonolithTimedPasswayComponent> radiusPassWay, ref MapInitEvent args)
{
radiusPassWay.Comp.NextTimeTeleport = _timing.CurTime + radiusPassWay.Comp.Delay;
}
private void OnOpenRiftInteractDoAfter(Entity<CP14DemiplaneRiftOpenedComponent> passWay,
ref CP14DemiplanPasswayUseDoAfter args)
{

View File

@@ -14,10 +14,10 @@ public abstract partial class CP14SharedDemiplaneSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<CP14DemiplaneRiftOpenedComponent, InteractHandEvent>(OnDemiplanPasswayInteract);
SubscribeLocalEvent<CP14DemiplaneRiftOpenedComponent, InteractHandEvent>(OnDemiplanePasswayInteract);
}
private void OnDemiplanPasswayInteract(Entity<CP14DemiplaneRiftOpenedComponent> passway, ref InteractHandEvent args)
private void OnDemiplanePasswayInteract(Entity<CP14DemiplaneRiftOpenedComponent> passway, ref InteractHandEvent args)
{
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager,
args.User,
@@ -33,6 +33,16 @@ public abstract partial class CP14SharedDemiplaneSystem : EntitySystem
MovementThreshold = 0.2f,
});
}
public virtual bool TryTeleportIntoDemiplane(Entity<CP14DemiplaneComponent> demiplane, EntityUid? entity)
{
return true;
}
public virtual bool TryTeleportOutDemiplane(Entity<CP14DemiplaneComponent> demiplane, EntityUid? entity)
{
return true;
}
}
[Serializable, NetSerializable]

View File

@@ -0,0 +1,29 @@
using Robust.Shared.Audio;
namespace Content.Shared._CP14.DemiplaneTraveling;
/// <summary>
/// teleports a certain number of entities to coordinate with a delay
/// </summary>
[RegisterComponent, AutoGenerateComponentPause]
public sealed partial class CP14MonolithTimedPasswayComponent : Component
{
[DataField]
public int MaxEntities = 3;
[DataField]
public TimeSpan Delay = TimeSpan.FromSeconds(10f);
[DataField]
public float Radius = 3f;
[DataField]
[AutoPausedField]
public TimeSpan NextTimeTeleport = TimeSpan.Zero;
[DataField("arrivalSound")]
public SoundSpecifier ArrivalSound = new SoundPathSpecifier("/Audio/Effects/teleport_arrival.ogg");
[DataField("departureSound")]
public SoundSpecifier DepartureSound = new SoundPathSpecifier("/Audio/Effects/teleport_departure.ogg");
}

View File

@@ -0,0 +1,26 @@
using Content.Shared._CP14.Demiplane;
using Content.Shared._CP14.Demiplane.Components;
namespace Content.Shared._CP14.MagicSpell.Spells;
public sealed partial class CP14SpellDemiplaneInfiltration : CP14SpellEffect
{
public override void Effect(EntityManager entManager, CP14SpellEffectBaseArgs args)
{
if (args.User is null)
return;
if (!entManager.TryGetComponent<CP14DemiplaneRiftComponent>(args.Target, out var rift))
return;
if (rift.Demiplane is null)
return;
if (!entManager.TryGetComponent<CP14DemiplaneComponent>(rift.Demiplane.Value, out var demiplane))
return;
var demiplaneSystem = entManager.System<CP14SharedDemiplaneSystem>();
demiplaneSystem.TryTeleportIntoDemiplane((rift.Demiplane.Value, demiplane), args.User.Value);
}
}

View File

@@ -52,4 +52,5 @@ cp14-loadout-bank-shoes = Bank Employee shoes
cp14-loadout-guildmaster-cloak = Guildmaster cloak
cp14-loadout-guildmaster-shirt = Guildmaster shirt
cp14-loadout-guildmaster-pants = Guildmaster pants
cp14-loadout-guildmaster-shoes = Guildmaster shoes
cp14-loadout-guildmaster-shoes = Guildmaster shoes
cp14-loadout-guildmaster-spells = Guildmaster spells

View File

@@ -5,8 +5,6 @@ cp14-magic-type-healing = Healing
cp14-magic-type-light = Light
cp14-magic-type-darkness = Darkness
cp14-magic-type-meta = Metamagic
cp14-magic-type-gate = Gate
cp14-magic-type-movement = Movement
cp14-magic-type-necro = Necromancy
cp14-magic-manacost = Manacost

View File

@@ -54,4 +54,5 @@ cp14-loadout-bank-shoes = Ботинки работника банка
cp14-loadout-guildmaster-cloak = Накидка гильдмастера
cp14-loadout-guildmaster-shirt = Рубашка гильдмастера
cp14-loadout-guildmaster-pants = Штаны гильдмастера
cp14-loadout-guildmaster-shoes = Ботинки гильдмастера
cp14-loadout-guildmaster-shoes = Ботинки гильдмастера
cp14-loadout-guildmaster-spells = Заклинания гильдмастера

View File

@@ -5,8 +5,6 @@ cp14-magic-type-healing = Исцеление
cp14-magic-type-light = Свет
cp14-magic-type-darkness = Тьма
cp14-magic-type-meta = Метамагия
cp14-magic-type-gate = Пространство
cp14-magic-type-movement = Движение
cp14-magic-type-necro = Некромантия
cp14-magic-manacost = Затраты маны

View File

@@ -0,0 +1,63 @@
- type: entity
id: CP14ActionSpellDemiplaneInfiltration
name: Demiplane infiltration
description: Mastery of demiplane space magic allows you to reach inside any open demiplanes
components:
- type: Sprite
sprite: _CP14/Effects/Magic/spells_icons.rsi
state: rift_arrow
- type: CP14MagicEffectManaCost
manaCost: 50
- type: CP14MagicEffect
magicType: Darkness
telegraphyEffects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14ImpactEffectShadowStep
effects:
- !type:CP14SpellDemiplaneInfiltration
- type: CP14MagicEffectVerbalAspect
startSpeech: "Ego intrabo et..."
endSpeech: "salvabo socios meos"
- type: CP14MagicEffectCastingVisual
proto: CP14RuneDemiplaneInfiltration
- type: EntityTargetAction
whitelist:
components:
- CP14DemiplaneRift
canTargetSelf: false
checkCanAccess: true
range: 3
itemIconStyle: BigAction
sound: !type:SoundPathSpecifier
path: /Audio/Magic/rumble.ogg
icon:
sprite: _CP14/Effects/Magic/spells_icons.rsi
state: rift_arrow
event: !type:CP14DelayedEntityTargetActionEvent
cooldown: 50
castDelay: 5
entityDistance: 3
breakOnMove: true
- type: entity
id: CP14RuneDemiplaneInfiltration
parent: CP14BaseMagicRune
categories: [ HideSpawnMenu ]
components:
- type: PointLight
color: "#5e427e"
- type: Sprite
layers:
- state: sun
color: "#5e427e"
shader: unshaded
- type: entity
parent: CP14BaseSpellScrollDarkness
id: CP14SpellScrollDemiplaneInfiltration
name: demiplane infiltration spell scroll
components:
- type: CP14SpellStorage
spells:
- CP14ActionSpellDemiplaneInfiltration

View File

@@ -0,0 +1,75 @@
- type: entity
id: CP14ActionSpellMonolithWarp
name: Monolith warp
description: You open a dimensional rift that transports the creatures around it to the demiplane link crystal
components:
- type: Sprite
sprite: _CP14/Effects/Magic/spells_icons.rsi
state: demi_arrow
- type: CP14MagicEffectManaCost
manaCost: 50
- type: CP14MagicEffect
magicType: Darkness
telegraphyEffects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14ImpactEffectShadowStep
effects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14GuildmaterTimedTeleport
- type: CP14MagicEffectVerbalAspect
startSpeech: "Crystal, ego..."
endSpeech: "vado ad vos"
- type: CP14MagicEffectCastingVisual
proto: CP14RuneDemiplaneInfiltration
- type: EntityWorldTargetAction
range: 7
itemIconStyle: BigAction
sound: !type:SoundPathSpecifier
path: /Audio/Magic/rumble.ogg
icon:
sprite: _CP14/Effects/Magic/spells_icons.rsi
state: demi_arrow
event: !type:CP14DelayedEntityWorldTargetActionEvent
cooldown: 50
- type: entity
id: CP14GuildmaterTimedTeleport
categories: [ ForkFiltered ]
name: pulsating demiplane rift
description: This rift is gaining strength, and will trap all nearby creatures in a demiplane in a second!
components:
- type: Transform
anchored: True
- type: Clickable
- type: Physics
canCollide: false
bodyType: Static
- type: Sprite
drawdepth: Effects
sprite: /Textures/_CP14/Structures/Dungeon/demiplan_rift.rsi
layers:
- state: pulse
shader: unshaded
- type: PointLight
radius: 8
color: "#5e427e"
- type: SingularityDistortion
falloffPower: 1.5
intensity: 50
- type: AmbientSound
volume: -3
range: 7
sound:
path: /Audio/Ambience/Objects/gravity_gen_hum.ogg
- type: CP14MonolithTimedPassway
- type: entity
parent: CP14BaseSpellScrollDarkness
id: CP14SpellScrollMonolithWarp
name: demiplane link spell scroll
components:
- type: CP14SpellStorage
spells:
- CP14ActionSpellMonolithWarp

View File

@@ -9,7 +9,7 @@
- type: CP14MagicEffectManaCost
manaCost: 10
- type: CP14MagicEffect
magicType: Movement
magicType: Darkness
telegraphyEffects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
@@ -54,7 +54,7 @@
color: "#5e427e"
- type: entity
parent: CP14BaseSpellScrollMovement
parent: CP14BaseSpellScrollDarkness
id: CP14SpellScrollShadowGrab
name: shadow grab spell scroll
components:

View File

@@ -11,7 +11,7 @@
- type: CP14MagicEffectManaCost
manaCost: 20
- type: CP14MagicEffect
magicType: Gate
magicType: Darkness
telegraphyEffects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
@@ -23,7 +23,6 @@
- type: CP14MagicEffectSomaticAspect
- type: EntityWorldTargetAction
range: 7
checkCanAccess: false
itemIconStyle: BigAction
sound: !type:SoundPathSpecifier
path: /Audio/Magic/rumble.ogg
@@ -46,7 +45,7 @@
color: "#5e427e"
- type: entity
parent: CP14BaseSpellScrollGate
parent: CP14BaseSpellScrollDarkness
id: CP14SpellScrollShadowStep
name: shadow step spell scroll
components:

View File

@@ -87,18 +87,6 @@
shader: unshaded
color: "#d9741c"
- type: entity
abstract: true
id: CP14BaseSpellScrollGate
parent: CP14BaseSpellScroll
components:
- type: Sprite
layers:
- state: paper_filled
- state: magic
shader: unshaded
color: "#32597d"
- type: entity
abstract: true
id: CP14BaseSpellScrollHealing
@@ -137,7 +125,7 @@
- type: entity
abstract: true
id: CP14BaseSpellScrollMovement
id: CP14BaseSpellScrollDarkness
parent: CP14BaseSpellScroll
components:
- type: Sprite
@@ -145,7 +133,7 @@
- state: paper_filled
- state: magic
shader: unshaded
color: "#63ceff"
color: "#5e427e"
- type: entity
abstract: true

View File

@@ -7,14 +7,4 @@
- type: Sprite
sprite: _CP14/Clothing/Cloak/Roles/Guard/guard_commander_cloak.rsi
- type: Clothing
sprite: _CP14/Clothing/Cloak/Roles/Guard/guard_commander_cloak.rsi
- type: Armor
modifiers:
coefficients:
Blunt: 0.6
Slash: 0.6
Piercing: 0.6
Heat: 0.7
- type: ClothingSpeedModifier
walkModifier: 0.9
sprintModifier: 0.9
sprite: _CP14/Clothing/Cloak/Roles/Guard/guard_commander_cloak.rsi

View File

@@ -47,4 +47,27 @@
id: CP14GuildmasterShoes
name: cp14-loadout-guildmaster-shoes
loadouts:
- CP14ShoesAristocraticBlack
- CP14ShoesAristocraticBlack
# Spells
- type: loadoutGroup
id: CP14GuildmasterSpells
name: cp14-loadout-guildmaster-spells
minLimit: 2
maxLimit: 2
loadouts:
- CP14ActionSpellDemiplaneInfiltration
- CP14ActionSpellMonolithWarp
- type: loadout
id: CP14ActionSpellDemiplaneInfiltration
dummyEntity: CP14ActionSpellDemiplaneInfiltration
actions:
- CP14ActionSpellDemiplaneInfiltration
- type: loadout
id: CP14ActionSpellMonolithWarp
dummyEntity: CP14ActionSpellMonolithWarp
actions:
- CP14ActionSpellMonolithWarp

View File

@@ -126,6 +126,7 @@
- CP14GuildmasterShoes
- CP14GeneralBack
- CP14GeneralTrinkets
- CP14GuildmasterSpells
- type: roleLoadout
id: JobCP14Banker

View File

@@ -8,11 +8,6 @@
name: cp14-magic-type-fire
color: "#d9741c"
- type: magicType
id: Gate
name: cp14-magic-type-gate
color: "#32597d"
- type: magicType
id: Healing
name: cp14-magic-type-healing
@@ -33,11 +28,6 @@
name: cp14-magic-type-meta
color: "#dcffdb"
- type: magicType
id: Movement
name: cp14-magic-type-movement
color: "#63ceff"
- type: magicType
id: Water
name: cp14-magic-type-water

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

View File

@@ -5,7 +5,7 @@
"y": 32
},
"license": "All right reserved",
"copyright": "Created by .kreks., cure_poison, cure_burn, mana_gift, water creation, plant_growth, beer creation, sprint, tiefling_revenge, signal_light_blue, signal_light_red, signal_light_yellow and resurrection by TheShuEd",
"copyright": "Created by .kreks., cure_poison, cure_burn, mana_gift, water creation, plant_growth, beer creation, sprint, tiefling_revenge, demi_arrow, rift_shield, rift_arrow, signal_light_blue, signal_light_red, signal_light_yellow and resurrection by TheShuEd",
"states": [
{
"name": "beer_creation"
@@ -19,6 +19,9 @@
{
"name": "cure_wounds"
},
{
"name": "demi_arrow"
},
{
"name": "earth_wall"
},
@@ -49,6 +52,12 @@
{
"name": "resurrection"
},
{
"name": "rift_arrow"
},
{
"name": "rift_shield"
},
{
"name": "shadow_grab"
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B