Advertisement
Guest User

Untitled

a guest
May 16th, 2025
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.52 KB | None | 0 0
  1.  
  2.  
  3. ---Episode Settings---
  4. local powerupGuard= API.load("powerupGuard");
  5. function onStart()
  6. end
  7. local coyotetime= API.load("coyotetime");
  8. local cp = require("customPowerups")
  9. cp.registerItemTier(957, true)
  10. cp.registerPowerup("ap_superball")
  11. local ShopSystem = require("ShopSystem")
  12. local AnotherCurrency = require("anothercurrency")
  13. local wtp = require("whatsThatPowerup")
  14. extra = require("extraNPCProperties")
  15. local peachSpinjump = require("peachSpinjump")
  16. local GP = require("GroundPound")
  17. GP.applyDefaultSettings()
  18. local swooperSuit = cp.addPowerup("Swooper Suit", "powerups/swooperSuit", 965)
  19. local chuckSuit = cp.addPowerup("Chuck Suit", "powerups/chuckSuit", 959)
  20. local jumpingLui = cp.addPowerup("Jumping Lui", "powerups/jumpingLui", 961)
  21. cp.transformWhenSmall(961, 9)
  22.  
  23. local goldFlower = cp.addPowerup("Gold Flower", "powerups/goldFlower", 968)
  24.  
  25.  
  26. local goldBall = require("AI/goldFireBall")
  27.  
  28. goldBall.addBlockTransformation(90, 33)
  29. goldBall.addBlockTransformation(188, 88)
  30. goldBall.addBlockTransformation(115, 33)
  31. goldBall.whitelistBlock(115)
  32.  
  33. tj = require("TripleJump") -- gotta load the library
  34.  
  35. Player.setCostume(CHARACTER_MARIO, "SMW-Mario")
  36. Player.setCostume(CHARACTER_LUIGI, "SMW-Luigi")
  37.  
  38. tj.register(CHARACTER_LUIGI,{1,2,3,2,1,2,3,2},{15,13,15,13})
  39.  
  40. local sunshineSpinJump = require("sunshineSpinJump")
  41. local smwPause = require("smwPause")
  42. local luigiHitsBlocksNormally = require("luigiHitsBlocksNormally")
  43. local inventory = require("simpleInventory")
  44.  
  45. --Peach, Toad, and Link don't have Whip form sprites, so this blacklists them just so it doesn't look weird in-game
  46. --If you have sprites for them, feel free to add them into the powerups folder and remove these blacklist lines.
  47. --cp.blacklistCharacter(CHARACTER_PEACH, superWhip.name)
  48. --cp.blacklistCharacter(CHARACTER_TOAD, superWhip.name)
  49. --cp.blacklistCharacter(CHARACTER_LINK, superWhip.name)
  50.  
  51.  
  52. ---Character Settings---
  53. function onTick()
  54. if player.character == 4 then
  55.   for k,v in ipairs(NPC.get(34)) do
  56.      v:transform(14)
  57.   end
  58.   for k,v in ipairs(NPC.get(169)) do
  59.     v:transform(264)
  60.   end
  61. end
  62. if player.character == 3 then
  63.     for k,v in ipairs(NPC.get(34)) do
  64.        v:transform(14)
  65.     end
  66.     for k,v in ipairs(NPC.get(169)) do
  67.       v:transform(264)
  68.     end
  69.     for k,v in ipairs(NPC.get(291)) do
  70.         v:transform(436)
  71.       end
  72.   end
  73. if player.character == 2 then
  74.     for k,v in ipairs(NPC.get(171)) do
  75.        v:transform(291)
  76.     end
  77. end
  78. if player.character == 1 then
  79.     for k,v in ipairs(NPC.get(171)) do
  80.        v:transform(970)
  81.     end
  82. end
  83. end
  84. local aw = require("anotherwalljump")
  85. aw.registerAllPlayersDefault()
  86.  
  87. -- Loading Libraries --
  88. local anothercurrency = require("anothercurrency")
  89. local ShopSystem = require("ShopSystem")
  90. local textplus = require("textplus")
  91. local hudoverride = require("hudoverride")
  92.  
  93. -- Images --
  94. local shopItems = Graphics.loadImageResolved("ShopSystem/shopItems.png")
  95. local coinsIcon = Graphics.loadImageResolved("ShopSystem/coinImage.png")
  96.  
  97. -- anothercurrency stuff --
  98. coinCounter = anothercurrency.registerCurrency("coins", true)
  99. coinCounter:registerLimit(9999, function() end)
  100. local myCurrency = anothercurrency.registerCurrency("Raven Coins", false)
  101. myCurrency:registerCoin(274, 1)
  102.  
  103. -- shopsystem stuff --
  104. local myShop = ShopSystem.create{music = "(MUSIC)/Friend Intro 12.ogg"}
  105. local miscShop = ShopSystem.create{music = "(MUSIC)/Friend Intro 12.ogg"}
  106. local bootShop = ShopSystem.create{music = "(MUSIC)/Friend Intro 12.ogg"}
  107. local animalShop = ShopSystem.create{}
  108.  
  109. -- variable currency stuff --
  110. local simpleVar = 0
  111. local simpleVar2 = 0
  112.  
  113. local function handleVarCurrency(shopItem)
  114.     if simpleVar >= shopItem.price then
  115.         simpleVar = simpleVar - shopItem.price
  116.     end
  117. end
  118.  
  119. local function handleVarCurrency2(shopItem)
  120.     if simpleVar2 >= shopItem.price then
  121.         simpleVar2 = simpleVar2 - shopItem.price
  122.     end
  123. end
  124. -----------------------------
  125.  
  126. local mushroom = myShop:RegisterItem{NPCid =   9, image = shopItems, price = 10,  amount = 5, name = "Mushroom", sourceX = 0, sourceY = 0, sourceWidth = 32, sourceHeight = 32, currency = coinCounter}
  127. local fire =     myShop:RegisterItem{NPCid =  14, image = shopItems, price = 20,  amount = 5, name = "Fire Flower", description = "It feels warm.", sourceX = 0, sourceY = 32, sourceWidth = 32, sourceHeight = 32, currency = coinCounter}
  128. local ice =      myShop:RegisterItem{NPCid = 264, image = shopItems, price = 30,  amount = 5, name = "Ice Flower", sourceX = 0, sourceY = 160, sourceWidth = 32, sourceHeight = 32, currency = coinCounter, description = "It feels cold."}
  129. local watch =     myShop:RegisterItem{NPCid =  248,  image = shopItems, price = 35,  amount = 5, name = "Pocket Watch", sourceX = 0, sourceY = 64, sourceWidth = 32, sourceHeight = 32, currency = coinCounter, description = "<wave 2>Ivan Gilbert Recommends</wave>"}
  130. local up =  myShop:RegisterItem{NPCid = 90, image = shopItems, price = 50,  amount = 5, name = "1-Up Mushroom", sourceX = 0, sourceY = 192, sourceWidth = 32, sourceHeight = 32, currency = coinCounter, description = "An Extra Life - Only works on playable Characters."}
  131. local threeup =   myShop:RegisterItem{NPCid = 188, image = shopItems, price = 175,  amount = 3, name = "3-Up Moon", sourceX = 0, sourceY = 224, sourceWidth = 32, sourceHeight = 32, currency = coinCounter, description = "Three Extra Lives Are Better Then One."}
  132. local turnip =   myShop:RegisterItem{NPCid = 140, image = shopItems, price = 15,  amount = 3, name = "Turnip", sourceX = 128, sourceY = 160, sourceWidth = 32, sourceHeight = 32, currency = coinCounter, description = "A Vegetable With a Face On It. Nothing To See Here."}
  133. local shell =   myShop:RegisterItem{NPCid = 113, image = shopItems, price = 35,  amount = 5, name = "Koopa Shell", sourceX = 128, sourceY = 128, sourceWidth = 32, sourceHeight = 32, currency = coinCounter, description = "<tremble 2>Is This Even Legal?!</tremble>"}
  134. local questitem =  myShop:RegisterItem{NPCid = 278, image = shopItems, closeAfterPurchase = true, price = 2500,  amount = 1, name = "Propeller Box", sourceX = 0, sourceY = 96, sourceWidth = 32, sourceHeight = 44, currency = coinCounter, description = "Actual Item Appearence may differ according to region."}
  135.  
  136. mushroom.description = "A Simple Mushroom."
  137.  
  138. local item1 = miscShop:RegisterItem{NPCid = 1, price = 10,  amount = 5, currency = coinCounter, useReserve = true}
  139. local item2 = miscShop:RegisterItem{NPCid = 2, price = 20,  amount = 5, currency = coinCounter, useReserve = true}
  140. local item3 = miscShop:RegisterItem{NPCid = 3, price = 30,  amount = 5, currency = coinCounter, useReserve = true}
  141. local item4 = miscShop:RegisterItem{NPCid = 4, price = 50,  amount = 5, currency = coinCounter, useReserve = true}
  142. local item5 = miscShop:RegisterItem{NPCid = 5, price = 50,  amount = 5, currency = coinCounter, useReserve = true}
  143. local item6 = miscShop:RegisterItem{NPCid = 6, price = 30,  amount = 5, currency = coinCounter, useReserve = true}
  144. local item7 = miscShop:RegisterItem{NPCid = 7, price = 10,  amount = 5, currency = coinCounter, useReserve = true}
  145. local item8 = miscShop:RegisterItem{NPCid = 8, price = 20,  amount = 5, currency = coinCounter, useReserve = true}
  146. local item9 = miscShop:RegisterItem{NPCid = 9, price = 30,  amount = 5, currency = coinCounter, useReserve = true}
  147. local item10 = miscShop:RegisterItem{NPCid = 10, price = 50,  amount = 5, currency = coinCounter}
  148. local item11 = miscShop:RegisterItem{NPCid = 11, price = 50,  amount = 5, currency = coinCounter}
  149. local item12 = miscShop:RegisterItem{NPCid = 12, price = 30,  amount = 5, currency = coinCounter}
  150. local item13 = miscShop:RegisterItem{NPCid = 13, price = 10,  amount = 5, currency = coinCounter}
  151. local item14 = miscShop:RegisterItem{NPCid = 14, price = 20,  amount = 5, currency = coinCounter}
  152. local item15 = miscShop:RegisterItem{NPCid = 15, price = 30,  amount = 5, currency = coinCounter}
  153. local item16 = miscShop:RegisterItem{NPCid = 16, price = 50,  amount = 5, currency = coinCounter}
  154. local item17 = miscShop:RegisterItem{NPCid = 17, price = 50,  amount = 5, currency = coinCounter}
  155. local item18 = miscShop:RegisterItem{NPCid = 50, price = 30,  amount = 5, currency = coinCounter}
  156. local item19 = miscShop:RegisterItem{NPCid = 19, price = 50,  amount = 5, currency = coinCounter}
  157. local item20 = miscShop:RegisterItem{NPCid = 21, price = 50,  amount = 5, currency = coinCounter}
  158. local item21 = miscShop:RegisterItem{NPCid = 22, price = 30,  amount = 5, currency = coinCounter}
  159. local item22 = miscShop:RegisterItem{NPCid = 23, price = 10,  amount = 5, currency = coinCounter}
  160. local item23 = miscShop:RegisterItem{NPCid = 24, price = 20,  amount = 5, currency = coinCounter}
  161. local item24 = miscShop:RegisterItem{NPCid = 25, price = 30,  amount = 5, currency = coinCounter}
  162. local item25 = miscShop:RegisterItem{NPCid = 26, price = 50,  amount = 5, currency = coinCounter}
  163. local item26 = miscShop:RegisterItem{NPCid = 27, price = 50,  amount = 5, currency = coinCounter}
  164. local item27 = miscShop:RegisterItem{NPCid = 28, price = 30,  amount = 5, currency = coinCounter}
  165. local item28 = miscShop:RegisterItem{NPCid = 31, price = 50,  amount = 5, currency = coinCounter}
  166. local item29 = miscShop:RegisterItem{NPCid = 32, price = 30,  amount = 5, currency = coinCounter}
  167. local item30 = miscShop:RegisterItem{NPCid = 33, price = 10,  amount = 5, currency = coinCounter}
  168. local item31 = miscShop:RegisterItem{NPCid = 34, price = 20,  amount = 5, currency = coinCounter}
  169. local item32 = miscShop:RegisterItem{NPCid = 35, price = 30,  amount = 5, currency = coinCounter}
  170. local item33 = miscShop:RegisterItem{NPCid = 36, price = 50,  amount = 5, currency = coinCounter}
  171. local item34 = miscShop:RegisterItem{NPCid = 37, price = 50,  amount = 5, currency = coinCounter}
  172. local item35 = miscShop:RegisterItem{NPCid = 38, price = 30,  amount = 5, currency = coinCounter}
  173. local item36 = miscShop:RegisterItem{NPCid = 41, price = 50,  amount = 5, currency = coinCounter}
  174. local item37 = miscShop:RegisterItem{NPCid = 42, price = 30,  amount = 5, currency = coinCounter}
  175. local item38 = miscShop:RegisterItem{NPCid = 43, price = 10,  amount = 5, currency = coinCounter}
  176. local item39 = miscShop:RegisterItem{NPCid = 44, price = 20,  amount = 5, currency = coinCounter}
  177. local item40 = miscShop:RegisterItem{NPCid = 45, price = 30,  amount = 5, currency = coinCounter}
  178. local item41 = miscShop:RegisterItem{NPCid = 46, price = 50,  amount = 5, currency = coinCounter}
  179. local item42 = miscShop:RegisterItem{NPCid = 47, price = 50,  amount = 5, currency = coinCounter}
  180. local item43 = miscShop:RegisterItem{NPCid = 48, price = 30,  amount = 5, currency = coinCounter}
  181. local item44 = miscShop:RegisterItem{NPCid = 51, price = 50,  amount = 5, currency = coinCounter}
  182. local item45 = miscShop:RegisterItem{NPCid = 52, price = 30,  amount = 5, currency = coinCounter}
  183. local item46 = miscShop:RegisterItem{NPCid = 53, price = 10,  amount = 5, currency = coinCounter}
  184. local item47 = miscShop:RegisterItem{NPCid = 54, price = 20,  amount = 5, currency = coinCounter}
  185. local item48 = miscShop:RegisterItem{NPCid = 55, price = 30,  amount = 5, currency = coinCounter}
  186. local item49 = miscShop:RegisterItem{NPCid = 56, price = 50,  amount = 5, currency = coinCounter}
  187. local item50 = miscShop:RegisterItem{NPCid = 57, price = 50,  amount = 5, currency = coinCounter}
  188. local item51 = miscShop:RegisterItem{NPCid = 58, price = 30,  amount = 5, currency = coinCounter}
  189.  
  190. local item52 = bootShop:RegisterItem{NPCid =  35, price = 50,  amount = 5, currency = coinCounter}
  191. local item53 = bootShop:RegisterItem{NPCid = 191, price = 50,  amount = 5, currency = coinCounter}
  192. local item54 = bootShop:RegisterItem{NPCid = 193, price = 30,  amount = 5, currency = coinCounter}
  193.  
  194. local item55 = animalShop:RegisterItem{NPCid =  95, price = 50,  amount = 5, currency = coinCounter}
  195. local item56 = animalShop:RegisterItem{NPCid =  98, price = 30,  amount = 5, currency = coinCounter}
  196. local item57 = animalShop:RegisterItem{NPCid =  99, price = 10,  amount = 5, currency = coinCounter}
  197. local item58 = animalShop:RegisterItem{NPCid = 100, price = 20,  amount = 5, currency = coinCounter}
  198. local item59 = animalShop:RegisterItem{NPCid = 148, price = 30,  amount = 5, currency = coinCounter}
  199. local item60 = animalShop:RegisterItem{NPCid = 149, price = 50,  amount = 5, currency = coinCounter}
  200. local item61 = animalShop:RegisterItem{NPCid = 150, price = 50,  amount = 5, currency = coinCounter}
  201. local item62 = animalShop:RegisterItem{NPCid = 228, price = 30,  amount = 5, currency = coinCounter}
  202.  
  203.  
  204. local function newHUD()
  205.     hudoverride.offsets.coins.value.y = -50 -- move the coin counter's position up by 50 pixels so that it is offscreen and not visible
  206.     Text.printWP(string.format("%04d",coinCounter:getMoney()),1,538,27,5) -- print the new coin counter
  207. end
  208. Graphics.addHUDElement(newHUD) -- register our render function in the default hud
  209.  
  210.  
  211. function onDraw()
  212.     if ShopSystem.activeShop.id ~= nil then -- detect if ANY shop is currently open
  213.         Graphics.drawBox{texture = coinsIcon, x = ShopSystem.movement.sidePanels.position + 22, y = 292, priority = ShopSystem.leastPriority + 0.65}
  214.         textplus.print{x = ShopSystem.movement.sidePanels.position + 58, y = 300, text = string.format("%04d", coinCounter:getMoney()), font = ShopSystem.font, priority = ShopSystem.leastPriority + 0.65}
  215.     end
  216.     myCurrency:draw()
  217. end
  218.  
  219. function onEvent(eventName)
  220.     if eventName == "hellostranger" then
  221.         myShop:open()
  222.     elseif eventName == "test2" then
  223.         miscShop:open()
  224.     elseif eventName == "test3" then
  225.         bootShop:open()
  226.     elseif eventName == "test4" then
  227.         animalShop:open()
  228.     end
  229. end
  230.  
  231.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement