summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-04-02Fixed multiple warnings and errors that blocked c++0xErik Schilling18-53/+74
This allows the server to compile with c++0x (and enables it). This also includes some coding style / readabillity fixes.
2013-04-02Removed old commandhandler approachErik Schilling2-440/+0
It was forgotten to remove when the new approach was added
2013-04-02Moved fighting code into a componentErik Schilling23-374/+651
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
2013-03-25Moved documentation out of class definitionThorbjørn Lindeijer2-68/+97
Inline documentation is in general needlessly verbose and only makes it harder to read the actual class API. This change moves this kind of documentation to the function implementation for the 'Entity' class. For inline methods, the implementation is moved outside of the class using the 'inline' keyword. This provides a good place to put the documentation, but it also further cleans up the class definition. The class definition now gives a much better overview over its API. And if needed, details can be looked up at the function implementations. Reviewed-by: Erik Schilling
2013-03-25Changed NPC to an NpcComponent added to a BeingThorbjørn Lindeijer14-172/+178
2013-03-25Changed Effect to a component of ActorThorbjørn Lindeijer9-53/+61
Reviewed-by: Yohann Ferreira
2013-03-25Changed Item to a component of ActorThorbjørn Lindeijer15-84/+129
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
2013-03-25Changed SpawnArea and TriggerArea to components of EntityThorbjørn Lindeijer13-65/+202
Well, first visible change is that everything just gets longer to read. Reviewed-by: Yohann Ferreira
2013-02-25Removed some outdated and not useful documentationThorbjørn Lindeijer3-113/+0
2013-02-24Fixed installation of Lua scriptsThorbjørn Lindeijer1-0/+1
The 'scripts' subfolder was not added to the toplevel CMakeLists.txt
2013-02-24Removed mentioning of retired structThorbjørn Lindeijer1-2/+0
MonsterTargetEventDispatch was used before switching to libsigc++.
2013-02-24Added Debug class for more convenient debugging outputThorbjørn Lindeijer1-0/+34
Inspired by the QDebug class and qDebug() function from Qt. Actually it might be nice if the LOG macro would also use this.
2013-02-24Fixed default value of the servernameErik Schilling2-2/+3
Since the name was used to log things and the default now is "" also added logging of the address and port too.
2013-02-24Added possibility to reserve mapsErik Schilling11-31/+155
If you set net_gameServerName you can now reserve maps in the maps.xml. There you have to add the servername - property to the <map> tag. Then the map will only be activated by that server. Also changed the activate sequence that the account server now tells the game server what maps to activate (previously the server requested all maps and the account server said yes or no). TODO: Fix general inter server map switching.
2013-02-24Made the scripts being able to installErik Schilling5-5/+15
The game server will now look for the scripts in this order: - serverPath - config value - current working directory - the PKG_DATADIR #define
2013-02-24Documented all lua binds directly in the sourceErik Schilling2-1352/+2340
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
2013-02-21Removed loading of script files using the statusmanagerErik Schilling4-19/+5
They are now required via the main.lua. Also made Harmony giving you the plague in order to allow testing.
2013-02-21Introduced Script::ContextErik Schilling16-87/+99
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.
2013-02-20Rephrased the README about the server data a bitErik Schilling1-11/+2
2013-02-17Monsters no longer load their script filesErik Schilling4-41/+0
Before monsters loaded their script file on *each* spawn. This is rather wrong since the script state keeps growing for each monster. However all of this was unnessecary since the main.lua can simply require the script file. If you do not want to spam the main.lua (or any other file) with all the requires: I guess we can add script binds to iterate over all monsters and add some custom properties to the monsters.xml (See Mana-Mantis #356)
2013-02-16Fixed last second reordering of function parameters in last commitErik Schilling1-5/+5
Accidently only reordered the order in the definition but not in the calls
2013-02-04Moved attribute (re)calculation to the scriptsErik Schilling10-177/+174
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.
2013-02-04Changed Sword to Vit bonus since it has a lot derived attributesErik Schilling1-1/+1
Only done for easier debugging
2013-02-04Random cleanup of attribute codeErik Schilling3-19/+28
Did this during trying to understand the code
2013-02-03Fixed configure with old cmakeErik Schilling1-2/+3
2013-02-03Modifications to allow crosscompiling with mingwErik Schilling10-13/+32
Reviewed-by: bjorn.
2013-02-03Fixed codeblocks compile for linux with sigc++Erik Schilling1-3/+7
2013-02-01Merge pull request #11 from Bertram25/manaserv-emotes-supportYohann Ferreira16-25/+220
Added emote support. Reviewed-by: Ablu
2013-02-01Silenced to Wreorder warnings.Yohann Ferreira2-3/+3
2013-02-01Added emote support.Yohann Ferreira14-22/+217
2013-01-29Silenced some eclipse warningsErik Schilling8-5/+21
2013-01-29Fixed and silenced compiler warningErik Schilling1-4/+5
Also removed a senseless line
2013-01-15Fixed setting current map for npc update functionErik Schilling1-0/+2
2013-01-10Small simplification in Monster::diedThorbjørn Lindeijer1-4/+4
2013-01-10Used a typedef to make callback syntax more readableThorbjørn Lindeijer1-11/+8
2013-01-10Small documentation updates for Point and RectangleThorbjørn Lindeijer2-4/+3
This documentation used to be accurate, until Point was merged with the Position class in commit 8ff3e6674c1d4fc05fc1ba87f42484689fca0879. Also fixed a typo.
2013-01-10Removed deprecated and unused Storage::flushSkillThorbjørn Lindeijer2-19/+0
2013-01-10Update some Doxygen settingsThorbjørn Lindeijer1-3/+3
Enabled source code browsing and excluded enet from the docs by only including the 'src' directory.
2013-01-10Made sure in-inventory trigger is called at pickupErik Schilling1-1/+9
Also added checks for invalid item and zero amount Reviewed-by: bjorn.
2013-01-09Removed unused functor obj_name_isThorbjørn Lindeijer1-20/+0
2013-01-09Replaced EventListener with signals based on libsigc++Thorbjørn Lindeijer23-344/+291
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
2013-01-09Replaced 'unsigned int' with 'unsigned'Thorbjørn Lindeijer55-298/+286
Same thing, but shorter.
2013-01-09Micro-optimizations for pushing strings to LuaThorbjørn Lindeijer4-37/+29
Use lua_pushliteral and lua_pushlstring instead of lua_pushstring, which avoids Lua having to determine the length of the string.
2013-01-09Added support for Lua 5.2Thorbjørn Lindeijer3-1/+23
Should still work against Lua 5.1 as well.
2013-01-08Fixed syntax error (added missing '{')Thorbjørn Lindeijer1-0/+1
2013-01-08Added Vulnerabilities for monstersErik Schilling5-3/+30
You can now actually use the already used node in the monsters.xml Monsters can have different vulnerabillities against elements: <vulnerabillity element="earth" factor="2.0" /> This will double damage of the element earth to this monster.
2013-01-08Added script binds for getting attack informationErik Schilling3-9/+159
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
2013-01-08Work on (Auto)Attack system.Erik Schilling19-535/+688
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
2013-01-08Rename AutoAttack to AttackErik Schilling12-55/+55
2013-01-07Set the current map when executing being callbacksThorbjørn Lindeijer1-0/+2
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