Advertisement
Guest User

Untitled

a guest
Apr 20th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. music = "Metal Cruncher" --Always OGG. Extension is added automatically. Remove the first two lines for custom music.
  4. encountertext = "Mettaton chase you!" --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. enemies = {
  10. "UnMetta"
  11. }
  12.  
  13. enemypositions = {
  14. {0, 22}
  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_chaserorb", "bullettest_touhou"}
  19.  
  20. function EncounterStarting()
  21. -- If you want to change the game state immediately, this is the place.
  22. State("ENEMYDIALOGUE")
  23. require "Animations/unmetta_anim"
  24. end
  25.  
  26. function EnemyDialogueStarting()
  27. -- Good location for setting monster dialogue depending on how the battle is going.
  28. -- Example: enemies[1].SetVar('currentdialogue', {"Check it\nout!"}) See documentation for details.
  29. dialogueCount = dialogueCount + 1
  30.  
  31. if dialogueCount == 1 then
  32. enemies[1].SetVar('currentdialogue', {"Hello Darling!"}
  33. if dialogueCount == 2 then
  34. enemies[1].SetVar('currentdialogue', {"I told\nyou im\na monster"}
  35. if dialogueCount == 3 then
  36. enemies[1].SetVar('currentdialogue', {"You don't\ngonna\npass\nthis area"}
  37. if GetGlobal('ex') == true then
  38. enemies[1].SetVar('currentdialogue', {"[SetSprite("extalkingdemo")]Well...[SetSprite("ex")]", "[SetSprite("extalkingdemo")]This part\nis not\nfinished[SetSprite("ex")]", "[SetSprite("extalkingdemo")]Goodbye!", "[func:State,DONE]"})}
  39.  
  40. end
  41.  
  42. function EnemyDialogueEnding()
  43. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  44. -- This example line below takes a random attack from 'possible_attacks'.
  45. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  46. end
  47.  
  48. function DefenseEnding() --This built-in function fires after the defense round ends.
  49. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  50. end
  51.  
  52. function HandleSpare()
  53. if GetGlobal('ex') == true then
  54. enemies[1].SetVar("canspare",true)
  55. enemies[1].SetVar("def",-200) --or other defense number
  56. end
  57.  
  58.  
  59. function HandleItem(ItemID)
  60. BattleDialog({"Selected item " .. ItemID .. "."})
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement