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 = "Terraria_Music_Boss_1" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
- encountertext = "You feel an evil presence\rwatching you..." --Modify as necessary. It will only be read out in the action select screen.
- nextwaves = {"bullettest_chaserorb"}
- wavetimer = 4.0
- arenasize = {155, 130}
- autolinebreak = true
- enemies = {
- "Eye of Cthulhu"
- }
- enemypositions = {
- {0, 0}
- }
- SetGlobal("phase", 1)
- SetGlobal("SetSprite", 0)
- require "Animations/EoC_Phase2_anim"
- -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
- possible_attacks = {"bullettest_chaserorb", "vertical", "bullet_purplewave"}
- function EncounterStarting()
- -- If you want to change the game state immediately, this is the place.
- Player.lv = 2
- Player.hp = 24
- Player.name = "Marlon"
- Player.atk = 150
- Inventory.AddCustomItems({"Mushroom", "L. Healing P", "B. Honey", "Arkhalis", "Empty Gun"}, {0, 0, 0, 0, 1})
- Inventory.SetInventory({"Mushroom", "Mushroom", "L. Healing P", "L. Healing P", "B. Honey", "B. Honey", "Arkhalis", "Empty Gun"})
- eyeofcthulhu = CreateSprite("Eye_of_Cthulhu")
- eyeofcthulhu.MoveTo(315,350)
- eyeofcthulhu.SetAnimation({"Eye_of_Cthulhu", "Eye_of_Cthulhu2", "Eye_of_Cthulhu3"}, 1/7)
- end
- function Arkhalis()
- Player.atk = Player.atk + 200
- end
- function Update()
- --By calling the AnimateSans() function on the animation Lua file, we can create some movement!
- if GetGlobal("phase") == 1 then
- Animateeyeofcthulhu()
- eyeofcthulhuphase2.alpha = 0
- else
- Animateeyeofcthulhuphase2()
- eyeofcthulhu.StopAnimation ()
- eyeofcthulhu.Remove ()
- eyeofcthulhuphase2.SendToTop ()
- eyeofcthulhuphase2.alpha = 1
- end
- end
- function Animateeyeofcthulhu()
- eyeofcthulhu.rotation = 10*math.sin(Time.time + 2)
- end
- function EnemyDialogueStarting()
- -- Good location for setting monster dialogue depending on how the battle is going.
- end
- function EnemyDialogueEnding()
- -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
- nextwaves = { possible_attacks[math.random(#possible_attacks)] }
- end
- function DefenseEnding() --This built-in function fires after the defense round ends.
- nextwaves = { possible_attacks[math.random(#possible_attacks)] } --This built-in function gets a random encounter text from a random enemy.
- end
- function HandleSpare()
- end
- function HandleItem(ItemID)
- -- (ItemID is in all uppercase, LIKE THIS)
- if ItemID == "MUSHROOM" then
- Player.Heal(5)
- BattleDialog({"You ate a Mushroom.\nIt didn't make you grow\nYou recovered 5 HP."})
- elseif ItemID == "L. HEALING P" then
- Player.Heal(10)
- BattleDialog({"You drank the Potion.\nTastes like mushroom\nYou recovered 10 HP."})
- elseif ItemID == "B. HONEY" then
- Player.Heal(12)
- BattleDialog({"You drank the Bottled Honey.\nThis honey is very sweet.\nYou recovered 12 HP."})
- elseif ItemID == "ARKHALIS" then
- BattleDialog({"You equipped the Arkhalis sword.[func:Arkhalis]", "Your ATTACK has increased!"})
- elseif ItemID == "EMPTY GUN" then
- Inventory.SetAmount(150) -- 12 weapon ATK
- BattleDialog({"You equipped the Empty Gun."})
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement