From 493cbca3511d014fdec41fb3713b6d77b38806e8 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 23 Jan 2023 14:21:31 +0700 Subject: [PATCH] a --- .../kstarbound/defs/item/HarvestingToolDefinition.kt | 4 ++++ .../kstarbound/defs/item/HarvestingToolPrototype.kt | 5 +++++ .../kstarbound/defs/item/IHarvestingToolDefinition.kt | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolDefinition.kt index df9a324e..445ededd 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolDefinition.kt @@ -3,6 +3,7 @@ package ru.dbotthepony.kstarbound.defs.item import com.google.common.collect.ImmutableList import ru.dbotthepony.kstarbound.defs.IThingWithDescription import ru.dbotthepony.kstarbound.defs.ThingDescription +import ru.dbotthepony.kvector.vector.ndouble.Vector2d data class HarvestingToolDefinition( override val itemName: String, @@ -28,6 +29,9 @@ data class HarvestingToolDefinition( override val idleSound: ImmutableList, override val strikeSounds: ImmutableList, + override val handPosition: Vector2d, + override val fireTime: Double, + val descriptionData: ThingDescription, val json: Map diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolPrototype.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolPrototype.kt index 21739147..bbf477a2 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolPrototype.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/HarvestingToolPrototype.kt @@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableList import ru.dbotthepony.kstarbound.defs.util.enrollMap import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder import ru.dbotthepony.kstarbound.util.NotNullVar +import ru.dbotthepony.kvector.vector.ndouble.Vector2d @JsonBuilder class HarvestingToolPrototype : ItemPrototype(), IHarvestingToolDefinition { @@ -13,6 +14,8 @@ class HarvestingToolPrototype : ItemPrototype(), IHarvestingToolDefinition { override var altBlockRadius: Int = 0 override var idleSound: ImmutableList = ImmutableList.of() override var strikeSounds: ImmutableList = ImmutableList.of() + override var handPosition: Vector2d by NotNullVar() + override var fireTime: Double by NotNullVar() init { maxStack = 1L @@ -45,6 +48,8 @@ class HarvestingToolPrototype : ItemPrototype(), IHarvestingToolDefinition { altBlockRadius = altBlockRadius, idleSound = idleSound, strikeSounds = strikeSounds, + handPosition = handPosition, + fireTime = fireTime, ) } } diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IHarvestingToolDefinition.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IHarvestingToolDefinition.kt index cc1ad316..01c199e1 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IHarvestingToolDefinition.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/item/IHarvestingToolDefinition.kt @@ -1,6 +1,7 @@ package ru.dbotthepony.kstarbound.defs.item import ru.dbotthepony.kstarbound.defs.animation.IAnimated +import ru.dbotthepony.kvector.vector.ndouble.Vector2d interface IHarvestingToolDefinition : IItemDefinition, IAnimated { /** @@ -22,4 +23,14 @@ interface IHarvestingToolDefinition : IItemDefinition, IAnimated { * Звуки при работе */ val strikeSounds: List + + /** + * Позиция инструмента в руке (смещение в пикселях) + */ + val handPosition: Vector2d + + /** + * Время атаки + */ + val fireTime: Double }