diff --git a/arena.lua b/arena.lua index 54b0501..18beaa5 100644 --- a/arena.lua +++ b/arena.lua @@ -327,10 +327,11 @@ function Arena:update(dt) run_passive_pool_by_tiers = { [1] = { 'wall_echo', 'wall_rider', 'centipede', 'temporal_chains', 'amplify', 'amplify_x', 'ballista', 'ballista_x', 'blunt_arrow', 'berserking', 'unwavering_stance', 'assassination', 'unleash', 'blessing', 'hex_master', 'force_push', 'spawning_pool'}, - [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'concentrated_fire', + [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'echo_barrage', 'reinforce', 'payback', 'whispers_of_doom', 'heavy_impact', 'immolation', 'call_of_the_void'}, [3] = {'divine_machine_arrow', 'divine_punishment', 'flying_daggers', 'crucio', 'hive', 'void_rift'}, } + max_units = 7 + new_game_plus main:add(BuyScreen'buy_screen') main:go_to('buy_screen', 0, {}, passives) end, text = Text({{text = '[wavy, bg]restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)} @@ -423,10 +424,11 @@ function Arena:update(dt) run_passive_pool_by_tiers = { [1] = { 'wall_echo', 'wall_rider', 'centipede', 'temporal_chains', 'amplify', 'amplify_x', 'ballista', 'ballista_x', 'blunt_arrow', 'berserking', 'unwavering_stance', 'assassination', 'unleash', 'blessing', 'hex_master', 'force_push', 'spawning_pool'}, - [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'concentrated_fire', + [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'echo_barrage', 'reinforce', 'payback', 'whispers_of_doom', 'heavy_impact', 'immolation', 'call_of_the_void'}, [3] = {'divine_machine_arrow', 'divine_punishment', 'flying_daggers', 'crucio', 'hive', 'void_rift'}, } + max_units = 7 + new_game_plus main:add(BuyScreen'buy_screen') main:go_to('buy_screen', 0, {}, passives) end, text = Text({{text = '[wavy, bg]restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)} @@ -460,7 +462,7 @@ function Arena:quit() if self.level == 25 then if not self.win_text and not self.win_text2 then self.won = true - trigger:tween(1, _G, {slow_amount = 0}, math.linear, function() slow_amount = 0 end) + 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, y = gh/2 - 66, force_update = true, lines = {{text = '[wavy_mid, cbyc2]congratulations!', font = fat_font, alignment = 'center'}}} trigger:after(2.5, function() @@ -496,7 +498,7 @@ function Arena:quit() }} SteamFollowButton{group = self.ui, x = gw/2, y = gh/2 + 34, force_update = true} RestartButton{group = self.ui, x = gw - 40, y = gh - 20, force_update = true} - trigger:after(12, function() + trigger:after(8, function() self.try_ng_text = Text2{group = self.ui, x = gw - 220, y = gh - 20, force_update = true, lines = { {text = '[cbyc3]try a harder difficulty with +1 max snake size:', font = pixul_font}, }} @@ -504,6 +506,28 @@ function Arena:quit() 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.restart_button = Button{group = self.ui, x = gw - 40, y = gh - 68, force_update = true, button_text = 'restart', fg_color = 'bg10', bg_color = 'bg', action = function(b) + self.transitioning = true + ui_transition2:play{pitch = random:float(0.95, 1.05), volume = 0.5} + ui_switch2:play{pitch = random:float(0.95, 1.05), volume = 0.5} + ui_switch1:play{pitch = random:float(0.95, 1.05), volume = 0.5} + TransitionEffect{group = main.transitions, x = gw/2, y = gh/2, color = fg[0], transition_action = function() + slow_amount = 1 + gold = 2 + passives = {} + main_song_instance:stop() + run_passive_pool_by_tiers = { + [1] = { 'wall_echo', 'wall_rider', 'centipede', 'temporal_chains', 'amplify', 'amplify_x', 'ballista', 'ballista_x', 'blunt_arrow', 'berserking', 'unwavering_stance', 'assassination', 'unleash', 'blessing', + 'hex_master', 'force_push', 'spawning_pool'}, + [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'echo_barrage', + 'reinforce', 'payback', 'whispers_of_doom', 'heavy_impact', 'immolation', 'call_of_the_void'}, + [3] = {'divine_machine_arrow', 'divine_punishment', 'flying_daggers', 'crucio', 'hive', 'void_rift'}, + } + max_units = 7 + new_game_plus + main:add(BuyScreen'buy_screen') + main:go_to('buy_screen', 0, {}, passives) + end, text = Text({{text = '[wavy, bg]restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)} + end} end end) @@ -648,7 +672,7 @@ function Arena:quit() self.t:after(3, function() if self.level % 3 == 0 then self.arena_clear_text.dead = true - trigger:tween(1, _G, {slow_amount = 0}, math.linear, function() slow_amount = 0 end) + 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) local card_w, card_h = 100, 100 local w = 3*card_w + 2*20 @@ -657,14 +681,25 @@ function Arena:quit() local tier_1 = random:weighted_pick(unpack(level_to_passive_tier_weights[level or self.level])) local tier_2 = random:weighted_pick(unpack(level_to_passive_tier_weights[level or self.level])) local tier_3 = random:weighted_pick(unpack(level_to_passive_tier_weights[level or self.level])) - local passive_pool_copy = table.copy(run_passive_pool_by_tiers) - local passive_1 = random:table_remove(passive_pool_copy[tier_1]) - local passive_2 = random:table_remove(passive_pool_copy[tier_2]) - local passive_3 = random:table_remove(passive_pool_copy[tier_3]) - table.insert(self.cards, PassiveCard{group = main.current.ui, x = gw/2 - w/2 + 0*(card_w + 20) + card_w/2, y = gh/2 - 6, w = card_w, h = card_h, arena = self, passive = passive_1, force_update = true}) - table.insert(self.cards, PassiveCard{group = main.current.ui, x = gw/2 - w/2 + 1*(card_w + 20) + card_w/2, y = gh/2 - 6, w = card_w, h = card_h, arena = self, passive = passive_2, force_update = true}) - table.insert(self.cards, PassiveCard{group = main.current.ui, x = gw/2 - w/2 + 2*(card_w + 20) + card_w/2, y = gh/2 - 6, w = card_w, h = card_h, arena = self, passive = passive_3, force_update = true}) + local passive_1 = random:table_remove(run_passive_pool_by_tiers[tier_1]) + local passive_2 = random:table_remove(run_passive_pool_by_tiers[tier_2]) + local passive_3 = random:table_remove(run_passive_pool_by_tiers[tier_3]) + if passive_1 then + table.insert(self.cards, + PassiveCard{group = main.current.ui, x = gw/2 - w/2 + 0*(card_w + 20) + card_w/2, y = gh/2 - 6, w = card_w, h = card_h, card_i = 1, tier = tier_1, arena = self, passive = passive_1, force_update = true}) + end + if passive_2 then + table.insert(self.cards, + PassiveCard{group = main.current.ui, x = gw/2 - w/2 + 1*(card_w + 20) + card_w/2, y = gh/2 - 6, w = card_w, h = card_h, card_i = 2, tier = tier_2, arena = self, passive = passive_2, force_update = true}) + end + if passive_3 then + table.insert(self.cards, + PassiveCard{group = main.current.ui, x = gw/2 - w/2 + 2*(card_w + 20) + card_w/2, y = gh/2 - 6, w = card_w, h = card_h, card_i = 3, tier = tier_3, arena = self, passive = passive_3, force_update = true}) + end self.passive_text = Text2{group = self.ui, x = gw/2, y = gh/2 - 65, lines = {{text = '[fg, wavy]choose one', font = fat_font, alignment = 'center'}}} + if not passive_1 and not passive_2 and not passive_3 then + self:transition() + end else self:transition() end @@ -673,6 +708,15 @@ function Arena:quit() end +function Arena:restore_passives_to_pool(j) + for i = 1, 3 do + if i ~= j then + table.insert(run_passive_pool_by_tiers[self.cards[i].tier], self.cards[i].passive) + end + end +end + + function Arena:draw() self.floor:draw() self.main:draw() @@ -751,10 +795,11 @@ function Arena:die() run_passive_pool_by_tiers = { [1] = { 'wall_echo', 'wall_rider', 'centipede', 'temporal_chains', 'amplify', 'amplify_x', 'ballista', 'ballista_x', 'blunt_arrow', 'berserking', 'unwavering_stance', 'assassination', 'unleash', 'blessing', 'hex_master', 'force_push', 'spawning_pool'}, - [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'concentrated_fire', + [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'echo_barrage', 'reinforce', 'payback', 'whispers_of_doom', 'heavy_impact', 'immolation', 'call_of_the_void'}, [3] = {'divine_machine_arrow', 'divine_punishment', 'flying_daggers', 'crucio', 'hive', 'void_rift'}, } + max_units = 7 + new_game_plus main:add(BuyScreen'buy_screen') main:go_to('buy_screen', 0, {}, passives) end, text = Text({{text = '[wavy, bg]restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)} @@ -825,10 +870,11 @@ end function Arena:transition() self.transitioning = true local gold_gained = random:int(level_to_gold_gained[self.level][1], level_to_gold_gained[self.level][2]) - local interest = math.floor(gold/5) + local interest = math.min(math.floor(gold/5), 5) gold = gold + gold_gained + interest ui_transition2:play{pitch = random:float(0.95, 1.05), volume = 0.5} TransitionEffect{group = main.transitions, x = self.player.x, y = self.player.y, color = self.color, transition_action = function(t) + slow_amount = 1 main:add(BuyScreen'buy_screen') main:go_to('buy_screen', self.level, self.units, passives) t.t:after(0.1, function() diff --git a/assets/images/concentrated_fire.png b/assets/images/echo_barrage.png similarity index 100% rename from assets/images/concentrated_fire.png rename to assets/images/echo_barrage.png diff --git a/buy_screen.lua b/buy_screen.lua index cff90de..94fcc3f 100644 --- a/buy_screen.lua +++ b/buy_screen.lua @@ -439,8 +439,16 @@ function RestartButton:update(dt) gold = 2 passives = {} main_song_instance:stop() + run_passive_pool_by_tiers = { + [1] = { 'wall_echo', 'wall_rider', 'centipede', 'temporal_chains', 'amplify', 'amplify_x', 'ballista', 'ballista_x', 'blunt_arrow', 'berserking', 'unwavering_stance', 'assassination', 'unleash', 'blessing', + 'hex_master', 'force_push', 'spawning_pool'}, + [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'echo_barrage', + 'reinforce', 'payback', 'whispers_of_doom', 'heavy_impact', 'immolation', 'call_of_the_void'}, + [3] = {'divine_machine_arrow', 'divine_punishment', 'flying_daggers', 'crucio', 'hive', 'void_rift'}, + } new_game_plus = new_game_plus + 1 state.new_game_plus = new_game_plus + max_units = 7 + new_game_plus system.save_state() main:add(BuyScreen'buy_screen') main:go_to('buy_screen', 0, {}, passives) @@ -868,7 +876,7 @@ function PassiveCard:update(dt) if self.selected and input.m1.pressed and self.arena.choosing_passives then self.arena.choosing_passives = false table.insert(passives, self.passive) - table.delete(run_passive_pool_by_tiers[passive_tiers[self.passive]], self.passive) + self.arena:restore_passives_to_pool(self.card_i) trigger:tween(0.25, _G, {slow_amount = 1}, math.linear, function() slow_amount = 1 self.arena:transition() diff --git a/enemies.lua b/enemies.lua index d1b6ec9..872f0ab 100644 --- a/enemies.lua +++ b/enemies.lua @@ -97,7 +97,7 @@ function Seeker:init(args) enemy:hit(10000) shoot1:play{pitch = random:float(0.95, 1.05), volume = 0.4} local n = 8 + new_game_plus*2 - for i = 1, n do EnemyProjectile{group = main.current.main, x = enemy.x, y = enemy.y, color = blue[0], r = (i-1)*math.pi/(n/2), v = 150 + 5*enemy.level, dmg = (1 + 0.2*new_game_plus)*enemy.dmg} end + for i = 1, n do EnemyProjectile{group = main.current.main, x = enemy.x, y = enemy.y, color = blue[0], r = (i-1)*math.pi/(n/2), v = 150 + 5*enemy.level, dmg = (1 + 0.1*new_game_plus)*enemy.dmg} end end end) @@ -212,8 +212,8 @@ function Seeker:init(args) self.hfx:use('hit', 0.25, 200, 10, 0.1) local r = self.r HitCircle{group = main.current.effects, x = self.x + 0.8*self.shape.w*math.cos(r), y = self.y + 0.8*self.shape.w*math.sin(r), rs = 6} - EnemyProjectile{group = main.current.main, x = self.x + 1.6*self.shape.w*math.cos(r), y = self.y + 1.6*self.shape.w*math.sin(r), color = fg[0], r = r, v = 150 + 5*self.level + 10*new_game_plus, - dmg = (new_game_plus*0.2 + 1)*self.dmg} + EnemyProjectile{group = main.current.main, x = self.x + 1.6*self.shape.w*math.cos(r), y = self.y + 1.6*self.shape.w*math.sin(r), color = fg[0], r = r, v = 150 + 5*self.level + 8*new_game_plus, + dmg = (new_game_plus*0.1 + 1)*self.dmg} end) end end, nil, nil, 'shooter') diff --git a/engine/datastructures/table.lua b/engine/datastructures/table.lua index 1edff1f..825039f 100644 --- a/engine/datastructures/table.lua +++ b/engine/datastructures/table.lua @@ -391,11 +391,12 @@ end function table.tostring(t) if type(t) == "table" then local str = "{" - for k, v in ipairs(t) do + for k, v in pairs(t) do if type(k) ~= "number" then k = '"' .. k .. '"' end str = str .. "[" .. k .. "] = " .. table.tostring(v) .. ", " end - return str:sub(1, -3) .. "}" + if str ~= "{" then return str:sub(1, -3) .. "}" + else return str .. "}" end else return tostring(t) end end diff --git a/engine/init.lua b/engine/init.lua index 096227c..27d6457 100644 --- a/engine/init.lua +++ b/engine/init.lua @@ -48,7 +48,6 @@ function engine_run(config) love.filesystem.setIdentity(config.game_name) steam.init() system.load_state() - if type(state) ~= 'table' then state = {} end local _, _, flags = love.window.getMode() local window_width, window_height = love.window.getDesktopDimensions(flags.display) @@ -69,6 +68,7 @@ function engine_run(config) sx, sy = state.sx, state.sy love.window.setMode(state.sx*gw, state.sy*gh, {fullscreen = state.fullscreen, vsync = config.vsync, msaa = msaa or 0, display = config.display}) else + state.sx, state.sy = sx, sy love.window.setMode(window_width, window_height, {fullscreen = config.fullscreen, vsync = config.vsync, msaa = msaa or 0, display = config.display}) end love.window.setTitle(config.game_name) diff --git a/engine/system.lua b/engine/system.lua index 50cc0b8..668a0ac 100644 --- a/engine/system.lua +++ b/engine/system.lua @@ -1,5 +1,4 @@ system = {} -local state_path = love.filesystem.getSaveDirectory() .. "/state" function system.update(dt) @@ -119,18 +118,22 @@ end function system.save_state() - if not system.does_file_exist(love.filesystem.getSaveDirectory()) then love.filesystem.createDirectory("") end - local file = io.open(state_path, "r") - if file then - file:close() - binser.w(state_path, state or {}) - end + love.filesystem.createDirectory("") + local str = "return " .. table.tostring(state or {}) + love.filesystem.write("state.txt", str) end function system.load_state() - if not system.does_file_exist(state_path) then system.save_state() end - state = binser.r(state_path)[1] + if love.filesystem.getInfo("state") then + state = binser.r(love.filesystem.getSaveDirectory() .. '/state')[1] + love.filesystem.createDirectory("old_save_backup") + os.rename(love.filesystem.getSaveDirectory() .. '/state', love.filesystem.getSaveDirectory() .. '/old_save_backup/state') + system.save_state() + end + local chunk = love.filesystem.load("state.txt") + if chunk then state = chunk() + else state = {} end end diff --git a/main.lua b/main.lua index 8602651..3d96469 100644 --- a/main.lua +++ b/main.lua @@ -152,7 +152,7 @@ function init() flying_daggers = Image('flying_daggers') assassination = Image('assassination') magnify = Image('magnify') - concentrated_fire = Image('concentrated_fire') + echo_barrage = Image('echo_barrage') unleash = Image('unleash') reinforce = Image('reinforce') payback = Image('payback') @@ -574,7 +574,7 @@ function init() character_effect_descriptions = { ['vagrant'] = function() return '[yellow]+10%[fg] damage and [yellow]+5%[fg] attack speed per active set' end, ['swordsman'] = function() return "[fg]the swordsman's damage is [yellow]doubled" end, - ['wizard'] = function() return '[fg]the projectile chains [yellow]5[fg] times' end, + ['wizard'] = function() return '[fg]the projectile chains [yellow]3[fg] times' end, ['archer'] = function() return '[fg]the arrow ricochets off walls [yellow]3[fg] times' end, ['scout'] = function() return '[yellow]+25%[fg] damage per chain and [yellow]+3[fg] chains' end, ['cleric'] = function() return '[fg]heals all units' end, @@ -585,7 +585,7 @@ function init() ['stormweaver'] = function() return "[fg]chain lightning's trigger area of effect and number of units hit is [yellow]doubled" end, ['sage'] = function() return '[fg]when the projectile expires deal [yellow]' .. 3*get_character_stat('sage', 3, 'dmg') .. '[fg] damage to all enemies under its influence' end, ['squire'] = function() return '[yellow]+30%[fg] damage, attack speed, movement speed and defense to all allies' end, - ['cannoneer'] = function() return '[fg]showers the hit area in [yellow]5[fg] additional cannon shots that deal [yellow]' .. get_character_stat('cannoneer', 3, 'dmg')/2 .. '[fg] AoE damage' end, + ['cannoneer'] = function() return '[fg]showers the hit area in [yellow]7[fg] additional cannon shots that deal [yellow]' .. get_character_stat('cannoneer', 3, 'dmg')/2 .. '[fg] AoE damage' end, ['dual_gunner'] = function() return '[fg]every 5th attack shoot in rapid succession for [yellow]2[fg] seconds' end, ['hunter'] = function() return '[fg]summons [yellow]3[fg] pets and the pets ricochet off walls once' end, ['chronomancer'] = function() return '[fg]enemies take damave over time [yellow]50%[fg] faster' end, @@ -618,7 +618,7 @@ function init() character_effect_descriptions_gray = { ['vagrant'] = function() return '[light_bg]+10% damage and +5% attack speed per active set' end, ['swordsman'] = function() return "[light_bg]the swordsman's damage is doubled" end, - ['wizard'] = function() return '[light_bg]the projectile chains 5 times' end, + ['wizard'] = function() return '[light_bg]the projectile chains 3 times' end, ['archer'] = function() return '[light_bg]the arrow ricochets off walls 3 times' end, ['scout'] = function() return '[light_bg]+25% damage per chain and +3 chains' end, ['cleric'] = function() return '[light_bg]heals all units' end, @@ -629,7 +629,7 @@ function init() ['stormweaver'] = function() return "[light_bg]chain lightning's trigger area of effect and number of units hit is doubled" end, ['sage'] = function() return '[light_bg]when the projectile expires deal ' .. 3*get_character_stat('sage', 3, 'dmg') .. ' damage to all enemies under its influence' end, ['squire'] = function() return '[light_bg]+30% damage, attack speed, movement speed and defense to all allies' end, - ['cannoneer'] = function() return '[light_bg]showers the hit area in 5 additional cannon shots that deal ' .. get_character_stat('cannoneer', 3, 'dmg')/2 .. ' AoE damage' end, + ['cannoneer'] = function() return '[light_bg]showers the hit area in 7 additional cannon shots that deal ' .. get_character_stat('cannoneer', 3, 'dmg')/2 .. ' AoE damage' end, ['dual_gunner'] = function() return '[light_bg]every 5th attack shoot in rapid succession for 2 seconds' end, ['hunter'] = function() return '[light_bg]summons 3 pets and the pets ricochet off walls once' end, ['chronomancer'] = function() return '[light_bg]enemies take damave over time 50% faster' end, @@ -729,12 +729,12 @@ function init() ['ranger'] = function(lvl) return '[' .. ylb1(lvl) .. ']3[' .. ylb2(lvl) .. ']/6 [fg]- [' .. ylb1(lvl) .. ']8%[' .. ylb2(lvl) .. ']/16% [fg]chance to release a barrage on attack to allied rangers' end, ['warrior'] = function(lvl) return '[' .. ylb1(lvl) .. ']3[' .. ylb2(lvl) .. ']/6 [fg]- [' .. ylb1(lvl) .. ']+25[' .. ylb2(lvl) .. ']/+50 [fg]defense to allied warriors' end, ['mage'] = function(lvl) return '[' .. ylb1(lvl) .. ']3[' .. ylb2(lvl) .. ']/6 [fg]- [' .. ylb1(lvl) .. ']-15[' .. ylb2(lvl) .. ']/-30 [fg]enemy defense' end, - ['rogue'] = function(lvl) return '[' .. ylb1(lvl) .. ']3[' .. ylb2(lvl) .. ']/6 [fg]- [' .. ylb1(lvl) .. ']10%[' .. ylb2(lvl) .. ']/20% [fg]chance to crit to allied rogues, dealing [yellow]4x[] damage' end, + ['rogue'] = function(lvl) return '[' .. ylb1(lvl) .. ']3[' .. ylb2(lvl) .. ']/6 [fg]- [' .. ylb1(lvl) .. ']15%[' .. ylb2(lvl) .. ']/30% [fg]chance to crit to allied rogues, dealing [yellow]4x[] damage' end, ['healer'] = function(lvl) return '[' .. ylb1(lvl) .. ']2[' .. ylb2(lvl) .. ']/4 [fg]- [' .. ylb1(lvl) .. ']+15%[' .. ylb2(lvl) .. ']/+30% [fg]healing effectiveness' end, ['enchanter'] = function(lvl) return '[' .. ylb1(lvl) .. ']2[' .. ylb2(lvl) .. ']/4 [fg]- [' .. ylb1(lvl) .. ']+15%[' .. ylb2(lvl) .. ']/+25% [fg]damage to all allies' end, ['nuker'] = function(lvl) return '[' .. ylb1(lvl) .. ']3[' .. ylb2(lvl) .. ']/6 [fg]- [' .. ylb1(lvl) .. ']+15%[' .. ylb2(lvl) .. ']/+25% [fg]area damage and size to allied nukers' end, ['conjurer'] = function(lvl) return '[' .. ylb1(lvl) .. ']2[' .. ylb2(lvl) .. ']/4 [fg]- [' .. ylb1(lvl) .. ']+25%[' .. ylb2(lvl) .. ']/+50% [fg]summon damage and duration' end, - ['psyker'] = function(lvl) return '[' .. ylb1(lvl) .. ']2[' .. ylb2(lvl) .. ']/4 [fg]- [' .. ylb1(lvl) .. ']+5%[' .. ylb2(lvl) .. ']/+10% [fg]damage and attack speed per active set to allied psykers' end, + ['psyker'] = function(lvl) return '[' .. ylb1(lvl) .. ']2[' .. ylb2(lvl) .. ']/4 [fg]- [' .. ylb1(lvl) .. ']+10%[' .. ylb2(lvl) .. ']/+20% [fg]damage and attack speed per active set to allied psykers' end, ['curser'] = function(lvl) return '[' .. ylb1(lvl) .. ']2[' .. ylb2(lvl) .. ']/4 [fg]- [' .. ylb1(lvl) .. ']+25%[' .. ylb2(lvl) .. ']/+50% [fg]curse duration' end, ['forcer'] = function(lvl) return '[' .. ylb1(lvl) .. ']2[' .. ylb2(lvl) .. ']/4 [fg]- [' .. ylb1(lvl) .. ']+25%[' .. ylb2(lvl) .. ']/+50% [fg]knockback force to all allies' end, ['swarmer'] = function(lvl) return '[' .. ylb1(lvl) .. ']2[' .. ylb2(lvl) .. ']/4 [fg]- [' .. ylb1(lvl) .. ']+1[' .. ylb2(lvl) .. ']/+3 [fg]hits to critters' end, @@ -911,7 +911,7 @@ function init() ['flying_daggers'] = 'Flying Daggers', ['assassination'] = 'Assassination', ['magnify'] = 'Magnify', - ['concentrated_fire'] = 'Concentrated Fire', + ['echo_barrage'] = 'Echo Barrage', ['unleash'] = 'Unleash', ['reinforce'] = 'Reinforce', ['payback'] = 'Payback', @@ -946,7 +946,7 @@ function init() ['longshot'] = '[fg]projectiles deal up to [yellow]+100%[fg] damage far away and down to [yellow]-50%[fg] up close', ['blunt_arrow'] = '[fg]all arrows fired by rangers have a [yellow]20%[fg] chance to knockback', ['explosive_arrow'] = '[fg]arrows fired by rangers have a [yellow]30%[fg] chance to explode, dealing [yellow]20%[fg] AoE damage', - ['divine_machine_arrow'] = '[fg]arrows fired by rangers have a [yellow]40%[fg] chance to seek enemies and pierce [yellow]5[fg] times', + ['divine_machine_arrow'] = '[fg]arrows fired by rangers have a [yellow]40%[fg] chance to seek enemies and pierce [yellow]4[fg] times', ['chronomancy'] = '[fg]all mages cast their spells [yellow]25%[fg] faster', ['awakening'] = '[fg]every round [yellow]1[fg] mage is granted [yellow]+100%[fg] attack speed and damage for that round', ['divine_punishment'] = '[fg]periodically deal [yellow]10X[fg] damage to all enemies, where [yellow]X[fg] is how many mages you have', @@ -956,7 +956,7 @@ function init() ['flying_daggers'] = '[fg]all knives thrown by rogues chain [yellow]+2[fg] times', ['assassination'] = '[fg]crits from rogues deal [yellow]8x[fg] damage but normal attacks deal [yellow]half[fg] damage', ['magnify'] = '[yellow]+25%[fg] area size', - ['concentrated_fire'] = '[yellow]-50%[fg] area size and [yellow]+100%[fg] area damage', + ['echo_barrage'] = '[yellow]20%[fg] chance to create [yellow]3[fg] secondary AoEs on AoE hit', ['unleash'] = '[yellow]+2%[fg] area size and damage per second', ['reinforce'] = '[yellow]+10%[fg] damage, defense and attack speed to all allies with at least one enchanter', ['payback'] = '[yellow]+5%[fg] damage to all allies whenever an enchanter is hit', @@ -1001,7 +1001,7 @@ function init() ['flying_daggers'] = 3, ['assassination'] = 1, ['magnify'] = 1, - ['concentrated_fire'] = 2, + ['echo_barrage'] = 2, ['unleash'] = 1, ['reinforce'] = 2, ['payback'] = 2, @@ -1021,7 +1021,7 @@ function init() tier_to_passives = { [1] = {'wall_echo', 'wall_rider', 'centipede', 'temporal_chains', 'amplify', 'amplify_x', 'ballista', 'ballista_x', 'blunt_arrow', 'berserking', 'unwavering_stance', 'assassination', 'unleash', 'blessing', 'hex_master', 'force_push', 'spawning_pool'}, - [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'concentrated_fire', + [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'echo_barrage', 'reinforce', 'payback', 'whispers_of_doom', 'heavy_impact', 'immolation', 'call_of_the_void'}, [3] = {'divine_machine_arrow', 'divine_punishment', 'flying_daggers', 'crucio', 'hive', 'void_rift'}, } @@ -1160,15 +1160,15 @@ function init() run_passive_pool_by_tiers = { [1] = { 'wall_echo', 'wall_rider', 'centipede', 'temporal_chains', 'amplify', 'amplify_x', 'ballista', 'ballista_x', 'blunt_arrow', 'berserking', 'unwavering_stance', 'assassination', 'unleash', 'blessing', 'hex_master', 'force_push', 'spawning_pool'}, - [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'concentrated_fire', + [2] = {'ouroboros_technique_r', 'ouroboros_technique_l', 'intimidation', 'vulnerability', 'resonance', 'point_blank', 'longshot', 'explosive_arrow', 'chronomancy', 'awakening', 'ultimatum', 'echo_barrage', 'reinforce', 'payback', 'whispers_of_doom', 'heavy_impact', 'immolation', 'call_of_the_void'}, [3] = {'divine_machine_arrow', 'divine_punishment', 'flying_daggers', 'crucio', 'hive', 'void_rift'}, } gold = 2 passives = {} steam.userStats.requestCurrentStats() - system.load_state() new_game_plus = state.new_game_plus or 0 + if not state.new_game_plus then state.new_game_plus = new_game_plus end max_units = 7 + new_game_plus main = Main() @@ -1256,6 +1256,10 @@ function update(dt) state.fullscreen = false end + if input.p.pressed then + system.save_state() + end + --[[ if input.f12.pressed then steam.userStats.resetAllStats(true) diff --git a/objects.lua b/objects.lua index 63c6a45..d13c1a6 100644 --- a/objects.lua +++ b/objects.lua @@ -232,14 +232,14 @@ 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, 15, 0, 0, 18, 0, 0, 21, 0, 0, 24, 25} - self.base_hp = 100 + (new_game_plus*10) + (90 + new_game_plus*14)*y[x] - self.base_dmg = (25 + new_game_plus*10) + (7 + new_game_plus*4)*y[x] + self.base_hp = 100 + (new_game_plus*5) + (90 + new_game_plus*10)*y[x] + self.base_dmg = (12 + new_game_plus*2) + (2 + new_game_plus)*y[x] self.base_mvspd = 35 + 1.5*y[x] 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} - self.base_hp = 22 + (new_game_plus*3) + (17 + new_game_plus*2.6)*y[x] - self.base_dmg = (4 + new_game_plus*1.5) + (2.2 + new_game_plus)*y[x] + self.base_hp = 22 + (new_game_plus*3) + (15 + new_game_plus*2.4)*y[x] + self.base_dmg = (4 + new_game_plus*1) + (2 + new_game_plus)*y[x] self.base_mvspd = 70 + 3*y[x] end elseif self:is(Saboteur) then diff --git a/player.lua b/player.lua index ede404d..af57fed 100644 --- a/player.lua +++ b/player.lua @@ -34,7 +34,7 @@ function Player:init(args) self.t:cooldown(2, function() local enemies = self:get_objects_in_shape(self.attack_sensor, main.current.enemies); return enemies and #enemies > 0 end, function() local closest_enemy = self:get_closest_object_in_shape(self.attack_sensor, main.current.enemies) if closest_enemy then - self:shoot(self:angle_to_object(closest_enemy), {chain = (self.level == 3 and 5 or 0)}) + self:shoot(self:angle_to_object(closest_enemy), {chain = (self.level == 3 and 3 or 0)}) end end, nil, nil, 'shoot') @@ -212,7 +212,7 @@ function Player:init(args) self.t:cooldown(4, function() local enemies = self:get_objects_in_shape(self.attack_sensor, main.current.enemies); return enemies and #enemies > 0 end, function() local closest_enemy = self:get_closest_object_in_shape(self.attack_sensor, main.current.enemies) if closest_enemy then - self:shoot(self:angle_to_object(closest_enemy), {chain = (self.level == 3 and 14 or 7), v = 70}) + self:shoot(self:angle_to_object(closest_enemy), {chain = (self.level == 3 and 14 or 7), v = 140}) end end, nil, nil, 'shoot') @@ -326,14 +326,14 @@ function Player:init(args) end, nil, nil, 'shoot') elseif self.character == 'highlander' then - self.attack_sensor = Circle(self.x, self.y, 32) + self.attack_sensor = Circle(self.x, self.y, 48) self.t:cooldown(4, function() local enemies = self:get_objects_in_shape(self.attack_sensor, main.current.enemies); return enemies and #enemies > 0 end, function() if self.level == 3 then self.t:every(0.25, function() - self:attack(48) + self:attack(72) end, 3) else - self:attack(48) + self:attack(72) end end, nil, nil, 'attack') @@ -536,11 +536,6 @@ function Player:init(args) self.magnify_area_size_m = 1.25 end - if self.concentrated_fire then - self.concentrated_fire_area_size_m = 0.66 - self.concentrated_fire_area_dmg_m = 2 - end - if self.unleash then self.unleash_area_dmg_m = 1 self.unleash_area_size_m = 1 @@ -596,7 +591,6 @@ function Player:init(args) end end) end - end @@ -677,8 +671,8 @@ function Player:update(dt) else self.conjurer_buff_m = 1 end if table.any(self.classes, function(v) return v == 'rogue' end) then - if main.current.rogue_level == 2 then self.chance_to_crit = 20 - elseif main.current.rogue_level == 1 then self.chance_to_crit = 10 + if main.current.rogue_level == 2 then self.chance_to_crit = 30 + elseif main.current.rogue_level == 1 then self.chance_to_crit = 15 elseif main.current.rogue_level == 0 then self.chance_to_crit = 0 end end @@ -702,11 +696,11 @@ function Player:update(dt) if class_levels.swarmer >= 1 then number_of_active_sets = number_of_active_sets + 1 end if class_levels.voider >= 1 then number_of_active_sets = number_of_active_sets + 1 end if main.current.psyker_level == 2 then - self.psyker_dmg_m = 1 + 0.1*number_of_active_sets - self.psyker_aspd_m = 1 + 0.1*number_of_active_sets + self.psyker_dmg_m = 1 + 0.2*number_of_active_sets + self.psyker_aspd_m = 1 + 0.2*number_of_active_sets elseif main.current.psyker_level == 1 then - self.psyker_dmg_m = 1 + 0.05*number_of_active_sets - self.psyker_aspd_m = 1 + 0.05*number_of_active_sets + self.psyker_dmg_m = 1 + 0.10*number_of_active_sets + self.psyker_aspd_m = 1 + 0.10*number_of_active_sets else self.psyker_dmg_m = 1 self.psyker_aspd_m = 1 @@ -746,8 +740,8 @@ function Player:update(dt) self.buff_aspd_m = (self.chronomancer_aspd_m or 1)*(self.vagrant_aspd_m or 1)*(self.outlaw_aspd_m or 1)*(self.fairy_aspd_m or 1)*(self.psyker_aspd_m or 1)*(self.chronomancy_aspd_m or 1)*(self.awakening_aspd_m or 1)*(self.berserking_aspd_m or 1)*(self.reinforce_aspd_m or 1)*(self.squire_aspd_m or 1) self.buff_dmg_m = (self.squire_dmg_m or 1)*(self.vagrant_dmg_m or 1)*(self.enchanter_dmg_m or 1)*(self.swordsman_dmg_m or 1)*(self.flagellant_dmg_m or 1)*(self.psyker_dmg_m or 1)*(self.ballista_dmg_m or 1)*(self.ballista_x_dmg_m or 1)*(self.awakening_dmg_m or 1)*(self.reinforce_dmg_m or 1)*(self.payback_dmg_m or 1)*(self.immolation_dmg_m or 1) self.buff_def_m = (self.squire_def_m or 1)*(self.ouroboros_def_m or 1)*(self.unwavering_stance_def_m or 1)*(self.reinforce_def_m or 1) - self.buff_area_size_m = (self.nuker_area_size_m or 1)*(self.magnify_area_size_m or 1)*(self.concentrated_fire_area_size_m or 1)*(self.unleash_area_size_m or 1) - self.buff_area_dmg_m = (self.nuker_area_dmg_m or 1)*(self.amplify_area_dmg_m or 1)*(self.amplify_x_area_dmg_m or 1)*(self.concentrated_fire_area_dmg_m or 1)*(self.unleash_area_dmg_m or 1) + self.buff_area_size_m = (self.nuker_area_size_m or 1)*(self.magnify_area_size_m or 1)*(self.unleash_area_size_m or 1) + self.buff_area_dmg_m = (self.nuker_area_dmg_m or 1)*(self.amplify_area_dmg_m or 1)*(self.amplify_x_area_dmg_m or 1)*(self.unleash_area_dmg_m or 1) self.buff_mvspd_m = (self.wall_rider_mvspd_m or 1)*(self.centipede_mvspd_m or 1)*(self.squire_mvspd_m or 1) self:calculate_stats() @@ -1292,7 +1286,7 @@ function Projectile:init(args) if self.parent.divine_machine_arrow and table.any(self.parent.classes, function(v) return v == 'ranger' end) then if random:bool(40) then self.homing = true - self.pierce = 5 + self.pierce = 4 end end @@ -1398,17 +1392,20 @@ function Projectile:die(x, y, r, n) self.dead = true if self.character == 'wizard' then - Area{group = main.current.effects, x = self.x, y = self.y, r = self.r, w = self.parent.area_size_m*32, color = self.color, dmg = self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self} + Area{group = main.current.effects, x = self.x, y = self.y, r = self.r, w = self.parent.area_size_m*32, color = self.color, dmg = self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self, + void_rift = self.parent.void_rift, echo_barrage = self.parent.echo_barrage} elseif self.character == 'blade' then - Area{group = main.current.effects, x = self.x, y = self.y, r = self.r, w = self.parent.area_size_m*64, color = self.color, dmg = self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self} + Area{group = main.current.effects, x = self.x, y = self.y, r = self.r, w = self.parent.area_size_m*64, color = self.color, dmg = self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self, + void_rift = self.parent.void_rift, echo_barrage = self.parent.echo_barrage} elseif self.character == 'cannoneer' then - Area{group = main.current.effects, x = self.x, y = self.y, r = self.r, w = self.parent.area_size_m*96, color = self.color, dmg = 2*self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self} + Area{group = main.current.effects, x = self.x, y = self.y, r = self.r, w = self.parent.area_size_m*96, color = self.color, dmg = 2*self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self, + void_rift = self.parent.void_rift, echo_barrage = self.parent.echo_barrage} if self.level == 3 then - self.parent.t:every(0.2, function() + self.parent.t:every(0.3, function() _G[random:table{'cannoneer1', 'cannoneer2'}]:play{pitch = random:float(0.95, 1.05), volume = 0.5} Area{group = main.current.effects, x = self.x + random:float(-32, 32), y = self.y + random:float(-32, 32), r = self.r + random:float(0, 2*math.pi), w = self.parent.area_size_m*48, color = self.color, - dmg = 0.5*self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self} - end, 5) + dmg = 0.5*self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self, void_rift = self.parent.void_rift, echo_barrage = self.parent.echo_barrage} + end, 7) end end end @@ -1513,7 +1510,8 @@ function Projectile:on_trigger_enter(other, contact) other:hit(self.dmg*(self.distance_dmg_m or 1), self) if self.character == 'wizard' and self.level == 3 then - Area{group = main.current.effects, x = self.x, y = self.y, r = self.r, w = self.parent.area_size_m*32, color = self.color, dmg = self.parent.area_dmg_m*self.dmg, character = self.character, parent = self} + Area{group = main.current.effects, x = self.x, y = self.y, r = self.r, w = self.parent.area_size_m*32, color = self.color, dmg = self.parent.area_dmg_m*self.dmg, character = self.character, parent = self, + void_rift = self.parent.void_rift, echo_barrage = self.parent.echo_barrage} end if self.character == 'hunter' and random:bool(40) then @@ -1580,7 +1578,7 @@ function Projectile:on_trigger_enter(other, contact) if random:bool(30) then _G[random:table{'cannoneer1', 'cannoneer2'}]:play{pitch = random:float(0.95, 1.05), volume = 0.5} Area{group = main.current.effects, x = self.x, y = self.y, r = self.r + random:float(0, 2*math.pi), w = self.parent.area_size_m*32, color = self.color, - dmg = 0.2*self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self} + dmg = 0.2*self.parent.area_dmg_m*self.dmg, character = self.character, level = self.level, parent = self, void_rift = self.parent.void_rift, echo_barrage = self.parent.echo_barrage} end end @@ -1655,9 +1653,38 @@ function Area:init(args) end end - if self.parent.void_rift and table.any(self.parent.classes, function(v) return v == 'mage' or v == 'nuker' or v == 'voider' end) then - if random:bool(20) then - DotArea{group = main.current.effects, x = self.x, y = self.y, rs = self.parent.area_size_m*24, color = self.color, dmg = self.parent.area_dmg_m*self.dmg*(self.parent.dot_dmg_m or 1), void_rift = true, duration = 1, parent = self.parent} + if self.parent:is(Projectile) then + local p = self.parent.parent + if p.void_rift and table.any(p.classes, function(v) return v == 'mage' or v == 'nuker' or v == 'voider' end) then + if random:bool(20) then + DotArea{group = main.current.effects, x = self.x, y = self.y, rs = p.area_size_m*24, color = self.color, dmg = p.area_dmg_m*self.dmg*(p.dot_dmg_m or 1), + void_rift = true, duration = 1, parent = p} + end + end + if p.echo_barrage and not self.echo_barrage_area then + if random:bool(20) then + p.t:every(0.3, function() + _G[random:table{'cannoneer1', 'cannoneer2'}]:play{pitch = random:float(0.95, 1.05), volume = 0.5} + Area{group = main.current.effects, x = self.x + random:float(-32, 32), y = self.y + random:float(-32, 32), r = self.r + random:float(0, 2*math.pi), w = p.area_size_m*48, color = p.color, + dmg = 0.5*p.area_dmg_m*self.dmg, character = self.character, level = p.level, parent = p, echo_barrage_area = true} + end, 3) + end + end + else + if self.parent.void_rift and table.any(self.parent.classes, function(v) return v == 'mage' or v == 'nuker' or v == 'voider' end) then + if random:bool(20) then + DotArea{group = main.current.effects, x = self.x, y = self.y, rs = self.parent.area_size_m*24, color = self.color, dmg = self.parent.area_dmg_m*self.dmg*(self.parent.dot_dmg_m or 1), + void_rift = true, duration = 1, parent = self.parent} + end + end + if self.parent.echo_barrage and not self.echo_barrage_area then + if random:bool(20) then + self.parent.t:every(0.3, function() + _G[random:table{'cannoneer1', 'cannoneer2'}]:play{pitch = random:float(0.95, 1.05), volume = 0.5} + Area{group = main.current.effects, x = self.x + random:float(-32, 32), y = self.y + random:float(-32, 32), r = self.r + random:float(0, 2*math.pi), w = self.parent.area_size_m*48, color = self.parent.color, + dmg = 0.5*self.parent.area_dmg_m*self.dmg, character = self.character, level = self.parent.level, parent = self.parent, echo_barrage_area = true} + end, 3) + end end end @@ -2144,6 +2171,9 @@ end function Saboteur:update(dt) self:update_game_object(dt) + + self.buff_area_size_m = self.parent.buff_area_size_m + self.buff_area_dmg_m = self.parent.buff_area_dmg_m self:calculate_stats() if not self.target then self.target = random:table(self.group:get_objects_by_classes(main.current.enemies)) end diff --git a/todo b/todo index 4e3cbc4..cb1dc94 100644 --- a/todo +++ b/todo @@ -1,4 +1,15 @@ -Lich buff -Highlander buff -Concentrated Fire change to "chance to create secondary AoEs on AoE hit" (like Cannoneer's Lv.3) -Change Cannoneer's Lv.3 to 7 repeats, and each repeat should be slightly slower +* Lich buff -> increased projectile speed +* Highlander buff -> increased area size +* Change Cannoneer's Lv.3 to 7 repeats, and each repeat should be slightly slower * +* Wizard chains 3 times +* Saboteur area fix +* NG+ snake size fix +* Change Divine Machine Arrow to pierce 4 times +* Rogue buff -> chance to crit 15/30 +* Psyker buff -> 10% bonus +* Concentrated Fire change to "chance to create secondary AoEs on AoE hit" (like Cannoneer's Lv.3) +* Decreased difficulty slightly for NG+ levels +* Remove repeat passives +* restart button on end game +* fixed interest above 5 +* fixed fast passive buy bug