28 Commits

Author SHA1 Message Date
Aaron Suen
8add276587 Make falling things bounce off players.
If the falling item/node causes enough damage to
trigger a "hurt" effect, then it loses much of its energy
and bounces upward off the player.

This will also reduce the "scraping" effect when nodes
fall through a player.  Hopefully the damage from
falling things is a little more consistent now.
2019-12-29 12:12:08 -05:00
Aaron Suen
b7efac4a7f Note updates from discord. 2019-12-15 08:28:34 -05:00
Aaron Suen
b9e2f822f8 New flexible find_nodes_around api. 2019-11-30 10:28:35 -05:00
Aaron Suen
a12d44c4f8 Tighten up interact checks. 2019-11-28 08:55:09 -05:00
Aaron Suen
829e8aed81 Fix some things affected by spectators. 2019-11-25 21:46:29 -05:00
Aaron Suen
ac4ae381a6 Fix nodefall-disturb group falling.
Wrong falling check.  We don't need to check for repose
because that's already handled by an ABM.  Instead use the
standard check_for_falling that's recursive.
2019-11-23 09:27:06 -05:00
Aaron Suen
feb9c5016d Nerf door op rate, falling node operation.
Also:
- Persist door squelch data.
- Work around crush damage logic issue...?
- Try to reduce unnecessary network packets?
2019-10-11 01:14:00 -04:00
Aaron Suen
c147da4dde Convert from depends.txt to mod.conf 2019-10-05 11:24:16 -04:00
Aaron Suen
6536276430 Non-loose nodes inherit crush damage from loose alternatives. 2019-09-21 08:38:16 -04:00
Aaron Suen
77cc5d603e Thrown items also cause crush damage while falling.
- Make some adjustments to player entity location finding.
- Genericize crush damage logic to apply to item entities too.
- Item ents cause only 20% crushing damage.
2019-09-13 22:26:47 -04:00
Aaron Suen
310ce1bc6c Treat NodeCore as a unified thing.
- Collapse all nodecore "core" mods in the /mods listing, so it's
  easier to find the actual add-on mods.
- Parameterize in-game branding to make renaming derivatives just
  a little easier.
2019-09-07 09:08:57 -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
50c4d2d094 Fix bad log formatting. 2019-04-07 18:44:35 -04:00
Aaron Suen
a674184df0 Fix deprecated getpos -> get_pos. 2019-04-06 20:34:13 -04:00
Aaron Suen
d8acafe9cc Switch from line_of_sight to raycast. 2019-04-06 20:31:12 -04:00
Aaron Suen
c43eaa10ec Fix bug that broke falling node hazards. 2019-04-06 20:20:04 -04:00
Aaron Suen
47b4ae9bc6 Promote inventory pickup changes to a first-class feature mod.
Use interception where possible to modify destintion for items
directly instead of relying on post-hoc inventory rearrangement.

This should resolve the glitches where items appear in the wrong
place in inventory for a flash before being moved.
2019-03-27 22:10:45 -04:00
Aaron Suen
3a299e712f Some minor API cleanup (celebrating 5.0 release). 2019-03-04 19:33:55 -05:00
Aaron Suen
98b235511c Standardize use of include function. 2019-03-02 20:39:08 -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
35d814fb43 Fix suspected infinite loop in nodefall. 2019-02-09 23:35:16 -05:00
Aaron Suen
33cbce23e5 Merge branch 'master' into refac1 2019-02-04 20:16:54 -05:00
Aaron Suen
d67f736ac5 Merge node_is into match. 2019-02-03 12:44:33 -05:00
Aaron Suen
3a377af1fd Guard against failed def lookup. 2019-02-03 09:11:36 -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
8a7dbfe255 Remove debug code. 2019-01-26 16:18:21 -05:00
Aaron Suen
8b8c20ec03 Add falling node hazards.
- Nodes that are falling do damage to those near to them from
  crushing and/or friction.
- Player activity can cause falling nodes left in precarious
  positions by mapgen to fall randomly.
2019-01-26 13:58:35 -05:00