SHARE
TWEET

Untitled

a guest May 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2. attacknum = 0
  3. textnum = 0
  4. music = "Bonetrousle3.0" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  5. encountertext = "Devil Sans Emerges!" --Modify as necessary. It will only be read out in the action select screen.
  6. wavetimer = 4
  7. arenasize = {155, 130}
  8. SetGlobal("hurtTime",-10)
  9. CanAttack = 1
  10. kill = 1
  11. SetGlobal('damage', 15)
  12. can = 1
  13. Skin = 0
  14. Lol =3
  15. SetPPCollision(true)
  16.  
  17. NewAudio.CreateChannel("1")
  18. NewAudio.PlaySound( "1","Nyeh Heh Heh",true,0.65)
  19. enemies = {
  20. "AsrielFlowur"
  21. }
  22.  
  23. enemypositions = {
  24. {0, 0}
  25. }
  26. Yar = 1
  27. Destroy = 0
  28. thetimer = 0
  29. AttackAnim = 0
  30. function Update()
  31.  
  32. if AttackAnim == 1 then
  33. AnimateFloweyDown()
  34. else
  35. AnimateNone()
  36. end
  37.  
  38. DEBUG(Destroy)
  39.  
  40. if (GetGlobal("blackScreen") == true) then
  41.     if Yar == 1 then
  42.         screenbullet = CreateProjectileAbs("screenfade/white",320,240)
  43.         screenbullet.SetVar('tile', 1)
  44.         screenbullet.SetVar('Destruction', 0)
  45.         screenbullet.sprite.alpha = 1  
  46.         if Destroy == 1 then
  47.     screenbullet.SetVar("Destruction",1)
  48.     Yar = 0
  49.     screenbullet.Remove()
  50. end
  51.     end        
  52. end
  53.  
  54.  
  55.  
  56. SetButtonLayer("Bottom")
  57. if Skin == 1 then
  58. enemies[1].Call("SetSprite","papy/Down")
  59. elseif Skin == 2 then
  60. enemies[1].Call("SetSprite","papy/Up")
  61. elseif Skin == 3 then
  62. enemies[1].Call("SetSprite","papy/Left")
  63. elseif Skin == 4 then
  64. enemies[1].Call("SetSprite","papy/Right")
  65. end
  66. end
  67.  
  68. possible_attacks = {"Husky/blue_H","Husky/at2"}
  69.  
  70. spawntimer7 = 0
  71.  
  72. function EncounterStarting()
  73. require "Animations/Test"
  74.     State("ENEMYDIALOGUE")
  75.     Player.name = "Oliver"
  76.     Player.lv = 20
  77.     Player.hp = 99
  78.     SetGlobal("hurtTime",false)
  79.      Inventory.AddCustomItems({"Pure Hope"}, {0})
  80.     Inventory.SetInventory({"Pure Hope"})
  81. end
  82.  
  83. function Husky1()
  84.  
  85. end
  86.  
  87. function EnemyDialogueStarting()
  88.    
  89.     local intro = GetGlobal("intro")
  90. if intro == true then
  91.     enemies[1].SetVar('currentdialogue',("You Have Stood\n In My Way Long\n Enough!"))
  92.     SetGlobal("intro",false)
  93.     end
  94.       textnum = textnum + 1
  95.       attacknum = attacknum + 1
  96.      
  97.       if can == 1 then
  98.       if textnum == 1 then
  99.   enemies[1].SetVar('currentdialogue', {
  100.             "[noskip][effect:twitch][effect:shake][func:BlackScreen][w:20][func:Begining][w:50][func:BeginingEnd][func:SetSprite,AFlower/Beg]See?\nI never betrayed\nyou![w:10][next]",
  101.             "[noskip][effect:twitch][effect:shake][func:SetSprite,AFlower/Beg]It was all a\ntrick, see?[w:10][next]",
  102.             "[noskip][effect:twitch][effect:shake][func:SetSprite,AFlower/Beg]I was waiting to\nkill him for you![w:10][next]",
  103.             "[noskip][effect:twitch][effect:shake][func:SetSprite,AFlower/BestFr]After all it's me\nyour best friend![w:10][next]",
  104.             "[noskip][effect:twitch][effect:shake][func:SetSprite,AFlower/Helpfull]I'm helpful, I can\nbe useful to you[w:10][next]",
  105.             "[noskip][effect:twitch][effect:shake][func:SetSprite,AFlower/BestFr]I promise I won't\nget in your way[w:10][next]",
  106.             "[noskip][effect:twitch][effect:shake][func:SetSprite,AFlower/Beg]I can help...\n[w:5]I can...\n[w:5]I can...[w:10][next]",
  107.             "[noskip][func:SetSprite,AFlower/Scared][effect:twitch][effect:shake][w:10]Please [w:10]don't \n[w:10]kill[w:10] me.[w:10][next]","[func:SetSprite,AFlower/Scared][func:AttackAnims][effect:twitch][effect:shake][w:35]You Know[w:10] what[w:10][w:10][next]","[func:EndAttackAnims][func:SetSprite,AFlower/Angry]You are going\nto kill me.[w:10][next]","[noskip][func:SetSprite,AFlower/Angry][effect:twitch][effect:shake][w:2]And I don't know[w:10]\nif I can stop you.[w:10][next]","[noskip][func:SetSprite,AFlower/Angry][effect:twitch][effect:shake][w:2]But I have to\ntry any way[w:10][next]","[noskip][func:SetSprite,AFlower/Angry][effect:twitch][effect:shake]Souls.\nMaby you will\nnow work.[w:10][next]","[noskip][func:ChangeAnims][w:25],[func:EndChangeAnims][next]","[noskip][w:20][func:Monster][next]","[noskip]So[w:5][next]","[noskip][next]","[noskip]Can you beat me now[func:Begin][w:5][next]"
  108.         })
  109.  
  110.         Audio.Pause()
  111.  
  112.     elseif textnum == 2 then
  113.   enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Papy/Great]Nyeh Heh Heh\nSans taught me\nsome tricks",
  114.                                        "[func:SetSprite,Papy/Happy]Can not wait\nTo try them"})
  115.     elseif textnum == 3 then
  116.   enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Papy/Happy]Heh\nI will become",
  117.                                        "Soooo",
  118.                                        "[func:SetSprite,Papy/Bring]Pop\nPop\nPop\nPOPULAR"})
  119.                                        
  120.     elseif textnum == 4 then
  121.   enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Papy/Happy]Human\nbow down before\nthe ggggreat\nPapyrus",
  122.                                        "[func:SetSprite,Papy/Great]Or not...",})
  123.     elseif textnum == 5 then
  124.   enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Papy/Happy]Do you want\n To hang out\n after I capture\nyou"})
  125.     elseif textnum == 6 then
  126.   enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Papy/Happy]Nyeh Heh Ow.\nI trust you\nwill come to\nyour sences",
  127.                                        "[func:SetSprite,Papy/Great]I hope"})
  128.     elseif textnum == 7 then
  129.   enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Papy/Angry]Human\nI command\nyou to back\ndown"})
  130.       elseif textnum == 8 then
  131.   enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Papy/Great]Nyeh Heh Heh\nWell done\nHuman\nYou are doing \nwell"})
  132.   elseif textnum == 9 then
  133.   enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Papy/Cry]Human\nThis hurts\nstop"})
  134.     elseif textnum == 10 then
  135.   enemies[1].SetVar('currentdialogue',{" [func:SetSprite,Chara/Battle/CNeutral]Hah.\nVery determined.\nLets\'Justify\' That"})
  136.  elseif textnum == 11 then
  137.  enemies[1].SetVar('currentdialogue',{"Okay, \nHere we go\nThis will\nNeed alot of\nJustice"})
  138.  elseif textnum == 12 then
  139.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CNeutral]You are\nstrong","I'll give\nyou that"})
  140.   elseif textnum == 13 then
  141.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CNeutral]You're not\nBrave enough\nfor this\nthough","(Tip):Brave soul:\nUse space\nto change \nand match\nclours"})
  142.  elseif textnum == 14 then
  143.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CNeutral]You really\nneed to\nslow down"})
  144.  elseif textnum == 15 then
  145.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CMad]That's it\nIf you do\nnot die\nI will use\nmy special attack"})
  146.  elseif textnum == 16 then
  147.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CJoy]Okay\nYou asked for it","I will\nhave to drop\nmy shield\nthough"})
  148.  enemies[1].SetVar("Yes", 0)
  149.  elseif textnum == 17 then
  150.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CNeutral]Wait\nWhy did\nYou not\nkill me"})
  151.  elseif textnum == 18 then
  152.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CNeutral]Uh\nI'm killing\nYou so\nyou try to\nkill me right?"})
  153.  elseif textnum == 19 then
  154.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CNeutral]Are You\ntrying to\nmercy me?"})
  155.  elseif textnum == 20 then
  156.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CJoy]Oh wow.\nFine\nYou may spare\n me"})
  157.  enemies[1].SetVar("name", "[starcolor:ffff00][color:ffff00]C H A R A")
  158.  elseif textnum == 21 then
  159.  enemies[1].SetVar('currentdialogue',{"[func:SetSprite,Chara/Battle/CMad]Not"})
  160.   end
  161.  end
  162. end
  163.  
  164. function EnemyDialogueEnding()
  165. if CanAttack == 1 then
  166.   if attacknum == 1 then
  167.    Audio.StopAll()
  168.    Audio.Play()
  169.    nextwaves = {"Pap/5"}
  170.    Player.lv = 20
  171.    Player.Heal(99)
  172.   elseif attacknum == 2 then
  173.    nextwaves = {"Pap/2"}
  174.    Player.Heal(99)
  175.   elseif attacknum == 3 then
  176.    nextwaves = {"Pap/3"}
  177.    Player.Heal(99)
  178.   elseif attacknum == 4 then
  179.    nextwaves = {"Pap/4"}
  180.    Player.Heal(99)
  181.   elseif attacknum == 5 then
  182.    nextwaves = {"Pap/5"}
  183.    Player.Heal(99)
  184.   elseif attacknum == 6 then
  185.    nextwaves = {"Pap/6"}
  186.    Player.Heal(99)
  187.   elseif attacknum == 7 then
  188.    nextwaves = {"Pap/7"}
  189.    Player.Heal(99)
  190.   elseif attacknum == 8 then
  191.    nextwaves = {"Pap/8"}
  192.    Player.Heal(99)
  193.   elseif attacknum == 9 then
  194.    nextwaves = {"As/9"}
  195.    Player.Heal(99)
  196.   elseif attacknum == 10 then
  197.    nextwaves = {"As/10"}
  198.    Player.Heal(99)
  199.   elseif attacknum == 11 then
  200.    nextwaves = {"As/11"}
  201.    Player.Heal(99)
  202.   elseif attacknum == 12 then
  203.    nextwaves = {"As/12"}
  204.    Player.Heal(99)
  205.   elseif attacknum == 13 then
  206.    nextwaves = {"As/13"}
  207.    Player.Heal(99)
  208.   elseif attacknum == 14 then
  209.    nextwaves = {"As/14"}
  210.    Player.Heal(99)
  211.   elseif attacknum == 15 then
  212.    nextwaves = {"As/15"}
  213.    Player.Heal(99)
  214.   elseif attacknum == 16 then
  215.    nextwaves = {"As/16"}
  216.    Player.Heal(99)
  217.    elseif attacknum == 17 then
  218.    nextwaves = {"Husky/Blank"}
  219.    elseif attacknum == 18 then
  220.    nextwaves = {"Husky/Blank"}
  221.    elseif attacknum == 19 then
  222.    nextwaves = {"Husky/Blank"}
  223.    elseif attacknum == 20 then
  224.    nextwaves = {"Husky/Blank"}
  225.    elseif attacknum == 21 then
  226.    nextwaves = {"As/Ha"}
  227.    attacknum = 0
  228.   end
  229. end
  230.  if CanAttack == 0 then
  231.   nextwaves = {"Husky/Blank"}
  232.  end
  233. end
  234.  
  235. function DefenseEnding()
  236.     encountertext = RandomEncounterText()
  237. end
  238.  
  239. function HandleSpare()
  240.     State("ENEMYDIALOGUE")
  241. end
  242. function HandleItem(ItemID)
  243.     if ItemID == "PURE HOPE" then
  244.         Player.Heal(50)
  245.         BattleDialog({"Devil Sans's soul was consumed.[w:10]\nYou recovered 50 HP!"})
  246.     end
  247. end
  248.  
  249. function OnHit(bullet)
  250. if (bullet.GetVar('Destruction')) == 1 then
  251.     whitebullet.Remove()
  252.     elseif(bullet.GetVar('tile')) == 0 then
  253.             Player.Hurt(1)
  254.     end
  255. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top