-- TODO: Use safe sandboxed environment
--require 'Scripts/safe_load.lua'

stats = ShopGroup:create("Stats")
stats:setName("Stats")
stats:setDescription("StatsDescription")

stack = ShopStack:create("Power")
stack:setName("PowerStat")
stack:setDescription("PowerStatDescription")
stack:setShopImagePath("Images/UI/Gym/icon_attribute_damage.png")
sound = SoundComponent:create("Upgrade")
stack:addComponent("SoundComponent", sound)
upgrade = UpgradeComponent:create()
upgrade:setName("PowerStatVariable")
stack:addComponent("UpgradeComponent", upgrade)
statComponent = StatComponent:create()
statComponent:setIconPath("Images/UI/Gym/icon_attribute_damage.png")
stack:addComponent("StatComponent", statComponent)
stats:getShopObjects():addObject(stack)

item = ShopItem:create("Power0")
item:setStorageLocation(StorageLocation_HeroProfile)
earn = EarnComponent:create()
item:addComponent("EarnComponent", earn)
upgrade = UpgradeComponent:create()
upgrade:setValue("10")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(10))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power1")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(50)
buy:setRequirement(InventoryRequirement:create("Power0", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("12")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power2")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(100)
buy:setRequirement(InventoryRequirement:create("Power1", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("14")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power3")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(150)
buy:setRequirement(InventoryRequirement:create("Power2", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("16")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power4")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(200)
buy:setRequirement(InventoryRequirement:create("Power3", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("18")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power5")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(250)
buy:setRequirement(InventoryRequirement:create("Power4", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("20")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power6")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(300)
buy:setRequirement(InventoryRequirement:create("Power5", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("22")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power7")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(350)
buy:setRequirement(InventoryRequirement:create("Power6", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("24")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power8")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(400)
buy:setRequirement(InventoryRequirement:create("Power7", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("26")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power9")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(450)
buy:setRequirement(InventoryRequirement:create("Power8", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("28")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Power10")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(500)
buy:setRequirement(InventoryRequirement:create("Power9", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("30")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddDamage:create(2))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)


stack = ShopStack:create("Endurance")
stack:setName("EnduranceStat")
stack:setDescription("EnduranceStatDescription")
stack:setShopImagePath("Images/UI/Gym/icon_attribute_hp.png")
sound = SoundComponent:create("Upgrade")
stack:addComponent("SoundComponent", sound)
upgrade = UpgradeComponent:create()
upgrade:setName("EnduranceStatVariable")
stack:addComponent("UpgradeComponent", upgrade)
statComponent = StatComponent:create()
statComponent:setIconPath("Images/UI/Gym/icon_attribute_hp.png")
stack:addComponent("StatComponent", statComponent)
stats:getShopObjects():addObject(stack)

item = ShopItem:create("Endurance0")
item:setStorageLocation(StorageLocation_HeroProfile)
earn = EarnComponent:create()
item:addComponent("EarnComponent", earn)
statsTrigger = PassiveTrigger:create()
upgrade = UpgradeComponent:create()
upgrade:setValue("5")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger:addEffect(AddHealth:create(5))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance1")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(50)
buy:setRequirement(InventoryRequirement:create("Endurance0", 1))
item:addComponent("BuyComponent", buy)
statsTrigger = PassiveTrigger:create()
upgrade = UpgradeComponent:create()
upgrade:setValue("6")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger:addEffect(AddHealth:create(1))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance2")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(100)
buy:setRequirement(InventoryRequirement:create("Endurance1", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("7")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddHealth:create(1))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance3")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(150)
buy:setRequirement(InventoryRequirement:create("Endurance2", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("8")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddHealth:create(1))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance4")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(200)
buy:setRequirement(InventoryRequirement:create("Endurance3", 1))
item:addComponent("BuyComponent", buy)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddHealth:create(1))
upgrade = UpgradeComponent:create()
upgrade:setValue("9")
item:addComponent("UpgradeComponent", upgrade)
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance5")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(250)
buy:setRequirement(InventoryRequirement:create("Endurance4", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("10")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddHealth:create(1))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance6")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(300)
buy:setRequirement(InventoryRequirement:create("Endurance5", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("11")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddHealth:create(1))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance7")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(350)
buy:setRequirement(InventoryRequirement:create("Endurance6", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("12")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddHealth:create(1))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance8")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(400)
buy:setRequirement(InventoryRequirement:create("Endurance7", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("13")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddHealth:create(1))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance9")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(450)
buy:setRequirement(InventoryRequirement:create("Endurance8", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("14")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddHealth:create(1))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

item = ShopItem:create("Endurance10")
item:setStorageLocation(StorageLocation_HeroProfile)
buy = BuyComponent:create(500)
buy:setRequirement(InventoryRequirement:create("Endurance9", 1))
item:addComponent("BuyComponent", buy)
upgrade = UpgradeComponent:create()
upgrade:setValue("15")
item:addComponent("UpgradeComponent", upgrade)
statsTrigger = PassiveTrigger:create()
statsTrigger:addEffect(AddHealth:create(1))
item:getTriggerDispatcher():addPassiveTrigger(statsTrigger)
stack:getShopItems():addObject(item)

return stats
