mt-mods / technic

Technic mod for Minetest
18 stars 24 forks source link

Mining drill and laser EU requirement based on node groups #159

Open S-S-X opened 3 years ago

S-S-X commented 3 years ago

https://minetest.gitlab.io/minetest/groups/

Just like other tools speed is affected by node groups make drill and laser use energy based on groups. Harder nodes should use more energy while softer ones use less.

Please do understand this, otherwise you cannot use the system to it's full potential. -- celeron55

BuckarooBanzay commented 3 years ago

The drill code is pretty easy to retrofit i think: https://github.com/mt-mods/technic/blob/7cdb21ae56a3ea74784e4fa3c6fa45a8b73c8772/technic/tools/mining_drill.lua#L49-L63

Not sure about the laser, most "digging" logic seems to be in here: https://github.com/mt-mods/technic/blob/7cdb21ae56a3ea74784e4fa3c6fa45a8b73c8772/technic/tools/mining_lasers.lua#L36-L50

Is there even a helper function in the api to determine/evaluate all those groups?

S-S-X commented 3 years ago

Is there even a helper function in the api to determine/evaluate all those groups?

There is thing that could be used:

Then do some more or less clever math with time and wear to get factor for base energy usage.