mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 14:04:05 +09:00
Actor reference ID on debug window, RefID is now Int, added Japanese on help page
Former-commit-id: 3519b8746d611c4badd65f01644ba05e41d10d04 Former-commit-id: 45bb407c2d932e5d70aab9c9eb4f3ef55ce68d27
This commit is contained in:
@@ -11,9 +11,9 @@ interface Actor {
|
||||
|
||||
/**
|
||||
* Valid RefID is equal to or greater than 32768.
|
||||
* @return Reference ID. (32768-0x7FFF_FFFF_FFFF_FFFF)
|
||||
* @return Reference ID. (32768-0xFFFF_FFFF)
|
||||
*/
|
||||
var referenceID: Long
|
||||
var referenceID: Int
|
||||
|
||||
var actorValue: ActorValue
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class ActorInventory() {
|
||||
/**
|
||||
* <ReferenceID, Amounts>
|
||||
*/
|
||||
private val itemList: HashMap<Long, Int> = HashMap()
|
||||
private val itemList: HashMap<Int, Int> = HashMap()
|
||||
|
||||
/**
|
||||
* Default constructor with no encumbrance.
|
||||
@@ -74,7 +74,7 @@ class ActorInventory() {
|
||||
* Get reference to the itemList
|
||||
* @return
|
||||
*/
|
||||
fun getItemList(): Map<Long, Int>? {
|
||||
fun getItemList(): Map<Int, Int>? {
|
||||
return itemList
|
||||
}
|
||||
|
||||
@@ -83,8 +83,8 @@ class ActorInventory() {
|
||||
* @return
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun getCopyOfItemList(): Map<Long, Int>? {
|
||||
return itemList.clone() as Map<Long, Int>
|
||||
fun getCopyOfItemList(): Map<Int, Int>? {
|
||||
return itemList.clone() as Map<Int, Int>
|
||||
}
|
||||
|
||||
fun getTotalWeight(): Float {
|
||||
|
||||
@@ -53,11 +53,11 @@ open class ActorWithBody constructor() : Actor, Visible, Glowing {
|
||||
internal var baseSpriteWidth: Int = 0
|
||||
internal var baseSpriteHeight: Int = 0
|
||||
|
||||
override var referenceID: Long = 0L
|
||||
override var referenceID: Int = 0
|
||||
/**
|
||||
* Positions: top-left point
|
||||
*/
|
||||
val hitbox = Hitbox(0f,0f,0f,0f)
|
||||
override val hitbox = Hitbox(0f,0f,0f,0f)
|
||||
@Transient val nextHitbox = Hitbox(0f,0f,0f,0f)
|
||||
|
||||
/**
|
||||
@@ -137,7 +137,7 @@ open class ActorWithBody constructor() : Actor, Visible, Glowing {
|
||||
|
||||
init {
|
||||
do {
|
||||
referenceID = HQRNG().nextLong() // set new ID
|
||||
referenceID = HQRNG().nextInt() // set new ID
|
||||
} while (Terrarum.game.hasActor(referenceID)) // check for collision
|
||||
|
||||
map = Terrarum.game.map
|
||||
|
||||
@@ -15,7 +15,7 @@ open class NPCIntelligentBase : ActorWithBody()
|
||||
, AIControlled, Pocketed, CanBeAnItem, Factionable, LandHolder {
|
||||
|
||||
override var itemData: InventoryItem = object : InventoryItem {
|
||||
override var itemID = HQRNG().nextLong()
|
||||
override var itemID = HQRNG().nextInt()
|
||||
|
||||
override var mass: Float
|
||||
get() = actorValue.get("mass") as Float
|
||||
@@ -55,7 +55,7 @@ open class NPCIntelligentBase : ActorWithBody()
|
||||
|
||||
private val factionSet = HashSet<Faction>()
|
||||
|
||||
override var referenceID: Long = HQRNG().nextLong()
|
||||
override var referenceID: Int = HQRNG().nextInt()
|
||||
|
||||
override var faction: HashSet<Faction> = HashSet()
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class Player : ActorWithBody, Controllable, Pocketed, Factionable, Luminous, Lan
|
||||
@Transient internal const val WALK_STOP_ACCEL = 0.32f
|
||||
@Transient internal const val WALK_ACCEL_BASE = 0.32f
|
||||
|
||||
@Transient const val PLAYER_REF_ID: Long = 0x51621D
|
||||
@Transient const val PLAYER_REF_ID: Int = 0x51621D
|
||||
@Transient const val BASE_HEIGHT = 40
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ import org.newdawn.slick.Graphics
|
||||
* Created by minjaesong on 16-03-14.
|
||||
*/
|
||||
interface Visible {
|
||||
val hitbox: Hitbox
|
||||
|
||||
fun drawBody(gc: GameContainer, g: Graphics)
|
||||
|
||||
fun updateBodySprite(gc: GameContainer, delta: Int)
|
||||
|
||||
Reference in New Issue
Block a user