ScummVM API documentation
effect.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_EFFECT_H
32 #define CRAB_EFFECT_H
33 
34 #include "crab/loaders.h"
35 #include "crab/event/GameEventInfo.h"
36 #include "crab/people/person.h"
37 #include "crab/rapidxml/rapidxml.hpp"
38 
39 namespace Crab {
40 
41 namespace pyrodactyl {
42 namespace event {
43 enum EventResultType {
44  ER_NONE, // Do nothing
45  ER_MAP, // Change the map visible to player
46  ER_DEST, // Add or remove a destination on world map
47  ER_IMG, // Change the character button image
48  ER_TRAIT, // Add or remove a trait from a character
49  ER_LEVEL, // Change level
50  ER_MOVE, // Move sprite
51  ER_PLAYER, // Switch the player sprite
52  ER_SAVE, // Save game
53  ER_SYNC, // Sync the level
54  ER_QUIT // Quit to main menu
55 };
56 
57 struct EventResult {
58  EventResultType _type;
59  Common::String _val;
60  int _x, _y;
61 
62  EventResult() {
63  _type = ER_NONE;
64  _x = -1;
65  _y = -1;
66  }
67 };
68 
69 struct EventSeqInfo {
70  bool _cur;
71  Common::String _loc, _val;
72 
73  EventSeqInfo() {
74  _cur = false;
75  }
76 
77  EventSeqInfo(const bool &cur) {
78  _cur = cur;
79  }
80 };
81 
82 enum EffectType {
83  EFF_VAR, // variable operations like adding, removing etc
84  EFF_JOURNAL, // Add an objective to the player quest book
85  EFF_OBJ, // Change status (hostile, coward etc), state (stand, fight, flee, KO etc) of a character
86  EFF_ITEM, // Add/remove an item in the player's inventory
87  EFF_LIKE, // Change opinion of a character (charm)
88  EFF_FEAR, // Change opinion of a character (intimidate)
89  EFF_RESPECT, // Change opinion of a character (respect)
90  EFF_HEALTH, // Change health of a character
91  EFF_SOUND, // Manipulate the game music
92  EFF_MONEY, // Set the money variable (not its value, just that which variable is the current money variable)
93  EFF_END, // End of the event sequence, remove it from active sequences
94  // EFFECT DIVISION HERE
95  EFF_MOVE, // Make a character move
96  EFF_MAP, // Change the world map
97  EFF_DEST, // Add a destination to the world map
98  EFF_IMG, // Change the player button image
99  EFF_TRAIT, // Add or remove a trait from a character
100  EFF_LEVEL, // Load a new level
101  EFF_PLAYER, // Swap the player sprite
102  EFF_SAVE, // Auto save the game
103  EFF_QUIT // Quit to main menu
104 };
105 
106 struct Effect {
107  EffectType _type;
108  Common::String _subject, _operation, _val;
109 
110  Effect() {
111  _type = EFF_VAR;
112  }
113 
114  ~Effect() {}
115 
116  void load(rapidxml::xml_node<char> *node);
117  bool execute(pyrodactyl::event::Info &info, const Common::String &playerId,
119 
120  void changeOpinion(pyrodactyl::event::Info &info, pyrodactyl::people::OpinionType type);
121 };
122 } // End of namespace event
123 } // End of namespace pyrodactyl
124 
125 } // End of namespace Crab
126 
127 #endif // CRAB_EFFECT_H
Definition: str.h:59
Definition: array.h:52
Definition: GameEventInfo.h:44
Definition: effect.h:106
Definition: moveeffect.h:37