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 = "Chara" --Always OGG. Extension is added automatically. Uncomment for custom music.
- encountertext = "..." --Modify as necessary. It will only be read out in the action select screen.
- wavetimer = 10000000000
- arenasize = {155, 130}
- SetGlobal("AttackNow", false)
- SetGlobal("Threat1", false)
- SetGlobal("Starting", 1)
- attack_counter = 1
- attack_list = {"blackout1","attack1"}
- AttackNow = false
- nextwaves = {"no"}
- Starting = 1
- SetGlobal("Progress", 1)
- SetGlobal("sprite", ArmUp1)
- SetGlobal("Atk1", 0)
- enemies = {
- "Sans"
- }
- enemypositions = {
- {0, 0}
- }
- function Update()
- if GetGlobal("Atk1") == 1 then
- enemies[1].Call("SetSprite",GetGlobal("sprite"))
- end
- local attack_counter = GetGlobal("Progress")
- local Starting = GetGlobal("Starting")
- if Starting == 0 then
- nextwaves = {attack_list[attack_counter]}
- end
- if waitfordodge then
- if Input.Confirm == 1 and Starting == 0 then
- SetGlobal("dodge", true)
- waitfordodge = false
- end
- Animate()
- end
- function EncounterStarting()
- SetGlobal("intro", 1)
- State("ENEMYDIALOGUE")
- require "blue"
- require "Animations/Sansimation"
- 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 = {"blackout"}
- function EnteringState(newstate, oldstate)
- if(newstate == "ACTIONSELECT") then
- fui_selectingButton = true
- else
- fui_selectingButton = false
- end
- if(newstate == "ENEMYDIALOGUE" or newstate == "DEFENDING") then
- fui_inMenu = false
- else
- fui_inMenu = true
- end
- end
- function EnemyDialogueStarting()
- local intro = GetGlobal("intro")
- if intro == 1 then
- 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]"})
- SetGlobal("intro", false)
- end
- if GetGlobal("Threat1") == true then
- enemies[1].SetVar('currentdialogue', {"[novoice][effect:none][font:monster][novoice][waitall:7][noskip]Dust\nto\ndust."})
- SetGlobal("Threat1", false)
- end
- function EnemyDialogueEnding()
- if attack_counter > -1 and intro == false then
- attack_counter = attack_counter + 1
- if attack_counter > #attack_list then
- attack_counter = 1
- end
- end
- function EnteringState(newstate, oldstate)
- if newstate == "ATTACKING" then
- waitfordodge = true
- end
- end
- function HandleSpare()
- State("ENEMYDIALOGUE")
- end
- function HandleItem(ItemID)
- State("ACTIONSELECT")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement