Navigation Menu

Skip to content

Commit

Permalink
Balance
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelovesrobots committed Jul 28, 2011
1 parent 4499f7e commit 041bfb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions game.lua
Expand Up @@ -72,8 +72,6 @@ function Game:start_new_game()
self:generate_sector()
self:level_up()
self:level_up()
self:level_up()
self:level_up()
end

function Game:level_up()
Expand Down Expand Up @@ -464,7 +462,7 @@ function Game:draw_stats()

local stats = {
text_indicator("Health", self.sector.player.health, self.sector.player.max_health),
text_indicator(" Food", 10, 20),
text_indicator(" Water", 10, 20),
text_indicator(" XP", self.sector.player.xp, self.sector.player.max_xp),
}

Expand Down Expand Up @@ -686,12 +684,13 @@ end
function cache_attributes(entity)
table.each({'armor', 'muscle', 'speed', 'mind'}, function (attribute)
entity[attribute] = sum_descent(entity.base_part, attribute)
debug(attribute .. " is now " .. entity[attribute])
end)
end

function sum_descent(part, attribute)
local sum = part[attribute]
table.each(part.contains, function(other) sum = sum + other[attribute] end)
table.each(part.contains, function(other) sum = sum + sum_descent(other, attribute) end)
return sum
end

Expand Down
6 changes: 2 additions & 4 deletions library/entities.json
Expand Up @@ -6,8 +6,7 @@
"allegiance" : "railors",
"max_health" : 10,
"health" : 10,
"ai" : "hostile",
"muscle" : 3
"ai" : "hostile"
},

"bruiser": {
Expand All @@ -17,8 +16,7 @@
"allegiance" : "bauntisaurs",
"max_health" : 10,
"health" : 10,
"ai" : "hostile",
"muscle" : 5
"ai" : "hostile"
},

"player": {
Expand Down

0 comments on commit 041bfb6

Please sign in to comment.