1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-08 00:39:30 +02:00

rpg spells - modify xp gain and disable blacklisted items

This commit is contained in:
Gerkiz 2021-01-11 15:59:07 +01:00
parent bea9e619fa
commit eac1f62fe4
2 changed files with 8 additions and 4 deletions

View File

@ -754,16 +754,19 @@ local function on_player_crafted_item(event)
local rpg_extra = RPG.get('rpg_extra')
local is_blacklisted = rpg_extra.tweaked_crafting_items
local tweaked_crafting_items_enabled = rpg_extra.tweaked_crafting_items_enabled
local item = event.item_stack
local amount = 0.30 * math.random(1, 2)
if tweaked_crafting_items_enabled then
if item and item.valid then
if is_blacklisted[item.name] then
amount = 0.2
end
end
end
Functions.gain_xp(player, event.recipe.energy * amount)
Functions.reward_mana(player, amount)
@ -1061,7 +1064,7 @@ local function on_player_used_capsule(event)
rpg_t[player.index].last_spawned = game.tick + object.tick
Functions.update_mana(player)
local reward_xp = object.mana_cost * 0.009
local reward_xp = object.mana_cost * 0.045
if reward_xp < 1 then
reward_xp = 1
end

View File

@ -106,6 +106,7 @@ function Public.reset_table()
['iron-gear-wheel'] = true,
['pipe'] = true
}
this.tweaked_crafting_items_enabled = false
this.rpg_t = {}
this.rpg_extra.rpg_xp_yield = {
['behemoth-biter'] = 16,