Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- A basic encounter script skeleton you can copy and modify for your own creations.
- music = "Heartache" --Always OGG. Extension is added automatically. Remove the first two lines for custom music.
- encountertext = "Toriel blocks the way!" --Modify as necessary. It will only be read out in the action select screen.
- nextwaves = {"Nothing"}
- wavetimer = 0.1
- arenasize = {155, 130}
- enemies = {
- "Genocide Toriel-(Normal)",
- "CyanSoul"
- }
- enemypositions = {
- {0, 0},
- {0, 142}
- }
- ------------- Global Variables & Other Stuff----------------
- SetGlobal("DEAD",0)
- SetGlobal("help",0)
- SetGlobal("revive",0)
- SetGlobal("Soul",0)
- toriisded1 = false
- toriisded2 = false
- yay1 = false
- yay2 = false
- itemsused = 0
- Current_Turn = 0
- starttime = Time.time
- currenttime = 0
- current = 0
- ------------------------------------------------------------
- function EncounterStarting()
- require "Animations/Toriel_Intro"
- Player.lv = 4
- Player.hp = 32
- Player.name = "Chara"
- SetPPCollision(true)
- AllowPlayerDef(true)
- Inventory.AddCustomItems({"Pie", "MnstrCndy", "MnstrCndy", "MnstrCndy", "SpidrDont", "SpidrDont", "SpidrCidr"}, {0, 0, 0, 0, 0, 0, 0})
- Inventory.SetInventory({"Pie", "MnstrCndy", "MnstrCndy", "MnstrCndy", "SpidrDont", "SpidrDont", "SpidrCidr"})
- State("ACTIONSELECT")
- enemies[2].Call("SetActive", false)
- -- If you want to change the game state immediately, this is the place.
- end
- function Update()
- if enemies[1].GetVar("hp") <= 1 and yay1 == false then
- toriisded1 = true
- SetGlobal("ded", true)
- yay1 = true
- enemies[1].SetVar("hp", 10000)
- enemies[1].SetVar("def", -100)
- end
- if toriisded1 == true then
- Audio.Stop()
- HideToriel()
- enemies[1].Call("SetSprite","a_toriel_fatally_wounded")
- end
- if (GetGlobal("DEAD") == 1 and part == 3) then
- SetGlobal("help",1)
- TorielIntro()
- end
- if (GetGlobal("DEAD") == 1 and part == 4) then
- SetGlobal("revive",1)
- Sacrifice()
- end
- if (GetGlobal("DEAD") == 1 and part == 6) then
- --AnimateToriel()
- end
- end
- part = 1
- function EnemyDialogueStarting()
- local revive = GetGlobal("revive")
- if (GetGlobal("DEAD") == 1 and part == 1) then
- enemies[1].SetVar('currentdialogue',{"[waitall:4][voice:toriel1][effect:shake]Y... you...\nreally hate me\nthat much?", "[waitall:4][voice:toriel1][effect:shake]Now I see who I\nwas protecting by\nkeeping you here.", "[waitall:4][voice:toriel1][effect:shake]Not you...", "[func:SetSprite,a_toriel_fatally_wounded_smiling][waitall:4][voice:toriel1][effect:shake]But them!", "[func:SetSprite,a_toriel_fatally_wounded_before_death][waitall:8][voice:toriel1][effect:none]H a . . .[w:4] h a . . .", "[func:SetSprite,a_toriel_fatally_wounded_before_death][func:State,ENEMYDIALOGUE]"})
- part = 2
- toriisded1 = false
- elseif (GetGlobal("DEAD") == 1 and part == 2) then
- enemies[2].Call("SetActive", true)
- enemies[2].SetVar('currentdialogue',{"[waitall:500][noskip][finished][next]", "[noskip][w:250][next]", "[novoice]Don't die yet mother.[w:60][next]", "[novoice]You are the only \none to stop them at \ntheir current state.[w:60][next]", "[novoice]Please mother, take\nmy[color:42fcff] Soul.[w:30][color:000000] And put a \nend to this horrible\n[color:ff0000]Nightmare.[color:ffffff][w:60][next]", "[novoice]Do it for[color:42fcff] me,[w:30][color:000000]\ndo it for all[color:42fcff] humans\nand monsters.[w:60][next]", "[novoice]Do it[w:60] for your \nkingdom, and most \nimportantly[w:60][next]", "[novoice]Asgore[w:90][next]", "[func:SetSprite,a_nothing][func:State,ENEMYDIALOGUE]"})
- part = 3
- elseif (GetGlobal("DEAD") == 1 and part == 3) then
- enemies[2].SetVar('currentdialogue',{"[waitall:100][noskip][next]", "[noskip][w:100][func:Heal][next]", "[func:State,ENEMYDIALOGUE]"})
- part = 4
- elseif (GetGlobal("DEAD") == 1 and part == 4) then
- enemies[2].Call("SetActive", false)
- enemies[1].SetVar('currentdialogue',{"[noskip][func:SetSprite,a_toriel_healed][w:100][sound:click][func:SetSprite,a_toriel_healed_standing_1][w:100][next]", "[func:State,ENEMYDIALOGUE]"})
- part = 5
- elseif (GetGlobal("DEAD") == 1 and part == 5) then
- enemies[1].Call("SetSprite", "a_toriel_healed_standing_2")
- enemies[1].SetVar('currentdialogue',{"[waitall:12][novoice][effect:none]....[w:30][waitall:1][voice:toriel]I thought it \nwouldn't come to \nthis but i know \nwhat i must do.", "[voice:toriel][effect:none]I thought i \nwouldn't have to \nkill a human[w:15], EVER!", "[func:SetSprite,a_toriel_healed_standing_1][effect:none][novoice][waitall:12]...[waitall:1][voice:toriel]but you[novoice]...", "[func:SetSprite,a_toriel_healed_standing_2][voice:toriel][effect:none]your the \nexpection.", "[voice:toriel][effect:none]I guess it's time \nfor us to say \ngoodbye.", "[noskip][voice:toriel][effect:shake][w:30][func:SetSprite,a_toriel_healed_standing_3][waitall:8]See you in hell.[func:SetSprite,a_queen_toriel_ battle_sprite][w:60][func:BattleStart][func:State,DEFENDING][next]"})
- Opening_Start = {"Battle_Start"}
- nextwaves = { Opening_Start[(#Opening_Start)] }
- part = 6
- elseif (GetGlobal("DEAD") == 1 and part == 6) then
- SetGlobal("Soul",1)
- wavetimer = 16.0
- end
- end
- -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
- possible_attacks = {}
- Attack_Order = {"hand_opening", "hand_sweep", "circles", "bigbulletrain", "warning_fire", "circles", "warning_fire", "wavy_fire"}
- Random_Attacks = {"hand_sweep", "bigbulletrain", "circles", "warning_fire", "wavy_fire"}
- function EnemyDialogueEnding()
- -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
- -- This example line below takes a random attack from 'possible_attacks'.
- if (GetGlobal("Soul") == 1 and Current_Turn <= #Attack_Order) then
- Current_Turn = Current_Turn + 1
- SetGlobal("Current_Turn", Current_Turn)
- nextwaves = { Attack_Order[Current_Turn] }
- elseif (GetGlobal("Soul") == 1 and Current_Turn >= 7) then
- nextwaves = { Random_Attacks[math.random(#Random_Attacks)] }
- starttime = Time.time
- currenttime = 0
- end
- end
- function DefenseEnding() --This built-in function fires after the defense round ends.
- encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
- Audio["RESETDICTIONARY"] = "dogsecret"
- end
- function HandleSpare()
- State("ENEMYDIALOGUE")
- end
- function HandleItem(ItemID)
- if ItemID == "PIE" then
- Player.Heal(99)
- BattleDialog({"You eat the Butterscotch Pie.[w:10]\nYou HP was maxed out!"})
- itemsused = itemsused + 1
- end
- if ItemID == "MNSTRCNDY" then
- Player.Heal(10)
- BattleDialog({"You eat the Monster Candy.[w:10]\nYou recovered 10 HP!"})
- itemsused = itemsused + 1
- end
- if ItemID == "SPIDRDONT" then
- Player.Heal(12)
- BattleDialog({"Don't worry, spider didn't."})
- itemsused = itemsused + 1
- end
- if ItemID == "SPIDRCIDR" then
- Player.Heal(24)
- BattleDialog({"You drank the Spider Cider.[w:10]\nYou recovered 24 HP!"})
- itemsused = itemsused + 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement