Mana
Loading...
Searching...
No Matches
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
27{
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
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
49namespace 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}
Ability information database.
Definition abilitydb.h:50
void unload()
Definition abilitydb.cpp:81
AbilityInfo * find(std::string_view name)
Finds an ability by name.
Definition abilitydb.cpp:98
void checkStatus()
Definition abilitydb.cpp:76
void init()
Definition abilitydb.cpp:49
AbilityInfo * get(int id)
Gets the ability info for ID.
Definition abilitydb.cpp:89
void readAbilityNode(XML::Node node, const std::string &filename)
Definition abilitydb.cpp:55
int rechargeNeeded
Definition abilitydb.h:42
@ TARGET_DIRECTION
Definition abilitydb.h:32
std::string icon
Definition abilitydb.h:36
int rechargeCurrent
Definition abilitydb.h:43
bool rechargeable
Definition abilitydb.h:41
std::string name
Definition abilitydb.h:35
std::string useAction
Definition abilitydb.h:37
TargetMode targetMode
Definition abilitydb.h:39