1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-05-13 21:56:29 +02:00

biter_battles > 0.17 things

This commit is contained in:
MewMew 2019-03-03 00:33:08 +01:00
parent 7f0bb9ae83
commit 7ef17ace0f
4 changed files with 28 additions and 43 deletions

View File

@ -6,7 +6,7 @@ local event = require 'utils.event'
local function create_admin_button(player) local function create_admin_button(player)
if player.gui.top["admin_button"] then return end if player.gui.top["admin_button"] then return end
local b = player.gui.top.add({type = "button", caption = "Admin", name = "admin_button", tooltip = "Use your powers wisely"}) local b = player.gui.top.add({type = "button", caption = "Admin", name = "admin_button", tooltip = "Use your powers wisely"})
--b.style.font_color = {r = 0.95, g = 0.11, b = 0.11} b.style.font_color = {r = 0.1, g = 0.1, b = 0.1}
b.style.font = "default-bold" b.style.font = "default-bold"
b.style.minimal_height = 38 b.style.minimal_height = 38
b.style.minimal_width = 54 b.style.minimal_width = 54

View File

@ -13,9 +13,9 @@ require "poll"
require "score" require "score"
---- enable modules here ---- ---- enable modules here ----
require "maps.tools.cheat_mode" --require "maps.tools.cheat_mode"
--require "maps.modules.hunger" --require "maps.modules.hunger"
require "maps.modules.area_unlocked_on_rotated_entity" --require "maps.modules.area_unlocked_on_rotated_entity"
--require "maps.modules.fish_respawner" --require "maps.modules.fish_respawner"
--require "maps.modules.rocket_launch_always_yields_science" --require "maps.modules.rocket_launch_always_yields_science"
--require "maps.modules.launch_fish_to_win" --require "maps.modules.launch_fish_to_win"
@ -33,7 +33,7 @@ require "maps.modules.area_unlocked_on_rotated_entity"
----------------------------- -----------------------------
---- enable maps here ---- ---- enable maps here ----
--require "maps.biter_battles" require "maps.biter_battles"
--require "maps.cave_miner" --require "maps.cave_miner"
--require "maps.labyrinth" --require "maps.labyrinth"
--require "maps.spooky_forest" --require "maps.spooky_forest"

View File

@ -12,7 +12,7 @@ local function build_group_gui(player)
if not player.gui.top["group_button"] then if not player.gui.top["group_button"] then
local b = player.gui.top.add({type = "button", name = "group_button", caption = global.player_group[player.name], tooltip = "Join / Create a group"}) local b = player.gui.top.add({type = "button", name = "group_button", caption = global.player_group[player.name], tooltip = "Join / Create a group"})
--b.style.font_color = {r = 0.77, g = 0.77, b = 0.77} b.style.font_color = {r = 0.1, g = 0.1, b = 0.1}
b.style.font = "default-bold" b.style.font = "default-bold"
b.style.minimal_height = 38 b.style.minimal_height = 38
b.style.minimal_width = 38 b.style.minimal_width = 38

View File

@ -26,10 +26,10 @@ local food_names = {
local food_values = { local food_values = {
["automation-science-pack"] = 0.00000100, ["automation-science-pack"] = 0.00000100,
["logistic-science-pack"] = 0.00000292, ["logistic-science-pack"] = 0.00000292,
["military-science-pack"] = 0.00001950, ["military-science-pack"] = 0.00001225,
["chemical-science-pack"] = 0.00003792, ["chemical-science-pack"] = 0.00002392,
["production-science-pack"] = 0.00008000, ["production-science-pack"] = 0.00008000,
["utility-science-pack"] = 0.00021000, ["utility-science-pack"] = 0.00013875,
["space-science-pack"] = 0.00042000 ["space-science-pack"] = 0.00042000
} }
@ -225,7 +225,7 @@ local function create_biter_battle_menu(player)
frame.add { type = "table", name = "biter_battle_table", column_count = 4 } frame.add { type = "table", name = "biter_battle_table", column_count = 4 }
local t = frame.biter_battle_table local t = frame.biter_battle_table
local foods = {"automation-science-pack","logistic-science-pack","military-science-pack","chemical-science-pack","production-science-pack","utility-science-pack","space-science-pack","raw-fish"} local foods = {"automation-science-pack","logistic-science-pack","military-science-pack","chemical-science-pack","production-science-pack","utility-science-pack","space-science-pack","raw-fish"}
local food_tooltips = {"1 Calorie","3 Calories", "20 Calories", "38 Calories", "80 Calories", "210 Calories", "420 Calories", "Send spy"} local food_tooltips = {"1 Calorie","3 Calories", "12 Calories", "24 Calories", "80 Calories", "138 Calories", "420 Calories", "Send spy"}
local x = 1 local x = 1
for _, f in pairs(foods) do for _, f in pairs(foods) do
local s = t.add { type = "sprite-button", name = f, sprite = "item/" .. f } local s = t.add { type = "sprite-button", name = f, sprite = "item/" .. f }
@ -240,11 +240,9 @@ local function create_biter_battle_menu(player)
local b = frame.add { type = "label", caption = "Feed the enemy team´s biters to gain advantage!" } local b = frame.add { type = "label", caption = "Feed the enemy team´s biters to gain advantage!" }
b.style.font = "default-bold" b.style.font = "default-bold"
b.style.font_color = { r=0.98, g=0.66, b=0.22} b.style.font_color = { r=0.98, g=0.66, b=0.22}
frame.add { type = "label", caption = "--------------------------------------------------"} frame.add { type = "label", caption = "-----------------------------------------------------------"}
end end
--frame.add { type = "label", caption = "--------------------------"}
local t = frame.add { type = "table", column_count = 3 } local t = frame.add { type = "table", column_count = 3 }
local l = t.add { type = "label", caption = "Team North"} local l = t.add { type = "label", caption = "Team North"}
l.style.font = "default-bold" l.style.font = "default-bold"
@ -306,11 +304,11 @@ local function create_biter_battle_menu(player)
local l = t.add { type = "label", caption = p.name } local l = t.add { type = "label", caption = p.name }
l.style.font_color = color l.style.font_color = color
end end
local b = frame.add { type = "button", name = "join_north_button", caption = c } local b = frame.add { type = "sprite-button", name = "join_north_button", caption = c }
b.style.font = "default-listbox" b.style.font = "default-large-bold"
b.style.font_color = font_color b.style.font_color = font_color
b.style.minimal_width = 320 b.style.minimal_width = 350
frame.add { type = "label", caption = "--------------------------------------------------"} frame.add { type = "label", caption = "-----------------------------------------------------------"}
else else
frame.add { type = "label", caption = "--------------------------"} frame.add { type = "label", caption = "--------------------------"}
end end
@ -376,48 +374,34 @@ local function create_biter_battle_menu(player)
local l = t.add { type = "label", caption = p.name } local l = t.add { type = "label", caption = p.name }
l.style.font_color = color l.style.font_color = color
end end
local b = frame.add { type = "button", name = "join_south_button", caption = c } local b = frame.add { type = "sprite-button", name = "join_south_button", caption = c }
b.style.font = "default-listbox" b.style.font = "default-large-bold"
b.style.font_color = font_color b.style.font_color = font_color
b.style.minimal_width = 320 b.style.minimal_width = 350
end end
if global.team_chosen[player.name] then if global.team_chosen[player.name] then
local t = frame.add { type = "table", column_count = 2 } local t = frame.add { type = "table", column_count = 2 }
if player.force.name == "spectator" then if player.force.name == "spectator" then
local b = t.add { type = "button", name = "biter_battle_leave_spectate", caption = "Leave spectating" } local b = t.add { type = "sprite-button", name = "biter_battle_leave_spectate", caption = "Join Team" }
b.style.font = "default-bold"
b.style.font_color = { r=0.98, g=0.66, b=0.22}
b.style.top_padding = 1
b.style.left_padding = 1
b.style.right_padding = 1
b.style.bottom_padding = 1
else else
local b = t.add { type = "button", name = "biter_battle_spectate", caption = "Spectate" } local b = t.add { type = "sprite-button", name = "biter_battle_spectate", caption = "Spectate" }
b.style.font = "default-bold"
b.style.font_color = { r=0.98, g=0.66, b=0.22}
b.style.top_padding = 1
b.style.left_padding = 1
b.style.right_padding = 1
b.style.bottom_padding = 1
end end
if global.biter_battle_view_players[player.name] == true then if global.biter_battle_view_players[player.name] == true then
local b = t.add { type = "button", name = "biter_battle_hide_players", caption = "Hide players" } local b = t.add { type = "sprite-button", name = "biter_battle_hide_players", caption = "Playerlist" }
b.style.font = "default-bold"
b.style.font_color = { r=0.98, g=0.66, b=0.22}
b.style.top_padding = 1
b.style.left_padding = 1
b.style.right_padding = 1
b.style.bottom_padding = 1
else else
local b = t.add { type = "button", name = "biter_battle_view_players", caption = "View players" } local b = t.add { type = "sprite-button", name = "biter_battle_view_players", caption = "Playerlist" }
end
for _, b in pairs(t.children) do
b.style.font = "default-bold" b.style.font = "default-bold"
b.style.font_color = { r=0.98, g=0.66, b=0.22} b.style.font_color = { r=0.98, g=0.66, b=0.22}
b.style.top_padding = 1 b.style.top_padding = 1
b.style.left_padding = 1 b.style.left_padding = 1
b.style.right_padding = 1 b.style.right_padding = 1
b.style.bottom_padding = 1 b.style.bottom_padding = 1
b.style.maximal_height = 30
b.style.minimal_width = 86
end end
end end
end end
@ -476,7 +460,7 @@ local function join_team(player, team)
permission_group.set_allows_action(defines.input_action.start_walking, true) permission_group.set_allows_action(defines.input_action.start_walking, true)
permission_group.set_allows_action(defines.input_action.open_kills_gui, true) permission_group.set_allows_action(defines.input_action.open_kills_gui, true)
permission_group.set_allows_action(defines.input_action.open_character_gui, true) permission_group.set_allows_action(defines.input_action.open_character_gui, true)
permission_group.set_allows_action(defines.input_action.open_equipment_gui, true) --permission_group.set_allows_action(defines.input_action.open_equipment_gui, true)
permission_group.set_allows_action(defines.input_action.edit_permission_group, true) permission_group.set_allows_action(defines.input_action.edit_permission_group, true)
permission_group.set_allows_action(defines.input_action.toggle_show_entity_info, true) permission_group.set_allows_action(defines.input_action.toggle_show_entity_info, true)
end end
@ -1136,6 +1120,7 @@ local function clear_corpses()
end end
local function send_near_biter_to_silo() local function send_near_biter_to_silo()
if not global.rocket_silo then return end
game.surfaces["surface"].set_multi_command({ game.surfaces["surface"].set_multi_command({
command={ command={
type=defines.command.attack, type=defines.command.attack,