blocks now have properly formatted ids

This commit is contained in:
Song Minjae
2017-04-29 00:05:10 +09:00
parent df3afab5ee
commit 0510ac230b
17 changed files with 3346 additions and 851 deletions

View File

@@ -7,6 +7,7 @@ import net.torvald.terrarum.gamecontroller.Key
import net.torvald.terrarum.itemproperties.InventoryItem
import net.torvald.terrarum.itemproperties.Material
import net.torvald.terrarum.realestate.LandUtil
import net.torvald.terrarum.ui.UIInventory
import org.newdawn.slick.GameContainer
import org.newdawn.slick.Input
import java.util.*
@@ -479,12 +480,15 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
// ONLY FOR HAND_GRIPs!!
val quickBarItem = inventory.getQuickBar(actorValue.getAsInt(key)!!)?.item
if (quickBarItem == null) {
unequipSlot(InventoryItem.EquipPosition.HAND_GRIP)
}
else if (quickBarItem.equipPosition == InventoryItem.EquipPosition.HAND_GRIP) {
if (quickBarItem != null && quickBarItem.equipPosition == InventoryItem.EquipPosition.HAND_GRIP) {
equipItem(quickBarItem)
}
// force update inventory UI
try {
(Terrarum.ingame!!.uiInventoryPlayer.UI as UIInventory).shutUpAndRebuild()
}
catch (LateInitMyArse: kotlin.UninitializedPropertyAccessException) { }
}
}

View File

@@ -8,9 +8,8 @@ import org.newdawn.slick.Graphics
*
* Created by minjaesong on 2017-01-21.
*/
abstract class ActorVisible(renderOrder: RenderOrder) : Actor(renderOrder) {
abstract class ActorWithBody(renderOrder: RenderOrder) : Actor(renderOrder) {
open val hitbox = Hitbox(0.0, 0.0, 0.0, 0.0)
override abstract fun update(gc: GameContainer, delta: Int)
abstract fun drawBody(g: Graphics)
abstract fun drawGlow(g: Graphics)
}

View File

@@ -26,7 +26,7 @@ import java.util.*
*
* Created by minjaesong on 16-01-13.
*/
open class ActorWithPhysics(renderOrder: RenderOrder, val immobileBody: Boolean = false, physics: Boolean = true) : ActorVisible(renderOrder) {
open class ActorWithPhysics(renderOrder: RenderOrder, val immobileBody: Boolean = false, physics: Boolean = true) : ActorWithBody(renderOrder) {
/** !! ActorValue macros are on the very bottom of the source !! **/

View File

@@ -13,7 +13,11 @@ typealias AnyPlayer = HistoricalFigure
*
* Created by minjaesong on 16-10-10.
*/
open class HistoricalFigure(val born: GameDate, val dead: GameDate? = null, realAirFriction: Boolean = false) : ActorWithPhysics(Actor.RenderOrder.MIDDLE, realAirFriction) {
open class HistoricalFigure(
val born: GameDate,
val dead: GameDate? = null,
realAirFriction: Boolean = false
) : ActorWithPhysics(Actor.RenderOrder.MIDDLE, realAirFriction) {
init {
this.actorValue["_bornyear"] = born.year