Commit Graph

30 Commits

Author SHA1 Message Date
gsemaj
ab4b763f00 YET ANOTHER ITERATION of the new ability system
I am very tired
2023-08-19 20:46:41 +00:00
gsemaj
1637b8e789 Passive nano powers boilerplate 2023-08-19 20:46:41 +00:00
gsemaj
a07f36e379 Buff framework tweaks + polish 2023-08-19 20:46:41 +00:00
gsemaj
afc48b7676 Rework buff callbacks
The first implementation was way too complicated and prone to bugs.
This is much more simple flexible; first off, std::function is now used
instead of a raw function pointer, so lambdas and binds are fair game
which is great for scripting. Second, callbacks for all stacks are
executed. It is up to the callback target to ensure correct behavior.
2023-08-19 20:46:41 +00:00
gsemaj
98634d5aa2 New buff framework (player implementation)
Get rid of `iConditionBitFlag` in favor of a system of individual buff
objects that get composited to a bitflag on-the-fly.
Buff objects can have callbacks for application, expiration, and tick,
making them pretty flexible. Scripting languages can eventually use
these for custom behavior, too.

TODO:
- Get rid of bitflag in BaseNPC
- Apply buffs from passive nano powers
- Apply buffs from active nano powers
- Move eggs to new system
- ???
2023-08-19 20:46:41 +00:00
gsemaj
306a75f469 The great re-#include
Was getting frustrated by the inconsistency in our include statements,
which were causing me problems. As a result, I went through and manually
re-organized every include statement in non-core files.

I'm just gonna copy my rant from Discord:
FOR HEADER FILES (.hpp):
- everything you use IN THE HEADER must be EXPLICITLY INCLUDED with the exception of things that fall under Core.hpp
- you may NOT include ANYTHING ELSE

FOR SOURCE FILES (.cpp):
- you can #include whatever you want as long as the partner header is included first
- anything that gets included by another include is fair game
- redundant includes are ok because they'll be harmless AS LONG AS our header files stay lean.

the point of this is NOT to optimize the number of includes used all around or make things more efficient necessarily. it's to improve readability & coherence and make it easier to avoid cyclical issues
2023-08-19 20:46:41 +00:00
gsemaj
710300c04c (WIP) EXPERIMENTAL GROUP CHANGES 2023-08-19 20:46:41 +00:00
gsemaj
4f49bcea87 (WIP) Move away from rigid states/transitions to allow custom behavior 2023-08-19 20:46:41 +00:00
gsemaj
f6094fde58 EntityType -> EntityKind 2023-08-19 20:46:41 +00:00
gsemaj
b6f15824f1 (WIP) Remove BaseNPC::barkerType to save space 2023-08-19 20:46:41 +00:00
gsemaj
45742e90a2 (WIP) Add src param to transition + certain hooks
Should all hooks have src? I think not
2023-08-19 20:46:41 +00:00
gsemaj
69a478b777 (WIP) Transitions + hook definitions + onRetreat hook implementation 2023-08-19 20:46:41 +00:00
gsemaj
c32e5b2d5e (WIP) Point 2: Generalization 2023-08-19 20:46:41 +00:00
gsemaj
3d572432b3 (WIP) Point 1: step functions 2023-08-19 20:46:41 +00:00
gsemaj
0c4cdaeabf (WIP) Start implementing ICombatant
Start by replacing `hitMob` with `takeDamage` interface function.
Simplify `pcAttackChars` a little by utilizing the new interface, then add more interface functions as needed.

A lot of the combat logic is tied to the `Mob` class. Need to start moving stuff over to CombatNPC.
2023-08-19 20:46:41 +00:00
gsemaj
ed866fbee4 (WIP) Move ICombatant functions around a bit 2023-08-19 20:46:41 +00:00
gsemaj
5ab0112298 (WIP) Initial ICombatant draft 2023-08-19 20:46:41 +00:00
71f1f6edb9 [refactor] Remove redundant coord args from most entity constructors
Mobs and CombatNPCs still need theirs in order to properly set their
roaming and spawn coords. Assignment of the latter has been moved to the
CombatNPC constructor, where it should have already been.
2023-08-19 20:46:41 +00:00
gsemaj
efc00e63b3 [WIP] Replace appearance data with individual fields
Storing certain things in appearance data and others in their own fields
was gross. Now everything is stored on the same level and functions have
been added to generate appearance data when it's needed by the client.
2023-08-19 20:46:41 +00:00
gsemaj
7ab01b098d [WIP] Rename Entity.type -> Entity.kind 2023-08-19 20:46:41 +00:00
129d1c2fe3 Use a specialized null value for ChunkPos
This prevents logic errors related to being in chunk 0 0 0.

Also:

* Moved some duplicated chunk teleportation logic to a new helper
  function
* Made ChunkPos into a proper class so it can default to INVALID_CHUNK
  when default-initialized
* Reversed the inclusion order of Chunking.hpp and Entities.hpp to work
  around problems with type definitions
2022-07-24 21:36:03 +02:00
CakeLancelot
8326ea6e26 Fix sliders stopping in place after one round-trip 2021-05-16 14:39:45 -05:00
gsemaj
6f59001be1 Only loop NPC movement if the NPC has a looping path assigned
Allows paths to terminate.
Also fixes a bug where follower NPCs sometimes oscillate their positions.
2021-05-09 08:38:14 -04:00
33ea5af8b7 Added speed to CombatNPC
- Mob's constructor sets speed
- MobAI.cpp now uses mob->speed
2021-04-29 19:20:53 -05:00
9b84d9dc4d [refactor] BaseNPC now uses Entity XYZ fields for handling positions
- fixed many references to Entity.appearanceData.i[XYZ] to use the base Entity XYZ values
- BaseNPC::enterIntoViewOf grabs the position from the base Entity XYZ values
- NPCManager::updateNPCPosition updates the base Entity XYZ values
- MobAI.c/deadStep() also sends it's packet based on the Entity XYZ values
2021-04-13 20:03:51 -05:00
65462d01e3 Generalize NPC AI stepping logic
The MobAI::Mobs map still needs to be removed.
2021-03-31 22:28:27 +02:00
3325397d17 Remove Eggs::Eggs and rearrange Entity members a bit 2021-03-31 22:28:27 +02:00
22678fcfc2 Initialize all members of all Entity-derived classes
Also moved some logic out of Mob into CombatNPC.
2021-03-31 22:28:27 +02:00
0c8e209360 [WIP] Convert all chunk-related logic to the new system's semantics
Replaced all references to chunk->players and chunk->NPCs with
chunk->entities and all instances of the old NPCClass enum with
EntityType.

The server compiles but will not yet run properly.
2021-03-31 22:28:27 +02:00
224ffe05e7 [WIP] Convert most of Chunking to Entity-based system
Player and all NPCs now have a common superclass, with virtual functions
so smooth over shared behavior. EntityRef is a simple class that points
to an arbitrary Entity.

This commit is not yet functional.
2021-03-31 22:28:27 +02:00