]> git.lizzy.rs Git - killaura.git/commitdiff
Initial Commit
authorElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 11 Dec 2020 16:50:01 +0000 (17:50 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 11 Dec 2020 16:50:01 +0000 (17:50 +0100)
README [new file with mode: 0644]
init.lua [new file with mode: 0644]
mod.conf [new file with mode: 0644]
settingtypes.txt [new file with mode: 0644]

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..b787bd8
--- /dev/null
+++ b/README
@@ -0,0 +1,2 @@
+# killaura 
+A dragonfire CSM that add Killaura and ForceField
diff --git a/init.lua b/init.lua
new file mode 100644 (file)
index 0000000..a63c59b
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,29 @@
+minetest.register_globalstep(function(dtime)
+       local player = minetest.localplayer
+       if not player then return end
+       local control = player:get_control()
+       if minetest.settings:get_bool("killaura") or minetest.settings:get_bool("forcefield") and control.dig then
+               local friendlist = minetest.settings:get("friendlist"):split(",")
+               for _, obj in ipairs(minetest.get_objects_inside_radius(player:get_pos(), 5)) do
+                       local do_attack = true
+                       if obj:is_local_player() then
+                               do_attack = false
+                       else
+                               for _, friend in ipairs(friendlist) do
+                                       if obj:get_name() == friend or obj:get_nametag() == friend then
+                                               do_attack = false
+                                               break
+                                       end
+                               end
+                       end
+                       if do_attack then
+                               obj:punch()
+                       end
+               end
+       end
+end)
+minetest.register_list_command("friend", "Configure Friend List (friends dont get attacked by Killaura or Forcefield)", "friendlist")
+
+minetest.register_cheat("Killaura", "Combat", "killaura")
+minetest.register_cheat("ForceField", "Combat", "forcefield")
diff --git a/mod.conf b/mod.conf
new file mode 100644 (file)
index 0000000..4d182b2
--- /dev/null
+++ b/mod.conf
@@ -0,0 +1,3 @@
+name = killaura
+author = Fleckenstein
+description = A dragonfire CSM that add Killaura and ForceField
diff --git a/settingtypes.txt b/settingtypes.txt
new file mode 100644 (file)
index 0000000..18d9a13
--- /dev/null
@@ -0,0 +1,3 @@
+killaura (Killaura) bool false
+forcefield (ForceField) bool false
+friendlist (Friend List) string