mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-18 14:34:04 +09:00
NPCIntelligentBase -> HumanoidNPC, modified HumanoidNPC accordingly
Former-commit-id: 0645b78df018cfd4c10e2b2956985412bee536e6 Former-commit-id: 8578954077c68de4d47a19cd72927c79aa8c07d8
This commit is contained in:
77
src/net/torvald/terrarum/gameactors/HumanoidNPC.kt
Normal file
77
src/net/torvald/terrarum/gameactors/HumanoidNPC.kt
Normal file
@@ -0,0 +1,77 @@
|
||||
package net.torvald.terrarum.gameactors
|
||||
|
||||
import net.torvald.terrarum.console.ActorHumanoid
|
||||
import net.torvald.terrarum.gameactors.ai.ActorAI
|
||||
import net.torvald.terrarum.gameactors.faction.Faction
|
||||
import net.torvald.terrarum.gameitem.InventoryItem
|
||||
import net.torvald.terrarum.realestate.RealEstateUtility.getAbsoluteTileNumber
|
||||
import org.newdawn.slick.GameContainer
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-03-14.
|
||||
*/
|
||||
open class HumanoidNPC(born: GameDate) : ActorHumanoid(born), AIControlled, CanBeAnItem {
|
||||
|
||||
override var actorAI: ActorAI = object : ActorAI {
|
||||
// TODO fully establish ActorAI so that I can implement AI here
|
||||
}
|
||||
|
||||
// we're having InventoryItem data so that this class could be somewhat universal
|
||||
override var itemData: InventoryItem = object : InventoryItem {
|
||||
override var itemID = referenceID
|
||||
|
||||
override var mass: Double
|
||||
get() = actorValue.getAsDouble(AVKey.BASEMASS)!!
|
||||
set(value) {
|
||||
actorValue[AVKey.BASEMASS] = value
|
||||
}
|
||||
|
||||
override var scale: Double
|
||||
get() = actorValue.getAsDouble(AVKey.SCALE)!!
|
||||
set(value) {
|
||||
actorValue[AVKey.SCALE] = value
|
||||
}
|
||||
|
||||
override fun effectWhileInPocket(gc: GameContainer, delta: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun effectWhenPickedUp(gc: GameContainer, delta: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun primaryUse(gc: GameContainer, delta: Int) {
|
||||
// TODO do not allow primary_use
|
||||
}
|
||||
|
||||
override fun secondaryUse(gc: GameContainer, delta: Int) {
|
||||
// TODO place this Actor to the world
|
||||
}
|
||||
|
||||
override fun effectWhenThrown(gc: GameContainer, delta: Int) {
|
||||
}
|
||||
|
||||
override fun effectWhenTakenOut(gc: GameContainer, delta: Int) {
|
||||
}
|
||||
|
||||
override fun worldActorEffect(gc: GameContainer, delta: Int) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemWeight(): Double {
|
||||
return mass
|
||||
}
|
||||
|
||||
override fun stopUpdateAndDraw() {
|
||||
isUpdate = false
|
||||
isVisible = false
|
||||
}
|
||||
|
||||
override fun resumeUpdateAndDraw() {
|
||||
isUpdate = true
|
||||
isVisible = true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user