Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/1x/Basic Series/AtlasStakesBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/1x/Basic Series/AtlasStickersBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/2x/Basic Series/AtlasStakesBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/2x/Basic Series/AtlasStickersBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion functions/energyfunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ energy_max = 3

-- we're gonna need this for the vanilla jokers later
-- Load list of energizable vanilla jokers
local energizable_vanilla = assert(SMODS.load_file("functions/energizable_vanilla.lua"))()
energizable_vanilla = assert(SMODS.load_file("functions/energizable_vanilla.lua"))()

-- this is a series of checks formerly strewn about the energy functions
-- namely, is ability.extra a table or a number or nil, is there an energizable value, etc.
Expand Down
6 changes: 6 additions & 0 deletions functions/pokefunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,12 @@ evo_item_in_pool = function(self)
end

type_tooltip = function(self, info_queue, center)
if (center.ability and center.ability.extra and type(center.ability.extra) == "table" and
center.ability.poke_weakened and (get_total_energy(center) == 0))
then
info_queue[#info_queue+1] = {set = 'Other', key = "energy",
vars = {get_total_energy(center), energy_max + (G.GAME.energy_plus or 0) + (center.ability.extra.e_limit_up or 0)}}
end
local percent
if (center.ability and center.ability.extra and type(center.ability.extra) == "table" and (get_total_energy(center) ~= 0)) then
info_queue[#info_queue+1] = {set = 'Other', key = "energy", vars = {get_total_energy(center), energy_max + (G.GAME.energy_plus or 0) + (center.ability.extra.e_limit_up or 0)}}
Expand Down
25 changes: 25 additions & 0 deletions localization/en-us.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6157,6 +6157,15 @@ return {
}
},
},
Stake={
stake_poke_lilac_stake = {
name = "Lilac Stake",
text = {"Shop can have {C:attention}Weakened{} Jokers",
"{C:inactive,s:0.8}(Base values are {C:attention,s:0.8}de-energized{}{C:inactive,s:0.8}){}",
"{s:0.8}Applies all previous Stakes"
},
},
},
Tag = {
tag_poke_pocket_tag = {
name = "Pocket Tag",
Expand Down Expand Up @@ -6329,6 +6338,14 @@ return {
"{X:bird,C:white}Bird{}",
}
},
poke_lilac_stake_sticker = {
name = "Lilac Sticker",
text = {
"Used this Joker",
"to win on {C:attention}Lilac",
"{C:attention}Stake{} difficulty"
},
},
--infoqueue used for things like kabuto and omanyte
ancient = {
name = "Ancient",
Expand Down Expand Up @@ -6942,6 +6959,13 @@ return {
"{C:dark_edition}#1#{}"
}
},
poke_weakened = {
name = "Weakened",
text = {
"Base values",
"are {C:attention}de-energized{}"
},
},
endless = {
name = "Reusable",
text = {
Expand Down Expand Up @@ -7480,6 +7504,7 @@ return {

k_poke_safari = "Safari",
k_poke_mega = "Mega",
poke_weakened = "Weakened",
},
quips = {
poke_lose_quip1 = {"Maybe Pokémon contests", "are more your speed...",},
Expand Down
61 changes: 60 additions & 1 deletion pokermon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,12 @@ load_directory("boosters", SMODS.Booster, true)
--Load seals
load_directory("seals", SMODS.Seal, true)

--Load stakes
load_directory("stakes", SMODS.Stake, true)

--Load stickers
load_directory("stickers", function (item)
item.hide_badge = true
if not item.name == "weakened" then item.hide_badge = true end
SMODS.Sticker(item)
end, true)

Expand Down Expand Up @@ -248,12 +251,68 @@ function Card:set_ability(center, initial, delay_sprites)
return ret
end

-- copy of `is_energizable` but for centers instead
local is_center_energizable = function(center)
if energizable_vanilla[center.name] then
return true
end
-- Regular case
if type(center.config.extra) == "table" then
for name, _ in pairs(energy_values) do
if type(center.config.extra[name]) == "number" then
return true
end
end
elseif type(center.config.extra) == "number" then
return true
-- More generic check for energizable values that aren't in ability.extra
else
for k, _ in pairs(energy_values) do
if center.config[energy_values[k]] and center.config[energy_values[k]] > 0 then return true end
end
end
return false
end

-- workaround for `get_family_keys` taking a card instead of a center
local get_family_key_set = function(center)
local family = poke_get_family_list(center.name)
local keys = {}
if #family > 1 then
local prefix = center.poke_custom_prefix or 'poke' -- if it's in a family, we know it's one of these
for _, v in ipairs(family) do
local name = type(v) == 'table' and v.key or v
local key = 'j_' .. prefix .. '_' .. name
if G.P_CENTERS[key] then
keys[key] = true
end
end
else
keys[center.key] = true
end
return keys
end


function SMODS.current_mod.reset_game_globals(run_start)
if run_start then
if G.GAME.modifiers.no_energy then
G.GAME.energy_rate = 0
end
for _, center in pairs(G.P_CENTERS) do
-- distribute `poke_weakened_compat` to jokers
if G.GAME.modifiers.enable_poke_weakened and center.set == 'Joker'
and center.poke_weakened_compat == nil then -- allow manual overrides
local family_key_set = get_family_key_set(center)
for k, _ in pairs(family_key_set) do
local rel_center = G.P_CENTERS[k]
if rel_center and is_center_energizable(rel_center) then
center.poke_weakened_compat = true
break
end
end
end
end
end

local rank_resets = {'bulb1card', 'sneaselcard', 'bramblincard', 'wingullcard'}
Expand Down
7 changes: 7 additions & 0 deletions pokesprites.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ SMODS.Atlas({
py = 95,
})

SMODS.Atlas({
key = "AtlasStakesBasic",
path = "Basic Series/AtlasStakesBasic.png",
px = 29,
py = 29
})

SMODS.Atlas({
key = "AtlasStickersBasic",
path = "Basic Series/AtlasStickersBasic.png",
Expand Down
23 changes: 23 additions & 0 deletions stakes/lilac_stake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local lilac = {
key = 'lilac_stake',
applied_stakes = {'gold'},
above_stake = 'gold',
prefix_config = {above_stake = {mod = false}, applied_stakes = {mod = false}},

modifiers = function()
G.GAME.modifiers.enable_poke_weakened = true
end,

colour = HEX('E8CCE8'),

pos = {x = 0, y = 0},
sticker_pos = {x = 8, y = 1},
atlas = 'AtlasStakesBasic',
sticker_atlas = 'AtlasStickersBasic'
}



return {name = "Stakes",
list = {lilac}
}
2 changes: 1 addition & 1 deletion stickers/stickers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local type_sticker_template =
prefix_config = {key = false},
rate = 0.0,
atlas = "AtlasStickersBasic",
no_collection = true
no_collection = true,
}

local type_stickers = {}
Expand Down
28 changes: 28 additions & 0 deletions stickers/weakened_sticker.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

local weakened = {
key = 'weakened',
badge_colour = HEX('c497c4'),
order = 5,
pos = {x = 7, y = 1},
atlas = 'AtlasStickersBasic',
rate = 0.3,
needs_enable_flag = true,
default_compat = false,
apply = function(self, card, val)
card.ability[self.key] = val
if card.ability.extra then
if type(card.ability.extra) == "table" then
increment_energy(card, get_type(card), -1, true)
card.ability.extra.e_limit_up = card.ability.extra.e_limit_up and (card.ability.extra.e_limit_up - 1) or -1
end
end
end,
should_apply = function(self, card, center, area, bypass_roll)
return (area == G.shop_jokers or area == G.pack_cards)
and SMODS.Sticker.should_apply(self, card, center, area, bypass_roll)
end,
}

return {name = "Stickers",
list = {weakened}
}