mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Make commands display in game chat (#297)
* Update friendly-fire.lua * Update research.lua * Update friendly-fire.lua * Update speed.lua * Update cheat-mode.lua * Update bot-queue.lua * Update train.lua * Update pollution.lua * Update commands.cfg * Update commands.cfg * Update commands.cfg * Update cheat-mode.lua * Update research.lua * Update commands.cfg * Update commands.cfg * Update commands.cfg
This commit is contained in:
@@ -20,5 +20,6 @@ Commands.new_command('bot-queue-set', 'Set bot queue')
|
||||
:register(function(player, amount)
|
||||
player.force.max_successful_attempts_per_tick_per_construction_queue = 3 * amount
|
||||
player.force.max_failed_attempts_per_tick_per_construction_queue = 1 * amount
|
||||
return Commands.success{'expcom-bot-queue.result', 3 * amount, 1 * amount}
|
||||
game.print{'expcom-bot-queue.result', player.name, 3 * amount, 1 * amount}
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
@@ -26,8 +26,9 @@ Commands.new_command('research-all', 'Set all research for your force.')
|
||||
:set_defaults{force=function(player)
|
||||
return player.force
|
||||
end}
|
||||
:register(function(_, force)
|
||||
:register(function(player, force)
|
||||
force.research_all_technologies()
|
||||
game.print{'expcom-cheat.res', player.name}
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
@@ -37,7 +38,8 @@ Commands.new_command('toggle-always-day', 'Toggles always day in surface')
|
||||
:set_defaults{surface=function(player)
|
||||
return player.surface
|
||||
end}
|
||||
:register(function(_, surface)
|
||||
:register(function(player, surface)
|
||||
surface.always_day = not surface.always_day
|
||||
return Commands.success{'expcom-cheat.day', surface.always_day}
|
||||
game.print{'expcom-cheat.day', player.name, surface.always_day}
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
@@ -12,7 +12,8 @@ Commands.new_command('toggle-friendly-fire', 'Toggle Friendly Fire')
|
||||
:set_defaults{force=function(player)
|
||||
return player.force
|
||||
end}
|
||||
:register(function(_, force)
|
||||
:register(function(player, force)
|
||||
force.friendly_fire = not force.friendly_fire
|
||||
return Commands.success{'expcom-ff.ff', force.friendly_fire}
|
||||
game.print{'expcom-ff.ff', player.name, force.friendly_fire}
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
@@ -15,7 +15,8 @@ Commands.new_command('pollution-clear', 'Clear pollution')
|
||||
end}
|
||||
:register(function(player, surface)
|
||||
surface.clear_pollution()
|
||||
return Commands.success{'expcom-pol.clr', player.name}
|
||||
game.print{'expcom-pol.clr', player.name}
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
Commands.new_command('pollution-off', 'Disable pollution')
|
||||
@@ -28,5 +29,6 @@ Commands.new_command('pollution-off', 'Disable pollution')
|
||||
v.clear_pollution()
|
||||
end
|
||||
|
||||
return Commands.success{'expcom-pol.off', player.name}
|
||||
game.print{'expcom-pol.off', player.name}
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
@@ -103,5 +103,6 @@ Commands.new_command('auto-research', 'Automatically queue up research')
|
||||
res_queue(player.force)
|
||||
end
|
||||
|
||||
return game.print{'expcom-res.res', research.res_queue_enable}
|
||||
game.print{'expcom-res.res', player.name, research.res_queue_enable}
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
@@ -9,7 +9,8 @@ require 'config.expcore.command_general_parse'
|
||||
Commands.new_command('game-speed', 'Set game speed')
|
||||
:add_param('amount', 'number-range', 0.2, 1)
|
||||
:set_flag('admin_only')
|
||||
:register(function(_, amount)
|
||||
:register(function(player, amount)
|
||||
game.speed = math.round(amount, 3)
|
||||
return Commands.success{'expcom-speed.result', string.format('%.3f', amount)}
|
||||
game.print{'expcom-speed.result', player.name, string.format('%.3f', amount)}
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
@@ -18,5 +18,6 @@ Commands.new_command('set-trains-to-automatic', 'Set All Trains to Automatic')
|
||||
end
|
||||
end
|
||||
|
||||
return Commands.success{'expcom-train.manual-result', format_number(count)}
|
||||
game.print{'expcom-train.manual-result', player.name, format_number(count)}
|
||||
return Commands.success
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user