File tree Expand file tree Collapse file tree 5 files changed +84
-1
lines changed
Expand file tree Collapse file tree 5 files changed +84
-1
lines changed Original file line number Diff line number Diff line change 1+ -- Destroy oilwells when pumpjack explodes from fire
2+ -- created by perfectwill
3+
4+ local Event = require ' utils.event'
5+
6+ local explosions = {
7+ ' massive-explosion' ,
8+ ' big-artillery-explosion' ,
9+ }
10+
11+ local Public = {}
12+
13+ Public .register = function ()
14+ Event .add (defines .events .on_entity_died , function (event )
15+ local entity = event .entity
16+ if not (entity and entity .valid ) then
17+ return
18+ end
19+ if entity .name == ' pumpjack' and (event .damage_type and event .damage_type .name == ' fire' ) then
20+ local oilwell = entity .surface .find_entity (' crude-oil' , entity .position )
21+ if not oilwell then
22+ return
23+ end
24+
25+ oilwell .surface .create_entity ({
26+ name = explosions [math.random (# explosions )],
27+ position = oilwell .position ,
28+ })
29+ oilwell .destroy ()
30+ end
31+ end )
32+ end
33+
34+ return Public
Original file line number Diff line number Diff line change 1+ -- Invincible vehicles with enough experience
2+
3+ local Event = require ' utils.event'
4+ local ForceControl = require ' features.force_control'
5+
6+ local Public = {}
7+
8+ Public .register = function ()
9+ Event .on_built (function (event )
10+ local entity = event .entity
11+ if not (entity and entity .valid ) then
12+ return
13+ end
14+ if entity .type ~= ' spider-vehicle' then
15+ return
16+ end
17+ local data = ForceControl .get_force_data (entity .force )
18+ if not (data and data .current_level and data .current_level > 300 ) then
19+ return
20+ end
21+ entity .destructible = false
22+ end )
23+ end
24+
25+ return Public
Original file line number Diff line number Diff line change @@ -372,6 +372,14 @@ local config = {
372372 load = function () return require ' map_gen.maps.diggy.feature.mining_productivity' end ,
373373 replace = script .active_mods [' redmew-data' ] == nil , -- replace mining productivity with robot cargo capacity
374374 },
375+ flaming_pumpjack = {
376+ enabled = true ,
377+ load = function () return require (' map_gen.maps.diggy.feature.flaming_pumpjack' ) end ,
378+ },
379+ shelob = {
380+ enabled = true ,
381+ load = function () return require (' map_gen.maps.diggy.feature.shelob' ) end ,
382+ },
375383 }
376384}
377385
Original file line number Diff line number Diff line change @@ -371,6 +371,14 @@ local config = {
371371 enabled = true ,
372372 load = function () return require ' map_gen.maps.diggy.feature.mining_productivity' end ,
373373 replace = script .active_mods [' redmew-data' ] == nil , -- replace mining productivity with robot cargo capacity
374+ },
375+ flaming_pumpjack = {
376+ enabled = true ,
377+ load = function () return require (' map_gen.maps.diggy.feature.flaming_pumpjack' ) end ,
378+ },
379+ shelob = {
380+ enabled = true ,
381+ load = function () return require (' map_gen.maps.diggy.feature.shelob' ) end ,
374382 },
375383 belts_n_bullets = {
376384 enabled = true ,
Original file line number Diff line number Diff line change @@ -353,7 +353,15 @@ local config = {
353353 weapon_balance = {
354354 enabled = true ,
355355 load = function () return require (' map_gen.maps.diggy.feature.weapon_balance' ) end
356- }
356+ },
357+ flaming_pumpjack = {
358+ enabled = true ,
359+ load = function () return require (' map_gen.maps.diggy.feature.flaming_pumpjack' ) end ,
360+ },
361+ shelob = {
362+ enabled = true ,
363+ load = function () return require (' map_gen.maps.diggy.feature.shelob' ) end ,
364+ },
357365 }
358366}
359367
You can’t perform that action at this time.
0 commit comments