mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
35 lines
1.0 KiB
Kotlin
35 lines
1.0 KiB
Kotlin
package net.torvald.terrarum.gameactors
|
|
|
|
import net.torvald.terrarum.itemproperties.GameItem
|
|
import net.torvald.terrarum.itemproperties.ItemCodex
|
|
import net.torvald.terrarum.blockproperties.BlockCodex
|
|
import org.newdawn.slick.GameContainer
|
|
import org.newdawn.slick.Graphics
|
|
|
|
/**
|
|
* Created by minjaesong on 16-03-15.
|
|
*/
|
|
class DroppedItem(private val item: GameItem) : ActorWithPhysics(Actor.RenderOrder.MIDTOP) {
|
|
|
|
init {
|
|
if (item.dynamicID >= ItemCodex.ACTORID_MIN)
|
|
throw RuntimeException("Attempted to create DroppedItem actor of a real actor; the real actor must be dropped instead.")
|
|
|
|
isVisible = true
|
|
|
|
avBaseMass = if (item.dynamicID < BlockCodex.TILE_UNIQUE_MAX)
|
|
BlockCodex[item.dynamicID].density / 1000.0
|
|
else
|
|
ItemCodex[item.dynamicID].mass
|
|
|
|
scale = ItemCodex[item.dynamicID].scale
|
|
}
|
|
|
|
override fun update(gc: GameContainer, delta: Int) {
|
|
item.effectWhenEquipped(gc, delta)
|
|
}
|
|
|
|
override fun drawBody(g: Graphics) {
|
|
|
|
}
|
|
} |