Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

Commit

Permalink
Some balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Afforess committed Jun 24, 2016
1 parent b160c46 commit a9c5914
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libs/biter/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ function BiterBase.create_plan(base)
end
end

if math.random(100) > 75 and base:can_afford('harrassment') and base.targets then
local evo_factor = game.evolution_factor * 100

if evo_factor > 30 and math.random(100) > 80 and base:can_afford('harrassment') and base.targets then
local active_chunk = BiterBase.is_in_active_chunk(base)
if active_chunk then LogAI("Is in an active chunk: true", base) else LogAI("Is in an active chunk: false", base) end

Expand All @@ -266,7 +268,7 @@ function BiterBase.create_plan(base)
end
end

if math.random(100) > (game.evolution_factor * 100) and base:can_afford('attack_area') and base.targets then
if math.random(100) < evo_factor and base:can_afford('attack_area') and base.targets then
local active_chunk = BiterBase.is_in_active_chunk(base)
if active_chunk then LogAI("Is in an active chunk: true", base) else LogAI("Is in an active chunk: false", base) end

Expand Down Expand Up @@ -327,7 +329,7 @@ function BiterBase.create_entity(base, surface, entity_data)
if not base.entities then base.entities = {} end
table.insert(base.entities, entity)

local evo_cost = 0.000001 * game.entity_prototypes[entity_data.name].max_health
local evo_cost = 0.00000025 * game.entity_prototypes[entity_data.name].max_health
game.evolution_factor = game.evolution_factor - evo_cost

return entity
Expand All @@ -337,7 +339,7 @@ function BiterBase.destroy_entity(entity)
if not entity or not entity.valid then
return
end
local evo_cost = 0.000001 * game.entity_prototypes[entity.name].max_health
local evo_cost = 0.00000025 * game.entity_prototypes[entity.name].max_health
game.evolution_factor = game.evolution_factor + evo_cost
entity.destroy()
end
Expand Down

0 comments on commit a9c5914

Please sign in to comment.