NPCDialogueBuilder

class NPCDialogueBuilder(var dialogueElements: MutableList<NPCOp>)(source)

Constructors

Link copied to clipboard
constructor(dialogueElements: MutableList<NPCOp>)

Types

Link copied to clipboard
class NPCDialogueBranchBuilder(val builder: NPCDialogueBuilder, val predicate: (NPCOperationData) -> Boolean, val trueBranch: MutableList<NPCOp>, val elseBranch: MutableList<NPCOp>)

Functions

Link copied to clipboard

Branches dialogue logic based on predicate

Link copied to clipboard

Executes the provided code

Link copied to clipboard
fun goal(goal: String): Boolean

Grants player a goal

Link copied to clipboard
fun lacksGoal(goal: String, grant: Boolean = true): (NPCOperationData) -> Boolean

A predicate to check whether the player has achieved goal. Optionally also grants the goal to player

Link copied to clipboard
fun message(message: String): Boolean

Sends a raw message to player

Link copied to clipboard
fun openUi(uiProvider: (NPCOperationData) -> GUI<out ForInventory>): Boolean

Opens a KSpigot GUI for player

Link copied to clipboard
fun playSound(sound: Sound, pitch: Number = 1, volume: Number = 1): Boolean

Plays a sound at NPC location

Link copied to clipboard
fun say(message: String): Boolean

Says something from the NPC

Link copied to clipboard
fun shop(id: String): Boolean

Opens a shop to player

Link copied to clipboard
fun wait(seconds: Number): Boolean

Waits for certain amount of seconds

fun wait(duration: Duration): Boolean

Waits for certain duration

Properties

Link copied to clipboard