Advertisement
Guest User

Sprite issue monster

a guest
Oct 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.81 KB | None | 0 0
  1. -- A basic monster script skeleton you can copy and modify for your own creations.
  2. comments = {"Toriel blocks the way."}
  3. commands = {"TALK"}
  4. randomdialogue = {"[voice:toriel]..."}
  5.  
  6. sprite = "Toriel_Battle_Sprite" --Always PNG. Extension is added automatically.
  7. name = "Toriel"
  8. hp = 1
  9. atk = 6
  10. def = 1
  11. check = "She won't let you past."
  12. dialogbubble = "right" -- See documentation for what bubbles you have available.
  13. canspare = false
  14. cancheck = true
  15.  
  16. -- Happens after the slash animation but before
  17. function HandleAttack(attackstatus)
  18.     if attackstatus == -1 then
  19.         -- player pressed fight but didn't press Z afterwards
  20.     else
  21.       if hp < 1 then
  22.           Audio.stop()
  23.           if canspare == false then
  24.               hurttoriel.alpha = 1
  25.               currentdialogue = {"[func:SetSprite,Toriel_Empty][voice:toriel]I\nunderstand...[next]" , "[voice:toriel]Be good\n[w:30]my children.[w:60]",
  26.                 "[noskip][func:EndLife]"}
  27.                hp = 1      
  28.           elseif canspare == true then
  29.               killedtoriel.alpha = 1
  30.               currentdialogue = {"[voice:toriel][effect:shake][w:60]At my most\nvulnerable\nmoment...[next]" , "[voice:toriel][effect:shake]You fit\nin out\nthere![next]" , "[voice:toriel][effect:shake]HaHaHaHaHa\nHaHaHaHaHa",
  31.                  "[noskip][func:EndLife]"}
  32.                hp = 1
  33.                end
  34.           end
  35.       end
  36. end
  37.      
  38.     function EndLife()
  39.        Kill()
  40.      end
  41.    
  42.    
  43.         -- player did actually attack
  44.        
  45.  
  46.  
  47. -- This handles the commands; all-caps versions of the commands list you have above.
  48. function HandleCustomCommand(command)
  49.     if command == "TALK" then
  50.        
  51.         BattleDialog({"Toriel doesn't seem up for conversation."})
  52.         currentdialogue = {"[voice:toriel]Please stop."}
  53.     end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement