ScummVM API documentation
opinion.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
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 3 of the License, or
10  * (at your option) 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 
22 /*
23  * This code is based on the CRAB engine
24  *
25  * Copyright (c) Arvind Raja Yadav
26  *
27  * Licensed under MIT
28  *
29  */
30 
31 #ifndef CRAB_OPINION_H
32 #define CRAB_OPINION_H
33 
34 #include "crab/rapidxml/rapidxml.hpp"
35 namespace Crab {
36 
37 namespace pyrodactyl {
38 namespace people {
39 // What each opinion type is
40 // like - how much a person likes you
41 // intimidate - how much a person fears you
42 // respect - how much a person respects you
43 enum OpinionType {
44  OPI_LIKE,
45  OPI_RESPECT,
46  OPI_FEAR,
47  OPI_TOTAL
48 };
49 
50 // The limits on opinion values
51 extern int OPINION_MIN, OPINION_MAX;
52 
53 struct Opinion {
54  // The opinion of the character about the player
55  // Range 0 to 100 , 100 = absolutely adore you, and 0 = really hate you
56  int _val[OPI_TOTAL];
57 
58  Opinion();
59  ~Opinion() {}
60 
61  void change(const OpinionType &type, const int &change);
62  void set(const OpinionType &type, const int &val);
63  void validate(const OpinionType &type);
64 
65  void load(rapidxml::xml_node<char> *node);
66  void saveState(rapidxml::xml_document<> &doc, rapidxml::xml_node<char> *root);
67 };
68 } // End of namespace people
69 } // End of namespace pyrodactyl
70 
71 } // End of namespace Crab
72 
73 #endif // CRAB_OPINION_H
Definition: opinion.h:53
Definition: moveeffect.h:37