Skip to content

Instantly share code, notes, and snippets.

@rubenwardy
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubenwardy/76c11fdbfe06d5f29a44 to your computer and use it in GitHub Desktop.
Save rubenwardy/76c11fdbfe06d5f29a44 to your computer and use it in GitHub Desktop.
code golf minetest mod 1
_=minetest;h={"get_objects_inside_radius","get_player_name","set_hp","get_hp","remove_node"};_.register_node("t:s",{});_.register_abm({nodenames={"t:s"},interval=0.2,chance=1,action=function(p) local o=_.env[h[1]](_.env,p,2);for k,b in pairs(o) do if b and b[h[2]] and b[h[2]](b)~=nil then b[h[3]](b,b[h[4]](b)-30); for d=-5,5 do for c=-5,5 do for a=-5,5 do if d*d+c*c+a*a<=30 then _.env[h[5]](_.env,{x=p.x+d,y=p.y+c,z=p.z+a}) end end end end _.env[h[5]](_.env,p);break; end end end })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment