Shadow anomaly returns (#24629)

* content

* add cat

* ambient

* I FORGOT HEARTS!

* fix ambient

* some fixes

* canCollide: false

* connect to damageable

* pi

* remove fx

* some fixes

* *sad bruh*

* hazed

* Update base_shadow.yml
This commit is contained in:
Ed
2024-02-14 01:12:32 +03:00
committed by GitHub
parent f8640cf97e
commit ae321151ca
26 changed files with 468 additions and 29 deletions

View File

@@ -0,0 +1,15 @@
using Content.Shared.Damage;
using Robust.Shared.Prototypes;
namespace Content.Server.Flash.Components;
// Also needed FlashableComponent on entity to work
[RegisterComponent, Access(typeof(DamagedByFlashingSystem))]
public sealed partial class DamagedByFlashingComponent : Component
{
/// <summary>
/// damage from flashing
/// </summary>
[DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier FlashDamage = new ();
}

View File

@@ -0,0 +1,22 @@
using Content.Server.Flash.Components;
using Content.Shared.Damage;
namespace Content.Server.Flash;
public sealed class DamagedByFlashingSystem : EntitySystem
{
[Dependency] private readonly DamageableSystem _damageable = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DamagedByFlashingComponent, FlashAttemptEvent>(OnFlashAttempt);
}
private void OnFlashAttempt(Entity<DamagedByFlashingComponent> ent, ref FlashAttemptEvent args)
{
_damageable.TryChangeDamage(ent, ent.Comp.FlashDamage);
//To Do: It would be more logical if different flashes had different power,
//and the damage would be inflicted depending on the strength of the flash.
}
}

View File

@@ -31,6 +31,7 @@ namespace Content.Server.Flash
[Dependency] private readonly SharedChargesSystem _charges = default!;
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly PopupSystem _popup = default!;
@@ -150,27 +151,23 @@ namespace Content.Server.Flash
public void FlashArea(EntityUid source, EntityUid? user, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, SoundSpecifier? sound = null)
{
var transform = EntityManager.GetComponent<TransformComponent>(source);
var mapPosition = transform.MapPosition;
var flashableEntities = new List<EntityUid>();
var mapPosition = _transform.GetMapCoordinates(transform);
var flashableQuery = GetEntityQuery<FlashableComponent>();
foreach (var entity in _entityLookup.GetEntitiesInRange(transform.Coordinates, range))
{
if (!flashableQuery.HasComponent(entity))
if (!flashableQuery.TryGetComponent(entity, out var flashable))
continue;
flashableEntities.Add(entity);
}
foreach (var entity in flashableEntities)
{
// Check for unobstructed entities while ignoring the mobs with flashable components.
if (!_interaction.InRangeUnobstructed(entity, mapPosition, range, CollisionGroup.Opaque, (e) => flashableEntities.Contains(e) || e == source))
if (!_interaction.InRangeUnobstructed(entity, mapPosition, range, flashable.CollisionGroup, (e) => e == source))
continue;
// They shouldn't have flash removed in between right?
Flash(entity, user, source, duration, slowTo, displayPopup, flashableQuery.GetComponent(entity));
}
if (sound != null)
{
_audio.PlayPvs(sound, source, AudioParams.Default.WithVolume(1f).WithMaxDistance(3f));

View File

@@ -1,3 +1,4 @@
using Content.Shared.Physics;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
@@ -9,6 +10,9 @@ namespace Content.Shared.Flash
public float Duration;
public TimeSpan LastFlash;
[DataField]
public CollisionGroup CollisionGroup = CollisionGroup.Opaque;
public override bool SendOnlyToOwner => true;
}

Binary file not shown.

View File

@@ -95,4 +95,10 @@
spookyspace2.ogg"]
license: "CC0-1.0"
copyright: "Taken from /vg/station"
source: "https://github.com/vgstation-coders/vgstation13/commit/23303188abe6fe31b114a218a1950d7325a23730"
source: "https://github.com/vgstation-coders/vgstation13/commit/23303188abe6fe31b114a218a1950d7325a23730"
- files: ["anomaly_scary.ogg"]
license: "CC0-1.0"
copyright: "Created by dimbark1, edited and converted to mono by TheShuEd (github)"
source: "https://freesound.org/people/dimbark1/sounds/316797/"

View File

@@ -51,6 +51,7 @@ petting-failure-dragon = You raise your hand, but as {THE($target)} roars, you d
petting-failure-hamster = You reach out to pet {THE($target)}, but {SUBJECT($target)} attempts to bite your finger and only your quick reflexes save you from an almost fatal injury.
petting-failure-bear = You reach out to pet {THE($target)}, but {SUBJECT($target)} growls, making you think twice.
petting-failure-monkey = You reach out to pet {THE($target)}, but {SUBJECT($target)} almost bites your fingers!
petting-failure-shadow = You're trying to pet {THE($target)}, but your hand passes through the cold darkness of his body.
## Petting silicons

View File

@@ -47,3 +47,8 @@
- Toxin
supportedTypes:
- Shock
- type: damageContainer
id: ShadowHaze
supportedTypes:
- Heat

View File

@@ -68,3 +68,26 @@
lifetime: 120
- type: Portal
canTeleportToOtherMaps: true
- type: entity
id: ShadowPortal
name: shadow rift
description: Looks unstable.
parent: [ BasePortal, BaseShadow ]
components:
- type: Portal
arrivalSound: /Audio/Items/hiss.ogg
departureSound: /Audio/Items/hiss.ogg
- type: Sprite
state: portal-artifact
color: "#793a80dd"
- type: PointLight
color: "#793a80dd"
radius: 3
energy: 1
netsync: false
- type: AmbientSound
range: 6
volume: -3
sound:
path: /Audio/Ambience/anomaly_scary.ogg

View File

@@ -19,6 +19,7 @@
- RandomRockAnomalySpawner
- AnomalyLiquid
- AnomalyFlora
- AnomalyShadow
chance: 1
offset: 0.15 # not to put it higher. The anomaly sychnronizer looks for anomalies within this radius, and if the radius is higher, the anomaly can be attracted from a neighboring tile.

View File

@@ -0,0 +1,26 @@
- type: entity
id: ShadowKudzuLootSpawner
parent: MarkerBase
components:
- type: Sprite
layers:
- state: red
- sprite: Structures/Specific/Anomalies/shadow_anom.rsi
state: anom
- type: RandomSpawner
offset: 0.05
chance: 0.7
prototypes:
- CrystalPink
- CrystalPink
- ShadowPortal
- ShadowTree01
- ShadowTree02
- ShadowTree03
- ShadowTree04
- ShadowTree05
- ShadowTree06
rareChance: 0.05
rarePrototypes:
- MobCatShadow
- ArtifactFragment

View File

@@ -0,0 +1,67 @@
- type: entity
id: BaseShadowMob
abstract: true
parent: [ BaseMob, BaseShadow ]
components:
- type: Sprite
color: "#793a80dd"
- type: PointLight
color: "#793a80dd"
radius: 1.1
- type: MovementSpeedModifier
baseWalkSpeed: 2
baseSprintSpeed: 2
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeCircle
radius: 0.35
density: 120
mask:
- Opaque
layer:
- None
- type: StandingState
- type: Tag
tags:
- DoorBumpOpener
- type: NpcFactionMember
factions:
- SimpleNeutral
- type: HTN
rootTask:
task: IdleCompound
- type: SlowOnDamage
speedModifierThresholds:
60: 0.7
80: 0.5
- type: entity
name: shadow cat
parent: BaseShadowMob
id: MobCatShadow
description: A lovely piece of darkness. Hope he doesn't bring you a curse.
components:
- type: Sprite
drawdepth: Mobs
sprite: Mobs/Pets/cat.rsi
layers:
- map: ["enum.DamageStateVisualLayers.Base"]
state: cat
- type: Physics
- type: ReplacementAccent
accent: cat
- type: InteractionPopup
successChance: 0.01 # you cant pet shadow cat... almost
interactSuccessString: petting-success-cat
interactFailureString: petting-failure-shadow
interactSuccessSpawn: EffectHearts
interactSuccessSound:
path: /Audio/Animals/cat_meow.ogg
- type: Grammar
attributes:
gender: epicene
- type: Tag
tags:
- VimPilot

View File

@@ -1,11 +1,26 @@
- type: entity
id: Kudzu
name: kudzu
description: A rapidly growing, dangerous plant. WHY ARE YOU STOPPING TO LOOK AT IT?!
id: BaseKudzu
abstract: true
placement:
mode: SnapgridCenter
snap:
- Wall
components:
- type: Appearance
- type: Transform
anchored: true
- type: Physics
- type: Kudzu
- type: GrowingKudzu
- type: ActiveEdgeSpreader
- type: EdgeSpreader
id: Kudzu
- type: entity
id: Kudzu
name: kudzu
parent: BaseKudzu
description: A rapidly growing, dangerous plant. WHY ARE YOU STOPPING TO LOOK AT IT?!
components:
- type: MeleeSound
soundGroups:
@@ -16,12 +31,8 @@
sprite: Objects/Misc/kudzu.rsi
state: kudzu_11
drawdepth: Overdoors
- type: Appearance
- type: KudzuVisuals
- type: Clickable
- type: Transform
anchored: true
- type: Physics
- type: Fixtures
fixtures:
fix1:
@@ -69,19 +80,14 @@
types:
Heat: 10
- type: AtmosExposed
- type: Kudzu
growthTickChance: 0.3
spreadChance: 0.4
- type: GrowingKudzu
- type: SlowContacts
walkSpeedModifier: 0.2
sprintSpeedModifier: 0.2
ignoreWhitelist:
components:
- IgnoreKudzu
- type: ActiveEdgeSpreader
- type: EdgeSpreader
id: Kudzu
- type: Food
requiredStomachs: 2 # ruminants have 4 stomachs but i dont care to give them literally 4 stomachs. 2 is good
delay: 0.5
@@ -159,6 +165,7 @@
- type: entity
id: FleshKudzu
name: tendons
parent: BaseKudzu
description: A rapidly growing cluster of meaty tendons. WHY ARE YOU STOPPING TO LOOK AT IT?!
placement:
mode: SnapgridCenter
@@ -174,12 +181,8 @@
sprite: Objects/Misc/fleshkudzu.rsi
state: kudzu_11
drawdepth: Overdoors
- type: Appearance
- type: KudzuVisuals
- type: Clickable
- type: Transform
anchored: true
- type: Physics
- type: Fixtures
fixtures:
fix1:
@@ -233,12 +236,8 @@
damage:
types:
Heat: 3
- type: GrowingKudzu
growthTickChance: 0.3
- type: AtmosExposed
- type: ActiveEdgeSpreader
- type: EdgeSpreader
id: Kudzu
- type: SlowContacts
walkSpeedModifier: 0.3
sprintSpeedModifier: 0.3
@@ -261,3 +260,41 @@
types:
Asphyxiation: -0.25
- type: entity
name: dark haze
id: ShadowKudzu
parent: [ BaseKudzu, BaseShadow ]
components:
- type: Physics
canCollide: false
- type: Occluder
- type: Sprite
drawdepth: Effects
sprite: Effects/spookysmoke.rsi
state: spookysmoke
color: "#793a80dd"
- type: Kudzu
growthTickChance: 0.2
spreadChance: 0.99
- type: RandomSpawner
deleteSpawnerAfterSpawn: false
rareChance: 0.05
offset: 0.2
chance: 0.45
prototypes:
- ShadowBasaltRandom
rarePrototypes:
- ShadowPortal
- ShadowKudzuLootSpawner
- type: Tag
tags:
- HideContextMenu
- SpookyFog
- type: entity
name: Haze
id: ShadowKudzuWeak
parent: ShadowKudzu
components:
- type: Kudzu
spreadChance: 0 #appears during pulsation. It shouldnt spreading.

View File

@@ -0,0 +1,26 @@
- type: entity
id: BaseShadow
abstract: true
components:
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 10
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:PlaySoundBehavior
sound:
path: /Audio/Items/hiss.ogg
params:
variation: 0.08
- type: Flashable
collisionGroup:
- None
- type: DamagedByFlashing
flashDamage:
types:
Heat: 10
- type: Damageable
damageContainer: ShadowHaze

View File

@@ -791,3 +791,57 @@
solution: anomaly
- type: InjectableSolution
solution: beaker
- type: entity
id: AnomalyShadow
parent: BaseAnomaly
suffix: Shadow
components:
- type: Sprite
sprite: Structures/Specific/Anomalies/shadow_anom.rsi
layers:
- state: anom
map: ["enum.AnomalyVisualLayers.Base"]
- state: pulse
map: ["enum.AnomalyVisualLayers.Animated"]
visible: false
- type: PointLight
radius: 1.5
energy: 12.5
color: "#793a80"
- type: AmbientSound
range: 5
volume: -5
sound:
path: /Audio/Ambience/anomaly_scary.ogg
- type: Anomaly
corePrototype: AnomalyCoreShadow
coreInertPrototype: AnomalyCoreShadowInert
anomalyContactDamage:
types:
Cold: 10
animationTime: 4
offset: "-0.1,0.1"
- type: EntitySpawnAnomaly
entries:
- settings:
spawnOnPulse: true
spawnOnSuperCritical: true
minAmount: 10
maxAmount: 20
maxRange: 4
spawns:
- ShadowKudzuWeak
- settings:
spawnOnSuperCritical: true
minAmount: 30
maxAmount: 40
maxRange: 50
spawns:
- ShadowKudzu
- type: Portal
arrivalSound: /Audio/Items/hiss.ogg
departureSound: /Audio/Items/hiss.ogg
- type: Tag
tags:
- SpookyFog

View File

@@ -155,6 +155,19 @@
color: "#6270bb"
castShadows: false
- type: entity
parent: [ BaseAnomalyCore, BaseShadow ]
id: AnomalyCoreShadow
suffix: Shadow
components:
- type: Sprite
sprite: Structures/Specific/Anomalies/Cores/shadow_core.rsi
- type: PointLight
radius: 1.5
energy: 2.0
color: "#793a80"
castShadows: false
# Inert cores
- type: entity
@@ -288,3 +301,16 @@
energy: 2.0
color: "#6270bb"
castShadows: false
- type: entity
parent: [ BaseAnomalyInertCore, BaseShadow ]
id: AnomalyCoreShadowInert
suffix: Shadow, Inert
components:
- type: Sprite
sprite: Structures/Specific/Anomalies/Cores/shadow_core.rsi
- type: PointLight
radius: 1.5
energy: 2.0
color: "#793a80"
castShadows: false

View File

@@ -7,6 +7,15 @@
rules: NearMorgue
priority: 4
- type: ambientMusic
id: SpookyFog
sound:
params:
volume: -12
collection: AmbienceSpookyFog
rules: NearSpookyFog
priority: 5
- type: ambientMusic
id: Holy
sound:
@@ -196,6 +205,24 @@
- /Audio/Ambience/ambiruin6.ogg
- /Audio/Ambience/ambiruin7.ogg
- type: soundCollection
id: AmbienceSpookyFog
files:
- /Audio/Ambience/spookyspace1.ogg
- /Audio/Ambience/spookyspace2.ogg
- /Audio/Ambience/ambimo2.ogg
- /Audio/Ambience/ambilava1.ogg
- /Audio/Ambience/ambilava2.ogg
- /Audio/Ambience/ambiruin2.ogg
- /Audio/Ambience/ambiruin3.ogg
- /Audio/Ambience/ambiruin4.ogg
- /Audio/Ambience/ambiruin5.ogg
- /Audio/Ambience/ambiruin6.ogg
- /Audio/Ambience/ambiruin7.ogg
- /Audio/Ambience/ambidanger.ogg
- /Audio/Ambience/ambidanger2.ogg
- /Audio/Ambience/ambimine.ogg
## Background noise on station, separate to ambient music.
- type: soundCollection
id: AmbienceStation
@@ -263,6 +290,16 @@
components:
- type: Morgue
range: 3
- type: rules
id: NearSpookyFog
rules:
- !type:NearbyEntitiesRule
count: 5
whitelist:
tags:
- SpookyFog
range: 4
- type: rules
id: OnMapGrid

View File

@@ -1052,6 +1052,9 @@
- type: Tag
id: Soup
- type: Tag
id: SpookyFog
- type: Tag
id: Spray

View File

@@ -0,0 +1,30 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from https://github.com/discordia-space/CEV-Eris/blob/81b3a082ccdfb425f36bbed6e5bc1f0faed346ec/icons/effects/chemsmoke.dmi, edit by TheShuEd (github)",
"size": {
"x": 96,
"y": 96
},
"states": [
{
"name": "spookysmoke",
"delays": [
[
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2,
0.2
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

View File

@@ -0,0 +1,25 @@
{
"version": 1,
"license": "CC0-1.0",
"copyright": "Created by TheShuEd (github) for ss14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "core"
},
{
"name": "pulse",
"delays": [
[
0.15625,
0.15625,
0.15625,
0.15625
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,34 @@
{
"version": 1,
"license": "CC0-1.0",
"copyright": "Created by TheShuEd (github) for ss14",
"size": {
"x": 32,
"y": 48
},
"states": [
{
"name": "anom",
"delays": [
[
0.25625,
0.25625,
0.25625
]
]
},
{
"name": "pulse",
"delays": [
[
0.15625,
0.15625,
0.15625,
0.15625,
0.15625,
0.15625
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB