master
Kyra Zimmer 2020-08-12 11:50:33 +02:00
parent a262fdca3c
commit 7afb5c753e
1 changed files with 3 additions and 97 deletions

View File

@ -1,20 +1,6 @@
storage = minetest.get_mod_storage()
hb.settings.max_bar_length = 230 -- hudbars is a bit broken
if false -- moreores support, seems to have been fixed by new submodule
toolranks.add_tool "moreores:pick_mithril"
toolranks.add_tool "moreores:shovel_mithril"
toolranks.add_tool "moreores:sword_mithril"
toolranks.add_tool "moreores:axe_mithril"
toolranks.add_tool "moreores:pick_silver"
toolranks.add_tool "moreores:shovel_silver"
toolranks.add_tool "moreores:sword_silver"
toolranks.add_tool "moreores:axe_silver"
if true -- nssm doesn't know about toolranks
do -- nssm doesn't know about toolranks
-- literally generated using: grep register_tool nssm/nssm_materials.lua
-- and search+replace
toolranks.add_tool "nssm:sun_sword"
@ -54,7 +40,7 @@ if true -- nssm doesn't know about toolranks
if true -- allow cactus damage by shrinking its collision box and enabling "immersed" dps
do -- allow cactus damage by shrinking its collision box and enabling "immersed" dps
cactus = WSU.registered "node", "default:cactus"
cactus.collision_box={
type: "fixed",
@ -66,7 +52,7 @@ if true -- allow cactus damage by shrinking its collision box and enabling "imme
minetest.register_node ":default:cactus", cactus
if true -- fooditems via ugly debug hack, but surprisingly efficient! catches anything using `item_eat`/`on_item_eat`.
do -- fooditems via ugly debug hack, but surprisingly efficient! catches anything using `item_eat`/`on_item_eat`.
scan_item=(name)->
if minetest.registered_craftitems[name]._hunger_ng
return
@ -84,83 +70,3 @@ if true -- fooditems via ugly debug hack, but surprisingly efficient! catches an
}
for n,v in pairs minetest.registered_craftitems
scan_item n
if false -- fooditems for nssm; replaced above
nssm_craftitem_eat=(name,_desc,satiates)->
heals = math.floor(satiates/4)
minetest.log 'action','[WBG:modcompat] registering nssm fooditem "%s" with hunger_ng'\format name
hunger_ng.add_hunger_data "nssm:"..name, {
heals: heals
satiates: satiates
}
nssm_craftitem_eat 'werewolf_leg','Werewolf Leg',3
nssm_craftitem_eat 'felucco_steak','Felucco Steak',3
nssm_craftitem_eat 'roasted_felucco_steak','Roasted Felucco Steak',6
nssm_craftitem_eat 'heron_leg','Moonheron Leg',2
nssm_craftitem_eat 'chichibios_heron_leg',"Chichibio's Moonheron Leg",4
nssm_craftitem_eat 'crocodile_tail','Crocodile Tail',3
nssm_craftitem_eat 'roasted_crocodile_tail','Roasted Crocodile Tail',6
nssm_craftitem_eat 'roasted_werewolf_leg','Roasted_Werewolf Leg',6
nssm_craftitem_eat 'duck_legs','Duck Legs',1
nssm_craftitem_eat 'roasted_duck_legs','Roasted Duck Leg',3
nssm_craftitem_eat 'ant_leg','Ant Leg',-1
nssm_craftitem_eat 'roasted_ant_leg','Roasted Ant Leg',4
nssm_craftitem_eat 'spider_leg','Spider Leg',-1
nssm_craftitem_eat 'roasted_spider_leg','Roasted Spider Leg',4
nssm_craftitem_eat 'tentacle','Tentacle',2
nssm_craftitem_eat 'roasted_tentacle','Roasted Tentacle',5
nssm_craftitem_eat 'worm_flesh','Worm Flesh',-2
nssm_craftitem_eat 'roasted_worm_flesh','Roasted Worm Flesh',4
nssm_craftitem_eat 'amphibian_heart','Amphibian Heart',1
nssm_craftitem_eat 'roasted_amphibian_heart','Roasted Amphibian Heart',8
nssm_craftitem_eat 'raw_scrausics_wing','Raw Scrausics Wing',1
nssm_craftitem_eat 'spicy_scrausics_wing','Spicy Scrausics Wing',6
nssm_craftitem_eat 'phoenix_nuggets','Phoenix Nuggets',20
nssm_craftitem_eat 'phoenix_tear','Phoenix Tear',20
nssm_craftitem_eat 'frosted_amphibian_heart','Frosted Amphibian Heart',-1
nssm_craftitem_eat 'surimi','Surimi',4
nssm_craftitem_eat 'amphibian_ribs','Amphibian Ribs',2
nssm_craftitem_eat 'roasted_amphibian_ribs','Roasted Amphibian Ribs',6
nssm_craftitem_eat 'dolidrosaurus_fin','Dolidrosaurus Fin',-2
nssm_craftitem_eat 'roasted_dolidrosaurus_fin','Roasted Dolidrosaurus Fin',4
nssm_craftitem_eat 'larva_meat','Larva Meat',-1
nssm_craftitem_eat 'larva_juice','Larva Juice',-3
nssm_craftitem_eat 'larva_soup','Larva Soup',10
nssm_craftitem_eat 'mantis_meat','Mantis Meat',1
nssm_craftitem_eat 'roasted_mantis_meat','Roasted Mantis Meat',4
nssm_craftitem_eat 'spider_meat','Spider Meat',-1
nssm_craftitem_eat 'roasted_spider_meat','Roasted Spider Meat',3
nssm_craftitem_eat 'silk_gland','Silk Gland',-1
nssm_craftitem_eat 'roasted_silk_gland','Roasted Silk Gland',3
nssm_craftitem_eat 'super_silk_gland','Super Silk Gland',-8
nssm_craftitem_eat 'roasted_super_silk_gland','Roasted Super Silk Gland',2
if false -- register hunger data for any other items, undoing the "keep out of other mods' way" policy of hunger_ng; replaced above
-- don't ask, srsly...
--file = io.open minetest.get_modpath('wbg_modcompat')..'/loaditems.txt', 'w'
--file\write storage\get_string 'fallback_hunger_items'
--file\close!
bbqitems={["bbq:smoked_pepper"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:pickled_peppers"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:stuffed_chop"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:bacon"]: {["heals"]: 1, ["satiates"]: 7}, ["bbq:pepper_steak_raw"]: {["heals"]: 1, ["satiates"]: 4}, ["bbq:leg_lamb"]: {["heals"]: 2, ["satiates"]: 9}, ["bbq:ham"]: {["heals"]: 2, ["satiates"]: 9}, ["bbq:rack_lamb_raw"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:sugar"]: {["heals"]: 0, ["satiates"]: 2}, ["bbq:bbq_chicken_raw"]: {["heals"]: 1, ["satiates"]: 4}, ["bbq:veggie_kebab_raw"]: {["heals"]: 1, ["satiates"]: 4}, ["bbq:stuffed_mushroom_raw"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:beef"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:pepper_steak"]: {["heals"]: 2, ["satiates"]: 10}, ["bbq:bacon_cheeseburger"]: {["heals"]: 2, ["satiates"]: 9}, ["bbq:corned_beef_raw"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:hamburger_patty_raw"]: {["heals"]: 0, ["satiates"]: 3}, ["bbq:stuffed_chop_raw"]: {["heals"]: 0, ["satiates"]: 3}, ["bbq:grilled_tomato"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:grilled_pizza"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:veggie_packet_raw"]: {["heals"]: 1, ["satiates"]: 4}, ["bbq:grilled_pizza_raw"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:bbq_beef_ribs_raw"]: {["heals"]: 1, ["satiates"]: 4}, ["bbq:brisket_raw"]: {["heals"]: 1, ["satiates"]: 4}, ["bbq:beef_raw"]: {["heals"]: 0, ["satiates"]: 3}, ["bbq:stuffed_pepper"]: {["heals"]: 2, ["satiates"]: 9}, ["bbq:stuffed_mushroom"]: {["heals"]: 2, ["satiates"]: 9}, ["bbq:hot_wings_raw"]: {["heals"]: 0, ["satiates"]: 3}, ["bbq:beef_jerky_raw"]: {["heals"]: 0, ["satiates"]: 2}, ["bbq:stuffed_pepper_raw"]: {["heals"]: 1, ["satiates"]: 4}, ["bbq:cheese_steak"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:rack_lamb"]: {["heals"]: 2, ["satiates"]: 10}, ["bbq:pulled_pork"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:london_broil_raw"]: {["heals"]: 0, ["satiates"]: 3}, ["bbq:beef_jerky"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:corned_beef"]: {["heals"]: 2, ["satiates"]: 10}, ["bbq:hotdog_cooked"]: {["heals"]: 1, ["satiates"]: 7}, ["bbq:london_broil"]: {["heals"]: 1, ["satiates"]: 7}, ["bbq:hotdog_raw"]: {["heals"]: 0, ["satiates"]: 3}, ["bbq:hamburger_patty"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:bacon_raw"]: {["heals"]: 0, ["satiates"]: 3}, ["bbq:veggie_kebab"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:portebello_steak_raw"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:tomato_sauce"]: {["heals"]: 0, ["satiates"]: 2}, ["bbq:bbq_beef_ribs"]: {["heals"]: 2, ["satiates"]: 9}, ["bbq:lamb_kebab_raw"]: {["heals"]: 0, ["satiates"]: 2}, ["bbq:hamburger"]: {["heals"]: 2, ["satiates"]: 9}, ["bbq:veggie_packet"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:bbq_chicken"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:lamb_kebab"]: {["heals"]: 1, ["satiates"]: 4}, ["bbq:ham_raw"]: {["heals"]: 1, ["satiates"]: 4}, ["bbq:hotdog"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:beer"]: {["heals"]: 1, ["satiates"]: 6}, ["bbq:hot_wings"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:grilled_corn"]: {["heals"]: 2, ["satiates"]: 8}, ["bbq:grilled_corn_raw"]: {["heals"]: 1, ["satiates"]: 5}, ["bbq:portebello_steak"]: {["heals"]: 2, ["satiates"]: 9}, ["bbq:brisket"]: {["heals"]: 2, ["satiates"]: 9}, ["bbq:leg_lamb_raw"]: {["heals"]: 1, ["satiates"]: 4}}
loaditems = minetest.deserialize storage\get_string 'fallback_hunger_items'
if not loaditems
loaditems = {}
for name, data in pairs bbqitems
loaditems[name]=data
for name, data in pairs loaditems
minetest.log 'action','[WBG:modcompat] registering loaded fooditem "%s" with hunger_ng'\format name
hunger_ng.add_hunger_data name, data
minetest.register_on_item_eat (hp_change, replace_with_item, itemstack, user, pointed_thing)->
definition = itemstack\get_definition!._hunger_ng
if definition
return false
name = itemstack\get_name!
data = {
heals: math.floor(hp_change / 4)
satiates: hp_change
}
loaditems[name]=data
hunger_ng.add_hunger_data name, data
minetest.log 'warning','[WBG:modcompat] registering new fooditem "%s" with hunger_ng'\format name
storage\set_string 'fallback_hunger_items', minetest.serialize loaditems