Shop update 4/5

master
a327ex 2021-06-11 01:44:06 -03:00
parent 8f2caf7109
commit ada06aa107
7 changed files with 271 additions and 46 deletions

View File

@ -7,12 +7,14 @@ function Arena:init(name)
end
function Arena:on_enter(from, level, units, passives)
function Arena:on_enter(from, level, units, passives, shop_level, shop_xp)
self.hfx:add('condition1', 1)
self.hfx:add('condition2', 1)
self.level = level or 1
self.units = units
self.passives = passives
self.shop_level = shop_level or 1
self.shop_xp = shop_xp or 0
if not state.mouse_control then
input:set_mouse_visible(false)
@ -401,7 +403,7 @@ function Arena:update(dt)
main:add(BuyScreen'buy_screen')
locked_state = nil
system.save_run()
main:go_to('buy_screen', 0, {}, passives)
main:go_to('buy_screen', 0, {}, passives, 1, 0)
end, text = Text({{text = '[wavy, bg]restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)}
end}
@ -579,7 +581,7 @@ function Arena:update(dt)
main:add(BuyScreen'buy_screen')
locked_state = nil
system.save_run()
main:go_to('buy_screen', 0, {}, passives)
main:go_to('buy_screen', 0, {}, passives, 1, 0)
end, text = Text({{text = '[wavy, bg]restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)}
end
@ -1002,7 +1004,7 @@ function Arena:die()
max_units = 7 + current_new_game_plus
main:add(BuyScreen'buy_screen')
system.save_run()
main:go_to('buy_screen', 0, {}, passives)
main:go_to('buy_screen', 0, {}, passives, 1, 0)
end, text = Text({{text = '[wavy, bg]restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)}
end}
end)
@ -1082,10 +1084,23 @@ function Arena:transition()
self.transitioning = true
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)
if self.level % 2 == 0 and self.shop_level < 5 then
self.shop_xp = self.shop_xp + 1
local max_xp = 0
if self.shop_level == 1 then max_xp = 3
elseif self.shop_level == 2 then max_xp = 4
elseif self.shop_level == 3 then max_xp = 5
elseif self.shop_level == 4 then max_xp = 6
elseif self.shop_level == 5 then max_xp = 0 end
if self.shop_xp >= max_xp then
self.shop_xp = 0
self.shop_level = self.shop_level + 1
end
end
slow_amount = 1
main:add(BuyScreen'buy_screen')
system.save_run(self.level, gold, self.units, self.passives, run_passive_pool_by_tiers, locked_state)
main:go_to('buy_screen', self.level, self.units, self.passives)
system.save_run(self.level, gold, self.units, self.passives, self.shop_level, self.shop_xp, run_passive_pool_by_tiers, locked_state)
main:go_to('buy_screen', self.level, self.units, self.passives, self.shop_level, self.shop_xp)
t.t:after(0.1, function()
t.text:set_text({
{text = '[nudge_down, bg]gold gained: ' .. tostring(self.gold_gained or 0) .. ' + ' .. tostring(self.gold_picked_up or 0), font = pixul_font, alignment = 'center', height_multiplier = 1.5},

View File

@ -34,13 +34,16 @@ function BuyScreen:on_exit()
self.hfx = nil
self.tutorial_button = nil
self.restart_button = nil
self.level_button = nil
end
function BuyScreen:on_enter(from, level, units, passives)
function BuyScreen:on_enter(from, level, units, passives, shop_level, shop_xp)
self.level = level
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)
@ -80,6 +83,7 @@ function BuyScreen:on_enter(from, level, units, passives)
if not self.first_screen then RerollButton{group = self.main, x = 150, y = 18, parent = self} end
GoButton{group = self.main, x = gw - 90, y = gh - 20, parent = self}
LevelButton{group = self.main, x = gw/2, y = 18, parent = self}
self.tutorial_button = Button{group = self.main, x = gw/2 + 134, y = 18, button_text = '?', fg_color = 'bg10', bg_color = 'bg', action = function()
self.in_tutorial = true
self.title_text = Text2{group = self.tutorial, x = gw/2, y = 35, lines = {{text = '[fg]WELCOME TO SNKRX!', font = fat_font, alignment = 'center'}}}
@ -147,7 +151,7 @@ function BuyScreen:on_enter(from, level, units, passives)
max_units = 7 + current_new_game_plus
main:add(BuyScreen'buy_screen')
system.save_run()
main:go_to('buy_screen', 0, {}, passives)
main:go_to('buy_screen', 0, {}, passives, 1, 0)
end, text = Text({{text = '[wavy, 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}
@ -221,7 +225,7 @@ function BuyScreen:draw()
self.main:draw()
self.effects:draw()
if self.items_text then self.items_text:draw(32, 145) end
if self.level_text then self.level_text:draw(260, gh - 20) end
if self.level_text then self.level_text:draw(265, gh - 20) end
self.ui:draw()
if self.unit_grabbed then
@ -239,7 +243,7 @@ function BuyScreen:draw()
if self.shop_text then self.shop_text:draw(64, 20) end
if self.sets_text then self.sets_text:draw(328, 20) end
if self.party_text then self.party_text:draw(440, 20) end
if current_new_game_plus > 0 then self.ng_text:draw(260, 20) end
if current_new_game_plus > 0 then self.ng_text:draw(265, gh - 40) end
if self.in_tutorial then
graphics.rectangle(gw/2, gh/2, 2*gw, 2*gh, nil, nil, modal_transparent_2)
@ -322,17 +326,19 @@ function BuyScreen:gain_gold(amount)
end
function BuyScreen:set_cards(level, dont_spawn_effect, first_call)
function BuyScreen:set_cards(shop_level, dont_spawn_effect, first_call)
if self.cards then for i = 1, 3 do if self.cards[i] then self.cards[i]:die(dont_spawn_effect) end end end
self.cards = {}
local all_units = {}
local unit_1
local unit_2
local unit_3
local shop_level = shop_level or 1
local tier_weights = get_shop_odds_by_level(shop_level)
repeat
unit_1 = random:table(tier_to_characters[random:weighted_pick(unpack(level_to_tier_weights[level or self.level]))])
unit_2 = random:table(tier_to_characters[random:weighted_pick(unpack(level_to_tier_weights[level or self.level]))])
unit_3 = random:table(tier_to_characters[random:weighted_pick(unpack(level_to_tier_weights[level or self.level]))])
unit_1 = random:table(tier_to_characters[random:weighted_pick(unpack(tier_weights))])
unit_2 = random:table(tier_to_characters[random:weighted_pick(unpack(tier_weights))])
unit_3 = random:table(tier_to_characters[random:weighted_pick(unpack(tier_weights))])
all_units = {unit_1, unit_2, unit_3}
until not table.all(all_units, function(v) return table.any(non_attacking_characters, function(u) return v == u end) end)
if first_call and self.locked then
@ -536,7 +542,7 @@ function RestartButton:update(dt)
system.save_state()
main:add(BuyScreen'buy_screen')
system.save_run()
main:go_to('buy_screen', 0, {}, passives)
main:go_to('buy_screen', 0, {}, passives, 1, 0)
end, text = Text({{text = '[wavy, bg]restarting...', font = pixul_font, alignment = 'center'}}, global_text_tags)}
end
end
@ -684,7 +690,7 @@ function GoButton:update(dt)
self.transitioning = true
TransitionEffect{group = main.transitions, x = self.x, y = self.y, color = character_colors[random:table(self.parent.units).character], transition_action = function()
main:add(Arena'arena')
main:go_to('arena', ((self.parent.first_screen and 1) or (self.parent.level + 1)), self.parent.units, self.parent.passives)
main:go_to('arena', ((self.parent.first_screen and 1) or (self.parent.level + 1)), self.parent.units, self.parent.passives, self.parent.shop_level, self.parent.shop_xp)
end, text = Text({{text = '[wavy, bg]level ' .. ((self.parent.first_screen and 1) or (self.parent.level + 1)) .. '/25', font = pixul_font, alignment = 'center'}}, global_text_tags)}
end
end
@ -735,7 +741,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 == 1 and 0 or self.parent.level, gold, self.parent.units, passives, run_passive_pool_by_tiers, locked_state)
system.save_run(self.parent.level == 1 and 0 or self.parent.level, gold, self.parent.units, passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool_by_tiers, locked_state)
end
ui_switch2:play{pitch = random:float(0.95, 1.05), volume = 0.5}
self.selected = true
@ -771,6 +777,129 @@ end
LevelButton = Object:extend()
LevelButton:implement(GameObject)
function LevelButton:init(args)
self:init_game_object(args)
self.interact_with_mouse = true
self.shape = Rectangle(self.x, self.y, 16, 16)
self.text = Text({{text = '[bg10]' .. tostring(self.parent.shop_level), font = pixul_font, alignment = 'center'}}, global_text_tags)
self.shop_xp = self.parent.shop_xp or 0
self.max_xp = (self.parent.shop_level == 1 and 3) or (self.parent.shop_level == 2 and 4) or (self.parent.shop_level == 3 and 5) or (self.parent.shop_level == 4 or 6) or (self.parent.shop_level == 5 or 0)
end
function LevelButton:update(dt)
self:update_game_object(dt)
if self.selected and input.m1.pressed then
if self.parent.shop_level >= 5 then return end
if gold < 5 then
self.spring:pull(0.2, 200, 10)
self.selected = true
error1:play{pitch = random:float(0.95, 1.05), volume = 0.5}
if not self.info_text_2 then
self.info_text_2 = InfoText{group = main.current.ui}
self.info_text_2:activate({
{text = '[fg]not enough gold', font = pixul_font, alignment = 'center'},
}, nil, nil, nil, nil, 16, 4, nil, 2)
self.info_text_2.x, self.info_text_2.y = gw/2, gh/2 + 30
end
self.t:after(2, function() self.info_text_2:deactivate(); self.info_text_2.dead = true; self.info_text_2 = nil end, 'info_text_2')
else
ui_switch2:play{pitch = random:float(0.95, 1.05), volume = 0.5}
self.shop_xp = self.shop_xp + 1
if self.shop_xp >= self.max_xp then
self.shop_xp = 0
self.parent.shop_level = self.parent.shop_level + 1
self.max_xp = (self.parent.shop_level == 1 and 3) or (self.parent.shop_level == 2 and 4) or (self.parent.shop_level == 3 and 5) or (self.parent.shop_level == 4 or 6) or (self.parent.shop_level == 5 or 0)
-- Reload info text
if self.info_text then
self.info_text:deactivate()
self.info_text.dead = true
end
self.info_text = nil
local t11, t12 = get_shop_odds(self.parent.shop_level, 1), get_shop_odds(self.parent.shop_level+1, 1)
local t21, t22 = get_shop_odds(self.parent.shop_level, 2), get_shop_odds(self.parent.shop_level+1, 2)
local t31, t32 = get_shop_odds(self.parent.shop_level, 3), get_shop_odds(self.parent.shop_level+1, 3)
local t41, t42 = get_shop_odds(self.parent.shop_level, 4), get_shop_odds(self.parent.shop_level+1, 4)
self.info_text = InfoText{group = main.current.ui}
self.info_text:activate({
{text = '[yellow]Lv.' .. self.parent.shop_level .. '[fg] shop, XP: [yellow]' .. self.parent.shop_xp .. '/' .. self.max_xp, font = pixul_font, alignment = 'center', height_multiplier = 1.5},
{text = '[bg10]chances of units appearing on the shop', font = pixul_font, alignment = 'center', height_multiplier = 1.25},
{text = '[yellow]current shop level [fgm10]next shop level', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
{text = '[fg]tier 1: ' .. t11 .. '%' .. tostring(t11 < 10 and ' ' or '') .. ' [fgm8]tier 1: ' .. t12 .. '%', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
{text = '[green]tier 2: ' .. t21 .. '%' .. tostring(t21 < 10 and ' ' or '') .. ' [fgm6]tier 2: ' .. t22 .. '%', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
{text = '[blue]tier 3: ' .. t31 .. '%' .. tostring(t31 < 10 and ' ' or '') .. ' [fgm4]tier 3: ' .. t32 .. '%', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
{text = '[purple]tier 4: ' .. t41 .. '%' .. tostring(t41 < 10 and ' ' or '') .. ' [fgm2]tier 4: ' .. t42 .. '%', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
}, nil, nil, nil, nil, 16, 4, nil, 2)
self.info_text.x, self.info_text.y = gw/2, gh/2 - 45
end
self.parent.shop_xp = self.shop_xp
self.selected = true
self.spring:pull(0.2, 200, 10)
gold = gold - 5
self.parent.shop_text:set_text{{text = '[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)
end
end
end
function LevelButton:draw()
graphics.push(self.x, self.y, 0, self.spring.x, self.spring.y)
graphics.rectangle(self.x, self.y, self.shape.w, self.shape.h, 4, 4, self.selected and fg[0] or bg[1])
self.text:draw(self.x, self.y + 1)
for i = 1, self.max_xp do
graphics.line(self.x + 0.9*self.shape.w + (i-1)*5, self.y - self.shape.h/3, self.x + 0.9*self.shape.w + (i-1)*5, self.y + self.shape.h/3, bg[1], 2)
end
for i = 1, self.shop_xp do
graphics.line(self.x + 0.9*self.shape.w + (i-1)*5, self.y - self.shape.h/3, self.x + 0.9*self.shape.w + (i-1)*5, self.y + self.shape.h/3, fg[0], 2)
end
graphics.pop()
end
function LevelButton:on_mouse_enter()
ui_hover1:play{pitch = random:float(1.3, 1.5), volume = 0.5}
pop2:play{pitch = random:float(0.95, 1.05), volume = 0.5}
self.selected = true
self.text:set_text{{text = '[fgm5]' .. tostring(self.parent.shop_level), font = pixul_font, alignment = 'center'}}
self.spring:pull(0.2, 200, 10)
local t11, t12 = get_shop_odds(self.parent.shop_level, 1), get_shop_odds(self.parent.shop_level+1, 1)
local t21, t22 = get_shop_odds(self.parent.shop_level, 2), get_shop_odds(self.parent.shop_level+1, 2)
local t31, t32 = get_shop_odds(self.parent.shop_level, 3), get_shop_odds(self.parent.shop_level+1, 3)
local t41, t42 = get_shop_odds(self.parent.shop_level, 4), get_shop_odds(self.parent.shop_level+1, 4)
self.info_text = InfoText{group = main.current.ui}
self.info_text:activate({
{text = '[yellow]Lv.' .. self.parent.shop_level .. '[fg] shop, XP: [yellow]' .. self.parent.shop_xp .. '/' .. self.max_xp, font = pixul_font, alignment = 'center', height_multiplier = 1.5},
{text = '[bg10]chances of units appearing on the shop', font = pixul_font, alignment = 'center', height_multiplier = 1.25},
{text = '[yellow]current shop level [fgm10]next shop level', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
{text = '[fg]tier 1: ' .. t11 .. '%' .. tostring(t11 < 10 and ' ' or '') .. ' [fgm8]tier 1: ' .. t12 .. '%', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
{text = '[green]tier 2: ' .. t21 .. '%' .. tostring(t21 < 10 and ' ' or '') .. ' [fgm6]tier 2: ' .. t22 .. '%', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
{text = '[blue]tier 3: ' .. t31 .. '%' .. tostring(t31 < 10 and ' ' or '') .. ' [fgm4]tier 3: ' .. t32 .. '%', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
{text = '[purple]tier 4: ' .. t41 .. '%' .. tostring(t41 < 10 and ' ' or '') .. ' [fgm2]tier 4: ' .. t42 .. '%', font = pixul_font, alignment = 'left', height_multiplier = 1.25},
}, nil, nil, nil, nil, 16, 4, nil, 2)
self.info_text.x, self.info_text.y = gw/2, gh/2 - 45
end
function LevelButton:on_mouse_exit()
self.text:set_text{{text = '[bg10]' .. tostring(self.parent.shop_level), font = pixul_font, alignment = 'center'}}
self.selected = false
if self.info_text then
self.info_text:deactivate()
self.info_text.dead = true
end
self.info_text = nil
end
RerollButton = Object:extend()
RerollButton:implement(GameObject)
function RerollButton:init(args)
@ -811,12 +940,12 @@ function RerollButton:update(dt)
self.t:after(2, function() self.info_text:deactivate(); self.info_text.dead = true; self.info_text = nil end, 'info_text')
else
ui_switch2:play{pitch = random:float(0.95, 1.05), volume = 0.5}
self.parent:set_cards(random:int(1, 25), true)
self.parent:set_cards(self.parent.shop_level, true)
self.selected = true
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 == 1 and 0 or self.parent.level, gold, self.parent.units, passives, run_passive_pool_by_tiers, locked_state)
system.save_run(self.parent.level == 1 and 0 or self.parent.level, gold, self.parent.units, passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool_by_tiers, locked_state)
end
elseif self.parent:is(Arena) then
if gold < 15 and not self.free_reroll then
@ -1301,7 +1430,7 @@ function ShopCard:update(dt)
_G[random:table{'coins1', 'coins2', 'coins3'}]:play{pitch = random:float(0.95, 1.05), volume = 0.5}
self:die()
self.parent.cards[self.i] = nil
system.save_run(self.parent.level == 1 and 0 or self.parent.level, gold, self.parent.units, passives, run_passive_pool_by_tiers, locked_state)
system.save_run(self.parent.level == 1 and 0 or self.parent.level, gold, self.parent.units, passives, self.parent.shop_level, self.parent.shop_xp, run_passive_pool_by_tiers, locked_state)
else
error1:play{pitch = random:float(0.95, 1.05), volume = 0.5}
self.spring:pull(0.2, 200, 10)

View File

@ -137,8 +137,8 @@ function system.load_state()
end
function system.save_run(level, gold, units, passives, run_passive_pool_by_tiers, locked_state)
local run = {level = level, gold = gold, units = units, passives = passives, run_passive_pool_by_tiers = run_passive_pool_by_tiers, locked_state = locked_state}
function system.save_run(level, gold, units, passives, shop_level, shop_xp, run_passive_pool_by_tiers, locked_state)
local run = {level = level, gold = gold, units = units, passives = passives, shop_level = shop_level, shop_xp = shop_xp, run_passive_pool_by_tiers = run_passive_pool_by_tiers, locked_state = locked_state}
local str = "return " .. table.tostring(run)
love.filesystem.write("run.txt", str)
end

View File

@ -272,7 +272,7 @@ function init()
['vulcanist'] = 'Vulcanist',
['warden'] = 'Warden',
['psychic'] = 'Psychic',
['treasure_hunter'] = 'Treasure Hunter',
['miner'] = 'Miner',
['merchant'] = 'Merchant',
['usurer'] = 'Usurer',
['gambler'] = 'Gambler',
@ -329,7 +329,7 @@ function init()
['vulcanist'] = red[0],
['warden'] = yellow[0],
['psychic'] = fg[0],
['treasure_hunter'] = yellow2[0],
['miner'] = yellow2[0],
['merchant'] = yellow2[0],
['usurer'] = purple[0],
['gambler'] = yellow2[0],
@ -386,7 +386,7 @@ function init()
['vulcanist'] = 'red',
['warden'] = 'yellow',
['psychic'] = 'fg',
['treasure_hunter'] = 'yellow2',
['miner'] = 'yellow2',
['merchant'] = 'yellow2',
['usurer'] = 'purple',
['gambler'] = 'yellow2',
@ -443,7 +443,7 @@ function init()
['vulcanist'] = {'sorcerer', 'nuker'},
['warden'] = {'sorcerer', 'forcer'},
['psychic'] = {'sorcerer', 'psyker'},
['treasure_hunter'] = {'mercenary'},
['miner'] = {'mercenary'},
['merchant'] = {'mercenary'},
['usurer'] = {'curser', 'mercenary', 'voider'},
['gambler'] = {'mercenary', 'sorcerer'},
@ -500,7 +500,7 @@ function init()
['vulcanist'] = '[blue2]Sorcerer, [red]Nuker',
['warden'] = '[blue2]Sorcerer, [yellow]Forcer',
['psychic'] = '[blue2]Sorcerer, [fg]Psyker',
['treasure_hunter'] = '[yellow2]Mercenary',
['miner'] = '[yellow2]Mercenary',
['merchant'] = '[yellow2]Mercenary',
['usurer'] = '[purple]Curser, [yellow2]Mercenary, [purple]Curser',
['gambler'] = '[yellow2]Mercenary, [blue2]Sorcerer',
@ -574,7 +574,7 @@ function init()
['vulcanist'] = function(lvl) return '[fg]creates a volcano that explodes the nearby area [yellow]4[fg] times, dealing [yellow]' .. get_character_stat('vulcanist', lvl, 'dmg') .. ' AoE [fg]damage' end,
['warden'] = function(lvl) return '[fg]creates a force field around a random unit that prevents enemies from entering' end,
['psychic'] = function(lvl) return '[fg]creates a small area that deals [yellow]' .. get_character_stat('psychic', lvl, 'dmg') .. ' AoE[fg] damage' end,
['treasure_hunter'] = function(lvl) return '[fg]picking up gold releases [yellow]4[fg] homing projectiles that each deal [yellow]' .. get_character_stat('treasure_hunter', lvl, 'dmg') .. ' [fg]damage' end,
['miner'] = function(lvl) return '[fg]picking up gold releases [yellow]4[fg] homing projectiles that each deal [yellow]' .. get_character_stat('miner', lvl, 'dmg') .. ' [fg]damage' end,
['merchant'] = function(lvl) return '[fg]gain [yellow]+1[fg] interest for every [yellow]10[fg] gold' end,
['usurer'] = function(lvl) return '[fg]curses [yellow]3[fg] nearby enemies indefinitely with [yellow]debt[fg], dealing [yellow]' .. get_character_stat('usurer', lvl, 'dmg') .. '[fg] damage per second' end,
['gambler'] = function(lvl) return '[fg]deal [yellow]2X[fg] damage to a single random enemy where X is how much gold you have' end,
@ -631,7 +631,7 @@ function init()
['vulcanist'] = '[red]Lava Burst',
['warden'] = '[yellow]Magnetic Field',
['psychic'] = '[fg]Mental Strike',
['treasure_hunter'] = '[yellow2]Golden Bolts',
['miner'] = '[yellow2]Golden Bolts',
['merchant'] = '[yellow2]Item Shop',
['usurer'] = '[purple]Bankruptcy',
['gambler'] = '[yellow2]Multicast',
@ -688,7 +688,7 @@ function init()
['vulcanist'] = '[light_bg]Lava Burst',
['warden'] = '[light_bg]Magnetic Field',
['psychic'] = '[light_bg]Mental Strike',
['treasure_hunter'] = '[light_bg]Golden Bolts',
['miner'] = '[light_bg]Golden Bolts',
['merchant'] = '[light_bg]Item Shop',
['usurer'] = '[light_bg]Bankruptcy',
['gambler'] = '[light_bg]Multicast',
@ -745,7 +745,7 @@ function init()
['vulcanist'] = function() return '[fg]the number and speed of explosions is [yellow]doubled[fg]' end,
['warden'] = function() return '[fg]creates the force field around [yellow]2[fg] units' end,
['psychic'] = function() return '[fg]the attack can happen from any distance and repeats once' end,
['treasure_hunter'] = function() return '[fg]release [yellow]8[fg] homing projectiles instead and they pierce twice' end,
['miner'] = function() return '[fg]release [yellow]8[fg] homing projectiles instead and they pierce twice' end,
['merchant'] = function() return '[fg]your first item reroll is always free' end,
['usurer'] = function() return '[fg]if the same enemy is cursed [yellow]3[fg] times it takes [yellow]' .. 10*get_character_stat('usurer', 3, 'dmg') .. '[fg] damage' end,
['gambler'] = function() return '[yellow]60/40/20%[fg] chance to cast the attack [yellow]2/3/4[fg] times' end,
@ -802,7 +802,7 @@ function init()
['vulcanist'] = function() return '[light_bg]the number and speed of explosions is doubled' end,
['warden'] = function() return '[light_bg]creates the force field around 2 units' end,
['psychic'] = function() return '[light_bg]the attack can happen from any distance and repeats once' end,
['treasure_hunter'] = function() return '[light_bg]release 8 homing projectiles instead and they pierce twice' end,
['miner'] = function() return '[light_bg]release 8 homing projectiles instead and they pierce twice' end,
['merchant'] = function() return '[light_bg]your first item reroll is always free' end,
['usurer'] = function() return '[light_bg]if the same enemy is cursed 3 times it takes ' .. 10*get_character_stat('usurer', 3, 'dmg') .. ' damage' end,
['gambler'] = function() return '[light_bg]60/40/20% chance to cast the attack 2/3/4 times' end,
@ -859,7 +859,7 @@ function init()
['vulcanist'] = function(lvl) return get_character_stat_string('vulcanist', lvl) end,
['warden'] = function(lvl) return get_character_stat_string('warden', lvl) end,
['psychic'] = function(lvl) return get_character_stat_string('psychic', lvl) end,
['treasure_hunter'] = function(lvl) return get_character_stat_string('treasure_hunter', lvl) end,
['miner'] = function(lvl) return get_character_stat_string('miner', lvl) end,
['merchant'] = function(lvl) return get_character_stat_string('merchant', lvl) end,
['usurer'] = function(lvl) return get_character_stat_string('usurer', lvl) end,
['gambler'] = function(lvl) return get_character_stat_string('gambler', lvl) end,
@ -924,14 +924,14 @@ function init()
}
tier_to_characters = {
[1] = {'vagrant', 'swordsman', 'magician', 'archer', 'scout', 'cleric', 'arcanist', 'treasure_hunter'},
[1] = {'vagrant', 'swordsman', 'magician', 'archer', 'scout', 'cleric', 'arcanist', 'miner'},
[2] = {'wizard', 'saboteur', 'sage', 'squire', 'dual_gunner', 'hunter', 'chronomancer', 'barbarian', 'cryomancer', 'beastmaster', 'launcher', 'jester', 'carver', 'psychic', 'witch', 'silencer', 'outlaw', 'merchant'},
[3] = {'elementor', 'stormweaver', 'spellblade', 'psykeeper', 'engineer', 'juggernaut', 'pyromancer', 'host', 'assassin', 'bane', 'barrager', 'infestor', 'flagellant', 'illusionist', 'usurer', 'gambler'},
[4] = {'priest', 'highlander', 'psykino', 'fairy', 'blade', 'plague_doctor', 'cannoneer', 'vulcanist', 'warden', 'corruptor', 'thief'},
}
non_attacking_characters = {'cleric', 'stormweaver', 'squire', 'chronomancer', 'sage', 'psykeeper', 'bane', 'carver', 'fairy', 'priest', 'flagellant', 'merchant', 'treasure_hunter'}
non_cooldown_characters = {'squire', 'chronomancer', 'psykeeper', 'merchant', 'treasure_hunter'}
non_attacking_characters = {'cleric', 'stormweaver', 'squire', 'chronomancer', 'sage', 'psykeeper', 'bane', 'carver', 'fairy', 'priest', 'flagellant', 'merchant', 'miner'}
non_cooldown_characters = {'squire', 'chronomancer', 'psykeeper', 'merchant', 'miner'}
character_tiers = {
['vagrant'] = 1,
@ -983,7 +983,7 @@ function init()
['vulcanist'] = 4,
['warden'] = 4,
['psychic'] = 2,
['treasure_hunter'] = 1,
['miner'] = 1,
['merchant'] = 2,
['usurer'] = 3,
['gambler'] = 3,
@ -1366,6 +1366,72 @@ function init()
[25] = {'speed_booster', 'exploder', 'headbutter', 'tank', 'shooter', 'spawner'},
}
get_shop_odds_by_level = function(lvl)
if lvl == 1 then
return {70, 20, 10, 0}
elseif lvl == 2 then
return {50, 30, 15, 5}
elseif lvl == 3 then
return {30, 40, 20, 10}
elseif lvl == 4 then
return {20, 25, 35, 20}
end
end
get_shop_odds = function(lvl, tier)
if lvl == 1 then
if tier == 1 then
return 70
elseif tier == 2 then
return 20
elseif tier == 3 then
return 10
elseif tier == 4 then
return 0
end
elseif lvl == 2 then
if tier == 1 then
return 50
elseif tier == 2 then
return 30
elseif tier == 3 then
return 15
elseif tier == 4 then
return 5
end
elseif lvl == 3 then
if tier == 1 then
return 30
elseif tier == 2 then
return 40
elseif tier == 3 then
return 20
elseif tier == 4 then
return 10
end
elseif lvl == 4 then
if tier == 1 then
return 20
elseif tier == 2 then
return 25
elseif tier == 3 then
return 35
elseif tier == 4 then
return 20
end
elseif lvl == 5 then
if tier == 1 then
return 10
elseif tier == 2 then
return 20
elseif tier == 3 then
return 25
elseif tier == 4 then
return 40
end
end
end
local run = system.load_run()
run_passive_pool_by_tiers = run.run_passive_pool_by_tiers or {
[1] = { 'wall_echo', 'wall_rider', 'centipede', 'temporal_chains', 'amplify', 'amplify_x', 'ballista', 'ballista_x', 'blunt_arrow', 'berserking', 'unwavering_stance', 'assassination', 'unleash', 'blessing',
@ -1392,7 +1458,7 @@ function init()
-- main_song_instance = _G[random:table{'song1', 'song2', 'song3', 'song4', 'song5'}]:play{volume = 0.5}
main:add(BuyScreen'buy_screen')
main:go_to('buy_screen', run.level or 0, run.units or {}, passives)
main:go_to('buy_screen', run.level or 0, run.units or {}, passives, run.shop_level or 1, run.shop_xp or 0)
-- main:go_to('buy_screen', 7, run.units or {}, {'unleash'})
--[[

View File

@ -1696,7 +1696,7 @@ function Projectile:init(args)
elseif self.character == 'witch' and self.level == 3 then
self.chain = 1
elseif self.character == 'treasure_hunter' then
elseif self.character == 'miner' then
self.homing = true
if self.level == 3 then
self.pierce = 2
@ -1882,7 +1882,7 @@ function Projectile:on_collision_enter(other, contact)
elseif self.character == 'cannoneer' then
self:die(x, y, r, random:int(2, 3))
cannon_hit_wall1:play{pitch = random:float(0.95, 1.05), volume = 0.1}
elseif self.character == 'engineer' or self.character == 'dual_gunner' or self.character == 'treasure_hunter' then
elseif self.character == 'engineer' or self.character == 'dual_gunner' or self.character == 'miner' then
self:die(x, y, r, random:int(2, 3))
_G[random:table{'turret_hit_wall1', 'turret_hit_wall2'}]:play{pitch = random:float(0.9, 1.1), volume = 0.2}
else
@ -1931,7 +1931,7 @@ function Projectile:on_trigger_enter(other, contact)
end
if self.character == 'archer' or self.character == 'scout' or self.character == 'outlaw' or self.character == 'blade' or self.character == 'hunter' or self.character == 'spellblade' or self.character == 'engineer' or
self.character == 'jester' or self.character == 'assassin' or self.character == 'barrager' or self.character == 'beastmaster' or self.character == 'witch' or self.character == 'treasure_hunter' or self.character == 'thief' then
self.character == 'jester' or self.character == 'assassin' or self.character == 'barrager' or self.character == 'beastmaster' or self.character == 'witch' or self.character == 'miner' or self.character == 'thief' then
hit2:play{pitch = random:float(0.95, 1.05), volume = 0.35}
if self.character == 'spellblade' then
magic_area1:play{pitch = random:float(0.95, 1.05), volume = 0.15}
@ -2913,7 +2913,7 @@ function Gold:on_trigger_enter(other, contact)
local units = other:get_all_units()
local th
for _, unit in ipairs(units) do
if unit.character == 'treasure_hunter' then
if unit.character == 'miner' then
th = unit
end
end

View File

@ -506,7 +506,15 @@ global_text_tags = {
bgm2 = TextTag{draw = function(c, i, text) graphics.set_color(bg[-2]) end},
light_bg = TextTag{draw = function(c, i, text) graphics.set_color(bg[5]) end},
fg = TextTag{draw = function(c, i, text) graphics.set_color(fg[0]) end},
fgm1 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-1]) end},
fgm2 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-2]) end},
fgm3 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-3]) end},
fgm4 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-4]) end},
fgm5 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-5]) end},
fgm6 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-6]) end},
fgm7 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-7]) end},
fgm8 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-8]) end},
fgm9 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-9]) end},
fgm10 = TextTag{draw = function(c, i, text) graphics.set_color(fg[-10]) end},
greenm5 = TextTag{draw = function(c, i, text) graphics.set_color(green[-5]) end},
green5 = TextTag{draw = function(c, i, text) graphics.set_color(green[5]) end},

15
todo
View File

@ -1,16 +1,19 @@
Shop Update
New units
* Mercenaries (2/4) - +10/20% chance for enemies to drop gold on death
* Treasure Hunter (tier 1 mercenary) - picking up gold releases 4 homing projectiles that deal X damage, Lv.3 - release 8 homing projectiles instead and they pierce twice
* Miner (tier 1 mercenary) - picking up gold releases 4 homing projectiles that deal X damage, Lv.3 - release 8 homing projectiles instead and they pierce twice
* Merchant (tier 2 mercenary) - gain +1 interest for every 10 gold, Lv.3 - your first item reroll is always free
* Usurer (tier 3 curser, mercenary, voider) - curses 3 nearby enemies indefinitely with debt, dealing X damage over time, Lv.3 - if the same enemy is cursed 3 times it takes 50X damage
* Gambler (tier 3 mercenary, sorcerer) - deal 2X damage to a single random enemy where X is how much gold you have, Lv.3 effect - 60%/40%/20% chance to cast the attack 2/3/4 times
* Thief (tier 4 mercenary, rogue) - throws a knife that deals 2X damage and chains 5 times, Lv.3 - if the knife crits it deals 10X damage, chains 10 times and grants 1 gold
Shop changes
Owned units highlighted in shop
Fix highlight colors and highlight reserve
Shop level up
* Shop level up
* Shop level visual
* Shop level up button
* Level up logic
* Level probabilities
* Hook probabilities into reroll
Item changes
Sorcerer items
@ -29,6 +32,8 @@ Shop Update
* The cursor is now invisible during waves, unless mouse follow mode is enabled
Options menu from buy screen
Add visuals for tank attack
Owned units highlighted in shop
Fix highlight colors and highlight reserve
Balance
* Decreased level 25 boss movement speed
@ -110,6 +115,8 @@ Roguelite update:
Text + reward
Training grounds (upgrade unit)
Tavern (heal units)
Challenge + reward
Go through the labyrinth without hitting any walls
Units die permanently when they die (dead units can be stored in bench to be revived later)
Units can have items attached to them like in Underlords
Unit item ideas: