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

Post feeding messages to discord

This commit is contained in:
Aleksander Mistewicz 2020-02-01 21:48:30 +01:00
parent 01664d3b7f
commit 521cde4a6b

View File

@ -1,4 +1,5 @@
local bb_config = require "maps.biter_battles_v2.config"
local Server = require 'utils.server'
local tables = require "maps.biter_battles_v2.tables"
local food_values = tables.food_values
@ -56,7 +57,9 @@ local function print_feeding_msg(player, food, flask_amount)
local formatted_amount = table.concat({"[font=heading-1][color=255,255,255]" .. flask_amount .. "[/color][/font]"})
if flask_amount >= 20 then
game.print(colored_player_name .. " fed " .. formatted_amount .. " flasks of " .. formatted_food .. " to team " .. team_strings[get_enemy_team_of(player.force.name)] .. " biters!", {r = 0.9, g = 0.9, b = 0.9})
local msg = table.concat({colored_player_name, " fed ", formatted_amount, " flasks of ", formatted_food, " to team ", team_strings[get_enemy_team_of(player.force.name)], " biters!"})
game.print(msg, {r = 0.9, g = 0.9, b = 0.9})
Server.to_discord_bold(msg)
else
local target_team_text = "the enemy"
if global.training_mode then
@ -181,4 +184,4 @@ local function feed_biters(player, food)
add_stats(player, food, flask_amount ,biter_force_name, evolution_before_feed, threat_before_feed)
end
return feed_biters
return feed_biters