Guest User

edit2

a guest
Oct 14th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.89 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2. Timers = require "timer"
  3. require "Animations/nomercy"
  4. require "FaakeUi"
  5. require "vsprite"
  6.  
  7. music = "Devilovania OST - AUTOPHOBIA1" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  8. encountertext = "You Know The Drill..." --Modify as necessary. It will only be read out in the action select screen.
  9. nextwaves = {"bullettest_chaserorb"}
  10. wavetimer = 11.0
  11. arenasize = {155, 130}
  12. starttime = Time.time
  13. currenttime = 0
  14.  
  15. enemies = {
  16. "poseur",
  17. "HIS"
  18. }
  19. enemypositions = {
  20. {-10, 80},
  21. {0, 20}
  22. }
  23.  
  24. SetGlobal("intro", true)
  25.  
  26. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  27. possible_attacks = {"Blasters"}
  28.  
  29. function EncounterStarting()
  30. -- If you want to change the game state immediately, this is the place.
  31. require "Libraries/objectdefs"
  32. require "Libraries/colortoys"
  33. require "Libraries/objectdefs2"
  34. require "Libraries/courage"
  35.  
  36. Player.name = "Chara/Tom"
  37. Player.lv = 20
  38. Player.hp = 261
  39. Player.atk = 243
  40. Player.def = 141
  41. Player.lv = Player.lv + 60
  42. Player.SetMaxHPShift(-78 , 0)
  43. Player.Heal(99999)
  44. Audio.Pitch(1)
  45. Audio.Volume(1)
  46. SetGlobal("wavetimer",10.0)
  47.  
  48. timer = 0
  49. framecounter = 0
  50. SetGlobal("courage", true)
  51. SetGlobal("poseur","close")
  52. SetGlobal("poseurDead",false)
  53. SetGlobal("sparedposeur",false)
  54. SetGlobal("sparingposeur",10)
  55.  
  56. SetGlobal("revived",false)
  57.  
  58. SetGlobal("HIS","hidden")
  59. SetGlobal("HISDead",false)
  60.  
  61. switchrevive = false
  62. switchrevive2 = false
  63. --Include the animation Lua file. It's important you do this in EncounterStarting, because you can't create sprites before the game's done loading.
  64. --Be careful that you use different variable names as you have here, because the encounter's will be overwritten otherwise!
  65. --You can also use that to your benefit if you want to share a bunch of variables with multiple encounters.
  66. end
  67.  
  68. function TEST()
  69. if GetGlobal("revived") == false then
  70. encountertext = "[noskip][color:ff0000]WHY SO ANGRY?", "[noskip][color:ff0000]In MY Absolute Way..."
  71. end
  72.  
  73. function Update()
  74. --By calling the AnimateSans() function on the animation Lua file, we can create some movement!
  75. if GetGlobal("revived") == false then
  76. else
  77. if switchrevive == false then
  78. enemies[2].Call("Activate")
  79. enemies[1].Call("Deactivate")
  80. switchrevive = true
  81. end
  82. end
  83. end
  84.  
  85. function EnemyDialogueStarting()
  86. --Player.ForceAttack(1, 1)
  87. SetGlobal("placingposeur", 0)
  88. if switchrevive2 == false then
  89. encountertext = "[noskip][color:ff0000]WHY SO ANGRY?", "[noskip][color:ff0000]In MY Absolute Way..."
  90. switchrevive2 = true
  91. end
  92. end
  93.  
  94. function EnemyDialogueEnding()
  95. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  96. -- This example line below takes a random attack from 'possible_attacks'.
  97. if GetGlobal("revived") == true then
  98. if enemies[2]["hp"] <= 271 then
  99. encountertext = "Its The Final Showdown/n[color:ff0000]Get Ready For HIS Attacks"
  100. else
  101. encountertext = RandomEncounterText()
  102. end
  103. else
  104. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy
  105.  
  106. end
  107. SetGlobal("poseur","close")
  108. SetGlobal("HIS", "normal")
  109. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  110. SetGlobal("placingposeur", -1)
  111. end
  112.  
  113. function DefenseEnding() --This built-in function fires after the defense round ends.
  114. SetGlobal("HIS", "normal")
  115. --currentdialogue = {"..."} --This built-in function gets a random encounter text from a random enemy.
  116. end
  117.  
  118. function HandleSpare()
  119. if GetGlobal("revived") == false and GetGlobal("sparingposeur") == 1 then
  120. SetGlobal("sparedposeur", true)
  121. SetGlobal("sparingposeur", 0)
  122. end
  123. State("ENEMYDIALOGUE")
  124. end
  125. end
Advertisement
Add Comment
Please, Sign In to add comment