mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-16 13:34:06 +09:00
World Click events
let's hope it works w/o tests as I can't get to the Ingame now
This commit is contained in:
@@ -142,7 +142,7 @@ abstract class GameItem : Comparable<GameItem>, Cloneable {
|
||||
* Consumption function is executed in net.torvald.terrarum.gamecontroller.IngameController,
|
||||
* in which the function itself is defined in net.torvald.terrarum.modulebasegame.gameactors.ActorInventory
|
||||
*/
|
||||
open fun primaryUse(delta: Float): Boolean = false
|
||||
open fun startPrimaryUse(delta: Float): Boolean = false
|
||||
|
||||
/**
|
||||
* Apply effects (continuously or not) while secondary button (usually right mouse button) is down
|
||||
@@ -152,7 +152,7 @@ abstract class GameItem : Comparable<GameItem>, Cloneable {
|
||||
*
|
||||
* note: DO NOT super() this!
|
||||
*/
|
||||
open fun secondaryUse(delta: Float): Boolean = false
|
||||
open fun startSecondaryUse(delta: Float): Boolean = false
|
||||
|
||||
open fun endPrimaryUse(delta: Float): Boolean = false
|
||||
open fun endSecondaryUse(delta: Float): Boolean = false
|
||||
|
||||
@@ -61,12 +61,12 @@ object ItemCodex {
|
||||
print("$originalID ")
|
||||
}
|
||||
|
||||
override fun primaryUse(delta: Float): Boolean {
|
||||
override fun startPrimaryUse(delta: Float): Boolean {
|
||||
return false
|
||||
// TODO base punch attack
|
||||
}
|
||||
|
||||
override fun secondaryUse(delta: Float): Boolean {
|
||||
override fun startSecondaryUse(delta: Float): Boolean {
|
||||
val mousePoint = Point2d(Terrarum.mouseTileX.toDouble(), Terrarum.mouseTileY.toDouble())
|
||||
|
||||
// check for collision with actors (BLOCK only)
|
||||
@@ -130,7 +130,7 @@ object ItemCodex {
|
||||
name = "Stone pickaxe"
|
||||
}
|
||||
|
||||
override fun primaryUse(delta: Float): Boolean {
|
||||
override fun startPrimaryUse(delta: Float): Boolean {
|
||||
val mousePoint = Point2d(Terrarum.mouseTileX.toDouble(), Terrarum.mouseTileY.toDouble())
|
||||
val actorvalue = ingame.actorNowPlaying.actorValue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user