From ceb16277fb15b8e5d319c91db1e0246a8fb9e4bb Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 27 Nov 2011 05:09:41 +0100 Subject: [PATCH] world::move_idle_cost: Introduce, based on attr.move --- agent.cc | 1 + world.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/agent.cc b/agent.cc index cb06493..7a10765 100644 --- a/agent.cc +++ b/agent.cc @@ -114,6 +114,7 @@ agent::on_tick(void) if (!dead) { chenergy(world::sun_energy); + chenergy(attr.move * world::move_idle_cost); } else { energy += world::dead_decay; diff --git a/world.h b/world.h index b2266fd..a8e0687 100644 --- a/world.h +++ b/world.h @@ -6,6 +6,8 @@ struct world { const static int move_cost = -50; const static int attack_cost = -400; const static int defense_cost = -200; + + const static int move_idle_cost = -15; /* ... * attr.move */ const static int sun_energy = 10; const static int dead_body_energy = 2000;