mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 14:04:05 +09:00
various patches and renaming; thai-variable font sheet
This commit is contained in:
@@ -71,7 +71,8 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
* (Use ArrayList for normal circumstances)
|
||||
*/
|
||||
override val lightBoxList: List<Hitbox>
|
||||
get() = arrayOf(Hitbox(0.0, 0.0, hitbox.width, hitbox.height)).toList() // use getter; dimension of the player may change by time.
|
||||
get() = arrayOf(Hitbox(2.0, 2.0, hitbox.width - 3, hitbox.height - 3)).toList() // things are asymmetric!!
|
||||
// use getter; dimension of the player may change by time.
|
||||
|
||||
@Transient val BASE_DENSITY = 980.0
|
||||
|
||||
@@ -156,7 +157,7 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
|
||||
if (vehicleRiding is Player)
|
||||
throw Error("Attempted to 'ride' player object. ($vehicleRiding)")
|
||||
if (vehicleRiding != null && (vehicleRiding == this))
|
||||
if (vehicleRiding != null && vehicleRiding == this)
|
||||
throw Error("Attempted to 'ride' itself. ($vehicleRiding)")
|
||||
|
||||
|
||||
@@ -167,7 +168,7 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
updateSprite(delta)
|
||||
|
||||
if (noClip) {
|
||||
grounded = true
|
||||
//grounded = true
|
||||
}
|
||||
|
||||
// reset control box of AI
|
||||
@@ -370,9 +371,9 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
avAcceleration * (if (left) -1f else 1f) * absAxisVal
|
||||
|
||||
if (absAxisVal != AXIS_KEYBOARD)
|
||||
walkX = walkX.plus(readonly_totalX).bipolarClamp(avSpeedCap * absAxisVal)
|
||||
controllerMoveDelta?.x?.let { controllerMoveDelta!!.x = controllerMoveDelta!!.x.plus(readonly_totalX).bipolarClamp(avSpeedCap * absAxisVal) }
|
||||
else
|
||||
walkX = walkX.plus(readonly_totalX).bipolarClamp(avSpeedCap)
|
||||
controllerMoveDelta?.x?.let { controllerMoveDelta!!.x = controllerMoveDelta!!.x.plus(readonly_totalX).bipolarClamp(avSpeedCap) }
|
||||
|
||||
if (absAxisVal == AXIS_KEYBOARD) {
|
||||
walkCounterX += 1
|
||||
@@ -399,9 +400,9 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
avAcceleration * (if (up) -1f else 1f) * absAxisVal
|
||||
|
||||
if (absAxisVal != AXIS_KEYBOARD)
|
||||
walkY = walkY.plus(readonly_totalY).bipolarClamp(avSpeedCap * absAxisVal)
|
||||
controllerMoveDelta?.y?.let { controllerMoveDelta!!.y = controllerMoveDelta!!.y.plus(readonly_totalX).bipolarClamp(avSpeedCap * absAxisVal) }
|
||||
else
|
||||
walkY = walkY.plus(readonly_totalY).bipolarClamp(avSpeedCap)
|
||||
controllerMoveDelta?.y?.let { controllerMoveDelta!!.y = controllerMoveDelta!!.y.plus(readonly_totalX).bipolarClamp(avSpeedCap) }
|
||||
|
||||
if (absAxisVal == AXIS_KEYBOARD) {
|
||||
walkCounterY += 1
|
||||
@@ -459,7 +460,7 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
|
||||
jumpAcc = pwr * timedJumpCharge * JUMP_ACCELERATION_MOD * Math.sqrt(scale) // positive value
|
||||
|
||||
walkY -= jumpAcc // feed negative value to the vector
|
||||
controllerMoveDelta?.y?.let { controllerMoveDelta!!.y -= jumpAcc } // feed negative value to the vector
|
||||
// do not think of resetting this to zero when counter hit the ceiling; that's HOW NOT
|
||||
// newtonian physics work, stupid myself :(
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ open class ParticleBase(renderOrder: Actor.RenderOrder, maxLifeTime: Int? = null
|
||||
if (velocity.isZero || lifetimeCounter >= lifetimeMax ||
|
||||
// simple stuck check
|
||||
BlockCodex[Terrarum.ingame!!.world.getTileFromTerrain(
|
||||
hitbox.pointedX.div(TILE_SIZE).floorInt(),
|
||||
hitbox.pointedY.div(TILE_SIZE).floorInt()
|
||||
hitbox.canonicalX.div(TILE_SIZE).floorInt(),
|
||||
hitbox.canonicalY.div(TILE_SIZE).floorInt()
|
||||
) ?: Block.STONE].isSolid) {
|
||||
flagDespawn = true
|
||||
}
|
||||
|
||||
@@ -24,20 +24,20 @@ class PhysTestBall : ActorWithPhysics(Actor.RenderOrder.MIDDLE, immobileBody = t
|
||||
override fun drawBody(g: Graphics) {
|
||||
g.color = color
|
||||
g.fillOval(
|
||||
hitbox.posX.toFloat(),
|
||||
hitbox.posY.toFloat(),
|
||||
hitbox.startX.toFloat() - 1f,
|
||||
hitbox.startY.toFloat() - 1f,
|
||||
hitbox.width.toFloat(),
|
||||
hitbox.height.toFloat())
|
||||
|
||||
g.fillOval(
|
||||
hitbox.posX.toFloat() + Terrarum.ingame!!.world.width * TILE_SIZE,
|
||||
hitbox.posY.toFloat(),
|
||||
hitbox.startX.toFloat() + Terrarum.ingame!!.world.width * TILE_SIZE - 1f,
|
||||
hitbox.startY.toFloat() - 1f,
|
||||
hitbox.width.toFloat(),
|
||||
hitbox.height.toFloat())
|
||||
|
||||
g.fillOval(
|
||||
hitbox.posX.toFloat() - Terrarum.ingame!!.world.width * TILE_SIZE,
|
||||
hitbox.posY.toFloat(),
|
||||
hitbox.startX.toFloat() - Terrarum.ingame!!.world.width * TILE_SIZE - 1f,
|
||||
hitbox.startY.toFloat() - 1f,
|
||||
hitbox.width.toFloat(),
|
||||
hitbox.height.toFloat())
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ object PlayerBuilderSigrid {
|
||||
|
||||
p.actorValue[AVKey.INTELLIGENT] = true
|
||||
|
||||
p.actorValue[AVKey.LUMINOSITY] = Color(0x434aff).to10bit()
|
||||
//p.actorValue[AVKey.LUMINOSITY] = 214127943 // bright purple
|
||||
//p.actorValue[AVKey.LUMINOSITY] = Color(0x434aff).to10bit()
|
||||
p.actorValue[AVKey.LUMINOSITY] = 214127943 // bright purple
|
||||
|
||||
p.actorValue[AVKey.BASEDEFENCE] = 141
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ internal class AILuaAPI(g: Globals, actor: ActorWithPhysics) {
|
||||
val moveDelta = actor.externalForce + actor.controllerMoveDelta
|
||||
|
||||
t["name"] = actor.actorValue.getAsString(AVKey.NAME).toLua()
|
||||
t["posX"] = actor.hitbox.centeredX.toLua()
|
||||
t["posY"] = actor.hitbox.centeredY.toLua()
|
||||
t["startX"] = actor.hitbox.centeredX.toLua()
|
||||
t["startY"] = actor.hitbox.centeredY.toLua()
|
||||
|
||||
t["veloX"] = moveDelta.x.toLua()
|
||||
t["veloY"] = moveDelta.y.toLua()
|
||||
|
||||
Reference in New Issue
Block a user