palra / univ-mmorpg

0 stars 0 forks source link

Add/remove Character's speed in Item#onRegister(Character)/Item#onUnregister(Character) #23

Closed palra closed 9 years ago

palra commented 9 years ago

https://github.com/palra/univ-mmorpg/blob/feature/serialization/src/main/java/fr/univdevs/mmorpg/engine/character/Item.java#L146-L166

The speed of a character is linked to the weight of the items he has on it. So, we can set the speed of a given Character from here, as every item has a weight. The child classes, then, may have to call super.onRegister(Character)

drattak commented 9 years ago

done only for protections

drattak commented 9 years ago

Because a character is advantaged when wearing a protection, but not when carrying a cure, therefore it should not disadvantage him

palra commented 9 years ago

The strategy is the same : when an item is added, we remove a proportional amount of speed depending of the item's weight. A Cure should have a 0 weight so.