From 5233a3aa6f20d59bb815371e495431258a389296 Mon Sep 17 00:00:00 2001 From: Kacper Kostka Date: Mon, 6 Feb 2023 05:22:35 +0100 Subject: [PATCH] . --- .../entities/sussy_imposter_entity.lua | 26 +++++++++++++++-- mods/amogus_generator/init.lua | 24 ++++++++++++++++ mods/amogus_items/init.lua | 28 +++++++++---------- 3 files changed, 62 insertions(+), 16 deletions(-) diff --git a/mods/amogus_entities/entities/sussy_imposter_entity.lua b/mods/amogus_entities/entities/sussy_imposter_entity.lua index 87a44cd..d8b1c93 100644 --- a/mods/amogus_entities/entities/sussy_imposter_entity.lua +++ b/mods/amogus_entities/entities/sussy_imposter_entity.lua @@ -166,7 +166,7 @@ local entity = { if math.random(10) == 1 then self.player:punch(self.object, 1.0, { full_punch_interval = 1.0, - damage_groups = {fleshy = 1}, + damage_groups = {fleshy = 5}, }, nil) end end @@ -278,4 +278,26 @@ local entity = { } -minetest.register_entity("amogus_entities:sussy_imposter", entity) \ No newline at end of file +minetest.register_entity("amogus_entities:sussy_imposter", entity) + +-- register spawn egg +minetest.register_craftitem("amogus_entities:sussy_imposter_spawn_egg", { + description = "Sussy Imposter Spawn Egg", + inventory_image = "amogus_entities_sussy_imposter_spawn_egg.png", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" then + return + end + + local pos = pointed_thing.above + local node = minetest.get_node(pos) + local def = minetest.registered_nodes[node.name] + if not def or not def.buildable_to then + return + end + + minetest.add_entity(pos, "amogus_entities:sussy_imposter") + itemstack:take_item() + return itemstack + end, +}) \ No newline at end of file diff --git a/mods/amogus_generator/init.lua b/mods/amogus_generator/init.lua index 1beeea1..78716d6 100644 --- a/mods/amogus_generator/init.lua +++ b/mods/amogus_generator/init.lua @@ -536,6 +536,30 @@ minetest.register_decoration({ schematic = "/schematics/STATUE_GIANT.mts", }) +minetest.register_abm({ + label = "Spawn Imposter", + nodenames = {"air"}, + neighbors = {"group:stone"}, + interval = 30, + chance = 100, + action = function(pos) + local light = minetest.get_node_light(pos) + local time = minetest.get_timeofday() + if light <= 12 and time >= 0.2 and time <= 0.8 then + local entities = minetest.get_objects_inside_radius(pos, 20) + local bat_count = 0 + for _, entity in pairs(entities) do + if entity:get_entity_name() == "amogus_entities:sussy_imposter" then + bat_count = bat_count + 1 + if bat_count >= 3 then + return + end + end + end + minetest.add_entity(pos, "amogus_entities:sussy_imposter") + end + end, +}) -- wtf is this?? diff --git a/mods/amogus_items/init.lua b/mods/amogus_items/init.lua index 5de098c..6029760 100644 --- a/mods/amogus_items/init.lua +++ b/mods/amogus_items/init.lua @@ -12,7 +12,7 @@ minetest.register_item(":", { -- Hand cracky = {times = {[1] = 1.0, [2] = 0.7, [3] = 0.5}, uses = 20, maxlevel = 1}, flower = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3}, }, - damage_groups = {fleshy = 1, snappy = 1, cracky=1}, + damage_groups = {fleshy = 0.5, snappy = 1, cracky=1}, } }) @@ -120,7 +120,7 @@ minetest.register_tool("amogus_items:lightsaber_blue", { groupcaps={ snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=0, maxlevel=3}, }, - damage_groups = {fleshy=10}, + damage_groups = {fleshy=1.01}, }, sound = {breaks = "amogus_sound"}, }) @@ -134,7 +134,7 @@ minetest.register_tool("amogus_items:lightsaber_red", { groupcaps={ snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=0, maxlevel=3}, }, - damage_groups = {fleshy=10}, + damage_groups = {fleshy=1.01}, }, sound = {breaks = "amogus_sound"}, @@ -149,7 +149,7 @@ minetest.register_tool("amogus_items:lightsaber_green", { groupcaps={ snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=0, maxlevel=3}, }, - damage_groups = {fleshy=10}, + damage_groups = {fleshy=1.01}, }, sound = {breaks = "amogus_sound"}, }) @@ -234,7 +234,7 @@ minetest.register_tool("amogus_items:stonepickaxe", { groupcaps={ stone={times={[1]=2.5, [2]=1.0, [3]=0.50}, uses=30, maxlevel=1}, }, - damage_groups = {fleshy=2}, + damage_groups = {fleshy=1.0}, }, sound = {breaks = "default_tool_breaks"}, }) @@ -247,7 +247,7 @@ minetest.register_tool("amogus_items:goldenpickaxe", { groupcaps={ stone={times={[1]=1.3, [2]=0.60, [3]=0.40}, uses=30, maxlevel=1}, }, - damage_groups = {fleshy=2}, + damage_groups = {fleshy=1.0}, }, sound = {breaks = "default_tool_breaks"}, }) @@ -260,7 +260,7 @@ minetest.register_tool("amogus_items:sussiumpickaxe", { groupcaps={ stone={times={[0.5]=2.0,[1]=0.85, [2]=0.40, [3]=0.20}, uses=30, maxlevel=1}, }, - damage_groups = {fleshy=2}, + damage_groups = {fleshy=1.0}, }, sound = {breaks = "default_tool_breaks"}, }) @@ -273,7 +273,7 @@ minetest.register_tool("amogus_items:goldenaxe", { groupcaps={ choppy={times={[1]=2.50, [2]=1.40, [3]=0.45}, uses=30, maxlevel=2}, }, - damage_groups = {fleshy=4}, + damage_groups = {fleshy=1.0}, }, groups = {flammable = 2} }) @@ -286,7 +286,7 @@ minetest.register_tool("amogus_items:stoneaxe", { groupcaps={ choppy={times={[1]=2.50, [2]=1.40, [3]=0.80}, uses=30, maxlevel=2}, }, - damage_groups = {fleshy=4}, + damage_groups = {fleshy=1.0}, }, groups = {flammable = 2} }) @@ -299,7 +299,7 @@ minetest.register_tool("amogus_items:sussiumaxe", { groupcaps={ choppy={times={[1]=0.90, [2]=0.80, [3]=0.35}, uses=30, maxlevel=2}, }, - damage_groups = {fleshy=4}, + damage_groups = {fleshy=1.0}, }, groups = {flammable = 2} @@ -314,7 +314,7 @@ minetest.register_tool("amogus_items:stoneshovel", { groupcaps={ crumbly={times={[1]=1.5, [2]=1.0, [3]=0.9}, uses=30, maxlevel=2}, }, - damage_groups = {fleshy=4}, + damage_groups = {fleshy=1.0}, }, groups = {flammable = 2} }) @@ -329,7 +329,7 @@ minetest.register_tool("amogus_items:goldenshovel", { groupcaps={ crumbly={times={[1]=1.0, [2]=0.8, [3]=0.6}, uses=30, maxlevel=2}, }, - damage_groups = {fleshy=4}, + -- damage_groups = {fleshy=1.0}, }, groups = {flammable = 2} }) @@ -342,7 +342,7 @@ minetest.register_tool("amogus_items:sussiumshovel", { groupcaps={ crumbly={times={[1]=0.8, [2]=0.6, [3]=0.35}, uses=30, maxlevel=2}, }, - damage_groups = {fleshy=4}, + --damage_groups = {fleshy=1.0}, }, groups = {flammable = 2} }) @@ -359,7 +359,7 @@ minetest.register_tool("amogus_items:obsussian_hammer", { stone={times={[0.5]=1.4,[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=1}, crumbly={times={[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=2}, }, - damage_groups = {fleshy=4}, + damage_groups = {fleshy=1.0}, }, groups = {flammable = 2}