Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- encountertext = "The Judge, Jury, and Executioner\nis finally doing his job." --Modify as necessary. It will only be read out in the action select screen.
- wavetimer = 5
- arenasize = {240, 180}
- nextwaves = {"novawave"}
- fightstage = 0
- enemies = {"sans"}
- enemypositions = {{0, 0}}
- waitfordodge = false
- SetGlobal("intro", true)
- SetGlobal("SansFace", spr_sans_bface_0)
- musicisplaying = false
- function EncounterStarting()
- -- If you want to change the game state immediately, this is the place.
- require "Animations/sans_anim"
- items = require "Libraries/itemsmenu"
- State("ENEMYDIALOGUE")
- Audio.LoadFile("OGG_Song_That_Might_Play_When_You_Fight_Sans_Skipedys_")
- Audio.Stop()
- local randomdialogue = enemies[1].GetVar("randomdialogue") -- retrieve dialogue first, for readability
- end
- function Update()
- if waitfordodge then
- if Input.Confirm == 1 then
- SetGlobal("dodge", true)
- waitfordodge = false
- end
- end
- if items.inmenu then
- items.Update()
- end
- Animate()
- end
- possible_attacks = {"novawave", "waves", "CYAN", "bullettest_gasterblastersRL", "bullettest_gasterblastersR", "bullettest_gasterblastersL"}
- function AnimateFace(arg)
- SetGlobal("SansFace", arg)
- end
- function OnHit(bullet)
- if not bullet.GetVar("safe") then
- Player.Hurt(3)
- end
- end
- function EnemyDialogueStarting()
- -- Good location for setting monster dialogue depending on how the battle is going.
- local intro = GetGlobal("intro") --updates the variable "intro" everytime the EnemyDialogueStarting() function is triggered
- if intro == true then
- enemies[1].SetVar('currentdialogue', {"[noskip][font:sans]listen, kid.", "[noskip][font:sans]this is my job...", "[func:AnimateFace,spr_sansb_face_4][noskip][font:sans]...", "[func:AnimateFace,spr_sansb_face_5][func:PlayAudio][noskip][effect:shake][novoice][waitall:5]sorry, old lady.[w:10][next]"})
- SetGlobal("intro", false) -- sets the variable "intro" to false so that this line of dialogue only plays once
- end
- end
- function PlayAudio()
- Audio.LoadFile("OGG_Song_That_Might_Play_When_You_Fight_Sans_Skipedys_.ogg")
- end
- function EnteringState(newstate, oldstate)
- if newstate == "ATTACKING" then
- waitfordodge = true
- end
- if newstate == "ITEMMENU" then
- items.OpenItemMenu()
- end
- end
- 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'.
- nextwaves = {possible_attacks[math.random(#possible_attacks)]}
- if musicisplaying == false then
- Audio.Play()
- SetGlobal("SansFace", spr_sans_bface_0)
- musicisplaying = true
- 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.
- end
- function HandleSpare()
- State("ENEMYDIALOGUE")
- end
- function HandleItem(ItemID)
- BattleDialog({"Selected item " .. ItemID .. "."})
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement