diff --git a/arena.lua b/arena.lua index f4a3eac..910ad12 100644 --- a/arena.lua +++ b/arena.lua @@ -7,10 +7,11 @@ function Arena:init(name) end -function Arena:on_enter(from, level, units, passives, shop_level, shop_xp, lock) +function Arena:on_enter(from, level, loop, units, passives, shop_level, shop_xp, lock) self.hfx:add('condition1', 1) self.hfx:add('condition2', 1) self.level = level or 1 + self.loop = loop or 0 self.units = units self.passives = passives self.shop_level = shop_level or 1 @@ -185,6 +186,11 @@ function Arena:on_enter(from, level, units, passives, shop_level, shop_xp, lock) 6, 6, 7, 7, 8, 10, 8, 8, 10, 12, 14, 16, 25, } + for i = 26, 5000 do + local n = i % 25 + if n == 0 then n = 25 end + self.level_to_max_waves[i] = self.level_to_max_waves[n] + end self.level_to_distributed_enemies_chance = { 0, 5, 10, 10, 15, 15, 20, @@ -192,6 +198,11 @@ function Arena:on_enter(from, level, units, passives, shop_level, shop_xp, lock) 25, 25, 25, 25, 25, 30, 20, 25, 30, 35, 40, 45, 50, } + for i = 26, 5000 do + local n = i % 25 + if n == 0 then n = 25 end + self.level_to_distributed_enemies_chance[i] = self.level_to_distributed_enemies_chance[n] + end self.max_waves = self.level_to_max_waves[self.level] self.wave = 0 self.start_time = 3 @@ -319,6 +330,10 @@ function Arena:on_enter(from, level, units, passives, shop_level, shop_xp, lock) self.t:after(1.125 + math.floor(n/4)*0.25, function() self.spawning_enemies = false end, 'spawning_enemies') self.enemy_spawns_prevented = 0 end) + + self.level = 25*(self.loop+1) + self.won = true + self:quit() end @@ -379,11 +394,11 @@ function Arena:update(dt) 'assassination', 'flying_daggers', 'ultimatum', 'magnify', 'echo_barrage', 'unleash', 'reinforce', 'payback', 'enchanted', 'freezing_field', 'burning_field', 'gravity_field', 'magnetism', 'insurance', 'dividends', 'berserking', 'unwavering_stance', 'unrelenting_stance', 'blessing', 'haste', 'divine_barrage', 'orbitism', 'psyker_orbs', 'psychosense', 'rearm', 'taunt', 'summon_instability', } - max_units = 7 + current_new_game_plus + max_units = math.clamp(7 + current_new_game_plus + self.loop, 7, 12) main:add(BuyScreen'buy_screen') locked_state = nil system.save_run() - main:go_to('buy_screen', 1, {}, passives, 1, 0) + main:go_to('buy_screen', 1, 0, {}, passives, 1, 0) end, text = Text({{text = '[wavy, ' .. tostring(state.dark_transitions and 'fg' or 'bg') .. ']restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)} end @@ -416,7 +431,8 @@ function Arena:quit() if self.died then return end self.quitting = true - if self.level == 25 then + if self.level % 25 == 0 then + self:gain_gold() if not self.win_text and not self.win_text2 then input:set_mouse_visible(true) self.won = true @@ -428,12 +444,12 @@ function Arena:quit() end current_new_game_plus = current_new_game_plus + 1 state.current_new_game_plus = current_new_game_plus - max_units = 7 + current_new_game_plus + max_units = math.clamp(7 + current_new_game_plus + self.loop, 7, 12) system.save_run() trigger:tween(1, _G, {slow_amount = 0}, math.linear, function() slow_amount = 0 end, 'slow_amount') trigger:tween(4, camera, {x = gw/2, y = gh/2, r = 0}, math.linear, function() camera.x, camera.y, camera.r = gw/2, gh/2, 0 end) - self.win_text = Text2{group = self.ui, x = gw/2 + 40, y = gh/2 - 66, force_update = true, lines = {{text = '[wavy_mid, cbyc2]congratulations!', font = fat_font, alignment = 'center'}}} + self.win_text = Text2{group = self.ui, x = gw/2 + 40, y = gh/2 - 69, force_update = true, lines = {{text = '[wavy_mid, cbyc2]congratulations!', font = fat_font, alignment = 'center'}}} trigger:after(2.5, function() self.build_text = Text2{group = self.ui, x = 40, y = 20, force_update = true, lines = {{text = "[wavy_mid, fg]your build", font = pixul_font, alignment = 'center'}}} for i, unit in ipairs(self.units) do @@ -442,6 +458,9 @@ function Arena:quit() {text = '[' .. character_color_strings[unit.character] .. ']' .. unit.character, font = pixul_font, alignment = 'left'} }} end + for i, passive in ipairs(self.passives) do + ItemCard{group = self.ui, x = 120 + (i-1)*30, y = 20, w = 30, h = 45, sx = 0.75, sy = 0.75, force_update = true, passive = passive.passive , level = passive.level, xp = passive.xp, parent = self} + end if current_new_game_plus == 6 then if current_new_game_plus == new_game_plus then @@ -452,17 +471,19 @@ function Arena:quit() state.current_new_game_plus = current_new_game_plus max_units = 12 - self.win_text2 = Text2{group = self.ui, x = gw/2 + 40, y = gh/2 + 30, force_update = true, lines = { + self.win_text2 = Text2{group = self.ui, x = gw/2 + 40, y = gh/2 + 20, force_update = true, lines = { {text = "[fg]now you've really beaten the game!", font = pixul_font, alignment = 'center', height_multiplier = 1.24}, {text = "[fg]thanks a lot for playing it and completing it entirely!", font = pixul_font, alignment = 'center', height_multiplier = 1.24}, - {text = "[fg]this game was inspired by:", font = pixul_font, alignment = 'center', height_multiplier = 4}, - {text = "[fg]so check those games out, they're fun!", font = pixul_font, alignment = 'center', height_multiplier = 1.24}, - {text = "[fg]and to get more games like this in the future:", font = pixul_font, alignment = 'center', height_multiplier = 4}, + {text = "[fg]this game was inspired by:", font = pixul_font, alignment = 'center', height_multiplier = 3.5}, + {text = "[fg]so check them out! and to get more games like this:", font = pixul_font, alignment = 'center', height_multiplier = 3.5}, {text = "[wavy_mid, yellow]thanks for playing!", font = pixul_font, alignment = 'center'}, }} - SteamFollowButton{group = self.ui, x = gw/2 + 40, y = gh/2 + 78, force_update = true} + SteamFollowButton{group = self.ui, x = gw/2 + 40, y = gh/2 + 58, force_update = true} Button{group = self.ui, x = gw - 40, y = gh - 44, force_update = true, button_text = 'credits', fg_color = 'bg10', bg_color = 'bg', action = function() self:create_credits() end} - Button{group = self.ui, x = gw - 32, y = gh - 20, force_update = true, button_text = 'quit', fg_color = 'bg10', bg_color = 'bg', action = function() love.event.quit() end} + Button{group = self.ui, x = gw - 39, y = gh - 20, force_update = true, button_text = ' loop ', fg_color = 'bg10', bg_color = 'bg', action = function() self:endless() end} + self.try_loop_text = Text2{group = self.ui, x = gw - 144, y = gh - 20, force_update = true, lines = { + {text = '[bg10]continue run (+difficulty):', font = pixul_font}, + }} local open_url = function(b, url) ui_switch2:play{pitch = random:float(0.95, 1.05), volume = 0.5} b.spring:pull(0.2, 200, 10) @@ -472,7 +493,15 @@ function Arena:quit() end Button{group = self.ui, x = gw/2 - 50 + 40, y = gh/2 + 12, force_update = true, button_text = 'nimble quest', fg_color = 'bluem5', bg_color = 'blue', action = function(b) open_url(b, 'https://store.steampowered.com/app/259780/Nimble_Quest/') end} Button{group = self.ui, x = gw/2 + 50 + 40, y = gh/2 + 12, force_update = true, button_text = 'dota underlords', fg_color = 'bluem5', bg_color = 'blue', action = function(b) open_url(b, 'https://store.steampowered.com/app/1046930/Dota_Underlords/') end} + else + self.win_text2 = Text2{group = self.ui, x = gw/2 + 40, y = gh/2 + 5, force_update = true, lines = { + {text = "[fg]you've beaten the game!", font = pixul_font, alignment = 'center', height_multiplier = 1.24}, + {text = "[fg]if you liked it:", font = pixul_font, alignment = 'center', height_multiplier = 3.5}, + {text = "[fg]and if you liked the music:", font = pixul_font, alignment = 'center', height_multiplier = 3.5}, + {text = "[wavy_mid, yellow]thanks for playing!", font = pixul_font, alignment = 'center'}, + }} + --[[ self.win_text2 = Text2{group = self.ui, x = gw/2 + 40, y = gh/2 + 20, force_update = true, lines = { {text = "[fg]you've beaten the game!", font = pixul_font, alignment = 'center', height_multiplier = 1.24}, {text = "[fg]i made this game in 3 months as a dev challenge", font = pixul_font, alignment = 'center', height_multiplier = 1.24}, @@ -481,16 +510,18 @@ function Arena:quit() {text = "[fg]i will release more games this year, so stay tuned!", font = pixul_font, alignment = 'center', height_multiplier = 1.4}, {text = "[wavy_mid, yellow]thanks for playing!", font = pixul_font, alignment = 'center'}, }} - SteamFollowButton{group = self.ui, x = gw/2 + 40, y = gh/2 + 34, force_update = true} + ]]-- + SteamFollowButton{group = self.ui, x = gw/2 + 40, y = gh/2 - 10, force_update = true} + Button{group = self.ui, x = gw/2 + 40, y = gh/2 + 33, force_update = true, button_text = 'buy the soundtrack!', fg_color = 'greenm5', bg_color = 'green', action = function() open_url(b, 'https://kubbimusic.com/album/ember') end} + Button{group = self.ui, x = gw - 40, y = gh - 44, force_update = true, button_text = ' loop ', fg_color = 'bg10', bg_color = 'bg', action = function() self:endless() end} RestartButton{group = self.ui, x = gw - 40, y = gh - 20, force_update = true} - trigger:after(8, function() - self.try_ng_text = Text2{group = self.ui, x = gw - 210, y = gh - 20, force_update = true, lines = { - {text = '[cbyc3]try a harder difficulty with +1 max snake size:', font = pixul_font}, - }} - end) - self.credits_button = Button{group = self.ui, x = gw - 40, y = gh - 44, force_update = true, button_text = 'credits', fg_color = 'bg10', bg_color = 'bg', action = function() - self:create_credits() - end} + self.try_loop_text = Text2{group = self.ui, x = gw - 200, y = gh - 44, force_update = true, lines = { + {text = '[bg10]continue run (+difficulty, +1 max snake size):', font = pixul_font}, + }} + self.try_ng_text = Text2{group = self.ui, x = gw - 187, y = gh - 20, force_update = true, lines = { + {text = '[bg10]new run (+difficulty, +1 max snake size):', font = pixul_font}, + }} + self.credits_button = Button{group = self.ui, x = gw - 40, y = gh - 68, force_update = true, button_text = 'credits', fg_color = 'bg10', bg_color = 'bg', action = function() self:create_credits() end} end end) @@ -651,7 +682,7 @@ function Arena:quit() self.t:tween(0.7, self, {main_slow_amount = 0}, math.linear, function() self.main_slow_amount = 0 end) end) self.t:after(3, function() - if self.level % 3 == 0 then + if (self.level-(25*self.loop)) % 3 == 0 and #self.passives < 8 then input:set_mouse_visible(true) self.arena_clear_text.dead = true trigger:tween(1, _G, {slow_amount = 0}, math.linear, function() slow_amount = 0 end, 'slow_amount') @@ -809,10 +840,10 @@ function Arena:die() 'assassination', 'flying_daggers', 'ultimatum', 'magnify', 'echo_barrage', 'unleash', 'reinforce', 'payback', 'enchanted', 'freezing_field', 'burning_field', 'gravity_field', 'magnetism', 'insurance', 'dividends', 'berserking', 'unwavering_stance', 'unrelenting_stance', 'blessing', 'haste', 'divine_barrage', 'orbitism', 'psyker_orbs', 'psychosense', 'rearm', 'taunt', 'summon_instability', } - max_units = 7 + current_new_game_plus + max_units = math.clamp(7 + current_new_game_plus + self.loop, 7, 12) main:add(BuyScreen'buy_screen') system.save_run() - main:go_to('buy_screen', 1, {}, passives, 1, 0) + main:go_to('buy_screen', 1, 0, {}, passives, 1, 0) end, text = Text({{text = '[wavy, ' .. tostring(state.dark_transitions and 'fg' or 'bg') .. ']restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)} end} end) @@ -821,6 +852,13 @@ function Arena:die() end +function Arena:endless() + current_new_game_plus = current_new_game_plus - 1 + self.loop = self.loop + 1 + self:transition() +end + + function Arena:create_credits() local open_url = function(b, url) ui_switch2:play{pitch = random:float(0.95, 1.05), volume = 0.5} @@ -926,8 +964,8 @@ function Arena:transition() end slow_amount = 1 main:add(BuyScreen'buy_screen') - system.save_run(self.level+1, gold, self.units, self.passives, self.shop_level, self.shop_xp, run_passive_pool, locked_state) - main:go_to('buy_screen', self.level+1, self.units, self.passives, self.shop_level, self.shop_xp) + system.save_run(self.level+1, self.loop, gold, self.units, self.passives, self.shop_level, self.shop_xp, run_passive_pool, locked_state) + main:go_to('buy_screen', self.level+1, self.loop, self.units, self.passives, self.shop_level, self.shop_xp) t.t:after(0.1, function() t.text:set_text({ {text = '[nudge_down, ' .. tostring(state.dark_transitions and 'fg' or 'bg') .. ']gold gained: ' .. tostring(self.gold_gained or 0) .. ' + ' .. tostring(self.gold_picked_up or 0), font = pixul_font, diff --git a/buy_screen.lua b/buy_screen.lua index ba200cc..8481fb3 100644 --- a/buy_screen.lua +++ b/buy_screen.lua @@ -38,18 +38,18 @@ function BuyScreen:on_exit() end -function BuyScreen:on_enter(from, level, units, passives, shop_level, shop_xp) +function BuyScreen:on_enter(from, level, loop, units, passives, shop_level, shop_xp) self.level = level + self.loop = loop self.units = units self.passives = passives self.shop_level = shop_level self.shop_xp = shop_xp camera.x, camera.y = gw/2, gh/2 - input:set_mouse_visible(true) + print(self.loop) - if self.level == 1 then - end + input:set_mouse_visible(true) steam.friends.setRichPresence('steam_display', '#StatusFull') steam.friends.setRichPresence('text', 'Shop - Level ' .. self.level) @@ -72,8 +72,8 @@ function BuyScreen:on_enter(from, level, units, passives, shop_level, shop_xp) self.items_text = Text({{text = '[wavy_mid, fg]items', font = pixul_font, alignment = 'center'}}, global_text_tags) self.ng_text = Text({{text = '[fg]NG+' .. current_new_game_plus, font = pixul_font, alignment = 'center'}}, global_text_tags) local get_elite_str = function(lvl) - if lvl == 6 or lvl == 12 or lvl == 18 or lvl == 24 or lvl == 25 then return ' (elite)' - elseif lvl % 3 == 0 then return ' (hard)' + if (lvl-(25*self.loop)) % 6 == 0 or lvl % 25 == 0 then return ' (elite)' + elseif (lvl-(25*self.loop)) % 3 == 0 then return ' (hard)' else return '' end end self.level_text = Text({{text = '[fg]Lv.' .. tostring(self.level) .. get_elite_str(self.level), font = pixul_font, alignment = 'center'}}, global_text_tags) @@ -146,10 +146,10 @@ function BuyScreen:on_enter(from, level, units, passives, shop_level, shop_xp) 'assassination', 'flying_daggers', 'ultimatum', 'magnify', 'echo_barrage', 'unleash', 'reinforce', 'payback', 'enchanted', 'freezing_field', 'burning_field', 'gravity_field', 'magnetism', 'insurance', 'dividends', 'berserking', 'unwavering_stance', 'unrelenting_stance', 'blessing', 'haste', 'divine_barrage', 'orbitism', 'psyker_orbs', 'psychosense', 'rearm', 'taunt', 'summon_instability', } - max_units = 7 + current_new_game_plus + max_units = math.clamp(7 + current_new_game_plus + self.loop, 7, 12) main:add(BuyScreen'buy_screen') system.save_run() - main:go_to('buy_screen', 1, {}, passives, 1, 0) + main:go_to('buy_screen', 1, 0, {}, passives, 1, 0) end, text = Text({{text = '[wavy, ' .. tostring(state.dark_transitions and 'fg' or 'bg') .. ']restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)} end, mouse_enter = function(b) b.info_text = InfoText{group = main.current.ui, force_update = true} @@ -178,7 +178,7 @@ function BuyScreen:on_enter(from, level, units, passives, shop_level, shop_xp) ]]-- locked_state = {locked = self.locked, cards = {self.cards[1] and self.cards[1].unit, self.cards[2] and self.cards[2].unit, self.cards[3] and self.cards[3].unit}} - system.save_run(self.level, gold, self.units, self.passives, self.shop_level, self.shop_xp, run_passive_pool, locked_state) + system.save_run(self.level, self.loop, gold, self.units, self.passives, self.shop_level, self.shop_xp, run_passive_pool, locked_state) end @@ -552,7 +552,7 @@ function RestartButton:update(dt) system.save_state() main:add(BuyScreen'buy_screen') system.save_run() - main:go_to('buy_screen', 1, {}, passives, 1, 0) + main:go_to('buy_screen', 1, 0, {}, passives, 1, 0) end, text = Text({{text = '[wavy, ' .. tostring(state.dark_transitions and 'fg' or 'bg') .. ']restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)} end end @@ -698,11 +698,11 @@ function GoButton:update(dt) ui_switch1:play{pitch = random:float(0.95, 1.05), volume = 0.5} ui_transition1:play{pitch = random:float(0.95, 1.05), volume = 0.5} self.transitioning = true - system.save_run(self.parent.level, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) + system.save_run(self.parent.level, self.parent.loop, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) TransitionEffect{group = main.transitions, x = self.x, y = self.y, color = state.dark_transitions and bg[-2] or character_colors[random:table(self.parent.units).character], transition_action = function() main:add(Arena'arena') - main:go_to('arena', self.parent.level, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, self.parent.locked) - end, text = Text({{text = '[wavy, ' .. tostring(state.dark_transitions and 'fg' or 'bg') .. ']level ' .. tostring(self.parent.level) .. '/25', font = pixul_font, alignment = 'center'}}, global_text_tags)} + main:go_to('arena', self.parent.level, self.parent.loop, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, self.parent.locked) + end, text = Text({{text = '[wavy, ' .. tostring(state.dark_transitions and 'fg' or 'bg') .. ']level ' .. tostring(self.parent.level) .. '/' .. tostring(25*(self.parent.loop+1)), font = pixul_font, alignment = 'center'}}, global_text_tags)} end end end @@ -752,7 +752,7 @@ function LockButton:update(dt) if not self.parent.locked then locked_state = nil end if self.parent.locked then locked_state = {locked = true, cards = {self.parent.cards[1] and self.parent.cards[1].unit, self.parent.cards[2] and self.parent.cards[2].unit, self.parent.cards[3] and self.parent.cards[3].unit}} - system.save_run(self.parent.level, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) + system.save_run(self.parent.level, self.parent.loop, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) end ui_switch2:play{pitch = random:float(0.95, 1.05), volume = 0.5} self.selected = true @@ -833,7 +833,7 @@ function LevelButton:update(dt) gold = gold - 5 self.parent.shop_text:set_text{{text = '[wavy_mid, fg]shop [fg]- [fg, nudge_down]gold: [yellow, nudge_down]' .. gold, font = pixul_font, alignment = 'center'}} self.text = Text({{text = '[bg10]' .. tostring(self.parent.shop_level), font = pixul_font, alignment = 'center'}}, global_text_tags) - system.save_run(self.parent.level, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) + system.save_run(self.parent.level, self.parent.loop, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) end end end @@ -969,7 +969,7 @@ function RerollButton:update(dt) self.spring:pull(0.2, 200, 10) gold = gold - 2 self.parent.shop_text:set_text{{text = '[wavy_mid, fg]shop [fg]- [fg, nudge_down]gold: [yellow, nudge_down]' .. gold, font = pixul_font, alignment = 'center'}} - system.save_run(self.parent.level, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) + system.save_run(self.parent.level, self.parent.loop, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) end elseif self.parent:is(Arena) then if gold < 5 and not self.free_reroll then @@ -1174,14 +1174,14 @@ function CharacterPart:update(dt) self.parent:set_party_and_sets() self.parent:refresh_cards() self.parent.party_text:set_text({{text = '[wavy_mid, fg]party ' .. tostring(#self.parent.units) .. '/' .. tostring(max_units), font = pixul_font, alignment = 'center'}}) - system.save_run(self.parent.level, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) + system.save_run(self.parent.level, self.parent.loop, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) else self.parent.parent:gain_gold(self:get_sale_price()) self.parent.parent.units[self.i].reserve[self.level] = self.parent.parent.units[self.i].reserve[self.level] - 1 self:die() self.parent.parent:set_party_and_sets() self.parent.parent:refresh_cards() - system.save_run(self.parent.parent.level, gold, self.parent.parent.units, self.parent.parent.passives, self.parent.parent.shop_level, self.parent.parent.shop_xp, run_passive_pool, locked_state) + system.save_run(self.parent.parent.level, self.parent.parent.loop, gold, self.parent.parent.units, self.parent.parent.passives, self.parent.parent.shop_level, self.parent.parent.shop_xp, run_passive_pool, locked_state) end end @@ -1578,7 +1578,7 @@ function ShopCard:update(dt) self.parent:refresh_cards() self.parent.party_text:set_text({{text = '[wavy_mid, fg]party ' .. tostring(#self.parent.units) .. '/' .. tostring(max_units), font = pixul_font, alignment = 'center'}}) locked_state = {locked = self.parent.locked, cards = {self.parent.cards[1] and self.parent.cards[1].unit, self.parent.cards[2] and self.parent.cards[2].unit, self.parent.cards[3] and self.parent.cards[3].unit}} - system.save_run(self.parent.level, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) + system.save_run(self.parent.level, self.parent.loop, gold, self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool, locked_state) else error1:play{pitch = random:float(0.95, 1.05), volume = 0.5} self.spring:pull(0.2, 200, 10) diff --git a/enemies.lua b/enemies.lua index 6a3313d..dbf89c0 100644 --- a/enemies.lua +++ b/enemies.lua @@ -13,6 +13,9 @@ function Seeker:init(args) self:calculate_stats(true) self:set_as_steerable(self.v, 1000, 2*math.pi, 2) + local level = self.level % 25 + if level == 0 then self.level = 25*math.floor(self.level/25) end + if self.boss == 'speed_booster' then self.color = green[0]:clone() self.t:every(8, function() diff --git a/engine/system.lua b/engine/system.lua index cf218be..b29e73c 100644 --- a/engine/system.lua +++ b/engine/system.lua @@ -137,8 +137,8 @@ function system.load_state() end -function system.save_run(level, gold, units, passives, shop_level, shop_xp, run_passive_pool, locked_state) - local run = {level = level, gold = gold, units = units, passives = passives, shop_level = shop_level, shop_xp = shop_xp, run_passive_pool= run_passive_pool, locked_state = locked_state} +function system.save_run(level, loop, gold, units, passives, shop_level, shop_xp, run_passive_pool, locked_state) + local run = {level = level, loop = loop, gold = gold, units = units, passives = passives, shop_level = shop_level, shop_xp = shop_xp, run_passive_pool= run_passive_pool, locked_state = locked_state} local str = "return " .. table.tostring(run) love.filesystem.write("run_v3.txt", str) end diff --git a/main.lua b/main.lua index 35576f1..74e6d8e 100644 --- a/main.lua +++ b/main.lua @@ -1394,6 +1394,16 @@ function init() [25] = {100, 100}, } + local k = 1 + for i = 26, 5000 do + local n = i % 25 + if n == 0 then + n = 25 + k = k + 1 + end + level_to_gold_gained[i] = {level_to_gold_gained[n][1]*k, level_to_gold_gained[n][2]*k} + end + level_to_elite_spawn_weights = { [1] = {0}, [2] = {4, 2}, @@ -1422,6 +1432,25 @@ function init() [25] = {5, 5, 5, 5, 5, 5}, } + local k = 1 + local l = 0.2 + for i = 26, 5000 do + local n = i % 25 + if n == 0 then + n = 25 + k = k + 1 + l = l*2 + end + local a, b, c, d, e, f = unpack(level_to_elite_spawn_weights[n]) + a = (a or 0) + (a or 0)*l + b = (b or 0) + (b or 0)*l + c = (c or 0) + (c or 0)*l + d = (d or 0) + (d or 0)*l + e = (e or 0) + (e or 0)*l + f = (f or 0) + (f or 0)*l + level_to_elite_spawn_weights[i] = {a, b, c, d, e, f} + end + level_to_boss = { [6] = 'speed_booster', [12] = 'exploder', @@ -1430,6 +1459,17 @@ function init() [25] = 'randomizer', } + local bosses = {'speed_booster', 'exploder', 'swarmer', 'forcer'} + local k = 1 + for i = 30, 5000, 6 do + level_to_boss[i] = bosses[k] + k = k + 1 + if k > 4 then k = 1 end + end + for i = 50, 5000, 25 do + level_to_boss[i] = 'randomizer' + end + level_to_elite_spawn_types = { [1] = {'speed_booster'}, [2] = {'speed_booster', 'shooter'}, @@ -1458,6 +1498,14 @@ function init() [25] = {'speed_booster', 'exploder', 'headbutter', 'tank', 'shooter', 'spawner'}, } + for i = 26, 5000 do + local n = i % 25 + if n == 0 then + n = 25 + end + level_to_elite_spawn_types[i] = level_to_elite_spawn_types[n] + end + level_to_shop_odds = { [1] = {70, 20, 10, 0}, [2] = {50, 30, 15, 5}, @@ -1531,7 +1579,7 @@ function init() if not state.new_game_plus then state.new_game_plus = new_game_plus end current_new_game_plus = state.current_new_game_plus or new_game_plus if not state.current_new_game_plus then state.current_new_game_plus = current_new_game_plus end - max_units = 7 + current_new_game_plus + max_units = math.clamp(7 + current_new_game_plus, 7, 12) main_song_instance = _G[random:table{'song1', 'song2', 'song3', 'song4', 'song5'}]:play{volume = 0.5} main = Main() @@ -1870,6 +1918,7 @@ function open_options(self) state.current_new_game_plus = current_new_game_plus self.ng_t.text:set_text({{text = '[bg10]current: ' .. current_new_game_plus, font = pixul_font, alignment = 'center'}}) max_units = 7 + current_new_game_plus + system.save_run() end} self.ng_plus_plus_button = Button{group = self.ui, x = gw/2 + 5, y = gh - 50, force_update = true, button_text = 'NG+ up', fg_color = 'bg10', bg_color = 'bg', action = function(b) @@ -1880,6 +1929,7 @@ function open_options(self) state.current_new_game_plus = current_new_game_plus self.ng_t.text:set_text({{text = '[bg10]current: ' .. current_new_game_plus, font = pixul_font, alignment = 'center'}}) max_units = 7 + current_new_game_plus + system.save_run() end} end diff --git a/mainmenu.lua b/mainmenu.lua index 8429d0e..8ff0138 100644 --- a/mainmenu.lua +++ b/mainmenu.lua @@ -102,7 +102,7 @@ function MainMenu:on_enter(from) locked_state = run.locked_state system.save_state() main:add(BuyScreen'buy_screen') - main:go_to('buy_screen', run.level or 1, run.units or {}, passives, run.shop_level or 1, run.shop_xp or 0) + main:go_to('buy_screen', run.level or 1, run.loop or 0, run.units or {}, passives, run.shop_level or 1, run.shop_xp or 0) end, text = Text({{text = '[wavy, ' .. tostring(state.dark_transitions and 'fg' or 'bg') .. ']starting...', font = pixul_font, alignment = 'center'}}, global_text_tags)} end} self.options_button = Button{group = self.main_ui, x = 47, y = gh/2 + 12, force_update = true, button_text = 'options', fg_color = 'bg10', bg_color = 'bg', action = function(b) diff --git a/objects.lua b/objects.lua index 880ccf3..e21d217 100644 --- a/objects.lua +++ b/objects.lua @@ -233,6 +233,17 @@ function Unit:calculate_stats(first_run) if self.boss then local x = self.level local y = {0, 0, 3, 0, 0, 6, 0, 0, 9, 0, 0, 12, 0, 0, 18, 0, 0, 40, 0, 0, 32, 0, 0, 64, 90} + local y2 = {0, 0, 24, 0, 0, 28, 0, 0, 32, 0, 0, 36, 0, 0, 44, 0, 0, 64, 0, 0, 48, 0, 0, 80, 100} + local k = 1.1 + for i = 26, 50 do y[i] = y2[i] end + for i = 51, 5000 do + local n = i % 25 + if n == 0 then + n = 25 + k = k + 0.1 + end + y[i] = y2[n]*k + end self.base_hp = 100 + (current_new_game_plus*5) + (90 + current_new_game_plus*10)*y[x] self.base_dmg = (12 + current_new_game_plus*2) + (2 + current_new_game_plus)*y[x] self.base_mvspd = 35 + 1.5*y[x] @@ -243,6 +254,15 @@ function Unit:calculate_stats(first_run) else local x = self.level local y = {0, 1, 3, 3, 4, 6, 5, 6, 9, 7, 8, 12, 10, 11, 15, 12, 13, 18, 16, 17, 21, 17, 20, 24, 25} + local k = 1.2 + for i = 26, 5000 do + local n = i % 25 + if n == 0 then + n = 25 + k = k + 0.2 + end + y[i] = y[n]*k + end self.base_hp = 25 + 16.5*y[x] self.base_dmg = 4.5 + 2.5*y[x] self.base_mvspd = 70 + 3*y[x] @@ -251,6 +271,17 @@ function Unit:calculate_stats(first_run) if self.boss then local x = self.level local y = {0, 0, 3, 0, 0, 6, 0, 0, 9, 0, 0, 12, 0, 0, 18, 0, 0, 40, 0, 0, 32, 0, 0, 64, 90} + local y2 = {0, 0, 24, 0, 0, 28, 0, 0, 32, 0, 0, 36, 0, 0, 44, 0, 0, 64, 0, 0, 48, 0, 0, 80, 100} + local k = 1.1 + for i = 26, 50 do y[i] = y2[i] end + for i = 51, 5000 do + local n = i % 25 + if n == 0 then + n = 25 + k = k + 0.1 + end + y[i] = y2[n]*k + end self.base_hp = 100 + (current_new_game_plus*5) + (90 + current_new_game_plus*10)*y[x] self.base_dmg = (12 + current_new_game_plus*2) + (2 + current_new_game_plus)*y[x] self.base_mvspd = 35 + 1.5*y[x] @@ -261,6 +292,15 @@ function Unit:calculate_stats(first_run) else local x = self.level local y = {0, 1, 3, 3, 4, 6, 5, 6, 9, 7, 8, 12, 10, 11, 15, 12, 13, 18, 16, 17, 21, 17, 20, 24, 25} + local k = 1.2 + for i = 26, 5000 do + local n = i % 25 + if n == 0 then + n = 25 + k = k + 0.2 + end + y[i] = y[n]*k + end self.base_hp = 22 + (current_new_game_plus*3) + (15 + current_new_game_plus*2.7)*y[x] self.base_dmg = (4 + current_new_game_plus*1.15) + (2 + current_new_game_plus*0.83)*y[x] self.base_mvspd = 70 + 3*y[x] @@ -277,6 +317,15 @@ function Unit:calculate_stats(first_run) elseif self:is(EnemyCritter) or self:is(Critter) then local x = self.level local y = {0, 1, 3, 3, 4, 6, 5, 6, 9, 7, 8, 12, 10, 11, 15, 12, 13, 18, 16, 17, 21, 17, 20, 24, 25} + local k = 1.2 + for i = 26, 5000 do + local n = i % 25 + if n == 0 then + n = 25 + k = k + 0.2 + end + y[i] = y[n]*k + end self.base_hp = 25 + 30*(y[x] or 1) self.base_dmg = 10 + 3*(y[x] or 1) self.base_mvspd = 60 + 3*(y[x] or 1) diff --git a/player.lua b/player.lua index 9bee8a7..78f8c3c 100644 --- a/player.lua +++ b/player.lua @@ -3384,7 +3384,7 @@ function Gold:update(dt) self:update_game_object(dt) self.r = self:get_angle() - if main.current.player.magnetism then + if main.current.player.magnetism and self.magnet_sensor then local players = self:get_objects_in_shape(self.magnet_sensor, {Player}) if players and #players > 0 then local x, y = 0, 0 diff --git a/shared.lua b/shared.lua index 2b08f59..f703803 100644 --- a/shared.lua +++ b/shared.lua @@ -111,8 +111,8 @@ end function Star:update(dt) self:update_game_object(dt) - self.x = self.x + self.v*math.cos(-math.pi/4) - self.y = self.y + self.v*math.sin(-math.pi/4) + self.x = self.x + self.v*math.cos(-math.pi/4)*dt + self.y = self.y + self.v*math.sin(-math.pi/4)*dt self.vr = self.vr + self.dvr*dt if self.x > gw + 64 then self.dead = true end end @@ -569,7 +569,7 @@ global_text_tags = { cbyc3 = TextTag{init = function(c, i, text) c.color = invisible - text.t:after((i-1)*0.05, function() + text.t:after((i-1)*0.025, function() c.color = bg[10] end) end, draw = function(c, i, text) diff --git a/todo b/todo index 5da94e8..fe5f6e6 100644 --- a/todo +++ b/todo @@ -42,12 +42,12 @@ Loop Update Saboteur -> Bomber (builder, nuker): plants a static bomb, when it explodes it deals 2X AoE damage, Lv.3 effect: 100% increased bomb area and damage Hunter (builder, ranger, forcer): shoots a projectile that has 20% chance to spawn a pet, Lv.3 effect: spawns 3 pets instead Looping - Change end screen - Loop button on end screen - Looping lets you continue with the current snake until you die - Difficulty is increased according to the formula for levels 25+ - Snake size goes up by 1 every loop, up to 12 - Don't offer items if item slots are full + * Change end screen + * Loop button on end screen + * Looping lets you continue with the current snake until you die + * Difficulty is increased according to the formula for levels 25+ + * Snake size goes up by 1 every loop, up to 12 + * Don't offer items if at maximum items QoL Increase item choice slots to 4 Add option for mouse cursor to always be visible @@ -55,8 +55,8 @@ Loop Update Add visuals divine intervention, fairy buff warrior attack range barbarian jugg attack - Items on end screen Party + items on death screen + * Items on end screen * Items on passive screen * Selling items * Decreased sound effect volume for shoot 5