tidied code, added pet scorpion.

master
NathanSalapat 2019-08-05 09:35:04 -05:00
parent 083161e570
commit 3e123fcef9
7 changed files with 188 additions and 128 deletions

81
big.lua
View File

@ -1,46 +1,47 @@
mobs:register_mob("scorpion:big", {
type = "monster",
passive = false,
attack_type = "dogfight",
damage = 15,
hp_min = 50, hp_max = 100, armor = 30,
collisionbox = {-1.2, -.6, -1, 1.2, 0.6, 1},
visual = "mesh",
mesh = "scorpion.b3d",
drawtype = "front",
textures = {
{"scorpion_red.png"},
{"scorpion_green.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=13,y=13},
makes_footstep_sound = true,
mobs:register_mob('scorpion:big', {
type = 'monster',
passive = false,
attack_type = 'dogfight',
damage = 15,
hp_min = 50, hp_max = 100, armor = 30,
collisionbox = {-1.2, -.6, -1, 1.2, 0.6, 1},
visual = 'mesh',
mesh = 'scorpion.b3d',
drawtype = 'front',
textures = {
{'scorpion_red.png'},
{'scorpion_green.png'},
{'scorpion_tan.png'},
},
blood_texture = 'mobs_blood.png',
visual_size = {x=13,y=13},
makes_footstep_sound = true,
sounds = {
war_cry = "scorpion_squeak",
},
war_cry = 'scorpion_squeak',
},
walk_velocity = .5,
run_velocity = 2,
jump = true,
stepheight = 2.2,
run_velocity = 2,
jump = true,
stepheight = 2.2,
reach = 4,
view_range = 4,
view_range = 8,
fear_height = 5,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 5, max = 20},
},
water_damage = 1,
lava_damage = 20,
light_damage = 0,
animation = {
speed_normal = 15, speed_run = 15,
stand_start = 0, stand_end = 60,
walk_start = 150, walk_end = 210,
run_start = 150, run_end = 210,
punch_start = 220, punch_end = 260,
punch2_start = 265, punch2_end = 305,
punch3_start = 70, punch3_end = 140,
},
drops = {
{name = 'mobs:meat_raw', chance = 1, min = 5, max = 20},
},
water_damage = 2,
lava_damage = 60,
light_damage = 0,
animation = {
speed_normal = 15, speed_run = 15,
stand_start = 0, stand_end = 60,
walk_start = 150, walk_end = 210,
run_start = 150, run_end = 210,
punch_start = 220, punch_end = 260,
punch2_start = 265, punch2_end = 305,
punch3_start = 70, punch3_end = 140,
},
})
mobs:register_spawn("scorpion:big", {"default:desert_sand"}, 20, 0, 1000, 5, 31000)
mobs:register_egg("scorpion:big", "Big Scorpion", "default_grass.png", 1)
mobs:register_spawn('scorpion:big', {'default:desert_sand'}, 10, 0, 2000, 5, 31000)
mobs:register_egg('scorpion:big', 'Big Scorpion', 'default_grass.png', 1)

102
boss.lua
View File

@ -1,48 +1,49 @@
mobs:register_mob("scorpion:boss", {
type = "monster",
passive = false,
attack_type = "dogfight",
damage = 20,
hp_min = 75, hp_max = 175, armor = 20,
collisionbox = {-1, -0.95, -1, 1, .35, 1},
visual = "mesh",
mesh = "scorpion.b3d",
drawtype = "front",
textures = {
{"scorpion_red.png^scorpion_armor.png"},
{"scorpion_green.png^scorpion_armor.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=20,y=20},
makes_footstep_sound = true,
sounds = {
war_cry = "scorpion_squeak",
},
walk_velocity = 3,
run_velocity = 7,
jump = true,
stepheight = 3,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 5, max = 15},
{name = "default:diamondblock", chance = 3, min = 4, max = 15},
{name = "default:mese", chance = 3, min = 4, max = 15},
{name = "default:steel_ingot", chance = 2, min = 10, max = 40},
},
water_damage = 1,
lava_damage = 20,
light_damage = 0,
mobs:register_mob('scorpion:boss', {
type = 'monster',
passive = false,
attack_type = 'dogfight',
damage = 20,
hp_min = 75, hp_max = 175, armor = 20,
collisionbox = {-1, -0.95, -1, 1, .35, 1},
visual = 'mesh',
mesh = 'scorpion.b3d',
drawtype = 'front',
textures = {
{'scorpion_red.png^scorpion_armor.png'},
{'scorpion_green.png^scorpion_armor.png'},
{'scorpion_tan.png^scorpion_armor.png'},
},
blood_texture = 'mobs_blood.png',
visual_size = {x=20,y=20},
makes_footstep_sound = true,
sounds = {
war_cry = 'scorpion_squeak',
},
walk_velocity = 3,
run_velocity = 7,
jump = true,
stepheight = 3,
drops = {
{name = 'mobs:meat_raw', chance = 1, min = 5, max = 15},
{name = 'default:diamondblock', chance = 3, min = 4, max = 15},
{name = 'default:mese', chance = 3, min = 4, max = 15},
{name = 'default:steel_ingot', chance = 2, min = 10, max = 40},
},
water_damage = 20,
lava_damage = 60,
light_damage = 0,
reach = 5,
view_range = 10,
view_range = 12,
fear_height = 9,
animation = {
speed_normal = 15, speed_run = 15,
stand_start = 0, stand_end = 60,
walk_start = 150, walk_end = 210,
run_start = 150, run_end = 210,
punch_start = 220, punch_end = 260,
punch2_start = 265, punch2_end = 305,
punch3_start = 70, punch3_end = 140,
},
animation = {
speed_normal = 15, speed_run = 15,
stand_start = 0, stand_end = 60,
walk_start = 150, walk_end = 210,
run_start = 150, run_end = 210,
punch_start = 220, punch_end = 260,
punch2_start = 265, punch2_end = 305,
punch3_start = 70, punch3_end = 140,
},
custom_attack = function(self)
local random_number = math.random(0,8)
@ -50,10 +51,19 @@ mobs:register_mob("scorpion:boss", {
if random_number == 3 then
local s = self.object:get_pos()
local pos1 = {x=s.x+math.random(-3,3), y=s.y, z=s.z+math.random(-3,3)}
minetest.add_entity(pos1, "scorpion:little")
minetest.add_entity(pos1, 'scorpion:little')
end
end,
on_die = function(self)
local random_number = math.random(0,10)
if random_number == 2 then
local s = self.object:get_pos()
local pos1 = {x=s.x+math.random(-2,2), y=s.y, z=s.z+math.random(-2,2)}
minetest.add_entity(pos1, 'scorpion:pet')
end
end,
})
mobs:register_spawn("scorpion:boss", {"default:desert_stone"}, 20, 0, 5000, 1, 31000)
mobs:register_egg("scorpion:boss", "Boss Scorpion", "default_grass.png", 1)
mobs:register_spawn('scorpion:boss', {'default:desert_stone'}, 10, 0, 5000, 1, 31000)
mobs:register_egg('scorpion:boss', 'Boss Scorpion', 'default_grass.png', 1)

View File

@ -3,5 +3,6 @@ if mobs.mod and mobs.mod == "redo" then
dofile(minetest.get_modpath('scorpion')..'/little.lua')
dofile(minetest.get_modpath('scorpion')..'/big.lua')
dofile(minetest.get_modpath('scorpion')..'/boss.lua')
dofile(minetest.get_modpath('scorpion')..'/pet.lua')
end

View File

@ -1,46 +1,47 @@
mobs:register_mob("scorpion:little", {
type = "monster",
passive = false,
attack_type = "dogfight",
damage = 3,
hp_min = 30, hp_max = 75, armor = 45,
collisionbox = {-0.6, -0.35, -0.5, 0.6, 0.3, 0.5},
visual = "mesh",
mesh = "scorpion.b3d",
drawtype = "front",
textures = {
{"scorpion_red.png"},
{"scorpion_green.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=7,y=7},
makes_footstep_sound = true,
mobs:register_mob('scorpion:little', {
type = 'monster',
passive = false,
attack_type = 'dogfight',
damage = 3,
hp_min = 30, hp_max = 75, armor = 45,
collisionbox = {-0.6, -0.35, -0.5, 0.6, 0.3, 0.5},
visual = 'mesh',
mesh = 'scorpion.b3d',
drawtype = 'front',
textures = {
{'scorpion_red.png'},
{'scorpion_green.png'},
{'scorpion_tan.png'},
},
blood_texture = 'mobs_blood.png',
visual_size = {x=7,y=7},
makes_footstep_sound = true,
sounds = {
war_cry = "scorpion_squeak",
},
walk_velocity = 2,
run_velocity = 6,
jump = true,
stepheight = 1.7,
reach = 2,
view_range = 2,
war_cry = 'scorpion_squeak',
},
walk_velocity = 2,
run_velocity = 6,
jump = true,
stepheight = 1.7,
reach = 3,
view_range = 6,
fear_height = 2,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 2, max = 8},
},
water_damage = 2,
lava_damage = 20,
light_damage = 0,
animation = {
speed_normal = 45, speed_run = 90,
stand_start = 0, stand_end = 60,
walk_start = 150, walk_end = 210,
run_start = 150, run_end = 210,
punch_start = 220, punch_end = 260,
punch2_start = 265, punch2_end = 305,
punch3_start = 70, punch3_end = 140,
},
drops = {
{name = 'mobs:meat_raw', chance = 1, min = 2, max = 8},
},
water_damage = 2,
lava_damage = 60,
light_damage = 0,
animation = {
speed_normal = 45, speed_run = 90,
stand_start = 0, stand_end = 60,
walk_start = 150, walk_end = 210,
run_start = 150, run_end = 210,
punch_start = 220, punch_end = 260,
punch2_start = 265, punch2_end = 305,
punch3_start = 70, punch3_end = 140,
},
})
mobs:register_spawn("scorpion:little", {"default:dirt_with_rainforest_litter", "default:desert_sand"}, 20, 0, 1000, 15, 31000)
mobs:register_egg("scorpion:little", "Little Scorpion", "default_grass.png", 1)
mobs:register_spawn('scorpion:little', {'default:dirt_with_rainforest_litter', 'default:desert_sand'}, 10, 0, 2000, 7, 31000)
mobs:register_egg('scorpion:little', 'Little Scorpion', 'default_grass.png', 1)

47
pet.lua Normal file
View File

@ -0,0 +1,47 @@
mobs:register_mob('scorpion:pet', {
type = 'animal',
passive = false,
attack_type = 'dogfight',
owner_loyal = true,
damage = 10,
hp_min = 30, hp_max = 75, armor = 45,
collisionbox = {-0.6, -0.35, -0.5, 0.6, 0.3, 0.5},
visual = 'mesh',
mesh = 'scorpion.b3d',
drawtype = 'front',
textures = {
{'scorpion_red.png'},
{'scorpion_green.png'},
{'scorpion_tan.png'},
},
blood_texture = 'mobs_blood.png',
visual_size = {x=7,y=7},
makes_footstep_sound = true,
sounds = {
war_cry = 'scorpion_squeak',
},
walk_velocity = 2,
run_velocity = 6,
jump = true,
stepheight = 1.7,
reach = 4,
view_range = 6,
fear_height = 2,
drops = {
{name = 'mobs:meat_raw', chance = 1, min = 2, max = 8},
},
water_damage = 2,
lava_damage = 60,
light_damage = 0,
animation = {
speed_normal = 45, speed_run = 90,
stand_start = 0, stand_end = 60,
walk_start = 150, walk_end = 210,
run_start = 150, run_end = 210,
punch_start = 220, punch_end = 260,
punch2_start = 265, punch2_end = 305,
punch3_start = 70, punch3_end = 140,
},
})
mobs:register_egg('scorpion:pet', 'Pet Scorpion', 'default_grass.png', 1)

Binary file not shown.

BIN
textures/scorpion_tan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB