- Closes #17
This commit is contained in:
Leslie Krause 2020-05-13 23:53:00 -04:00
parent 0ae41552a8
commit 497d5e29f7
14 changed files with 129 additions and 26 deletions

View File

@ -1,4 +1,4 @@
Mobs Lite Mod v1.3
Mobs Lite Mod v1.4
By Leslie E. Krause
Mobs Lite is a fully-working proof of concept for the Extended Motion Mechanics API for
@ -24,12 +24,18 @@ Here are some of the other highlights of the Mobs Lite engine:
* Sensitivity thresholds and certainty factors determine whether creatures "see" a player
within their view cone.
* Discrete awareness stages permit mobs to slowly ramp up or cool down alertness based on
the target's visibility.
* Animals will attempt to flee to safety when a player that previously punched them
returns to the field of view.
* Animals can be programmed to follow players that are wielding food and to eat directly
from the player's hand.
* Monsters burst into multiple gibs when killed by explosive charges such as fire arrows,
landmines, and dynamite.
* Seamless integration with Axon allows Mobs to react to various environmental stimulii
like smells, sounds, etc.
@ -109,14 +115,29 @@ Multimedia License (textures, sounds, and models)
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
/sounds/mobs_damage_hand.ogg
by MTJohnson
by shelbyshark
modified by sorcerykid
obtained from https://freesound.org/people/MTJohnson/sounds/426308/
obtained from https://freesound.org/people/shelbyshark/sounds/444703/
/sounds/mobs_damage_tool.ogg
by Kreastricon62
by satanicupsman
modified by sorcerykid
objained from https://freesound.org/people/Kreastricon62/sounds/323526/
objained from https://freesound.org/people/satanicupsman/sounds/144015/
/sounds/mobs_damage_tool.ogg
by rcroller
modified by sorcerykid
objained from https://freesound.org/people/rcroller/sounds/424144/
/sounds/mobs_gib_chunky.1.ogg
by GreenFireSound
modified by sorcerykid
objained from https://freesound.org/people/GreenFireSound/sounds/481090/
/sounds/mobs_gib_chunky.2.ogg
by GreenFireSound
modified by sorcerykid
objained from https://freesound.org/people/GreenFireSound/sounds/481090/
/textures/mobs_spider.png
by AspireMint

View File

@ -1,2 +1,3 @@
tnt
default
physics

View File

@ -308,6 +308,52 @@ end )
--------------------
minetest.register_entity( "mobs:gibbage", {
physical = true,
visual = "mesh",
visual_size = { x = 1.0, y = 1.0 },
collisionbox = { -0.2, -0.1, -0.2, 0.2, 0.1, 0.2 },
motion_sounds = { },
physics = {
density = 0.5,
elasticity = 0.2,
resistance = 0.0,
friction = 0.7,
},
on_activate = function ( self, staticdata, dtime )
BasicPhysics( self )
self.timekeeper = Timekeeper( self )
self.timekeeper.start( math.random( 4, 8 ), "gibbage", function ( )
self.object:remove( )
end )
if dtime > 0 then
self.object:remove( )
return
end
end,
on_step = function ( self, dtime, pos )
self.timekeeper.on_step( dtime )
end,
launch = function ( self, intensity, texture, piece, sound )
local obj = self.object
obj:set_properties( {
mesh = "gib_" .. piece .. ".b3d",
textures = { texture },
} )
local vel_horz = min( 4, intensity * 0.5 )
local vel_vert = min( 4, intensity * 0.7 )
obj:set_velocity( vector.new( random_range( -vel_horz, vel_horz ), vel_vert, random_range( -vel_horz, vel_horz ) ) )
obj:set_animation( { x = 0, y = 120 }, random( 20, 40 ), 0, false )
self.motion_sounds.bouncing = sound
end,
} )
mobs.register_mob = function ( name, def )
minetest.register_entity( name, {
type = def.type,
@ -325,6 +371,7 @@ mobs.register_mob = function ( name, def )
textures = def.textures,
makes_footstep_sound = def.makes_footstep_sound,
makes_bloodshed_effect = def.makes_bloodshed_effect,
gibbage_params = def.gibbage_params,
receptrons = def.receptrons,
death_message = def.death_message,
alertness_states = def.alertness_states,
@ -1309,7 +1356,24 @@ mobs.register_mob = function ( name, def )
if damage == 0 then return end
if self.makes_bloodshed_effect and random( 2 ) == 2 then
if hp - damage <= 0 and self.gibbage_params then
local params = self.gibbage_params
local intensity = 0
for k, v in pairs( tool_capabilities.damage_groups ) do
if params.damage_groups[ k ] and v >= params.damage_groups[ k ] then
intensity = max( intensity, v ) -- get maximum intensity among all damage groups
end
end
if intensity > 0 then
for i = 1, #params.pieces do
local obj = minetest.add_entity( vector.offset_y( self.pos, 1.5 ), "mobs:gibbage" )
obj:get_luaentity( ):launch(
intensity, params.textures[ random( #params.textures ) ], params.pieces[ i ], params.sound )
end
else
blood_effect( pos )
end
elseif self.makes_bloodshed_effect and random( 2 ) == 2 then
blood_effect( pos )
end

BIN
models/gib_large.b3d Normal file

Binary file not shown.

BIN
models/gib_small.b3d Normal file

Binary file not shown.

BIN
models/gib_teeny.b3d Normal file

Binary file not shown.

View File

@ -28,7 +28,6 @@ mobs.register_mob( "mobs:ghost", {
groups = { mob = 1, monster = 1, flies = 1, jumps = 1, mobile = 1 },
textures = { "mobs_ghost.png" },
makes_footstep_sound = false,
makes_bloodshed_effect = false,
@ -36,11 +35,11 @@ mobs.register_mob( "mobs:ghost", {
alertness_states = {
ignore = { view_offset = 2, view_radius = 8, view_height = 8, view_acuity = 0 },
search = { view_offset = 2, view_radius = 14, view_height = 8, view_acuity = 3, view_filter = function ( self, obj, clarity )
return clarity == 0.0 and "search" or "attack"
end },
return clarity == 0.0 and "search" or "attack"
end },
attack = { view_offset = 2, view_radius = 14, view_height = 8, view_acuity = 3 , view_filter = function ( self, obj, clarity )
return clarity == 0.0 and "search" or "attack"
end },
return clarity == 0.0 and "search" or "attack"
end },
escape = { view_offset = 2, view_radius = 14, view_height = 8, view_acuity = 3 },
},
awareness_stages = {
@ -130,19 +129,32 @@ mobs.register_mob( "mobs:spider", {
groups = { mob = 1, monster = 1, walks = 1, jumps = 1, mobile = 1 },
textures = { "mobs_spider.png" },
makes_footstep_sound = false,
makes_bloodshed_effect = true,
gibbage_params = {
pieces = { "teeny", "teeny", "teeny" },
sound = "mobs_gib_chunky",
damage_groups = { blast_stim = 3 },
textures = { "mobs_spider_gib.png" }
},
gibbage_params = {
pieces = { "teeny", "teeny" },
sound = "mobs_gib_chunky",
damage_groups = { blast_stim = 3 },
textures = { "mobs_paniki_gib.png" }
},
hunger_params = { offset = 0.3, spread = 4.0 },
alertness_states = {
ignore = { view_offset = 6, view_radius = 6, view_height = 6, view_acuity = 3 },
search = { view_offset = 6, view_radius = 12, view_height = 6, view_acuity = 5, view_filter = function ( self, obj, clarity )
return clarity == 0.0 and "search" or "attack"
end },
return clarity == 0.0 and "search" or "attack"
end },
attack = { view_offset = 6, view_radius = 12, view_height = 6, view_acuity = 5, view_filter = function ( self, obj, clarity )
return clarity == 0.0 and "search" or "attack"
end },
return clarity == 0.0 and "search" or "attack"
end },
escape = { view_offset = 6, view_radius = 12, view_height = 6, view_acuity = 5 },
},
awareness_stages = {
@ -198,7 +210,10 @@ mobs.register_mob( "mobs:spider", {
damage_hand = "mobs_damage_hand",
},
drops = {
{ name = "farming:blueberries", chance = 6, min = 1, max = 2 },
{ name = "farming:raspberries", chance = 6, min = 1, max = 2 },
{ name = "default:grass_1", chance = 8, min = 1, max = 2 },
{ name = "default:shrub", chance = 8, min = 1, max = 2 },
},
on_rightclick = nil,
} )
@ -234,7 +249,6 @@ mobs.register_mob( "mobs:bat", {
groups = { mob = 1, monster = 1, flies = 1, jumps = 1, mobile = 1 },
textures = { "mobs_paniki.png" }, --paniki from minetest defense
makes_footstep_sound = false,
makes_bloodshed_effect = true,
@ -242,11 +256,11 @@ mobs.register_mob( "mobs:bat", {
alertness_states = {
ignore = { view_offset = 10, view_radius = 15, view_height = 15, view_acuity = 3 },
search = { view_offset = 10, view_radius = 20, view_height = 15, view_acuity = 5, view_filter = function ( self, obj, clarity )
return clarity == 0.0 and "search" or "attack"
end },
return clarity == 0.0 and "search" or "attack"
end },
attack = { view_offset = 10, view_radius = 20, view_height = 15, view_acuity = 5, view_filter = function ( self, obj, clarity )
return clarity == 0.0 and "search" or "attack"
end },
return clarity == 0.0 and "search" or "attack"
end },
escape = { view_offset = 10, view_radius = 20, view_height = 15, view_acuity = 3 },
},
awareness_stages = {
@ -304,6 +318,7 @@ mobs.register_mob( "mobs:bat", {
},
drops = {
{ name = "default:apple", chance = 4, min = 1, max = 2 },
{ name = "default:orange", chance = 4, min = 1, max = 2 },
},
} )
@ -338,7 +353,6 @@ mobs.register_mob( "mobs:griefer_ghost", {
groups = { mob = 1, monster = 1, walks = 1, jumps = 1, mobile = 1 },
textures = { "mobs_oerkki.png" },
makes_footstep_sound = true,
makes_bloodshed_effect = false,
@ -346,11 +360,11 @@ mobs.register_mob( "mobs:griefer_ghost", {
alertness_states = {
ignore = { view_offset = 5, view_radius = 10, view_height = 8, view_acuity = 2 },
search = { view_offset = 5, view_radius = 20, view_height = 8, view_acuity = 2, view_filter = function ( self, obj, clarity )
return clarity == 0.0 and "search" or "attack"
end },
return clarity == 0.0 and "search" or "attack"
end },
attack = { view_offset = 5, view_radius = 20, view_height = 8, view_acuity = 2, view_filter = function ( self, obj, clarity )
return clarity == 0.0 and "search" or "attack"
end },
return clarity == 0.0 and "search" or "attack"
end },
escape = { view_offset = 5, view_radius = 20, view_height = 8, view_acuity = 2 },
},
awareness_stages = {
@ -405,6 +419,9 @@ mobs.register_mob( "mobs:griefer_ghost", {
},
drops = {
{ name = "default:papyrus", chance = 6, min = 1, max = 2 },
{ name = "default:cactus", chance = 6, min = 1, max = 2 },
{ name = "farming:pumpkin_slice", chance = 8, min = 1, max = 2 },
{ name = "farming:melon_slice", chance = 8, min = 1, max = 2 },
},
} )

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B