Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2. music = "Chara" --Always OGG. Extension is added automatically. Uncomment for custom music.
  3. encountertext = "..." --Modify as necessary. It will only be read out in the action select screen.
  4. wavetimer = 10000000000
  5. arenasize = {155, 130}
  6. SetGlobal("AttackNow", false)
  7. SetGlobal("Threat1", false)
  8. SetGlobal("Starting", 1)
  9. attack_counter = 1
  10. attack_list = {"blackout1","attack1"}
  11. AttackNow = false
  12. nextwaves = {"no"}
  13. Starting = 1
  14. SetGlobal("Progress", 1)
  15. SetGlobal("sprite", ArmUp1)
  16. SetGlobal("Atk1", 0)
  17. enemies = {
  18. "Sans"
  19. }
  20.  
  21. enemypositions = {
  22. {0, 0}
  23. }
  24.  
  25. function Update()
  26. if GetGlobal("Atk1") == 1 then
  27. enemies[1].Call("SetSprite",GetGlobal("sprite"))
  28. end
  29. local attack_counter = GetGlobal("Progress")
  30. local Starting = GetGlobal("Starting")
  31. if Starting == 0 then
  32. nextwaves = {attack_list[attack_counter]}
  33. end
  34. if waitfordodge then
  35. if Input.Confirm == 1 and Starting == 0 then
  36. SetGlobal("dodge", true)
  37. waitfordodge = false
  38. end
  39. Animate()
  40. end
  41.  
  42. function EncounterStarting()
  43. SetGlobal("intro", 1)
  44. State("ENEMYDIALOGUE")
  45. require "blue"
  46. require "Animations/Sansimation"
  47. end
  48.  
  49. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  50. possible_attacks = {"blackout"}
  51.  
  52. function EnteringState(newstate, oldstate)
  53. if(newstate == "ACTIONSELECT") then
  54. fui_selectingButton = true
  55. else
  56. fui_selectingButton = false
  57. end
  58. if(newstate == "ENEMYDIALOGUE" or newstate == "DEFENDING") then
  59. fui_inMenu = false
  60. else
  61. fui_inMenu = true
  62. end
  63. end
  64.  
  65. function EnemyDialogueStarting()
  66. local intro = GetGlobal("intro")
  67. if intro == 1 then
  68. enemies[1].SetVar('currentdialogue',{"[font:sans][effect:none][noskip][voice:Dusty][color:3d0000][w:25][func:SetSprite,Opening/SansT][waitall:2]huh?","[font:sans][effect:none][noskip][voice:Dusty][color:3d0000][waitall:2]what are you talking\nabout?","[font:sans][effect:none][noskip][voice:Dusty][color:3d0000][waitall:2]i deserve a break.","[font:sans][effect:none][noskip][voice:Dusty][color:3d0000][waitall:2]besides,[w:3] i've gotten\na ton of work done\nso far.","[font:sans][effect:none][noskip][voice:Dusty][color:3d0000][waitall:2]no need to get\na[w:2][color:a59200]head[color:3d0000][w:2] of ourselves.","[font:sans][effect:none][noskip][voice:Dusty][color:3d0000][waitall:2]either way,[w:3] the king\nevacuated everyone.","[font:sans][effect:none][noskip][voice:Dusty][color:3d0000][waitall:2]no point in scavenging\nfor every last soul.","[font:sans][effect:none][noskip][voice:Dusty][color:3d0000][waitall:2]heh.[w:5] as far as i care...","[font:sans][effect:none][noskip][voice:Dusty][color:720000][waitall:7]we're the only ones\nleft.","[func:SetSprite,Opening/Sans][next]"})
  69. SetGlobal("intro", false)
  70. end
  71. if GetGlobal("Threat1") == true then
  72. enemies[1].SetVar('currentdialogue', {"[novoice][effect:none][font:monster][novoice][waitall:7][noskip]Dust\nto\ndust."})
  73. SetGlobal("Threat1", false)
  74. end
  75.  
  76. function EnemyDialogueEnding()
  77. if attack_counter > -1 and intro == false then
  78. attack_counter = attack_counter + 1
  79. if attack_counter > #attack_list then
  80. attack_counter = 1
  81. end
  82. end
  83.  
  84. function EnteringState(newstate, oldstate)
  85. if newstate == "ATTACKING" then
  86. waitfordodge = true
  87. end
  88. end
  89.  
  90. function HandleSpare()
  91. State("ENEMYDIALOGUE")
  92. end
  93.  
  94. function HandleItem(ItemID)
  95. State("ACTIONSELECT")
  96. end
  97. end
  98. end
  99. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement