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.
- function HealAndReturnString(num,sound)
- local string = nil
- if Player.hp + num >= 99 then
- string = "Your HP was maxed out!"
- else
- string = "You recovered "..num.." HP!"
- end
- Player.hp = Player.hp + num
- if sound ~= nil then
- Audio.PlaySound(sound)
- else
- Audio.PlaySound("healsound")
- end
- return string
- end
- currentstate = "NONE"
- function OnHit(bullet)
- end
- music = "MSBSG normalize" --Always OGG. Extension is added automatically. Remove the first two lines for custom music.
- encountertext = "Tails Doll appeared!" --Modify as necessary. It will only be read out in the action select screen.
- nextwaves = {"bullettest_chaserorb"}
- wavetimer = 4.0
- arenasize = {155, 130}
- enemies = {
- "Tails Doll"
- }
- enemypositions = {
- {0, 0}
- }
- attacknum = 0
- SetGlobal("intro",true)
- sparecount = 0
- -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here i""n case you want to use it.
- possible_attacks = {"bullettest_bouncy", "bullettest_chaserorb", "bullettest_touhou"}
- function EncounterStarting()
- State("ENEMYDIALOGUE")
- Player.name = "Tails"
- Player.lv = 20
- Player.hp = 99
- Inventory.AddCustomItems({"Rbpie", "Rblade", "SSIC", "MntCndy", "Chldog", "Hchldog", "Ggrape", "Pgrape", "CDIC", "Eggs"}, {3, 3, 0, 0, 3, 0, 0, 0, 0, 0})
- Inventory.SetInventory({"Rbpie", "SSIC", "MntCndy", "Chldog", "Ggrape", "Pgrape", "CDIC", "Eggs"})
- end
- function EnemyDialogueStarting()
- local intro = GetGlobal("intro")
- if intro == true then
- enemies[1].SetVar('currentdialogue',{"Hehehehehe.", "Well well well...", "Hello Tails.", "What does your\nDetermination", "say", "to", "this. . ."})
- SetGlobal("intro",false)
- end
- end
- function EnemyDialogueEnding()
- attacknum = attacknum + 1
- if attacknum == 1 then
- nextwaves = {"Spears"}
- elseif attacknum == 2 then
- nextwaves = {"Spears Wave"}
- elseif attacknum == 3 then
- nextwaves = {"wave_spawning_example_x_version"}
- attacknum = 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.
- end
- function HandleSpare()
- if sparecount == 0 then
- enemies[1].SetVar('currentdialogue',{"are you trying to\nspare me?", "pathetic"})
- sparecount = sparecount + 1
- elseif sparecount == 1 then
- enemies[1].SetVar('currentdialogue',{"You did a full\ngenocide and now\nyou are going to\njust spare me?", "no I refuse"})
- sparecount = sparecount + 1
- elseif sparecount == 2 then
- enemies[1].SetVar('currentdialogue',{"If you keep spareing me\nI will end you."})
- sparecount = sparecount + 1
- elseif sparecount == 3 then
- Player.Hurt(99)
- end
- State("ENEMYDIALOGUE")
- end
- function HandleItem(ItemID)
- local index = Inventory.GetItem(1)
- for i=1,8 do
- if string.upper(Inventory.GetItem(i)) == ItemID then
- index = Inventory.GetItem(i)
- break
- end
- end
- if ItemID == "RBPIE" then
- BattleDialog({"You took a bite and felt a\nrazorblade."})
- Player.Hurt(15)
- Inventory.SetItem(index, "Rblade")
- elseif ItemID == "RBLADE" then
- BattleDialog({"You tripped on the razor blade.\nOUCH!"})
- Player.Hurt(30)
- elseif ItemID == "SSIC" then
- BattleDialog({"You ate the soft served\nice cream.[w:10]\n"..HealAndReturnString(99,"eat")})
- elseif ItemID == "MNTCNDY" then
- BattleDialog({"You ate the mint candy.[w:10]\n"..HealAndReturnString(65,"eat")})
- elseif ItemID == "GGRAPE" then
- BattleDialog({"Eat your greens![w:10]\n"..HealAndReturnString(60,"eat")})
- elseif ItemID == "PGRAPE" then
- BattleDialog({"Eat your gree-\ner.. purples.[w:10]\n"..HealAndReturnString(60,"eat")})
- elseif ItemID == "EGGS" then
- BattleDialog({"Mmm protien.[w:10]\n"..HealAndReturnString(40,"eat")})
- elseif ItemID == "CHLDOG" then
- BattleDialog({"You ate half of a chili dog.[w:10]\n"..HealAndReturnString(27,"eat")})
- Inventory.SetItem(index, "Hchldog")
- elseif ItemID == "HCHLDOG" then
- BattleDialog({"You ate the other half\nof the chili dog.[w:10]\n"..HealAndReturnString(27,"eat")})
- elseif ItemID == "CDIC" then
- BattleDialog({"You ate the cookie dough\nice cream.[w:10]\n"..HealAndReturnString(15,"eat")})
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment