Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Well, first visible change is that everything just gets longer to read.
Reviewed-by: Yohann Ferreira
|
|
This introduces two callbacks:
- on_update_derived_attribute -> Called to recalculate other derived
attributes.
- on_recalculate_base_attribute -> Called to recalculate a base attribute
(only called for characters. However the
function passed as callback can be useful
for recalculating the derived attributes
as well)
Monsters no longer block recalculation of attributes except HP and Speed.
I saw no sense to keep this.
Fixed constant value in libmana-constants.lua
Dropped bool type of the recalculation functions. It would be difficult to
keep it while pushing all to the script engine and it was unused anyway.
All in all this adds a LOT more flexibillity to projects since they can now
adapt all attributes in the way they want.
|
|
This replaces the rather hard to understand event dispatcher with a
probably even harder to understand templated library, but fortunately
we can rely on the available documentation.
Hopefully it will also help with the readability of our code and with
adding additional signals to other classes.
Added libsigc++ to README and Travis CI configuration.
Reviewed-by: Erik Schilling
|
|
Same thing, but shorter.
|
|
During the implementation bjorn and I agreed to limit the number of attacks that
can be used in the same tick to one. This makes a lot of stuff easier and the
client cannot display two frames at the same time
Things done:
- Implemented setting of attacks when equipping/unequipping items
- Single place where the xml attack node is parsed
- Finished attack logic
- Unified the attack handling of monsters and characters
- Added a global cooldown after attack use
(not only for next use of same attack)
- Removed the temponary attributes for the monster attack values
- Priorities for all attacks
- Rewrote the attack core:
- Attacks now have this attributes:
- warmup -> time a attack needs after starting it to actually deal the damage
- cooldown -> time a attack needs after dealing damage before another attack
can be used
- reuse -> time before the same attack can be used again
- If no attack is performed at the moment the following is done:
- make a list with all ready attacks
- check for attack that has the necessarily range and highest priority
- start this attack (inform client about it)
- when warmup is finished -> trigger damage
- when cooldown is finished -> allow to use other (or the same if reusetimer
allows) attacks
TODO:
- sync client with this to allow better timed animations
|
|
Reviewed-by: bjorn.
|
|
The timeout remembers a reference point of time against which it can check
how much time is remaining.
Reviewed-by: Erik Schilling
Reviewed-by: Yohann Ferreira
|
|
- Made the current charge being saved.
- Added script binds:
- chr_set_special_recharge_speed
- chr_get_special_recharge_speed
- chr_set_special_mana
- chr_get_special_mana
- get_special_info
- Added special info lua class. Functions:
- name
- needed_mana
- rechargeable
- on_use
- on_recharged
- category
Further the engine no longer sets charge to 0 after using of specials
this allows more flexbilillity (like failing specials).
Changes on the xml database:
- recharge renamed to rechargeable (needed by client and server)
- needed - the needed mana to trigger a special (server only)
- rechargespeed - the defailt recharge speed in mana per tick (server only)
- target - the type of target (either being or point) (server and client)
I also made the lua engine pushing nil instead of a 0 light userdata when
the pointer was 0.
Database update needed.
Change is tested.
Mana-Mantis: #167, #156
Reviewed-by: bjorn.
|
|
The main change here is to remove the separate calling of 'perform' on all
beings, and rather rely on the beings to do whatever they were doing in
that function when the virtual 'update' function is called.
Reviewed-by: Yohann Ferreira
|
|
TODO: Inform client about this change.
Reviewed-by: bjorn.
|
|
When creating an NPC, you now provide its optional talk and update functions
directly rather than them being stored in a table on the Lua side and then
called in response to a global callback.
Also fixed an issue with a missing gender parameter to the delayed NPC
creation callback used by NPCs defined on the map (found by Erik while
reviewing this patch).
Reviewed-by: Erik Schilling
|
|
Rather than wrapping NPC functions up in coroutines in the Lua side, they
are now managed on the C++ side as "script threads", which are essentially
the same thing.
The main purpose is that the server can now know whether any of these long
running script interactions are still active, which will probably be useful
when adding the ability to reload scripts.
Reviewed-by: Erik Schilling
|
|
Rather than relying on the availability of global functions with certain
predefined names, the Lua script now calls API functions to set which
function should be called on these global events.
This mechanism should make it easier to avoid name collisions in the global
namespace, which is important now that there is only a single script state.
For these global events this was not likely to become a problem, but this
solution can also be used for callbacks on specific item or monster types,
or even allow setting callbacks on certain instances.
Reviewed-by: Erik Schilling
Reviewed-by: Yohann Ferreira
|
|
in case of disconnection.
I made the Character::disconnected() function handle that case,
permitting also to centralize GameState::remove() calls there.
I also made the GameState::enqueueWarp() function test whether
the Character pointer is about to be deleted, so that the warp
can be handled directly to avoid a crash.
Last but not least, I also made the Character::update() function
not update the Character specials and hp to avoid discrepancies
seen in the client.
Resolves: Mana-Mantis #309.
Reviewed-by: Ablu.
|
|
Reviewed-by: o11c, bjorn, Bertram.
|
|
|
|
Just seems a bit more organized to me.
|
|
It was done in both the Character and the Monster destructors, but I
don't see how any Actor should be excluded from this. Now it also
happens for NPC, Effect and Item, though only NPC has a relevant
walkmask.
Also fixed a small issue introduced in 97e0a9eb170499 and added an
assert to freeTile. We should be able to assert that a tile can only be
freed if it was blocked.
Reviewed-by: Stefan Dombrowski
|
|
Extracted the path finding algorithm out of the Map class and introduced
a new class called PathInfo that has the path finding information that
used to be part of MetaTile.
This allows a single vector of path information to be shared between all
maps running on the server, significantly reducing the memory overhead
per map (for 200x200 maps, the memory reduction is about 1 MB per map).
Part of this change is some cleanup, like moving the 'occupation' counts
into MetaTile, inlining some methods for performance reasons, and using
STL to simplify memory management.
Mantis-issue: 106
Reviewed-by: Bertram
|
|
Resolves: Mana-Mantis #278.
|
|
Also added an header to the autoattack.{h,cpp} files.
Big but trivial fix.
|