mirror of
https://github.com/veden/Rampant.git
synced 2025-01-14 02:23:01 +02:00
ecb8040: Wasps drones and spawner eggs can now be hit be projectiles
This commit is contained in:
parent
6864bd6a97
commit
e0955458ac
@ -45,6 +45,7 @@ Version: 3.2.0
|
||||
- Fixed non-settler unit groups being created when player or base pheromone is effectively zero
|
||||
- When the last player structure is destroyed on a chunk, the base pheromone is set to 0
|
||||
- Fixed crash when walls or gates didn't have a resistence property with the add acid resistance to walls mod settings
|
||||
- Fixed projectiles not being able to collide with spawner eggs and wasps
|
||||
Optimizations:
|
||||
- Moved most constants out of global
|
||||
- Removed new enemy variations setting
|
||||
|
@ -33,6 +33,18 @@ if settings.startup["rampant--newEnemies"].value and mods["SchallAlienLoot"] the
|
||||
end
|
||||
end
|
||||
|
||||
for _, projectile in pairs(data.raw["projectile"]) do
|
||||
if not projectile.hit_collision_mask then
|
||||
projectile.hit_collision_mask = {
|
||||
"player-layer",
|
||||
"train-layer",
|
||||
RampantGlobalVariables.projectileCollisionLayer
|
||||
}
|
||||
else
|
||||
projectile.hit_collision_mask[#projectile.hit_collision_mask+1] = RampantGlobalVariables.projectileCollisionLayer
|
||||
end
|
||||
end
|
||||
|
||||
if settings.startup["rampant--removeBloodParticles"].value then
|
||||
local explosions = data.raw["explosion"]
|
||||
|
||||
|
5
data.lua
5
data.lua
@ -20,6 +20,7 @@ local colorUtils = require("prototypes/utils/ColorUtils")
|
||||
local smokeUtils = require("prototypes/utils/SmokeUtils")
|
||||
local swarmUtils = require("prototypes/SwarmUtils")
|
||||
local constants = require("libs/Constants")
|
||||
local collision_mask_util = require("collision-mask-util")
|
||||
|
||||
-- imported functions
|
||||
|
||||
@ -39,6 +40,9 @@ makeSmokeAddingFuel({name="the"})
|
||||
|
||||
require("prototypes/buildings/ChunkScanner")
|
||||
|
||||
RampantGlobalVariables = {}
|
||||
RampantGlobalVariables.projectileCollisionLayer = collision_mask_util.get_first_unused_layer()
|
||||
|
||||
if not data.raw["corpse"]["acid-splash-purple"] then
|
||||
local attributes = {}
|
||||
|
||||
@ -151,4 +155,3 @@ if settings.startup["rampant--newEnemies"].value then
|
||||
else
|
||||
swarmUtils.generateSpawnerProxy(data.raw["unit-spawner"]["biter-spawner"].result_units)
|
||||
end
|
||||
|
||||
|
@ -42,6 +42,7 @@ function droneUtils.makeDrone(attributes)
|
||||
healing_per_tick = attributes.healing,
|
||||
alert_when_damaged = false,
|
||||
collision_box = {{0, 0}, {0, 0}},
|
||||
collision_mask = {RampantGlobalVariables.projectileCollisionLayer},
|
||||
selection_box = {{-0.5, -1.5}, {0.5, -0.5}},
|
||||
distance_per_frame = attributes.distancePerFrame or 0,
|
||||
time_to_live = attributes.ttl or (60 * 45),
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
local projectileUtils = {}
|
||||
|
||||
|
||||
function projectileUtils.makeProjectile(attributes, attack)
|
||||
local n = attributes.name .. "-projectile-rampant"
|
||||
|
||||
@ -25,8 +24,9 @@ function projectileUtils.makeProjectile(attributes, attack)
|
||||
name = n,
|
||||
flags = {"not-on-map"},
|
||||
collision_box = attributes.attackCollisionBox or {{-0.025, -0.025}, {0.025, 0.025}},
|
||||
collision_mask = attributes.attackCollisionMask,
|
||||
hit_collision_mask = attributes.attackCollisionMask or {"player-layer", "train-layer", RampantGlobalVariables.projectileCollisionLayer},
|
||||
direction_only = attributes.attackDirectionOnly,
|
||||
hit_at_collision_position = true,
|
||||
piercing_damage = attributes.attackPiercingDamage or 0,
|
||||
acceleration = attributes.attackAcceleration or 0.000001,
|
||||
max_speed = math.min(math.max(attributes.scale*0.60, 0.4), 0.7),
|
||||
|
Loading…
Reference in New Issue
Block a user