diff --git a/README.md b/README.md index 443a2746..4b184ab6 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ The following mods are also included: * sheep ([Creatures MOB-Engine][cme]) * hostils/ * ghost ([Creatures MOB-Engine][cme]) + * mob_shark ([animals_modpack][]) ([CC-BY-SA](mods/hostils/mob_shark/License.txt)) * [mobs_goblins][] ([CC-BY-SA / CC-BY / CC0](mods/hostils/mobs_goblins/README.md)) * oerrki ([Creatures MOB-Engine][cme]) * zombie ([Creatures MOB-Engine][cme]) diff --git a/mods/hostils/mob_shark/License.txt b/mods/hostils/mob_shark/License.txt new file mode 100644 index 00000000..15877d80 --- /dev/null +++ b/mods/hostils/mob_shark/License.txt @@ -0,0 +1,5 @@ +Licenses + +Everything not mentioned: + CC-BY-SA 3.0, Author sapier + URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode \ No newline at end of file diff --git a/mods/hostils/mob_shark/depends.txt b/mods/hostils/mob_shark/depends.txt new file mode 100644 index 00000000..6ca107db --- /dev/null +++ b/mods/hostils/mob_shark/depends.txt @@ -0,0 +1,5 @@ +default +animalmaterials +mob_environments +mobf +intllib? diff --git a/mods/hostils/mob_shark/init.lua b/mods/hostils/mob_shark/init.lua new file mode 100644 index 00000000..2a03de68 --- /dev/null +++ b/mods/hostils/mob_shark/init.lua @@ -0,0 +1,181 @@ +------------------------------------------------------------------------------- +-- Mob Framework Mod by Sapier +-- +-- You may copy, use, modify or do nearly anything except removing this +-- copyright notice. +-- And of course you are NOT allow to pretend you have written it. +-- +--! @file init.lua +--! @brief shark implementation +--! @copyright Sapier +--! @author Sapier +--! @date 2014-05-30 +-- +-- Contact sapier a t gmx net +------------------------------------------------------------------------------- +-- +-- Boilerplate to support localized strings if intllib mod is installed. +local S +if (minetest.get_modpath("intllib")) then + dofile(minetest.get_modpath("intllib").."/intllib.lua") + S = intllib.Getter(minetest.get_current_modname()) +else + S = function ( s ) return s end +end + +local version = "0.2.0" + +minetest.log("action","MOD: mob_shark loading ...") + +local selectionbox_shark = {-0.75, -0.5, -0.75, 0.75, 0.5, 0.75} + +local shark_groups = { + not_in_creative_inventory=1 + } + +function shark_drop() + local result = {} + + if math.random() < 0.01 then + table.insert(result,"animalmaterials:shark_tooth 3") + end + + if math.random() < 0.01 then + table.insert(result,"animalmaterials:shark_skin 1") + end + + table.insert(result,"animalmaterials:fish_shark 3") + + return result +end + +local shark_prototype = { + name="shark", + modname="mob_shark", + + factions = { + member = { + "animals", + "fish", + "sharks" + } + }, + + generic = { + description= S("Shark"), + base_health=5, + kill_result=shark_drop, + armor_groups= { + fleshy=20, + }, + groups = shark_groups, + envid="deep_water", + population_density = 450, + }, + movement = { + default_gen="probab_mov_gen", + min_accel=0.1, + max_accel=0.3, + max_speed=0.8, + pattern="swim_pattern1", + canfly=true, + follow_speedup= { x=20,y=1.5,z=20 }, + }, + combat = { + angryness=1, + starts_attack=true, + sun_sensitive=false, + melee = { + maxdamage=5, + range=2, + speed=1, + }, + distance = nil, + self_destruct = nil, + }, + animation = { + swim = { + start_frame = 80, + end_frame = 160, + }, + stand = { + start_frame = 1, + end_frame = 80, + }, + }, + states = { + { + name = "default", + movgen = "none", + chance = 0, + animation = "stand", + graphics_3d = { + visual = "mesh", + mesh = "mob_shark.b3d", + textures = {"mob_shark_shark_mesh.png"}, + collisionbox = selectionbox_shark, + visual_size= {x=1,y=1,z=1}, + }, + graphics = { + sprite_scale={x=2,y=1}, + sprite_div = {x=1,y=1}, + visible_height = 1, + visible_width = 1, + }, + typical_state_time = 30, + }, + { + name = "swiming", + movgen = "probab_mov_gen", + chance = 0.9, + animation = "swim", + typical_state_time = 180, + }, + { + name = "combat", + typical_state_time = 9999, + chance = 0.0, + animation = "swim", + movgen = "follow_mov_gen" + }, + }, + } + +local shark_name = shark_prototype.modname .. ":" .. shark_prototype.name +local shark_env = mobf_environment_by_name(shark_prototype.generic.envid) + +mobf_spawner_register("shark_spawner_1",shark_name, + { + spawnee = shark_name, + spawn_interval = 60, + spawn_inside = shark_env.media, + entities_around = + { + { type="MAX",distance=1,threshold=0 }, + { type="MAX",entityname=shark_name, + distance=shark_prototype.generic.population_density,threshold=2 }, + }, + + absolute_height = + { + min = -50, + max = -20 + }, + + nodes_around = + { + {type="MIN",distance=2, name={ "default:water_flowing","default:water_source"},threshold=22}, + }, + + -- set to empty to disable relative check + relative_height = {}, + + collisionbox = selectionbox_shark, + + spawns_per_interval = 5 + }) + +--register with animals mod +minetest.log("action","\tadding mob "..shark_prototype.name) +mobf_add_mob(shark_prototype) +minetest.log("action","MOD: mob_shark mod version " .. version .. " loaded") diff --git a/mods/hostils/mob_shark/locale/de.txt b/mods/hostils/mob_shark/locale/de.txt new file mode 100644 index 00000000..1cc75348 --- /dev/null +++ b/mods/hostils/mob_shark/locale/de.txt @@ -0,0 +1,3 @@ +# Translation by Xanthin + +Shark = Hai diff --git a/mods/hostils/mob_shark/locale/es.txt b/mods/hostils/mob_shark/locale/es.txt new file mode 100644 index 00000000..689ac49c --- /dev/null +++ b/mods/hostils/mob_shark/locale/es.txt @@ -0,0 +1,5 @@ +# Spanish translation for Animals Modpack. +# Traducción al español de Animals Modpack. +# Author/Autor: Diego Martínez + +Shark = Tiburon diff --git a/mods/hostils/mob_shark/locale/template.txt b/mods/hostils/mob_shark/locale/template.txt new file mode 100644 index 00000000..cafc35cb --- /dev/null +++ b/mods/hostils/mob_shark/locale/template.txt @@ -0,0 +1,3 @@ +# Template + +Shark = diff --git a/mods/hostils/mob_shark/models/mob_shark.b3d b/mods/hostils/mob_shark/models/mob_shark.b3d new file mode 100644 index 00000000..c076e594 Binary files /dev/null and b/mods/hostils/mob_shark/models/mob_shark.b3d differ diff --git a/mods/hostils/mob_shark/models/mob_shark.blend b/mods/hostils/mob_shark/models/mob_shark.blend new file mode 100644 index 00000000..a985bc31 Binary files /dev/null and b/mods/hostils/mob_shark/models/mob_shark.blend differ diff --git a/mods/hostils/mob_shark/textures/mob_shark_shark_item.png b/mods/hostils/mob_shark/textures/mob_shark_shark_item.png new file mode 100644 index 00000000..375890bf Binary files /dev/null and b/mods/hostils/mob_shark/textures/mob_shark_shark_item.png differ diff --git a/mods/hostils/mob_shark/textures/mob_shark_shark_mesh.png b/mods/hostils/mob_shark/textures/mob_shark_shark_mesh.png new file mode 100644 index 00000000..6c3bc69e Binary files /dev/null and b/mods/hostils/mob_shark/textures/mob_shark_shark_mesh.png differ