Skip to content

Commit c676735

Browse files
committed
Revised behavior of secret room bonus items, now more likely to include up to 1 kind of ammo, maximum 2 kinds as opposed to just health/armor.
1 parent ceb5ecc commit c676735

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

scripts/item.lua

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,13 +1002,31 @@ function Item_pickups_for_class(LEVEL, CL)
10021002
if not stats.health then
10031003
stats.health = 1
10041004
end
1005+
1006+
local pick1
1007+
local pick2
1008+
if R.zone.weap_palette
1009+
and not table.empty(R.zone.weap_palette)
1010+
and OB_CONFIG.secrets_bonus ~= nil then
1011+
pick1 = rand.key_by_probs(R.zone.weap_palette)
1012+
if rand.odds(33 + LEVEL.id) then
1013+
pick2 = rand.key_by_probs(R.zone.weap_palette)
1014+
end
1015+
end
1016+
1017+
if pick1 and not stats[GAME.WEAPONS[pick1].ammo] then
1018+
stats[GAME.WEAPONS[pick1].ammo] = 1
1019+
end
1020+
if pick2 and not stats[GAME.WEAPONS[pick2].ammo] then
1021+
stats[GAME.WEAPONS[pick2].ammo] = 1
1022+
end
10051023
end
10061024

10071025
for stat,qty in pairs(stats) do
10081026

10091027
-- this secret room is a treasure trove, baby!
10101028
if R.is_secret and OB_CONFIG.secrets_bonus ~= nil then
1011-
qty = R.svolume * SECRET_BONUS_FACTORS[OB_CONFIG.secrets_bonus]
1029+
qty = qty + (R.svolume/2) * SECRET_BONUS_FACTORS[OB_CONFIG.secrets_bonus]
10121030
end
10131031

10141032
select_pickups(R, item_list, stat, qty)

0 commit comments

Comments
 (0)