Advertisement
offbrandbiscuit

Untitled

Jun 8th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. music = "ALTERTALE - Dynami" --Always OGG. Extension is added automatically. Remove the first two lines for custom music.
  4. encountertext = "Flames erupt from the ground,\npulling you towards them.\nYou're going back to hell."
  5. nextwaves = {"bullettest_bouncy"}
  6. wavetimer = 6.0
  7. arenasize = {155, 130}
  8.  
  9. enemies = {
  10. "Toriel"
  11. }
  12.  
  13. enemypositions = {
  14. {0, 0}
  15. }
  16.  
  17. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  18. possible_attacks = {"bullettest_bouncy", "bullettest_touhou"}
  19.  
  20. function EncounterStarting()
  21. Inventory.AddCustomItems({"Chocolate", "Syringe", "Music Box"}, {0, 0, 3})
  22. Inventory.SetInventory({"Chocolate", "Syringe", "Music Box"})
  23. Inventory.SetItem(1, "Chocolate", 2, "Syringe", 3, "Music Box")
  24. Audio["hurtsound"] = "dogsecret"
  25. Player.name = "Chara"
  26. Player.lv = 15
  27. Player.hp = 76
  28.  
  29. end
  30.  
  31. function EnemyDialogueStarting()
  32. local intro = GetGlobal("intro")
  33. if intro == true then
  34. enemies[1].SetVar('currentdialogue',{"My child... You\rcertainly know how\rto get around."})
  35. SetGlobal("intro",false)
  36. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  37. end
  38. end
  39.  
  40. function EnemyDialogueEnding()
  41. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  42. -- This example line below takes a random attack from 'possible_attacks'.
  43. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  44. end
  45.  
  46. function DefenseEnding() --This built-in function fires after the defense round ends.
  47. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  48. Audio["RESETDICTIONARY"] = "dogsecret"
  49. end
  50.  
  51. function HandleSpare()
  52. State("ENEMYDIALOGUE")
  53. end
  54.  
  55. function HandleItem(ItemID)
  56. if (ItemID == "CHOCOLATE") then
  57. Inventory.NoDelete = true
  58. Player.Heal(80)
  59. BattleDialog({"My favourite. Your HP was\rmaxed out."})
  60. elseif (ItemID == "SYRINGE") then
  61. Player.Heal(20)
  62. BattleDialog({"You stab the syringe into\ryour arm.\rFilled with juicy goodness!"})
  63. elseif (ItemID == "MUSIC BOX") then
  64. BattleDialog({"[noskip]You wind up the music box.\rA familiar tune fills the room.", "Recollection flashes in Toriel's\reyes.", "Toriel's DEF down!"})
  65. enemies[1].SetVar("def", enemies[1].GetVar("def") / 2)
  66.  
  67. end
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement