Merge branch 'release/5.3.0' into dev

This commit is contained in:
Cooldude2606
2019-04-11 16:55:28 +01:00
9 changed files with 80 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ return {
'modules.commands.cheat-mode',
'modules.commands.interface',
'modules.commands.help',
'modules.commands.roles',
-- QoL Addons
'modules.addons.chat-popups',
'modules.addons.damage-popups',

View File

@@ -0,0 +1,7 @@
-- This controls how pollution is viewed on the map
return {
reference_point = {x=0,y=0}, -- where pollution is read from
max_scalar = 0.5, -- the scale between true max and max
min_scalar = 0.17, -- the scale between the lowest max and min
update_delay = 15 -- time in minutes between view updates
}

View File

@@ -58,6 +58,8 @@ Roles.new_role('Moderator','Mod')
:set_flag('is_spectator')
:set_parent('Trainee')
:allow{
'command/assign-role',
'command/unassign-role'
}
Roles.new_role('Trainee','TrMod')
@@ -141,7 +143,8 @@ Roles.new_role('Guest','')
'command/me',
'command/tag',
'command/tag-clear',
'command/chelp'
'command/chelp',
'command/list-roles'
}
--- Jail role

View File

@@ -7,4 +7,7 @@ chelp-title=Help results for "__1__":
chelp-footer=(__1__ results found; page __2__ of __3__)
chelp-format=/__1__ __2__ - __3__ __4__
chelp-alias=Alias: __1__
chelp-out-of-range=__1__ is an invalid page number.
chelp-out-of-range=__1__ is an invalid page number.
roles-higher-role=The role you tried to assign is higher than your highest.
roles-list=All active roles are:
roles-list-element=__1__, [color=__2__]__3__

View File

@@ -20,6 +20,8 @@ Global.register(
end
)
local Public = {}
--- This will re-create the speech bubble after it de-spawns called with set_timeout
local callback =
Token.register(
@@ -38,6 +40,9 @@ local callback =
--- This will move the messages onto the next message in the loop
local function circle_messages()
for name, ent in pairs(compilatrons) do
if not ent.valid then
Public.spawn_compilatron(game.players[1].surface,name)
end
local current_message = current_messages[name]
local msg_number
local message
@@ -58,8 +63,6 @@ end
Event.on_nth_tick(config.message_cycle, circle_messages)
local Public = {}
--- This will add a compilatron to the global and start his message cycle
-- @tparam entity LuaEntity the compilatron entity that moves around
-- @tparam name string the name of the location that the complitron is at

View File

@@ -0,0 +1,13 @@
local Event = require 'utils.event'
local config = require 'config.pollution_grading'
local delay = config.update_delay * 3600 -- convert from minutes to ticks
Event.on_nth_tick(delay,function()
local surface = game.surfaces[1]
local true_max = surface.get_pollution(config.reference_point)
local max = true_max*config.max_scalar
local min = max*config.min_scalar
local settings = game.map_settings.pollution
settings.expected_max_per_chunk = max
settings.min_to_show_per_chunk = min
end)

View File

@@ -2,7 +2,7 @@ local Event = require 'utils.event'
local Game = require 'utils.game'
local Global = require 'utils.global'
local print_grid_value, clear_flying_text = ext_require('expcore.common','print_grid_value','clear_flying_text')
local config = require 'config.worn_paths'
local config = require 'config.scorched_earth'
-- Loops over the config and finds the wile which has the highest value for strength
local max_strength = 0

View File

@@ -0,0 +1,45 @@
local Commands = require 'expcore.commands'
local Roles = require 'expcore.roles'
local Colours = require 'resources.color_presets'
Commands.new_command('assign-role','Assigns a role to a player')
:add_param('player',false,'player-role')
:add_param('role',false,'role')
:set_flag('admin-only',true)
:add_alias('rpromote','assign','role','add-role')
:register(function(player,action_player,role,raw)
local player_highest = Roles.get_player_highest(player)
if player_highest.index < role.index then
Roles.assign_player(action_player,role,player.name)
else
return Commands.error{'exp-commands.roles-higher-role'}
end
end)
Commands.new_command('unassign-role','Unassigns a role from a player')
:add_param('player',false,'player-role')
:add_param('role',false,'role')
:set_flag('admin-only',true)
:add_alias('rdemote','unassign','remove-role')
:register(function(player,action_player,role,raw)
local player_highest = Roles.get_player_highest(player)
if player_highest.index < role.index then
Roles.unassign_player(action_player,role,player.name)
else
return Commands.error{'exp-commands.roles-higher-role'}
end
end)
Commands.new_command('list-roles','Lists all roles in they correct order')
:add_alias('lroles','roles')
:register(function(player,raw)
local roles = Roles.config.order
local message = {'exp-commands.roles-list'}
for _,role_name in pairs(roles) do
local role = Roles.get_role_by_name(role_name)
local colour = role.custom_color or Colours.white
colour = string.format('%d,%d,%d',colour.r,colour.g,colour.b)
message = {'exp-commands.roles-list-element',message,colour,role_name}
end
return Commands.success(message)
end)