mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-09 13:37:02 +02:00
updates
This commit is contained in:
parent
e3cc65d21f
commit
1db039d601
@ -89,6 +89,7 @@ local function distance(player)
|
||||
rpg_extra.reward_new_players = bonus_xp_on_join * rpg_extra.breached_walls
|
||||
WPT.set().breached_wall = breached_wall + 1
|
||||
WPT.set().placed_trains_in_zone.placed = 0
|
||||
WPT.set().biters.amount = 0
|
||||
WPT.set().placed_trains_in_zone.randomized = false
|
||||
WPT.set().placed_trains_in_zone.positions = {}
|
||||
raise_event(Balance.events.breached_wall, {})
|
||||
|
@ -536,8 +536,11 @@ local function construct_doors(ic, car)
|
||||
local p
|
||||
if car.name == 'car' then
|
||||
p = {x = x, y = area.left_top.y + 10}
|
||||
else
|
||||
elseif car.name == 'tank' then
|
||||
p = {x = x, y = area.left_top.y + 20}
|
||||
elseif car.name == 'spidertron' then
|
||||
p = {x = x, y = area.left_top.y + 30}
|
||||
main_tile_name = 'tutorial-grid'
|
||||
end
|
||||
if p.x < 0 then
|
||||
surface.set_tiles({{name = main_tile_name, position = {x = p.x + 0.5, y = p.y}}}, true)
|
||||
@ -728,6 +731,15 @@ function Public.create_car_room(ic, car)
|
||||
|
||||
local tiles = {}
|
||||
|
||||
if entity_name == 'car' then
|
||||
surface.create_entity({name = 'sand-rock-big', position = {0, 20}})
|
||||
elseif entity_name == 'tank' then
|
||||
surface.create_entity({name = 'sand-rock-big', position = {0, 40}})
|
||||
elseif entity_name == 'spidertron' then
|
||||
surface.create_entity({name = 'sand-rock-big', position = {0, 60}})
|
||||
main_tile_name = 'tutorial-grid'
|
||||
end
|
||||
|
||||
for x = area.left_top.x, area.right_bottom.x - 1, 1 do
|
||||
for y = area.left_top.y + 2, area.right_bottom.y - 3, 1 do
|
||||
tiles[#tiles + 1] = {name = main_tile_name, position = {x, y}}
|
||||
@ -739,14 +751,6 @@ function Public.create_car_room(ic, car)
|
||||
end
|
||||
end
|
||||
|
||||
if entity_name == 'car' then
|
||||
surface.create_entity({name = 'sand-rock-big', position = {0, 20}})
|
||||
elseif entity_name == 'tank' then
|
||||
surface.create_entity({name = 'sand-rock-big', position = {0, 40}})
|
||||
elseif entity_name == 'spidertron' then
|
||||
surface.create_entity({name = 'sand-rock-big', position = {0, 40}})
|
||||
end
|
||||
|
||||
local fishes = {}
|
||||
|
||||
for x = area.left_top.x, area.right_bottom.x - 1, 1 do
|
||||
@ -763,12 +767,8 @@ function Public.create_car_room(ic, car)
|
||||
|
||||
construct_doors(ic, car)
|
||||
|
||||
local lx, ly, rx, ry
|
||||
if car.name == 'car' then
|
||||
lx, ly, rx, ry = 4, 1, 5, 1
|
||||
else
|
||||
lx, ly, rx, ry = 4, 1, 5, 1
|
||||
end
|
||||
local lx, ly, rx, ry = 4, 1, 5, 1
|
||||
|
||||
local position1 = {area.left_top.x + lx, area.left_top.y + ly}
|
||||
local position2 = {area.right_bottom.x - rx, area.left_top.y + ry}
|
||||
|
||||
@ -819,16 +819,9 @@ function Public.create_car(ic, event)
|
||||
|
||||
local name, mined = get_player_entity(ic, player, ce)
|
||||
|
||||
if
|
||||
name == 'car' and ce.name == 'car' and not mined or name == 'car' and ce.name == 'tank' and not mined or
|
||||
name == 'tank' and ce.name == 'car' and not mined or
|
||||
name == 'tank' and ce.name == 'tank' and not mined or
|
||||
name == 'spidertron' and ce.name == 'car' and not mined or
|
||||
name == 'spidertron' and ce.name == 'tank' and not mined or
|
||||
name == 'spidertron' and ce.name == 'spidertron' and not mined
|
||||
then
|
||||
return player.print('Multiple vehicles are not supported at the moment.', Color.warning)
|
||||
end
|
||||
if entity_type[name] and not mined then
|
||||
return player.print('Multiple vehicles are not supported at the moment.', Color.warning)
|
||||
end
|
||||
|
||||
if string.sub(ce.surface.name, 0, #map_name) ~= map_name then
|
||||
return player.print('Multi-surface is not supported at the moment.', Color.warning)
|
||||
@ -963,7 +956,7 @@ function Public.infinity_scrap(ic, event, recreate)
|
||||
if random(1, 2) == 1 then
|
||||
reward = items
|
||||
size = #items
|
||||
count = random(1, 10)
|
||||
count = random(1, 15)
|
||||
else
|
||||
reward = ores
|
||||
size = #ores
|
||||
|
@ -45,7 +45,7 @@ function Public.reset()
|
||||
this.car_areas = {
|
||||
['car'] = {left_top = {x = -20, y = 0}, right_bottom = {x = 20, y = 20}},
|
||||
['tank'] = {left_top = {x = -30, y = 0}, right_bottom = {x = 30, y = 40}},
|
||||
['spidertron'] = {left_top = {x = -30, y = 0}, right_bottom = {x = 30, y = 40}}
|
||||
['spidertron'] = {left_top = {x = -40, y = 0}, right_bottom = {x = 40, y = 60}}
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -1,27 +1,9 @@
|
||||
local Public = {}
|
||||
|
||||
local ICW = require 'maps.mountain_fortress_v3.icw.table'
|
||||
local Color = require 'utils.color_presets'
|
||||
local Session = require 'utils.datastore.session_data'
|
||||
|
||||
local random = math.random
|
||||
|
||||
local rock_raffle = {
|
||||
'sand-rock-big',
|
||||
'sand-rock-big',
|
||||
'rock-big',
|
||||
'rock-big',
|
||||
'rock-big',
|
||||
'rock-big',
|
||||
'rock-big',
|
||||
'rock-big',
|
||||
'rock-big',
|
||||
'rock-big',
|
||||
'rock-huge'
|
||||
}
|
||||
|
||||
local size_of_rock_raffle = #rock_raffle
|
||||
|
||||
function Public.request_reconstruction(icw)
|
||||
icw.rebuild_tick = game.tick + 30
|
||||
end
|
||||
@ -390,19 +372,6 @@ function Public.kill_wagon(icw, entity)
|
||||
kick_players_from_surface(wagon)
|
||||
kick_players_out_of_vehicles(wagon)
|
||||
kill_wagon_doors(icw, wagon)
|
||||
for _, e in pairs(surface.find_entities_filtered({area = wagon.area})) do
|
||||
if e and e.valid and e.name == 'character' and e.player then
|
||||
local p = wagon.entity.surface.find_non_colliding_position('character', wagon.entity.position, 128, 0.5)
|
||||
if p then
|
||||
e.player.teleport(p, wagon.entity.surface)
|
||||
else
|
||||
e.player.teleport(wagon.entity.position, wagon.entity.surface)
|
||||
end
|
||||
Public.kill_minimap(e.player)
|
||||
else
|
||||
e.destroy()
|
||||
end
|
||||
end
|
||||
for _, tile in pairs(surface.find_tiles_filtered({area = wagon.area})) do
|
||||
surface.set_tiles({{name = 'out-of-map', position = tile.position}}, true)
|
||||
end
|
||||
@ -479,7 +448,7 @@ function Public.create_wagon_room(icw, wagon)
|
||||
for x = area.left_top.x, area.right_bottom.x - 1, 1 do
|
||||
for y = area.left_top.y + 2, area.right_bottom.y - 3, 1 do
|
||||
if random(1, 16) == 1 then
|
||||
fishes[#fishes + 1] = {name = rock_raffle[random(1, size_of_rock_raffle)], position = {x, y}}
|
||||
fishes[#fishes + 1] = {name = 'mineable-wreckage', position = {x, y}}
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -656,56 +625,6 @@ function Public.create_wagon_room(icw, wagon)
|
||||
end
|
||||
end
|
||||
|
||||
function Public.locomotive_mining(icw, event)
|
||||
local entity = event.entity
|
||||
if not entity or not entity.valid then
|
||||
return
|
||||
end
|
||||
local player = game.players[event.player_index]
|
||||
if not validate_player(player) then
|
||||
return
|
||||
end
|
||||
|
||||
local items = {
|
||||
'iron-plate',
|
||||
'iron-gear-wheel',
|
||||
'copper-plate',
|
||||
'copper-cable',
|
||||
'pipe',
|
||||
'explosives',
|
||||
'firearm-magazine',
|
||||
'stone-brick'
|
||||
}
|
||||
|
||||
local reward = items
|
||||
local size = #items
|
||||
local count = random(1, 20)
|
||||
local name = reward[random(1, size)]
|
||||
|
||||
for k, surface in pairs(icw.surfaces) do
|
||||
if validate_entity(surface) then
|
||||
if player.surface.index == surface.index then
|
||||
if entity.type ~= 'simple-entity' then
|
||||
return
|
||||
end
|
||||
event.buffer.clear()
|
||||
player.insert({name = name, count = count})
|
||||
if random(1, 4) == 1 then
|
||||
player.insert({name = 'coin', count = 1})
|
||||
end
|
||||
player.surface.create_entity(
|
||||
{
|
||||
name = 'flying-text',
|
||||
position = entity.position,
|
||||
text = '+' .. count .. ' [img=item/' .. name .. ']',
|
||||
color = {r = 188, g = 201, b = 63}
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Public.create_wagon(icw, created_entity, delay_surface)
|
||||
if not validate_entity(created_entity) then
|
||||
return
|
||||
|
@ -28,8 +28,6 @@ local function on_player_mined_entity(event)
|
||||
end
|
||||
local icw = ICW.get()
|
||||
|
||||
Functions.locomotive_mining(icw, event)
|
||||
|
||||
if not icw.allow_player_to_build_trains then
|
||||
return
|
||||
end
|
||||
|
@ -1992,7 +1992,7 @@ function Public.get_items()
|
||||
main_market_items['car'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 3000,
|
||||
price = 6000,
|
||||
tooltip = 'Portable Car Surface\nCan be killed easily.',
|
||||
upgrade = false,
|
||||
static = true
|
||||
@ -2000,7 +2000,7 @@ function Public.get_items()
|
||||
main_market_items['tank'] = {
|
||||
stack = 1,
|
||||
value = 'coin',
|
||||
price = 10000,
|
||||
price = 15000,
|
||||
tooltip = 'Portable Tank Surface\nChonk tank, can resist heavy damage.',
|
||||
upgrade = false,
|
||||
static = true
|
||||
|
@ -24,6 +24,8 @@ function Public.reset_table()
|
||||
this.restart = false
|
||||
this.shutdown = false
|
||||
this.announced_message = false
|
||||
this.soft_reset_counter = 0
|
||||
this.game_saved = false
|
||||
-- @end
|
||||
this.icw_locomotive = nil
|
||||
this.debug = false
|
||||
@ -62,9 +64,6 @@ function Public.reset_table()
|
||||
flame_turret = {}
|
||||
}
|
||||
}
|
||||
if this.hidden_dimension then
|
||||
this.hidden_dimension.logistic_research_level = 0
|
||||
end
|
||||
this.aura_upgrades = 0
|
||||
this.health_upgrades = 0
|
||||
this.breached_wall = 1
|
||||
@ -73,6 +72,10 @@ function Public.reset_table()
|
||||
x = 0,
|
||||
y = 0
|
||||
}
|
||||
this.biters = {
|
||||
amount = 0,
|
||||
limit = 256
|
||||
}
|
||||
this.traps = {}
|
||||
this.munch_time = true
|
||||
this.coin_amount = 1
|
||||
@ -89,14 +92,14 @@ function Public.reset_table()
|
||||
this.placed_trains_in_zone = {
|
||||
placed = 0,
|
||||
positions = {},
|
||||
limit = 5,
|
||||
limit = 4,
|
||||
randomized = false
|
||||
}
|
||||
this.collapse_grace = true
|
||||
this.explosive_bullets = false
|
||||
this.locomotive_biter = nil
|
||||
this.disconnect_wagon = false
|
||||
this.spawn_near_collapse = false
|
||||
this.spawn_near_collapse = true
|
||||
this.spidertron_unlocked_at_wave = 11
|
||||
-- this.void_or_tile = 'lab-dark-2'
|
||||
this.void_or_tile = 'out-of-map'
|
||||
|
@ -2149,6 +2149,7 @@ local function process_level_0_position(x, y, data, void_or_lab)
|
||||
if random(1, 2048) == 1 then
|
||||
treasure[#treasure + 1] = {position = p, chest = 'iron-chest'}
|
||||
end
|
||||
tiles[#tiles + 1] = {name = "dirt-7", position = p}
|
||||
if random(1, 100) > 25 then
|
||||
entities[#entities + 1] = {name = rock_raffle[random(1, size_of_rock_raffle)], position = p}
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user