* Adjust vampire features and add construction category Increased vampire skill points from 1 to 3 and removed SendOnlyToOwner override. Updated power punch spell: removed cast slowdown, increased paralyze durations, and raised cooldown. Added new construction category for vampires with English and Russian localization, and updated vampire construction recipes to use this category. Reduced furnace recipe craft times from 4 to 1. Cleaned up unused usings in vampire components. * Improve vampire skill popups and clan heart features Added missing popup when no essence is left to gather and improved popup handling for skill point changes. Updated localization for clan progress and essence messages, added WarpPoint to vampire clan heart, and adjusted vampire skill tree structure and UI positions. * Add vampire hypnosis skill and rebalance vampire content Introduces the Hypnosys vampire skill and associated spell, including new status effects and alerts for forced sleep. Adjusts vampire skill tree progression, rebalances bite spell effects, modifies construction recipes to use stone instead of iron, and updates entity drop behaviors. Also tweaks skill point defaults and hunger/thirst effect order for plant growth spells. * Adjust hunger settings and map spawner modifiers Removed baseDecayRate and starvationDamage from Hunger components for NightChildrens, Devourers, and Unnameable in subgamemodes.yml. Updated comoss.yml and venicialis.yml to replace or add spawner modifiers, introducing Boar and Rabbits while removing EnemyFlem, MonsterMosquito, and MobSlimeIce. * Add SSD block to magic system and vampire bite spell Introduced CP14MagicEffectSSDBlockComponent to prevent magic use on SSD (disconnected) players. Updated the magic system to check for SSD status and added localization strings for SSD block messages in English and Russian. Applied the SSD block effect to the vampire bite spell. Also fixed a typo in the PacifiedBlockComponent filename. * Make blood reagents unrecognizable and adjust effects Set all blood reagent variants to 'recognizable: false' to prevent easy identification. Simplified and unified damage effects for blood reagents, removing some specific reactions and adjusting damage groups, particularly for vampire-related blood types. Also fixed a duplicate 'allowedStates' key in the vampire bite spell action. * Enable map initialization and clean up power punch spell Changed map creation in Demiplane and CrashToWildlands systems to run map initialization by setting runMapInit to true. Removed redundant map initialization check in CP14SpawnProceduralLocationJob. Also removed the CP14ActionSpellVampirePower2 entity from the vampire power punch spell prototype.
98 lines
3.3 KiB
C#
98 lines
3.3 KiB
C#
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Content.Server.Atmos.EntitySystems;
|
|
using Content.Server.Procedural;
|
|
using Content.Shared._CP14.Procedural.Prototypes;
|
|
using Content.Shared.Atmos;
|
|
using Content.Shared.Gravity;
|
|
using Content.Shared.Procedural;
|
|
using Content.Shared.Procedural.DungeonLayers;
|
|
using Robust.Shared.CPUJob.JobQueues;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Map.Components;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Server._CP14.Procedural;
|
|
|
|
public sealed class CP14SpawnProceduralLocationJob(
|
|
double maxTime,
|
|
IEntityManager entManager,
|
|
ILogManager logManager,
|
|
IPrototypeManager protoManager,
|
|
DungeonSystem dungeon,
|
|
SharedMapSystem map,
|
|
EntityUid mapUid,
|
|
MapId mapId,
|
|
Vector2i position,
|
|
int seed,
|
|
ProtoId<CP14ProceduralLocationPrototype> config,
|
|
List<ProtoId<CP14ProceduralModifierPrototype>> modifiers,
|
|
string? jobName = null,
|
|
CancellationToken cancellation = default)
|
|
: Job<bool>(maxTime, cancellation)
|
|
{
|
|
public readonly EntityUid MapUid = mapUid;
|
|
public string? JobName = jobName;
|
|
|
|
private readonly ISawmill _sawmill = logManager.GetSawmill("cp14_procedural_location_job");
|
|
|
|
protected override async Task<bool> Process()
|
|
{
|
|
_sawmill.Debug($"Spawning procedural location `{config.Id}` with seed {seed}");
|
|
var gridComp = entManager.EnsureComponent<MapGridComponent>(MapUid);
|
|
|
|
MetaDataComponent? metadata = null;
|
|
DungeonConfigPrototype dungeonConfig = new();
|
|
|
|
//Boilerplate: reserve all old grid tiles
|
|
dungeonConfig.Layers.Add(new CP14ReserveGrid());
|
|
|
|
//Setup location config
|
|
var locationConfig = protoManager.Index(config);
|
|
var indexedLocation = protoManager.Index(locationConfig.LocationConfig);
|
|
|
|
dungeonConfig.Layers.AddRange(indexedLocation.Layers);
|
|
dungeonConfig.ReserveTiles = indexedLocation.ReserveTiles;
|
|
|
|
//Apply modifiers
|
|
foreach (var modifier in modifiers)
|
|
{
|
|
if (!protoManager.TryIndex(modifier, out var indexedModifier))
|
|
continue;
|
|
|
|
if (indexedModifier.Layers != null)
|
|
dungeonConfig.Layers.AddRange(indexedModifier.Layers);
|
|
if (indexedModifier.Components != null)
|
|
entManager.AddComponents(MapUid, indexedModifier.Components);
|
|
|
|
_sawmill.Debug($"Added modifier: {seed} - {modifier.Id}");
|
|
}
|
|
|
|
//Setup gravity
|
|
var gravity = entManager.EnsureComponent<GravityComponent>(MapUid);
|
|
gravity.Enabled = true;
|
|
entManager.Dirty(MapUid, gravity, metadata);
|
|
|
|
// Setup default atmos
|
|
var moles = new float[Atmospherics.AdjustedNumberOfGases];
|
|
moles[(int)Gas.Oxygen] = 21.824779f;
|
|
moles[(int)Gas.Nitrogen] = 82.10312f;
|
|
var mixture = new GasMixture(moles, Atmospherics.T20C);
|
|
entManager.System<AtmosphereSystem>().SetMapAtmosphere(MapUid, false, mixture);
|
|
|
|
map.SetPaused(mapId, false);
|
|
|
|
//Spawn modified config
|
|
await WaitAsyncTask(dungeon.GenerateDungeonAsync(dungeonConfig,
|
|
MapUid,
|
|
gridComp,
|
|
position,
|
|
seed));
|
|
|
|
//Add map components
|
|
entManager.AddComponents(MapUid, locationConfig.Components);
|
|
|
|
return true;
|
|
}
|
|
}
|