mirror of
https://github.com/veden/Rampant.git
synced 2024-12-28 21:08:22 +02:00
need to finish faction selection on damage
This commit is contained in:
parent
e88c4ef1ec
commit
5450359cfe
@ -3,6 +3,7 @@ Factorio Mod - Improves the enemies tactics by using potential fields/pheromones
|
||||
|
||||
# Forum Post
|
||||
|
||||
https://mod.factorio.com/veden/Rampant
|
||||
https://forums.factorio.com/viewtopic.php?f=94&t=31445
|
||||
|
||||
# Notes
|
||||
|
@ -16,6 +16,8 @@ local FACTION_MUTATION_MAPPING = constants.FACTION_MUTATION_MAPPING
|
||||
|
||||
local MAGIC_MAXIMUM_NUMBER = constants.MAGIC_MAXIMUM_NUMBER
|
||||
|
||||
local FACTIONS_BY_DAMAGE_TYPE = constants.FACTIONS_BY_DAMAGE_TYPE
|
||||
|
||||
local BASE_AI_STATE_ACTIVE = constants.BASE_AI_STATE_ACTIVE
|
||||
local BASE_AI_STATE_MUTATE = constants.BASE_AI_STATE_MUTATE
|
||||
|
||||
@ -333,22 +335,25 @@ end
|
||||
local function pickMutationFromDamageType(map, damageType, roll, base)
|
||||
local baseAlignment = base.alignment
|
||||
|
||||
if (damageType == "physical") then
|
||||
|
||||
elseif (damageType == "impact") then
|
||||
|
||||
elseif (damageType == "poison") then
|
||||
|
||||
elseif (damageType == "explosion") then
|
||||
|
||||
elseif (damageType == "fire") then
|
||||
|
||||
elseif (damageType == "laser") then
|
||||
|
||||
elseif (damageType == "acid") then
|
||||
|
||||
elseif (damageType == "electric") then
|
||||
local damageFactions = FACTIONS_BY_DAMAGE_TYPE[damageType]
|
||||
|
||||
if (damageFactions) then
|
||||
if baseAlignment[2] then
|
||||
if (roll < 0.05) then
|
||||
baseAlignment[2] = nil
|
||||
baseAlignment[1] = damageFactions[math.random(#damageFactions)]
|
||||
elseif (roll < 0.25) then
|
||||
baseAlignment[1] = damageFactions[math.random(#damageFactions)]
|
||||
else
|
||||
baseAlignment[2] = damageFactions[math.random(#damageFactions)]
|
||||
end
|
||||
else
|
||||
if (roll < 0.85) then
|
||||
base.alignment[1] = damageFactions[math.random(#damageFactions)]
|
||||
else
|
||||
base.alignment[2] = damageFactions[math.random(#damageFactions)]
|
||||
end
|
||||
end
|
||||
else
|
||||
if baseAlignment[2] then
|
||||
if (roll < 0.05) then
|
||||
|
@ -472,6 +472,33 @@ for tier=1, 10 do
|
||||
end
|
||||
end
|
||||
|
||||
constants.FACTIONS_BY_DAMAGE_TYPE = {
|
||||
["physical"] = {
|
||||
|
||||
},
|
||||
["impact"] = {
|
||||
|
||||
},
|
||||
["poison"] = {
|
||||
|
||||
},
|
||||
["explosion"] = {
|
||||
|
||||
},
|
||||
["fire"] = {
|
||||
|
||||
},
|
||||
["laser"] = {
|
||||
|
||||
},
|
||||
["acid"] = {
|
||||
|
||||
},
|
||||
["electric"] = {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
constants.FACTION_SET = {}
|
||||
|
||||
constants.FACTION_SET[#constants.FACTION_SET+1] = {
|
||||
|
Loading…
Reference in New Issue
Block a user