forked from mtcontrib/3d_armor
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
1869d4b0c3
@ -18,6 +18,7 @@ read_globals = {
|
||||
|
||||
-- deps
|
||||
"default",
|
||||
"player_api",
|
||||
"minetest",
|
||||
"unified_inventory",
|
||||
"wardrobe",
|
||||
|
@ -254,7 +254,7 @@ The above allows armor to block/prevent new damage types but you also need to as
|
||||
## Groups used by 3d_Armor
|
||||
3d_armor has many default groups already registered, these are categorized under 4 main headings
|
||||
- **Elements:** armor_head, armor_torso, armor_legs, armor_feet
|
||||
- **Attributes:** armor_heal, armor_fire, armor_water
|
||||
- **Attributes:** armor_heal, armor_fire, armor_water, armor_feather
|
||||
- **Physics:** physics_jump, physics_speed, physics_gravity
|
||||
- **Durability:** armor_use, flammable
|
||||
|
||||
@ -334,6 +334,9 @@ The below Diamond chestplate has a 12% chance to completely block all damage (ar
|
||||
damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
|
||||
})
|
||||
|
||||
#### Armor_feather
|
||||
***"Armor_feather"*** will slow a player when falling. This only has one level or state, which is armor_feather=1
|
||||
|
||||
### Physics
|
||||
The physics attributes supported by 3d_armor are ***physics_jump, physics_speed and physics_gravity***. Although 3d_armor supports the use of this with no other mods it is recommended that the mod [player_monoids](https://forum.minetest.net/viewtopic.php?t=14895) is used to help with intermod compatability.
|
||||
|
||||
|
@ -112,7 +112,7 @@ armor = {
|
||||
timer = 0,
|
||||
elements = {"head", "torso", "legs", "feet"},
|
||||
physics = {"jump", "speed", "gravity"},
|
||||
attributes = {"heal", "fire", "water"},
|
||||
attributes = {"heal", "fire", "water", "feather"},
|
||||
formspec = "image[2.5,0;2,4;armor_preview]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
@ -183,6 +183,7 @@ armor.config = {
|
||||
water_protect = true,
|
||||
fire_protect = minetest.get_modpath("ethereal") ~= nil,
|
||||
fire_protect_torch = minetest.get_modpath("ethereal") ~= nil,
|
||||
feather_fall = true,
|
||||
punch_damage = true,
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ end
|
||||
|
||||
-- Armor Player Model
|
||||
|
||||
default.player_register_model("3d_armor_character.b3d", {
|
||||
player_api.register_model("3d_armor_character.b3d", {
|
||||
animation_speed = 30,
|
||||
textures = {
|
||||
armor.default_skin..".png",
|
||||
@ -440,6 +440,20 @@ end, true)
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
timer = timer + dtime
|
||||
|
||||
if armor.config.feather_fall == true then
|
||||
for _,player in pairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
if armor.def[name].feather > 0 then
|
||||
local vel_y = player:get_velocity().y
|
||||
if vel_y < 0 and vel_y < 3 then
|
||||
vel_y = -(vel_y * 0.05)
|
||||
player:add_velocity({x = 0, y = vel_y, z = 0})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if timer <= armor.config.init_delay then
|
||||
return
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
name = 3d_armor
|
||||
depends = default
|
||||
depends = default, player_api
|
||||
optional_depends = player_monoids, armor_monoid, pova, fire, ethereal, bakedclay, moreores, nether
|
||||
description = Adds craftable armor that is visible to other players.
|
||||
|
Loading…
Reference in New Issue
Block a user