Browse Source

Add the workaround for multi-mesh model files as a new function (in codersea for now)--related to issue #462.

master
poikilos 3 years ago
parent
commit
daf5b7071d
  1. 124
      Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-carp.lua
  2. 141
      Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-lobster.lua
  3. 110
      Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-seahorse.lua
  4. 104
      Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-trout.lua
  5. 149
      Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/init.lua
  6. 124
      Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-carp.lua
  7. 141
      Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-lobster.lua
  8. 110
      Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-seahorse.lua
  9. 104
      Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-trout.lua
  10. 208
      Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/init.lua

124
Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-carp.lua

@ -0,0 +1,124 @@
-- Carp. Descended from Skandarella version.
local spawnchance = codersea_chance_fish
if spawnchance < 300 then
spawnchance = 300 end
local mobname = "codersea:carp"
mobs:register_mob (mobname, {
stepheight = 0.0 ,
type = "animal" ,
passive = true ,
attack_type = "dogfight" ,
attack_animals = false ,
reach = 1 ,
damage = 1 ,
hp_min = 5 ,
hp_max = 25 ,
armor = 100 ,
visual = "mesh" ,
sounds = {} ,
walk_velocity = 2 ,
run_velocity = 3 ,
fly = true ,
fall_speed = 0 ,
runaway = true ,
jump = false ,
stepheight = 0.0 ,
fear_height = 2 ,
floats = 0 ,
view_range = 10 ,
air_damage = 1 ,
lava_damage = 4 ,
light_damage = 0 ,
water_damage = 0 ,
mesh = "codersea_carp.b3d" ,
visual_size = { x=1.0, y=1.0 } ,
textures = {{ "codersea_carp.png" }} ,
collisionbox = { -0.40, -0.01, -0.40, 0.40, 0.50, 0.40 } ,
makes_footstep_sound = false ,
animation = {
speed_normal = 100,
stand_start = 0,
stand_end = 100,
walk_start = 150,
walk_end = 250,
fly_start = 150, -- swim animation
fly_end = 250,
punch_start = 100,
punch_end = 200,
-- 50-70 is slide/water idle
},
drops = {
{ name = "codersea:sushi",
chance = 1, min = 1, max = 1 } ,
} ,
fly_in = {
"codersea:water_flowing" ,
"codersea:water_source" ,
"default:water_flowing" ,
"default:water_source" ,
"default:water_gel" ,
"default:river_water_source" ,
"default:river_water_flowing" ,
} ,
follow = {
"ethereal:worm", "seaweed", "fishing:bait_worm",
"default:grass", "farming:cucumber",
"farming:cabbage", "animalworld:ant",
"animalworld:termite", "animalworld:fishfood"
},
runaway_from = {
"animalworld:bear", "animalworld:crocodile",
"animalworld:tiger", "animalworld:spider",
"animalworld:spidermale", "animalworld:shark",
"animalworld:hyena", "animalworld:kobra",
"animalworld:monitor", "animalworld:snowleopard",
"animalworld:volverine",
"livingfloatlands:deinotherium",
"livingfloatlands:carnotaurus",
"livingfloatlands:lycaenops",
"livingfloatlands:smilodon",
"livingfloatlands:tyrannosaurus",
"livingfloatlands:velociraptor",
"animalworld:divingbeetle",
"animalworld:divingbeetle",
"animalworld:scorpion",
"animalworld:polarbear",
"animalworld:leopardseal",
"animalworld:stellerseagle", "player"
} ,
on_rightclick = function (self, clicker)
if mobs:feed_tame (self, clicker, 4, false, true) then
return
end
if mobs:protect (self, clicker) then return end
if mobs:capture_mob (self, clicker,
5, 50, 80, false, nil) then
return
end
end ,
})
-- ===================================================================
mobs:spawn_specific (mobname ,
codersea.default_spawn_nodes ,
codersea.default_spawn_near ,
5, 30, 30, spawnchance, codersea_aoc_fish, -31000, 0)
mobs:register_egg (mobname ,
"Carp", "egg_carp.png", 0)
-- ===================================================================
-- End of file.

141
Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-lobster.lua

@ -0,0 +1,141 @@
-- Lobster. Descended from Skandarella version.
local spawnchance = codersea_chance_lobster
if spawnchance < 300 then
spawnchance = 300 end
local mobname = "codersea:lobster"
mobs:register_mob (mobname, {
type = "animal" ,
armor = 100 ,
attack_npcs = false ,
attack_type = "dogfight" ,
damage = 5 ,
fear_height = 2 ,
floats = 0 ,
group_attack = true ,
hp_max = 70 ,
hp_min = 25 ,
jump = false ,
jump_height = 3 ,
owner_loyal = true ,
passive = false ,
pushable = true ,
reach = 2 ,
run_velocity = 1.0 ,
runaway = true ,
stepheight = 1 ,
view_range = 10 ,
walk_velocity = 0.5 ,
air_damage = 1 ,
lava_damage = 5 ,
light_damage = 0 ,
water_damage = 0 ,
sounds = {} ,
collisionbox = { -0.6, -0.01, -0.6, 0.6, 0.5, 0.6 } ,
visual = "mesh" ,
mesh = "codersea_lobster.b3d" ,
textures = {{ "codersea_lobster.png" }} ,
makes_footstep_sound = true,
animation = {
speed_normal = 50,
stand_start = 0,
stand_end = 100,
walk_start = 100,
walk_end = 200,
punch_start = 200,
punch_end = 300,
die_start = 1, -- we dont have a specific death animation so we will
die_end = 2, -- re-use 2 standing frames at a speed of 1 fps and
die_speed = 1, -- have mob rotate when dying.
die_loop = false,
die_rotate = true,
} ,
runaway_from = {
"animalworld:bear" ,
"animalworld:crocodile" ,
"animalworld:tiger" ,
"animalworld:spider" ,
"animalworld:spidermale" ,
"animalworld:shark" ,
"animalworld:hyena" ,
"animalworld:kobra" ,
"animalworld:monitor" ,
"animalworld:snowleopard" ,
"animalworld:volverine" ,
"livingfloatlands:deinotherium" ,
"livingfloatlands:carnotaurus" ,
"livingfloatlands:lycaenops" ,
"livingfloatlands:smilodon" ,
"livingfloatlands:tyrannosaurus" ,
"livingfloatlands:velociraptor" ,
"animalworld:divingbeetle" ,
"animalworld:scorpion" ,
"animalworld:polarbear" ,
"animalworld:leopardseal" ,
"animalworld:stellerseagle" ,
"player"
} ,
follow = {
"animalworld:rawfish" ,
"mobs_fish:tropical" ,
"mobs:clownfish_raw" ,
"mobs:bluefish_raw" ,
"fishing:bait_worm" ,
"fishing:clownfish_raw" ,
"fishing:bluewhite_raw" ,
"fishing:exoticfish_raw" ,
"fishing:fish_raw" ,
"fishing:carp_raw" ,
"fishing:perch_raw" ,
"water_life:meat_raw" ,
"fishing:shark_raw" ,
"fishing:pike_raw" ,
} ,
drops = {
} ,
fly_in = {
"codersea:water_flowing" ,
"codersea:water_source" ,
"default:water_flowing" ,
"default:water_source" ,
"default:water_gel" ,
"default:river_water_source" ,
"default:river_water_flowing" ,
} ,
on_rightclick = function (self, clicker)
if mobs:feed_tame (self, clicker, 8, true, true) then
return
end
if mobs:protect (self, clicker) then return end
if mobs:capture_mob (self, clicker,
0, 5, 50, false, nil) then
return
end
end ,
})
-- ===================================================================
mobs:spawn_specific (mobname ,
codersea.default_spawn_nodes ,
codersea.default_spawn_near ,
0, 30, 30, spawnchance, codersea_aoc_lobster, -31000, 0)
mobs:register_egg (mobname ,
"Lobster", "egg_lobster.png", 0)
-- ===================================================================
-- End of file.

110
Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-seahorse.lua

@ -0,0 +1,110 @@
local spawnchance = codersea_chance_seahorse
if spawnchance < 300 then
spawnchance = 300 end
local mobname = "codersea:seahorse"
local v_scale = 0.6
mobs:register_mob (mobname, {
stepheight = 0.0,
type = "animal",
passive = true,
attack_type = "dogfight",
attack_animals = false,
reach = 1,
damage = 0,
hp_min = 5,
hp_max = 5,
armor = 100,
collisionbox = {
-0.10 * v_scale ,
-0.01 ,
-0.10 * v_scale ,
0.10 * v_scale ,
0.60 * v_scale ,
0.10 * v_scale ,
} ,
visual = "mesh",
mesh = "codersea_seahorse.b3d",
visual_size = {x = v_scale, y = v_scale },
textures = {
{"codersea_seahorse1.png"},
{"codersea_seahorse2.png"},
},
sounds = {},
makes_footstep_sound = false,
walk_velocity = 0.25 ,
run_velocity = 0.50 ,
fly = true,
fly_in = {
"codersea:water_flowing" ,
"codersea:water_source" ,
"default:water_flowing" ,
"default:water_source" ,
"default:water_gel" ,
"default:river_water_source" ,
"default:river_water_flowing" ,
} ,
fall_speed = 0,
runaway = true,
-- @@@
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "animalworld:divingbeetle", "animalworld:divingbeetle", "animalworld:scorpion", "animalworld:polarbear", "animalworld:leopardseal", "animalworld:stellerseagle", "player"},
jump = false,
stepheight = 0.0,
drops = {
},
water_damage = 0,
air_damage = 1,
lava_damage = 4,
light_damage = 0,
fear_height = 2,
animation = {
speed_normal = 50,
stand_start = 0,
stand_end = 100,
stand2_start = 0,
stand2_end = 1,
walk_start = 100,
walk_end = 200,
walk_speed = 30,
fly_speed = 30,
fly_start = 100, -- swim animation
fly_end = 200,
-- 50-70 is slide/water idle
},
fly_in = {"default:water_source", "default:river_water_source", "default:water_flowing", "default:river_water_flowing"},
floats = 0,
follow = {
"animalworld:fishfood" -- @@@
},
view_range = 5,
on_rightclick = function (self, clicker)
if mobs:feed_tame (self, clicker, 4, false, true) then
return
end
if mobs:protect (self, clicker) then return end
if mobs:capture_mob (self, clicker,
5, 50, 80, false, nil) then
return
end
end ,
})
-- ===================================================================
mobs:spawn_specific (mobname ,
codersea.default_spawn_nodes ,
codersea.default_spawn_near ,
0, 30, 30, spawnchance, codersea_aoc_seahorse, -31000, 0)
mobs:register_egg (mobname ,
"Seahorse", "egg_seahorse.png", 0)
-- ===================================================================
-- End of file.

104
Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-trout.lua

@ -0,0 +1,104 @@
-- Trout. Descended from Skandarella version.
local spawnchance = codersea_chance_fish
if spawnchance < 300 then
spawnchance = 300 end
local mobname = "codersea:trout"
mobs:register_mob (mobname, {
type = "animal" ,
armor = 100 ,
attack_type = "dogfight" ,
attack_animals = false ,
damage = 1 ,
hp_max = 25 ,
hp_min = 5 ,
passive = true ,
reach = 1 ,
run_velocity = 3 ,
runaway = true ,
view_range = 10 ,
walk_velocity = 2 ,
stepheight = 0.0 ,
fly = true ,
sounds = {} ,
visual = "mesh" ,
fall_speed = 0 ,
jump = false ,
fear_height = 2 ,
floats = 0 ,
air_damage = 1 ,
lava_damage = 4 ,
light_damage = 0 ,
water_damage = 0 ,
collisionbox = { -0.4, -0.01, -0.4, 0.4, 0.4, 0.4 } ,
mesh = "codersea_trout.b3d",
visual_size = { x=1.0, y=1.0 } ,
textures = {{ "codersea_trout.png" }} ,
makes_footstep_sound = false,
fly_in = {
"codersea:water_flowing" ,
"codersea:water_source" ,
"default:water_flowing" ,
"default:water_source" ,
"default:water_gel" ,
"default:river_water_source" ,
"default:river_water_flowing" ,
} ,
runaway_from = {"codermobs:bear", "codersea:crocodile", "codermobs:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "codermobs:tyrannosaurus", "codermobs:velociraptor", "codermobs:divingbeetle", "codermobs:scorpion", "codermobs:polarbear", "codermobs:leopardseal", "codermobs:stellerseagle", "player"},
drops = {
{ name = "codersea:sushi", chance = 1, min = 1, max = 1 } ,
} ,
animation = {
speed_normal = 125,
stand_start = 0,
stand_end = 100,
walk_start = 150,
walk_end = 250,
fly_start = 150 , -- swim animation
fly_end = 250,
punch_start = 100,
punch_end = 200,
-- 50-70 is slide/water idle
},
fly_in = {
"default:water_source", "default:river_water_source", "default:water_flowing"
} ,
follow = {
"mobs:meat_raw", "codermobs:ant", "ethereal:worm", "fishing:bait_worm", "water_life:meat_raw", "xocean:fish_edible", "codermobs:fishfood"
},
on_rightclick = function (self, clicker)
if mobs:feed_tame (self, clicker, 4, false, true) then
return
end
if mobs:protect (self, clicker) then return end
if mobs:capture_mob (self, clicker,
5, 50, 80, false, nil) then
return
end
end ,
})
-- ===================================================================
mobs:spawn_specific (mobname ,
codersea.default_spawn_nodes ,
codersea.default_spawn_near ,
5, 30, 30, spawnchance, codersea_aoc_fish, -31000, 0)
mobs:register_egg (mobname ,
"Trout", "egg_trout.png", 0)
-- ===================================================================
-- End of file.

149
Bucket_Game-base/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/init.lua

@ -0,0 +1,149 @@
-- File: codersea/init.lua
-- Purpose: CoderSea "init.lua" (i.e., main) module
-- Credits: See "codersea.md"
-- Licenses: See "LICENSE"
codersea = {}
codersea.modname = "codersea"
codersea.modpath = minetest.get_modpath (codersea.modname)
local has_mobs = ocutil.mod_exists ("mobs")
local modpath = codersea.modpath
local liteworld =
ocutil.bool_setting ("liteworld")
-- "util.lua" and "settings.lua" should come first.
--
dofile (modpath .. "/util.lua" );
dofile (modpath .. "/settings.lua" );
dofile (modpath .. "/tidyup.lua" );
if ocutil.model_missing (codersea.modname,
"codersea_turtle.x") then
codersea_disable_turtle = true
end
if has_mobs then
ocutil.log ("codersea: has_mobs")
else
ocutil.log ("codersea: not has_mobs")
codersea_disable_urchin = true
codersea_disable_mobs = true
end
if not codersea_disable_shine then
dofile (modpath .. "/seashine.lua" );
end
dofile (modpath .. "/seasprites.lua" );
if not codersea_reset then
dofile (modpath .. "/seaglass.lua");
end
if not codersea_disable_seastone then
dofile (modpath .. "/seacobble.lua" );
dofile (modpath .. "/seagravel.lua" );
dofile (modpath .. "/seastone.lua" );
dofile (modpath .. "/seabrick.lua" );
end
-- Should come after seaglass and seastone mods
dofile (modpath .. "/seaplants.lua" );
if not codersea_disable_shipwrecks then
dofile (modpath .. "/shipwrecks.lua");
end
dofile (modpath .. "/legacy.lua" );
-- "fixwater.lua" should come after the other "codersea" modules ex-
-- cept for the "mobs" ones.
--
dofile (modpath .. "/fixwater.lua" );
-- Future change: Perhaps use a clone-table utility function here.
if not codersea_drowning then
local function overwrite_drowning (name)
local table = minetest.registered_nodes [name]
if table ~= nil then
local table2 = {}
for i,v in pairs (table) do table2 [i] = v end
table2.drowning = false
minetest.register_node (":" .. name, table2)
end
end
overwrite_drowning ("default:water_source" )
overwrite_drowning ("default:water_flowing" )
overwrite_drowning ("default:water_gel" )
overwrite_drowning ("default:lava_source" )
overwrite_drowning ("default:lava_flowing" )
end
if not codersea_disable_mobs then
if not codersea_disable_fish then
dofile (modpath .. "/codersea-carp.lua" )
dofile (modpath .. "/codersea-trout.lua" )
dofile (modpath .. "/codersea-morefish.lua" )
end
if not codersea_disable_jellyfish then
dofile (modpath .. "/codersea-jellyfish.lua" )
end
if not codersea_disable_lobster then
dofile (modpath .. "/codersea-lobster.lua" )
end
if not codersea_disable_seahorse then
dofile (modpath .. "/codersea-seahorse.lua" )
end
if not codersea_disable_shark then
dofile (modpath .. "/codersea-shark.lua" )
end
if not codersea_disable_urchin then
dofile (modpath .. "/codersea-urchin.lua" )
end
if liteworld == false then
-- if not codersea_disable_dolidro then
-- dofile (modpath .. "/codersea-dolidro.lua" )
-- end
-- if not codersea_disable_octopus then
-- dofile (modpath .. "/codersea-octopus.lua" )
-- end
if not codersea_disable_turtle then
dofile (modpath .. "/codersea-turtle.lua" )
end
end
end
-- ===================================================================
minetest.register_craftitem ("codersea:cookedfish" , {
description = ( "Cooked Fish" ) ,
inventory_image = "codersea_cookedfish.png" ,
on_use = minetest.item_eat (5) ,
groups = {
food_meat=1, flammable=2
} ,
})
minetest.register_craft ({
type = "cooking" ,
output = "codersea:cookedfish" ,
recipe = "codersea:sushi" ,
cooktime = 5 ,
})
minetest.register_craftitem ("codersea:fishfood", {
description = ("Fish Food") ,
inventory_image = "codersea_fishfood.png" ,
})
-- ===================================================================
-- End of file.

124
Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-carp.lua

@ -0,0 +1,124 @@
-- Carp. Descended from Skandarella version.
local spawnchance = codersea_chance_fish
if spawnchance < 300 then
spawnchance = 300 end
local mobname = "codersea:carp"
mobs:register_mob (mobname, {
stepheight = 0.0 ,
type = "animal" ,
passive = true ,
attack_type = "dogfight" ,
attack_animals = false ,
reach = 1 ,
damage = 1 ,
hp_min = 5 ,
hp_max = 25 ,
armor = 100 ,
visual = "mesh" ,
sounds = {} ,
walk_velocity = 2 ,
run_velocity = 3 ,
fly = true ,
fall_speed = 0 ,
runaway = true ,
jump = false ,
stepheight = 0.0 ,
fear_height = 2 ,
floats = 0 ,
view_range = 10 ,
air_damage = 1 ,
lava_damage = 4 ,
light_damage = 0 ,
water_damage = 0 ,
mesh = "codersea_carp.b3d" ,
visual_size = { x=1.0, y=1.0 } ,
textures = codersea.multiply_texture("codersea_carp.png", 13),
collisionbox = { -0.40, -0.01, -0.40, 0.40, 0.50, 0.40 } ,
makes_footstep_sound = false ,
animation = {
speed_normal = 100,
stand_start = 0,
stand_end = 100,
walk_start = 150,
walk_end = 250,
fly_start = 150, -- swim animation
fly_end = 250,
punch_start = 100,
punch_end = 200,
-- 50-70 is slide/water idle
},
drops = {
{ name = "codersea:sushi",
chance = 1, min = 1, max = 1 } ,
} ,
fly_in = {
"codersea:water_flowing" ,
"codersea:water_source" ,
"default:water_flowing" ,
"default:water_source" ,
"default:water_gel" ,
"default:river_water_source" ,
"default:river_water_flowing" ,
} ,
follow = {
"ethereal:worm", "seaweed", "fishing:bait_worm",
"default:grass", "farming:cucumber",
"farming:cabbage", "animalworld:ant",
"animalworld:termite", "animalworld:fishfood"
},
runaway_from = {
"animalworld:bear", "animalworld:crocodile",
"animalworld:tiger", "animalworld:spider",
"animalworld:spidermale", "animalworld:shark",
"animalworld:hyena", "animalworld:kobra",
"animalworld:monitor", "animalworld:snowleopard",
"animalworld:volverine",
"livingfloatlands:deinotherium",
"livingfloatlands:carnotaurus",
"livingfloatlands:lycaenops",
"livingfloatlands:smilodon",
"livingfloatlands:tyrannosaurus",
"livingfloatlands:velociraptor",
"animalworld:divingbeetle",
"animalworld:divingbeetle",
"animalworld:scorpion",
"animalworld:polarbear",
"animalworld:leopardseal",
"animalworld:stellerseagle", "player"
} ,
on_rightclick = function (self, clicker)
if mobs:feed_tame (self, clicker, 4, false, true) then
return
end
if mobs:protect (self, clicker) then return end
if mobs:capture_mob (self, clicker,
5, 50, 80, false, nil) then
return
end
end ,
})
-- ===================================================================
mobs:spawn_specific (mobname ,
codersea.default_spawn_nodes ,
codersea.default_spawn_near ,
5, 30, 30, spawnchance, codersea_aoc_fish, -31000, 0)
mobs:register_egg (mobname ,
"Carp", "egg_carp.png", 0)
-- ===================================================================
-- End of file.

141
Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-lobster.lua

@ -0,0 +1,141 @@
-- Lobster. Descended from Skandarella version.
local spawnchance = codersea_chance_lobster
if spawnchance < 300 then
spawnchance = 300 end
local mobname = "codersea:lobster"
mobs:register_mob (mobname, {
type = "animal" ,
armor = 100 ,
attack_npcs = false ,
attack_type = "dogfight" ,
damage = 5 ,
fear_height = 2 ,
floats = 0 ,
group_attack = true ,
hp_max = 70 ,
hp_min = 25 ,
jump = false ,
jump_height = 3 ,
owner_loyal = true ,
passive = false ,
pushable = true ,
reach = 2 ,
run_velocity = 1.0 ,
runaway = true ,
stepheight = 1 ,
view_range = 10 ,
walk_velocity = 0.5 ,
air_damage = 1 ,
lava_damage = 5 ,
light_damage = 0 ,
water_damage = 0 ,
sounds = {} ,
collisionbox = { -0.6, -0.01, -0.6, 0.6, 0.5, 0.6 } ,
visual = "mesh" ,
mesh = "codersea_lobster.b3d" ,
textures = codersea.multiply_texture("codersea_lobster.png", 27),
makes_footstep_sound = true,
animation = {
speed_normal = 50,
stand_start = 0,
stand_end = 100,
walk_start = 100,
walk_end = 200,
punch_start = 200,
punch_end = 300,
die_start = 1, -- we dont have a specific death animation so we will
die_end = 2, -- re-use 2 standing frames at a speed of 1 fps and
die_speed = 1, -- have mob rotate when dying.
die_loop = false,
die_rotate = true,
} ,
runaway_from = {
"animalworld:bear" ,
"animalworld:crocodile" ,
"animalworld:tiger" ,
"animalworld:spider" ,
"animalworld:spidermale" ,
"animalworld:shark" ,
"animalworld:hyena" ,
"animalworld:kobra" ,
"animalworld:monitor" ,
"animalworld:snowleopard" ,
"animalworld:volverine" ,
"livingfloatlands:deinotherium" ,
"livingfloatlands:carnotaurus" ,
"livingfloatlands:lycaenops" ,
"livingfloatlands:smilodon" ,
"livingfloatlands:tyrannosaurus" ,
"livingfloatlands:velociraptor" ,
"animalworld:divingbeetle" ,
"animalworld:scorpion" ,
"animalworld:polarbear" ,
"animalworld:leopardseal" ,
"animalworld:stellerseagle" ,
"player"
} ,
follow = {
"animalworld:rawfish" ,
"mobs_fish:tropical" ,
"mobs:clownfish_raw" ,
"mobs:bluefish_raw" ,
"fishing:bait_worm" ,
"fishing:clownfish_raw" ,
"fishing:bluewhite_raw" ,
"fishing:exoticfish_raw" ,
"fishing:fish_raw" ,
"fishing:carp_raw" ,
"fishing:perch_raw" ,
"water_life:meat_raw" ,
"fishing:shark_raw" ,
"fishing:pike_raw" ,
} ,
drops = {
} ,
fly_in = {
"codersea:water_flowing" ,
"codersea:water_source" ,
"default:water_flowing" ,
"default:water_source" ,
"default:water_gel" ,
"default:river_water_source" ,
"default:river_water_flowing" ,
} ,
on_rightclick = function (self, clicker)
if mobs:feed_tame (self, clicker, 8, true, true) then
return
end
if mobs:protect (self, clicker) then return end
if mobs:capture_mob (self, clicker,
0, 5, 50, false, nil) then
return
end
end ,
})
-- ===================================================================
mobs:spawn_specific (mobname ,
codersea.default_spawn_nodes ,
codersea.default_spawn_near ,
0, 30, 30, spawnchance, codersea_aoc_lobster, -31000, 0)
mobs:register_egg (mobname ,
"Lobster", "egg_lobster.png", 0)
-- ===================================================================
-- End of file.

110
Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-seahorse.lua

@ -0,0 +1,110 @@
local spawnchance = codersea_chance_seahorse
if spawnchance < 300 then
spawnchance = 300 end
local mobname = "codersea:seahorse"
local v_scale = 0.6
mobs:register_mob (mobname, {
stepheight = 0.0,
type = "animal",
passive = true,
attack_type = "dogfight",
attack_animals = false,
reach = 1,
damage = 0,
hp_min = 5,
hp_max = 5,
armor = 100,
collisionbox = {
-0.10 * v_scale ,
-0.01 ,
-0.10 * v_scale ,
0.10 * v_scale ,
0.60 * v_scale ,
0.10 * v_scale ,
} ,
visual = "mesh",
mesh = "codersea_seahorse.b3d",
visual_size = {x = v_scale, y = v_scale },
textures = codersea.multiply_texture({
{"codersea_seahorse1.png"},
{"codersea_seahorse2.png"},
}, 13),
sounds = {},
makes_footstep_sound = false,
walk_velocity = 0.25 ,
run_velocity = 0.50 ,
fly = true,
fly_in = {
"codersea:water_flowing" ,
"codersea:water_source" ,
"default:water_flowing" ,
"default:water_source" ,
"default:water_gel" ,
"default:river_water_source" ,
"default:river_water_flowing" ,
} ,
fall_speed = 0,
runaway = true,
-- @@@
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "animalworld:divingbeetle", "animalworld:divingbeetle", "animalworld:scorpion", "animalworld:polarbear", "animalworld:leopardseal", "animalworld:stellerseagle", "player"},
jump = false,
stepheight = 0.0,
drops = {
},
water_damage = 0,
air_damage = 1,
lava_damage = 4,
light_damage = 0,
fear_height = 2,
animation = {
speed_normal = 50,
stand_start = 0,
stand_end = 100,
stand2_start = 0,
stand2_end = 1,
walk_start = 100,
walk_end = 200,
walk_speed = 30,
fly_speed = 30,
fly_start = 100, -- swim animation
fly_end = 200,
-- 50-70 is slide/water idle
},
fly_in = {"default:water_source", "default:river_water_source", "default:water_flowing", "default:river_water_flowing"},
floats = 0,
follow = {
"animalworld:fishfood" -- @@@
},
view_range = 5,
on_rightclick = function (self, clicker)
if mobs:feed_tame (self, clicker, 4, false, true) then
return
end
if mobs:protect (self, clicker) then return end
if mobs:capture_mob (self, clicker,
5, 50, 80, false, nil) then
return
end
end ,
})
-- ===================================================================
mobs:spawn_specific (mobname ,
codersea.default_spawn_nodes ,
codersea.default_spawn_near ,
0, 30, 30, spawnchance, codersea_aoc_seahorse, -31000, 0)
mobs:register_egg (mobname ,
"Seahorse", "egg_seahorse.png", 0)
-- ===================================================================
-- End of file.

104
Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/codersea-trout.lua

@ -0,0 +1,104 @@
-- Trout. Descended from Skandarella version.
local spawnchance = codersea_chance_fish
if spawnchance < 300 then
spawnchance = 300 end
local mobname = "codersea:trout"
mobs:register_mob (mobname, {
type = "animal" ,
armor = 100 ,
attack_type = "dogfight" ,
attack_animals = false ,
damage = 1 ,
hp_max = 25 ,
hp_min = 5 ,
passive = true ,
reach = 1 ,
run_velocity = 3 ,
runaway = true ,
view_range = 10 ,
walk_velocity = 2 ,
stepheight = 0.0 ,
fly = true ,
sounds = {} ,
visual = "mesh" ,
fall_speed = 0 ,
jump = false ,
fear_height = 2 ,
floats = 0 ,
air_damage = 1 ,
lava_damage = 4 ,
light_damage = 0 ,
water_damage = 0 ,
collisionbox = { -0.4, -0.01, -0.4, 0.4, 0.4, 0.4 } ,
mesh = "codersea_trout.b3d",
visual_size = { x=1.0, y=1.0 } ,
textures = codersea.multiply_texture("codersea_trout.png", 11),
makes_footstep_sound = false,
fly_in = {
"codersea:water_flowing" ,
"codersea:water_source" ,
"default:water_flowing" ,
"default:water_source" ,
"default:water_gel" ,
"default:river_water_source" ,
"default:river_water_flowing" ,
} ,
runaway_from = {"codermobs:bear", "codersea:crocodile", "codermobs:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "codermobs:tyrannosaurus", "codermobs:velociraptor", "codermobs:divingbeetle", "codermobs:scorpion", "codermobs:polarbear", "codermobs:leopardseal", "codermobs:stellerseagle", "player"},
drops = {
{ name = "codersea:sushi", chance = 1, min = 1, max = 1 } ,
} ,
animation = {
speed_normal = 125,
stand_start = 0,
stand_end = 100,
walk_start = 150,
walk_end = 250,
fly_start = 150 , -- swim animation
fly_end = 250,
punch_start = 100,
punch_end = 200,
-- 50-70 is slide/water idle
},
fly_in = {
"default:water_source", "default:river_water_source", "default:water_flowing"
} ,
follow = {
"mobs:meat_raw", "codermobs:ant", "ethereal:worm", "fishing:bait_worm", "water_life:meat_raw", "xocean:fish_edible", "codermobs:fishfood"
},
on_rightclick = function (self, clicker)
if mobs:feed_tame (self, clicker, 4, false, true) then
return
end
if mobs:protect (self, clicker) then return end
if mobs:capture_mob (self, clicker,
5, 50, 80, false, nil) then
return
end
end ,
})
-- ===================================================================
mobs:spawn_specific (mobname ,
codersea.default_spawn_nodes ,
codersea.default_spawn_near ,
5, 30, 30, spawnchance, codersea_aoc_fish, -31000, 0)
mobs:register_egg (mobname ,
"Trout", "egg_trout.png", 0)
-- ===================================================================
-- End of file.

208
Bucket_Game-branches/untextured_mob_body_parts_workaround-vs-211114a/mods/codercore/codersea/init.lua

@ -0,0 +1,208 @@
-- File: codersea/init.lua
-- Purpose: CoderSea "init.lua" (i.e., main) module
-- Credits: See "codersea.md"
-- Licenses: See "LICENSE"
codersea = {}
codersea.modname = "codersea"
codersea.modpath = minetest.get_modpath (codersea.modname)
codersea.multiply_texture = function(texture, mesh_count)
-- by Poikilos
-- mesh_count -- This must be the # of meshes in model.
-- texture -- Provide a single texture or variants to use randomly.
--
-- If texture is not a table, it will be assumed to be a
-- string, and table of length mesh_count will be returned so
-- you don't have to type something like:
-- { textures, textures, textures, ...}
-- (The same texture will be applied to multiple body parts.)
--
-- If texture is a table, it will be assumed to be a list of
-- variants (for mobs that get a random texture), and a nested
-- table will be returned where each element is of length
-- mesh_count so you don't have to type something like
-- {
-- {texturemonkey.png, texturemonkey.png, texturemonkey.png, ...},
-- {texturemonkey2.png, texturemonkey2.png, texturemonkey2.png, ...},
-- {texturemonkey3.png, texturemonkey3.png, texturemonkey3.png, ...},
-- }
-- (The same variant will be applied to multiple body
-- parts, but a variant is still selected at random by
-- register_mob.)
if not texture then
error("You must provide a texture string or table of variants.")
end
if not mesh_count then
error(
"You must provide a mesh_count" ..
" (The number of meshes in the model file)." ..
" See the traceback below for what file called" ..
" multiply_texture incorrectly."
)
end
local multi_mesh_texture = {}
if type(texture) == "table" then
-- It is a list-like table of variant texture filenames.
local texture_filename = nil
for variant_i = 1,#texture,1 do
multi_mesh_texture[variant_i] = {}
texture_filename = texture[variant_i]
if type(texture_filename) == "table" then
texture_filename = texture_filename[1]
-- ^ In case the mobs-style nested table was passed,
-- copy the single texture for each variant.
end
for multimesh_texture_i = 1,mesh_count,1 do
multi_mesh_texture[variant_i][multimesh_texture_i] = texture_filename
end
end
else
-- It is a single texture filename string.
for multimesh_texture_i = 1,mesh_count,1 do
multi_mesh_texture[multimesh_texture_i] = texture
end
end
return multi_mesh_texture
end
local has_mobs = ocutil.mod_exists ("mobs")
local modpath = codersea.modpath
local liteworld =
ocutil.bool_setting ("liteworld")
-- "util.lua" and "settings.lua" should come first.
--
dofile (modpath .. "/util.lua" );
dofile (modpath .. "/settings.lua" );
dofile (modpath .. "/tidyup.lua" );
if ocutil.model_missing (codersea.modname,
"codersea_turtle.x") then
codersea_disable_turtle = true
end
if has_mobs then
ocutil.log ("codersea: has_mobs")
else
ocutil.log ("codersea: not has_mobs")
codersea_disable_urchin = true
codersea_disable_mobs = true
end
if not codersea_disable_shine then
dofile (modpath .. "/seashine.lua" );
end
dofile (modpath .. "/seasprites.lua" );
if not codersea_reset then
dofile (modpath .. "/seaglass.lua");
end
if not codersea_disable_seastone then
dofile (modpath .. "/seacobble.lua" );
dofile (modpath .. "/seagravel.lua" );
dofile (modpath .. "/seastone.lua" );
dofile (modpath .. "/seabrick.lua" );
end
-- Should come after seaglass and seastone mods
dofile (modpath .. "/seaplants.lua" );
if not codersea_disable_shipwrecks then
dofile (modpath .. "/shipwrecks.lua");
end
dofile (modpath .. "/legacy.lua" );
-- "fixwater.lua" should come after the other "codersea" modules ex-
-- cept for the "mobs" ones.
--
dofile (modpath .. "/fixwater.lua" );
-- Future change: Perhaps use a clone-table utility function here.
if not codersea_drowning then
local function overwrite_drowning (name)
local table = minetest.registered_nodes [name]
if table ~= nil then
local table2 = {}
for i,v in pairs (table) do table2 [i] = v end
table2.drowning = false
minetest.register_node (":" .. name, table2)
end
end
overwrite_drowning ("default:water_source" )
overwrite_drowning ("default:water_flowing" )
overwrite_drowning ("default:water_gel" )
overwrite_drowning ("default:lava_source" )
overwrite_drowning ("default:lava_flowing" )
end
if not codersea_disable_mobs then
if not codersea_disable_fish then
dofile (modpath .. "/codersea-carp.lua" )
dofile (modpath .. "/codersea-trout.lua" )
dofile (modpath .. "/codersea-morefish.lua" )
end
if not codersea_disable_jellyfish then
dofile (modpath .. "/codersea-jellyfish.lua" )
end
if not codersea_disable_lobster then
dofile (modpath .. "/codersea-lobster.lua" )
end
if not codersea_disable_seahorse then
dofile (modpath .. "/codersea-seahorse.lua" )
end
if not codersea_disable_shark then
dofile (modpath .. "/codersea-shark.lua" )
end
if not codersea_disable_urchin then
dofile (modpath .. "/codersea-urchin.lua" )
end
if liteworld == false then
-- if not codersea_disable_dolidro then
-- dofile (modpath .. "/codersea-dolidro.lua" )
-- end
-- if not codersea_disable_octopus then
-- dofile (modpath .. "/codersea-octopus.lua" )
-- end
if not codersea_disable_turtle then
dofile (modpath .. "/codersea-turtle.lua" )
end
end
end
-- ===================================================================
minetest.register_craftitem ("codersea:cookedfish" , {
description = ( "Cooked Fish" ) ,
inventory_image = "codersea_cookedfish.png" ,
on_use = minetest.item_eat (5) ,
groups = {
food_meat=1, flammable=2
} ,
})
minetest.register_craft ({
type = "cooking" ,
output = "codersea:cookedfish" ,
recipe = "codersea:sushi" ,
cooktime = 5 ,
})
minetest.register_craftitem ("codersea:fishfood", {
description = ("Fish Food") ,
inventory_image = "codersea_fishfood.png" ,
})
-- ===================================================================
-- End of file.
Loading…
Cancel
Save