forked from EasyRPG/Player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_enemyparty.h
97 lines (83 loc) · 2.22 KB
/
game_enemyparty.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
* This file is part of EasyRPG Player.
*
* EasyRPG Player is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EasyRPG Player is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EP_GAME_ENEMYPARTY_H
#define EP_GAME_ENEMYPARTY_H
#include <vector>
#include <lcf/rpg/troop.h>
#include "game_enemy.h"
#include "game_party_base.h"
/**
* Manages the enemy party during battles.
*/
class Game_EnemyParty : public Game_Party_Base {
public:
/**
* Initializes Game_Enemy_Party.
*/
Game_EnemyParty();
Game_Enemy& operator[] (const int index) override;
int GetBattlerCount() const override;
int GetVisibleBattlerCount() const override;
/**
* Reset the party for a new battle.
*
* @param battle_troop_id ID of the enemy party, or 0 for empty.
*/
void ResetBattle(int battle_troop_id);
/**
* Gets a list with all party members
*
* @return list of party members
*/
std::vector<Game_Enemy*> GetEnemies();
/**
* Sums up the experience points of all enemy party members.
*
* @return All experience points
*/
int GetExp() const;
/**
* Sums up the money of all enemy party members.
*
* @return All money
*/
int GetMoney() const;
/**
* Rolls once for each enemy's drops.
*
* @param out List of the dropped items' IDs
*/
void GenerateDrops(std::vector<int>& out) const;
/**
* Get the enemy by party index.
*
* @param idx the index of the enemy.
* @return enemy from party
*/
Game_Enemy* GetEnemy(int idx);
/**
* Get the position index of the enemy in the party.
*
* @param enemy the enemy to query.
*
* @return 0 based index, or -1 if not found
*/
int GetEnemyPositionInParty(const Game_Enemy* enemy) const;
private:
std::vector<Game_Enemy> enemies;
};
#endif