mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
LuaEntity armor groups
This commit is contained in:
parent
8c01ad8a9d
commit
8db89b8136
7 changed files with 67 additions and 6 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue