Actually utilising ActorAI interface to support AIs written in Kotlin as well as in Lua

Former-commit-id: 53901f5a5d53b33c4254091ec507be82289d57fd
Former-commit-id: 86ce8d2a646a1564ee5e33ef07c5affb338c028e
This commit is contained in:
Song Minjae
2017-02-04 22:53:36 +09:00
parent 2fd7487248
commit 5daf424554
6 changed files with 133 additions and 101 deletions

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum.gameactors
import net.torvald.spriteanimation.SpriteAnimation
import net.torvald.terrarum.gameactors.ActorHumanoid
import net.torvald.terrarum.gameactors.ai.LuaAIWrapper
import net.torvald.terrarum.mapdrawer.FeaturesDrawer
/**
@@ -11,9 +12,12 @@ object PlayerBuilderCynthia {
operator fun invoke(): ActorWithSprite {
//val p: Player = Player(GameDate(100, 143)) // random value thrown
val p: HumanoidNPC = HumanoidNPC("/net/torvald/terrarum/gameactors/ai/scripts/PokemonNPCAI.lua",
val p: HumanoidNPC = HumanoidNPC(
LuaAIWrapper("/net/torvald/terrarum/gameactors/ai/scripts/PokemonNPCAI.lua"),
GameDate(100, 143)) // random value thrown
InjectCreatureRaw(p.actorValue, "CreatureHuman.json")
(p.ai as LuaAIWrapper).attachActor(p)
p.actorValue[AVKey.__PLAYER_QUICKBARSEL] = 0
p.actorValue[AVKey.NAME] = "Cynthia"