Возвращаем rarity, fuel и category ибо они нужны движку
This commit is contained in:
parent
d6ac6d86bb
commit
005aa354df
@ -18,6 +18,11 @@ interface IItemDefinition : IThingWithDescription {
|
||||
*/
|
||||
val price: Long
|
||||
|
||||
/**
|
||||
* Редкость предмета
|
||||
*/
|
||||
val rarity: ItemRarity
|
||||
|
||||
/**
|
||||
* Категория предмета, определяет, в какую вкладку инвентаря оно попадает
|
||||
*/
|
||||
@ -48,6 +53,11 @@ interface IItemDefinition : IThingWithDescription {
|
||||
*/
|
||||
val eventCategory: String?
|
||||
|
||||
/**
|
||||
* Топливо корабля
|
||||
*/
|
||||
val fuelAmount: Long
|
||||
|
||||
/**
|
||||
* Заставляет предмет "использовать" сразу же при подборе
|
||||
*/
|
||||
|
@ -28,12 +28,12 @@ open class ItemPrototype : FreezableDefintionBuilder(), IItemDefinition {
|
||||
get() = descriptionData.racialShortDescription
|
||||
|
||||
@JsonPropertyConfig(isFlat = true)
|
||||
var descriptionData: ThingDescription by NotNullVar()
|
||||
var descriptionData: ThingDescription by NotNull()
|
||||
|
||||
final override var itemName: String by NotNull()
|
||||
final override var price: Long by NotNull(0L)
|
||||
final override var rarity: ItemRarity by NotNull(ItemRarity.COMMON)
|
||||
final override var category: String? by Nullable()
|
||||
final override var category: String by NotNull()
|
||||
final override var inventoryIcon: ImmutableList<InventoryIcon>? by Nullable()
|
||||
final override var itemTags: ImmutableList<String> by NotNull(ImmutableList.of())
|
||||
final override var learnBlueprintsOnPickup: ImmutableList<RegistryReference<IItemDefinition>> by NotNull(ImmutableList.of())
|
||||
@ -44,7 +44,7 @@ open class ItemPrototype : FreezableDefintionBuilder(), IItemDefinition {
|
||||
final override var tooltipKind: String by NotNull("normal")
|
||||
final override var twoHanded: Boolean by NotNull(false)
|
||||
final override var radioMessagesOnPickup: ImmutableList<String> by NotNull(ImmutableList.of())
|
||||
final override var fuelAmount: Long? by Nullable()
|
||||
final override var fuelAmount: Long by NotNull(0L)
|
||||
|
||||
final override var pickupSoundsSmall: ImmutableList<String> by NotNull(ImmutableList.of())
|
||||
final override var pickupSoundsMedium: ImmutableList<String> by NotNull(ImmutableList.of())
|
||||
|
@ -0,0 +1,20 @@
|
||||
package ru.dbotthepony.kstarbound.defs.item
|
||||
|
||||
import com.google.gson.stream.JsonWriter
|
||||
import ru.dbotthepony.kstarbound.io.json.builder.IStringSerializable
|
||||
|
||||
enum class ItemRarity(val canonical: String) : IStringSerializable {
|
||||
COMMON("Common"),
|
||||
UNCOMMON("Uncommon"),
|
||||
RARE("Rare"),
|
||||
LEGENDARY("Legendary"),
|
||||
ESSENTIAL("Essential");
|
||||
|
||||
override fun match(name: String): Boolean {
|
||||
return name == this.canonical || name.lowercase() == this.name.lowercase()
|
||||
}
|
||||
|
||||
override fun write(out: JsonWriter) {
|
||||
out.value(canonical)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user