From 514d102c3e5de6729b16809129aac0b1f4a04bac Mon Sep 17 00:00:00 2001 From: MewMew Date: Tue, 15 Oct 2019 05:56:30 +0200 Subject: [PATCH] added missing arguments --- functions/basic_markets.lua | 2 +- maps/mountain_fortress_v2/main.lua | 4 ++-- modules/biters_yield_coins.lua | 3 ++- modules/custom_death_messages.lua | 2 +- modules/rocks_yield_ore.lua | 2 +- modules/rocks_yield_ore_veins.lua | 2 +- modules/rpg.lua | 12 ++++++------ 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/functions/basic_markets.lua b/functions/basic_markets.lua index 0e39bfb5..ae45f3ec 100644 --- a/functions/basic_markets.lua +++ b/functions/basic_markets.lua @@ -158,7 +158,7 @@ local function get_resource_market_sells() {price = {{"coin", math.random(5,10)}}, offer = {type = 'give-item', item = 'stone', count = 50}}, {price = {{"coin", math.random(5,10)}}, offer = {type = 'give-item', item = 'coal', count = 50}}, {price = {{"coin", math.random(8,16)}}, offer = {type = 'give-item', item = 'uranium-ore', count = 50}}, - {price = {{"coin", math.random(2,3)}}, offer = {type = 'give-item', item = 'crude-oil-barrel', count = 1}}, + {price = {{"coin", math.random(2,4)}}, offer = {type = 'give-item', item = 'crude-oil-barrel', count = 1}}, } table.shuffle_table(sells) return sells diff --git a/maps/mountain_fortress_v2/main.lua b/maps/mountain_fortress_v2/main.lua index 60499319..1955f2fe 100644 --- a/maps/mountain_fortress_v2/main.lua +++ b/maps/mountain_fortress_v2/main.lua @@ -100,7 +100,7 @@ local function protect_train(event) event.entity.health = event.entity.health + event.final_damage_amount end end - +--[[ local function neutral_force_player_damage_resistance(event) if event.entity.force.index ~= 3 then return end -- Neutral Force if event.cause then @@ -116,7 +116,7 @@ local function neutral_force_player_damage_resistance(event) end event.entity.health = event.entity.health + (event.final_damage_amount * 0.5) end - +]] local function biters_chew_rocks_faster(event) if event.entity.force.index ~= 3 then return end --Neutral Force if not event.cause then return end diff --git a/modules/biters_yield_coins.lua b/modules/biters_yield_coins.lua index cfd11496..7372a027 100644 --- a/modules/biters_yield_coins.lua +++ b/modules/biters_yield_coins.lua @@ -16,7 +16,8 @@ local coin_yield = { ["biter-spawner"] = 32, ["small-worm-turret"] = 8, ["medium-worm-turret"] = 16, - ["big-worm-turret"] = 24 + ["big-worm-turret"] = 24, + ["behemoth-worm-turret"] = 32, } local entities_that_earn_coins = { diff --git a/modules/custom_death_messages.lua b/modules/custom_death_messages.lua index aae30240..93aa61f0 100644 --- a/modules/custom_death_messages.lua +++ b/modules/custom_death_messages.lua @@ -33,7 +33,7 @@ local function on_player_died(event) if event.cause then local cause = event.cause if not cause.name then - game.print(player.name .. tag .. " was killed." .. str, message_color) + game.print(player.name .. tag .. " was killed.", message_color) return end if messages[cause.name] then diff --git a/modules/rocks_yield_ore.lua b/modules/rocks_yield_ore.lua index 9beebefb..4f2f9f0e 100644 --- a/modules/rocks_yield_ore.lua +++ b/modules/rocks_yield_ore.lua @@ -134,7 +134,7 @@ local function on_entity_died(event) local surface = entity.surface local ore = ore_raffle[math_random(1, #ore_raffle)] local pos = {entity.position.x, entity.position.y} - create_particles(surface, particles[ore], pos, 16) + create_particles(surface, particles[ore], pos, 16, false) if event.cause then if event.cause.valid then diff --git a/modules/rocks_yield_ore_veins.lua b/modules/rocks_yield_ore_veins.lua index 52e0de4f..ea649ee0 100644 --- a/modules/rocks_yield_ore_veins.lua +++ b/modules/rocks_yield_ore_veins.lua @@ -54,7 +54,7 @@ local function on_player_mined_entity(event) local ore_entities_placed = 0 local modifier_raffle = {{0,-1},{-1,0},{1,0},{0,1}} while ore_entities_placed < math_random(size[2],size[3]) do - local a = math.ceil((math_random(tile_distance_to_center*4, tile_distance_to_center*5)) / 1 + ore_entities_placed * 0.5, 0) + local a = math.floor((math_random(tile_distance_to_center*4, tile_distance_to_center*5)) / 1 + ore_entities_placed * 0.5) + 1 for x = 1, 150, 1 do local m = modifier_raffle[math_random(1,#modifier_raffle)] local pos = {x = p.x + m[1], y = p.y + m[2]} diff --git a/modules/rpg.lua b/modules/rpg.lua index 8f85abc3..97310a2a 100644 --- a/modules/rpg.lua +++ b/modules/rpg.lua @@ -405,7 +405,7 @@ local function gain_xp(player, amount) amount = math.round(amount, 2) global.rpg[player.index].xp = global.rpg[player.index].xp + amount global.rpg[player.index].xp_since_last_floaty_text = global.rpg[player.index].xp_since_last_floaty_text + amount - if player.gui.left.rpg then draw_gui(player) end + if player.gui.left.rpg then draw_gui(player, false) end if not experience_levels[global.rpg[player.index].level + 1] then return end if global.rpg[player.index].xp >= experience_levels[global.rpg[player.index].level + 1] then level_up(player) @@ -457,7 +457,7 @@ local function on_gui_click(event) player.gui.left.rpg.destroy() return end - draw_gui(player) + draw_gui(player, false) end end @@ -471,20 +471,20 @@ local function on_gui_click(event) if event.button == defines.mouse_button_type.right then for a = 1, 5, 1 do - if global.rpg[player.index].points_to_distribute <= 0 then draw_gui(player) return end + if global.rpg[player.index].points_to_distribute <= 0 then draw_gui(player, false) return end global.rpg[player.index].points_to_distribute = global.rpg[player.index].points_to_distribute - 1 global.rpg[player.index][index] = global.rpg[player.index][index] + 1 update_player_stats(player) end - draw_gui(player) + draw_gui(player, false) return end - if global.rpg[player.index].points_to_distribute <= 0 then draw_gui(player) return end + if global.rpg[player.index].points_to_distribute <= 0 then draw_gui(player, false) return end global.rpg[player.index].points_to_distribute = global.rpg[player.index].points_to_distribute - 1 global.rpg[player.index][index] = global.rpg[player.index][index] + 1 update_player_stats(player) - draw_gui(player) + draw_gui(player, false) end local xp_yield = {