Skip to content

Commit

Permalink
feat: rebalance weapon
Browse files Browse the repository at this point in the history
  • Loading branch information
BigJk committed Sep 2, 2024
1 parent 7e7afb4 commit f2bd471
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions assets/scripts/equipment/permanents/basic_hand_weapons.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local hand_warning = "**Important:** If you already carry a artifact in your hand, you will have to drop it and related cards to pick up the new one."
local hand_warning =
"**Important:** If you already carry a artifact in your hand, you will have to drop it and related cards to pick up the new one."

HAND_WEAPONS = {
{
Expand Down Expand Up @@ -53,9 +54,11 @@ HAND_WEAPONS_ARTIFACT_IDS = fun.iter(HAND_WEAPONS):map(function(w) return w.id e
for _, weapon in pairs(HAND_WEAPONS) do
register_card(weapon.id, {
name = l("cards." .. weapon.id .. ".name", weapon.name),
description = l("cards." .. weapon.id .. ".description", string.format("Use to deal %s (+3 for each upgrade) damage.", weapon.base_damage)),
description = l("cards." .. weapon.id .. ".description",
string.format("Use to deal %s (+1 for each upgrade) damage.", weapon.base_damage)),
state = function(ctx)
return string.format(l("cards." .. weapon.id .. ".state", "Use to deal %s damage."), highlight(weapon.base_damage + ctx.level * 3))
return string.format(l("cards." .. weapon.id .. ".state", "Use to deal %s damage."),
highlight(weapon.base_damage + ctx.level * 1))
end,
tags = weapon.tags,
max_level = 3,
Expand Down Expand Up @@ -121,7 +124,8 @@ for _, weapon in pairs(HAND_WEAPONS) do
}
})

add_found_artifact_event(weapon.id, weapon.image, string.format("%s\n\n%s", weapon.description, hand_warning), registered.card[weapon.id].description, weapon.event_tags)
add_found_artifact_event(weapon.id, weapon.image, string.format("%s\n\n%s", weapon.description, hand_warning),
registered.card[weapon.id].description, weapon.event_tags)
end

---hand_weapon_event returns a random hand weapon event weighted by price.
Expand All @@ -130,4 +134,4 @@ function hand_weapon_event()
local ids = fun.iter(HAND_WEAPONS):map(function(w) return w.id end):totable()
local prices = fun.iter(HAND_WEAPONS):map(function(w) return 500 - w.price end):totable()
return choose_weighted(ids, prices)
end
end

0 comments on commit f2bd471

Please sign in to comment.