Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MewMew committed Dec 2, 2018
1 parent 56cea73 commit a8eeb2f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 34 deletions.
17 changes: 13 additions & 4 deletions antigrief.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,24 @@ local function on_player_used_capsule(event)
end
end

local blacklisted_types = {
["transport-belt"] = true,
["wall"] = true,
["underground-belt"] = true,
["inserter"] = true,
["land-mine"] = true,
["gate"] = true,
["lamp"] = true,
["mining-drill"] = true,
["splitter"] = true
}

--Friendly Fire History
local function on_entity_died(event)
if not event.cause then return end
if event.cause.name ~= "player" then return end
if event.cause.force.name ~= event.entity.force.name then return end
if blacklisted_types[event.entity.type] then return end
local player = event.cause.player
if not global.friendly_fire_history then global.friendly_fire_history = {} end
if #global.friendly_fire_history > 999 then global.friendly_fire_history = {} end
Expand All @@ -151,10 +164,6 @@ local function on_entity_died(event)
end

--Mining Thieves History
local blacklisted_types = {
["transport-belt"] = true,
["inserter"] = true
}
local function on_player_mined_entity(event)
if not event.entity.last_user then return end
local player = game.players[event.player_index]
Expand Down
6 changes: 3 additions & 3 deletions maps/fish_defender.lua
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ local function refresh_market_offers()
{price = {{"coin", 125}}, offer = {type = 'give-item', item = 'heavy-armor', count = 1}},
{price = {{"coin", 350}}, offer = {type = 'give-item', item = 'modular-armor', count = 1}},
{price = {{"coin", 1500}}, offer = {type = 'give-item', item = 'power-armor', count = 1}},
{price = {{"coin", 12000}}, offer = {type = 'give-item', item = 'power-armor-mk2', count = 1}},
{price = {{"coin", 10000}}, offer = {type = 'give-item', item = 'power-armor-mk2', count = 1}},
{price = {{"coin", 50}}, offer = {type = 'give-item', item = 'solar-panel-equipment', count = 1}},
{price = {{"coin", 2250}}, offer = {type = 'give-item', item = 'fusion-reactor-equipment', count = 1}},
{price = {{"coin", 100}}, offer = {type = 'give-item', item = 'battery-equipment', count = 1}},
Expand Down Expand Up @@ -552,7 +552,7 @@ local function damage_entities_in_radius(position, radius, damage)
if radius > 5 then radius = 5 end
local entities_to_damage = game.surfaces["fish_defender"].find_entities_filtered({area = {{position.x - radius, position.y - radius},{position.x + radius, position.y + radius}}})
for _, entity in pairs(entities_to_damage) do
if entity.health then
if entity.health and entity.name ~= "land-mine" then
if entity.force.name ~= "enemy" then
if entity.name == "player" then
entity.damage(damage, "enemy")
Expand Down Expand Up @@ -764,7 +764,7 @@ local function on_player_joined_game(event)
["laser-turret"] = {placed = 0, limit = 1, str = "laser turret", slot_price = 250},
["artillery-turret"] = {placed = 0, limit = 1, str = "artillery turret", slot_price = 500},
["flamethrower-turret"] = {placed = 0, limit = 0, str = "flamethrower turret", slot_price = 50000},
["land-mine"] = {placed = 0, limit = 1, str = "landmine", slot_price = 2}
["land-mine"] = {placed = 0, limit = 1, str = "landmine", slot_price = 1}
}

global.wave_grace_period = wave_interval * 21
Expand Down
55 changes: 28 additions & 27 deletions maps/spooky_forest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,14 @@ local function uncover_map(surface, position, radius_min, radius_max)
if surface.get_tile(pos).name == "out-of-map" then
local tile_name = get_noise_tile(pos)
insert(tiles, {name = tile_name, position = pos})
if tile_name == "water" or tile_name == "deepwater" then
if math_random(1, 8) == 1 then insert(fishes, pos) end
end
local entity = get_entity(pos)
if entity then
surface.create_entity({name = entity, position = pos})
end
if tile_name == "water" or tile_name == "deepwater" or tile_name == "water-green" then
if math_random(1, 9) == 1 then insert(fishes, pos) end
else
local entity = get_entity(pos)
if entity then
surface.create_entity({name = entity, position = pos})
end
end
end
end
end
Expand All @@ -214,17 +215,17 @@ local function uncover_map_for_player(player)
if surface.get_tile(pos).name == "out-of-map" then
local tile_name = get_noise_tile(pos)
insert(tiles, {name = tile_name, position = pos})
if tile_name == "water" or tile_name == "deepwater" then
if math_random(1, 8) == 1 then insert(fishes, pos) end
end

local entity = get_entity(pos)
if entity then
surface.create_entity({name = entity, position = pos})
if entity == "biter-spawner" or entity == "spitter-spawner" then
insert(uncover_map_schedule, {x = pos.x, y = pos.y})
if tile_name == "water" or tile_name == "deepwater" or tile_name == "water-green" then
if math_random(1, 9) == 1 then insert(fishes, pos) end
else
local entity = get_entity(pos)
if entity then
surface.create_entity({name = entity, position = pos})
if entity == "biter-spawner" or entity == "spitter-spawner" then
insert(uncover_map_schedule, {x = pos.x, y = pos.y})
end
end
end
end
end
end
end
Expand Down Expand Up @@ -285,16 +286,16 @@ local function on_entity_died(event)
if p then surface.create_entity {name=t[1], position=p} end
end
end

local name = ore_spawn_raffle[math.random(1,#ore_spawn_raffle)]
local pos = {x = event.entity.position.x, y = event.entity.position.y}
local amount_modifier = 1 + game.forces.enemy.evolution_factor * 10
if name == "crude-oil" then
map_functions.draw_oil_circle(pos, name, surface, 5, math.ceil(100000 * amount_modifier))
else
map_functions.draw_smoothed_out_ore_circle(pos, name, surface, 7, math.ceil(600 * amount_modifier))
if math_random(1, 4) == 1 then
local name = ore_spawn_raffle[math.random(1,#ore_spawn_raffle)]
local pos = {x = event.entity.position.x, y = event.entity.position.y}
local amount_modifier = 1 + game.forces.enemy.evolution_factor * 10
if name == "crude-oil" then
map_functions.draw_oil_circle(pos, name, surface, 5, math.ceil(100000 * amount_modifier))
else
map_functions.draw_smoothed_out_ore_circle(pos, name, surface, 7, math.ceil(600 * amount_modifier))
end
end

end

if entity_drop_amount[event.entity.name] then
Expand Down Expand Up @@ -338,7 +339,7 @@ local function on_player_joined_game(event)
game.forces["player"].set_spawn_position({0, 0}, surface)

game.map_settings.enemy_expansion.enabled = true
game.map_settings.enemy_evolution.destroy_factor = 0.0035
game.map_settings.enemy_evolution.destroy_factor = 0.0012
game.map_settings.enemy_evolution.time_factor = 0
game.map_settings.enemy_evolution.pollution_factor = 0

Expand Down
4 changes: 4 additions & 0 deletions maps/spooky_forest_changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.05
map reveal fixes
reduced evolution

0.04
disabled flamethrower turret

Expand Down

0 comments on commit a8eeb2f

Please sign in to comment.