1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-03 13:12:11 +02:00
difficulty increase limited to 24 players
50% xp bonus per 1000 tile distance for mining
This commit is contained in:
MewMew 2020-04-28 20:25:18 +02:00
parent f9d6e2bfeb
commit a6a048639e
2 changed files with 16 additions and 7 deletions

View File

@ -45,6 +45,7 @@ local treasure_chest_messages = {
local function set_difficulty()
local wave_defense_table = WD.get_table()
local player_count = #game.connected_players
if player_count > 24 then player_count = 24 end
wave_defense_table.max_active_biters = 1024
@ -52,7 +53,9 @@ local function set_difficulty()
wave_defense_table.threat_gain_multiplier = 2 + player_count * 0.1
--1 additional map collapse tile / 8 players in game, with too high threat, the collapse speeds up.
global.map_collapse.speed = math.floor(player_count * 0.125) + 1 + math.floor(wave_defense_table.threat / 100000)
local speed = 1 + math.floor(player_count * 0.125) + math.floor(wave_defense_table.threat / 100000)
if speed > 10 then speed = 10 end
global.map_collapse.speed = speed
--20 Players for fastest wave_interval
wave_defense_table.wave_interval = 3600 - player_count * 90

View File

@ -16,6 +16,8 @@ Modified by Gerkiz *-*
require "player_modifiers"
local math_random = math.random
local math_sqrt = math.sqrt
local math_floor = math.floor
local Global = require 'utils.global'
local Tabs = require "comfy_panel.main"
local P = require "player_modifiers"
@ -793,12 +795,16 @@ local function on_pre_player_mined_item(event)
rpg_t[player.index].last_mined_entity_position.x = entity.position.x
rpg_t[player.index].last_mined_entity_position.y = entity.position.y
if entity.type == "resource" then gain_xp(player, 0.5) return end
--if entity.force.index == 3 then
gain_xp(player, 1.5 + event.entity.prototype.max_health * 0.0035)
--return
--end
--gain_xp(player, 0.1 + event.entity.prototype.max_health * 0.0005)
local distance_multiplier = math_floor(math_sqrt(entity.position.x ^ 2 + entity.position.y ^ 2)) * 0.0005 + 1
local xp_amount
if entity.type == "resource" then
xp_amount = 0.5 * distance_multiplier
else
xp_amount = (1.5 + event.entity.prototype.max_health * 0.0035) * distance_multiplier
end
gain_xp(player, xp_amount)
end
local function on_player_crafted_item(event)