Age | Commit message (Collapse) | Author | Files | Lines |
|
Only moved a single script function to a member for now, will do others
in a separate commit.
|
|
|
|
This was the final step to remove the hierachy with Entity on the top.
|
|
I did not really care too much about staying consistent with the use of
static_casts to Actors since they are only temporary anyway until Actor
is a component too.
|
|
A CharacterData was created as a proxy class in order to allow using the
old serialization method.
|
|
Things done:
- Allowed to create new Attributes outside of the protected scope of Being
- Moved Monster to MonsterComponent
- Some minor cleanup in the Attribute setting code of monsters
|
|
This allows the server to compile with c++0x (and enables it).
This also includes some coding style / readabillity fixes.
|
|
All damage dealing is now handeled via CombatComponent.
Monsters use a derived MonsterCombatComponent since they can have a damage
mutation and have a seperate script callback.
The wirering with Being is still not optional since most of the stuff does
not exist as components.
Things done:
- Seperated the fighting code from Being and only let Characters and Monsters
add the Component (less overhead for npcs)
- Added a getter for Attribute values to prevent searching it all the time in
non Being members
- Fixed the type if the damage mutation to double (no idea why it was int)
I did not want to copy it over incorrectly
- Removed the addAttack/removeAttack overrides in Character and made the
knuckleAttack being added based on newly added signals
Future TODOS:
- Remove depedency on Being as soon all needed dependencies are available
as components of Entity
- Move the monster script callback into the general combatcomponent and
make it usuable for characters too
|
|
|
|
Reviewed-by: Yohann Ferreira
|
|
Items also have positions, so the ItemComponent only makes sense as part of
an Actor. Later on it will probably be part of an entity that also has an
ActorComponent.
Since it was annoying to update all the places where items were created,
I've introduced a function for this.
The component types are now prefixed with "CT_" because I wanted to introduce
an 'Item' namespace which would otherwise be conflicting. The component types
enum isn't used much in the code so it can look a bit ugly.
Reviewed-by: Yohann Ferreira
|
|
Well, first visible change is that everything just gets longer to read.
Reviewed-by: Yohann Ferreira
|
|
This change adds a comment to each lua binding. In the future a script should
parse those and generate the docs from them.
This should prevent outdated docs and duplicate effort to keep code and docs
synced.
In C++ categories can be defined in this way:
/** LUA_CATEGORY long description of the category (shortname)
* further text
* goes into
* the next lines
*/
The shortname is only used to bind other comments to the category.
In lua the category would look like this:
--- LUA_CATEGORY long description of the category (shortname)
-- further text
-- goes into
-- the next lines
A comment that describes a bind then can look like this:
/** LUA some_function (shortnameofcategory)
* some_function(string name)
* some_function(int id)
**
* Description
*/
Or in Lua:
--- LUA some_function (shortnameofcategory)
-- some_function(string name)
-- some_function(int id)
---
-- Description
Autoupdates script follows soon
|
|
This should allow to finally call functions to lua without having to care
about working around situations where a lua call causes a c++ call which
needs to call to lua again.
Tested against the source of tales repository data.
|
|
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
|
|
Use lua_pushliteral and lua_pushlstring instead of lua_pushstring, which
avoids Lua having to determine the length of the string.
|
|
Should still work against Lua 5.1 as well.
|
|
New binds:
- Damage:
- id
- skill
- base
- delta
- cth
- element
- type
- truestrike
- range
- Attack:
- priority
- cooldown
- warmup
- global_cooldown
- damage
- on_attack
- MonsterClass:
- attacks
- ItemClass:
- attacks
|
|
The on_death and on_remove callbacks where not being executed in the
context of any map. Now they execute in the context of the map of the
being.
Reviewed-by: Erik Schilling
|
|
|
|
Reviewed-by: bjorn.
|
|
This was forgotten to do when dropping the money checks and introducing the
checkItem function.
Reviewed-by: bjorn.
|
|
Previously each map had its own scope. They got merged now but the atinit
function was forgotten to adapt.
Reviewed-by: bjorn.
|
|
|
|
It wasn't really adding anything since errors raised using luaL_error
are already logged anyway.
Reviewed-by: Erik Schilling
|
|
read them
The difference to the old chr_get_quest bind is that this allows querying quest
vars from non npc functions as well.
Change is tested.
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Change is tested.
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Previously it only used the rectangle iterator which in fact iterated over the
beings in the map zones and returned often way higher number of beings compared
to the actual rectangle.
Change is tested.
Reviewed-by: Bjorn.
|
|
Also unsetted maps after execution of scripts to make finding this mistakes easier.
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
I forgot to remove this during my special cleanup
Reviewed-by: bjorn.
|
|
This is intended to be used only when the string length is known. The
client was deriving the length from the remaining amount of data in the
message, but that doesn't work in the new 'debug mode' of the protocol.
Reviewed-by: Ben Longbons
|
|
Reviewed-by: Ben Longbons
|
|
Reviewed-by: bjorn
|
|
In preparation for using an entity/component system for the entities
in the game world, this name will be more recognizable and easier to
talk about.
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.
|
|
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
For a non-empty vectors that did not contain the element to remove, the
loop would go on forever because a size_t can't become smaller than 0.
Fixed by simply iterating forwards.
|
|
Another step towards scriptable @commands.
Reviewed-by: bjorn.
|
|
Another step for being able to make @commands scriptable
Reviewed-by: bjorn.
|
|
Step to be able to handle chatcommands by scripts.
Reviewed-by: bjorn.
|
|
TODO: Inform client about this change.
Reviewed-by: bjorn.
|
|
Forgot to do this in the previous commit.
|
|
Scripts mostly execute the Mana script API, and it seems like just
unnecessary verbosity to refer to the 'mana' table all the time. This table
no longer exists now.
Reviewed-by: Erik Schilling
|