1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2026-06-20 16:32:28 +02:00

tweaks to mtn fortress

This commit is contained in:
Gerkiz
2020-12-09 19:59:49 +01:00
parent 174f36c984
commit 532acd7444
4 changed files with 56 additions and 52 deletions
+5 -1
View File
@@ -282,7 +282,7 @@ commands.add_command(
p_modifer[player.index].character_mining_speed_modifier['creative'] = 50 p_modifer[player.index].character_mining_speed_modifier['creative'] = 50
p_modifer[player.index].character_health_bonus['creative'] = 2000 p_modifer[player.index].character_health_bonus['creative'] = 2000
p_modifer[player.index].character_crafting_speed_modifier['creative'] = 50 p_modifer[player.index].character_crafting_speed_modifier['creative'] = 50
v.character_inventory_slots_bonus = p_modifer[k].character_inventory_slots_bonus['creative'] v.character_inventory_slots_bonus = p_modifer[player.index].character_inventory_slots_bonus['creative']
v.insert {name = _k, count = _v.stack_size} v.insert {name = _k, count = _v.stack_size}
v.print('[CREATIVE] Inserted all base items.', Color.success) v.print('[CREATIVE] Inserted all base items.', Color.success)
Modifiers.update_player_modifiers(player) Modifiers.update_player_modifiers(player)
@@ -394,6 +394,8 @@ local on_player_joined_game = function(event)
end end
function Public.insert_all_items(player) function Public.insert_all_items(player)
if this.creative_enabled then
if not this.players[player.index] then
if player.character ~= nil then if player.character ~= nil then
if player.get_inventory(defines.inventory.character_armor) then if player.get_inventory(defines.inventory.character_armor) then
player.get_inventory(defines.inventory.character_armor).clear() player.get_inventory(defines.inventory.character_armor).clear()
@@ -434,6 +436,8 @@ function Public.insert_all_items(player)
end end
end end
end end
end
end
function Public.get(key) function Public.get(key)
if key then if key then
+2 -2
View File
@@ -52,7 +52,7 @@ market.caspules = {
['defender-capsule'] = {value = 8, rarity = 1}, ['defender-capsule'] = {value = 8, rarity = 1},
['distractor-capsule'] = {value = 20, rarity = 5}, ['distractor-capsule'] = {value = 20, rarity = 5},
['destroyer-capsule'] = {value = 32, rarity = 7}, ['destroyer-capsule'] = {value = 32, rarity = 7},
['discharge-defense-remote'] = {value = 64, rarity = 6}, ['discharge-defense-remote'] = {value = 2000, rarity = 8},
['artillery-targeting-remote'] = {value = 32, rarity = 7}, ['artillery-targeting-remote'] = {value = 32, rarity = 7},
['raw-fish'] = {value = 6, rarity = 1} ['raw-fish'] = {value = 6, rarity = 1}
} }
@@ -73,7 +73,7 @@ market.equipment = {
['battery-equipment'] = {value = 160, rarity = 2}, ['battery-equipment'] = {value = 160, rarity = 2},
['battery-mk2-equipment'] = {value = 2000, rarity = 8}, ['battery-mk2-equipment'] = {value = 2000, rarity = 8},
['personal-laser-defense-equipment'] = {value = 2500, rarity = 7}, ['personal-laser-defense-equipment'] = {value = 2500, rarity = 7},
['discharge-defense-equipment'] = {value = 2000, rarity = 5}, ['discharge-defense-equipment'] = {value = 8000, rarity = 7},
['belt-immunity-equipment'] = {value = 200, rarity = 1}, ['belt-immunity-equipment'] = {value = 200, rarity = 1},
['exoskeleton-equipment'] = {value = 800, rarity = 3}, ['exoskeleton-equipment'] = {value = 800, rarity = 3},
['personal-roboport-equipment'] = {value = 500, rarity = 3}, ['personal-roboport-equipment'] = {value = 500, rarity = 3},
+3 -5
View File
@@ -166,19 +166,17 @@ local function get_owner_car_name(ic, player)
return false return false
end end
local function get_saved_entity(cars, entity, index) local function get_saved_entity(entity, index)
for k, car in pairs(cars) do
if index and index.name ~= entity.name then if index and index.name ~= entity.name then
local msg = local msg =
table.concat( table.concat(
{ {
'The built entity is not the same as the saved one. ', 'The built entity is not the same as the saved one. ',
'Saved entity is: ' .. upperCase(car.name) .. ' - Built entity is: ' .. upperCase(entity.name) .. '. ' 'Saved entity is: ' .. upperCase(index.name) .. ' - Built entity is: ' .. upperCase(entity.name) .. '. '
} }
) )
return false, msg return false, msg
end end
end
return true return true
end end
@@ -378,7 +376,7 @@ local function restore_surface(ic, player, entity)
end end
if saved_surfaces[player.index] then if saved_surfaces[player.index] then
local success, msg = get_saved_entity(cars, ce, index) local success, msg = get_saved_entity(ce, index)
if not success then if not success then
player.print(msg, Color.warning) player.print(msg, Color.warning)
return true return true
+2
View File
@@ -16,6 +16,8 @@ local blacklist = {
['artillery-wagon'] = true, ['artillery-wagon'] = true,
['artillery-turret'] = true, ['artillery-turret'] = true,
['landfill'] = true, ['landfill'] = true,
['discharge-defense-equipment'] = true,
['discharge-defense-remote'] = true,
['fluid-wagon'] = true, ['fluid-wagon'] = true,
['pistol'] = true ['pistol'] = true
} }