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

mtn fortress - tweaks from suggestions

This commit is contained in:
Gerkiz
2021-02-04 20:23:07 +01:00
parent 727a895354
commit 598391931c
7 changed files with 42 additions and 18 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ sold_out=Sold out!
flamethrower_turret=Upgrades the amount of flamethrowers that can be placed.
land_mine=Upgrades the amount of landmines that can be placed.
car=Portable Car Surface\nCan be killed easily.
tank=Portable Tank Surface\nChonk tank, can resist heavy damage.
tank=Portable Tank Surface\nChonk tank, can resist heavy damage.\nTo buy this, you need to have a car in your inventory.
tank_cannon_na=Tank Cannon\nAvailable after wave __1__.
vehicle_machine_gun_na=Car Machine Gun\nAvailable after wave __1__.
+3 -3
View File
@@ -49,9 +49,9 @@ market.caspules = {
['cluster-grenade'] = {value = 64, rarity = 5},
['poison-capsule'] = {value = 32, rarity = 6},
['slowdown-capsule'] = {value = 8, rarity = 1},
['defender-capsule'] = {value = 8, rarity = 1},
['distractor-capsule'] = {value = 20, rarity = 5},
['destroyer-capsule'] = {value = 32, rarity = 7},
['defender-capsule'] = {value = 18, rarity = 1},
['distractor-capsule'] = {value = 68, rarity = 5},
['destroyer-capsule'] = {value = 74, rarity = 7},
['discharge-defense-remote'] = {value = 2000, rarity = 8},
['artillery-targeting-remote'] = {value = 32, rarity = 7},
['raw-fish'] = {value = 6, rarity = 1}
+14 -1
View File
@@ -462,6 +462,17 @@ local function give_coin(player)
end
end
local immunity_spawner =
Token.register(
function(data)
local entity = data.entity
if not entity or not entity.valid then
return
end
entity.destructible = true
end
)
local mining_events = {
{
function()
@@ -624,7 +635,9 @@ local mining_events = {
local position = entity.position
local surface = entity.surface
surface.create_entity({name = 'biter-spawner', position = position, force = 'enemy'})
local e = surface.create_entity({name = 'biter-spawner', position = position, force = 'enemy'})
e.destructible = false
Task.set_timeout_in_ticks(300, immunity_spawner, {entity = e})
Public.unstuck_player(index)
end,
512,
@@ -8,11 +8,7 @@ local Public = {}
local function splash_damage(surface, position, final_damage_amount)
local create = surface.create_entity
local damage = random(floor(final_damage_amount * 3), floor(final_damage_amount * 4))
for _, e in pairs(
surface.find_entities_filtered(
{area = {{position.x - radius, position.y - radius}, {position.x + radius, position.y + radius}}}
)
) do
for _, e in pairs(surface.find_entities_filtered({area = {{position.x - radius, position.y - radius}, {position.x + radius, position.y + radius}}})) do
if e.valid and e.health then
local distance_from_center = sqrt((e.position.x - position.x) ^ 2 + (e.position.y - position.y) ^ 2)
if distance_from_center <= radius then
@@ -55,10 +51,7 @@ function Public.explosive_bullets(event)
if not weapon.valid_for_read or not ammo.valid_for_read then
return
end
if
ammo.name ~= 'firearm-magazine' and ammo.name ~= 'piercing-rounds-magazine' and
ammo.name ~= 'uranium-rounds-magazine'
then
if ammo.name ~= 'firearm-magazine' and ammo.name ~= 'piercing-rounds-magazine' and ammo.name ~= 'uranium-rounds-magazine' then
return
end
local entity = event.entity
+1 -1
View File
@@ -696,7 +696,7 @@ function Public.remove_offline_players()
if offline_players[i] and game.players[offline_players[i].index] and game.players[offline_players[i].index].connected then
offline_players[i] = nil
else
if offline_players[i] and game.players[offline_players[i].index] and offline_players[i].tick < game.tick - 54000 then
if offline_players[i] and game.players[offline_players[i].index] and offline_players[i].tick < game.tick - 108000 then
local name = offline_players[i].name
player_inv[1] = game.players[offline_players[i].index].get_inventory(defines.inventory.character_main)
player_inv[2] = game.players[offline_players[i].index].get_inventory(defines.inventory.character_armor)
+20 -3
View File
@@ -1238,7 +1238,6 @@ local function gui_click(event)
player.print(({'locomotive.full_inventory', inserted_count, name}), {r = 0.98, g = 0.66, b = 0.22})
player.print(({'locomotive.change_returned'}), {r = 0.98, g = 0.66, b = 0.22})
player.insert({name = name, count = inserted_count})
player.remove_item({name = item.value, count = ceil(item.price * (inserted_count / item.stack))})
else
player.remove_item({name = item.value, count = cost})
@@ -1745,6 +1744,23 @@ local function on_player_changed_surface(event)
end
end
local function on_player_driving_changed_state(event)
local player = game.players[event.player_index]
if not player or not player.valid then
return
end
local trusted = Session.get_trusted_table()
local locomotive = WPT.get('locomotive')
if not locomotive or not locomotive.valid then
return
end
if not trusted[player.name] then
if player.character and player.character.valid and player.character.driving then
player.character.driving = false
end
end
end
function Public.close_gui_player(frame)
if not frame then
return
@@ -2224,7 +2240,7 @@ function Public.get_items()
main_market_items['car'] = {
stack = 1,
value = 'coin',
price = 8000,
price = 6000,
tooltip = ({'main_market.car'}),
upgrade = false,
static = true
@@ -2232,7 +2248,7 @@ function Public.get_items()
main_market_items['tank'] = {
stack = 1,
value = 'coin',
price = 15000,
price = 12000,
tooltip = ({'main_market.tank'}),
upgrade = false,
static = true
@@ -2388,5 +2404,6 @@ Event.add(defines.events.on_pre_player_mined_item, on_player_and_robot_mined_ent
Event.add(defines.events.on_robot_mined_entity, on_player_and_robot_mined_entity)
Event.add(defines.events.on_console_chat, on_console_chat)
Event.add(defines.events.on_player_changed_surface, on_player_changed_surface)
Event.add(defines.events.on_player_driving_changed_state, on_player_driving_changed_state)
return Public
+1
View File
@@ -206,6 +206,7 @@ function Public.reset_map()
WD.enable_threat_log(true)
WD.check_collapse_position(true)
WD.set_disable_threat_below_zero(true)
WD.increase_damage_per_wave(false)
Functions.set_difficulty()
Functions.disable_creative()