summaryrefslogtreecommitdiff
path: root/src/game-server/item.h
AgeCommit message (Collapse)AuthorFilesLines
2013-09-19Removed unused being state enumsThorbjørn Lindeijer1-28/+0
2013-09-19Renamed actor.{h,cpp} to actorcomponent.{h,cpp}Thorbjørn Lindeijer1-1/+1
To match the class name.
2013-08-26Moved AttributeInfo into a seperate fileErik Schilling1-2/+2
2013-08-26Allowed to push attributeinfos for the attribute recalculationErik Schilling1-6/+10
While on it I replaced the id usage in the server with the usage of the AttributeInfo directly. Next steps: - Dehardcode the core attribute ids and store their attributeinfos somewhere in AttributeManager (for now i simply wrapped the ids with getAttributeInfo(). - Move AttributeInfo out of AttributeManager to shorten the usage + to allow using a pointer in ModifierLocation without forward declaring it.
2013-08-26[Abilities] Removed the old autoattack systemErik Schilling1-23/+0
As a side effect i had to remove the monster attack AI for now. I will readd this as next thing.
2013-04-12Moved Actor into an ComponentErik Schilling1-1/+1
This was the final step to remove the hierachy with Entity on the top.
2013-04-11Converted Being into a ComponentErik Schilling1-12/+12
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.
2013-03-25Changed Effect to a component of ActorThorbjørn Lindeijer1-1/+1
Reviewed-by: Yohann Ferreira
2013-03-25Changed Item to a component of ActorThorbjørn Lindeijer1-4/+27
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-01-10Small documentation updates for Point and RectangleThorbjørn Lindeijer1-1/+1
This documentation used to be accurate, until Point was merged with the Position class in commit 8ff3e6674c1d4fc05fc1ba87f42484689fca0879. Also fixed a typo.
2013-01-09Replaced 'unsigned int' with 'unsigned'Thorbjørn Lindeijer1-10/+10
Same thing, but shorter.
2013-01-08Work on (Auto)Attack system.Erik Schilling1-20/+33
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 Schilling1-3/+3
2012-08-05Remove resetEffects; move it to destructor in ItemClass.Stefan Beller1-18/+2
Reviewed-by: bjorn
2012-08-05Fixup segfault at shutdown of gameserver.Stefan Beller1-5/+1
The objects of ItemEffectInfo class, which are hold in mDispells are definitly in mEffects as well, because they are added in in addEffect as the same pointer. Reviewed-by: Erik Schilling
2012-04-14Fixed compiler warning about non-virtual destructorThorbjørn Lindeijer1-0/+2
None of the subclasses actually define a destructor that does anything, but this may change in the future. In any case it's good to get rid of the warning. Reviewed-by: Erik Schilling
2012-03-03Use callbacks for items, monsters and status effectsThorbjørn Lindeijer1-9/+22
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-5/+3
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
2011-08-19Used the client base to make a final bugfix on the server code.Yohann Ferreira1-11/+14
Made the server handle only one slot type requirement since it's irrelevant to have more anyway. Plus, it simplifies the code for both equipping/unequipping. I also added a dagger to show how equipping/unequipping is working.
2011-08-10Changed ItemEquipInfo to only be a pair of unsigned.Yohann Ferreira1-1/+1
Previously it was a list of pair ofunsigned int, used to get the equipment slot requirements. It didn't make sense as the ItemEquipsInfo was already a list of it. So you had to manage with a list of list and that ended up being irrelevant to the need. I had to disable the equip function to permit compilation. This will be fixed in my next commit.
2011-07-27Small random code format cleanups, and documentation fixes.Yohann Ferreira1-0/+2
This doesn't change anything yet.
2011-04-19Implemented scriptable effects on item use and dispell.Yohann Ferreira1-8/+25
Reviewed-by: Thorbjorn.
2011-03-20Introduced separate functions for item database loadingThorbjørn Lindeijer1-5/+3
This splits the huge ItemManager::reload() into readEquipSlotsFile() and readItemsFile(), the latter of which is further split up into multiple functions for reading the different elements. Just to keep the amount of nesting down and increase the readability. Removes the need for huge eye-catching comment blocks. Reviewed-by: Freeyorp
2011-03-16Allowed item names instead of IDs in @commandsPhilipp Sehmisch1-0/+14
The @drop and @item commands can now accept an item name instead of an item ID. In addition the amount can be omitted to create a single item.
2010-12-08Fix many compiler warnings.Freeyorp1-7/+12
Reviewed-by: Bertram
2010-11-14Renamed .hpp files into .h for consistency.Yohann Ferreira1-0/+273
Also added an header to the autoattack.{h,cpp} files. Big but trivial fix.