summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorRubenwardy <anjayward@gmail.com>2013-02-23 15:13:21 +0000
committerRubenwardy <anjayward@gmail.com>2013-02-23 15:13:21 +0000
commit4cf05cbc47b5ddab616170097673947d69e93a29 (patch)
tree345fc723d8a7797e2021b577578e9996b4065805 /api.lua
parent6b031a601d7ba394b61bcbce73c569a74625a913 (diff)
add onDeath
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/api.lua b/api.lua
index 6b51195..b80b797 100644
--- a/api.lua
+++ b/api.lua
@@ -46,6 +46,12 @@ function awards.register_achievement(name,data_table)
target=data_table['trigger']['target'],
}
table.insert(awards.onPlace,tmp)
+ elseif data_table['trigger']['type']=="death" then
+ local tmp={
+ award=name,
+ target=data_table['trigger']['target'],
+ }
+ table.insert(awards.onDeath,tmp)
end
end
@@ -60,6 +66,10 @@ function awards.register_onPlace(func)
table.insert(awards.onPlace,func);
end
+function awards.register_onDeath(func)
+ table.insert(awards.onDeath,func);
+end
+
function awards.give_achievement(name,award)
local data=player_data[name]