mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-16 05:24:06 +09:00
gdx 1.10/lwjgl3 migration; removing old Lua stuffs
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
package net.torvald.terrarum.itemproperties
|
||||
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.ai.toLua
|
||||
import org.luaj.vm2.Globals
|
||||
import org.luaj.vm2.LuaTable
|
||||
import org.luaj.vm2.LuaValue
|
||||
import org.luaj.vm2.lib.ThreeArgFunction
|
||||
import org.luaj.vm2.lib.ZeroArgFunction
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2017-04-16.
|
||||
*/
|
||||
class ItemEffectsLuaAPI(g: Globals) {
|
||||
|
||||
init {
|
||||
g["getMouseTile"] = GetMouseTile()
|
||||
g["getMousePos"] = GetMousePos()
|
||||
|
||||
|
||||
|
||||
g["world"] = LuaTable()
|
||||
|
||||
g["world"]["strikeEarth"] = StrikeEarth()
|
||||
g["world"]["strikeWall"] = StrikeWall()
|
||||
|
||||
|
||||
|
||||
g["actor"] = LuaTable()
|
||||
}
|
||||
|
||||
|
||||
class GetMouseTile : ZeroArgFunction() {
|
||||
override fun call(): LuaValue {
|
||||
return LuaValue.tableOf(arrayOf(Terrarum.mouseTileX.toLua(), Terrarum.mouseTileY.toLua()))
|
||||
}
|
||||
}
|
||||
class GetMousePos : ZeroArgFunction() {
|
||||
override fun call(): LuaValue {
|
||||
return LuaValue.tableOf(arrayOf(Terrarum.mouseX.toLua(), Terrarum.mouseY.toLua()))
|
||||
}
|
||||
}
|
||||
|
||||
class StrikeEarth : ThreeArgFunction() {
|
||||
override fun call(x: LuaValue, y: LuaValue, power: LuaValue): LuaValue {
|
||||
(Terrarum.ingame!!.world).inflictTerrainDamage(x.checkint(), y.checkint(), power.checkdouble())
|
||||
return LuaValue.NONE
|
||||
}
|
||||
}
|
||||
class StrikeWall : ThreeArgFunction() {
|
||||
override fun call(x: LuaValue, y: LuaValue, power: LuaValue): LuaValue {
|
||||
(Terrarum.ingame!!.world).inflictWallDamage(x.checkint(), y.checkint(), power.checkdouble())
|
||||
return LuaValue.NONE
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user