mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-11 14:21:52 +09:00
players can dig out dirts barehandedly
This commit is contained in:
@@ -73,8 +73,8 @@ basegame
|
||||
// Commit counts up to the Release 0.3.3: 3020
|
||||
|
||||
// val VERSION_SNAPSHOT = Snapshot(0) // for normal dev
|
||||
val VERSION_SNAPSHOT = ForcedSnapshot("24w07b") // for snapshot release
|
||||
// val VERSION_SNAPSHOT = null // for the release
|
||||
// val VERSION_SNAPSHOT = ForcedSnapshot("24w07b") // for snapshot release
|
||||
val VERSION_SNAPSHOT = null // for the release
|
||||
|
||||
const val VERSION_TAG: String = ""
|
||||
|
||||
|
||||
@@ -1539,8 +1539,13 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
fun performBarehandAction(actor: ActorWithBody, delta: Float, mwx: Double, mwy: Double, mtx: Int, mty: Int) {
|
||||
|
||||
val canAttackOrDig = actor.scale * actor.baseHitboxH >= (actor.actorValue.getAsDouble(AVKey.BAREHAND_MINHEIGHT) ?: 4294967296.0)
|
||||
// for giant actors punching every structure pickaxe can dig out
|
||||
val canAttackOrDig =
|
||||
actor.scale * actor.baseHitboxH >= (actor.actorValue.getAsDouble(AVKey.BAREHAND_MINHEIGHT) ?: 4294967296.0)
|
||||
|
||||
// for players punching dirts or weaker blocks
|
||||
val canDigSoftTileOnly =
|
||||
actor is ActorHumanoid && (actor.baseHitboxH * actor.scale) >= 32f
|
||||
|
||||
fun getActorsAtVicinity(worldX: Double, worldY: Double, radius: Double): List<ActorWithBody> {
|
||||
val outList = java.util.ArrayList<ActorWithBody>()
|
||||
@@ -1611,6 +1616,13 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
PickaxeCore.startPrimaryUse(actor, delta, null, mtx, mty, 1.0 / punchBlockSize, punchBlockSize, punchBlockSize)
|
||||
}
|
||||
}
|
||||
else if (canDigSoftTileOnly) {
|
||||
barehandPickInUse = true
|
||||
val tileUnderCursor = INGAME.world.getTileFromTerrain(mtx, mty)
|
||||
val tileprop = BlockCodex[tileUnderCursor]
|
||||
if (tileprop.strength <= 12)
|
||||
PickaxeCore.startPrimaryUse(actor, delta, null, mtx, mty, 1.0, 1, 1)
|
||||
}
|
||||
}
|
||||
|
||||
override fun hide() {
|
||||
|
||||
@@ -687,7 +687,7 @@ object Common {
|
||||
}
|
||||
|
||||
fun decodeToUUID(str: String): UUID {
|
||||
val code = str.replace(" ", "").trim()
|
||||
val code = str.uppercase().replace(" ", "").trim()
|
||||
val b = PasswordBase32.decode(code + (if (code.length == 25) "Y" else ""), 16)
|
||||
|
||||
/*b.forEach {
|
||||
|
||||
Reference in New Issue
Block a user