SargaPulcsis

Untitled

May 16th, 2026 (edited)
109
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.95 KB | None | 0 0
  1. if mods["apia"] then
  2.     local util = require("util.util")
  3.  
  4.     local phosphorus_ammo = data.raw["ammo"]["artillery-shell-with-phosphorus"]
  5.     local phosphorus_projectile = data.raw["artillery-projectile"]["artillery-projectile-with-phosphorus"]
  6.     local phosphorus_recipe = data.raw["recipe"]["artillery-shell-with-phosphorus"]
  7.     local bio_solar_panel = data.raw["solar-panel"]["bio-solar-panel"]
  8.     local bio_solar_item = data.raw["item"]["bio-solar-panel"]
  9.  
  10.     -- Non-optional settings
  11.     if phosphorus_ammo then
  12.         phosphorus_ammo.icon = "__xy-k2so-enhancements-nulls-fork__/icons/phosphorus-artillery-shell.png"
  13.     end
  14.  
  15.     util.relax_conditions_for_planet("assembling-machine", "kr-greenhouse", "apia")
  16.  
  17.     if data.raw["combat-robot"] and data.raw["combat-robot"]["flamethrower"] then
  18.         data.raw["combat-robot"]["flamethrower"].time_to_live = 120 * 60
  19.     end
  20.  
  21.     -- Phosphorus Artillery Shell
  22.     if settings.startup["xy-apia-artillery-rebalance"].value then
  23.         if phosphorus_projectile then
  24.             phosphorus_projectile.action = phosphorus_projectile.action or { type = "direct" }
  25.  
  26.             phosphorus_projectile.action.action_delivery = {
  27.                 type = "instant",
  28.                 target_effects = {
  29.                     {
  30.                         type = "nested-result",
  31.                         action = {
  32.                             type = "area",
  33.                             radius = 10.0,
  34.                             action_delivery = {
  35.                                 type = "instant",
  36.                                 target_effects = {
  37.                                     { type = "damage", damage = { amount = 2500, type = "physical" } },
  38.                                     { type = "damage", damage = { amount = 2500, type = "explosion" } }
  39.                                 }
  40.                             }
  41.                         }
  42.                     },
  43.                     {
  44.                         type = "create-trivial-smoke",
  45.                         smoke_name = "artillery-smoke",
  46.                         initial_height = 0,
  47.                         speed_from_center = 0.05,
  48.                         speed_from_center_deviation = 0.005,
  49.                         offset_deviation = {{-4, -4}, {4, 4}},
  50.                         max_radius = 3.5,
  51.                         repeat_count = 4 * 4 * 15
  52.                     },
  53.                     {
  54.                         type = "create-smoke",
  55.                         entity_name = "phosphorus-cloud",
  56.                         repeat_count = 8,
  57.                         random_offset = true,
  58.                         offset_deviation = {{-8, -8}, {8, 8}}
  59.                     },
  60.                     {
  61.                         type = "create-entity",
  62.                         entity_name = "big-artillery-explosion"
  63.                     },
  64.                     {
  65.                         type = "show-explosion-on-chart",
  66.                         scale = 8 / 32
  67.                     }
  68.                 }
  69.             }
  70.         end
  71.  
  72.         if phosphorus_ammo then
  73.             phosphorus_ammo.stack_size = 25
  74.             phosphorus_ammo.weight = 1000 * kg
  75.         end
  76.  
  77.         if phosphorus_recipe then
  78.             phosphorus_recipe.ingredients = {
  79.                 { type = "item", name = "steel-plate", amount = 10 },
  80.                 { type = "item", name = "processing-unit", amount = 10 },
  81.                 { type = "item", name = "phosphorus", amount = 15 },
  82.                 { type = "item", name = "artillery-shell", amount = 1 }
  83.             }
  84.         end
  85.     end
  86.  
  87.     -- Bio Solar Panel
  88.     if settings.startup["xy-apia-biosolar-rebalance"].value then
  89.         if bio_solar_panel then
  90.             bio_solar_panel.emissions_per_second = { pollution = -0.2 }
  91.             bio_solar_panel.production = "120kW"
  92.         end
  93.  
  94.         if bio_solar_item then
  95.             bio_solar_item.weight = 40000
  96.             bio_solar_item.stack_size = 50
  97.         end
  98.     end
  99. end
Tags: factorio
Advertisement
Comments
Add Comment
Please, Sign In to add comment