mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 14:04:05 +09:00
new console command 'error' (stderr equivalent of console window)
Former-commit-id: ab54663fd64f9ae9c758f53b3f5800a5894f0db3 Former-commit-id: 7aba1585ffa45195622bb25e1c62cace474420c9
This commit is contained in:
@@ -91,7 +91,7 @@ class ActorInventory() {
|
||||
var weight = 0f
|
||||
|
||||
for (item in itemList.entries) {
|
||||
weight += ItemPropCodex.getItem(item.key).mass * item.value
|
||||
weight += ItemPropCodex.getProp(item.key).mass * item.value
|
||||
}
|
||||
|
||||
return weight
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
package net.torvald.terrarum.gameactors
|
||||
|
||||
import net.torvald.terrarum.itemproperties.ItemPropCodex
|
||||
import net.torvald.terrarum.tileproperties.TilePropCodex
|
||||
import org.newdawn.slick.GameContainer
|
||||
import org.newdawn.slick.Graphics
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-03-15.
|
||||
*/
|
||||
class DroppedItem constructor() : ActorWithBody() {
|
||||
class DroppedItem constructor(itemID: Int) : ActorWithBody() {
|
||||
|
||||
init {
|
||||
if (itemID >= ItemPropCodex.ITEM_UNIQUE_MAX)
|
||||
throw RuntimeException("Attempted to create DroppedItem actor of a real actor; the real actor must be dropped instead.")
|
||||
|
||||
isVisible = true
|
||||
|
||||
mass = if (itemID < 4096)
|
||||
TilePropCodex.getProp(itemID).density / 1000f
|
||||
else
|
||||
ItemPropCodex.getProp(itemID).mass
|
||||
}
|
||||
|
||||
override fun update(gc: GameContainer, delta_t: Int) {
|
||||
@@ -17,6 +27,6 @@ class DroppedItem constructor() : ActorWithBody() {
|
||||
}
|
||||
|
||||
override fun drawBody(gc: GameContainer, g: Graphics) {
|
||||
drawBody(gc, g)
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user