diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:44:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:44:42 +0100 |
commit | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (patch) | |
tree | c980d614fec4a5495798be3e79e033229062c3cd /builtin/client/cheats | |
parent | 28f6a79706b088c37268a59d90878220dc4ef9c7 (diff) | |
parent | 3af10766fd2b58b068e970266724d7eb10e9316b (diff) | |
download | dragonfireclient-5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'builtin/client/cheats')
-rw-r--r-- | builtin/client/cheats/chat.lua | 35 | ||||
-rw-r--r-- | builtin/client/cheats/combat.lua | 28 | ||||
-rw-r--r-- | builtin/client/cheats/init.lua | 11 | ||||
-rw-r--r-- | builtin/client/cheats/inventory.lua | 48 | ||||
-rw-r--r-- | builtin/client/cheats/world.lua | 17 |
5 files changed, 125 insertions, 14 deletions
diff --git a/builtin/client/cheats/chat.lua b/builtin/client/cheats/chat.lua index 1b8094768..0763909df 100644 --- a/builtin/client/cheats/chat.lua +++ b/builtin/client/cheats/chat.lua @@ -6,3 +6,38 @@ core.register_on_receiving_chat_message(function(message) return true end end) + +function core.send_colorized(message) + local starts_with = message:sub(1, 1) + + if starts_with == "/" or starts_with == "." then return end + + local reverse = core.settings:get_bool("chat_reverse") + + if reverse then + local msg = "" + for i = 1, #message do + msg = message:sub(i, i) .. msg + end + message = msg + end + + local use_chat_color = core.settings:get_bool("use_chat_color") + local color = core.settings:get("chat_color") + + if use_chat_color and color then + local msg + if color == "rainbow" then + msg = core.rainbow(message) + else + msg = core.colorize(color, message) + end + message = msg + end + + core.send_chat_message(message) + return true +end + +core.register_on_sending_chat_message(core.send_colorized) + diff --git a/builtin/client/cheats/combat.lua b/builtin/client/cheats/combat.lua index b497c6c1b..4904d8c52 100644 --- a/builtin/client/cheats/combat.lua +++ b/builtin/client/cheats/combat.lua @@ -2,7 +2,9 @@ local placed_crystal local switched_to_totem = 0 local used_sneak = true local totem_move_action = InventoryAction("move") -totem_move_action:to("current_player", "main", 8) +totem_move_action:to("current_player", "main", 9) + +core.register_list_command("friend", "Configure Friend List (friends dont get attacked by Killaura or Forcefield)", "friendlist") core.register_globalstep(function(dtime) local player = core.localplayer @@ -10,7 +12,25 @@ core.register_globalstep(function(dtime) local control = player:get_control() local pointed = core.get_pointed_thing() local item = player:get_wielded_item():get_name() - if core.settings:get_bool("crystal_pvp") then + if core.settings:get_bool("killaura") or core.settings:get_bool("forcefield") and control.LMB then + local friendlist = core.settings:get("friendlist"):split(",") + for _, obj in ipairs(core.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 + elseif core.settings:get_bool("crystal_pvp") then if placed_crystal then if core.switch_to_item("mobs_mc:totem") then switched_to_totem = 5 @@ -48,9 +68,9 @@ core.register_globalstep(function(dtime) if totem_stack and totem_stack:get_name() ~= "mobs_mc:totem" then local totem_index = core.find_item("mobs_mc:totem") if totem_index then - totem_move_action:from("current_player", "main", totem_index - 1) + totem_move_action:from("current_player", "main", totem_index) totem_move_action:apply() - player:set_wield_index(8) + player:set_wield_index(9) end end end diff --git a/builtin/client/cheats/init.lua b/builtin/client/cheats/init.lua index a7be83cee..03fc20c60 100644 --- a/builtin/client/cheats/init.lua +++ b/builtin/client/cheats/init.lua @@ -1,6 +1,7 @@ core.cheats = { ["Combat"] = { ["Killaura"] = "killaura", + ["Forcefield"] = "forcefield", ["AntiKnockback"] = "antiknockback", ["FastHit"] = "spamclick", ["AttachmentFloat"] = "float_above_parent", @@ -26,6 +27,7 @@ core.cheats = { ["Coords"] = "coords", ["Tracers"] = "enable_tracers", ["ESP"] = "enable_esp", + ["CheatHUD"] = "cheat_hud", }, ["World"] = { ["FastDig"] = "fastdig", @@ -37,7 +39,8 @@ core.cheats = { ["ScaffoldPlus"] = "scaffold_plus", ["BlockWater"] = "block_water", ["PlaceOnTop"] = "autotnt", - ["Replace"] = "replace" + ["Replace"] = "replace", + ["Nuke"] = "nuke", }, ["Exploit"] = { ["EntitySpeed"] = "entity_speed", @@ -54,7 +57,9 @@ core.cheats = { }, ["Chat"] = { ["IgnoreStatus"] = "ignore_status_messages", - ["Deathmessages"] = "mark_deathmessages" + ["Deathmessages"] = "mark_deathmessages", + ["ColoredChat"] = "use_chat_color", + ["ReversedChat"] = "chat_reverse", }, ["Inventory"] = { ["AutoEject"] = "autoeject", @@ -62,6 +67,8 @@ core.cheats = { ["Enderchest"] = function() core.open_enderchest() end, ["HandSlot"] = function() core.open_handslot() end, ["NextItem"] = "next_item", + ["Strip"] = "strip", + ["AutoRefill"] = "autorefill", } } diff --git a/builtin/client/cheats/inventory.lua b/builtin/client/cheats/inventory.lua index faa7d1c0e..b9943f507 100644 --- a/builtin/client/cheats/inventory.lua +++ b/builtin/client/cheats/inventory.lua @@ -2,15 +2,48 @@ local elapsed_time = 0 local tick_time = 0.05 local drop_action = InventoryAction("drop") +local strip_move_act = InventoryAction("move") +strip_move_act:to("current_player", "craft", 1) +local strip_craft_act = InventoryAction("craft") +strip_craft_act:craft("current_player") +local strip_move_back_act = InventoryAction("move") +strip_move_back_act:from("current_player", "craftresult", 1) + core.register_globalstep(function(dtime) + local player = core.localplayer + if not player then return end + local item = player:get_wielded_item() + local itemdef = core.get_item_def(item:get_name()) + local wieldindex = player:get_wield_index() + -- AutoRefill + if core.settings:get_bool("autorefill") and itemdef then + local space = item:get_free_space() + local i = core.find_item(item:get_name(), wieldindex + 1) + if i and space > 0 then + local move_act = InventoryAction("move") + move_act:to("current_player", "main", wieldindex) + move_act:from("current_player", "main", i) + move_act:set_count(space) + move_act:apply() + end + end + -- Strip + if core.settings:get_bool("strip") then + if itemdef and itemdef.groups.tree and player:get_control().RMB then + strip_move_act:from("current_player", "main", wieldindex) + strip_move_back_act:to("current_player", "main", wieldindex) + strip_move_act:apply() + strip_craft_act:apply() + strip_move_back_act:apply() + end + end -- AutoEject if core.settings:get_bool("autoeject") then - local player = core.localplayer local list = (core.settings:get("eject_items") or ""):split(",") local inventory = core.get_inventory("current_player") for index, stack in pairs(inventory.main) do if table.indexof(list, stack:get_name()) ~= -1 then - drop_action:from("current_player", "main", index - 1) + drop_action:from("current_player", "main", index) drop_action:apply() end end @@ -19,12 +52,8 @@ core.register_globalstep(function(dtime) if core.settings:get_bool("next_item") then elapsed_time = elapsed_time + dtime if elapsed_time < tick_time then return end - local player = minetest.localplayer - if not player then return end - local item = player:get_wielded_item() if item:get_count() == 0 then - local index = player:get_wield_index() - player:set_wield_index(index + 1) + player:set_wield_index(wieldindex + 1) end elapsed_time = 0 end @@ -62,7 +91,7 @@ core.register_on_punchnode(function(pos, node) for index, stack in pairs(inventory.main) do is_better, best_time = check_tool(stack, node_groups, best_time) if is_better then - new_index = index - 1 + new_index = index end end player:set_wield_index(new_index) @@ -113,3 +142,6 @@ local hand_formspec = "size[9,8.75]".. function core.open_handslot() minetest.show_formspec("__builtin__:hand", hand_formspec) end + + + diff --git a/builtin/client/cheats/world.lua b/builtin/client/cheats/world.lua index 5b97b206b..6cbdd67fc 100644 --- a/builtin/client/cheats/world.lua +++ b/builtin/client/cheats/world.lua @@ -48,6 +48,23 @@ core.register_globalstep(function(dtime) end end end + if core.settings:get_bool("nuke") then + local i = 0 + for x = pos.x - 5, pos.x + 5 do + for y = pos.y - 5, pos.y + 5 do + for z = pos.z - 5, pos.z + 5 do + local p = vector.new(x, y, z) + local node = core.get_node_or_nil(p) + local def = node and core.get_node_def(node.name) + if def and def.diggable then + if i > nodes_per_tick then return end + core.dig_node(p) + i = i + 1 + end + end + end + end + end end) |