Skip to content

Commit

Permalink
count monsters not killed on completed levels
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopper262 committed Aug 20, 2015
1 parent 06716ec commit 46a2e65
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Plugins/Marathon Stats/stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ function Triggers.cleanup()
stats["end tick"] = Game.ticks
if Level.completed then
stats["level completed"] = 1
-- calculate saved bobs for M1
stats["bobs saved"] = 0

-- count monsters left alive on map
for m in Monsters() do
if m.type.class == "bob" and m.vitality > 0 then
increment("bobs saved");
end
if not m.player and (m.vitality > 0 or not m.visible) then
increment(monster.type.mnemonic .. "s spared")
-- calculate saved bobs for M1
if m.type.class == "bob" and m.vitality > 0 then
increment("bobs saved")
end
end
end
end

Expand Down

0 comments on commit 46a2e65

Please sign in to comment.