From 968c09a8d98333cc7af8c5fb8a959e7036b09c2b Mon Sep 17 00:00:00 2001 From: a327ex Date: Sun, 30 May 2021 12:00:03 -0300 Subject: [PATCH] Assorted improvements --- arena.lua | 2 ++ buy_screen.lua | 34 +++++++++++++++++++++++++++++----- main.lua | 18 ++++++------------ objects.lua | 4 ++-- player.lua | 2 +- todo | 15 +++++++++++++-- 6 files changed, 53 insertions(+), 22 deletions(-) diff --git a/arena.lua b/arena.lua index 3b6c629..c953130 100644 --- a/arena.lua +++ b/arena.lua @@ -858,6 +858,7 @@ end function Arena:die() if not self.died_text and not self.won then + self.t:cancel('divine_punishment') self.died = true system.save_run() self.t:tween(2, self, {main_slow_amount = 0}, math.linear, function() self.main_slow_amount = 0 end) @@ -1162,6 +1163,7 @@ function CharacterHP:draw() graphics.pop() if state.cooldown_snake then + if table.any(non_cooldown_characters, function(v) return v == self.parent.character end) then return end local p = self.parent graphics.push(p.x, p.y, 0, self.hfx.hit.x, self.hfx.hit.y) if not p.dead then diff --git a/buy_screen.lua b/buy_screen.lua index e62c88f..8b59385 100644 --- a/buy_screen.lua +++ b/buy_screen.lua @@ -118,14 +118,14 @@ function BuyScreen:on_enter(from, level, units, passives) b.info_text:activate({ {text = '[fg]tutorial', font = pixul_font, alignment = 'center'}, }, nil, nil, nil, nil, 16, 4, nil, 2) - b.info_text.x, b.info_text.y = b.x, b.y + 16 + b.info_text.x, b.info_text.y = b.x, b.y + 20 end, mouse_exit = function(b) b.info_text:deactivate() b.info_text.dead = true b.info_text = nil end} - self.restart_button = Button{group = self.ui, x = gw/2 + 156, y = 18, force_update = true, button_text = 'R', fg_color = 'bg10', bg_color = 'bg', action = function(b) + self.restart_button = Button{group = self.ui, x = gw/2 + 156, y = 18, force_update = true, hold_button = 1, button_text = 'R', 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} @@ -152,7 +152,7 @@ function BuyScreen:on_enter(from, level, units, passives) b.info_text:activate({ {text = '[fg]restart run', font = pixul_font, alignment = 'center'}, }, nil, nil, nil, nil, 16, 4, nil, 2) - b.info_text.x, b.info_text.y = b.x, b.y + 16 + b.info_text.x, b.info_text.y = b.x, b.y + 20 end, mouse_exit = function(b) b.info_text:deactivate() b.info_text.dead = true @@ -577,14 +577,38 @@ function Button:update(dt) self:update_game_object(dt) if main.current.in_credits and not self.credits_button then return end - if self.selected and input.m1.pressed then - self:action() + if self.hold_button then + if self.selected and input.m1.pressed then + self.press_time = love.timer.getTime() + self.spring:pull(0.2, 200, 10) + end + if self.press_time then + if input.m1.down and love.timer.getTime() - self.press_time > self.hold_button then + self:action() + self.press_time = nil + self.spring:pull(0.1, 200, 10) + end + end + if input.m1.released then + self.press_time = nil + self.spring:pull(0.1, 200, 10) + end + else + if self.selected and input.m1.pressed then + self:action() + end end end function Button:draw() graphics.push(self.x, self.y, 0, self.spring.x, self.spring.y) + if self.hold_button and self.press_time then + graphics.set_line_width(5) + graphics.set_color(fg[-5]) + graphics.arc('open', self.x, self.y, 0.6*self.shape.w, 0, math.remap(love.timer.getTime() - self.press_time, 0, self.hold_button, 0, 1)*2*math.pi) + graphics.set_line_width(1) + end graphics.rectangle(self.x, self.y, self.shape.w, self.shape.h, 4, 4, self.selected and fg[0] or _G[self.bg_color][0]) self.text:draw(self.x, self.y + 1, 0, 1, 1) graphics.pop() diff --git a/main.lua b/main.lua index 5b5ca46..9e7b846 100644 --- a/main.lua +++ b/main.lua @@ -749,6 +749,7 @@ function init() } non_attacking_characters = {'cleric', 'stormweaver', 'squire', 'chronomancer', 'sage', 'psykeeper', 'bane', 'carver', 'fairy', 'priest', 'flagellant'} + non_cooldown_characters = {'squire', 'chronomancer', 'psykeeper'} character_tiers = { ['vagrant'] = 1, @@ -1185,18 +1186,11 @@ function init() --[[ main:add(Arena'arena') main:go_to('arena', 23, { - {character = 'dual_gunner', level = 3}, - {character = 'engineer', level = 3}, - {character = 'spellblade', level = 3}, - {character = 'assassin', level = 3}, - {character = 'scout', level = 3}, - {character = 'engineer', level = 3}, - {character = 'swordsman', level = 3}, - {character = 'archer', level = 3}, - {character = 'infestor', level = 3}, - {character = 'host', level = 3}, - {character = 'lich', level = 3}, - {character = 'psykino', level = 3}, + {character = 'wizard', level = 1}, + {character = 'spellblade', level = 1}, + {character = 'chronomancer', level = 1}, + {character = 'lich', level = 1}, + {character = 'psykino', level = 1}, }, passives) ]]-- diff --git a/objects.lua b/objects.lua index 5916078..6484f19 100644 --- a/objects.lua +++ b/objects.lua @@ -239,8 +239,8 @@ 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} - self.base_hp = 28 + 18*y[x] - self.base_dmg = 5 + 3*y[x] + self.base_hp = 25 + 16.5*y[x] + self.base_dmg = 4.5 + 2.5*y[x] self.base_mvspd = 70 + 3*y[x] end else diff --git a/player.lua b/player.lua index 0c20bad..9b2f906 100644 --- a/player.lua +++ b/player.lua @@ -548,7 +548,7 @@ function Player:init(args) LightningLine{group = main.current.effects, src = {x = enemy.x, y = enemy.y - 32}, dst = enemy, color = blue[0], duration = 0.2} _G[random:table{'spark1', 'spark2', 'spark3'}]:play{pitch = random:float(0.9, 1.1), volume = 0.3} end - end) + end, nil, nil, 'divine_punishment') end if self.unwavering_stance and table.any(self.classes, function(v) return v == 'warrior' end) then diff --git a/todo b/todo index 762f496..1688947 100644 --- a/todo +++ b/todo @@ -1,4 +1,15 @@ Hide cursor during waves Mouse follow control? -Bench - https://i.imgur.com/B1gNVKk.png -Item reroll for 10 gold +Item reroll for 15 gold +Option to have an arrow at the head of the snake - https://imgur.com/a/poXVsoN +Balance option for when there are more sets - https://i.imgur.com/JMynwbL.png +Bench? - https://i.imgur.com/B1gNVKk.png + +Patch Notes: +Decreased projectile speed for the exploder (blue enemy) +Added tooltips for "restart run" and "tutorial" buttons on the shop +Added a hold mechanism to the restart button, now it will only trigger a restart if you hold the button down for 1 second +Fixed text that was going outside the screen for the Priest and the Assassin +Fixed bug where Divine Punishment would continue triggering after death +Removed cooldown visuals on snake for units that don't have cooldowns (Squire, Chronomancer and Psykeeper) +Slightly decreased base game's difficulty