summaryrefslogtreecommitdiff
path: root/src/game-server/monster.h
AgeCommit message (Collapse)AuthorFilesLines
2013-01-09Replaced EventListener with signals based on libsigc++Thorbjørn Lindeijer1-8/+15
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 Lindeijer1-1/+1
Same thing, but shorter.
2013-01-08Added Vulnerabilities for monstersErik Schilling1-0/+8
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-08Work on (Auto)Attack system.Erik Schilling1-31/+11
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
2012-07-17Added script binds to get full monster anger list + drop anger of monstersErik Schilling1-0/+3
Reviewed-by: bjorn.
2012-04-14Introduced a Timeout class for counting down without countingThorbjørn Lindeijer1-4/+13
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
2012-04-04Adding monster::on_damage callbackStefan Beller1-0/+11
Reviewed-by: bjorn
2012-04-04Renamed Thing to EntityThorbjørn Lindeijer1-1/+1
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
2012-03-26Some general cleanups and merged Being::perform() into update()Thorbjørn Lindeijer1-1/+3
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
2012-03-16Fixed remaining compiler warningsThorbjørn Lindeijer1-1/+1
These were unused parameters and one return type with an ignored 'const' qualifier. Reviewed-by: Yohann Ferreira
2012-03-13Added script bind to set walkmask for beingsErik Schilling1-9/+0
TODO: Inform client about this change. Reviewed-by: bjorn.
2012-03-03Use callbacks for items, monsters and status effectsThorbjørn Lindeijer1-1/+26
Previously, global function names were defined in the respective XML definitions of items, monsters and status effects. This was reasonable when they all had the same state, but now they're sharing the single global Lua state. Now the Lua API provides access to the ItemClass, MonsterClass and StatusEffect instances, on which callbacks for both standard and custom events can be explicitly set. Reviewed-by: Erik Schilling
2012-03-02Merged all the different Lua states into oneThorbjørn Lindeijer1-6/+0
No more Lua state for each status effect, monster, item effect or map. All scripts are loaded into the same state. This should be more efficient overall and make it easier to implement dynamic reloading of the scripts in the future. Now, this introduces the problem of name collisions between different Lua scripts. For now this is solved by using more specific function names, like 'tick_plague' and 'tick_jump' rather than just 'tick'. The plan is however to get rid of these globals, and register these callbacks from the script, so that they can be local functions without the danger of colliding with other scripts. Reviewed-by: Erik Schilling Reviewed-by: Yohann Ferreira
2012-01-02Made all beings capable of having a genderErik Schilling1-0/+8
Reviewed-by: o11c, bjorn, Bertram.
2011-06-17Changed the attack message to send the attack id.Yohann Ferreira1-2/+2
This is more precise than sending the attack type, that can be guessed by the client anyway when the type parameter will be added in the <attack> tag. This is the server part of Mana issue: #363. Reviewed-by: Bjorn.
2011-05-26Allow monsters to drop multiple itemsStefan Dombrowski1-6/+1
Before at most one item was droped and the sum of all probablilites was limited to 100%. Also in the example data drops are changed to existing items.
2011-03-20Moved defines.h and manaserv_protocol.h into 'common'Thorbjørn Lindeijer1-1/+1
Just seems a bit more organized to me.
2011-03-17Micro-optimizations related to std::stringThorbjørn Lindeijer1-2/+1
* Rely on the fact that a std::string is empty by default * Use std::string::empty() rather than comparing to "" * Construct with std::string() rather than from "" Reviewed-by: Bertram
2011-03-16Allowed monster names in @spawn commandPhilipp Sehmisch1-0/+15
I rewrote the @spawn command to allow two new things: 1. The monster ID can be replaced with the name of the monster. 2. The amount of monsters can be omitted. In that case a single monster is spawned. Reviewed by: Jaxad and Thorbjorn
2011-03-15Some code style cleanups in AutoAttack classThorbjørn Lindeijer1-1/+1
2011-03-12Removed a bunch of silly documentationThorbjørn Lindeijer1-7/+0
A C++ developer should be able to recognize a constructor and a destructor by just looking at it, so let's stop writing down the obvious. :)
2011-03-11Split path finding out of the Map classThorbjørn Lindeijer1-2/+2
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
2011-02-16Fixed doc about stroll range, which is coded in pixels.Yohann Ferreira1-2/+2
Not in tiles, as suggested by the header. Trivial fix.
2011-01-30Made the monsters' attributes compute fine again.Yohann Ferreira1-1/+8
As a consequence, the monsters can spawn again. Reviewed-by: Freeyorp.
2010-12-29Moved parts needing to be in sync with the client in protocol.h.Yohann Ferreira1-2/+2
Trivial fix.
2010-11-14Renamed .hpp files into .h for consistency.Yohann Ferreira1-0/+351
Also added an header to the autoattack.{h,cpp} files. Big but trivial fix.