58 Commits

Author SHA1 Message Date
Aaron Suen
0929d007ce Use nodecore.interval where appropriate
Fixes deprecated get_connected_players() at load time issue
2020-06-23 06:43:34 -04:00
Aaron Suen
5648331c9f Replace all perplayer with playerstep 2020-06-22 22:47:33 -04:00
Aaron Suen
e0156b4742 Add profiler instrumentation metadata everywhere
N.B. the MT built-in profiler doesn't yet actually support reading
labels from bare-function registrations, so a builtin hack is
needed.
2020-06-15 07:21:39 -04:00
Aaron Suen
95bebf9bbb Fix lower bound for radiant heat overlay 2020-06-01 22:16:36 -04:00
Aaron Suen
20bf9bf3be HUD overlay for radiant/latent heat 2020-06-01 20:13:15 -04:00
Aaron Suen
11438a1625 Deprecate ent_prop_set() method 2020-05-25 11:43:51 -04:00
Aaron Suen
920fba34ee Separate node stand/touch/radiant damage types
Don't reuse damage_per_second for damage on punch and radiant
damage.  This allows these to be defined separately, i.e. no longer
assuming that all damage is from "heat" and can radiate.  This
allows for things like thorny plants that hurt if you touch them
or stand in them but not if you stand near them.

Thanks to WintersKnight94 for reporting this.
2020-04-09 06:56:18 -04:00
Aaron Suen
afa36f1236 Standardize obj property setting.
This should more reliably minimize network traffic
incurred by excess property setting.

We could probably standardize a few more things,
like set attach, anim, yaw, pos...
2020-03-25 09:20:37 -04:00
Aaron Suen
dfa8615200 Revert "Remove descritption from injury/burn."
This reverts commit 4a13733e68903904e088fe21d86dec6d927ee7d8.

While I'm still not happy with the desciptions, we probably need
some sensible way to talk about these in chat, wikis, etc.
2020-03-25 08:58:31 -04:00
Aaron Suen
4a13733e68 Remove descritption from injury/burn.
This always felt kinda redundant and the names
themselves never seemed all that great.

For Lux Burns in particular, I'd rather the radiation
symbol speak for itself.
2020-03-24 00:06:38 -04:00
Aaron Suen
baa54a6cd7 Damage logic consolidation 2020-03-22 08:19:39 -04:00
Aaron Suen
9094c00606 Fix virtual item placement prediction. 2020-02-25 00:36:08 -05:00
Aaron Suen
65c21683a3 Fix burn/injury inventory/hand appearance. 2020-02-24 21:45:13 -05:00
Aaron Suen
f541cf9062 Fix crash on unknown nodes for radiant heat. 2020-02-24 06:21:35 -05:00
Aaron Suen
756b12b7d4 Better record damage/heal types for stats. 2020-02-20 07:16:19 -05:00
Aaron Suen
670cbbb89b Prevent damage flash for new players.
Setting hp_max before player actually emerges in a
join event seems to prevent damage flash (MT engine
issue 7876) for new players.

Old players rejoining for the first time since the
change will still experience it though.
2020-02-20 07:35:39 -05:00
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