mirror of
https://github.com/veden/Rampant.git
synced 2024-12-26 20:54:12 +02:00
biter spawn tables and friendly fire setting
This commit is contained in:
parent
c9dbf420d6
commit
05e5661bb2
@ -197,6 +197,11 @@ function upgrade.attempt(natives)
|
||||
game.surfaces[1].print("Rampant - Version 0.16.16")
|
||||
global.version = constants.VERSION_51
|
||||
end
|
||||
if (global.version < constants.VERSION_52) then
|
||||
|
||||
game.surfaces[1].print("Rampant - Version 0.16.17")
|
||||
global.version = constants.VERSION_52
|
||||
end
|
||||
|
||||
return starting ~= global.version, natives
|
||||
end
|
||||
|
@ -1,3 +1,10 @@
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.16.17
|
||||
Date: 2. 02. 2018
|
||||
Improvements:
|
||||
- Changed defualt for friendly fire to off for worm and spitter splash damage
|
||||
- Generating unit spawner probability for each variation and tier instead of sharing a single table
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.16.16
|
||||
Date: 1. 31. 2018
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name" : "Rampant",
|
||||
"factorio_version" : "0.16",
|
||||
"version" : "0.16.16",
|
||||
"version" : "0.16.17",
|
||||
"title" : "Rampant",
|
||||
"author" : "Veden",
|
||||
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",
|
||||
|
@ -14,9 +14,7 @@ local AI_STATE_NOCTURNAL = constants.AI_STATE_NOCTURNAL
|
||||
-- module code
|
||||
|
||||
function aiPredicates.canAttack(natives, surface)
|
||||
return (((natives.state == AI_STATE_AGGRESSIVE) or aiPredicates.canAttackDark(natives, surface))
|
||||
and not surface.peaceful_mode -- and (#natives.squads < natives.maxSquads)
|
||||
)
|
||||
return ((natives.state == AI_STATE_AGGRESSIVE) or aiPredicates.canAttackDark(natives, surface)) and not surface.peaceful_mode
|
||||
end
|
||||
|
||||
function aiPredicates.isDark(surface)
|
||||
|
@ -20,6 +20,7 @@ constants.VERSION_38 = 38
|
||||
constants.VERSION_41 = 41
|
||||
constants.VERSION_44 = 44
|
||||
constants.VERSION_51 = 51
|
||||
constants.VERSION_52 = 52
|
||||
|
||||
-- misc
|
||||
|
||||
|
@ -9038,6 +9038,7 @@ rampant-newEnemyUnitVariations=Unit Variations
|
||||
rampant-newEnemyUnitTiers=Unit Tiers
|
||||
rampant-enableBobsUnits=Enable Bobs as a faction
|
||||
rampant-enableNEUnits=Enable NE as a faction
|
||||
rampant-disallowFriendlyFire=Disallow Friendly Fire Splash Damage
|
||||
|
||||
[mod-setting-description]
|
||||
rampant-useDumbProjectiles=Turns off homing projectiles for worms and spitters
|
||||
@ -9075,3 +9076,4 @@ rampant-newEnemyUnitVariations=This number corresponds to the number of variatio
|
||||
rampant-newEnemyUnitTiers=This number corresponds to number of tiers. The higher the number the smoother the enemy power curve.
|
||||
rampant-enableBobsUnits=Adds bobs spawners, units, and worms to the base upgrade and placement list
|
||||
rampant-enableNEUnits=Adds NE spawners, units, and worms to the base upgrade and placement list
|
||||
rampant-disallowFriendlyFire=Prevents enemy spitters and worms from damaging units or buildings from the same force through splash damage
|
@ -298,17 +298,16 @@ end
|
||||
|
||||
function swarmUtils.buildUnitSpawner(templates, upgradeTable, attackGenerator, variations, tiers)
|
||||
|
||||
local unitSet = buildUnits(templates.unit,
|
||||
attackGenerator,
|
||||
upgradeTable.unit,
|
||||
variations.unit,
|
||||
tiers.unit)
|
||||
|
||||
for tier=1, tiers.unitSpawner do
|
||||
local t = ((tiers.unitSpawner == 5) and TIER_SET_5[tier]) or TIER_SET_10[tier]
|
||||
for i=1,variations.unitSpawner do
|
||||
local unitSpawner = deepcopy(templates.unitSpawner)
|
||||
unitSpawner.name = unitSpawner.name .. "-v" .. i .. "-t" .. t
|
||||
local unitSet = buildUnits(templates.unit,
|
||||
attackGenerator,
|
||||
upgradeTable.unit,
|
||||
variations.unit,
|
||||
tiers.unit)
|
||||
local unitTable = unitSetToProbabilityTable(upgradeTable.probabilityTable,
|
||||
unitSet)
|
||||
generateApperance(unitSpawner, t)
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
local streamUtils = require("StreamUtils")
|
||||
|
||||
-- constants
|
||||
|
||||
local DISALLOW_FRIENDLY_FIRE = settings.startup["rampant-disallowFriendlyFire"].value
|
||||
|
||||
-- imported functions
|
||||
|
||||
local makeStream = streamUtils.makeStream
|
||||
@ -15,6 +19,7 @@ function AttackBall.createAttackBall(attributes)
|
||||
local templateArea = {
|
||||
type = "area",
|
||||
radius = attributes.radius,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
{
|
||||
|
@ -3,14 +3,16 @@
|
||||
-- import
|
||||
|
||||
local streamUtils = require("StreamUtils")
|
||||
local colorUtils = require("ColorUtils")
|
||||
local fireUtils = require("FireUtils")
|
||||
local stickerUtils = require("StickerUtils")
|
||||
|
||||
-- constants
|
||||
|
||||
local DISALLOW_FRIENDLY_FIRE = settings.startup["rampant-disallowFriendlyFire"].value
|
||||
|
||||
-- imported functions
|
||||
|
||||
local makeStream = streamUtils.makeStream
|
||||
local makeColor = colorUtils.makeColor
|
||||
local makeSpreadEffect = fireUtils.makeSpreadEffect
|
||||
local makeFire = fireUtils.makeFire
|
||||
local makeSticker = stickerUtils.makeSticker
|
||||
@ -55,6 +57,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 3,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -111,6 +114,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 2,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -155,6 +159,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 2,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -182,6 +187,7 @@ data:extend({
|
||||
action =
|
||||
{
|
||||
type = "direct",
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -226,6 +232,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 3,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -253,6 +260,7 @@ data:extend({
|
||||
action =
|
||||
{
|
||||
type = "direct",
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -308,6 +316,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 3,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -352,6 +361,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 3,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -404,6 +414,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 3,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -475,6 +486,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 3,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
|
@ -7,6 +7,10 @@ local colorUtils = require("ColorUtils")
|
||||
local fireUtils = require("FireUtils")
|
||||
local stickerUtils = require("StickerUtils")
|
||||
|
||||
-- constants
|
||||
|
||||
local DISALLOW_FRIENDLY_FIRE = settings.startup["rampant-disallowFriendlyFire"].value
|
||||
|
||||
-- imported functions
|
||||
|
||||
local makeColor = colorUtils.makeColor
|
||||
@ -61,6 +65,7 @@ function attackFlame.createAttackFlame(attributes)
|
||||
{
|
||||
type = "area",
|
||||
radius = attributes.radius or 2.5,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
local streamUtils = require("StreamUtils")
|
||||
|
||||
-- constants
|
||||
|
||||
local DISALLOW_FRIENDLY_FIRE = settings.startup["rampant-disallowFriendlyFire"].value
|
||||
|
||||
-- imported functions
|
||||
|
||||
local makeStream = streamUtils.makeStream
|
||||
@ -84,6 +88,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 2,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -128,6 +133,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 1.5,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
@ -176,6 +182,7 @@ makeStream({
|
||||
{
|
||||
type = "area",
|
||||
radius = 2,
|
||||
force = (DISALLOW_FRIENDLY_FIRE and "enemy") or nil,
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
|
@ -630,6 +630,52 @@ function biterFunctions.createElectricAttack(attributes, electricBeam, animation
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
function biterFunctions.createRailAttack(attributes, railBeam, animation)
|
||||
return {
|
||||
type = "projectile",
|
||||
ammo_category = "railgun",
|
||||
cooldown = 3 * 60,
|
||||
movement_slow_down_factor = 0.6,
|
||||
projectile_creation_distance = 0.6,
|
||||
ammo_type = {
|
||||
category = "railgun",
|
||||
target_type = "direction",
|
||||
clamp_position = true,
|
||||
action =
|
||||
{
|
||||
type = "line",
|
||||
range = 50,
|
||||
width = attributes.width or 0.5,
|
||||
|
||||
source_effects =
|
||||
{
|
||||
type = "create-explosion",
|
||||
entity_name = railBeam or "railgun-beam"
|
||||
},
|
||||
action_delivery =
|
||||
{
|
||||
type = "instant",
|
||||
target_effects =
|
||||
{
|
||||
type = "damage",
|
||||
damage = { amount = attributes.damage or 100, type=attributes.damageType or "physical" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
animation = animation,
|
||||
range = 50,
|
||||
sound =
|
||||
{
|
||||
{
|
||||
filename = "__base__/sound/railgun.ogg",
|
||||
volume = 0.8
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function biterFunctions.createMeleeAttack(attributes)
|
||||
return
|
||||
{
|
||||
|
11
settings.lua
11
settings.lua
@ -334,8 +334,19 @@ data:extend({
|
||||
default_value = true,
|
||||
order = "b[modifier]-d[trigger]",
|
||||
per_user = false
|
||||
},
|
||||
|
||||
{
|
||||
type = "bool-setting",
|
||||
name = "rampant-disallowFriendlyFire",
|
||||
setting_type = "startup",
|
||||
default_value = true,
|
||||
order = "b[modifier]-e[trigger]",
|
||||
per_user = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
-- {
|
||||
-- type = "bool-setting",
|
||||
-- name = "rampant-reduceAnimations",
|
||||
|
Loading…
Reference in New Issue
Block a user