FluffySheep291

enemy code

Sep 3rd, 2025
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. comments = {"You can feel the blood of the demons you killed coursing through your veins."}
  2. randomdialogue = {"Random\nDialogue\n1.", "Random\nDialogue\n2.", "Random\nDialogue\n3."}
  3. commands = {"Check"}
  4.  
  5. sprite = "cube_base"
  6. name = "RobTop"
  7. hp = 9 -- Normally 9999
  8. atk = 1
  9. def = 1
  10. dialogbubble = "right" -- See documentation for what bubbles you have available.
  11. canspare = false
  12. cancheck = false
  13.  
  14. -- Happens after the slash animation but before
  15. function HandleAttack(attackstatus)
  16.     if attackstatus == -1 then
  17.         -- player pressed fight but didn't press Z afterwards
  18.     else
  19.         -- player did actually attack
  20.     end
  21. end
  22.  
  23. function HandleCustomCommand(command)
  24.     if command == "Check" then
  25.        
  26.     end
  27.     BattleDialog({"Doesn't have 1 HP like the others. One attack and one defense are all he needs."})
  28. end
  29.  
  30.     require "Animations/BobAnim"
  31.  
  32. function Ouchy()
  33.     cube_blood.Remove()
  34.     cube_hurt = CreateSprite("cube_hurt")
  35.     cube_hurt.SetPivot(0.5, 0)
  36.     cube_hurt.Dust()
  37.     Kill()
  38. end
  39.  
  40. function OnDeath()
  41.     cube.Remove()
  42.     cube_blood = CreateSprite("cube_badly_hurt")
  43.     cube_blood.SetPivot(0.5, 0)
  44.     Audio.Stop()
  45.     Audio.LoadFile("mus_toomuch")
  46.     currentdialogue = {"Y... \nYou idiot...", "Now 2.3 is never coming out.", "Ha... Ha...", "[func:Ouchy]"}
  47.     State("ENEMYDIALOGUE")
  48. end
Advertisement
Add Comment
Please, Sign In to add comment