This commit is contained in:
DBotThePony 2023-01-23 14:21:31 +07:00
parent 49e90a6dca
commit 493cbca351
Signed by: DBot
GPG Key ID: DCC23B5715498507
3 changed files with 20 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package ru.dbotthepony.kstarbound.defs.item
import com.google.common.collect.ImmutableList import com.google.common.collect.ImmutableList
import ru.dbotthepony.kstarbound.defs.IThingWithDescription import ru.dbotthepony.kstarbound.defs.IThingWithDescription
import ru.dbotthepony.kstarbound.defs.ThingDescription import ru.dbotthepony.kstarbound.defs.ThingDescription
import ru.dbotthepony.kvector.vector.ndouble.Vector2d
data class HarvestingToolDefinition( data class HarvestingToolDefinition(
override val itemName: String, override val itemName: String,
@ -28,6 +29,9 @@ data class HarvestingToolDefinition(
override val idleSound: ImmutableList<String>, override val idleSound: ImmutableList<String>,
override val strikeSounds: ImmutableList<String>, override val strikeSounds: ImmutableList<String>,
override val handPosition: Vector2d,
override val fireTime: Double,
val descriptionData: ThingDescription, val descriptionData: ThingDescription,
val json: Map<String, Any> val json: Map<String, Any>

View File

@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableList
import ru.dbotthepony.kstarbound.defs.util.enrollMap import ru.dbotthepony.kstarbound.defs.util.enrollMap
import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder import ru.dbotthepony.kstarbound.io.json.builder.JsonBuilder
import ru.dbotthepony.kstarbound.util.NotNullVar import ru.dbotthepony.kstarbound.util.NotNullVar
import ru.dbotthepony.kvector.vector.ndouble.Vector2d
@JsonBuilder @JsonBuilder
class HarvestingToolPrototype : ItemPrototype(), IHarvestingToolDefinition { class HarvestingToolPrototype : ItemPrototype(), IHarvestingToolDefinition {
@ -13,6 +14,8 @@ class HarvestingToolPrototype : ItemPrototype(), IHarvestingToolDefinition {
override var altBlockRadius: Int = 0 override var altBlockRadius: Int = 0
override var idleSound: ImmutableList<String> = ImmutableList.of() override var idleSound: ImmutableList<String> = ImmutableList.of()
override var strikeSounds: ImmutableList<String> = ImmutableList.of() override var strikeSounds: ImmutableList<String> = ImmutableList.of()
override var handPosition: Vector2d by NotNullVar()
override var fireTime: Double by NotNullVar()
init { init {
maxStack = 1L maxStack = 1L
@ -45,6 +48,8 @@ class HarvestingToolPrototype : ItemPrototype(), IHarvestingToolDefinition {
altBlockRadius = altBlockRadius, altBlockRadius = altBlockRadius,
idleSound = idleSound, idleSound = idleSound,
strikeSounds = strikeSounds, strikeSounds = strikeSounds,
handPosition = handPosition,
fireTime = fireTime,
) )
} }
} }

View File

@ -1,6 +1,7 @@
package ru.dbotthepony.kstarbound.defs.item package ru.dbotthepony.kstarbound.defs.item
import ru.dbotthepony.kstarbound.defs.animation.IAnimated import ru.dbotthepony.kstarbound.defs.animation.IAnimated
import ru.dbotthepony.kvector.vector.ndouble.Vector2d
interface IHarvestingToolDefinition : IItemDefinition, IAnimated { interface IHarvestingToolDefinition : IItemDefinition, IAnimated {
/** /**
@ -22,4 +23,14 @@ interface IHarvestingToolDefinition : IItemDefinition, IAnimated {
* Звуки при работе * Звуки при работе
*/ */
val strikeSounds: List<String> val strikeSounds: List<String>
/**
* Позиция инструмента в руке (смещение в пикселях)
*/
val handPosition: Vector2d
/**
* Время атаки
*/
val fireTime: Double
} }