42 Commits

Author SHA1 Message Date
Aaron Suen
0c5611ed57 Remove broken-anyway breath check. 2020-02-19 22:35:18 -05:00
Aaron Suen
3271dba8b2 Limit damage FX replay for fully hurt players. 2020-02-19 22:32:19 -05:00
Aaron Suen
bc7987f9c4 Set drowning damage the correct way. 2020-02-19 21:30:45 -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
bcbe77644e Buff drowning damage, nerf some node damage. 2020-02-19 19:55:22 -05:00
Aaron Suen
00aa460942 Some damage buffs.
- Player hp_max is 8 now, so most injuries will block
  a whole slot each time.
- Player can be reduced to 1 slot, not 2.  The 2 slots
  was from back in the day when players needed to go
  to the surface to heal faster, to help them get up
  there.  Now the 1 slot is only needed in case the
  player is trapped in fire or something.
- Damage effects now don't stop playing just because
  the player has reached maximum injury, and healing
  is also delayed by continued injury.
2020-02-19 19:48:51 -05:00
Aaron Suen
8bf696d73f Buff radiant heat pass-thru a bit. 2020-02-08 14:04:34 -05:00
Aaron Suen
7d24975fb3 Player damage from radiant heat. 2020-01-18 10:12:11 -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
d7819762e5 Full proper support for spectator mods.
If players are invisible, NodeCore will not add any visible or
audible effects for them, allowing such players to be completely
non-interactive with gameplay.

This allows things like spectator or stealth-admin mods to
function properly.
2019-12-11 06:52:09 -05:00
Aaron Suen
dc8c483e01 Standardize virtual items, prevent them dropping. 2019-12-09 04:46:33 -05:00
Aaron Suen
3e5e8e4524 Disable healing for 4 seconds after injury.
This is another de-nerfing of physical damage to make
getting caught in a fire and other damage-over-time
situations more damaging.
2019-11-29 21:40:47 -05:00
Aaron Suen
c9bac9a66e Un-accidentally-nerf drowning damage. 2019-11-28 22:01:33 -05:00
Aaron Suen
a0bdf98ca1 Major damage simplification.
- Healing rate is always the same, regardless of environment.
- Remove visible damage from player.

Lasting injury has just never really been a major gameplay
factor, and making players wait to heal under certain
circumstances did not feel like it made gameplay "better" in
any way.

Now, if you get hurt, you drop your stuff, and have to wait a
MINIMAL amount of time before you can pick it up again.

Similarly, with visible inventory, the damage textures are
redundant, and with the gameplay importance of injury being
so diminished, they were visual overkill.
2019-11-20 23:58:42 -05:00
Aaron Suen
608742522f Add limited support for the enable_damage setting.
If disabled, players can still accumulate radiation poisoning,
but they won't lose inventory space for it.
2019-10-13 14:32:25 -04:00
Aaron Suen
af1f808c68 Fix player health FX auto-scaling.
Guarantee 2 usable slots no matter how many different
injury effects accumulate.

Filled slots will be shared among different damage types
roughly proportionally.
2019-10-13 12:57:57 -04:00
Aaron Suen
402f0150b7 Lux Radiation, and player healthfx API. 2019-10-13 11:37:36 -04:00
Aaron Suen
c147da4dde Convert from depends.txt to mod.conf 2019-10-05 11:24:16 -04:00
Aaron Suen
bf60379f8d Support spectator/creative mod(s). 2019-09-12 19:30:05 -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
285a21b796 New hand appearance.
- Matches player model.
- Stays down by player's side (off-screen) when not in use.
  The game looks even more minimalistic when first started.
2019-04-13 23:39:46 -04:00
Aaron Suen
087b8c8f1b More precise logic for player names.
Try to detect player traces going through a change in fluid medium
such as water/air or water/glass, and block facial recognition
through it.

Specifically allow air-into-glass transitions, or into any other
medium otherwise clear enough to allow sunlight to propagate.
2019-04-08 08:52:59 -04:00
Aaron Suen
40c239a798 Defer social damage sounds until after all modifiers.
This allows external mods that alter damage to prevent damage
sounds from playing for other nearby players if they modify the
damage amount.
2019-04-08 08:26:44 -04:00
Aaron Suen
c1828219e6 Refactor social sounds subsystem.
Standardize the "play a sound for everybody except the player who
is already playing it client-locally" logic into one place.

Fix failure to correctly detect tool speeds for some things, i.e.
when the player is using a tool but the capability used on a node
is actually inherited from the hand.

Note that this may allow pummeling with wrong tools (e.g. repacking
soils with spades) along with accompanying inappropriate tool wear,
but this should be minor and avoidable, and can be fixed later...
2019-04-06 23:51:05 -04:00
Aaron Suen
eba101c93a Fix sound doubling issues. 2019-04-06 23:42:23 -04:00
Aaron Suen
31fbfd8d33 Hear other players get hurt, reorg player health mod. 2019-04-06 21:23:14 -04:00
Aaron Suen
80d3d9708c Deprecate player:get/set_attribute to player:get_meta(). 2019-04-06 20:46:13 -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
47ac931f34 Easy targeted stack placement via drop key + raycast.
Attempt to place stack node directly when player is pointing at
a node space, instead of tossing out an item ent.

This makes item organization less tedious in the early game, as
players are manipulating node positions instead of calculating
ent ballistics in their heads when trying to lay out inventories
on the ground, or using naive shelving.

(Note that wooden shelves still have an advantage in how quickly
items can be taken from them).

Items are still tossed as ents if a player is not looking at a
valid place in nodespace, so inventories can still be e.g. thrown
over a cliff or jettisoned in the ocean...
2019-04-05 07:42:48 -04:00
Aaron Suen
00619690e2 Fix bug ejecting virtual items on damage. 2019-03-29 23:43:22 -04:00
Aaron Suen
30eb61406d Guard against crash for unloaded areas. 2019-03-16 12:01:36 -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
1f6239f101 Fixed injury showing in wield view, clean up stubs. 2019-03-12 21:27:29 -04:00
Aaron Suen
718123494a Make right-most slots more likely to be injured.
Each slot is twice as likely to be injured as the one to its
immediate left.  This creates some player agency in organizing the
inventory, e.g. prioritizing which items to risk the most/least
in the event of injury.
2019-03-11 23:23:37 -04:00
Aaron Suen
aa0fc9296d Heal faster when not moving, nullify healing while diving. 2019-03-11 23:12:04 -04:00
Aaron Suen
ff57c0aaba Replace suicide command with stuck command.
It does something similar, though it doesn't send you back to
spawn, just "phase shifts" nearby.
2019-03-11 23:00:42 -04:00
Aaron Suen
4d0f0734ba Beginning of a bold new health system.
- Eliminate health and breath stat bars.
- Players NO LONGER DIE FROM INJURY.
- Players no longer lose walking speed or mobility.
- Players lose inventory slots in proportion to injury; they're
  stuffed with an "injury" item, and items they displace are
  ejected.  Slots are displaced in random order.
- Healing rate is much faster, so players are usually mildly
  inconvenienced by injury, but can soon enough pick up their
  stuff and leave.
- Health and breath HUDs are gone.  Health is visible based on
  number of lost slots, and breath uses a vignette to narrow
  tunnel vision for O2 loss.

Overall, the old health system has been more of an immersion-
breaking annoyance than anything.  This allows health to get out
of the way of the primary gameplay.

UNFINISHED: Need a replacement for the old "suicide to get unstuck"
mechanic.
2019-03-10 15:47:22 -04:00
Aaron Suen
c7ac1f63db Reorg all player mods, give them lexically grouped names. 2019-03-02 20:32:50 -05:00