Advertisement
TheEmeraldMax

Example Item Test

Dec 2nd, 2020
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This is pastable. its not on the tutorial. its a example.
  2.  
  3. -- music = "final_chance" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  4. encountertext = "Poseur strikes a pose!" --Modify as necessary. It will only be read out in the action select screen.
  5. nextwaves = {"bullettest_chaserorb"}
  6. wavetimer = 4.0
  7. arenasize = {155, 130}
  8.  
  9. require "fakeui"
  10.  
  11. enemies = {
  12. "poseur"
  13. }
  14.  
  15. enemypositions = {
  16. {0, 0}
  17. }
  18.  
  19. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  20. possible_attacks = {"bullettest_bouncy"}
  21.  
  22. function EncounterStarting()
  23.     -- This is the inventory change...
  24.        
  25.     Inventory.AddCustomItems({"Buttspie", "Snowman Piece", "C. Bun","Chocolate"}, {0, 0, 0, 0})
  26.     Inventory.SetInventory({"Buttspie", "Snowman Piece", "Snowman Piece", "C. Bun", "C. Bun", "C. Bun", "C. Bun", "C. Bun"})
  27. end
  28.  
  29. function EnemyDialogueStarting()
  30.     -- Good location for setting monster dialogue depending on how the battle is going.
  31. end
  32.  
  33. function EnemyDialogueEnding()
  34.     -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  35.     nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  36. end
  37.  
  38. function DefenseEnding() --This built-in function fires after the defense round ends.
  39.     encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  40. end
  41.  
  42. function HandleSpare()
  43.     State("ENEMYDIALOGUE")
  44. end
  45.  
  46. function HandleItem(ItemID)
  47. if ItemID == "PIE" then
  48.         Player.Heal(999)
  49.         Audio.PlaySound("eat")
  50.         BattleDialog({"You ate the Butterschotch Pie.\rYour HP was max out!"})
  51.         elseif ItemID == "SNOWMAN PIECE" then
  52.         Audio.PlaySound("SeaTea")
  53.         Player.Heal(45)
  54.           if Player.hp == Player.maxhp then
  55.             BattleDialog({"You ate the Snowman Piece.\rYour HP was max out!"})
  56.           else
  57.             BattleDialog({"You ate the Snowman Piece.\rYou recovered 45 HP!"})
  58.           end
  59.         elseif ItemID == "L. HERO" then
  60.     Audio.PlaySound("LegHero")
  61.         Player.Heal(40)
  62.           if Player.hp == Player.maxhp then
  63.             BattleDialog({"You ate the Legendary Hero! 4 ATK Increased!\rYour HP was max out!"})
  64.           else
  65.             BattleDialog({"You ate the Legendary Hero! 4 ATK Increased!\rYou recovered 40 HP!"})
  66.           end
  67.         elseif ItemID == "I. NOODLES" then
  68.         Player.Heal (90)
  69.     Audio.PlaySound("SeaTea")
  70.         if Player.hp == Player.maxhp then
  71.     BattleDialog({"You ate the Instant Noodles.\rYour HP was max out!"})
  72.     else
  73.     BattleDialog({"You ate the Instant Noodles. \rYou recovered 90 HP!"})
  74.         end
  75.     elseif ItemID == "STEAK" then
  76.     Audio.PlaySound("eat")
  77.     Player.Heal (80)
  78.     if Player.hp == Player.maxhp then
  79.     BattleDialog({"You ate the Face Steak! \rYour HP was max out!"})
  80.     else
  81.     BattleDialog({"You ate the Face Steak! \rYou recovered 80 HP!"})
  82. end
  83. end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement