Advertisement
Guest User

Sprite issue encounter 2

a guest
Oct 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.52 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. -- music = "shine_on_you_crazy_diamond" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  4. encountertext = "Toriel blocks the way." --Modify as necessary. It will only be read out in the action select screen.
  5. nextwaves = {"bullettest_chaserorb"}
  6. wavetimer = 4.0
  7. arenasize = {155, 130}
  8.  
  9. enemies = {
  10. "Toriel" -- line 10
  11. }
  12.  
  13. enemypositions = {
  14. {0, 0}
  15. }
  16.  
  17. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  18. possible_attacks = {"bullettest_bouncy", "bullettest_chaserorb", "bullettest_touhou"}
  19.  
  20. function EncounterStarting() --line 20
  21.    --If you want to change the game state immediately, this is the place.
  22.      
  23.       sadtoriel = CreateSprite("spr_torielboss_sadhappy_0")
  24.           sadtoriel.Scale(2 , 2)
  25.           sadtoriel.alpha = 0
  26.           sadtoriel.y =330
  27.       hurttoriel = CreateSprite("spr_torielboss_reallyhurt_0")
  28.           hurttoriel.Scale(2 , 2)
  29.           hurttoriel.alpha = 0
  30.           hurttoriel.y = 330
  31.       kneeltoriel = CreateSprite("spr_torielboss_kneel_0")
  32.           kneeltoriel.Scale(2 , 2)
  33.           kneeltoriel.alpha = 0
  34.           kneeltoriel.y = 330
  35.       killedtoriel = CreateSprite("spr_torielboss_murdered_0")
  36.           killedtoriel.Scale(2 , 2)
  37.           killedtoriel.alpha = 0
  38.           killedtoriel.y = 330
  39.      
  40.    Player.name = "Chara"
  41.    Player.lv = 1
  42.    Player.hp = 20
  43.    if isCYF then --line 30
  44.             SetPPCollision(true)
  45.    end
  46. end
  47.  
  48. function EnemyDialogueStarting()
  49.     -- Good location for setting monster dialogue depending on how the battle is going.
  50.     -- If the monster's text has not be set, use one of the default text the monster uses.
  51.    
  52. end
  53. -- line 40
  54. function EnemyDialogueEnding()
  55.     -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  56.     -- The wavetype is set in bullet_testing_Toriel's act commands.
  57.     nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  58.  
  59. end
  60.  
  61. function DefenseEnding() --This built-in function fires after the defense round ends.
  62.     encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  63.         if GetGlobal("spareable") == 1 then --line 50
  64.                 encountertext = "Toriel is sparing you."
  65.         end
  66.  
  67. end
  68.         sparecount = 0
  69.         function HandleSpare()
  70.              sparecount = sparecount + 1
  71.              if sparecount == 1 then
  72.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]..."})
  73.              elseif sparecount == 2 then --line 60
  74.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]...\n..."})
  75.              elseif sparecount == 3 then
  76.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]...\n...\n..."})
  77.              elseif sparecount == 4 then
  78.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]..?"})
  79.              elseif sparecount == 5 then
  80.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]Stop it."})
  81.              elseif sparecount == 6 then
  82.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]What are\n you\ndoing?"})
  83.              elseif sparecount == 7 then --line 70
  84.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]You know\nI can't\nlet you\npast."})
  85.              elseif sparecount == 8 then
  86.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]Ha Ha Ha..."})
  87.              elseif sparecount == 9 then
  88.                        sadtoriel.alpha = 1
  89.                          
  90.                        enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Toriel_Empty][voice:toriel]Pathetic,[w:20]\nis it not[w:20]\nI can't\nsave a\nsingle child."})
  91.              elseif sparecount == 10 then
  92.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]No, I\nunderstand.[next]","[voice:toriel]You would\nnot be happy\nhere."})
  93.              elseif sparecount == 11 then
  94.                        enemies[1].SetVar('currentdialogue',{"[voice:toriel]I'm sorry,\nyou can\nleave now."})
  95.                                enemies[1].SetVar("canspare" , true)
  96.                                enemies[1].SetVar("def" , -66666)
  97.              end
  98.              State("ENEMYDIALOGUE")
  99.           end --line 70
  100.  
  101.  
  102. function HandleItem(ItemID)
  103.     BattleDialog({"Selected item " .. ItemID .. "."})
  104. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement