IScriptableItemDefinition
This commit is contained in:
parent
6fa7b2193e
commit
093cec575e
src/main/kotlin/ru/dbotthepony/kstarbound/defs/item
@ -15,6 +15,7 @@ data class ArmorItemDefinition(
|
|||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: List<String>,
|
override val pickupQuestTemplates: List<String>,
|
||||||
override val scripts: List<String>,
|
override val scripts: List<String>,
|
||||||
|
override val scriptDelta: Int,
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: ItemTooltipKind,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: List<String>,
|
override val radioMessagesOnPickup: List<String>,
|
||||||
|
@ -15,6 +15,9 @@ class ArmorItemPrototype : ItemPrototype(), IArmorItemDefinition {
|
|||||||
override var level: Double = 1.0
|
override var level: Double = 1.0
|
||||||
override var leveledStatusEffects: List<LeveledStatusEffect> = listOf()
|
override var leveledStatusEffects: List<LeveledStatusEffect> = listOf()
|
||||||
|
|
||||||
|
override var scripts: List<String> = listOf()
|
||||||
|
override var scriptDelta: Int = 1
|
||||||
|
|
||||||
override var armorType: ArmorPieceType by NotNullVar()
|
override var armorType: ArmorPieceType by NotNullVar()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@ -37,6 +40,7 @@ class ArmorItemPrototype : ItemPrototype(), IArmorItemDefinition {
|
|||||||
consumeOnPickup = consumeOnPickup,
|
consumeOnPickup = consumeOnPickup,
|
||||||
pickupQuestTemplates = pickupQuestTemplates,
|
pickupQuestTemplates = pickupQuestTemplates,
|
||||||
scripts = scripts,
|
scripts = scripts,
|
||||||
|
scriptDelta = scriptDelta,
|
||||||
tooltipKind = tooltipKind,
|
tooltipKind = tooltipKind,
|
||||||
twoHanded = twoHanded,
|
twoHanded = twoHanded,
|
||||||
radioMessagesOnPickup = radioMessagesOnPickup,
|
radioMessagesOnPickup = radioMessagesOnPickup,
|
||||||
@ -62,6 +66,8 @@ class ArmorItemPrototype : ItemPrototype(), IArmorItemDefinition {
|
|||||||
.auto(ArmorItemPrototype::femaleFrames)
|
.auto(ArmorItemPrototype::femaleFrames)
|
||||||
.auto(ArmorItemPrototype::level)
|
.auto(ArmorItemPrototype::level)
|
||||||
.autoList(ArmorItemPrototype::leveledStatusEffects)
|
.autoList(ArmorItemPrototype::leveledStatusEffects)
|
||||||
|
.autoList(ArmorItemPrototype::scripts)
|
||||||
|
.auto(ArmorItemPrototype::scriptDelta)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ data class CurrencyItemDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: List<String>,
|
override val pickupQuestTemplates: List<String>,
|
||||||
override val scripts: List<String>,
|
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: ItemTooltipKind,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: List<String>,
|
override val radioMessagesOnPickup: List<String>,
|
||||||
|
@ -32,7 +32,6 @@ class CurrencyItemPrototype : ItemPrototype(), ICurrencyItemDefinition {
|
|||||||
eventCategory = eventCategory,
|
eventCategory = eventCategory,
|
||||||
consumeOnPickup = consumeOnPickup,
|
consumeOnPickup = consumeOnPickup,
|
||||||
pickupQuestTemplates = pickupQuestTemplates,
|
pickupQuestTemplates = pickupQuestTemplates,
|
||||||
scripts = scripts,
|
|
||||||
tooltipKind = tooltipKind,
|
tooltipKind = tooltipKind,
|
||||||
twoHanded = twoHanded,
|
twoHanded = twoHanded,
|
||||||
radioMessagesOnPickup = radioMessagesOnPickup,
|
radioMessagesOnPickup = radioMessagesOnPickup,
|
||||||
|
@ -4,7 +4,7 @@ import ru.dbotthepony.kstarbound.Starbound
|
|||||||
import ru.dbotthepony.kstarbound.io.json.FactoryAdapter
|
import ru.dbotthepony.kstarbound.io.json.FactoryAdapter
|
||||||
import ru.dbotthepony.kstarbound.io.json.ifString
|
import ru.dbotthepony.kstarbound.io.json.ifString
|
||||||
|
|
||||||
interface IArmorItemDefinition : ILeveledItemDefinition {
|
interface IArmorItemDefinition : ILeveledItemDefinition, IScriptableItemDefinition {
|
||||||
/**
|
/**
|
||||||
* @see ArmorPieceType
|
* @see ArmorPieceType
|
||||||
*/
|
*/
|
||||||
|
@ -78,11 +78,6 @@ interface IItemDefinition : IThingWithDescription {
|
|||||||
*/
|
*/
|
||||||
val pickupQuestTemplates: List<String>
|
val pickupQuestTemplates: List<String>
|
||||||
|
|
||||||
/**
|
|
||||||
* Lua скрипты для выполнения
|
|
||||||
*/
|
|
||||||
val scripts: List<String>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* это где либо ещё применяется кроме брони?
|
* это где либо ещё применяется кроме брони?
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package ru.dbotthepony.kstarbound.defs.item
|
||||||
|
|
||||||
|
interface IScriptableItemDefinition : IItemDefinition {
|
||||||
|
/**
|
||||||
|
* Lua скрипты для выполнения
|
||||||
|
*/
|
||||||
|
val scripts: List<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Через какое количество тиков вызывать обновления скриптов
|
||||||
|
*/
|
||||||
|
val scriptDelta: Int
|
||||||
|
}
|
@ -14,7 +14,6 @@ data class ItemDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: List<String>,
|
override val pickupQuestTemplates: List<String>,
|
||||||
override val scripts: List<String>,
|
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: ItemTooltipKind,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: List<String>,
|
override val radioMessagesOnPickup: List<String>,
|
||||||
|
@ -19,7 +19,6 @@ open class ItemPrototype : IItemDefinition, INativeJsonHolder {
|
|||||||
final override var eventCategory: String? = null
|
final override var eventCategory: String? = null
|
||||||
final override var consumeOnPickup: Boolean = false
|
final override var consumeOnPickup: Boolean = false
|
||||||
final override var pickupQuestTemplates: List<String> = listOf()
|
final override var pickupQuestTemplates: List<String> = listOf()
|
||||||
final override var scripts: List<String> = listOf()
|
|
||||||
final override var tooltipKind: ItemTooltipKind = ItemTooltipKind.NORMAL
|
final override var tooltipKind: ItemTooltipKind = ItemTooltipKind.NORMAL
|
||||||
final override var twoHanded: Boolean = false
|
final override var twoHanded: Boolean = false
|
||||||
final override var radioMessagesOnPickup: List<String> = listOf()
|
final override var radioMessagesOnPickup: List<String> = listOf()
|
||||||
@ -46,7 +45,6 @@ open class ItemPrototype : IItemDefinition, INativeJsonHolder {
|
|||||||
eventCategory = eventCategory,
|
eventCategory = eventCategory,
|
||||||
consumeOnPickup = consumeOnPickup,
|
consumeOnPickup = consumeOnPickup,
|
||||||
pickupQuestTemplates = pickupQuestTemplates,
|
pickupQuestTemplates = pickupQuestTemplates,
|
||||||
scripts = scripts,
|
|
||||||
tooltipKind = tooltipKind,
|
tooltipKind = tooltipKind,
|
||||||
twoHanded = twoHanded,
|
twoHanded = twoHanded,
|
||||||
radioMessagesOnPickup = radioMessagesOnPickup,
|
radioMessagesOnPickup = radioMessagesOnPickup,
|
||||||
@ -76,7 +74,6 @@ open class ItemPrototype : IItemDefinition, INativeJsonHolder {
|
|||||||
auto(ItemPrototype::eventCategory)
|
auto(ItemPrototype::eventCategory)
|
||||||
auto(ItemPrototype::consumeOnPickup)
|
auto(ItemPrototype::consumeOnPickup)
|
||||||
autoList(ItemPrototype::pickupQuestTemplates)
|
autoList(ItemPrototype::pickupQuestTemplates)
|
||||||
autoList(ItemPrototype::scripts)
|
|
||||||
auto(ItemPrototype::tooltipKind)
|
auto(ItemPrototype::tooltipKind)
|
||||||
auto(ItemPrototype::twoHanded)
|
auto(ItemPrototype::twoHanded)
|
||||||
autoList(ItemPrototype::radioMessagesOnPickup)
|
autoList(ItemPrototype::radioMessagesOnPickup)
|
||||||
|
@ -16,7 +16,6 @@ data class LiquidItemDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: List<String>,
|
override val pickupQuestTemplates: List<String>,
|
||||||
override val scripts: List<String>,
|
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: ItemTooltipKind,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: List<String>,
|
override val radioMessagesOnPickup: List<String>,
|
||||||
|
@ -33,7 +33,6 @@ class LiquidItemPrototype : ItemPrototype() {
|
|||||||
eventCategory = eventCategory,
|
eventCategory = eventCategory,
|
||||||
consumeOnPickup = consumeOnPickup,
|
consumeOnPickup = consumeOnPickup,
|
||||||
pickupQuestTemplates = pickupQuestTemplates,
|
pickupQuestTemplates = pickupQuestTemplates,
|
||||||
scripts = scripts,
|
|
||||||
tooltipKind = tooltipKind,
|
tooltipKind = tooltipKind,
|
||||||
twoHanded = twoHanded,
|
twoHanded = twoHanded,
|
||||||
radioMessagesOnPickup = radioMessagesOnPickup,
|
radioMessagesOnPickup = radioMessagesOnPickup,
|
||||||
|
@ -16,7 +16,6 @@ data class MaterialItemDefinition(
|
|||||||
override val eventCategory: String?,
|
override val eventCategory: String?,
|
||||||
override val consumeOnPickup: Boolean,
|
override val consumeOnPickup: Boolean,
|
||||||
override val pickupQuestTemplates: List<String>,
|
override val pickupQuestTemplates: List<String>,
|
||||||
override val scripts: List<String>,
|
|
||||||
override val tooltipKind: ItemTooltipKind,
|
override val tooltipKind: ItemTooltipKind,
|
||||||
override val twoHanded: Boolean,
|
override val twoHanded: Boolean,
|
||||||
override val radioMessagesOnPickup: List<String>,
|
override val radioMessagesOnPickup: List<String>,
|
||||||
|
@ -33,7 +33,6 @@ class MaterialItemPrototype : ItemPrototype() {
|
|||||||
eventCategory = eventCategory,
|
eventCategory = eventCategory,
|
||||||
consumeOnPickup = consumeOnPickup,
|
consumeOnPickup = consumeOnPickup,
|
||||||
pickupQuestTemplates = pickupQuestTemplates,
|
pickupQuestTemplates = pickupQuestTemplates,
|
||||||
scripts = scripts,
|
|
||||||
tooltipKind = tooltipKind,
|
tooltipKind = tooltipKind,
|
||||||
twoHanded = twoHanded,
|
twoHanded = twoHanded,
|
||||||
radioMessagesOnPickup = radioMessagesOnPickup,
|
radioMessagesOnPickup = radioMessagesOnPickup,
|
||||||
|
Loading…
Reference in New Issue
Block a user