]> git.lizzy.rs Git - Crafter.git/commitdiff
Add in sheep
authoroilboi <47129783+oilboi@users.noreply.github.com>
Fri, 5 Jun 2020 10:35:49 +0000 (06:35 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Fri, 5 Jun 2020 10:35:49 +0000 (06:35 -0400)
17 files changed:
mc_sound_attributes.txt
mods/mob/api/api_hook.lua
mods/mob/api/data_handling.lua
mods/mob/api/interaction.lua
mods/mob/init.lua
mods/mob/models/22i's blends/sheep.blend [new file with mode: 0644]
mods/mob/models/22i's blends/sheep.blend1 [new file with mode: 0644]
mods/mob/models/sheep.b3d
mods/mob/sounds/attributes.txt
mods/mob/sounds/sheep.1.ogg [new file with mode: 0644]
mods/mob/sounds/sheep.2.ogg [new file with mode: 0644]
mods/mob/sounds/sheep.3.ogg [new file with mode: 0644]
mods/mob/textures/sheep.png
mods/mob/textures/sheep_fur.png [deleted file]
mods/mob/textures/sheep_head_shaved.png [new file with mode: 0644]
mods/mob/textures/sheep_head_wool.png [new file with mode: 0644]
mods/mob/textures/sheep_wool.png [new file with mode: 0644]

index ce14f0e4b60a6a01410cca4aa0b744becd5011ce..32facb2d535f65b62859d03597ea890d4433f8b8 100644 (file)
@@ -398,3 +398,5 @@ LICENSED UNDER ATTRIBUTION 3.0 UNPORTED (CC BY 3.0)
 LICENSED UNDER ATTRIBUTION 3.0 UNPORTED (CC BY 3.0)
 "bd.wav" by altemark
 LICENSED UNDER ATTRIBUTION 3.0 UNPORTED (CC BY 3.0)
+"SheepAndLambs.mp3"
+Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0)
\ No newline at end of file
index dfccd54dcfeef315583ec0eb2aa3772a305a3abd..59b5c63128e9a4d3f5a1197edfabdbf11988378d 100644 (file)
@@ -132,6 +132,10 @@ mob_register.custom_on_death = def.custom_on_death
 
 mob_register.custom_on_activate = def.custom_on_activate
 
+mob_register.custom_on_punch = def.custom_on_punch
+
+mob_register.c_mob_data = def.c_mob_data
+
 if def.pathfinds then
        --mob_register.path = {}
        mob_register.pathfinding_timer = 0
@@ -155,7 +159,7 @@ mob_register.on_step = function(self, dtime,moveresult)
                self.custom_function_begin(self,dtime)
        end
        
-       self.collision_detection(self)
+       --self.collision_detection(self)
        if self.fall_damage then
                self.fall_damage(self)
        end
@@ -169,7 +173,7 @@ mob_register.on_step = function(self, dtime,moveresult)
                        self.custom_function(self,dtime,moveresult)
                end
 
-               self.move(self,dtime,moveresult)
+               --self.move(self,dtime,moveresult)
                
                --self.debug_nametag(self,dtime)
 
index cbc5d35f0e08c71c8a56de2fa464848cba731d1c..9afa35b9750d384f856ca028bce74b80905d30a4 100644 (file)
@@ -16,6 +16,7 @@ mobs.create_data_handling_functions = function(def,mob_register)
                        projectile_timer = self.projectile_timer,
                        scared = self.scared,
                        scared_timer = self.scared_timer,
+                       c_mob_data = self.c_mob_data,
                })
        end
 
@@ -42,7 +43,8 @@ mobs.create_data_handling_functions = function(def,mob_register)
                                self.punch_timer = data.punch_timer
                                self.projectile_timer = data.projectile_timer
                                self.scared = data.scared
-                               self.scared_timer = data.scared_timer
+                               self.scared_timer = data.scared_timer                           
+                               self.c_mob_data = data.c_mob_data
                        end
                end
                
@@ -59,6 +61,7 @@ mobs.create_data_handling_functions = function(def,mob_register)
                end
                self.is_mob = true
                self.object:set_armor_groups({immortal = 1})
+
                if self.custom_on_activate then
                        self.custom_on_activate(self)
                end
index 9776a61c7cd43a0b3042abcea2b7c7ee18244326..64b56081240287d43de568e858295ac5f6e5e318 100644 (file)
@@ -164,6 +164,9 @@ mobs.create_interaction_functions = function(def,mob_register)
                                        self.scared = true
                                        self.scared_timer = 10
                                end
+                               if self.custom_on_punch then
+                                       self.custom_on_punch(self)
+                               end
                        end
                        
                        --critical effect
index b581d2b31e4e57a2a67d2c971d962dbee58ae07a..bf15a464c604b6c4c5ac88e3b5b0fad18091289f 100644 (file)
@@ -84,8 +84,8 @@ mobs.register_mob(
         visual_size = {x = 3, y = 3},
         mesh = "sheep.b3d",
         textures = {
-                --blank out the first two to create adult pig
-               "nothing.png","sheep.png"
+               "sheep_head_wool.png","sheep_wool.png","sheep.png"
+               --"sheep_head_shaved.png","nothing.png","sheep.png"
         },
         
         --these are used to anchor a point to the head position
@@ -94,10 +94,10 @@ mobs.register_mob(
         -----
         head_bone = "head",
         debug_head_pos = false,
-        head_directional_offset = 0.5, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
-        head_height_offset = 0.8, --added to the base y position
+        head_directional_offset = 0.571, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
+        head_height_offset = 1.15, --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,3,-0.5),
+        head_position_correction = vector.new(0,4.1,-0.86),
         --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
         head_coord = "horizontal",
         -----
@@ -122,17 +122,33 @@ mobs.register_mob(
         ----
         death_rotation = "x",
         
-        hurt_sound = "pig",
-        die_sound = "pig_die",
+        hurt_sound = "sheep",
+        die_sound = "sheep",
         
         
         hostile = false,
         attacked_hostile = false,
         attack_type = "punch",
         group_attack = true,
-        --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
-        --explosion_power = 7, -- how big the explosion has to be
-        --explosion_time = 3, -- how long it takes for a mob to explode
+
+        c_mob_data = {sheared = false},
+
+        custom_on_activate = function(self)
+               --print(dump(self.c_mob_data))
+               if self.c_mob_data.sheared == true then
+                       self.object:set_properties({textures = {"sheep_head_shaved.png","nothing.png","sheep.png"}})
+               end
+        end,
+
+        custom_on_punch = function(self)
+               if self.c_mob_data.sheared == false then
+                       self.object:set_properties({textures = {"sheep_head_shaved.png","nothing.png","sheep.png"}})
+                       self.c_mob_data = {sheared=true}
+                       local pos = self.object:get_pos()
+                       pos.y = pos.y + 0.5
+                       minetest.throw_item(pos,{name="weather:snow_block"})
+               end
+       end
        }
 )
 
diff --git a/mods/mob/models/22i's blends/sheep.blend b/mods/mob/models/22i's blends/sheep.blend
new file mode 100644 (file)
index 0000000..8929a2e
Binary files /dev/null and b/mods/mob/models/22i's blends/sheep.blend differ
diff --git a/mods/mob/models/22i's blends/sheep.blend1 b/mods/mob/models/22i's blends/sheep.blend1
new file mode 100644 (file)
index 0000000..121a70c
Binary files /dev/null and b/mods/mob/models/22i's blends/sheep.blend1 differ
index 5381adf9c2b3e5e965d1bdb0aee1af15e38cf7a6..72ce83257fb42dc269dcca88dd480a201423030a 100644 (file)
Binary files a/mods/mob/models/sheep.b3d and b/mods/mob/models/sheep.b3d differ
index ae21d899254b1d97153eb677b4da68389a303589..77c3499d2457a124f6082cb613d1a2fa94845187 100644 (file)
@@ -7,4 +7,5 @@ slimedie2 https://freesound.org/people/Breviceps/sounds/445118/
 critical https://freesound.org/people/FunWithSound/sounds/361482/
 creeper hurt - https://freesound.org/people/adcbicycle/sounds/14199/
 spider - https://freesound.org/people/columbia23/sounds/395395/ Attribution 3.0 Unported (CC BY 3.0)
-chicken - https://freesound.org/people/Breviceps/sounds/456803/ cc0
\ No newline at end of file
+chicken - https://freesound.org/people/Breviceps/sounds/456803/ cc0
+sheep - https://freesound.org/people/acclivity/sounds/39947/ Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0)
\ No newline at end of file
diff --git a/mods/mob/sounds/sheep.1.ogg b/mods/mob/sounds/sheep.1.ogg
new file mode 100644 (file)
index 0000000..4225602
Binary files /dev/null and b/mods/mob/sounds/sheep.1.ogg differ
diff --git a/mods/mob/sounds/sheep.2.ogg b/mods/mob/sounds/sheep.2.ogg
new file mode 100644 (file)
index 0000000..af20634
Binary files /dev/null and b/mods/mob/sounds/sheep.2.ogg differ
diff --git a/mods/mob/sounds/sheep.3.ogg b/mods/mob/sounds/sheep.3.ogg
new file mode 100644 (file)
index 0000000..1f432e4
Binary files /dev/null and b/mods/mob/sounds/sheep.3.ogg differ
index 13496a3c510690d4b67a1ff2250c16140e8af352..fa55a7b4a6c240ddf892d139b83ea93f3ec62ab3 100644 (file)
Binary files a/mods/mob/textures/sheep.png and b/mods/mob/textures/sheep.png differ
diff --git a/mods/mob/textures/sheep_fur.png b/mods/mob/textures/sheep_fur.png
deleted file mode 100644 (file)
index 4c30c19..0000000
Binary files a/mods/mob/textures/sheep_fur.png and /dev/null differ
diff --git a/mods/mob/textures/sheep_head_shaved.png b/mods/mob/textures/sheep_head_shaved.png
new file mode 100644 (file)
index 0000000..88105fe
Binary files /dev/null and b/mods/mob/textures/sheep_head_shaved.png differ
diff --git a/mods/mob/textures/sheep_head_wool.png b/mods/mob/textures/sheep_head_wool.png
new file mode 100644 (file)
index 0000000..c3d223d
Binary files /dev/null and b/mods/mob/textures/sheep_head_wool.png differ
diff --git a/mods/mob/textures/sheep_wool.png b/mods/mob/textures/sheep_wool.png
new file mode 100644 (file)
index 0000000..4c30c19
Binary files /dev/null and b/mods/mob/textures/sheep_wool.png differ