diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-09 20:46:56 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-10 11:28:13 +0200 |
commit | 8db89b8136686a5721080d18e8a14f03404aa095 (patch) | |
tree | a6a87bc6a50b9ab2030930faae35ed22814c7669 /data/mods | |
parent | 8c01ad8a9da86fc76bc9a180ccab10ede726625a (diff) | |
download | minetest-8db89b8136686a5721080d18e8a14f03404aa095.tar.gz minetest-8db89b8136686a5721080d18e8a14f03404aa095.tar.bz2 minetest-8db89b8136686a5721080d18e8a14f03404aa095.zip |
LuaEntity armor groups
Diffstat (limited to 'data/mods')
-rw-r--r-- | data/mods/default/init.lua | 1 | ||||
-rw-r--r-- | data/mods/experimental/init.lua | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua index bcd633b34..5ffed25ff 100644 --- a/data/mods/default/init.lua +++ b/data/mods/default/init.lua @@ -225,6 +225,7 @@ -- - select_horiz_by_yawpitch=false) -- - ^ Select sprite from spritesheet with optional animation and DM-style -- - texture selection based on yaw relative to camera +-- - set_armor_groups({group1=rating, group2=rating, ...}) -- - get_entity_name() (DEPRECATED: Will be removed in a future version) -- - get_luaentity() -- Player-only: (no-op for other objects) diff --git a/data/mods/experimental/init.lua b/data/mods/experimental/init.lua index ddc89f92c..c37488d04 100644 --- a/data/mods/experimental/init.lua +++ b/data/mods/experimental/init.lua @@ -330,6 +330,7 @@ function TNT:on_activate(staticdata) self.object:setvelocity({x=0, y=4, z=0}) self.object:setacceleration({x=0, y=-10, z=0}) self.object:settexturemod("^[brighten") + self.object:set_armor_groups({foo=1,bar=2}) end -- Called periodically @@ -355,7 +356,7 @@ function TNT:on_punch(hitter) if self.health <= 0 then self.object:remove() hitter:get_inventory():add_item("main", "experimental:tnt") - hitter:set_hp(hitter:get_hp() - 1) + --hitter:set_hp(hitter:get_hp() - 1) end end |