diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index b1c6d293d9..4313c29ce0 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -185,13 +185,13 @@ ______ _ _ _______ _ _ -- state switching logic (stand, walk, run, attacks) -local fly_state_list_wandering = {"stand", "walk"} +local fly_state_list_wandering = {"stand", "fly"} local fly_state_switch = function(self, dtime) self.state_timer = self.state_timer - dtime if self.wandering and self.state_timer <= 0 then self.state_timer = math.random(4,10) + math.random() - self.state = land_state_list_wandering[math.random(1,#land_state_list_wandering)] + self.state = fly_state_list_wandering[math.random(1,#fly_state_list_wandering)] end end @@ -200,13 +200,38 @@ end local fly_state_execution = function(self,dtime) + local pos = self.object:get_pos() + local current_node = minetest_get_node(pos).name + local inside_swim_node = false + + for _,id in pairs(self.fly_in) do + if id == current_node then + inside_swim_node = true + break + end + end + + print(inside_swim_node) + + if self.state == "stand" then + + --do animation + --mobs.set_mob_animation(self, "stand") + + --set the velocity of the mob + --mobs.set_velocity(self,0) + + --print("standing") + + elseif self.state == "fly" then + + + --print("flying") + + end end -local fly_state_switch = function(self, dtime) - - -end --[[ ___ ___ _ _ _ diff --git a/mods/ENTITIES/mobs_mc/0_gameconfig.lua b/mods/ENTITIES/mobs_mc/0_gameconfig.lua index c92ccbba52..3476bee4c7 100644 --- a/mods/ENTITIES/mobs_mc/0_gameconfig.lua +++ b/mods/ENTITIES/mobs_mc/0_gameconfig.lua @@ -81,7 +81,9 @@ mobs_mc.items = { gunpowder = "tnt:gunpowder", flint_and_steel = "fire:flint_and_steel", water_source = "default:water_source", + water_flowing = "default:water_flowing", river_water_source = "default:river_water_source", + water_flowing = "default:river_water_flowing", black_dye = "dye:black", poppy = "flowers:rose", dandelion = "flowers:dandelion_yellow", diff --git a/mods/ENTITIES/mobs_mc/squid.lua b/mods/ENTITIES/mobs_mc/squid.lua index cf794ea5bf..fbec650ddb 100644 --- a/mods/ENTITIES/mobs_mc/squid.lua +++ b/mods/ENTITIES/mobs_mc/squid.lua @@ -48,7 +48,7 @@ mobs:register_mob("mobs_mc:squid", { visual_size = {x=3, y=3}, makes_footstep_sound = false, fly = true, - fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source }, + fly_in = { mobs_mc.items.water_source, "mcl_core:water_flowing", mobs_mc.items.river_water_source }, breathes_in_water = true, jump = false, view_range = 16,