Age | Commit message (Collapse) | Author | Files | Lines |
|
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)
|
|
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.
|
|
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: Stefan Beller.
|
|
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
|
|
This can now be done in attributes.xml through the
minimum and maximum attribute parameters.
I also changed the AttributeInfo struct as requested by bjorn.
Reviewed-by: Erik Schilling, Thorbjørn Lindeijer
|
|
Reviewed-by: o11c, bjorn, Bertram.
|
|
When I introduced NameMap it was only used with pointers, but now it is
also used with std::string so it probably makes sense to keep a default-
constructed value around so that a reference can be returned rather than
a copy.
NameMap::find was renamed to NameMap::value to make it more clear that
it doesn't return an iterator, like std::map::find.
Reviewed-by: Yohann Ferreira
Reviewed-by: Ben Longbons
|
|
and item managers.
ack-by: o11c.
note: The managers still need to auto deinit when already loaded.
This will be done in another trivial commit.
|
|
The xml gives the drop rate as a floating point number.
Also added 0.5 for correct rounding. (Without it 0.7% calculates to 69.)
Reviewed-by: Jaxad0127
|
|
By default XML::Document will use the ResourceManager to resolve the
file name you pass to it. There is no point in disabling that
functionality only to resolve it manually.
Reviewed-by: Jared Adams
|
|
Introduced a template class NameMap, which provides a nice API for
mapping any custom types by their name.
This change also makes any duplicate item or monster definitions be
complete ignored, rather than being merged into the first definition.
Reviewed-by: Philipp Sehmisch
Reviewed-by: Yohann Ferreira
|
|
SCOPE_TYPES -> ScopeType (plural was confusing)
ATTR_BEING -> BeingScope
ATTR_CHAR -> CharacterScope
ATTR_MOD -> MonsterScope
ATTR_MAX -> MaxScope
AttributeScopes -> AttributeScope
(A single scope seems to include multiple lists of attributes. Seems
wrong to me to name this type in plural form.)
getAttributeInfoForType -> getAttributeScope
(just naming it after what it is actually returning)
Reviewed-by: Freeyorp
|
|
* 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
|
|
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
|
|
Reviewed-by: Bertram
|
|
|
|
|
|
Now this can be loaded with the 'magic-evade' xml tag.
|
|
As a consequence, the monsters can spawn again.
Reviewed-by: Freeyorp.
|
|
Also added an header to the autoattack.{h,cpp} files.
Big but trivial fix.
|
|
Also fixed a memleak when loading an invalid monster attack.
Resolves: Mana-Mantis #215.
Reviewed-by: Thorbjorn.
|
|
The speed conversion needs a standard tile length anyway
and can be improved later once the movement code
will start to handle beings size.
Reviewed-by: Crush.
|
|
Attribute system:
Structure is no longer completely hardcoded. Attributes and structure is
defined by new xml file (defaulting to stats.xml)
Structure defines non-base modifications to an attribute, to be used by
modifiers from items, effects, etc.
Calculating the base value for core attributes is still done in C++ (and for
such fundamental elements the only reason I can think of to do it any other
way is perhaps being able to quickly change scripts without a compile could be
useful for testing, but such things are a low priority anyway)
Item structure:
Modifiers are now through triggers rather than single events. This also
removes hardcoded types - an item could be both able to be equipped and be
able to be activated.
Item activation no longer consumes by default, this must be specified by the
property <consumes /> inside the trigger.
Currently only attribute modifications, autoattacks, and consumes are defined
as effects, but stubs for others do exist. Autoattacks are currently
non-functional, and this should be rectified with some urgency.
Auto Attacks:
AutoAttacks are now separate entities, though not fully complete, nor fully
integrated with all beings yet. Integration with the Character class is
urgent, integration with other Being children less so.
When fully integrated this will allow for multiple autoattacks, through
equipping multiple items with this as an equip effect or even through other
means if needed.
Equipment structure:
As ItemClass types are no longer hardcoded, so too are equip types. An item
have multiple ways to be equipped across multiple equipment slots with any
number in each slot. Character maximums are global but configurable.
Miscellaneous:
Speed, money, and weight are now attributes.
Some managers have been changed into classes such that their associated
classes can have them as friends, to avoid (ab)use of public accessors.
The serialise procedure should also be set as a friend of Character (both in
the account- and game- server) as well; having public accessors returning
iterators is simply ridiculous.
Some start for such cleanups have been made, but this is not the primary focus
here. Significant work will need to be done before this is resolved
completely, but the start is there.
BuySell::registerPlayerItems() has been completely disabled temporarily. The
previous function iterated through equipment, yet in the context I think it is
intended to fill items? I have been unable to update this function to fit the
modifications made to the Inventory/Equipment/Possessions, as I am unsure what
exactly what it should be doing.
ItemClass::mSpriteId was previously unused, so had been removed, but I
notice that it was used when transmitting equipment to nearby clients.
Experimentation showed that this value was never set to anything other than
0, and so has been left out of the ItemManager rewrite.
I am not entirely sure what is happening here, but it should be worth looking
into at a later time, as I am not sure how equipment appearences would be sent
otherwise.
|
|
|
|
Makes the code a little nicer.
|
|
libxml2 should be able to handle files with a BOM fine.
Reviewed-by: Bertram
|
|
Reviewed-by: Thorbjorn, Jaxad0127
|
|
Instead of loading data from a 'data' directory in the current working
directory, the server now uses clientDataPath and serverDataPath as
specified in the configuration. This removes the need to set up symbolic
links in order to merge these two types of data.
The default values point to example/clientdata and example/serverdata,
where a minimal example world can be developed to make setting up an
initial server quick and easy.
The XML::Document convenience class was copied over from the client.
Also, the ResourceManager is now shared between both servers, since the
account client is reading items.xml.
Reviewed-by: Jared Adams
|
|
Reviewed by: Jaxad0127
|
|
|
|
Also updated the headers to refer to the GPL by URL instead of
suggesting to contact the FSF by snail mail, as per the latest
GPL usage instructions.
|
|
sources after a certain skill level.
|
|
per second.
|
|
defines.h, and removing some overheading along the way.
|
|
|
|
in monsters.xml
|
|
|
|
Same as for the client.
|
|
|
|
implemented single target attacks useful for projectile weapons like bows.
|
|
|
|
library into the item and monstermanager modules and reimplemented them using std::maps.
|
|
|
|
|
|
instead of tiles per second.
|
|
|
|
|
|
|
|
|