diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-05-17 15:21:37 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-05-17 15:21:37 -0300 |
| commit | 8ef2e0070d614624c0a779f7c2a42d6c61c46295 (patch) | |
| tree | e8e5a90848c331764a3908d6c30404c6dca4d1a8 /src/player.cc | |
| parent | 717f5cd9dacf30fe6bf1561db9297e75fd27fdef (diff) | |
| download | game-8ef2e0070d614624c0a779f7c2a42d6c61c46295.tar.gz game-8ef2e0070d614624c0a779f7c2a42d6c61c46295.zip | |
TSkillProbe + some structs
Diffstat (limited to 'src/player.cc')
| -rw-r--r-- | src/player.cc | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/player.cc b/src/player.cc new file mode 100644 index 0000000..a6cd4a5 --- /dev/null +++ b/src/player.cc @@ -0,0 +1,44 @@ +#include "player.hh" +#include "enums.hh" + +void TPlayer::CheckState(void){ + if(this->Connection != NULL){ + uint8 State = 0; + + if(this->Skills[SKILL_POISON]->TimerValue() > 0){ + State |= 0x01; + } + + if(this->Skills[SKILL_BURNING]->TimerValue() > 0){ + State |= 0x02; + } + + if(this->Skills[SKILL_ENERGY]->TimerValue() > 0){ + State |= 0x04; + } + + // TODO(fusion): Not sure about this one. + if(this->Skills[SKILL_DRUNK]->TimerValue() > 0 && this->Skills[SKILL_DRUNK]->Get() == 0){ + State |= 0x08; + } + + if(this->Skills[SKILL_MANASHIELD]->TimerValue() > 0 || this->Skills[SKILL_MANASHIELD]->Get() > 0){ + State |= 0x10; + } + + if(this->Skills[SKILL_GO_STRENGTH]->MDAct < 0){ + State |= 0x20; + }else if(this->Skills[SKILL_GO_STRENGTH]->MDAct > 0){ + State |= 0x40; + } + + if(RoundNr < this->EarliestLogoutRound){ + State |= 0x80; + } + + if(State != this->OldState){ + SendPlayerState(this->Connection, State); + this->OldState = State; + } + } +} |
