Alchemy instruments (#122)

* add beer barrel

* add vet

* add storage to vat

* make bucket viable!

* bandage vat item fix

* Update vat.yml

* add small vial

* tiny vial

* Update SharedStorageSystem.cs

* Create biological.yml

* spilable and bonfire climbing
This commit is contained in:
Ed
2024-04-30 16:48:08 +03:00
committed by GitHub
parent 743c732162
commit 0169cb55d8
33 changed files with 414 additions and 21 deletions

View File

@@ -32,7 +32,7 @@ public sealed class InjectorStatusControl : Control
{
base.FrameUpdate(args);
if (!_solutionContainers.TryGetSolution(_parent.Owner, InjectorComponent.SolutionName, out _, out var solution))
if (!_solutionContainers.TryGetSolution(_parent.Owner, _parent.Comp.SolutionName, out _, out var solution))
return;
// only updates the UI if any of the details are different than they previously were

View File

@@ -124,7 +124,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
Popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, user);
}
if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out _, out var solution))
if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out _, out var solution))
return;
var actualDelay = MathHelper.Max(injector.Comp.Delay, TimeSpan.FromSeconds(1));
@@ -254,7 +254,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
private void TryInject(Entity<InjectorComponent> injector, EntityUid targetEntity,
Entity<SolutionComponent> targetSolution, EntityUid user, bool asRefill)
{
if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out var soln,
if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out var soln,
out var solution) || solution.Volume == 0)
return;
@@ -296,7 +296,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
private void AfterInject(Entity<InjectorComponent> injector, EntityUid target)
{
// Automatically set syringe to draw after completely draining it.
if (SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out _,
if (SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out _,
out var solution) && solution.Volume == 0)
{
SetMode(injector, InjectorToggleMode.Draw);
@@ -310,7 +310,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
private void AfterDraw(Entity<InjectorComponent> injector, EntityUid target)
{
// Automatically set syringe to inject after completely filling it.
if (SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out _,
if (SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out _,
out var solution) && solution.AvailableVolume == 0)
{
SetMode(injector, InjectorToggleMode.Inject);
@@ -324,7 +324,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
private void TryDraw(Entity<InjectorComponent> injector, Entity<BloodstreamComponent?> target,
Entity<SolutionComponent> targetSolution, EntityUid user)
{
if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out var soln,
if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out var soln,
out var solution) || solution.AvailableVolume == 0)
{
return;

View File

@@ -24,7 +24,8 @@ public sealed partial class InjectorDoAfterEvent : SimpleDoAfterEvent
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class InjectorComponent : Component
{
public const string SolutionName = "injector";
[DataField]
public string SolutionName = "injector";
/// <summary>
/// Whether or not the injector is able to draw from containers or if it's a single use

View File

@@ -113,7 +113,7 @@ public abstract class SharedInjectorSystem : EntitySystem
if (injector.Comp.InjectOnly)
return;
if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out var solEnt, out var solution))
if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out var solEnt, out var solution))
return;
string msg;

View File

@@ -0,0 +1,137 @@
- type: entity
parent: BaseItem
id: CP14BaseVial
abstract: true
components:
- type: MeleeWeapon
soundNoDamage:
path: "/Audio/Effects/Fluids/splat.ogg"
damage:
types:
Blunt: 0
- type: SolutionContainerManager
solutions:
vial:
maxVol: 1
- type: MixableSolution
solution: vial
- type: FitsInDispenser
solution: vial
- type: RefillableSolution
solution: vial
- type: DrainableSolution
solution: vial
- type: ExaminableSolution
solution: vial
- type: DrawableSolution
solution: vial
- type: InjectableSolution
solution: vial
- type: SolutionItemStatus
solution: vial
- type: UserInterface
interfaces:
enum.TransferAmountUiKey.Key:
type: TransferAmountBoundUserInterface
- type: Drink
solution: vial
- type: Appearance
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Glass
- type: Injector
solutionName: vial
injectOnly: false
ignoreMobs: true
minTransferAmount: 1
maxTransferAmount: 10
transferAmount: 1
toggleState: 1 # draw
- type: entity
parent: CP14BaseVial
id: CP14BaseVialFragile
abstract: true
components:
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 5
behaviors:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
params:
volume: -4
- !type:SpillBehavior
solution: vial
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
min: 1
max: 1
transferForensics: true
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: DamageOnLand
damage:
types:
Blunt: 10 # glass resistance set reduces damage. Need to land twice (w/o hitting wall)
- type: DamageOtherOnHit
damage:
types:
Blunt: 5
- type: DamageOnHighSpeedImpact
minimumSpeed: 2
damage:
types:
Blunt: 5
- type: entity
id: CP14VialTiny
parent: CP14BaseVial
name: tiny vial
description: A sturdy glass vial to hold a tiny amount of liquid.
components:
- type: Sprite
sprite: _CP14/Objects/Specific/Alchemy/vial_tiny.rsi
layers:
- state: vial
- state: liq-1
map: ["enum.SolutionContainerLayers.Fill"]
visible: false
- type: Item
size: Tiny
sprite: _CP14/Objects/Specific/Alchemy/vial_tiny.rsi
- type: SolutionContainerManager
solutions:
vial:
maxVol: 5
- type: SolutionContainerVisuals
maxFillLevels: 5
fillBaseName: liq-
- type: entity
id: CP14VialSmall
parent: CP14BaseVialFragile
name: small vial
description: A fragile glass vial to hold a small amount of liquid.
components:
- type: Sprite
sprite: _CP14/Objects/Specific/Alchemy/vial_small.rsi
layers:
- state: vial
- state: liq-1
map: ["enum.SolutionContainerLayers.Fill"]
visible: false
- type: Item
size: Tiny
sprite: _CP14/Objects/Specific/Alchemy/vial_small.rsi
- type: SolutionContainerManager
solutions:
vial:
maxVol: 10
- type: SolutionContainerVisuals
maxFillLevels: 5
fillBaseName: liq-

View File

@@ -0,0 +1,61 @@
- type: entity
parent: BaseItem
id: CP14Bucket
name: bucket
description: It's a boring old bucket.
suffix: CP14
components:
- type: Drink
solution: bucket
ignoreEmpty: true
- type: Clickable
- type: Sprite
sprite: Objects/Tools/bucket.rsi
layers:
- state: icon
- map: ["enum.SolutionContainerLayers.Fill"]
state: fill-1
visible: false
- type: Item
size: Normal
- type: SolutionContainerManager
solutions:
bucket:
maxVol: 50
- type: Injector
solutionName: bucket
injectOnly: false
ignoreMobs: true
minTransferAmount: 1
maxTransferAmount: 50
transferAmount: 50
toggleState: 1 # draw
- type: UserInterface
interfaces:
enum.TransferAmountUiKey.Key:
type: TransferAmountBoundUserInterface
- type: MeleeWeapon
soundNoDamage:
path: "/Audio/Effects/Fluids/splat.ogg"
damage:
types:
Blunt: 0
- type: Spillable
solution: bucket
- type: RefillableSolution
solution: bucket
- type: SolutionItemStatus
solution: bucket
- type: MixableSolution
solution: bucket
- type: DrainableSolution
solution: bucket
- type: Appearance
- type: SolutionContainerVisuals
maxFillLevels: 3
fillBaseName: fill-
- type: ExaminableSolution
solution: bucket
- type: Tag
tags:
- Bucket

View File

@@ -77,20 +77,22 @@
- type: SolutionContainerVisuals
maxFillLevels: 7
fillBaseName: liq
- type: Spillable
solution: barrel
- type: DrainableSolution
solution: barrel
- type: ExaminableSolution
solution: barrel
- type: InjectableSolution
- type: MixableSolution
solution: barrel
- type: RefillableSolution
solution: barrel
- type: DrawableSolution
solution: barrel
- type: DumpableSolution
solution: barrel
- type: Drink
solution: barrel
- type: SolutionTransfer
canChangeTransferAmount: true
- type: UserInterface
interfaces:
enum.TransferAmountUiKey.Key:
type: TransferAmountBoundUserInterface
- type: entity
id: CP14BarrelWater
@@ -102,4 +104,16 @@
barrel:
reagents:
- ReagentId: Water
Quantity: 300
- type: entity
id: CP14BarrelBeer
parent: CP14BaseBarrel
suffix: Beer
components:
- type: SolutionContainerManager
solutions:
barrel:
reagents:
- ReagentId: Beer
Quantity: 300

View File

@@ -17,14 +17,12 @@
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.08,-0.35,0.15,0.25"
bounds: "-0.45,-0.45,0.45,0.45"
density: 55
mask:
- TabletopMachineMask
- TableMask
layer:
- Impassable
- MidImpassable
- LowImpassable
hard: true
- TableLayer
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Wood
@@ -76,3 +74,4 @@
components:
- Temperature
- type: CP14FlammableEntityHeater
- type: Climbable

View File

@@ -0,0 +1,88 @@
- type: entity
id: CP14BaseVat
parent:
- BaseStructureDynamic
name: vat
description: VATVATVAT
placement:
mode: PlaceFree
components:
- type: Climbing
- type: Transform
noRot: true
- type: InteractionOutline
- type: Physics
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.3,-0.3,0.3,0.3"
density: 155
mask:
- MachineMask
layer:
- WallLayer
- type: Damageable
damageContainer: Inorganic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 50
behaviors:
- !type:SpillBehavior
solution: vat
- !type:PlaySoundBehavior
sound:
collection: MetalBreak
- !type:DoActsBehavior
acts: ["Destruction"]
- type: Appearance
- type: Sprite
drawdepth: Mobs
sprite: _CP14/Structures/Specific/Alchemy/alchemy_vat.rsi
noRot: true
layers:
- state: full
- state: liq1
map: ["enum.SolutionContainerLayers.Fill"]
visible: false
- type: SolutionContainerManager
solutions:
vat:
maxVol: 500
- type: SolutionContainerVisuals
maxFillLevels: 6
fillBaseName: liq
- type: DrainableSolution
solution: vat
- type: ExaminableSolution
solution: vat
- type: MixableSolution
solution: vat
- type: RefillableSolution
solution: vat
- type: DrawableSolution
solution: vat
- type: DumpableSolution
solution: vat
- type: Spillable
solution: vat
- type: Drink
solution: vat
- type: UserInterface
interfaces:
enum.StorageUiKey.Key:
type: StorageBoundUserInterface
- type: ContainerContainer
containers:
storagebase: !type:Container
- type: ThrowInsertContainer
containerId: storagebase
- type: Storage
grid:
- 0,0,4,3
blacklist:
components:
- SolutionContainerManager

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

View File

@@ -0,0 +1,29 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Created by TheShuEd (Github) for CrystallPunk14",
"states": [
{
"name": "vial"
},
{
"name": "liq-1"
},
{
"name": "liq-2"
},
{
"name": "liq-3"
},
{
"name": "liq-4"
},
{
"name": "liq-5"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

View File

@@ -0,0 +1,29 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Created by TheShuEd (Github) for CrystallPunk14",
"states": [
{
"name": "vial"
},
{
"name": "liq-1"
},
{
"name": "liq-2"
},
{
"name": "liq-3"
},
{
"name": "liq-4"
},
{
"name": "liq-5"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

View File

@@ -0,0 +1,35 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Created by Jaraten",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "full"
},
{
"name": "liq0"
},
{
"name": "liq1"
},
{
"name": "liq2"
},
{
"name": "liq3"
},
{
"name": "liq4"
},
{
"name": "liq5"
},
{
"name": "liq6"
}
]
}