Advertisement
TekSoda

Untitled

Aug 14th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. encountertext = "The Judge, Jury, and Executioner\nis finally doing his job." --Modify as necessary. It will only be read out in the action select screen.
  2. wavetimer = 5
  3. arenasize = {240, 180}
  4. nextwaves = {"novawave"}
  5. fightstage = 0
  6. enemies = {"sans"}
  7. enemypositions = {{0, 0}}
  8. waitfordodge = false
  9. SetGlobal("intro", true)
  10. SetGlobal("SansFace", spr_sans_bface_0)
  11. musicisplaying = false
  12. function EncounterStarting()
  13. -- If you want to change the game state immediately, this is the place.
  14. require "Animations/sans_anim"
  15. items = require "Libraries/itemsmenu"
  16. State("ENEMYDIALOGUE")
  17. Audio.LoadFile("OGG_Song_That_Might_Play_When_You_Fight_Sans_Skipedys_")
  18. Audio.Stop()
  19. local randomdialogue = enemies[1].GetVar("randomdialogue") -- retrieve dialogue first, for readability
  20. end
  21.  
  22. function Update()
  23. if waitfordodge then
  24. if Input.Confirm == 1 then
  25. SetGlobal("dodge", true)
  26. waitfordodge = false
  27. end
  28. end
  29. if items.inmenu then
  30. items.Update()
  31. end
  32.  
  33. Animate()
  34. end
  35.  
  36. possible_attacks = {"novawave", "waves", "CYAN", "bullettest_gasterblastersRL", "bullettest_gasterblastersR", "bullettest_gasterblastersL"}
  37.  
  38. function AnimateFace(arg)
  39. SetGlobal("SansFace", arg)
  40. end
  41.  
  42. function OnHit(bullet)
  43. if not bullet.GetVar("safe") then
  44. Player.Hurt(3)
  45. end
  46. end
  47.  
  48.  
  49. function EnemyDialogueStarting()
  50. -- Good location for setting monster dialogue depending on how the battle is going.
  51. local intro = GetGlobal("intro") --updates the variable "intro" everytime the EnemyDialogueStarting() function is triggered
  52. if intro == true then
  53. enemies[1].SetVar('currentdialogue', {"[noskip][font:sans]listen, kid.", "[noskip][font:sans]this is my job...", "[func:AnimateFace,spr_sansb_face_4][noskip][font:sans]...", "[func:AnimateFace,spr_sansb_face_5][func:PlayAudio][noskip][effect:shake][novoice][waitall:5]sorry, old lady.[w:10][next]"})
  54. SetGlobal("intro", false) -- sets the variable "intro" to false so that this line of dialogue only plays once
  55. end
  56. end
  57.  
  58. function PlayAudio()
  59. Audio.LoadFile("OGG_Song_That_Might_Play_When_You_Fight_Sans_Skipedys_.ogg")
  60. end
  61.  
  62.  
  63.  
  64. function EnteringState(newstate, oldstate)
  65. if newstate == "ATTACKING" then
  66. waitfordodge = true
  67. end
  68. if newstate == "ITEMMENU" then
  69. items.OpenItemMenu()
  70. end
  71. end
  72.  
  73. function EnemyDialogueEnding()
  74. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  75. -- This example line below takes a random attack from 'possible_attacks'.
  76. nextwaves = {possible_attacks[math.random(#possible_attacks)]}
  77. if musicisplaying == false then
  78. Audio.Play()
  79. SetGlobal("SansFace", spr_sans_bface_0)
  80. musicisplaying = true
  81. end
  82. end
  83.  
  84. function DefenseEnding() --This built-in function fires after the defense round ends.
  85. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  86. end
  87.  
  88. function HandleSpare()
  89. State("ENEMYDIALOGUE")
  90. end
  91.  
  92. function HandleItem(ItemID)
  93. BattleDialog({"Selected item " .. ItemID .. "."})
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement