-- A basic monster script skeleton you can copy and modify for your own creations.
voicer = require "randomvoice"
-- Now, set some voices that are included in the default directory.
voicer.setvoices({"voice_gaster_1";"voice_gaster_2";"voice_gaster_3";"voice_gaster_4";"voice_gaster_5";"voice_gaster_6";"voice_gaster_7";})
comments = {"Smells like the \runknown.", "It gets dark.", "What are we fighting ?"}
commands = {"Talk", "Cry", "Help"}
randomdialogue = {"[font:wingdings]..."}
sprite = "poseur" --Always PNG. Extension is added automatically.
name = "??????"
hp = 99999
atk = 999
def = 999
check = "There is no description about\rsomething that doesn't exist."
dialogbubble = "right" -- See documentation for what bubbles you have available.
canspare = false
cancheck = true
function EncounterStarting()
-- If you want to change the game state immediately, this is the place.
local randomdialogue = enemies[1].GetVar("randomdialogue") -- retrieve dialogue first, for readability
enemies[1].SetVar("randomdialogue", voicer.randomizetable(randomdialogue)) -- Randomize voices with the library!
end
function EnemyDialogueStarting()
-- Good location for setting monster dialogue depending on how the battle is going.
-- Example: enemies[1].SetVar('currentdialogue', {"Check it\nout!"}) See documentation for details.
local enemydialogue = enemies[1].GetVar("currentdialogue") -- retrieve dialogue first, for readability
if enemydialogue ~= nil then -- Note that this can happen when a monster is having its random dialogue!
enemies[1].SetVar('currentdialogue', voicer.randomizetable(enemydialogue)) -- Randomize voices with the library!
end
end
function EnemyDialogueEnding()
-- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
-- This example line below takes a random attack from 'possible_attacks'.
nextwaves = { possible_attacks[math.random(#possible_attacks)] }
end
-- Happens after the slash animation but before
function HandleAttack(attackstatus)
if attackstatus == -1 then
-- player pressed fight but didn't press Z afterwards
else
-- player did actually attack
end
end
-- This handles the commands; all-caps versions of the commands list you have above.
function HandleCustomCommand(command)
if command == "TALK" then
currentdialogue = {"..."}
BattleDialog({"You're talking to yourself."})
elseif command == "CRY" then
currentdialogue = {"Selected\nAct 2."}
BattleDialog({"Crying won't help."})
elseif command == "HELP" then
currentdialogue = {"..."}
BattleDialog({"There is no one to help."})
end
end