Skip to content
Snippets Groups Projects

DieClonesDie!

Merged Hachem_Muche requested to merge Hachem_Muche/t-engine4:DieClonesDie into master
24 files
+ 308
505
Compare changes
  • Side-by-side
  • Inline
Files
24
@@ -69,6 +69,32 @@ end
function _M:setTarget(target)
end
--- cloneActor default alt_node fields (controls fields copied by cloneCustom)
-- modules should update this as needed
_M.clone_nodes = {player=false, x=false, y=false,
fov_computed=false, fov={v={actors={}, actors_dist={}}}, distance_map={v={}},
_mo=false, _last_mo=false, add_mos=false, add_displays=false,
shader=false, shader_args=false,
}
--- cloneActor default fields (merged by _M.cloneActor with cloneCustom)
-- modules may define this as a table to automatically merge into cloned actors
_M.clone_copy = nil
--- Special version of cloneFull that clones an Actor, automatically managing duplication of some fields
-- uses class.CloneCustom
-- @param[optional, type=?table] post_copy a table merged into the cloned actor
-- updated with self.clone_copy if it is defined
-- @param[default=self.clone_nodes, type=?table] alt_nodes a table containing parameters for cloneCustom
-- to be merged with self.clone_nodes
-- @return the cloned actor
function _M:cloneActor(post_copy, alt_nodes)
alt_nodes = table.merge(alt_nodes or {}, self.clone_nodes, true)
if post_copy or self.clone_copy then post_copy = post_copy or {} table.update(post_copy, self.clone_copy or {}, true) end
local a = self:cloneCustom(alt_nodes, post_copy)
a:removeAllMOs()
return a, post_copy
end
--- Setup minimap color for this entity
-- You may overload this method to customize your minimap
-- @param mo
Loading