129 Commits

Author SHA1 Message Date
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
Aaron Suen
67041ac54d Craft shelves in-place.
Since the recipe output count matches frame count, this is more
consistent with design intent.

Shelves can also be crafted in place this way for use in a tote.
2019-02-28 23:15:26 -05:00
Aaron Suen
579679da2c Initial revision of a portable "tote" node.
When picked up, it carries up to 8 surrounding shelves with it,
allowing significant inventory compression into one slot.  Needs
to be placed somewhere everything fits to access the inventory
again.
2019-02-28 00:02:00 -05:00
Aaron Suen
393210db69 Start proper spectator support.
Make sure that non-built-in content respects the interact priv
and prevents spectator players from doing nasty stuff.
2019-02-24 21:54:33 -05:00
Aaron Suen
0d44601374 Fix shelf appearance under mipmapping. 2019-02-23 20:35:22 -05:00
Aaron Suen
a364e28cd2 Make shelf selection and collision boxes consistent.
This was causing weird issues with items falling "into" a shelf
and ending up stored there, leading to a few "where did my items
go" moments.
2019-02-23 20:08:40 -05:00
Aaron Suen
e2cf72282c Disallow shelf access through top/bottom. 2019-02-23 20:06:14 -05:00
Aaron Suen
480b999705 Make shelves easier to build.
- Double recipe yield
- Bash planks directly to sticks with mallet

- Remove debug code.
2019-02-23 10:39:38 -05:00
Aaron Suen
e303f100cf Shelves can no longer be nested.
- As a general rule, we're disallowing nesting of containers for
  now.  Only bare stack nodes may contain containers.
- Overhaul docs.  Ideas are getting out of hand, shoved a lot of
  stuff into the icebox for now.
2019-02-23 10:33:17 -05:00
Aaron Suen
58cd080fdf Apply big stack refactor. 2019-02-23 10:21:27 -05:00
Aaron Suen
94bd5a9cc8 Fix wield check again, make shelves flammable. 2019-02-23 10:00:31 -05:00
Aaron Suen
63d587cf8b Missed files in prev commit. 2019-02-21 14:59:41 -05:00
Aaron Suen
0638e3f11f Crafting cleanup.
- Alternate shelf recipe to make it a little more intuitive.
- Label all existing recipes.
2019-02-21 14:37:22 -05:00
Aaron Suen
8559316b89 Shelf fixes.
- Remove debugging code.
- We don't really need to be able to reach through shelves, but
  we don't want to miss when trying to access them, so make
  shelf hitboxes solid for now.
2019-02-20 00:48:55 -05:00
Aaron Suen
6d2b15a81b Item storage shelving. 2019-02-20 00:40:55 -05:00
Aaron Suen
4b972b4d3b More recipe conversion, bugfixing. 2019-02-10 00:20:55 -05:00
Aaron Suen
05d4d52eb4 Survey of how we're using pummels right now. 2019-02-08 21:12:10 -05:00
Aaron Suen
d67f736ac5 Merge node_is into match. 2019-02-03 12:44:33 -05:00
Aaron Suen
2b8cc8fba2 Finished refactoring crafting into a separate mod.
Appears to work with existing functionality.

Next step will be to rework pummel to use a "recipe" system and
reuse most of the useful parts of the crafting system.
2019-02-03 12:10:27 -05:00
Aaron Suen
ad94dddd20 Strip excess bark off ladder/frame textures. 2019-01-29 20:45:16 -05:00
Aaron Suen
2d3b468c65 Knock out a bunch of small low-hanging issues.
- Eggcorn cleanup.  They look a little better falling out of the
  tree, and we don't have so many now.
- Crushing damage fixes.  Crushing is nuanced now, and most things
  don't smush you, and many do reduced damage.  A few may do more.
- Item stack convenience.  Items landing on a stack or right-
  clicked onto one attempt to merge into it.
- Ladders now fall (they don't connect to sides).  Use the new
  full-scale frames for ones that don't.
2019-01-29 20:41:29 -05:00
Aaron Suen
169f226ba7 Punch item entities to jar them loose if they get "stuck". 2019-01-26 12:50:06 -05:00
Aaron Suen
a7d7aefc5c Add ladders.
Can construct simply using a stack of sticks.  Makes it possible to
maintainably tunnel upwards to bring in sunlight for indoor light
for shallow builds, and provides a safe walking surface above.

Also:
- Fixed recipe rotation to include normal check.
2019-01-26 12:28:52 -05:00
Aaron Suen
739ad29acc Be a little more forgiving on tool wear for stonifying wood tools.
Allow up to 2% wear.  Sometimes you're diggng with a stone tool and
the tip breaks off and you don't notice (there's no sound yet),
so you accidentally dig a little with the wood tool and get it a
little dirty.  Let's be a little forgiving, and allow the stone
tip applicaton to also apply a little "repair" to the underlying
wood tool.
2019-01-26 11:39:55 -05:00
Aaron Suen
fcb8463953 Stone-tipped tools.
- Add a bit of stone to the tip of a wooden tool to harden it.
- Stone tools wear back down to their wooden originals.
- Stone tools dig faster, but wear quickly, so you need to pay
  attention to wear levels and carry spare stone tips.

Also:
- Nerfed mining speeds again, but made higher-tier tools much
  faster relative to lower.
- Nerfed tool durability as well.

Also:
- Standardized item ejection logic.
2019-01-25 09:26:15 -05:00
Aaron Suen
5fe1fe0c29 Fix crash on log splitting. 2019-01-25 00:27:49 -05:00
Aaron Suen
b6a83b2791 Pummel API overhaul.
- Make check/resolve functions naturally paired instead of having
  to test the "check" value, so we can use the "check" value for
  more specific parameter stuff.
- Make existing pummel logic use a standard tool speed check.
2019-01-24 23:16:12 -05:00
Aaron Suen
8e47b687d0 TOOL CAPABILITIES / LEVELS OVERHAUL
Try to standardize the way we handle tools, materials, digtimes.
- Levels start at 1 and work upwards.
  - Level 1 is for "hand" or "primitive" tools.
  - Levels 2+ are wood, stone, metal, etc.
- Link dig times, tool levels, and durability together.
- Material groups now define standard "base dig times" which
  are the main thing that makes e.g. stone harder to dig than dirt.

The speed of digging almost everything will probably have changed,
in some cases not for the better; much testing will be needed.
2019-01-24 22:08:05 -05:00