mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-09 13:37:02 +02:00
railgun_enhancer update
This commit is contained in:
parent
1645b99910
commit
8bea0f98d6
@ -11,17 +11,17 @@ require "poll"
|
||||
require "score"
|
||||
|
||||
--require "maps.modules.hunger"
|
||||
--require "maps.tools.cheat_mode"
|
||||
require "maps.tools.cheat_mode"
|
||||
|
||||
---- enable maps here ----
|
||||
--require "maps.biter_battles"
|
||||
require "maps.cave_miner"
|
||||
--require "maps.cave_miner"
|
||||
--require "maps.deep_jungle"
|
||||
--require "maps.lost_desert"
|
||||
--require "maps.labyrinth"
|
||||
--require "maps.spaghettorio"
|
||||
--require "maps.spiral_troopers"
|
||||
--require "maps.fish_defender"
|
||||
require "maps.fish_defender"
|
||||
--require "maps.crossing"
|
||||
--require "maps.spooky_forest"
|
||||
--require "maps.atoll"
|
||||
|
@ -627,8 +627,8 @@ local function refresh_market_offers()
|
||||
{price = {{"coin", 2}}, offer = {type = 'give-item', item = 'rocket', count = 1}},
|
||||
{price = {{"coin", 7}}, offer = {type = 'give-item', item = 'explosive-rocket', count = 1}},
|
||||
{price = {{"coin", 7500}}, offer = {type = 'give-item', item = 'atomic-bomb', count = 1}},
|
||||
{price = {{"coin", 360}}, offer = {type = 'give-item', item = 'railgun', count = 1}},
|
||||
{price = {{"coin", 10}}, offer = {type = 'give-item', item = 'railgun-dart', count = 1}},
|
||||
{price = {{"coin", 325}}, offer = {type = 'give-item', item = 'railgun', count = 1}},
|
||||
{price = {{"coin", 8}}, offer = {type = 'give-item', item = 'railgun-dart', count = 1}},
|
||||
{price = {{"coin", 40}}, offer = {type = 'give-item', item = 'poison-capsule', count = 1}},
|
||||
{price = {{"coin", 4}}, offer = {type = 'give-item', item = 'defender-capsule', count = 1}},
|
||||
{price = {{"coin", 10}}, offer = {type = 'give-item', item = 'light-armor', count = 1}},
|
||||
@ -1000,7 +1000,7 @@ local function on_player_joined_game(event)
|
||||
--game.forces["player"].technologies["laser-turret-speed-7"].enabled = false
|
||||
--game.forces["player"].technologies["atomic-bomb"].enabled = false
|
||||
|
||||
game.forces.player.set_ammo_damage_modifier("shotgun-shell", 0.5)
|
||||
game.forces.player.set_ammo_damage_modifier("shotgun-shell", 1)
|
||||
--game.forces.player.set_turret_attack_modifier("flamethrower-turret", -0.5)
|
||||
|
||||
global.entity_limits = {
|
||||
|
@ -8,14 +8,15 @@ local info = [[
|
||||
|
||||
The Market will gladly take any coin you might find.
|
||||
|
||||
Buy slots for your team,
|
||||
to increase the maximum number of turrets/mines that can be placed.
|
||||
Additional turret slots can be bought at the market.
|
||||
|
||||
The railgun has been enhanced greatly.
|
||||
Researching Laser Turret Damage will improve it even further.
|
||||
|
||||
The shotgun has recieved a damage buff.
|
||||
|
||||
Researching Tanks will unlock the artillery tech early
|
||||
to allow you to produce shells.
|
||||
allowing you to produce shells.
|
||||
]]
|
||||
|
||||
local function create_map_intro(player)
|
||||
|
@ -1,8 +1,9 @@
|
||||
-- improves the damage of the railgun and adds visual effects -- by mewmew
|
||||
-- laser turret research will increase it´s damage even further --
|
||||
|
||||
local event = require 'utils.event'
|
||||
local damage_min = 1000
|
||||
local damage_max = 2000
|
||||
local damage_min = 400
|
||||
local damage_max = 800
|
||||
local math_random = math.random
|
||||
local additional_visual_effects = true
|
||||
local do_splash_damage = true
|
||||
@ -15,42 +16,47 @@ local biological_target_types = {
|
||||
}
|
||||
|
||||
local function create_visuals(source_entity, target_entity)
|
||||
if additional_visual_effects then
|
||||
local surface = target_entity.surface
|
||||
surface.create_entity({name = "water-splash", position = target_entity.position})
|
||||
if biological_target_types[target_entity.type] then
|
||||
surface.create_entity({name = "blood-explosion-big", position = target_entity.position})
|
||||
for x = -8, 8, 1 do
|
||||
for y = -8, 8, 1 do
|
||||
if math_random(1, 16) == 1 then
|
||||
surface.create_entity({name = "blood-fountain", position = {target_entity.position.x + (x * 0.1), target_entity.position.y + (y * 0.1)}})
|
||||
surface.create_entity({name = "blood-fountain-big", position = {target_entity.position.x + (x * 0.1), target_entity.position.y + (y * 0.1)}})
|
||||
end
|
||||
if not additional_visual_effects then return end
|
||||
local surface = target_entity.surface
|
||||
surface.create_entity({name = "water-splash", position = target_entity.position})
|
||||
if biological_target_types[target_entity.type] then
|
||||
surface.create_entity({name = "blood-explosion-big", position = target_entity.position})
|
||||
for x = -8, 8, 1 do
|
||||
for y = -8, 8, 1 do
|
||||
if math_random(1, 16) == 1 then
|
||||
surface.create_entity({name = "blood-fountain", position = {target_entity.position.x + (x * 0.1), target_entity.position.y + (y * 0.1)}})
|
||||
surface.create_entity({name = "blood-fountain-big", position = {target_entity.position.x + (x * 0.1), target_entity.position.y + (y * 0.1)}})
|
||||
end
|
||||
end
|
||||
else
|
||||
if math_random(1, 2) == 1 then
|
||||
surface.create_entity({name = "fire-flame", position = target_entity.position})
|
||||
end
|
||||
for x = -3, 3, 1 do
|
||||
for y = -3, 3, 1 do
|
||||
if math_random(1, 3) == 1 then
|
||||
surface.create_trivial_smoke({name="smoke-fast", position={target_entity.position.x + (x * 0.35), target_entity.position.y + (y * 0.35)}})
|
||||
end
|
||||
if math_random(1, 5) == 1 then
|
||||
surface.create_trivial_smoke({name="train-smoke", position={target_entity.position.x + (x * 0.35), target_entity.position.y + (y * 0.35)}})
|
||||
end
|
||||
end
|
||||
else
|
||||
if math_random(1, 3) ~= 1 then
|
||||
surface.create_entity({name = "fire-flame", position = target_entity.position})
|
||||
end
|
||||
for x = -3, 3, 1 do
|
||||
for y = -3, 3, 1 do
|
||||
if math_random(1, 3) == 1 then
|
||||
surface.create_trivial_smoke({name="smoke-fast", position={target_entity.position.x + (x * 0.35), target_entity.position.y + (y * 0.35)}})
|
||||
end
|
||||
if math_random(1, 5) == 1 then
|
||||
surface.create_trivial_smoke({name="train-smoke", position={target_entity.position.x + (x * 0.35), target_entity.position.y + (y * 0.35)}})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function do_splash_damage_around_entity(source_entity)
|
||||
local function do_splash_damage_around_entity(source_entity, player)
|
||||
if not do_splash_damage then return end
|
||||
local entities = source_entity.surface.find_entities_filtered({area = {{source_entity.position.x - 2.5, source_entity.position.y - 2.5}, {source_entity.position.x + 2.5, source_entity.position.y + 2.5}}})
|
||||
local research_damage_bonus = player.force.get_ammo_damage_modifier("laser-turret") + 1
|
||||
local research_splash_radius_bonus = player.force.get_ammo_damage_modifier("laser-turret") * 0.5
|
||||
local splash_area = {
|
||||
{source_entity.position.x - (2.5 + research_splash_radius_bonus), source_entity.position.y - (2.5 + research_splash_radius_bonus)},
|
||||
{source_entity.position.x + (2.5 + research_splash_radius_bonus), source_entity.position.y + (2.5 + research_splash_radius_bonus)}
|
||||
}
|
||||
local entities = source_entity.surface.find_entities_filtered({area = splash_area})
|
||||
for _, entity in pairs(entities) do
|
||||
if entity.health and entity ~= source_entity then
|
||||
if entity.health and entity ~= source_entity and entity ~= player then
|
||||
if additional_visual_effects then
|
||||
local surface = entity.surface
|
||||
surface.create_entity({name = "railgun-beam", position = source_entity.position, source = source_entity.position, target = entity.position})
|
||||
@ -58,8 +64,9 @@ local function do_splash_damage_around_entity(source_entity)
|
||||
if biological_target_types[entity.type] then
|
||||
surface.create_entity({name = "blood-fountain", position = entity.position})
|
||||
end
|
||||
end
|
||||
entity.damage(math_random(math.ceil(damage_min / 45), math.ceil(damage_max / 45)), source_entity.force, "physical")
|
||||
end
|
||||
local damage = math_random(math.ceil((damage_min * research_damage_bonus) / 32), math.ceil((damage_max * research_damage_bonus) / 32))
|
||||
entity.damage(damage, player.force, "physical")
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -77,10 +84,13 @@ local function on_entity_damaged(event)
|
||||
|
||||
create_visuals(event.cause, event.entity)
|
||||
|
||||
do_splash_damage_around_entity(event.entity)
|
||||
do_splash_damage_around_entity(event.entity, player)
|
||||
|
||||
event.entity.health = event.entity.health + event.final_damage_amount
|
||||
event.entity.damage(math_random(damage_min, damage_max), player.force, "physical")
|
||||
|
||||
local research_damage_bonus = player.force.get_ammo_damage_modifier("laser-turret") + 1
|
||||
local damage = math_random(math.ceil(damage_min * research_damage_bonus), math.ceil(damage_max * research_damage_bonus))
|
||||
event.entity.damage(damage, player.force, "physical")
|
||||
end
|
||||
|
||||
event.add(defines.events.on_entity_damaged, on_entity_damaged)
|
Loading…
x
Reference in New Issue
Block a user