Mana
Loading...
Searching...
No Matches
src
resources
abilitydb.h
Go to the documentation of this file.
1
/*
2
* The Mana Client
3
* Copyright (C) 2010-2013 The Mana Developers
4
*
5
* This file is part of The Mana Client.
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
#pragma once
22
23
#include <string>
24
#include "
utils/xml.h
"
25
26
struct
AbilityInfo
27
{
28
enum
TargetMode
29
{
30
TARGET_BEING
,
// target any being
31
TARGET_POINT
,
// target map location
32
TARGET_DIRECTION
// target a direction
33
};
34
int
id
;
35
std::string
name
;
// displayed name of ability
36
std::string
icon
;
// filename of graphical icon
37
std::string
useAction
;
// action when using the ability
38
39
TargetMode
targetMode
;
40
41
bool
rechargeable
;
// true when the ability has a recharge bar
42
int
rechargeNeeded
;
// maximum recharge when applicable
43
int
rechargeCurrent
;
// current recharge when applicable
44
};
45
49
namespace
AbilityDB
50
{
51
void
init
();
52
53
void
readAbilityNode
(
XML::Node
node,
const
std::string &filename);
54
55
void
checkStatus
();
56
57
void
unload
();
58
62
AbilityInfo
*
get
(
int
id
);
63
68
AbilityInfo
*
find
(std::string_view name);
69
}
XML::Node
Definition
xml.h:38
AbilityDB
Ability information database.
Definition
abilitydb.h:50
AbilityDB::unload
void unload()
Definition
abilitydb.cpp:81
AbilityDB::find
AbilityInfo * find(std::string_view name)
Finds an ability by name.
Definition
abilitydb.cpp:98
AbilityDB::checkStatus
void checkStatus()
Definition
abilitydb.cpp:76
AbilityDB::init
void init()
Definition
abilitydb.cpp:49
AbilityDB::get
AbilityInfo * get(int id)
Gets the ability info for ID.
Definition
abilitydb.cpp:89
AbilityDB::readAbilityNode
void readAbilityNode(XML::Node node, const std::string &filename)
Definition
abilitydb.cpp:55
AbilityInfo
Definition
abilitydb.h:27
AbilityInfo::rechargeNeeded
int rechargeNeeded
Definition
abilitydb.h:42
AbilityInfo::TargetMode
TargetMode
Definition
abilitydb.h:29
AbilityInfo::TARGET_BEING
@ TARGET_BEING
Definition
abilitydb.h:30
AbilityInfo::TARGET_DIRECTION
@ TARGET_DIRECTION
Definition
abilitydb.h:32
AbilityInfo::TARGET_POINT
@ TARGET_POINT
Definition
abilitydb.h:31
AbilityInfo::icon
std::string icon
Definition
abilitydb.h:36
AbilityInfo::rechargeCurrent
int rechargeCurrent
Definition
abilitydb.h:43
AbilityInfo::rechargeable
bool rechargeable
Definition
abilitydb.h:41
AbilityInfo::name
std::string name
Definition
abilitydb.h:35
AbilityInfo::useAction
std::string useAction
Definition
abilitydb.h:37
AbilityInfo::targetMode
TargetMode targetMode
Definition
abilitydb.h:39
AbilityInfo::id
int id
Definition
abilitydb.h:34
xml.h
Generated by
1.9.8