diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-04-22 19:53:22 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-04-22 19:53:22 +0000 |
commit | 5501c96d2c17f63e03b2e36d01d2b9cf64722f56 (patch) | |
tree | 6bbfc6f41fee58d6c99a23afadcd762579580a24 /src/being.cpp | |
parent | 87a4e3eea7865c37d3a73c60015988673b6178b5 (diff) | |
download | mana-client-5501c96d2c17f63e03b2e36d01d2b9cf64722f56.tar.gz mana-client-5501c96d2c17f63e03b2e36d01d2b9cf64722f56.tar.bz2 mana-client-5501c96d2c17f63e03b2e36d01d2b9cf64722f56.tar.xz mana-client-5501c96d2c17f63e03b2e36d01d2b9cf64722f56.zip |
Now you can attack with right mouse button, useful when using bow, need improvements though
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp index 1b2e595c..03649dc6 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -73,7 +73,7 @@ void remove_node(unsigned int id) { } } -unsigned int find_npc(unsigned short x, unsigned short y) { +unsigned int findNpc(unsigned short x, unsigned short y) { std::list<Being *>::iterator i; for (i = beings.begin(); i != beings.end(); i++) { Being *being = (*i); @@ -87,7 +87,7 @@ unsigned int find_npc(unsigned short x, unsigned short y) { return 0; } -unsigned int find_pc(unsigned short x, unsigned short y) { +unsigned int findPlayer(unsigned short x, unsigned short y) { std::list<Being *>::iterator i; for (i = beings.begin(); i != beings.end(); i++) { Being *being = (*i); @@ -99,7 +99,7 @@ unsigned int find_pc(unsigned short x, unsigned short y) { return 0; } -unsigned int find_monster(unsigned short x, unsigned short y) { +unsigned int findMonster(unsigned short x, unsigned short y) { std::list<Being*>::iterator i; for (i = beings.begin(); i != beings.end(); i++) { Being *being = (*i); @@ -114,7 +114,7 @@ unsigned int find_monster(unsigned short x, unsigned short y) { return 0; } -Being *find_node(unsigned int id) { +Being *findNode(unsigned int id) { std::list<Being*>::iterator i; for (i = beings.begin(); i != beings.end(); i++) { Being *being = (*i); @@ -125,6 +125,17 @@ Being *find_node(unsigned int id) { return NULL; } +Being *findNode(unsigned short x, unsigned short y) { + std::list<Being*>::iterator i; + for (i = beings.begin(); i != beings.end(); i++) { + Being *being = (*i); + if (being->x == x && being->y == y) { + return being; + } + } + return NULL; +} + class BeingCompare { public: bool operator() (const Being *a, const Being *b) const { @@ -281,3 +292,21 @@ void Being::drawSpeech(Graphics *graphics) gcn::Graphics::CENTER); } } + +bool Being::isPlayer() { + if (job < 10) + return true; + return false; +} + +bool Being::isNpc() { + if (job > 45 && job <126) + return true; + return false; +} + +bool Being::isMonster() { + if (job > 200) + return true; + return false; +} |