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

minor tweaks to files

This commit is contained in:
Gerkiz
2020-10-21 23:17:17 +02:00
parent ed7a4b6c90
commit 92fbf5efd8
12 changed files with 197 additions and 167 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ mana_max=This is your max mana. You can increase the regen by increasing your ma
mining_name=MINING\nSPEED
slot_name=SLOT\nBONUS
melee_name=MELEE\nDAMAGE
one_punch_chance=Life on-hit: _1_\nOne punch chance: _2_ %
one_punch_chance=Life on-hit: __1__\nOne punch chance: __2__ %
one_punch_disabled=One Punch is disabled.
bonus_tooltip=Reach distance bonus: __1__\nBuild distance bonus: __2__\nItem drop distance bonus: __3__\nLoot pickup distance bonus: __4__\nItem pickup distance bonus: __5__\nResource reach distance bonus: __6__\nRepair speed: __7__
reach_distance=REACH\nDISTANCE
+1 -1
View File
@@ -56,7 +56,7 @@ mana_max=This is your max mana. You can increase the regen by increasing your ma
mining_name=MINING\nSPEED
slot_name=SLOT\nBONUS
melee_name=MELEE\nDAMAGE
one_punch_chance=Life on-hit: _1_\nOne punch chance: _2_ %
one_punch_chance=Life on-hit: __1__\nOne punch chance: __2__ %
one_punch_disabled=One Punch is disabled.
bonus_tooltip=Reach distance bonus: __1__\nBuild distance bonus: __2__\nItem drop distance bonus: __3__\nLoot pickup distance bonus: __4__\nItem pickup distance bonus: __5__\nResource reach distance bonus: __6__\nRepair speed: __7__
reach_distance=REACH\nDISTANCE
+1 -1
View File
@@ -56,7 +56,7 @@ mana_max=This is your max mana. You can increase the regen by increasing your ma
mining_name=MINING\nSPEED
slot_name=SLOT\nBONUS
melee_name=MELEE\nDAMAGE
one_punch_chance=Life on-hit: _1_\nOne punch chance: _2_ %
one_punch_chance=Life on-hit: __1__\nOne punch chance: __2__ %
one_punch_disabled=One Punch is disabled.
bonus_tooltip=Reach distance bonus: __1__\nBuild distance bonus: __2__\nItem drop distance bonus: __3__\nLoot pickup distance bonus: __4__\nItem pickup distance bonus: __5__\nResource reach distance bonus: __6__\nRepair speed: __7__
reach_distance=REACH\nDISTANCE
+98 -126
View File
@@ -175,16 +175,12 @@ local function do_place_treasure(data)
return
end
pcall(
function()
for _, e in ipairs(data.treasure) do
if random(1, 6) == 1 then
e.chest = 'iron-chest'
end
Loot.add(surface, e.position, e.chest)
end
for _, e in ipairs(data.treasure) do
if random(1, 6) == 1 then
e.chest = 'iron-chest'
end
)
Loot.add(surface, e.position, e.chest)
end
end
local function do_place_markets(data)
@@ -195,158 +191,134 @@ local function do_place_markets(data)
return
end
pcall(
function()
local pos = markets[random(1, #markets)]
if
surface.count_entities_filtered {
area = {{pos.x - 96, pos.y - 96}, {pos.x + 96, pos.y + 96}},
name = 'market',
limit = 1
} == 0
then
local market = Market.mountain_market(surface, pos, abs(pos.y) * 0.004)
market.destructible = false
end
end
)
local pos = markets[random(1, #markets)]
if
surface.count_entities_filtered {
area = {{pos.x - 96, pos.y - 96}, {pos.x + 96, pos.y + 96}},
name = 'market',
limit = 1
} == 0
then
local market = Market.mountain_market(surface, pos, abs(pos.y) * 0.004)
market.destructible = false
end
end
local function do_place_tiles(data)
local surface = data.surface
pcall(
function()
surface.set_tiles(data.tiles, true)
end
)
surface.set_tiles(data.tiles, true)
end
local function do_place_hidden_tiles(data)
local surface = data.surface
pcall(
function()
surface.set_tiles(data.hidden_tiles, true)
end
)
surface.set_tiles(data.hidden_tiles, true)
end
local function do_place_decoratives(data)
local surface = data.surface
pcall(
function()
if regen_decoratives then
surface.regenerate_decorative(nil, {{data.top_x / 32, data.top_y / 32}})
end
if regen_decoratives then
surface.regenerate_decorative(nil, {{data.top_x / 32, data.top_y / 32}})
end
local dec = data.decoratives
if #dec > 0 then
surface.create_decoratives({check_collision = true, decoratives = dec})
end
end
)
local dec = data.decoratives
if #dec > 0 then
surface.create_decoratives({check_collision = true, decoratives = dec})
end
end
local function do_place_buildings(data)
local surface = data.surface
local entity
local callback
pcall(
function()
for _, e in ipairs(data.buildings) do
if e.e_type then
local p = e.position
if
surface.count_entities_filtered {
area = {{p.x - 32, p.y - 32}, {p.x + 32, p.y + 32}},
type = e.e_type,
limit = 1
} == 0
then
entity = surface.create_entity(e)
if entity and e.direction then
entity.direction = e.direction
end
if entity and e.force then
entity.force = e.force
end
if entity and e.callback then
local c = e.callback.callback
if not c then
return
end
local d = {callback_data = e.callback.data}
if not d then
callback = Token.get(c)
callback(entity)
return
end
callback = Token.get(c)
callback(entity, d)
end
for _, e in ipairs(data.buildings) do
if e.e_type then
local p = e.position
if
surface.count_entities_filtered {
area = {{p.x - 32, p.y - 32}, {p.x + 32, p.y + 32}},
type = e.e_type,
limit = 1
} == 0
then
entity = surface.create_entity(e)
if entity and e.direction then
entity.direction = e.direction
end
if entity and e.force then
entity.force = e.force
end
if entity and e.callback then
local c = e.callback.callback
if not c then
return
end
local d = {callback_data = e.callback.data}
if not d then
callback = Token.get(c)
callback(entity)
return
end
callback = Token.get(c)
callback(entity, d)
end
end
end
)
end
end
local function do_place_entities(data)
local surface = data.surface
local entity
local callback
pcall(
function()
for _, e in ipairs(data.entities) do
if e.collision then
if surface.can_place_entity(e) then
entity = surface.create_entity(e)
if entity and e.direction then
entity.direction = e.direction
end
if entity and e.force then
entity.force = e.force
end
if entity and e.callback then
local c = e.callback.callback
if not c then
return
end
local d = {callback_data = e.callback.data}
if not d then
callback = Token.get(c)
callback(entity)
return
end
callback = Token.get(c)
callback(entity, d)
end
for _, e in ipairs(data.entities) do
if e.collision then
if surface.can_place_entity(e) then
entity = surface.create_entity(e)
if entity and e.direction then
entity.direction = e.direction
end
if entity and e.force then
entity.force = e.force
end
if entity and e.callback then
local c = e.callback.callback
if not c then
return
end
else
entity = surface.create_entity(e)
if entity and e.direction then
entity.direction = e.direction
end
if entity and e.force then
entity.force = e.force
end
if entity and e.callback then
local c = e.callback.callback
if not c then
return
end
local d = {callback_data = e.callback.data}
if not d then
callback = Token.get(c)
callback(entity)
return
end
local d = {callback_data = e.callback.data}
if not d then
callback = Token.get(c)
callback(entity, d)
callback(entity)
return
end
callback = Token.get(c)
callback(entity, d)
end
end
else
entity = surface.create_entity(e)
if entity and e.direction then
entity.direction = e.direction
end
if entity and e.force then
entity.force = e.force
end
if entity and e.callback then
local c = e.callback.callback
if not c then
return
end
local d = {callback_data = e.callback.data}
if not d then
callback = Token.get(c)
callback(entity)
return
end
callback = Token.get(c)
callback(entity, d)
end
end
)
end
end
local function run_chart_update(data)
+3 -1
View File
@@ -659,7 +659,9 @@ function Public.validate_owner(ic, player, entity)
if p then
if car.owner ~= player.index and player.driving then
player.driving = false
return Utils.print_to(nil, '{Car} ' .. player.name .. ' tried to drive ' .. p.name .. '´s car.')
if not player.admin then
return Utils.print_to(nil, '{Car} ' .. player.name .. ' tried to drive ' .. p.name .. '´s car.')
end
end
end
end
+41 -13
View File
@@ -127,6 +127,10 @@ local set_loco_tiles =
function(data)
local position = data.position
local surface = data.surface
if not surface or not surface.valid then
return
end
local cargo_boxes = initial_cargo_boxes()
local p = {}
@@ -935,10 +939,10 @@ local function gui_click(event)
player.name .. ' has rerolled the market items for ' .. format_number(item.price, true) .. ' coins.'
}
)
this.reroll_amounts = this.reroll_amounts + item.stack
local breached_wall = WPT.get('breached_wall')
add_random_loot_to_main_market(breached_wall + random(1, 3))
Public.get_items(true)
redraw_market_items(data.item_frame, player, data.search_text)
redraw_coins_left(data.coins_left, player)
@@ -1897,27 +1901,51 @@ function Public.locomotive_spawn(surface, position)
game.forces.player.set_spawn_position({0, 19}, locomotive.surface)
end
function Public.get_items()
function Public.get_items(reroll)
local chest_limit_outside_upgrades = WPT.get('chest_limit_outside_upgrades')
local health_upgrades = WPT.get('health_upgrades')
local pickaxe_tier = WPT.get('pickaxe_tier')
local aura_upgrades = WPT.get('aura_upgrades')
local reroll_amounts = WPT.get('reroll_amounts')
local main_market_items = WPT.get('main_market_items')
local xp_points_upgrade = WPT.get('xp_points_upgrade')
local flame_turret = WPT.get('upgrades').flame_turret.bought
local landmine = WPT.get('upgrades').landmine.bought
local fixed_prices = WPT.get('marked_fixed_prices')
local chest_limit_cost = 3000 * (1 + chest_limit_outside_upgrades)
local health_cost = 10000 * (1 + health_upgrades)
local pickaxe_cost = 3000 * (1 + pickaxe_tier)
local reroll_cost = 1000 * (1 + reroll_amounts)
local aura_cost = 4000 * (1 + aura_upgrades)
local xp_point_boost_cost = 5000 * (1 + xp_points_upgrade)
local explosive_bullets_cost = 20000
local flamethrower_turrets_cost = 3000 * (1 + flame_turret)
local land_mine_cost = 2 * (1 + landmine)
local skill_reset_cost = 100000
local chest_limit_cost = fixed_prices.chest_limit_cost * (1 + chest_limit_outside_upgrades)
local health_cost = fixed_prices.health_cost * (1 + health_upgrades)
local pickaxe_cost = fixed_prices.pickaxe_cost * (1 + pickaxe_tier)
local reroll_cost = fixed_prices.reroll_cost
local aura_cost = fixed_prices.aura_cost * (1 + aura_upgrades)
local xp_point_boost_cost = fixed_prices.xp_point_boost_cost * (1 + xp_points_upgrade)
local explosive_bullets_cost = fixed_prices.explosive_bullets_cost
local flamethrower_turrets_cost = fixed_prices.flamethrower_turrets_cost * (1 + flame_turret)
local land_mine_cost = fixed_prices.land_mine_cost * (1 + landmine)
local skill_reset_cost = fixed_prices.skill_reset_cost
if reroll then
fixed_prices.chest_limit_cost = random(2000, 3000) * (1 + chest_limit_outside_upgrades)
fixed_prices.health_cost = random(7000, 10000) * (1 + health_upgrades)
fixed_prices.pickaxe_cost = random(2500, 4000) * (1 + pickaxe_tier)
fixed_prices.reroll_cost = random(4000, 6000)
fixed_prices.aura_cost = random(3000, 6000) * (1 + aura_upgrades)
fixed_prices.xp_point_boost_cost = random(4000, 6000) * (1 + xp_points_upgrade)
fixed_prices.explosive_bullets_cost = random(18000, 21000)
fixed_prices.flamethrower_turrets_cost = random(2500, 4000) * (1 + flame_turret)
fixed_prices.land_mine_cost = random(1, 8) * (1 + landmine)
fixed_prices.skill_reset_cost = random(90000, 110000)
if main_market_items['spidertron'] then
local rng = random(70000, 120000)
main_market_items['spidertron'] = {
stack = 1,
value = 'coin',
price = rng,
tooltip = 'Chonk Spidertron',
upgrade = false,
static = true
}
end
end
main_market_items['reroll_market_items'] = {
stack = 1,
value = 'coin',
+11 -7
View File
@@ -4,7 +4,6 @@ require 'maps.mountain_fortress_v3.breached_wall'
require 'maps.mountain_fortress_v3.ic.main'
require 'modules.rpg.main'
require 'modules.dynamic_landfill'
require 'modules.shotgun_buff'
require 'modules.no_deconstruction_of_neutral_entities'
require 'modules.rocks_yield_ore_veins'
@@ -530,7 +529,10 @@ local on_research_finished = function(event)
local mining_speed_bonus = game.forces.player.mining_drill_productivity_bonus * 5 -- +50% speed / level
if research.force.technologies['steel-axe'].researched then
mining_speed_bonus = mining_speed_bonus + 0.5
research.force.manual_mining_speed_modifier = mining_speed_bonus + this.force_mining_speed.speed
research.force.manual_mining_speed_modifier = mining_speed_bonus
local msg =
'Steel-axe technology has been researched, nerfing mining-speed.\nBuy Pickaxe-upgrades in the market!'
Alert.alert_all_players(30, msg, nil, 'achievement/tech-maniac', 0.6)
end -- +50% speed for steel-axe research
local force_name = research.force.name
@@ -561,12 +563,14 @@ local is_player_valid = function()
local players = game.connected_players
for _, player in pairs(players) do
if player.connected and not player.character or not player.character.valid then
local player_data = get_player_data(player)
if player_data.died then
return
if not player.admin then
local player_data = get_player_data(player)
if player_data.died then
return
end
player.set_controller {type = defines.controllers.god}
player.create_character()
end
player.set_controller {type = defines.controllers.god}
player.create_character()
end
end
end
-1
View File
@@ -1,4 +1,3 @@
require 'util'
local Global = require 'utils.global'
local surface_name = 'mountain_fortress_v3'
local level_width = require 'maps.mountain_fortress_v3.terrain'.level_width
+13 -2
View File
@@ -129,7 +129,6 @@ function Public.reset_table()
}
}
this.aura_upgrades = 0
this.reroll_amounts = 0
this.pickaxe_tier = 1
this.health_upgrades = 0
this.breached_wall = 1
@@ -158,9 +157,21 @@ function Public.reset_table()
this.placed_trains_in_zone = {
placed = 0,
positions = {},
limit = 4,
limit = 3,
randomized = false
}
this.marked_fixed_prices = {
chest_limit_cost = 3000,
health_cost = 10000,
pickaxe_cost = 3000,
reroll_cost = 5000,
aura_cost = 4000,
xp_point_boost_cost = 5000,
explosive_bullets_cost = 20000,
flamethrower_turrets_cost = 3000,
land_mine_cost = 2,
skill_reset_cost = 100000
}
this.collapse_grace = true
this.explosive_bullets = false
this.locomotive_biter = nil
+1 -1
View File
@@ -138,7 +138,7 @@ end
local function place_wagon(data)
local placed_trains_in_zone = WPT.get('placed_trains_in_zone')
if not placed_trains_in_zone.randomized then
placed_trains_in_zone.limit = random(1, 5)
placed_trains_in_zone.limit = random(1, 3)
placed_trains_in_zone.randomized = true
placed_trains_in_zone = WPT.get('placed_trains_in_zone')
end
+7
View File
@@ -98,6 +98,13 @@ commands.add_command(
end
local param = cmd.parameter
if not param then
return
end
if param == '' then
return
end
local target = game.players[param]
if not target or not target.valid then
+20 -13
View File
@@ -21,26 +21,33 @@ local function set_location(event)
label.location = {x = res.width - 423 * uis, y = 30 * uis}
end
local function create_label(player, label)
local ups = Server.get_ups()
local sUPS = 'SUPS = ' .. ups
if not label or not label.valid then
label =
player.gui.screen.add(
{
type = 'label',
name = ups_label,
caption = sUPS
}
)
local style = label.style
style.font = 'default-game'
return label
end
end
Event.add(
defines.events.on_player_joined_game,
function(event)
local player = game.get_player(event.player_index)
local ups = Server.get_ups()
local sUPS = 'SUPS = ' .. ups
local label = player.gui.screen[ups_label]
if not label or not label.valid then
label =
player.gui.screen.add(
{
type = 'label',
name = ups_label,
caption = sUPS
}
)
local style = label.style
style.font = 'default-game'
label = create_label(player, label)
end
set_location(event)
label.visible = false
@@ -78,7 +85,7 @@ commands.add_command(
local label = player.gui.screen[ups_label]
if not label or not label.valid then
return
label = create_label(player, label)
end
if label.visible then