106 Commits

Author SHA1 Message Date
Aaron Suen
64f4abff59 New texture for staff/ladder/frame.
Grain of bark now runs along the stick/staff in each direction,
rather than having "rings" along some axes.
2020-02-21 07:30:32 -05:00
Aaron Suen
828312d452 Cache to account for metadata jitteriness.
It seems that when we access metadata too rapidly
it pulls data out of order or something, so that the
player damage time stuff is unstable, and healing can
start immediately, or more than 8 seconds later.

Caching this stuff manually seems to work around the
issue, and it seems that the metadata system is at
least EVENTUALLY consistent, so it's still good for
long-term use or across world unloads.
2020-02-19 21:05:20 -05:00
Aaron Suen
1a9eafd04f Fix wood tool tint mismatching planks. 2020-02-18 21:34:01 -05:00
Aaron Suen
484c1a337f More subdued look for molten glass, image opt. 2020-02-18 20:10:08 -05:00
Aaron Suen
2ac5403149 The last few texture tweaks. 2020-02-18 19:57:30 -05:00
Aaron Suen
91b5d55320 Fix rakes digging when picked up. 2020-02-14 21:22:14 -05:00
Aaron Suen
b44263e332 Fix rakes losing or duplicating items. 2020-02-14 21:15:24 -05:00
Aaron Suen
efea4c0047 Rake reforms and cleanup.
- Simplify and then optimize code.
- Default rake mode digs up all rakable items in area.
- Sneak+dig digs up only matching items/stacks.
2020-02-09 10:12:16 -05:00
Aaron Suen
2bd26f790e Don't stack-as-node unless falling_repose=1.
...except for fluids and hot potatoes.
2020-01-29 08:50:04 -05:00
Aaron Suen
b220480f35 Wooden frames should not stack-as-node. 2020-01-29 08:47:59 -05:00
Aaron Suen
39f8abb703 Adzes can dig grass.
They act like a weak shovel now.  This should
ease some early game frustrations for new
players until they figure out proper tools.
2020-01-12 15:07:45 -05:00
Aaron Suen
4d47ab2e75 NC API dependency simplification.
Treat all API mods as a "layer", and use the new
nc_api_all registration to indicate that a mod depends
on the NC API (which ALL NC mods assume they do).
This means that each non-API mod does not need to
worry about which API mods it really needs and which
it does not, nor will they need to be updated for any
internal API restructures.

This is a game, not a modpack, so all mods will be
loaded anyway, and we only care about order.  That
means that we don't really need to worry about
having excess dependencies because any mod we
don't actually need will be needed by something that's
loaded anyway.  If somebody wants to reuse a
component elsewhere, they're likely to need to do
some work to untangle it anyway, because of the
amount that NodeCore mechanics interact and
interdepend.
2020-01-05 12:59:12 -05:00
Aaron Suen
dcfc80b367 Remove explicit names in mod.confs. 2020-01-05 12:38:45 -05:00
Aaron Suen
7050568938 Dammit dammit z-fighting hacks.
- Unbake the scaling tweak from models, apply it
  using mesh scaling in MT instead.
- Standardize ratio definition in one place.
- Default all nodeboxes to winning z-fights.
2019-12-08 23:14:56 -05:00
Aaron Suen
3d11536b81 Fix ugly frames/ladders/staves/rods.
Automatic z-fighting prevention was causing some
nodes to fail to connect to neighbors due to the tiny
gaps.  Allow certain nodes to "win" the z-fight instead
so they also connect to neighbors properly.
2019-12-08 17:19:47 -05:00
Aaron Suen
ce58f8294c Refactor shelf API/assets into its own module. 2019-12-08 16:41:59 -05:00
Aaron Suen
a53030cdcf Use a mesh instead of nodebox for shelves.
In principle this should be equivalent to 2 cuboids
instead of 6.  In practice, FPS improvements are
hard to measure.
2019-12-08 16:13:44 -05:00
Aaron Suen
e99c72154d Shelf standarization and tweaks.
- Refactor common code.
- Allow placement of wood shelves inside lode crates.
2019-12-07 18:25:05 -05:00
Aaron Suen
a695ac4071 Fix runaway shelf-item fires. 2019-12-01 16:54:15 -05:00
Aaron Suen
6e1f3fee94 Standardize intra-line spacing in code. 2019-12-01 11:08:12 -05:00
Aaron Suen
b9e2f822f8 New flexible find_nodes_around api. 2019-11-30 10:28:35 -05:00
Aaron Suen
e769727f93 Simplify name of Adze. 2019-11-23 09:36:31 -05:00
Aaron Suen
a9531b5225 Show bandolier slots as placeholder ents. 2019-11-18 20:28:58 -05:00
Aaron Suen
6f3bb30825 Fix rake taking credit for hand-digging nodes.
When you have a thing in your hand that doesn't help
you dig a node, but you can dig that node by hand,
then apparently the after_use callback still seems to
trigger, causing the rake effect, and wear-out.
2019-10-31 21:33:53 -04:00
Aaron Suen
aebbef9720 Rake also gathers excess loose items to center.
Any items that don't fit in the player's inventory will gather
to the center of the raked area, so they can combine and pile
together for easier pickup later.
2019-10-30 07:59:36 -04:00
Aaron Suen
11314033e8 Rake tool easily cleans up messes. 2019-10-29 23:20:09 -04:00
Aaron Suen
4eb4e80bc7 Fix log splitting. 2019-10-13 09:19:08 -04:00
Aaron Suen
0ed1c497fd Missing some coremod registrations...?! 2019-10-05 17:42:02 -04:00
Aaron Suen
c147da4dde Convert from depends.txt to mod.conf 2019-10-05 11:24:16 -04:00
Aaron Suen
77de117ea1 Place certain stacks as nodes.
If a node is specially tagges with the stack_as_node group, and
the stack size is exactly 1, place as a real node instead of a
stack node.

This reinstates logic from WAY back in the super-early pre-alpha
days, except only for nodes explicitly tagged this way.

This should be applied only to nodes that aren't transformed in
any non-desirable way when placed as nodes instead of stacks, and
can be dug the same ways as stacks (i.e. snappy = 1 or
crumbly = 1).

Currently applied to sticks, staves, leaves, ladders/frames,
and torches.  Ladder/frame placement offers some interesting
possibilities in terms of throwing ladders to rappel down holes.
2019-10-01 18:59:53 -04:00
Aaron Suen
54cc3445d3 Further shelf placement fixes. 2019-09-21 12:12:52 -04:00
Aaron Suen
2a3e0cc3ca Fix vertical shelf building.
Placing a shelf against the side of another shelf was possible
with a simple right-click, but placing one against the top or
bottom of another shelf didn't work.  This fixes that.
2019-09-21 09:50:26 -04:00
Aaron Suen
9a75f4c87a More flexible burning API.
Stone, lode, and lux tools now all have their handles burn, and
eject the non-flammable portions of the tool.

Now using a unified on_ignite hook for when flammable things catch
fire.  The call is made BEFORE the node is replaced, and has an
opportunity to look at node metadata and eject anything
non-flammable.

It can be a function, e.g. for shelves, or a static value in the
same format that the function would return (e.g. for lode tools
which need string values for temper substitutions).

If it returns a string or itemstack, it will eject that from the
position where the node burned.  If it returns a table it will
eject all the values of that table.
2019-09-07 11:28:51 -04:00
Aaron Suen
39dea8a2ae MAJOR: Code quality audit using luacheck.
- Removed lots of unused variables, a few shadowed identifiers.
- Removed a few sections of dead code.
2019-08-31 09:26:53 -04:00
Aaron Suen
fe2c153f9e Clean up all lua code style.
Formatting rules based on Paul Kulchenko's perl-based formatter...
http://notebook.kulchenko.com/programming/lua-beautifier-in-55-lines-of-perl
...using a single tab for indent.

Mostly pure whitespace changes.
2019-08-27 19:14:51 -04:00
Aaron Suen
85f87d1c17 Simplify some selectionboxes significantly. 2019-03-30 21:23:02 -04:00
Aaron Suen
a9c89eac4c Fix collision boxes for shelf/stack to be full cubes. 2019-03-22 18:41:33 -04:00
Aaron Suen
5c05a3c6dd Avoid spewing so many individual items. 2019-03-16 16:54:35 -04:00
Aaron Suen
fd5f4219f7 Sounds for some items, ash. 2019-03-14 01:16:44 -04:00
Aaron Suen
5de0cc54ec Add stony sounds, and sounds for stacks/shelves. 2019-03-14 00:31:09 -04:00
Aaron Suen
9607bcc6a6 Start working on sounds, plus minor refinements.
- Clean up registered_* usage patterns.
- Reduce tendancy of leaves to create stack nodes.
  Now they tend to stack up properly in-world more often.
- Tweak damage system to create "headroom" where minor
  damage doesn't cost inv slots immediately.
- Make player hand skin color match model skin.
- Cleanup/unify grass abm logic.
- Start installing new sounds by MagikEh

Sound source:
  https://github.com/MagikEh/SoundsOfWarr
2019-03-13 23:51:59 -04:00
Aaron Suen
0f0377da52 Make lens/prism light pass thru sunlight_propagates nodes.
This also prevents the lens from igniting them.

Made stick and staff at least as transarent as frames/ladders.
2019-03-09 19:46:52 -05:00
Aaron Suen
3be4f221ff Completely different approach to the item name tip thing.
Can't get HUDs to align right on high-DPI/android at all.  Give up
on the combination breath/wield bar, switch back to a much earlier
version of the code for that.

For wield names, add a new tooltip to the center of the screen, and
show it transiently so that it doesn't disrupt all gameplay.

As a bonus, this is also a logical place to put a "what am I
touching" display, so hook this up for punching.  Now you can
tell what you're touching even when you can't dig it.  This is
like a WAILA mod, but doesn't require tracing.
2019-03-06 13:50:54 -05:00
Aaron Suen
ab2132a035 Fix shelf not accepting ANY items. 2019-03-02 22:53:28 -05:00
Aaron Suen
5a83a15b48 Definitively block placing shelves/totes inside shelves. 2019-03-02 21:41:25 -05:00
Aaron Suen
98b235511c Standardize use of include function. 2019-03-02 20:39:08 -05:00
Aaron Suen
46403c1fea Randomized lode prill yield.
Using an exponentially-distributed random variable for lode prill
yield.  This results in approximately the same average yield as
before, but with many pieces of ore yielding disappointingly only
1 prill, but a few yielding more, theoretically almost infinitely
more.  Every smelting operation now has a bit of a gambling thrill
aspect to it.
2019-03-02 17:49:09 -05:00
Aaron Suen
1bca9d4b32 Fix plank smashing yield. 2019-03-02 15:15:09 -05:00
Aaron Suen
e8aaf4e580 Fix empty stack node on chopping wood pick head into sticks. 2019-03-02 08:55:15 -05:00
Aaron Suen
29dc12fcfb Appearance and recipe for tote node. 2019-02-28 23:16:07 -05:00