Hoe dirt preparing (#1135)

* seedbed returns

* modular hoe!

* hoe gameplay

* remove onion seeds
This commit is contained in:
Ed
2025-04-05 01:00:39 +03:00
committed by GitHub
parent d5e54ce744
commit e308eec703
57 changed files with 443 additions and 105 deletions

View File

@@ -170,7 +170,7 @@ public sealed class FloorTileSystem : EntitySystem
return tileDef.BaseTurf == baseTurf;
}
private void PlaceAt(EntityUid user, EntityUid gridUid, MapGridComponent mapGrid, EntityCoordinates location,
public void PlaceAt(EntityUid user, EntityUid gridUid, MapGridComponent mapGrid, EntityCoordinates location,
ushort tileId, SoundSpecifier placeSound, float offset = 0)
{
_adminLogger.Add(LogType.Tile, LogImpact.Low, $"{ToPrettyString(user):actor} placed tile {_tileDefinitionManager[tileId].Name} at {ToPrettyString(gridUid)} {location}");

View File

@@ -16,5 +16,5 @@ public sealed partial class CP14SeedComponent : Component
public EntProtoId PlantProto;
[DataField]
public HashSet<ProtoId<ContentTileDefinition>> SoilTile = new() { "CP14FloorDirt" };
public HashSet<ProtoId<ContentTileDefinition>> SoilTile = new() { "CP14FloorDirtSeedbed" };
}

View File

@@ -0,0 +1,35 @@
using Content.Shared.DoAfter;
using Content.Shared.Maps;
using Robust.Shared.Audio;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared._CP14.TileEditTool;
[RegisterComponent, Access(typeof(CP14EditTileToolSystem))]
public sealed partial class CP14EditTileToolComponent : Component
{
[DataField]
public TimeSpan Delay = TimeSpan.FromSeconds(1f);
[DataField]
public SoundSpecifier? Sound;
[DataField]
public Dictionary<ProtoId<ContentTileDefinition>, ProtoId<ContentTileDefinition>> TileReplace = new();
}
[Serializable, NetSerializable]
public sealed partial class CP14TileToolReplaceDoAfter : DoAfterEvent
{
[DataField(required:true)]
public NetCoordinates Coordinates;
public CP14TileToolReplaceDoAfter(NetCoordinates coordinates)
{
Coordinates = coordinates;
}
public override DoAfterEvent Clone() => this;
}

View File

@@ -0,0 +1,72 @@
using Content.Shared.DoAfter;
using Content.Shared.Interaction;
using Content.Shared.Maps;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.TileEditTool;
public sealed class CP14EditTileToolSystem : EntitySystem
{
[Dependency] private readonly SharedMapSystem _map = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CP14EditTileToolComponent, AfterInteractEvent>(OnTileClick);
SubscribeLocalEvent<CP14EditTileToolComponent, CP14TileToolReplaceDoAfter>(OnDoAfterEnd);
}
private void OnTileClick(Entity<CP14EditTileToolComponent> ent, ref AfterInteractEvent args)
{
if (args.Handled || !args.CanReach)
return;
var doAfterArgs =
new DoAfterArgs(EntityManager,
args.User,
ent.Comp.Delay,
new CP14TileToolReplaceDoAfter(GetNetCoordinates(args.ClickLocation)),
ent)
{
BreakOnDamage = true,
BlockDuplicate = false,
BreakOnMove = true,
BreakOnHandChange = true,
};
_doAfter.TryStartDoAfter(doAfterArgs);
}
private void OnDoAfterEnd(Entity<CP14EditTileToolComponent> ent, ref CP14TileToolReplaceDoAfter args)
{
if (args.Cancelled || args.Handled)
return;
var location = GetCoordinates(args.Coordinates);
var map = _transform.GetMap(location);
if (!TryComp<MapGridComponent>(map, out var gridComp))
return;
var tileRef = location.GetTileRef();
if (tileRef is null)
return;
var tile = tileRef.Value.Tile.GetContentTileDefinition();
if (!ent.Comp.TileReplace.TryGetValue(tile, out var replaceTile))
return;
args.Handled = true;
_map.SetTile((map.Value, gridComp), location, new Tile(_proto.Index(replaceTile).TileId));
_audio.PlayPredicted(ent.Comp.Sound, location, args.User);
}
}

View File

@@ -13,6 +13,7 @@ cp14-tiles-snow-deep-deep = deep deep snow
# Produced
cp14-tiles-foundation = foundation
cp14-tiles-dirt-seedbed = dirt seedbed
cp14-tiles-red-woodplanks = red woodplanks
cp14-tiles-red-woodplanks-big = big red planks

View File

@@ -13,6 +13,7 @@ cp14-tiles-snow-deep-deep = очень глубокий снег
# Produced
cp14-tiles-foundation = фундамент
cp14-tiles-dirt-seedbed = земляная грядка
cp14-tiles-red-woodplanks = красные доски
cp14-tiles-red-woodplanks-big = большие красные доски

View File

@@ -27,8 +27,6 @@
amount: 3
- id: CP14SeedTomato
amount: 3
- id: CP14SeedOnion
amount: 3
- id: CP14SeedPepper
amount: 3

View File

@@ -22,6 +22,9 @@
tags:
- HideContextMenu
- type: AnimationPlayer
- type: EmitSoundOnSpawn
sound:
collection: CP14Digging
- type: entity
id: CP14SnowEffect

View File

@@ -9,9 +9,6 @@
- CP14DirtBlock1
chance: 1
deleteSpawnerAfterSpawn: false
- type: EmitSoundOnSpawn
sound:
collection: CP14Digging
- type: entity
id: CP14RandomSnowLootSpawner

View File

@@ -459,6 +459,8 @@
Quantity: 4
- ReagentId: Allicin
Quantity: 3
- type: CP14Seed
plantProto: CP14PlantOnion
- type: Tag
tags:
- CP14FarmFood

View File

@@ -0,0 +1,79 @@
- type: entity
parent: BaseItem
id: CP14ModularBladeHoeBase
categories: [ ForkFiltered ]
abstract: true
description: A hoe blade without a hilt. A blacksmith can use it as a spare part to create a tool.
components:
- type: Item
storedRotation: 45
shape:
- 0,0,0,0
storedOffset: 0, 5
- type: entity
parent: CP14ModularBladeHoeBase
id: CP14ModularBladeIronHoe
name: iron hoe blade
components:
- type: Sprite
sprite: _CP14/Objects/ModularTools/Blade/Hoe/metall_hoe.rsi
layers:
- state: icon
- type: CP14ModularCraftPart
possibleParts:
- BladeIronHoe
- type: CP14Material
materials:
CP14Iron: 10
- type: entity
parent: CP14ModularBladeHoeBase
id: CP14ModularBladeCopperHoe
name: copper hoe blade
components:
- type: Sprite
sprite: _CP14/Objects/ModularTools/Blade/Hoe/metall_hoe.rsi
layers:
- state: icon
color: "#ffaf47"
- type: CP14ModularCraftPart
possibleParts:
- BladeCopperHoe
- type: CP14Material
materials:
CP14Copper: 10
- type: entity
parent: CP14ModularBladeHoeBase
id: CP14ModularBladeGoldHoe
name: golden hoe blade
components:
- type: Sprite
sprite: _CP14/Objects/ModularTools/Blade/Hoe/metall_hoe.rsi
layers:
- state: icon
color: "#bd712f"
- type: CP14ModularCraftPart
possibleParts:
- BladeGoldHoe
- type: CP14Material
materials:
CP14Gold: 10
- type: entity
parent: CP14ModularBladeSickleBase
id: CP14ModularBladeMithrilHoe
name: mithril hoe blade
components:
- type: Sprite
sprite: _CP14/Objects/ModularTools/Blade/Hoe/metall_hoe.rsi
layers:
- state: icon
color: "#45d2a4"
- type: CP14ModularCraftPart
possibleParts:
- BladeMithrilHoe
- type: CP14Material
materials:
CP14Mithril: 10

View File

@@ -75,19 +75,6 @@
- type: CP14Seed
plantProto: CP14PlantTomatoes
- type: entity
id: CP14SeedOnion
name: onion seeds
description: Onion seeds, small but strong.
parent: CP14BaseSeed
components:
- type: Sprite
layers:
- state: bag
- state: onion
- type: CP14Seed
plantProto: CP14PlantOnion
- type: entity
id: CP14SeedPepper
name: pepper seeds

View File

@@ -1,24 +0,0 @@
- type: entity
id: CP14BaseHoe
parent:
- BaseItem
- CP14BaseWeaponDestructible
- CP14BaseWeaponSelfDamage
- CP14BaseWeaponLight
name: hoe
description: A gardening tool to prepare the soil for planting, or to clear weeds
components:
- type: Sprite
sprite: _CP14/Objects/Weapons/Melee/Hoe/hoe.rsi
state: icon
- type: MeleeWeapon
wideAnimationRotation: 65
damage:
types:
Piercing: 4
Slash: 3
soundHit:
collection: MetalThud
- type: Item
size: Normal
sprite: _CP14/Objects/Weapons/Melee/Hoe/hoe.rsi

View File

@@ -0,0 +1,14 @@
- type: entity
id: CP14ModularIronHoe
parent: CP14ModularGripWooden
name: iron hoe
description: Hoe. Your perfect tool for tilling the ground and preparing it for gardening.
components:
- type: Sprite
layers:
- state: icon
- sprite: _CP14/Objects/ModularTools/Blade/Hoe/metall_hoe.rsi
state: icon
- type: CP14ModularCraftAutoAssemble
details:
- BladeIronHoe

View File

@@ -20,5 +20,5 @@
id: CP14GatherOnion
entries:
- id: CP14FoodOnion
amount: 1
maxAmount: 3
amount: 2
maxAmount: 4

View File

@@ -1,6 +1,6 @@
- type: entity
id: CP14PlantPepper
parent: CP14GatherablePlantSingleHarvestBase
parent: CP14GatherablePlantMultiHarvestBase
name: pepper
description: Russian roulette. Are you hot, or are you sweet peppers?
components:
@@ -22,5 +22,5 @@
id: CP14GatherPepper
entries:
- id: CP14FoodPepper
amount: 2
maxAmount: 4
amount: 1
maxAmount: 3

View File

@@ -13,7 +13,6 @@
sprite: _CP14/Structures/Flora/Farm/tomatoes.rsi
map: ["enum.PlantVisualLayers.Base"]
- type: CP14PlantGatherable
deleteAfterHarvest: false
loot:
All: CP14GatherTomatoes

View File

@@ -104,7 +104,7 @@
thresholds:
- trigger:
!type:DamageTrigger #Overkill
damage: 35
damage: 45
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
@@ -123,7 +123,7 @@
- trigger:
!type:DamageTypeTrigger #Heat
damageType: Heat
damage: 10
damage: 20
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
@@ -135,7 +135,7 @@
- trigger:
!type:DamageGroupTrigger #Brute
damageGroup: Brute
damage: 10
damage: 15
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]

View File

@@ -0,0 +1,96 @@
#Concept:
# Copy of dagger with bigger damage, but without throwing
- type: modularPart
id: BaseBladeHoe
modifiers:
- !type:Inherit
copyFrom:
- BaseWeaponChemical
- BaseWeaponThrowable
#components: TODO Add gathering tag
- !type:AddComponents
override: true
components:
- type: DamageOtherOnHit
damage:
types:
Piercing: 6
- type: ThrowingAngle
angle: 135
- type: EmbeddableProjectile
offset: -0.15,-0.15
removalTime: 0.5
- type: CP14EditTileTool
sound:
collection: CP14Digging
tileReplace:
CP14FloorDirt: CP14FloorDirtSeedbed
CP14FloorDirtSeedbed: CP14FloorDirt
- !type:EditMeleeWeapon
newWideAnimation: CP14WeaponArcThrust
attackRateMultiplier: 1.5
bonusDamage:
types:
Piercing: 6
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Piercing: 3
- !type:EditItem
newSize: Normal
adjustShape: 0, 1
storedOffsetBonus: 0, 5
- !type:EditModularSlots
addSlots:
- Garde
- type: modularPart
id: BladeIronHoe
slots:
- Blade
sourcePart: CP14ScrapIron
rsiPath: _CP14/Objects/ModularTools/Blade/Hoe/metall_hoe.rsi
modifiers:
- !type:Inherit
copyFrom:
- BaseBladeHoe
- BaseBladeIron
- type: modularPart
id: BladeGoldHoe
slots:
- Blade
sourcePart: CP14ScrapGold
rsiPath: _CP14/Objects/ModularTools/Blade/Hoe/metall_hoe.rsi
color: "#ffaf47"
modifiers:
- !type:Inherit
copyFrom:
- BaseBladeHoe
- BaseBladeGold
- type: modularPart
id: BladeCopperHoe
slots:
- Blade
sourcePart: CP14ScrapCopper
rsiPath: _CP14/Objects/ModularTools/Blade/Hoe/metall_hoe.rsi
color: "#bd712f"
modifiers:
- !type:Inherit
copyFrom:
- BaseBladeHoe
- BaseBladeCopper
- type: modularPart
id: BladeMithrilHoe
slots:
- Blade
sourcePart: CP14ScrapMithril
rsiPath: _CP14/Objects/ModularTools/Blade/Hoe/metall_hoe.rsi
color: "#45d2a4"
modifiers:
- !type:Inherit
copyFrom:
- BaseBladeHoe
- BaseBladeMithril

View File

@@ -29,6 +29,10 @@
bonusDamage:
types:
Piercing: 8
- !type:EditIncreaseDamageOnWield
bonusDamage:
types:
Piercing: 3
- !type:EditItem
newSize: Normal
adjustShape: 0, 1

View File

@@ -504,3 +504,44 @@
count: 2
result: CP14ModularBladeMithrilHammer
# Sickle
- type: CP14Recipe
id: CP14ModularBladeIronHoe
tag: CP14RecipeAnvil
craftTime: 2
requirements:
- !type:StackResource
stack: CP14IronBar
count: 1
result: CP14ModularBladeIronHoe
- type: CP14Recipe
id: CP14ModularBladeCopperHoe
tag: CP14RecipeAnvil
craftTime: 2
requirements:
- !type:StackResource
stack: CP14CopperBar
count: 1
result: CP14ModularBladeCopperHoe
- type: CP14Recipe
id: CP14ModularBladeGoldHoe
tag: CP14RecipeAnvil
craftTime: 2
requirements:
- !type:StackResource
stack: CP14GoldBar
count: 1
result: CP14ModularBladeGoldHoe
- type: CP14Recipe
id: CP14ModularBladeMithrilHoe
tag: CP14RecipeAnvil
craftTime: 2
requirements:
- !type:StackResource
stack: CP14MithrilBar
count: 1
result: CP14ModularBladeMithrilHoe

View File

@@ -51,17 +51,6 @@
count: 1
result: CP14SeedCucumber
- type: CP14Recipe
id: CP14SeedOnion
tag: CP14RecipeCooking
craftTime: 1
requirements:
- !type:ProtoIdResource
protoId: CP14FoodOnion
count: 1
result: CP14SeedOnion
resultCount: 2
- type: CP14Recipe
id: CP14SeedPepper
tag: CP14RecipeCooking

View File

@@ -190,3 +190,31 @@
collection: FootstepAsteroid
heatCapacity: 10000
weather: true
- type: tile
editorHidden: false
id: CP14FloorDirtSeedbed
name: cp14-tiles-dirt-seedbed
sprite: /Textures/_CP14/Tiles/DirtSeedBag/seedbed.png
variants: 2
placementVariants:
- 1.0
- 1.0
edgeSpritePriority: 100
edgeSprites:
SouthEast: /Textures/_CP14/Tiles/DirtSeedBag/single_edge_SE.png
NorthEast: /Textures/_CP14/Tiles/DirtSeedBag/single_edge_NE.png
NorthWest: /Textures/_CP14/Tiles/DirtSeedBag/single_edge_NW.png
SouthWest: /Textures/_CP14/Tiles/DirtSeedBag/single_edge_SW.png
South: /Textures/_CP14/Tiles/DirtSeedBag/double_edge_S.png
East: /Textures/_CP14/Tiles/DirtSeedBag/double_edge_E.png
North: /Textures/_CP14/Tiles/DirtSeedBag/double_edge_N.png
West: /Textures/_CP14/Tiles/DirtSeedBag/double_edge_W.png
baseTurf: CP14FloorDirt
deconstructTools: [ CP14Digging ]
itemDrop: CP14DirtEffect
isSubfloor: true
footstepSounds:
collection: FootstepAsteroid
heatCapacity: 10000
weather: true

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

View File

@@ -0,0 +1,42 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-4.0",
"copyright": "Created by TheShuEd (Github) ",
"states": [
{
"name": "equipped-BELT1",
"directions": 4
},
{
"name": "equipped-BELT2",
"directions": 4
},
{
"name": "equipped-NECK",
"directions": 4
},
{
"name": "icon"
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
},
{
"name": "wielded-inhand-left",
"directions": 4
},
{
"name": "wielded-inhand-right",
"directions": 4
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

View File

@@ -1,22 +0,0 @@
{
"version": 1,
"license": "CC-BY-SA-4.0",
"copyright": "Created by TheShuEd (Github)",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 600 B

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 962 B

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 B

After

Width:  |  Height:  |  Size: 922 B

View File

@@ -1,27 +1,12 @@
{
"version": 1,
"license": "All right reserved",
"copyright": "Created by Jaraten(Discord/Github)",
"copyright": "Created by TheShuEd",
"size": {
"x": 35,
"y": 35
"x": 32,
"y": 32
},
"states": [
{
"name": "seedbed_default"
},
{
"name": "seedbed_default_east"
},
{
"name": "seedbed_default_west"
},
{
"name": "seedbed_default_north"
},
{
"name": "seedbed_default_south"
},
{
"name": "liq-1"
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

View File

@@ -0,0 +1,9 @@
- files: ["seedbed.png"]
license: "All right reserved"
copyright: "Created by Jaraten"
source: "https://github.com/crystallpunk-14/crystall-punk-14/"
- files: ["double_edge.png", "single_edge.png"]
license: "All right reserved"
copyright: "Created by Jaraten"
source: "https://github.com/crystallpunk-14/crystall-punk-14/"

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

View File

@@ -322,6 +322,8 @@ CP14PlantPotatoDeath: CP14PlantPotato
CP14PlantPumpkinDeath: CP14PlantPumpkin
CP14PlantTomatoesDeath: CP14PlantTomatoes
CP14PlantWheatDeath: CP14PlantWheat
CP14BaseHoe: CP14ModularIronHoe
CP14PlantOnion: null
# <---> CrystallEdge migration zone end