Advertisement
Guest User

Untitled

a guest
Apr 27th, 2024
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. music = "shine_on_you_crazy_diamond" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  4. encountertext = "Poseur strikes a pose!" --Modify as necessary. It will only be read out in the action select screen.
  5. nextwaves = {"bullettest_chaserorb"}
  6. wavetimer = 4.0
  7. arenasize = {155, 130}
  8.  
  9. autolinebreak = true
  10.  
  11. enemies = {
  12. "poseur"
  13. }
  14.  
  15. enemypositions = {
  16. {0, 0}
  17. }
  18.  
  19. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  20. possible_attacks = {"attack1"}
  21.  
  22. function EncounterStarting()
  23. Inventory.AddCustomItems({"Cinnamon Bun", "Real Knife"}, {0, 1})
  24. Inventory.SetInventory({"Cinnamon Bun", "Real Knife"})
  25. -- If you want to change the game state immediately, this is the place.
  26. end
  27.  
  28. function EnemyDialogueStarting()
  29. -- Good location for setting monster dialogue depending on how the battle is going.
  30. end
  31.  
  32. function EnemyDialogueEnding()
  33. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  34. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  35. if nextwaves[1] == "attack1"
  36. wavetimer = 1.0
  37. arenasize = {100, 50}
  38. elseif
  39. wavetimer = 4.0
  40. arenasize = {155, 130}
  41. end
  42.  
  43. function DefenseEnding() --This built-in function fires after the defense round ends.
  44. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  45. end
  46.  
  47. function HandleSpare()
  48. State("ENEMYDIALOGUE")
  49. end
  50.  
  51. function HandleItem(ItemID)
  52. if ItemID == "CINNAMON BUN" then
  53. Player.Heal(24)
  54. BattleDialog({"You ate the Cinnamon Bun."})
  55. elseif ItemId == "REAL KNIFE" then
  56. Inventory.SetAmount(100)
  57. end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement