1 |
|
|
/* |
2 |
|
|
* The ManaPlus Client |
3 |
|
|
* Copyright (C) 2011-2019 The ManaPlus Developers |
4 |
|
|
* Copyright (C) 2019-2021 Andrei Karas |
5 |
|
|
* |
6 |
|
|
* This file is part of The ManaPlus Client. |
7 |
|
|
* |
8 |
|
|
* This program is free software; you can redistribute it and/or modify |
9 |
|
|
* it under the terms of the GNU General Public License as published by |
10 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
11 |
|
|
* any later version. |
12 |
|
|
* |
13 |
|
|
* This program is distributed in the hope that it will be useful, |
14 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
|
|
* GNU General Public License for more details. |
17 |
|
|
* |
18 |
|
|
* You should have received a copy of the GNU General Public License |
19 |
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 |
|
|
*/ |
21 |
|
|
|
22 |
|
|
#ifndef BEING_CASTINGEFFECT_H |
23 |
|
|
#define BEING_CASTINGEFFECT_H |
24 |
|
|
|
25 |
|
|
#include "being/actor.h" |
26 |
|
|
|
27 |
|
|
#include "enums/being/actortype.h" |
28 |
|
|
|
29 |
|
|
#include "localconsts.h" |
30 |
|
|
|
31 |
|
|
class AnimatedSprite; |
32 |
|
|
|
33 |
|
|
class CastingEffect final : public Actor |
34 |
|
|
{ |
35 |
|
|
public: |
36 |
|
|
CastingEffect(const int skillId, |
37 |
|
|
const int skillLevel, |
38 |
|
|
const std::string &animation, |
39 |
|
|
const int x, |
40 |
|
|
const int y, |
41 |
|
|
const int range); |
42 |
|
|
|
43 |
|
|
A_DELETE_COPY(CastingEffect) |
44 |
|
|
|
45 |
|
|
~CastingEffect() override final; |
46 |
|
|
|
47 |
|
|
virtual ActorTypeT getType() const noexcept2 A_WARN_UNUSED |
48 |
|
|
{ return ActorType::Unknown; } |
49 |
|
|
|
50 |
|
|
void draw(Graphics *const graphics, |
51 |
|
|
const int offsetX, |
52 |
|
|
const int offsetY) const override final A_NONNULL(2); |
53 |
|
|
|
54 |
|
|
int getSortPixelY() const restrict2 override A_WARN_UNUSED |
55 |
|
|
{ return mPixelY - mYDiff; } |
56 |
|
|
|
57 |
|
|
void update(const int time); |
58 |
|
|
|
59 |
|
|
bool isTerminated() const; |
60 |
|
|
|
61 |
|
|
float getAlpha() const override final A_WARN_UNUSED |
62 |
|
|
{ return 1.0F; } |
63 |
|
|
|
64 |
|
|
void setAlpha(const float alpha A_UNUSED) override final |
65 |
|
|
{ } |
66 |
|
|
|
67 |
|
|
protected: |
68 |
|
|
AnimatedSprite *mSprite; |
69 |
|
|
int mRectX; |
70 |
|
|
int mRectY; |
71 |
|
|
int mRectSize; |
72 |
|
|
int mAnimationX; |
73 |
|
|
int mAnimationY; |
74 |
|
|
}; |
75 |
|
|
|
76 |
|
|
#endif // BEING_CASTINGEFFECT_H |