1
0
Fork 0

Update mobs_mc, properly implement totem

objects
Wuzzy 2018-01-25 21:03:58 +01:00
parent ed5c2c2019
commit e3cea04f12
11 changed files with 102 additions and 26 deletions

View File

@ -304,6 +304,7 @@ mobs_mc.spawn_height = {
mobs_mc.misc = {
shears_wear = 276, -- Wear to add per shears usage (238 uses)
totem_fail_nodes = {} -- List of nodes in which the totem of undying fails
}
-- Item name overrides from mobs_mc_gameconfig (if present)

View File

@ -519,22 +519,74 @@ end
-- Evoker
if c("totem") then
-- TODO: Implement actual MC totem behaviour
local hud_totem = {}
-- Totem of Undying
minetest.register_craftitem("mobs_mc:totem", {
description = S("Totem of Undying"),
_doc_items_longdesc = S("A totem of undying is a rare artifact which may safe you from certain death."),
_doc_items_usagehelp = S("Hold it in your hand and punch once to instantly get back to full health. The totem gets destroyed in the process."),
wield_image = "mcl_mobitems_totem.png",
inventory_image = "mcl_mobitems_totem.png",
_doc_items_usagehelp = S("The totem only works while you hold it in your hand. If you receive fatal damage, you are saved from death and you get a second chance with 1 HP. The totem is destroyed in the process, however."),
inventory_image = "mcl_totems_totem.png",
wield_image = "mcl_totems_totem.png",
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
user:set_hp(20)
if not minetest.settings:get_bool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
})
minetest.register_on_leaveplayer(function(player)
hud_totem[player:get_player_name()] = nil
end)
-- Save the player from death when holding totem of undying in hand
minetest.register_on_player_hpchange(function(player, hp_change)
local hp = player:get_hp()
-- Fatal damage?
if hp + hp_change <= 0 then
local wield = player:get_wielded_item()
if wield:get_name() == "mobs_mc:totem" then
local ppos = player:get_pos()
local pnname = minetest.get_node(ppos).name
-- Some exceptions when _not_ to save the player
for n=1, #mobs_mc.misc.totem_fail_nodes do
if pnname == mobs_mc.misc.totem_fail_nodes[n] then
return hp_change
end
end
-- Reset breath as well
if player:get_breath() < 11 then
player:set_breath(10)
end
if not minetest.settings:get_bool("creative_mode") then
wield:take_item()
player:set_wielded_item(wield)
end
-- Effects
minetest.sound_play({name = "mcl_totems_totem", gain=1}, {pos=ppos, max_hear_distance=16})
-- Big totem overlay
if not hud_totem[player:get_player_name()] then
hud_totem[player:get_player_name()] = player:hud_add({
hud_elem_type = "image",
text = "mcl_totems_totem.png",
position = { x=0.5, y=1 },
scale = { x=17, y=17 },
offset = { x=0, y=-178 },
})
minetest.after(3, function(player)
if player and player:is_player() then
local name = player:get_player_name()
if hud_totem[name] then
player:hud_remove(hud_totem[name])
hud_totem[name] = nil
end
end
end, player)
end
-- Set HP to exactly 1
return -hp + 1
end
end
return hp_change
end, true)
end
-- Rotten flesh

View File

@ -120,3 +120,6 @@ Origin of those models:
* Source: <https://freesound.org/people/haratman/sounds/393749/>
* `mobs_mc_zombie_hurt.ogg`
* Source: <https://freesound.org/people/haratman/sounds/393749/>
* [Spennnyyy](https://freesound.org/people/Spennnyyy/) (CC0)
* `mcl_totems_totem.ogg`
* Source: <https://freesound.org/people/Spennnyyy/sounds/323502/>

View File

@ -7,15 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-05 16:40+0200\n"
"PO-Revision-Date: 2017-07-20 15:05+0200\n"
"POT-Creation-Date: 2018-01-25 18:45+0100\n"
"PO-Revision-Date: 2018-01-25 18:48+0100\n"
"Last-Translator: Wuzzy <almikes@aol.com>\n"
"Language-Team: \n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.2\n"
"X-Generator: Poedit 2.0.5\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: 1_items_default.lua
@ -345,11 +345,13 @@ msgstr ""
#: 1_items_default.lua
msgid ""
"Hold it in your hand and punch once to instantly get back to full health. "
"The totem gets destroyed in the process."
"The totem only works while you hold it in your hand. If you receive fatal "
"damage, you are saved from death and you get a second chance with 1 HP. The "
"totem is destroyed in the process, however."
msgstr ""
"Halten Sie es in der Hand und schlagen Sie zu, um sofort auf die volle "
"Gesundheit zu kommen. Das zerstört das Totem."
"Der Totem funktioniert nur, während Sie ihn in der Hand halten. Wenn sie "
"tödlichen Schaden erhalten, werden Sie vom Tod bewahrt und erhalten eine "
"zweite Lebenschance mit 1 HP. Der Totem geht dabei jedoch zu Bruch."
#: 1_items_default.lua
msgid "Rotten Flesh"
@ -500,6 +502,10 @@ msgstr ""
"Ein Witherskelettschädel ist ein kleiner dekorativer Block, der wie der "
"Schädel eines Witherskeletts aussieht."
#: agent.lua
msgid "Agent"
msgstr "Agent"
#: bat.lua
msgid "Bat"
msgstr "Fledermaus"
@ -716,6 +722,13 @@ msgstr "Zombie"
msgid "Zombie Pigman"
msgstr "Schweinezombie"
#~ msgid ""
#~ "Hold it in your hand and punch once to instantly get back to full health. "
#~ "The totem gets destroyed in the process."
#~ msgstr ""
#~ "Halten Sie es in der Hand und schlagen Sie zu, um sofort auf die volle "
#~ "Gesundheit zu kommen. Das zerstört das Totem."
#~ msgid "Enderman Head (WIP)"
#~ msgstr "Endermankopf (unfertig)"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-20 14:43+0200\n"
"POT-Creation-Date: 2018-01-25 18:45+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -298,8 +298,9 @@ msgstr ""
#: 1_items_default.lua
msgid ""
"Hold it in your hand and punch once to instantly get back to full health. "
"The totem gets destroyed in the process."
"The totem only works while you hold it in your hand. If you receive fatal "
"damage, you are saved from death and you get a second chance with 1 HP. The "
"totem is destroyed in the process, however."
msgstr ""
#: 1_items_default.lua
@ -425,6 +426,10 @@ msgid ""
"skull of a wither skeleton."
msgstr ""
#: agent.lua
msgid "Agent"
msgstr ""
#: bat.lua
msgid "Bat"
msgstr ""

View File

@ -87,9 +87,9 @@ mobs:register_mob("mobs_mc:parrot", {
})
--spawn
-- TODO: Increase spawn chance if polished
mobs:spawn_specific("mobs_mc:parrot", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 30000, 1, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max)
-- Spawn disabled because parrots are not very smart.
-- TODO: Re-enable when parrots are finished
--mobs:spawn_specific("mobs_mc:parrot", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 30000, 1, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max)
-- spawn eggs
mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0)

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 346 B

After

Width:  |  Height:  |  Size: 346 B

View File

@ -176,6 +176,9 @@ mobs_mc.override.enderman_takable = {
mobs_mc.override.enderman_replace_on_take = {
["mcl_core:dirt_with_dry_grass"] = "mcl_core:dirt_with_grass",
}
mobs_mc.override.misc = {
totem_fail_nodes = { "mcl_core:void", "mcl_core:realm_barrier" },
}
-- Texuture overrides for enderman block. Required for cactus because it's original is a nodebox
-- and the textures have tranparent pixels.

View File

@ -7,7 +7,6 @@ local wip_items = {
"mcl_observers:observer_off",
"mcl_observers:observer_on",
"mcl_chests:trapped_chest",
"mobs_mc:totem",
"mcl_comparators:comparator_off_comp",
"mcl_minecarts:hopper_minecart",
"mcl_minecarts:command_block_minecart",

View File

@ -666,7 +666,7 @@ Source path,Source file,Target path,Target file,xs,ys,xl,yl,xt,yt,Blacklisted?
/assets/minecraft/textures/blocks,glass_pane_top_silver.png,/mods/ITEMS/xpanes/textures,xpanes_top_glass_silver.png,,,,,,,
/assets/minecraft/textures/blocks,glass_pane_top_white.png,/mods/ITEMS/xpanes/textures,xpanes_top_glass_white.png,,,,,,,
/assets/minecraft/textures/blocks,glass_pane_top_yellow.png,/mods/ITEMS/xpanes/textures,xpanes_top_glass_yellow.png,,,,,,,
/assets/minecraft/textures/items,totem.png,/mods/ENTITIES/mobs_mc/textures,mcl_mobitems_totem.png,,,,,,,
/assets/minecraft/textures/items,totem.png,/mods/ENTITIES/mobs_mc/textures,mcl_totems_totem.png,,,,,,,
/assets/minecraft/textures/entity,bat.png,/mods/ENTITIES/mobs_mc/textures,mobs_mc_bat.png,,,,,,,
/assets/minecraft/textures/entity,blaze.png,/mods/ENTITIES/mobs_mc/textures,mobs_mc_blaze.png,,,,,,,
/assets/minecraft/textures/entity/cat,black.png,/mods/ENTITIES/mobs_mc/textures,mobs_mc_cat_black.png,,,,,,,

1 Source path Source file Target path Target file xs ys xl yl xt yt Blacklisted?
666 /assets/minecraft/textures/blocks glass_pane_top_silver.png /mods/ITEMS/xpanes/textures xpanes_top_glass_silver.png
667 /assets/minecraft/textures/blocks glass_pane_top_white.png /mods/ITEMS/xpanes/textures xpanes_top_glass_white.png
668 /assets/minecraft/textures/blocks glass_pane_top_yellow.png /mods/ITEMS/xpanes/textures xpanes_top_glass_yellow.png
669 /assets/minecraft/textures/items totem.png /mods/ENTITIES/mobs_mc/textures mcl_mobitems_totem.png mcl_totems_totem.png
670 /assets/minecraft/textures/entity bat.png /mods/ENTITIES/mobs_mc/textures mobs_mc_bat.png
671 /assets/minecraft/textures/entity blaze.png /mods/ENTITIES/mobs_mc/textures mobs_mc_blaze.png
672 /assets/minecraft/textures/entity/cat black.png /mods/ENTITIES/mobs_mc/textures mobs_mc_cat_black.png