mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
durability meter: stack of (new) tools displayed as intended
- displaying NOT based on their stacks but their health
This commit is contained in:
@@ -19,8 +19,7 @@ object AmmoMeterProxy {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
meter.vitalGetterVal = {
|
meter.vitalGetterVal = {
|
||||||
if (ItemCodex[currentItem.originalID].stackable) {
|
if (currentItem.stackable && currentItem.maxDurability == InventoryItem.DURABILITY_NA) {
|
||||||
//println("[AmmoMeterProxy] currentItem: $currentItem")
|
|
||||||
actor.inventory.getByDynamicID(currentItem.dynamicID)!!.amount.toFloat()
|
actor.inventory.getByDynamicID(currentItem.dynamicID)!!.amount.toFloat()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -28,7 +27,7 @@ object AmmoMeterProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
meter.vitalGetterMax = {
|
meter.vitalGetterMax = {
|
||||||
if (ItemCodex[currentItem.originalID].stackable)
|
if (currentItem.stackable && currentItem.maxDurability == InventoryItem.DURABILITY_NA)
|
||||||
500f
|
500f
|
||||||
else
|
else
|
||||||
currentItem.maxDurability.toFloat()
|
currentItem.maxDurability.toFloat()
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ object PlayerBuilderSigrid {
|
|||||||
p.actorValue[AVKey.SPEEDBUFF] = 1.0
|
p.actorValue[AVKey.SPEEDBUFF] = 1.0
|
||||||
p.actorValue[AVKey.ACCEL] = ActorHumanoid.WALK_ACCEL_BASE
|
p.actorValue[AVKey.ACCEL] = ActorHumanoid.WALK_ACCEL_BASE
|
||||||
p.actorValue[AVKey.ACCELBUFF] = 1.0
|
p.actorValue[AVKey.ACCELBUFF] = 1.0
|
||||||
p.actorValue[AVKey.JUMPPOWER] = 5.0
|
p.actorValue[AVKey.JUMPPOWER] = 5.2
|
||||||
|
|
||||||
p.actorValue[AVKey.BASEMASS] = 80.0
|
p.actorValue[AVKey.BASEMASS] = 80.0
|
||||||
p.actorValue[AVKey.SCALEBUFF] = 1.0 // Constant 1.0 for player, meant to be used by random mobs
|
p.actorValue[AVKey.SCALEBUFF] = 1.0 // Constant 1.0 for player, meant to be used by random mobs
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ abstract class InventoryItem : Comparable<InventoryItem>, Cloneable {
|
|||||||
open var scale: Double = 1.0
|
open var scale: Double = 1.0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to zero if durability not applicable
|
* Set to zero (InventoryItem.DURABILITY_NA) if durability not applicable
|
||||||
*/
|
*/
|
||||||
open var maxDurability: Int = 0
|
open var maxDurability: Int = 0
|
||||||
|
|
||||||
@@ -255,6 +255,9 @@ abstract class InventoryItem : Comparable<InventoryItem>, Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
val DURABILITY_NA = 0
|
||||||
|
|
||||||
fun generateUniqueDynamicID(inventory: ActorInventory): Int {
|
fun generateUniqueDynamicID(inventory: ActorInventory): Int {
|
||||||
var ret: Int
|
var ret: Int
|
||||||
do {
|
do {
|
||||||
|
|||||||
Reference in New Issue
Block a user