Mana
Loading...
Searching...
No Matches
beinginfo.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana 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#pragma once
23
24#include "actorsprite.h"
25#include "map.h"
26
27#include "gui/gui.h"
28#include "resources/spritedef.h"
29
30#include <map>
31#include <string>
32#include <vector>
33
34struct Attack
35{
36 std::string action = SpriteAction::ATTACK;
37 int effectId = 0;
38 int hitEffectId = 0;
41};
42
43enum class SoundEvent
44{
45 Hit,
46 Miss,
47 Hurt,
48 Die
49};
50
59{
60public:
62
65
66 std::string name;
72 bool targetSelection = true;
73
74 void setTargetCursorSize(const std::string &size);
75 void setHoverCursor(const std::string &cursorName);
76
77 void addSound(SoundEvent event, const std::string &filename);
78 const std::string &getSound(SoundEvent event) const;
79
80 void addAttack(int id, Attack attack);
81 const Attack &getAttack(int id) const;
82
83private:
84 std::map<SoundEvent, std::vector<std::string>> mSounds;
85 std::map<int, Attack> mAttacks;
86};
SoundEvent
Definition beinginfo.h:44
Holds information about a certain type of monster.
Definition beinginfo.h:59
static BeingInfo * Unknown
Definition beinginfo.h:61
std::map< SoundEvent, std::vector< std::string > > mSounds
Definition beinginfo.h:84
std::map< int, Attack > mAttacks
Definition beinginfo.h:85
const Attack & getAttack(int id) const
ActorSprite::TargetCursorSize targetCursorSize
Definition beinginfo.h:68
void addSound(SoundEvent event, const std::string &filename)
Definition beinginfo.cpp:93
void setHoverCursor(const std::string &cursorName)
Definition beinginfo.cpp:82
unsigned char walkMask
Definition beinginfo.h:70
SpriteDisplay display
Definition beinginfo.h:67
void addAttack(int id, Attack attack)
Map::BlockType blockType
Definition beinginfo.h:71
const std::string & getSound(SoundEvent event) const
Definition beinginfo.cpp:98
Cursor hoverCursor
Definition beinginfo.h:69
bool targetSelection
Definition beinginfo.h:72
std::string name
Definition beinginfo.h:66
void setTargetCursorSize(const std::string &size)
Definition beinginfo.cpp:71
@ BLOCKMASK_ALL
Definition map.h:163
BlockType
Definition map.h:150
@ BLOCKTYPE_CHARACTER
Definition map.h:153
Cursor
Cursors are in graphic order from left to right.
Definition gui.h:55
std::string missileParticleFilename
Definition beinginfo.h:40
int effectId
Definition beinginfo.h:37
std::string action
Definition beinginfo.h:36
int hitEffectId
Definition beinginfo.h:38
int criticalHitEffectId
Definition beinginfo.h:39