summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-15/+15
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2012-02-12Made the client not stop the target attack once in range.Yohann Ferreira1-1/+1
This was improperly done because of possible differences in the actual victim position, due to server lag. Spotted-by: cody Reviewed-by: Thorbjørn Lindeijer
2012-02-07Hopefully fixed two issues in the go and attack playflowYohann Ferreira1-13/+25
- Fixed the player attacking when clicking on a monster, and then walking near using the keyboard. - Fixed the walking glitch seen in tile path mode by letting the character reach its nearest tile path node. Reviewed-by: Thorbjørn Lindeijer
2012-02-05Fixed crash when the map couldn't be loadedThorbjørn Lindeijer1-0/+3
Ignore LocalPlayer::setDestination calls in this case, because it relies on the tile size of the current map. Reviewed-by: Erik Schilling
2012-02-03Fixed the go and attack mouse clickYohann Ferreira1-24/+49
I first removed the keep attacking and pickup targetting unset statements in the setdestination() function since it was messing with all the rest of the logic, and put those targetting logic where they belonged more. I also changed the gotoTarget function to properly call the setTarget function which permitted to properly unset the previous target in that case. I also finished the logic built around the mGoingToTarget member (until then actually unused) to make it all work again. At last, I also removed a now false comment in the startWalking() function. Reviewed-by: Erik Schilling
2012-02-03Fixed the player character's direction update when clicking on a monster.Yohann Ferreira1-0/+1
The direction is updated in those case only when the engine knows it's the mouse requesting the destination. Reviewed-by: Erik Schilling
2012-02-03Simplified and made generic the way the pickup is handled.Yohann Ferreira1-20/+20
I also made the range be taken from the server type as for the pickup and npc talk ranges. Last but no least, I fixed the parameters sent with PGMSG_PICKUP to send the (item) position where to pickup at as described in the manaserv protocol. The pickup is still not 100% functional due certainly to two problems: 1. The client item coordinates might not be the exact same as in the server. 2. The client seems to try to pick up the item a bit too soon, probably for the reason given in 1. I'll investigate this in another patch. Reviewed-by: Thorbjørn Lindeijer, Erik Schilling.
2012-02-02Fixed player's character direction.Yohann Ferreira1-3/+1
Made the player's character look at where it is going even when using the keyboard, by setting its direction after getting the actual destination, and not before. I also used the lookAt() function to avoid yet another custom way of setting the direction. Reviewed-by: Erik Schilling
2012-02-02Fixed diagonal walking to be much more smooth.Yohann Ferreira1-72/+65
The character used to stick to both corners of an obstacle it encountered when walking diagonally. Now it simply go back to the straight moving mode when encountering an obstacle in one of the two direction used. This also simplifies the function logic. The character direction bug left is still there, and will be dealt in a separate patch with. Reviewed-by: Erik Schilling
2012-02-02Remove duplicate direction computation by a call to lookAt()Yohann Ferreira1-19/+1
It simply does the same thing, in better. Reviewed-by: Erik Schilling
2012-01-27Random hacking cleanups in the LocalPlayer classYohann Ferreira1-34/+28
- Renamed mLastTarget to mLastTargetTime, and mLastAction to mLastActionTime to clarify their use. - NULL -> 0. - Removed the unused mLocalWalkTime member. + Change requested by bjorn. Reviewed-by: Thorjørn Lindeijer
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2012-01-22Prevented looking at item when picking up while movingErik Schilling1-0/+4
+ Fixes from Bjorns review. Reviewed-by: Bjorn.
2012-01-20Fixed a bug with hurt sounds volume and simplified codeThorbjørn Lindeijer1-6/+3
The hurt sound volume was being played based on the distance in tiles, even though Sound::playSfx was expecting pixels. This would cause hurt sounds of other players to play too loud. There were also several conversions between pixel and tile coordinates that could be simplified. Reviewed-by: Yohann Ferreira
2012-01-18Found a better way to fix the movement glitches on both servers.Yohann Ferreira1-15/+7
The patch also takes care of not spamming the different servers, when the servers are setting the being speed correctly. The most problems were coming from the keyboard movement functions handling 1 tile paths. To void the issues seen in #405, #439, and #440, I simply prevented to set a new path before reaching the destination of the former one, when using the keyboard. The mouse path system remains unchanged. I also made some functions private (or here protected) to show they shouldn't be called by something else than the localplayer object. And I removed the nextTile() function, since it was obsolete, unused, and replaced by the nextTile(direction) function. That patch was tested on both servers with mouse/keyboard mixed use. Resolves: Mana-Mantis #405, #439, #440. Reviewed-by: bjorn
2012-01-14Removed the auto-untargeting code for the local player.Yohann Ferreira1-8/+0
This was an annoyance in long lasting battles. Resolves: Mana-Mantis #445. Rewiewed-by: Ablu, bjorn
2012-01-10player_node -> local_playerYohann Ferreira1-4/+4
Reviewed-by: Ablu
2011-11-01Merge github.com:mana/manaYohann Ferreira1-5/+15
Conflicts: src/localplayer.cpp src/net/manaserv/beinghandler.cpp src/net/manaserv/charhandler.cpp
2011-09-30Fixed the negative XP notifications on levelups.Yohann Ferreira1-3/+20
This used to have an associated issue but I just can't find it anymore. Reviewed-by: Thorbjorn.
2011-09-29Fixed the player direction update when picking up an item using the mouse.Yohann Ferreira1-0/+1
This also happened when trying to reach a monster. I didn't fix the pick up once the destination is reached as the fix will be a little more complex.
2011-09-29Fix negative XP on levelups.Yohann Ferreira1-3/+10
This used to have an issue but i just can't find it anymore.
2011-09-13Made the delay between to keyboard move calls functional.Yohann Ferreira1-6/+9
It has been fixed and be made adapted to the being movement speed. Now, for instance, the client sends 3x times less move calls to the tA server, and roughly 20x times for the Manaserv's one. Resolves: Mana-Mantis #346. Reviewed-by: o11c.
2011-09-05The draw order of particles is now Y - 16 pixels.unknown1-1/+1
This means that the order point of the sprites relative to the particles is no longer the lowest point of the image but instead a point which is approximately between the feet of the characters. The intent of the latest commits to treat sprites as perpendicular to the ground instead of perpendicular to the view line is retained by this approach. I tested this with various particle effects and it results in exactly the expected behavior. Note that this does NOT fix the current problems on TMW with the snail slime effect, because the TMW content team accidently placed this one 10px in the air. Sorry, garbage in, garbage out. getDrawPixelY was re-renamed to getPixelY to be consistent with getPixelX, while getPixelY was renamed to getDrawOrder, to make its purpose clear. Further, particles are no longer drawn when behind other objects. This is implemented by adding a drawnWhenBehind member function to Actor, which currently returns true for everything except particles and compound- sprites with more than one sub-sprites (the later case is consistent with the previous behavior of them). An exception are text particles which are excempt from this exception and whose drawing order is also biased by 16 pixels south instead of north to make them more visible. Plus some minor changes from Bertram. Reviewed-by: Bertram. Resolves: Mana-Mantis #362.
2011-09-02The draw order of particles is now Y - 16 pixels.unknown1-1/+1
This means that the order point of the sprites relative to the particles is no longer the lowest point of the image but instead a point which is approximately between the feet of the characters. The intent of the latest commits to treat sprites as perpendicular to the ground instead of perpendicular to the view line is retained by this approach. I tested this with various particle effects and it results in exactly the expected behavior. Note that this does NOT fix the current problems on TMW with the snail slime effect, because the TMW content team accidently placed this one 10px in the air. Sorry, garbage in, garbage out. getDrawPixelY was re-renamed to getPixelY to be consistent with getPixelX, while getPixelY was renamed to getDrawOrder, to make its purpose clear. Further, particles are no longer drawn when behind other objects. This is implemented by adding a drawnWhenBehind member function to Actor, which currently returns true for everything except particles and compound- sprites with more than one sub-sprites (the later case is consistent with the previous behavior of them). An exception are text particles which are excempt from this exception and whose drawing order is also biased by 16 pixels south instead of north to make them more visible. Plus some minor changes from Bertram. Reviewed-by: Bertram. Resolves: Mana-Mantis #362.
2011-08-11Made the delay between to keyboard move calls functional.Yohann Ferreira1-6/+9
It has been fixed and be made adapted to the being movement speed. Now, for instance, the client sends 3x times less move calls to the tA server, and roughly 20x times for the Manaserv's one. Resolves: Mana-Mantis #346.
2011-06-22Applied fixes requested by cody.Yohann Ferreira1-4/+4
- Made the map teleport distance fixed for manaserv. - Small cleanups. The branch is considered reviewed by: Cody. Resolves Mana-Mantis: #74.
2011-06-17First pass on removing tile hard coded values.Yohann Ferreira1-48/+68
Every files has been checked against the hard coded 32 values except the map.cpp file. I also added convenience functions in the Game class, centralized the default item icon size, and removed two unused defines in being.cpp.
2011-06-17Made the client officially handle attack ids.Yohann Ferreira1-2/+2
It already was, but now the the api is clear about it. Client part of the mana issue: #363. Reviewed-by: Bjorn.
2011-06-07Fix particle positionsJared Adams1-1/+1
Particles were being drawn with wrong positions due to their Z coordinate being taken into account when sorting actors. Z is now only taken into account when drawing them. Reviewed-by: Bertram
2011-04-30Fix attack speed on both servers.Yohann Ferreira1-2/+9
Currently, we actually receive the local player attack speed in milliseconds for tA. Yet, we don't support receiving the attack speed for other beings, so the old behaviour will remain for them until someone adds that. As for Manaserv, we're only using the default speed atm. Most urgent part of mana-mantis: #343. Reviewed-by: Thorbjorn.
2011-04-30Use default values for pickup options.Yohann Ferreira1-3/+3
2011-04-26Made the client use a unique kind of movement code.Yohann Ferreira1-242/+117
This is fixng many issues and (hopefully) will make the movement rendering much smoother. Merge branch 'master' of gitorious.org:~bertram/mana/mana-movement-code-merge Conflicts: src/being.cpp src/net/manaserv/beinghandler.cpp Resolves: TMW-Mantis #946. Reviewed-by: Thorbjorn.
2011-04-16Fixed player movement desyncs on tile-based implementation.Yohann Ferreira1-2/+27
The new destination wasn't sent correctly since the destination was centered but checked pixel exact afterward. Now the destination check has been adapted for tile-wise implementation, leading to an almost desync free movement. Hurray!
2011-04-11Adjust action timer to something reasonableJared Adams1-2/+2
1 action per second was annoyingly slow. Reviewed-by: Thorbjørn Lindeijer Reviewed-by: Yohann Ferreira
2011-04-09Removed the Mana namespaceThorbjørn Lindeijer1-10/+10
It's just an annoyance when it's only applied to a few classes. Either we place everything in this namespace or nothing, and at the moment I don't see any rationale for placing everything in a Mana namespace. Acked-by: Jared Adams
2011-04-09Moved Channels to Mana::Event::ChannelThorbjørn Lindeijer1-7/+7
Acked-by: Jared Adams
2011-04-09Moved Events to Mana::Event::TypeThorbjørn Lindeijer1-3/+3
Acked-by: Jared Adams
2011-03-17Fixed pick up using keyboard for both servers.Yohann Ferreira1-2/+2
The character picks up one item at a time (to remain kinda realistic) and turns to the item picked up.
2011-03-17Simplified the get/setAttackRange() functions as requested.Yohann Ferreira1-30/+4
The attack range is still hardcoded for Manaserv as long as generic equipment handling hasn't been implemented.
2011-03-16Fixed the attack range handling for both servers.Yohann Ferreira1-19/+38
The attack range is always the default for manaserv, as proper equipment handling is to be added. Anyway, now the proper attack range is handled in tmwAthena and is always set a proper minimum for both protocols.
2011-03-15Basically merged the two movement algorithms into one.Yohann Ferreira1-222/+79
This was made in favour of the manaserv way of doing things. I also added a way to keep the original server speed value so the pixel value can be recomputed at each map change, as this was necessary since the speed is given before the first map is loaded. The code is much more simpler now about movement handling, and we can already see improvements on other characters movements in The Mana World with this. Everything can't be perfect the first time; here are bugs identified so far: - Monsters direction isn't updated on TmwAthena for obscure reasons. - Remote players walking animation is sometimes reset on each steps. - When changing map, the local player sometimes walks randomly until the player reacts. Stay tuned!
2011-02-21Merge branch '0.5'Thorbjørn Lindeijer1-4/+27
Translation file updates ignored. Conflicts: src/client.cpp src/commandhandler.cpp src/gui/popupmenu.cpp src/localplayer.cpp
2011-02-19Showing amount of picked up items in particle notificationStefan Dombrowski1-1/+5
2011-02-17Specific messages for each pickup failure reason.Ben Longbons1-5/+18
Reviewed-by: Jaxad0127
2011-02-17Add particle notification for "Unable to pick up item."Ben Longbons1-0/+6
2011-01-24Refactored the item loading in a more extensible and per protocol way.Yohann Ferreira1-5/+9
This will greatly help into upgrading the need of each protocol separately. This is the first step to a new item and equipment system for manaserv. A subclassing of the EquipmentWindow will be done in the next commit, as requested by Thorbjorn. Reviewed-by: Thorbjorn.
2011-01-06Made the beings avoid changing direction at their path's end.Yohann Ferreira1-5/+6
I had to let the keyboard path not be resend when the player released the movement keys and work on conditions used to update the beings direction to avoid conflicts. Resolves: Mana-mantis #154. Reviewed-by: Thorbjorn.
2010-12-28Revert "Remove the AFK response system"Yohann Ferreira1-1/+63
This reverts commit 3d6a2d9c80a969c3613f567dd7029e75ef59b5cb. I've by that readded the AFK system on master. Please, remove it when we've got a proper replacement.
2010-12-06Removed superfluous #includes taken from checkheaders list.Yohann Ferreira1-5/+0
Resolves: Mana-Mantis #265. Trivial fix.
2010-11-13Replace config listeners with the event systemChuck Miller1-10/+10
Reviewed-by: Jared Adams