mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-08 12:51:51 +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 {
|
||||
meter.vitalGetterVal = {
|
||||
if (ItemCodex[currentItem.originalID].stackable) {
|
||||
//println("[AmmoMeterProxy] currentItem: $currentItem")
|
||||
if (currentItem.stackable && currentItem.maxDurability == InventoryItem.DURABILITY_NA) {
|
||||
actor.inventory.getByDynamicID(currentItem.dynamicID)!!.amount.toFloat()
|
||||
}
|
||||
else
|
||||
@@ -28,7 +27,7 @@ object AmmoMeterProxy {
|
||||
}
|
||||
|
||||
meter.vitalGetterMax = {
|
||||
if (ItemCodex[currentItem.originalID].stackable)
|
||||
if (currentItem.stackable && currentItem.maxDurability == InventoryItem.DURABILITY_NA)
|
||||
500f
|
||||
else
|
||||
currentItem.maxDurability.toFloat()
|
||||
|
||||
@@ -42,7 +42,7 @@ object PlayerBuilderSigrid {
|
||||
p.actorValue[AVKey.SPEEDBUFF] = 1.0
|
||||
p.actorValue[AVKey.ACCEL] = ActorHumanoid.WALK_ACCEL_BASE
|
||||
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.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
|
||||
|
||||
/**
|
||||
* Set to zero if durability not applicable
|
||||
* Set to zero (InventoryItem.DURABILITY_NA) if durability not applicable
|
||||
*/
|
||||
open var maxDurability: Int = 0
|
||||
|
||||
@@ -255,6 +255,9 @@ abstract class InventoryItem : Comparable<InventoryItem>, Cloneable {
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
val DURABILITY_NA = 0
|
||||
|
||||
fun generateUniqueDynamicID(inventory: ActorInventory): Int {
|
||||
var ret: Int
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user