]> git.lizzy.rs Git - Crafter.git/blobdiff - mods/mob/init.lua
Implement first prototype of pathfinding
[Crafter.git] / mods / mob / init.lua
index 02ac50fd99a47394895416fe4842630a8b8ac849..13e285dff7a1713bb22e56ee0f84cc272f1216d8 100644 (file)
@@ -74,6 +74,67 @@ mobs.register_mob(
        }
 )
 
+
+mobs.register_mob(
+       {
+        mobname = "snowman",
+        physical = true,
+        collide_with_objects = false,
+        collisionbox = {-0.37, 0, -0.37, 0.37, 1.75, 0.37},
+        visual = "mesh",
+        visual_size = {x = 3, y = 3},
+        mesh = "snowman.b3d",
+        textures = {
+               "snowman.png","snowman.png","snowman.png","snowman.png","snowman.png","snowman.png",
+        },
+        
+        --these are used to anchor a point to the head position
+
+
+        -----
+        --head_bone = "head",
+        debug_head_pos = false,
+        head_directional_offset = 0, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
+        head_height_offset = 1.625, --added to the base y position
+        --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
+        head_position_correction = vector.new(0,4.6,0),
+        --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
+        head_coord = "vertical",
+        --rotational_correction = math.pi/2,
+        -----
+        
+        is_visible = true,
+        pointable = true,
+        automatic_face_movement_dir = 0,
+        automatic_face_movement_max_rotation_per_sec = 300,
+        makes_footstep_sound = false,
+        hp = 10,
+        gravity = {x = 0, y = -9.81, z = 0},
+        movement_type = "walk",
+        max_speed = 5,
+        state = 0,
+        view_distance = 15,
+        
+        item_drop = "weather:snowball", 
+        standing_frame = {x=0,y=0},
+        moving_frame = {x=0,y=0},
+        animation_multiplier = 10,
+        ----
+        ----
+        death_rotation = "x",
+        
+        hurt_sound = "wool",
+        die_sound = "wool",
+        
+        
+        hostile = true,
+        attack_type = "projectile",
+        projectile_type = "weather:snowball",
+        projectile_timer_cooldown = 1,
+
+       }
+)
+
 mobs.register_mob(
        {
         mobname = "phyg",
@@ -212,7 +273,7 @@ mobs.register_mob(
        automatic_face_movement_dir = 90,
        automatic_face_movement_max_rotation_per_sec = 300,
        makes_footstep_sound = false,
-       hp = 40,
+       hp = 32,
        gravity = {x = 0, y = -9.81, z = 0},
        movement_type = "jump",
        make_jump_noise = true,
@@ -250,7 +311,7 @@ mobs.register_mob(
        automatic_face_movement_dir = 90,
        automatic_face_movement_max_rotation_per_sec = 300,
        makes_footstep_sound = false,
-       hp = 20,
+       hp = 10,
        gravity = {x = 0, y = -9.81, z = 0},
        movement_type = "jump",
        make_jump_noise = true,
@@ -289,7 +350,7 @@ mobs.register_mob(
        automatic_face_movement_dir = 90,
        automatic_face_movement_max_rotation_per_sec = 300,
        makes_footstep_sound = false,
-       hp = 5,
+       hp = 4,
        gravity = {x = 0, y = -9.81, z = 0},
        movement_type = "jump",
        make_jump_noise = true,
@@ -437,10 +498,10 @@ mobs.register_mob(
         pointable = true,
         automatic_face_movement_max_rotation_per_sec = 300,
         makes_footstep_sound = false,
-        hp = 40,
+        hp = 27,
         gravity = {x = 0, y = -9.81, z = 0},
         movement_type = "walk",
-        max_speed = 4,
+        max_speed = 5.5,
         hostile = true,
         hostile_cooldown = false,
         state = 0,
@@ -476,8 +537,8 @@ mobs.register_mob(
         --projectile_timer_cooldown = 5,
         --projectile_type = "tnt:tnt",
         
-        explosion_radius = 3, -- how far away the mob has to be to initialize the explosion
-        explosion_power = 7, -- how big the explosion has to be
+        explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
+        explosion_power = 4, -- how big the explosion has to be
         explosion_time = 3, -- how long it takes for a mob to explode
         
         die_in_light = false,
@@ -503,7 +564,7 @@ mobs.register_mob(
         pointable = true,
         automatic_face_movement_max_rotation_per_sec = 300,
         makes_footstep_sound = false,
-        hp = 70,
+        hp = 40,
         gravity = {x = 0, y = -9.81, z = 0},
         movement_type = "walk",
         max_speed = 9,
@@ -569,8 +630,6 @@ mobs.register_mob(
         },
         
         --these are used to anchor a point to the head position
-
-
         -----
         head_bone = "body.head",
         debug_head_pos = false,
@@ -588,10 +647,10 @@ mobs.register_mob(
         automatic_face_movement_dir = 90,
         automatic_face_movement_max_rotation_per_sec = 300,
         makes_footstep_sound = false,
-        hp = 10,
+        hp = 30,
         gravity = {x = 0, y = -9.81, z = 0},
         movement_type = "walk",
-        max_speed = 5,
+        max_speed = 6,
         state = 0,
         view_distance = 15,
         
@@ -603,12 +662,15 @@ mobs.register_mob(
         ----
         death_rotation = "z",
         
-        hurt_sound = "pig",
-        die_sound = "pig_die",
+        hurt_sound = "spider",
+        die_sound = "spider_die",
         
         
+        pathfinds = true,
+
         hostile = true,
-        attacked_hostile = false,
+        friendly_in_daylight = true,
+        attacked_hostile = true,
         attack_type = "punch",
         group_attack = true,
         --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion