Merge branch 'master' into ed-05-08-2024-upstream

This commit is contained in:
Ed
2024-08-11 18:13:17 +03:00
committed by GitHub
151 changed files with 1227 additions and 170 deletions

View File

@@ -1,7 +1,7 @@
using System.Numerics;
using Content.Client.Parallax;
using Content.Client.Weather;
using Content.Shared._CP14.DayCycle;
using Content.Shared._CP14.DayCycle.Components;
using Content.Shared._CP14.WorldEdge;
using Content.Shared.Salvage;
using Content.Shared.Weather;

View File

@@ -1,5 +1,5 @@
using System.Numerics;
using Content.Shared._CP14.DayCycle;
using Content.Shared._CP14.DayCycle.Components;
using Robust.Client.Graphics;
using Robust.Shared.Utility;
@@ -53,7 +53,7 @@ public sealed partial class StencilOverlay
worldHandle.UseShader(_protoManager.Index<ShaderPrototype>("StencilMask").Instance());
worldHandle.DrawTextureRect(_blep!.Texture, worldBounds);
var curTime = _timing.RealTime;
var sprite = _sprite.GetFrame(new SpriteSpecifier.Texture(new ResPath(cloudComp.ParallaxPath)), curTime);
var sprite = _sprite.GetFrame(new SpriteSpecifier.Texture(cloudComp.ParallaxPath), curTime);
// Draw the rain
worldHandle.UseShader(_protoManager.Index<ShaderPrototype>("StencilDraw").Instance());

View File

@@ -0,0 +1,34 @@
using Content.Shared._CP14.Workbench;
using Robust.Client.UserInterface;
namespace Content.Client._CP14.Workbench;
public sealed class CP14WorkbenchBoundUserInterface : BoundUserInterface
{
private CP14WorkbenchWindow? _window;
public CP14WorkbenchBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = this.CreateWindow<CP14WorkbenchWindow>();
_window.OnCraft += entry => SendMessage(new CP14WorkbenchUiCraftMessage(entry.ProtoId));
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
switch (state)
{
case CP14WorkbenchUiRecipesState recipesState:
_window?.UpdateRecipes(recipesState);
break;
}
}
}

View File

@@ -0,0 +1,10 @@
<Control xmlns="https://spacestation14.io">
<GridContainer Columns="2">
<TextureRect Name="View"
Margin="0,0,4,0"
MinSize="48 48"
HorizontalAlignment="Left"
Stretch="KeepAspectCentered"/>
<Label Name="Name"/>
</GridContainer>
</Control>

View File

@@ -0,0 +1,43 @@
using Content.Shared.Stacks;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
namespace Content.Client._CP14.Workbench;
[GenerateTypedNameReferences]
public sealed partial class CP14WorkbenchRecipeControl : Control
{
[Dependency] private readonly IEntityManager _entity = default!;
private readonly SpriteSystem _sprite;
public CP14WorkbenchRecipeControl()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_sprite = _entity.System<SpriteSystem>();
}
public CP14WorkbenchRecipeControl(EntityPrototype prototype, int count) : this()
{
var entityName = prototype.Name;
Name.Text = count <= 1 ? entityName : $"{entityName} x{count}";
View.Texture = _sprite.GetPrototypeIcon(prototype).Default;
}
public CP14WorkbenchRecipeControl(StackPrototype prototype, int count) : this()
{
var entityName = Loc.GetString(prototype.Name);
Name.Text = $"{entityName} x{count}";
var icon = prototype.Icon;
if (icon is null)
return;
View.Texture = _sprite.Frame0(icon);
}
}

View File

@@ -0,0 +1,12 @@
<Control xmlns="https://spacestation14.io">
<Button Name="Button">
<GridContainer Columns="2">
<TextureRect Name="View"
Margin="0,0,4,0"
MinSize="48 48"
HorizontalAlignment="Left"
Stretch="KeepAspectCentered"/>
<Label Name="Name"/>
</GridContainer>
</Button>
</Control>

View File

@@ -0,0 +1,59 @@
using Content.Shared._CP14.Workbench;
using Content.Shared._CP14.Workbench.Prototypes;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
namespace Content.Client._CP14.Workbench;
[GenerateTypedNameReferences]
public sealed partial class CP14WorkbenchRequirementControl : Control
{
[Dependency] private readonly IEntityManager _entity = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
public event Action<CP14WorkbenchUiRecipesEntry, CP14WorkbenchRecipePrototype>? OnSelect;
private readonly SpriteSystem _sprite;
private readonly CP14WorkbenchRecipePrototype _recipePrototype;
private readonly bool _craftable;
public CP14WorkbenchRequirementControl(CP14WorkbenchUiRecipesEntry entry)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_sprite = _entity.System<SpriteSystem>();
_recipePrototype = _prototype.Index(entry.ProtoId);
_craftable = entry.Craftable;
Button.OnPressed += _ => OnSelect?.Invoke(entry, _recipePrototype);
UpdateColor();
UpdateName();
UpdateView();
}
private void UpdateColor()
{
if (_craftable)
return;
Button.ModulateSelfOverride = Color.FromHex("#302622");
}
private void UpdateName()
{
var result = _prototype.Index(_recipePrototype.Result);
Name.Text = Loc.GetString(result.Name);
}
private void UpdateView()
{
View.Texture = _sprite.GetPrototypeIcon(_recipePrototype.Result).Default;
}
}

View File

@@ -0,0 +1,60 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'cp14-workbench-ui-title'}"
MinSize="700 600">
<BoxContainer Orientation="Vertical">
<!-- Main -->
<BoxContainer HorizontalExpand="True" VerticalExpand="True" Orientation="Horizontal">
<GridContainer HorizontalExpand="True" VerticalExpand="True" Columns="2">
<!-- Crafts container -->
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" MinSize="0 200">
<BoxContainer Name="CraftsContainer" Orientation="Vertical" HorizontalExpand="True"/>
</ScrollContainer>
<!-- Craft view -->
<BoxContainer HorizontalExpand="True" VerticalExpand="True" Orientation="Vertical">
<PanelContainer HorizontalExpand="True" VerticalExpand="True">
<!-- Background -->
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#41332f"/>
</PanelContainer.PanelOverride>
<!-- Content -->
<BoxContainer HorizontalExpand="True" VerticalExpand="True" Orientation="Vertical">
<!-- Item info -->
<GridContainer HorizontalExpand="True" Columns="2">
<!-- Left panel - icon -->
<TextureRect Name="ItemView"
Margin="0,0,4,0"
MinSize="64 64"
HorizontalAlignment="Left"
Stretch="KeepAspectCentered"/>
<!-- Right panel - name & description -->
<BoxContainer HorizontalExpand="True" VerticalExpand="True" Orientation="Vertical">
<Label Name="ItemName" Text="Name"/>
<Label Name="ItemDescription" Text="Description" ClipText="True"/>
</BoxContainer>
</GridContainer>
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
<!-- Required title -->
<Label Text="{Loc 'cp14-workbench-recipe-list'}"/>
<!-- Craft requirements content -->
<!-- Added by code -->
<BoxContainer Name="ItemRequirements" Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True"/>
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
<!-- Craft button -->
<Button Name="CraftButton" Text="{Loc 'cp14-workbench-craft'}"/>
</BoxContainer>
</PanelContainer>
</BoxContainer>
</GridContainer>
</BoxContainer>
</BoxContainer>
</DefaultWindow>

View File

@@ -0,0 +1,104 @@
using Content.Shared._CP14.Workbench;
using Content.Shared._CP14.Workbench.Prototypes;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
namespace Content.Client._CP14.Workbench;
[GenerateTypedNameReferences]
public sealed partial class CP14WorkbenchWindow : DefaultWindow
{
[Dependency] private readonly IEntityManager _entity = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
public event Action<CP14WorkbenchUiRecipesEntry>? OnCraft;
private readonly SpriteSystem _sprite;
private CP14WorkbenchUiRecipesEntry? _selectedEntry ;
public CP14WorkbenchWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_sprite = _entity.System<SpriteSystem>();
CraftButton.OnPressed += _ =>
{
if (_selectedEntry is null)
return;
OnCraft?.Invoke(_selectedEntry.Value);
};
}
public void UpdateRecipes(CP14WorkbenchUiRecipesState recipesState)
{
CraftsContainer.RemoveAllChildren();
List<CP14WorkbenchUiRecipesEntry> uncraftableList = new();
foreach (var entry in recipesState.Recipes)
{
if (entry.Craftable)
{
var control = new CP14WorkbenchRequirementControl(entry);
control.OnSelect += RecipeSelect;
CraftsContainer.AddChild(control);
}
else
uncraftableList.Add(entry);
}
foreach (var entry in uncraftableList)
{
var control = new CP14WorkbenchRequirementControl(entry);
control.OnSelect += RecipeSelect;
CraftsContainer.AddChild(control);
}
if (_selectedEntry is not null && recipesState.Recipes.Contains(_selectedEntry.Value))
{
RecipeSelect(_selectedEntry.Value, _prototype.Index(_selectedEntry.Value.ProtoId));
return;
}
RecipeSelect(recipesState);
}
private void RecipeSelect(CP14WorkbenchUiRecipesState recipesState)
{
foreach (var entry in recipesState.Recipes)
{
RecipeSelect(entry, _prototype.Index(entry.ProtoId));
break;
}
}
private void RecipeSelect(CP14WorkbenchUiRecipesEntry entry, CP14WorkbenchRecipePrototype recipe)
{
_selectedEntry = entry;
var result = _prototype.Index(recipe.Result);
ItemView.Texture = _sprite.GetPrototypeIcon(recipe.Result).Default;
ItemName.Text = result.Name;
ItemDescription.Text = result.Description;
ItemRequirements.RemoveAllChildren();
foreach (var (entProtoId, count) in recipe.Entities)
{
ItemRequirements.AddChild(new CP14WorkbenchRecipeControl(_prototype.Index(entProtoId), count));
}
foreach (var (stackProtoId, count) in recipe.Stacks)
{
ItemRequirements.AddChild(new CP14WorkbenchRecipeControl(_prototype.Index(stackProtoId), count));
}
CraftButton.Disabled = !entry.Craftable;
}
}

View File

@@ -1,10 +1,9 @@
using System.Numerics;
using Content.Shared._CP14.DayCycle;
using Content.Shared._CP14.DayCycle.Components;
using Robust.Shared.Random;
namespace Content.Server._CP14.DayCycle;
public sealed partial class CP14CloudShadowsSystem : EntitySystem
public sealed class CP14CloudShadowsSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
@@ -15,10 +14,8 @@ public sealed partial class CP14CloudShadowsSystem : EntitySystem
SubscribeLocalEvent<CP14CloudShadowsComponent, MapInitEvent>(OnMapInit);
}
private void OnMapInit(Entity<CP14CloudShadowsComponent> ent, ref MapInitEvent args)
private void OnMapInit(Entity<CP14CloudShadowsComponent> entity, ref MapInitEvent args)
{
ent.Comp.CloudSpeed = new Vector2(
_random.NextFloat(-ent.Comp.MaxSpeed, ent.Comp.MaxSpeed),
_random.NextFloat(-ent.Comp.MaxSpeed, ent.Comp.MaxSpeed));
entity.Comp.CloudSpeed = _random.NextVector2(-entity.Comp.MaxSpeed, entity.Comp.MaxSpeed);
}
}

View File

@@ -1,19 +1,22 @@
using System.Diagnostics;
using Content.Shared._CP14.DayCycle;
using Content.Shared._CP14.DayCycle.Components;
using Content.Shared.Maps;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
namespace Content.Shared._CP14.DayCycle;
namespace Content.Server._CP14.DayCycle;
public sealed partial class CP14DayCycleSystem : EntitySystem
public sealed partial class CP14DayCycleSystem : CP14SharedDayCycleSystem
{
public const int MinTimeEntryCount = 2;
private const float MaxTimeDiff = 0.05f;
private static readonly ProtoId<CP14DayCyclePeriodPrototype> DayPeriod = "Day";
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly SharedMapSystem _maps = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
public override void Initialize()
@@ -21,17 +24,8 @@ public sealed partial class CP14DayCycleSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<CP14DayCycleComponent, MapInitEvent>(OnMapInitDayCycle);
SubscribeLocalEvent<CP14DayCycleComponent, DayCycleDayStartedEvent>(OnDayStarted);
SubscribeLocalEvent<CP14DayCycleComponent, DayCycleNightStartedEvent>(OnNightStarted);
}
private void OnDayStarted(Entity<CP14DayCycleComponent> dayCycle, ref DayCycleDayStartedEvent args)
{
}
private void OnNightStarted(Entity<CP14DayCycleComponent> dayCycle, ref DayCycleNightStartedEvent args)
{
}
private void OnMapInitDayCycle(Entity<CP14DayCycleComponent> dayCycle, ref MapInitEvent args)
{
@@ -88,22 +82,8 @@ public sealed partial class CP14DayCycleSystem : EntitySystem
dayCycle.Comp.EntryStartTime = dayCycle.Comp.EntryEndTime;
dayCycle.Comp.EntryEndTime += dayCycle.Comp.CurrentTimeEntry.Duration;
// TODO: Made with states,we might need an evening or something, and besides, it's too much hardcore
if (dayCycle.Comp.IsNight && !dayCycle.Comp.CurrentTimeEntry.IsNight) // Day started
{
dayCycle.Comp.IsNight = false;
var ev = new DayCycleDayStartedEvent(dayCycle);
RaiseLocalEvent(dayCycle, ref ev, true);
}
if (!dayCycle.Comp.IsNight && dayCycle.Comp.CurrentTimeEntry.IsNight) // Night started
{
dayCycle.Comp.IsNight = true;
var ev = new DayCycleNightStartedEvent(dayCycle);
RaiseLocalEvent(dayCycle, ref ev, true);
}
var ev = new DayCycleChangedEvent(dayCycle.Comp.CurrentTimeEntry);
RaiseLocalEvent(dayCycle, ref ev, true);
Dirty(dayCycle);
}
@@ -113,28 +93,22 @@ public sealed partial class CP14DayCycleSystem : EntitySystem
/// </summary>
/// <param name="target">An entity being tested to see if it is in daylight</param>
/// <param name="checkRoof">Checks if the tile covers the weather (the only "roof" factor at the moment)</param>
/// <param name="isDaylight">daylight test result returned</param>
public bool TryDaylightThere(EntityUid target, bool checkRoof)
{
if (!TryComp<TransformComponent>(target, out var xform))
return false;
var xform = Transform(target);
if (!TryComp<CP14DayCycleComponent>(xform.MapUid, out var dayCycle))
return false;
if (checkRoof)
{
if (!TryComp<MapGridComponent>(xform.GridUid, out var mapGrid))
return !dayCycle.IsNight;
if (!checkRoof || !TryComp<MapGridComponent>(xform.GridUid, out var mapGrid))
return dayCycle.CurrentPeriod == DayPeriod;
var tileRef = _maps.GetTileRef(xform.GridUid.Value, mapGrid, xform.Coordinates);
var tileDef = (ContentTileDefinition) _tileDefManager[tileRef.Tile.TypeId];
var tileRef = _maps.GetTileRef(xform.GridUid.Value, mapGrid, xform.Coordinates);
var tileDef = (ContentTileDefinition) _tileDefManager[tileRef.Tile.TypeId];
if (!tileDef.Weather)
return false;
}
if (!tileDef.Weather)
return false;
return !dayCycle.IsNight;
return dayCycle.CurrentPeriod == DayPeriod;
}
private void SetAmbientColor(Entity<MapLightComponent> light, Color color)

View File

@@ -1,9 +1,11 @@
using Content.Server.Administration;
using Content.Shared._CP14.DayCycle;
using Content.Shared._CP14.DayCycle.Components;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;
namespace Content.Server._CP14.DayCycle;
namespace Content.Server._CP14.DayCycle.Commands;
[AdminCommand(AdminFlags.VarEdit)]
public sealed class CP14AddTimeEntryCommand : LocalizedCommands
@@ -13,7 +15,7 @@ public sealed class CP14AddTimeEntryCommand : LocalizedCommands
public override string Command => Name;
public override string Description => "Allows you to add a new time entry to the map list";
public override string Help => $"{Name} <mapUid> <color> <duration> <isNight>";
public override string Help => $"{Name} <mapUid> <color> <duration> <periodId>";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
@@ -29,7 +31,9 @@ public sealed class CP14AddTimeEntryCommand : LocalizedCommands
return;
}
var entityManager = IoCManager.Resolve<EntityManager>();
var entityManager = IoCManager.Resolve<IEntityManager>();
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var dayCycleSystem = entityManager.System<CP14DayCycleSystem>();
var entity = entityManager.GetEntity(netEntity);
@@ -51,9 +55,9 @@ public sealed class CP14AddTimeEntryCommand : LocalizedCommands
return;
}
if (!bool.TryParse(args[3], out var isNight))
if (!prototypeManager.TryIndex<CP14DayCyclePeriodPrototype>(args[3], out var prototype))
{
shell.WriteError(Loc.GetString("parse-bool-fail", ("args", args[3])));
shell.WriteError(Loc.GetString("parse-prototype-fail", ("args", args[3])));
return;
}
@@ -61,7 +65,7 @@ public sealed class CP14AddTimeEntryCommand : LocalizedCommands
{
Color = color,
Duration = TimeSpan.FromSeconds(duration),
IsNight = isNight
Period = prototype.ID,
};
dayCycleSystem.AddTimeEntry((entity, dayCycle), entry);
@@ -72,7 +76,7 @@ public sealed class CP14AddTimeEntryCommand : LocalizedCommands
return args.Length switch
{
1 => CompletionResult.FromOptions(CompletionHelper.Components<CP14DayCycleComponent>(args[0])),
4 => CompletionResult.FromOptions(CompletionHelper.Booleans),
4 => CompletionResult.FromOptions(CompletionHelper.PrototypeIDs<CP14DayCyclePeriodPrototype>()),
_ => CompletionResult.Empty,
};
}

View File

@@ -2,8 +2,9 @@ using Content.Server.Administration;
using Content.Shared._CP14.DayCycle;
using Content.Shared.Administration;
using Robust.Shared.Console;
using CP14DayCycleComponent = Content.Shared._CP14.DayCycle.Components.CP14DayCycleComponent;
namespace Content.Server._CP14.DayCycle;
namespace Content.Server._CP14.DayCycle.Commands;
[AdminCommand(AdminFlags.VarEdit)]
public sealed class CP14InitDayCycleCommand : LocalizedCommands

View File

@@ -2,8 +2,9 @@ using Content.Server.Administration;
using Content.Shared._CP14.DayCycle;
using Content.Shared.Administration;
using Robust.Shared.Console;
using CP14DayCycleComponent = Content.Shared._CP14.DayCycle.Components.CP14DayCycleComponent;
namespace Content.Server._CP14.DayCycle;
namespace Content.Server._CP14.DayCycle.Commands;
[AdminCommand(AdminFlags.VarEdit)]
public sealed class CP14SetTimeEntryCommand : LocalizedCommands

View File

@@ -1,3 +1,4 @@
using Content.Server._CP14.DayCycle;
using Content.Server._CP14.Farming.Components;
using Content.Server.Destructible;
using Content.Server.DoAfter;

View File

@@ -0,0 +1,33 @@
using Content.Shared._CP14.Workbench;
namespace Content.Server._CP14.Workbench;
public sealed partial class CP14WorkbenchSystem
{
private void OnCraft(Entity<CP14WorkbenchComponent> entity, ref CP14WorkbenchUiCraftMessage args)
{
if (!entity.Comp.Recipes.Contains(args.Recipe))
return;
if (!_proto.TryIndex(args.Recipe, out var prototype))
return;
StartCraft(entity, args.Actor, prototype);
}
private void UpdateUIRecipes(Entity<CP14WorkbenchComponent> entity)
{
var placedEntities = _lookup.GetEntitiesInRange(Transform(entity).Coordinates, WorkbenchRadius);
var recipes = new List<CP14WorkbenchUiRecipesEntry>();
foreach (var recipeId in entity.Comp.Recipes)
{
var recipe = _proto.Index(recipeId);
var entry = new CP14WorkbenchUiRecipesEntry(recipeId, CanCraftRecipe(recipe, placedEntities));
recipes.Add(entry);
}
_userInterface.SetUiState(entity.Owner, CP14WorkbenchUiKey.Key, new CP14WorkbenchUiRecipesState(recipes));
}
}

View File

@@ -1,26 +1,32 @@
using Content.Server.DoAfter;
using Content.Server.Popups;
using Content.Server.Stack;
using Content.Shared._CP14.Workbench;
using Content.Shared._CP14.Workbench.Prototypes;
using Content.Shared.DoAfter;
using Content.Shared.Stacks;
using Content.Shared.UserInterface;
using Content.Shared.Verbs;
using Robust.Shared.Audio.Systems;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Prototypes;
namespace Content.Server._CP14.Workbench;
public sealed class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
public sealed partial class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
{
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedStackSystem _stack = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly DoAfterSystem _doAfter = default!;
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly UserInterfaceSystem _userInterface = default!;
private EntityQuery<MetaDataComponent> _metaQuery;
private EntityQuery<StackComponent> _stackQuery;
// Why not in component? Why?
private const float WorkbenchRadius = 0.5f;
public override void Initialize()
@@ -30,10 +36,18 @@ public sealed class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
_metaQuery = GetEntityQuery<MetaDataComponent>();
_stackQuery = GetEntityQuery<StackComponent>();
SubscribeLocalEvent<CP14WorkbenchComponent, BeforeActivatableUIOpenEvent>(OnBeforeUIOpen);
SubscribeLocalEvent<CP14WorkbenchComponent, CP14WorkbenchUiCraftMessage>(OnCraft);
SubscribeLocalEvent<CP14WorkbenchComponent, GetVerbsEvent<InteractionVerb>>(OnInteractionVerb);
SubscribeLocalEvent<CP14WorkbenchComponent, CP14CraftDoAfterEvent>(OnCraftFinished);
}
private void OnBeforeUIOpen(Entity<CP14WorkbenchComponent> ent, ref BeforeActivatableUIOpenEvent args)
{
UpdateUIRecipes(ent);
}
private void OnInteractionVerb(Entity<CP14WorkbenchComponent> ent, ref GetVerbsEvent<InteractionVerb> args)
{
if (!args.CanAccess || !args.CanInteract || args.Hands is null)
@@ -64,6 +78,7 @@ public sealed class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
}
}
// TODO: Replace Del to QueueDel when it's will be works with events
private void OnCraftFinished(Entity<CP14WorkbenchComponent> ent, ref CP14CraftDoAfterEvent args)
{
if (args.Cancelled || args.Handled)
@@ -89,7 +104,7 @@ public sealed class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
if (placedProto != null && placedProto == requiredIngredient.Key && requiredCount > 0)
{
requiredCount--;
QueueDel(placedEntity);
Del(placedEntity);
}
}
}
@@ -106,14 +121,18 @@ public sealed class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
continue;
var count = (int)MathF.Min(requiredCount, stack.Count);
_stack.SetCount(placedEntity, stack.Count - count, stack);
if (stack.Count - count <= 0)
Del(placedEntity);
else
_stack.SetCount(placedEntity, stack.Count - count, stack);
requiredCount -= count;
}
}
Spawn(_proto.Index(args.Recipe).Result, Transform(ent).Coordinates);
UpdateUIRecipes(ent);
args.Handled = true;
}

View File

@@ -0,0 +1,10 @@
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.DayCycle;
[Prototype("CP14DayCyclePeriod")]
public sealed class CP14DayCyclePeriodPrototype : IPrototype
{
[IdDataField]
public string ID { get; } = string.Empty;
}

View File

@@ -0,0 +1,3 @@
namespace Content.Shared._CP14.DayCycle;
public abstract class CP14SharedDayCycleSystem : EntitySystem;

View File

@@ -1,16 +1,17 @@
using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Utility;
namespace Content.Shared._CP14.DayCycle;
namespace Content.Shared._CP14.DayCycle.Components;
/// <summary>
/// if added to the map, renders cloud shadows on the map
/// If added to the map, renders cloud shadows on the map
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class CP14CloudShadowsComponent : Component
{
[DataField, AutoNetworkedField]
public Vector2 CloudSpeed = new Vector2(0.5f, 0f);
public Vector2 CloudSpeed = new(0.5f, 0f);
[DataField]
public float MaxSpeed = 1.5f;
@@ -22,5 +23,5 @@ public sealed partial class CP14CloudShadowsComponent : Component
public float Scale = 2.5f;
[DataField]
public string ParallaxPath = "/Textures/_CP14/Parallaxes/Shadows.png";
public ResPath ParallaxPath = new("/Textures/_CP14/Parallaxes/Shadows.png");
}

View File

@@ -1,13 +1,13 @@
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared._CP14.DayCycle;
namespace Content.Shared._CP14.DayCycle.Components;
/// <summary>
/// Stores all the necessary data for the day and night cycle system to work
/// Stores all the necessary data for the day and night cycle system to work.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(CP14DayCycleSystem))]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(CP14SharedDayCycleSystem))]
public sealed partial class CP14DayCycleComponent : Component
{
[ViewVariables]
@@ -25,12 +25,12 @@ public sealed partial class CP14DayCycleComponent : Component
[ViewVariables]
public Color EndColor => NextCurrentTimeEntry.Color;
[ViewVariables]
public ProtoId<CP14DayCyclePeriodPrototype> CurrentPeriod => CurrentTimeEntry.Period;
[DataField(required: true), ViewVariables, AutoNetworkedField]
public List<DayCycleEntry> TimeEntries = new();
[DataField, ViewVariables, AutoNetworkedField]
public bool IsNight; // TODO: Rewrite this shit
[DataField, ViewVariables, AutoNetworkedField]
public int CurrentTimeEntryIndex;
@@ -57,17 +57,11 @@ public readonly partial record struct DayCycleEntry()
public TimeSpan Duration { get; init; } = TimeSpan.FromSeconds(60);
[DataField]
public bool IsNight { get; init; } = false;
public ProtoId<CP14DayCyclePeriodPrototype> Period { get; init; } = "Day";
}
/// <summary>
/// Event raised on map entity, wen night is started
/// Event raised on map entity, wen day cycle changed.
/// </summary>
[ByRefEvent]
public readonly record struct DayCycleNightStartedEvent(EntityUid Map);
/// <summary>
/// Event raised on map entity, wen night is started
/// </summary>
[ByRefEvent]
public readonly record struct DayCycleDayStartedEvent(EntityUid Map);
public readonly record struct DayCycleChangedEvent(DayCycleEntry Entry);

View File

@@ -1,4 +1,3 @@
using Content.Shared._CP14.DayCycle;
using Content.Shared.Random.Rules;
namespace Content.Shared._CP14.Random.Rules;
@@ -11,7 +10,9 @@ public sealed partial class IsDaylight : RulesRule
public override bool Check(EntityManager entManager, EntityUid uid)
{
var transform = entManager.System<SharedTransformSystem>();
var dayCycle = entManager.System<CP14DayCycleSystem>();
// Not shared yet, use raw component data from map
// var dayCycle = entManager.System<CP14DayCycleSystem>();
//черт, нужны комиты из ветки фермерства
return !Inverted;

View File

@@ -0,0 +1,63 @@
using Content.Shared._CP14.Workbench.Prototypes;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared._CP14.Workbench;
[Serializable, NetSerializable]
public enum CP14WorkbenchUiKey
{
Key,
}
[Serializable, NetSerializable]
public sealed class CP14WorkbenchUiCraftMessage : BoundUserInterfaceMessage
{
public readonly ProtoId<CP14WorkbenchRecipePrototype> Recipe;
public CP14WorkbenchUiCraftMessage(ProtoId<CP14WorkbenchRecipePrototype> recipe)
{
Recipe = recipe;
}
}
[Serializable, NetSerializable]
public sealed class CP14WorkbenchUiRecipesState : BoundUserInterfaceState
{
// It's list (not hashset) BECAUSE CP14WorkbenchComponent contains list of recipes (WHY???)
public readonly List<CP14WorkbenchUiRecipesEntry> Recipes;
public CP14WorkbenchUiRecipesState(List<CP14WorkbenchUiRecipesEntry> recipes)
{
Recipes = recipes;
}
}
[Serializable, NetSerializable]
public readonly struct CP14WorkbenchUiRecipesEntry : IEquatable<CP14WorkbenchUiRecipesEntry>
{
public readonly ProtoId<CP14WorkbenchRecipePrototype> ProtoId;
public readonly bool Craftable;
public CP14WorkbenchUiRecipesEntry(ProtoId<CP14WorkbenchRecipePrototype> protoId, bool craftable)
{
ProtoId = protoId;
Craftable = craftable;
}
public override bool Equals(object? obj)
{
return obj is CP14WorkbenchUiRecipesEntry other && Equals(other);
}
public bool Equals(CP14WorkbenchUiRecipesEntry other)
{
return ProtoId.Id == other.ProtoId.Id;
}
public override int GetHashCode()
{
return HashCode.Combine(ProtoId, Craftable);
}
}

View File

@@ -4,13 +4,9 @@ using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.Workbench.Prototypes;
/// <summary>
///
/// </summary>
[Prototype("CP14Recipe")]
public sealed partial class CP14WorkbenchRecipePrototype : IPrototype
public sealed class CP14WorkbenchRecipePrototype : IPrototype
{
[ViewVariables]
[IdDataField]
public string ID { get; private set; } = default!;
@@ -27,5 +23,5 @@ public sealed partial class CP14WorkbenchRecipePrototype : IPrototype
public Dictionary<ProtoId<StackPrototype>, int> Stacks = new();
[DataField(required: true)]
public EntProtoId Result = default!;
public EntProtoId Result;
}

View File

@@ -12,27 +12,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
By using the code, you agree to be bound by the terms of this license agreement.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Some files may be sublicensed to third parties under the following license:
Custom License Agreement (CLA)
1. License Grant: You are granted a non-exclusive, non-transferable, non-sublicensable license to use the code solely for personal or internal business purposes in the specified project.
2. Restrictions:
a. You may not distribute, sublicense, or transfer copies of the code or its derivatives to any third party.
b. You may not modify or create derivative works based on the code without prior written consent from the copyright holder.
3. Termination: This license will terminate automatically if you fail to comply with any of its terms. Upon termination, you must destroy all copies of the code in your possession.
4. Disclaimer of Warranty: The code is provided "as is" without warranty of any kind, express or implied.
5. Limitation of Liability: In no event shall the copyright holder be liable for any damages arising from the use or inability to use the code.
By using the code, you agree to be bound by the terms of this license agreement.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

17
LICENSE_CLA.txt Normal file
View File

@@ -0,0 +1,17 @@
Some files may be sublicensed to third parties under the following license:
Custom License Agreement (CLA)
1. License Grant: You are granted a non-exclusive, non-transferable, non-sublicensable license to use the code solely for personal or internal business purposes in the specified project.
2. Restrictions:
a. You may not distribute, sublicense, or transfer copies of the code or its derivatives to any third party.
b. You may not modify or create derivative works based on the code without prior written consent from the copyright holder.
3. Termination: This license will terminate automatically if you fail to comply with any of its terms. Upon termination, you must destroy all copies of the code in your possession.
4. Disclaimer of Warranty: The code is provided "as is" without warranty of any kind, express or implied.
5. Limitation of Liability: In no event shall the copyright holder be liable for any damages arising from the use or inability to use the code.
By using the code, you agree to be bound by the terms of this license agreement.

21
LICENSE_MIT.txt Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017-2024 Space Wizards Federation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -15,8 +15,10 @@
[More detailed instructions on building the project.](https://docs.spacestation14.com/en/general-development/setup.html)
## License
The base code for the original Space Station 14 game is registered under MIT: https://github.com/space-wizards/space-station-14
The base code for the original Space Station 14 game is registered under [MIT License](https://github.com/crystallpunk-14/crystall-punk-14/blob/master/LICENSE_MIT.txt)
All CrystallPunk14 codebase contributions rights reserved. (all components and systems beginning with CP14, for example: https://github.com/crystallpunk-14/crystall-punk-14/blob/master/Content.Server/_CP14/Alchemy/CP14AlchemyExtractionSystem.cs)
All CrystallPunk14 codebase contributions [rights reserved](https://github.com/crystallpunk-14/crystall-punk-14/blob/master/LICENSE_ARR.TXT).
Visual and sound assets have their own license, described in the attribution file next to them.
Some code may be sublicensed under [CLA](https://github.com/crystallpunk-14/crystall-punk-14/blob/master/LICENSE_CLA.txt) for specific other projects. Details of who the code is sublicensed to can be found in the corresponding code files.
Visual and sound assets have their own license, described in the attribution file next to them.

View File

@@ -0,0 +1,4 @@
cp14-stack-copper-coin = copper coins
cp14-stack-silver-coin = silver coins
cp14-stack-gold-coin = gold coins
cp14-stack-platinum-coin = platinum coins

View File

@@ -0,0 +1,8 @@
cp14-stack-dirt-block = dirt blocks
cp14-stack-stone-block = stone blocks
cp14-stack-wood-planks = wooden planks
cp14-stack-nails = nails
cp14-stack-copper-bars = copper bars
cp14-stack-iron-bars = iron bars
cp14-stack-gold-bars = gold bars

View File

@@ -1,5 +1,6 @@
cp14-verb-categories-craft = Select recipe:
cp14-workbench-ui-title = Item creation
cp14-workbench-craft = Craft
cp14-workbench-recipe-list = Recipe:
cp14-workbench-no-resource = There aren't enough ingredients!

View File

@@ -1114,3 +1114,48 @@ ent-CP14CookedFoodMeat = Стейк из баранины
ent-CP14CuttingBoard = Разделочная доска
.desc = Поможет вам приготовить еду.
ent-CP14ActionSpellCureWounds = Лечение ран
.desc = Вы касаетесь существа, исцеляя его тело от физических повреждений.
ent-CP14ActionSpellEarthWall = Земляная стена
.desc = Поднимает из недр прочную стену земли.
ent-CP14ActionSpellFireball = Огненный шар
.desc = Эффективный метод уничтожения - взрывной огненный шар.
ent-CP14ActionSpellFlameCreation = Создание пламени
.desc = В вашей руке образуется искусственное пламя, освещающее окружающее пространство. Вы можете бросить его, чтобы использовать в качестве одноразового оружия.
ent-CP14FlameCreationArtificialFlame = искусственное пламя
.desc = Магически созданное искусственное пламя, горящее прямо в воздухе. Неплохой источник света или оружие, если бросить его кому-нибудь в лицо.
ent-CP14ActionSpellFlashLight = Вспышка света
.desc = Создает вспышку яркого, ослепительного света.
ent-CP14ActionSpellIceDagger = Ледяной кинжал
.desc = Материализация временного острого ледяного метательного кинжала.
ent-CP14DaggerIce = ледяной кинжал
.desc = Кусок острого магического льда. Через некоторое время действие заклинания ослабнет, и он исчезнет.
ent-CP14ActionSpellIceFloor = Ледяной пол
.desc = Покрывает определенный участок земли скользким льдом.
ent-CP14IceFloor = ледяная корка
.desc = Холодно и скользко.
ent-CP14ActionSpellIceShards = Ледяные осколки
.desc = Быстрые ледяные иглы для быстрой стрельбы по мишеням.
ent-CP14ActionSpellShadowGrab = Теневой захват
.desc = Вы вызываете призрачную руку, которая притягивает к вам предмет или сущность.
ent-CP14ActionSpellShadowStep = Теневой шаг
.desc = Шаг сквозь прореху реальности, позволяющий быстро преодолеть небольшое расстояние.
ent-CP14ActionSpellSphereOfLight = Сфера света
.desc = Материализация яркого и безопасного источника света.
ent-CP14SphereOfLight = Сфера света
.desc = Сгусток яркого света в форме сферы.

View File

@@ -0,0 +1,4 @@
cp14-stack-copper-coin = медные монеты
cp14-stack-silver-coin = серебрянные монеты
cp14-stack-gold-coin = золотые монеты
cp14-stack-platinum-coin = платиновые монеты

View File

@@ -0,0 +1,8 @@
cp14-stack-dirt-block = блоки земли
cp14-stack-stone-block = каменные блоки
cp14-stack-wood-planks = деревянные доски
cp14-stack-nails = гвозди
cp14-stack-copper-bars = медные слитки
cp14-stack-iron-bars = железные слитки
cp14-stack-gold-bars = золотые слитки

View File

@@ -1,5 +1,6 @@
cp14-verb-categories-craft = Выберите крафт:
cp14-workbench-ui-title = Создание предметов
cp14-workbench-craft = Создать
cp14-workbench-recipe-list = Рецепт:
cp14-workbench-no-resource = Не хватает ингредиентов!

View File

@@ -47,18 +47,18 @@ entities:
color: '#E0BA87FF'
- duration: 80
color: '#BFEEFFFF'
- isNight: True
duration: 80
- duration: 80
color: '#385163FF'
- isNight: True
duration: 80
period: Night
- duration: 80
color: '#060D12FF'
- isNight: True
duration: 80
period: Night
- duration: 80
color: '#000000FF'
- isNight: True
duration: 80
period: Night
- duration: 80
color: '#000000FF'
period: Night
- duration: 80
color: '#120906FF'
- uid: 2

View File

@@ -42,16 +42,16 @@ entities:
color: '#E0BA87FF'
- duration: 80
color: '#BFEEFFFF'
- isNight: True
- period: Night
duration: 80
color: '#385163FF'
- isNight: True
- period: Night
duration: 80
color: '#060D12FF'
- isNight: True
- period: Night
duration: 80
color: '#000000FF'
- isNight: True
- period: Night
duration: 80
color: '#000000FF'
- duration: 80

View File

@@ -38,16 +38,16 @@ entities:
color: '#E0BA87FF'
- duration: 80
color: '#BFEEFFFF'
- isNight: True
- period: Night
duration: 80
color: '#385163FF'
- isNight: True
- period: Night
duration: 80
color: '#060D12FF'
- isNight: True
- period: Night
duration: 80
color: '#000000FF'
- isNight: True
- period: Night
duration: 80
color: '#000000FF'
- duration: 80

View File

@@ -35,16 +35,16 @@ entities:
color: '#E0BA87FF'
- duration: 80
color: '#BFEEFFFF'
- isNight: True
- period: Night
duration: 80
color: '#385163FF'
- isNight: True
- period: Night
duration: 80
color: '#060D12FF'
- isNight: True
- period: Night
duration: 80
color: '#000000FF'
- isNight: True
- period: Night
duration: 80
color: '#000000FF'
- duration: 80

View File

@@ -0,0 +1,11 @@
- type: CP14DayCyclePeriod
id: Sunrise # HOLY SHIT!
- type: CP14DayCyclePeriod
id: Day
- type: CP14DayCyclePeriod
id: Night
- type: CP14DayCyclePeriod
id: Evening

View File

@@ -0,0 +1,86 @@
- type: entity
id: CP14ActionSpellFlashLight
name: Flash Light
description: Creates a flash of bright, blinding light.
components:
- type: CP14MagicEffect
manaCost: 10
telegraphyEffects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14ImpactEffectFlashLight
effects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14SpawnEffectFlashLight
- type: CP14MagicEffectVerbalAspect
startSpeech: "Lux clara..."
endSpeech: "excaecant inimicos meos"
- type: CP14MagicEffectCastingVisual
proto: CP14RuneFlashLight
- type: WorldTargetAction
useDelay: 5
range: 10
itemIconStyle: BigAction
sound: !type:SoundPathSpecifier
path: /Audio/Magic/rumble.ogg
icon:
sprite: _CP14/Effects/Magic/spells_icons.rsi
state: flash_light
event: !type:CP14DelayedWorldTargetActionEvent
delay: 0.5
- type: entity
id: CP14RuneFlashLight
parent: CP14BaseMagicRune
categories: [ HideSpawnMenu ]
components:
- type: PointLight
color: "#efedff"
- type: Sprite
layers:
- state: sun
color: "#efedff"
shader: unshaded
- type: entity
id: CP14ImpactEffectFlashLight
parent: CP14BaseMagicImpact
categories: [ HideSpawnMenu ]
components:
- type: Sprite
layers:
- state: particles_up
color: "#efedff"
shader: unshaded
- type: entity
id: CP14SpawnEffectFlashLight
components:
- type: Sprite
sprite: /Textures/Objects/Fun/goldbikehorn.rsi
visible: false
state: icon
- type: TriggerOnSpawn
- type: TimedDespawn
lifetime: 5
- type: FlashOnTrigger
range: 4
duration: 4
- type: SpawnOnTrigger
proto: CP14SpellFlashEffect
- type: entity
id: CP14SpellFlashEffect
noSpawn: true
components:
- type: PointLight
enabled: true
radius: 5
energy: 14
netsync: false
- type: LightFade
duration: 0.5
- type: TimedDespawn
lifetime: 0.5

View File

@@ -0,0 +1,113 @@
- type: entity
id: CP14ActionSpellSphereOfLight
name: Sphere of Light
description: Materialization of a bright and safe light source.
components:
- type: CP14MagicEffect
manaCost: 10
effects:
- !type:CP14SpellSpawnEntityOnTarget
spawns:
- CP14ImpactEffectSphereOfLight
- !type:CP14SpellSpawnInHandEntity
spawns:
- CP14SphereOfLight
- type: CP14MagicEffectVerbalAspect
startSpeech: "Appare in manu tua..."
endSpeech: "sphaera lucis"
- type: CP14MagicEffectSomaticAspect
- type: CP14MagicEffectCastingVisual
proto: CP14RuneSphereOfLight
- type: InstantAction
useDelay: 15
itemIconStyle: BigAction
sound: !type:SoundPathSpecifier
path: /Audio/Magic/rumble.ogg
icon:
sprite: _CP14/Effects/Magic/spells_icons.rsi
state: sphere_of_light
event: !type:CP14DelayedInstantActionEvent
delay: 0.5
breakOnMove: false
- type: entity
id: CP14RuneSphereOfLight
parent: CP14BaseMagicRune
categories: [ HideSpawnMenu ]
components:
- type: PointLight
color: "#efedff"
- type: Sprite
layers:
- state: sun
color: "#efedff"
shader: unshaded
- type: entity
id: CP14ImpactEffectSphereOfLight
parent: CP14BaseMagicImpact
categories: [ HideSpawnMenu ]
components:
- type: Sprite
layers:
- state: particles_up
color: "#efedff"
shader: unshaded
- type: entity
id: CP14SphereOfLight
name: Sphere of light
parent: BaseItem
description: A lump of bright light in the shape of a sphere.
components:
- type: TimedDespawn
lifetime: 300 # 5 min
- type: Sprite
sprite: _CP14/Effects/Magic/sphere_of_light.rsi
noRot: true
layers:
- state: icon
shader: unshaded
- type: Item
size: Ginormous
- type: Tag
tags:
- ForceableFollow
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.2,-0.2,0.2,0.2"
density: 30
hard: true
mask:
- ItemMask
layer:
- Opaque
- type: LandAtCursor
- type: MovementIgnoreGravity
- type: PointLight
radius: 5.0
energy: 6
color: "#efedff"
- type: Damageable
- type: EmitSoundOnLand
sound:
path: /Audio/Effects/drop.ogg
params:
volume: -100 #Yes, it's stupid, but it's easier
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 10
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:PlaySoundBehavior
sound:
path: /Audio/Weapons/Guns/Hits/energy_meat1.ogg
params:
variation: 0.250
volume: -12

View File

@@ -172,3 +172,40 @@
- type: CP14SpellStorage
spells:
- CP14ActionSpellIceFloor
- type: entity
id: CP14ClothingRingSphereOfLight
parent: CP14ClothingRingBase
name: conductive ring
description: A standard mana-conductive ring that allows the user to create a sphere of light.
suffix: Sphere of Light
components:
- type: Sprite
layers:
- state: brass_ring
- state: citrine_stone_small
- type: CP14SpellStorageRequireAttune
- type: CP14MagicAttuningItem
- type: CP14SpellStorageAccessWearing
- type: CP14SpellStorage
spells:
- CP14ActionSpellSphereOfLight
- type: entity
id: CP14ClothingRingFlashLight
parent: CP14ClothingRingBase
name: conductive ring
description: A standard mana-conductive ring that allows the user to create a bright flash of light that blinds enemies.
suffix: Flash Light
components:
- type: Sprite
layers:
- state: brass_ring
- state: citrine_stone_small
- type: CP14SpellStorageRequireAttune
- type: CP14MagicAttuningItem
- type: CP14SpellStorageAccessWearing
- type: CP14SpellStorage
spells:
- CP14ActionSpellFlashLight

View File

@@ -251,3 +251,36 @@
components:
- type: Stack
count: 10
- type: entity
id: CP14FloraMaterial
parent:
- BaseItem
name: flora material
description: An organic material used for medicinal or construction purposes.
components:
- type: Item
size: Tiny
- type: Sprite
sprite: _CP14/Objects/Materials/flora.rsi
layers:
- state: grass_material1
map: ["random"]
- type: RandomSprite
available:
- random:
grass_material1: ""
grass_material2: ""
grass_material3: ""
- type: Tag
tags:
- CP14FireplaceFuel
- type: Flammable
fireSpread: false
canResistFire: false
alwaysCombustible: true
canExtinguish: true
cP14FireplaceFuel: 5
damage:
types:
Heat: 1

View File

@@ -13,7 +13,7 @@
- type: entity
id: CP14MeltingMoldBlank
parent: CP14MeltingMoldBase
name: black melting mold
name: blank melting mold
description: An empty mold for casting metal. You can cut any shape you need in it on the pattern cutting table.
components:
- type: Sprite

View File

@@ -64,11 +64,11 @@
variation: 0.05
- !type:DoActsBehavior
acts: [ "Destruction" ]
#- !type:SpawnEntitiesBehavior #TODO - flora material drop
# spawn:
# CP14WoodLog:
# min: 1
# max: 3
- !type:SpawnEntitiesBehavior
spawn:
CP14FloraMaterial:
min: 0
max: 2
- type: SpeedModifierContacts
walkSpeedModifier: 0.5
sprintSpeedModifier: 0.5

View File

@@ -4,12 +4,18 @@
id: CP14BaseWorkbench
abstract: true
components:
- type: ActivatableUI
key: enum.CP14WorkbenchUiKey.Key
- type: Climbable
- type: Clickable
- type: PlaceableSurface
- type: InteractionOutline
- type: CP14Workbench
craftSpeed: 1
- type: InteractionOutline
- type: PlaceableSurface
- type: UserInterface
interfaces:
enum.CP14WorkbenchUiKey.Key:
type: CP14WorkbenchBoundUserInterface
- type: entity
parent:
@@ -68,6 +74,7 @@
recipes:
- CP14Bucket
- CP14BaseBarrel
- CP14WoodenBeerMug
- type: entity
id: CP14WorkbenchMeltingMolds

View File

@@ -0,0 +1,86 @@
- type: entity
id: CP14WindowDirectional
parent: BaseStructure
name: directional window
description: Don't smudge up the glass down there.
placement:
mode: SnapgridCenter
snap:
- Window
components:
- type: WallMount
arc: 360 # interact despite grilles
- type: MeleeSound
soundGroups:
Brute:
collection: GlassSmack
- type: Sprite
drawdepth: Mobs
sprite: _CP14/Structures/Windows/directional.rsi
layers:
- state: wooden_frame
- state: default_glass
- type: Icon
sprite: _CP14/Structures/Windows/directional.rsi
state: wooden_frame
- type: InteractionPopup
interactSuccessString: comp-window-knock
messagePerceivedByOthers: comp-window-knock
interactSuccessSound:
path: /Audio/Effects/glass_knock.ogg
- type: Physics
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.49,-0.32,0.49,0"
density: 1500
mask:
- FullTileMask
layer:
- GlassLayer
- type: Repairable
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Glass
- type: ExaminableDamage
messages: WindowMessages
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 150 #excess damage (nuke?). avoid computational cost of spawning entities.
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:PlaySoundBehavior
sound:
collection: WindowShatter
- trigger:
!type:DamageTrigger
damage: 25
behaviors:
- !type:PlaySoundBehavior
sound:
collection: WindowShatter
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Airtight
noAirWhenFullyAirBlocked: false
airBlockedDirection:
- South
- type: Appearance
- type: DamageVisuals
thresholds: [4, 8, 12]
damageDivisor: 3.333
trackAllDamage: true
damageOverlay:
sprite: Structures/Windows/cracks_directional.rsi
- type: StaticPrice
price: 10

View File

@@ -13,4 +13,12 @@
stacks:
CP14WoodenPlanks: 5
CP14Nail: 2
result: CP14BaseBarrel
result: CP14BaseBarrel
- type: CP14Recipe
id: CP14WoodenBeerMug
craftTime: 3
stacks:
CP14WoodenPlanks: 2
CP14Nail: 1
result: CP14WoodenBeerMug

View File

@@ -1,6 +1,6 @@
- type: stack
id: CP14CopperCoin
name: copper crown
name: cp14-stack-copper-coin
spawn: CP14CopperCoin1
icon:
sprite: /Textures/_CP14/Objects/Economy/cp_coin.rsi
@@ -9,7 +9,7 @@
- type: stack
id: CP14SilverCoin
name: silver sovereign
name: cp14-stack-silver-coin
spawn: CP14SilverCoin1
icon:
sprite: /Textures/_CP14/Objects/Economy/sp_coin.rsi
@@ -18,7 +18,7 @@
- type: stack
id: CP14GoldCoin
name: gold galifar
name: cp14-stack-gold-coin
spawn: CP14GoldCoin1
icon:
sprite: /Textures/_CP14/Objects/Economy/gp_coin.rsi
@@ -27,7 +27,7 @@
- type: stack
id: CP14PlatinumCoin
name: platinum dragon
name: cp14-stack-platinum-coin
spawn: CP14PlatinumCoin1
icon:
sprite: /Textures/_CP14/Objects/Economy/pp_coin.rsi

View File

@@ -1,48 +1,48 @@
- type: stack
id: CP14Dirt
name: dirt block
name: cp14-stack-dirt-block
spawn: CP14DirtBlock1
icon: { sprite: _CP14/Objects/Materials/dirt_block.rsi, state: dirt_2 }
maxCount: 10
- type: stack
id: CP14Stone
name: stone block
name: cp14-stack-stone-block
spawn: CP14StoneBlock1
icon: { sprite: _CP14/Objects/Materials/stone_block.rsi, state: stone_2 }
maxCount: 10
- type: stack
id: CP14WoodenPlanks
name: wooden planks
name: cp14-stack-wood-planks
spawn: CP14WoodenPlanks1
icon: { sprite: _CP14/Objects/Materials/wood.rsi, state: planks_2 }
maxCount: 10
- type: stack
id: CP14Nail
name: nails
name: cp14-stack-nails
spawn: CP14Nail1
icon: { sprite: _CP14/Objects/Materials/nails.rsi, state: nail_2 }
maxCount: 10
- type: stack
id: CP14CopperBar
name: copper bars
name: cp14-stack-copper-bars
spawn: CP14CopperBar1
icon: { sprite: _CP14/Objects/Materials/copper_bar.rsi, state: bar_2 }
maxCount: 10
- type: stack
id: CP14IronBar
name: iron bars
name: cp14-stack-iron-bars
spawn: CP14IronBar1
icon: { sprite: _CP14/Objects/Materials/iron_bar.rsi, state: bar_2 }
maxCount: 10
- type: stack
id: CP14GoldBar
name: gold bars
name: cp14-stack-gold-bars
spawn: CP14GoldBar1
icon: { sprite: _CP14/Objects/Materials/gold_bar.rsi, state: bar_2 }
maxCount: 10

View File

@@ -6,3 +6,7 @@
- type: lobbyBackground
id: TypicalAlchemistDay
background: /Textures/_CP14/LobbyScreens/typicalAlchemistDay.webp
- type: lobbyBackground
id: Tiefling
background: /Textures/_CP14/LobbyScreens/tiefling.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

View File

@@ -24,6 +24,9 @@
},
{
"name": "berill_stone_small"
},
{
"name": "citrine_stone_small"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 375 B

View File

@@ -5,7 +5,7 @@
"y": 32
},
"license": "All rights reserved for the CrystallPunk14 project only",
"copyright": "Created by TheShuEd",
"copyright": "Created by .kreks.",
"states": [
{
"name": "cure_wounds"
@@ -33,6 +33,12 @@
},
{
"name": "earth_wall"
},
{
"name": "sphere_of_light"
},
{
"name": "flash_light"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

View File

@@ -0,0 +1,22 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "All rights reserved for the CrystallPunk14 project only",
"copyright": "Created by Nimfar11 for CrystallPunk",
"states": [
{
"name": "icon",
"delays": [
[
0.2,
0.2,
0.2,
0.2
]
]
}
]
}

View File

@@ -1,4 +1,4 @@
- files: ["beginning.webp", "typicalAlchemistDay.webp"]
- files: ["beginning.webp", "typicalAlchemistDay.webp", "tiefling.webp"]
license: "All rights reserved for the CrystallPunk14 project only"
copyright: "alisw_a on discord"
source: "https://github.com/crystallpunk-14/crystall-punk-14"

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

View File

@@ -0,0 +1,2 @@
sample:
filter: true

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

View File

@@ -0,0 +1,20 @@
{
"version": 1,
"license": "All rights reserved for the CrystallPunk14 project only",
"copyright": "Created by Jaraten(Github/Discord)",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "grass_material1"
},
{
"name": "grass_material2"
},
{
"name": "grass_material3"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 988 B

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -0,0 +1,46 @@
{
"version": 1,
"size": {
"x": 32,
"y": 64
},
"license": "All rights reserved for the CrystallPunk14 project only",
"copyright": "Created by TheShuEd (Discord) for CrystallPunk14",
"states": [
{
"name": "wall0",
"directions": 4
},
{
"name": "wall1",
"directions": 4
},
{
"name": "wall2",
"directions": 4
},
{
"name": "wall3",
"directions": 4
},
{
"name": "wall4",
"directions": 4
},
{
"name": "wall5",
"directions": 4
},
{
"name": "wall6",
"directions": 4
},
{
"name": "wall7",
"directions": 4
},
{
"name": "full"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Some files were not shown because too many files have changed in this diff Show More