Advertisement
Guest User

Encounter

a guest
Dec 14th, 2019
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. music = "Theme" --Either OGG or WAV. Extension is added automatically. Uncomment (remove the two dashes) for custom music.
  2. encountertext = "Your flesh begins to crawl." --Modify as necessary. It will only be read out in the action select screen.
  3. nextwaves = {"bullettest_chaserorb"}
  4. wavetimer = 6.0
  5. arenasize = {155, 130}
  6. canflee = false
  7.  
  8. enemies = {
  9. "Him"
  10. }
  11.  
  12. enemypositions = {
  13. {0, 0}
  14. }
  15.  
  16. SetGlobal("intro", true)
  17.  
  18. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  19. possible_attacks = {"bullettest_bouncy", "bullettest_chaserorb", "bullettest_touhou"}
  20.  
  21. function EncounterStarting()
  22. require "Animations/him_animation"
  23. State("ENEMYDIALOGUE")
  24. Player.name = "Snes"
  25. Player.lv = 19
  26. Player.hp = 92
  27. Inventory.AddCustomItems({"Ramen","Sushi",},{0,0})
  28. Inventory.SetInventory({"Ramen","Sushi"})
  29. -- If you want to change the game state immediately, this is the place.
  30. end
  31.  
  32. function EnemyDialogueStarting()
  33. local intro = GetGlobal("intro")
  34. if intro == true then
  35. enemies[1].SetVar('currentdialogue', {"[font:sans]Here we\ngo."})
  36. SetGlobal("intro", false)
  37. end
  38. -- Good location for setting monster dialogue depending on how the battle is going.
  39. end
  40.  
  41. function Update()
  42. AnimateHim()
  43. end
  44.  
  45. function EnemyDialogueEnding()
  46. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  47. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  48. end
  49.  
  50. function DefenseEnding() --This built-in function fires after the defense round ends.
  51. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  52. end
  53.  
  54. function HandleSpare()
  55. BattleDialogue("It's too late for that now.")
  56. end
  57.  
  58. function HandleItem(ItemID)
  59. if (ItemID == "RAMEN") then
  60. if Player.hp >= 62 then
  61. Player.Heal(30)
  62. BattleDialog({"You ate the Ramen. Your HP\rwas maxed out!"})
  63. elseif Player.hp <= 61 then
  64. Player.Heal(30)
  65. BattleDialog({"You ate the Ramen.\rYou recovered 30 HP!"})
  66. end
  67. end
  68.  
  69. if (ItemID == "SUSHI") then
  70. if Player.hp <= 81 then
  71. Player.Heal(10)
  72. BattleDialog({"You ate the Sushi.\rYou recovered 10 HP!"})
  73. elseif Player.hp >= 82 then
  74. Player.Heal(10)
  75. BattleDialog({"You ate the Sushi. Your HP\rwas maxed out!"})
  76. end
  77. end
  78. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement