Advertisement
Guest User

Encounter

a guest
May 27th, 2023
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.93 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. music = "loonboon.ogg" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  4. encountertext = "Dispar e Arthur estao prontos!" --Modify as necessary. It will only be read out in the action select screen.
  5. nextwaves = {""}
  6. wavetimer = 4.0
  7. arenasize = {155, 130}
  8.  
  9.  
  10. enemies = {
  11. "dispar",
  12. "arthur"
  13. }
  14.  
  15. enemypositions = {
  16. {-180, 0},
  17. {120, 0}
  18. }
  19.  
  20. function Battlemusic()
  21. Audio.PlaySound(loonboon)
  22. end
  23.  
  24. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  25. possible_attacks = {"dispar_attack", "dispar_attack2", "arthur_attack","arthur_attack2","Basicattack","dispar_attack3"}
  26.  
  27. function EncounterStarting()
  28. -- If you want to change the game state immediately, this is the place.
  29. Player.lv = 1
  30. Player.Heal(99)
  31. Player.name = "YouTube"
  32. State("ENEMYDIALOGUE")
  33. end
  34.  
  35.  
  36.  
  37. SetGlobal("intro", true)
  38. SetGlobal("isDead", false)
  39. SetGlobal("battle_progress", -1)
  40.  
  41. function EnemyDialogueStarting()
  42. -- Good location for setting monster dialogue depending on how the battle is going.
  43. -- Example: enemies[1].SetVar('currentdialogue', {"Check it\nout!"}) See documentation for details.
  44. local intro = GetGlobal("intro") --updates the variable "intro" everytime the EnemyDialogueStarting() function is triggered
  45. local battle_progress = GetGlobal("battle_progress")
  46. if intro == true then
  47. Audio.Pause()
  48. enemies[1].SetVar('currentdialogue', {"[noskip][voice:dispar_voice]Prepare-\nse\npara\nencrenca!", "[noskip][func:SetSprite, dispar6][voice:dispar_voice]Para\nficar\ncom um\ncanal po-\npular!", "[func:SetSprite, dispar5][w:80][noskip][func:SetSprite, dispar_hurt][effect:none][waitall:6][voice:dispar_voice]UGH!!!\nARTHUR!!![w:60][func:Battlemusic][func:SetSprite, dispar_1][w:5][next]"})
  49. enemies[2].SetVar('currentdialogue', {"[w:10][noskip][voice:arthur_voice]Encre-\nnca\nem \ndobro", "[w:10][func:SetSprite, arthur_4][noskip][voice:arthur_voice]Para...\nuhh...[w:10][func:SetSprite, arthur_17]", "[noskip][func:SetSprite, arthur_18][effect:none][waitall:5][voice:arthur_voice]Eu\nesque-\nci a\nminha\nfrase[w:60][func:SetSprite, arthur_1][next]"})
  50. SetGlobal("intro", false) -- sets the variable "intro" to false so that this line of dialogue only plays once
  51. SetGlobal("battle_progress", 0)
  52. end
  53. local isDead = GetGlobal("isDead")
  54. if isDead == true then
  55. Audio.Pause()
  56. enemies[1].SetVar('currentdialogue', {"[noskip][func:SetSprite, dispar_dying1][voice:dispar_voice]...", "[noskip][func:SetSprite, dispar_dying2][voice:dispar_voice]...", "[w:10][noskip][func:SetSprite, dispar_dying4][voice:dispar_voice]ta tudo\nbem\nArthur...", "[noskip][func:SetSprite, dispar_dying4][voice:dispar_voice]Ja e\ntarde\ndemais...", "[noskip][func:SetSprite, dispar_dying3][voice:dispar_voice]Me\nprometa\nque...", "[noskip][func:SetSprite, dispar_dying3][voice:dispar_voice]Vai\nganhar\nessa\nluta\nmano![w:5]", "[noskip][func:Kill]"})
  57. enemies[2].SetVar('currentdialogue', {"[noskip][func:SetSprite, arthur_8][voice:arthur_voice]DISPAR!", "[noskip][func:SetSprite, arthur_8][voice:arthur_voice]NAO!\nNAO!\nNAO!", "[noskip][func:SetSprite, arthur_5][voice:arthur_voice]NAO\nMORRA!", "[noskip][func:SetSprite, arthur_hurt2][voice:arthur_voice]NAO\nME\nDIGA\nISSO!", "[noskip][func:SetSprite, arthur_5][voice:arthur_voice]NAO\nMORRA!", "[noskip][func:SetSprite, arthur_hurt2][voice:arthur_voice]PARE!", "[w:20][noskip][func:SetSprite, arthur_4][voice:arthur_voice]Dispar...[w:5]"})
  58. SetGlobal("isDead", false)
  59. end
  60. local battle_progress = GetGlobal("battle_progress")
  61. if battle_progress == 0 then
  62. enemies[1].SetVar('currentdialogue', {"[func:SetSprite, dispar6][voice:dispar_voice]Heheh!", "[func:SetSprite, dispar_2][voice:dispar_voice]Prepare-\n-se!", "[func:SetSprite, dispar_hurt][voice:dispar_voice]AFF!\nNAO\nIMPORTA!", "[func:SetSprite, dispar_hurt][voice:dispar_voice]PRESTA\nATENCAO\nNA\nBATA-\nLHA![w:40][next]"})
  63. enemies[2].SetVar('currentdialogue', {"[func:SetSprite, arthur_2][voice:arthur_voice]Nao\niremos\npegar\nleve!", "[w:10][func:SetSprite, arthur_18][voice:arthur_voice]Era\nessa a\nfrase\nne?", "[func:SetSprite, arthur_17][voice:arthur_voice]...", "[w:5][func:SetSprite, arthur_18][voice:arthur_voice]Ok\nmano[w:40][func:SetSprite, arthur_1][w:1][next]"})
  64. battle_progress = battle_progress + 1
  65. elseif battle_progress == 1 then
  66. enemies[1].SetVar('currentdialogue', {"[func:SetSprite, dispar_1][voice:dispar_voice]FAMA!\nINSCRITOS!\nPOPULA-\nIDADE!", "[voice:dispar_voice]Eu irei\nganhar!", "[func:SetSprite, dispar_hurt][voice:dispar_voice]PARA\nDE\nQUEBRAR\nMEUS S-\nONHOS![next]"})
  67. enemies[2].SetVar('currentdialogue', {"[func:SetSprite, arthur_2][voice:arthur_voice]", "[func:SetSprite, arthur_3][voice:arthur_voice]E isso\nai\nmano!", "[voice:arthur_voice]Se v-\noce nao\nfor at\nropelado\npelos SHORTS!", "[w:5][func:SetSprite, arthur_1][next]"})
  68. else
  69. end
  70. end
  71.  
  72.  
  73. function EnemyDialogueEnding()
  74. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  75. enemies[1].SetVar('currentdialogue', {"[func:SetSprite, dispar_1]"})
  76. enemies[2].SetVar('currentdialogue', {"[func:SetSprite, arthur_1]"})
  77. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  78. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  79. end
  80.  
  81.  
  82. function DefenseEnding() --This built-in function fires after the defense round ends.
  83. Audio.Unpause()
  84. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  85. end
  86.  
  87. function HandleSpare()
  88. State("ENEMYDIALOGUE")
  89. BattleDialog(("Voce tentou poupar ele\nMas ele recusou!"))
  90. enemies[1].SetVar("currentdialogue", ("[voice:dispar_voice]Onde\nvoce\npensa\nque esta\n indo?"))
  91. end
  92.  
  93. function HandleItem(ItemID)
  94. BattleDialog({"Você comeu um " .. ItemID .. "."})
  95. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement