Skip to content

Commit

Permalink
Merge pull request #1106 from Refactorio/crash-site-artillery-wagon-c…
Browse files Browse the repository at this point in the history
…hanges

Add combat robots explode on artillery wagons.
  • Loading branch information
grilledham authored Nov 10, 2020
2 parents c13b282 + 2c74421 commit 9ed9260
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,19 @@ Event.add(
set_timeout_in_ticks(1, spawn_player, player)
end
)

Event.add(
defines.events.on_combat_robot_expired,
function(event)
local entity = event.robot
local position = entity.position
local owner = event.owner
if owner == nil or not owner.valid then
return
end
if entity.force.name == 'enemy' and owner.name == "artillery-wagon" then
-- only create a grenade entity if an artillery wagon (the event owner) killed the target that spawned the combabt robot
entity.surface.create_entity{name = "cluster-grenade", position=position, target=position, speed=1}
end
end
)
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ local factory_b = {
local market = {
callback = ob.market_set_items_callback,
data = {
market_name = 'Medium Checmical Factory',
market_name = 'Medium Chemical Factory',
upgrade_rate = 0.5,
upgrade_base_cost = 250,
upgrade_cost_base = 2,
Expand Down
2 changes: 1 addition & 1 deletion map_gen/maps/crash_site/scenario.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'map_gen.maps.crash_site.blueprint_extractor'
require 'map_gen.maps.crash_site.entity_died_events'
require 'map_gen.maps.crash_site.events'
require 'map_gen.maps.crash_site.weapon_balance'

local b = require 'map_gen.shared.builders'
Expand Down

0 comments on commit 9ed9260

Please sign in to comment.