Commit graph

173 commits

Author SHA1 Message Date
trans_soup
249a698b52 refactor: stacking of leveled nodes.
extract level transfer between leveled nodes into own function, separate
from code that decides when and how to use that.
2023-10-22 22:13:28 +02:00
trans_soup
2de047d37a add utility alias for level-0 leveled nodes.
leveled nodes now have an alias from level 0 to air, meaning that code
that changes the level of a node doesn't have to differentiate between
setting its level, and removing the node when the level is supposed to
be 0.
2023-10-22 21:55:01 +02:00
trans_soup
4436b9068a make kindname comparison more reliable. 2023-10-22 21:44:47 +02:00
trans_soup
0bdbc5539a disable player fall damage. 2023-10-22 21:27:48 +02:00
trans_soup
f3d46e4d71 fix decomposition starting level.
leaves now preserve their level when they start decomposing.
2023-10-22 21:16:26 +02:00
trans_soup
4c21d9a015 fix decomposition with new leveled leaves.
decomposition will now start for all levels of leaves.
2023-10-22 21:11:07 +02:00
trans_soup
27288f4a84 make decaying leaves have random level. 2023-10-22 21:09:38 +02:00
trans_soup
20a85bd7b1 add group "leafy" to leaves. 2023-10-22 21:07:00 +02:00
trans_soup
54267faa88 make regular leaves leveled. 2023-10-22 21:06:38 +02:00
trans_soup
0f1452ca06 remove old comments. 2023-10-22 21:02:00 +02:00
trans_soup
c1bc0d18a5 fix alias for highest level of leveled nodes. 2023-10-21 22:43:39 +02:00
trans_soup
ddf0ada4ff minor fix.
replace an old leftover line.
2023-10-21 22:10:52 +02:00
trans_soup
81bdcf6951 fix decomposing leaves registration.
make decomposing leaves registration work with the new API support for
leveled nodes.
2023-10-21 22:10:00 +02:00
trans_soup
a06b0a08af fully implement leveled nodes.
add API support for leveled nodes, used via these two functions:

`blockgame.register_leveled_node` registers leveled nodes for each level
up to a given maximum.

`blockgame.check_for_stacking` checks whether a given node is
supposed to stack with its vertical neighbors, and if so handles that.
2023-10-21 22:08:46 +02:00
trans_soup
0c5d4891b7 add utility for extracting name parts.
add API function for splitting up an item identifier into its mod name
and item name parts.
2023-10-21 22:03:28 +02:00
trans_soup
8dfccdd315 remove unused variable. 2023-10-21 20:48:01 +02:00
trans_soup
29017dd835 Merge branch 'main' into leveled-nodes 2023-10-21 12:01:06 +02:00
trans_soup
f228dcac53 fix name validations in register_node wrapper.
`blockgame.register_node` now works both when the provided name includes
a mod name, and when it doesn't.

previously, including a mod name would break things, making the actual
name used for registration include the mod name twice.
2023-10-21 11:56:50 +02:00
trans_soup
8259231013 fix error in decomposing leaves placement.
one place accidentally used the position of the placed node, when it
should have used the position below that.
2023-10-21 11:47:12 +02:00
trans_soup
01bbe58e45 start working on leveled nodes.
start working on generalizing registration of leveled nodes. currently
broken.
2023-10-21 11:41:33 +02:00
trans_soup
bab117c98c add comment. 2023-10-21 11:15:25 +02:00
trans_soup
914f26e613 refactor: decomposition placement checks.
generalize a repeated node check into a single function.
2023-10-21 10:50:11 +02:00
trans_soup
c5a13d68c9 fix floating decomposing leaves.
leaves will now, upon beginning decomposition, check if there are
decomposing leaves on top of them which can fall down onto them. this
fixes an error where this situation would leave the top leaves visually
floating over the bottom leaves, even when there was space for them to
stack.
2023-10-21 10:38:16 +02:00
trans_soup
8584d0ac3e make living logs and saplings fall down.
add alive logs and saplings to the `faling_node` group.
2023-10-21 10:19:16 +02:00
trans_soup
40ff6896f2 update readme.
mention these in readme: how to get nuts; sapling world decoration.
2023-10-19 17:21:52 +02:00
trans_soup
3fa17f8b68 make decomposition require dirty nodes nearby.
decomposition will no longer happen unless the decomposing leaves are
touching a dirty node. thus, they can now be used for decoration in
non-dirty locations.
2023-10-19 17:14:39 +02:00
trans_soup
845e951d8d fix decomposing leaves construction.
decomposing leaves will now check if they can stack after being
constructed, fixing an error where there would be decomposing leaves
floating over other decomposing leaves.
2023-10-19 17:11:18 +02:00
trans_soup
ecd04f8105 balance: tweak decomposition rate bonuses.
decomposing leaves now provide a smaller bonus, and dirty nodes now
provide a larger bonus, than before.
2023-10-19 17:08:08 +02:00
trans_soup
37d192798e fix: decomposing leaves now check for falling.
leaves now call `minetest.check_for_falling` at their position when
decomposing into air. this fixes an error where falling nodes would be
left floating above decomposing leaves once said leaves disappeared.
2023-10-19 17:05:49 +02:00
trans_soup
123d3329cd increase decomposition temporal resolution.
make decomposition ABM:s happen more often. also decrease their chance
of happening, so that the overall balance isn't affected.
2023-10-19 16:51:14 +02:00
trans_soup
e42407978d add time control for decomposition.
add chat command that changes the rate at which decomposition happens.
2023-10-19 16:49:36 +02:00
trans_soup
400c27c021 tweak decomposition.
leaves will now start decomposing faster if touching certain nodes.
they'll also take longer overall to start decomposing.
2023-10-19 16:18:24 +02:00
trans_soup
ae26cfad42 refactor: make decomposition use new API function.
make leaves decomposition use the `blockgame.score_nearby_nodes` API
function (which was created largely from previous decomposition code).
2023-10-19 16:10:23 +02:00
trans_soup
a3537b5dda add blockgame.score_nearby_nodes utility to API.
expose public function that walks through nodes near a given position,
counting up a score based on their groups.
2023-10-19 16:08:25 +02:00
trans_soup
292358a3db balance: make decomposition more expensive.
decomposing leaves are now less likely to turn into dirt.
2023-10-19 16:00:43 +02:00
trans_soup
737afdfcc9 make leaves get a random level when they start decomposing. 2023-10-19 15:59:11 +02:00
trans_soup
7493d9771c balance: make it take longer for leaves to start decomposing. 2023-10-19 15:56:37 +02:00
trans_soup
87a88a88a6 fix sapling growth replacing certain nodes.
saplings can now replace alive leaves when growing (and other nodes can
easily be added in the future).

previously, instead of saplings, it was accidentally the case that
alive leaves growth worked like this when growing out of sapling,
instead of actual sapling growth.
2023-10-19 15:52:01 +02:00
trans_soup
717cbf91e2 fix leaves growth error.
make growing leaves turn into alive leaves if they should do so.
previously, this didn't happen for leaves that exceeded their max
distance from supporting node.
2023-10-19 15:39:04 +02:00
trans_soup
584187957a balance: tweak decomposition rate.
make leaves decompose bonuses from nearby nodes less powerful, and
increase decomposition cost.
2023-10-19 15:32:24 +02:00
trans_soup
c3bff227aa growing saplings can now replace living leaves. 2023-10-19 15:28:26 +02:00
trans_soup
3316dcba15 improve blockgame.attempt_place utility.
it now takes an optional argument that specifies what nodes may be
replaced (besides air).
2023-10-19 15:27:38 +02:00
trans_soup
477afad09e balance: tweak sapling growth rate. 2023-10-19 15:23:42 +02:00
trans_soup
1282fda837 make leaves growth use an increasing ABM.
this also means that leaves now grow slower.
2023-10-19 15:23:07 +02:00
trans_soup
0dffde9363 balance: make base decomposition rate slower.
(negligible when the decomposing leaves are touching several nodes that
make them decompose faster.)
2023-10-19 15:17:05 +02:00
trans_soup
f134082112 make nuts drop from leaves less often. 2023-10-19 15:14:02 +02:00
trans_soup
bdfb9f5fda make leaves only grow sideways.
previously, living leaves grew into more living leaves in all 6
directions. now, they only grow in the 4 horizontal directions.
2023-10-19 15:12:36 +02:00
trans_soup
19e392d1f3 make leaves grow at new sapling position.
make leaves grow out of the new (upper) sapling position instead of the
old (lower) position when saplings grow.
2023-10-19 15:09:53 +02:00
trans_soup
68e005814f refactor sapling support checking.
saplings now only check for groups, not specific nodes, when determining
whether they are supported. the previously checked nodes are now in the
new group that's being checked.
2023-10-19 15:08:53 +02:00
trans_soup
dd796c549e make unsupported roots die.
make `root_alive` nodes turn into `root` nodes if they're not touching
any of these nodes: `root_alive`, `log_alive`, `sapling`.
2023-10-19 14:53:15 +02:00