Advertisement
Guest User

edit3

a guest
Oct 14th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 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.  
  37. Player.name = "Chara/Tom"
  38. Player.lv = 20
  39. Player.hp = 261
  40. Player.atk = 243
  41. Player.def = 141
  42. Player.lv = Player.lv + 60
  43. Player.SetMaxHPShift(-78. , 0)
  44. Player.Heal(99999)
  45. Audio.Pitch(1)
  46. Audio.Volume(1)
  47. SetGlobal("wavetimer",10.0)
  48.  
  49. timer = 0
  50. framecounter = 0
  51. SetGlobal("courage", true)
  52. SetGlobal("poseur","close")
  53. SetGlobal("poseurDead",false)
  54. SetGlobal("sparedposeur",false)
  55. SetGlobal("sparingposeur",10)
  56.  
  57. SetGlobal("revived",false)
  58.  
  59. SetGlobal("HIS","hidden")
  60. SetGlobal("HISDead",false)
  61.  
  62. switchrevive = false
  63. switchrevive2 = false
  64. --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.
  65. --Be careful that you use different variable names as you have here, because the encounter's will be overwritten otherwise!
  66. --You can also use that to your benefit if you want to share a bunch of variables with multiple encounters.
  67. end
  68.  
  69. function Anger() -- not used for anything yet just plannning ahead
  70. Audio.Pause()
  71. Player.Heal(10)
  72. Audio.LoadFile("Revenge")
  73. end
  74.  
  75. function Update()
  76. --By calling the AnimateSans() function on the animation Lua file, we can create some movement!
  77. library.Update()
  78. if GetGlobal("revived") == false then
  79. else
  80. if switchrevive == false then
  81. enemies[2].Call("Activate")
  82. enemies[1].Call("Deactivate")
  83. switchrevive = true
  84. end
  85. end
  86. end
  87.  
  88. function EnemyDialogueStarting()
  89. --Player.ForceAttack(1, 1)
  90. SetGlobal("placingposeur", 0)
  91. if switchrevive2 == false then
  92. encountertext = "[noskip][color:ff0000]WHY SO ANGRY?", "[noskip][color:ff0000]In MY Absolute Way..."
  93. switchrevive2 = true
  94. end
  95. end
  96.  
  97. function EnemyDialogueEnding()
  98. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  99. -- This example line below takes a random attack from 'possible_attacks'.
  100. if GetGlobal("revived") == true then
  101. if enemies[2]["hp"] <= 200 then
  102. encountertext = "Its The Final Showdown/n[color:ff0000]Get Ready for HIS Attacks"
  103. else
  104. encountertext = RandomEncounterText()
  105. end
  106. else
  107. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  108.  
  109. end
  110. SetGlobal("poseur","close")
  111. SetGlobal("HIS", "normal")
  112. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  113. SetGlobal("placingposeur", -1)
  114. end
  115.  
  116. function DefenseEnding() --This built-in function fires after the defense round ends.
  117. SetGlobal("HIS", "normal")
  118. --currentdialogue = {"..."} --This built-in function gets a random encounter text from a random enemy.
  119. end
  120.  
  121. function HandleSpare()
  122. if GetGlobal("revived") == false and GetGlobal("sparingposeur") == 1 then
  123. SetGlobal("sparedposeur", true)
  124. SetGlobal("sparingposeur", 0)
  125. end
  126. State("ENEMYDIALOGUE")
  127. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement