File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ void CastSpell::performSpell(Character *chr) {
196
196
c._gems = MAX (c._gems - _requiredGems, 0 );
197
197
198
198
if (!isMagicAllowed ()) {
199
- spellDone (STRING[" dialogs.misc .magic_doesnt_work" ], 5 );
199
+ spellDone (STRING[" spells .magic_doesnt_work" ], 5 );
200
200
} else {
201
201
// Cast the spell
202
202
switch (Game::SpellsParty::cast (_spellIndex, chr)) {
Original file line number Diff line number Diff line change 20
20
*/
21
21
22
22
#include " mm/mm1/views_enh/spells/cast_spell.h"
23
+ #include " mm/mm1/game/spells_party.h"
23
24
#include " mm/mm1/globals.h"
24
25
25
26
namespace MM {
@@ -140,7 +141,27 @@ void CastSpell::updateSelectedSpell() {
140
141
}
141
142
142
143
void CastSpell::castSpell (Character *target) {
143
- warning (" TODO: cast spell" );
144
+ if (!isMagicAllowed ()) {
145
+ g_events->send (InfoMessage (STRING[" spells.magic_doesnt_work" ]));
146
+
147
+ } else {
148
+ // Cast the spell
149
+ Game::SpellResult result = Game::SpellsParty::cast (_spellIndex, target);
150
+
151
+ switch (result) {
152
+ case Game::SR_FAILED:
153
+ g_events->send (InfoMessage (STRING[" spells.failed" ]));
154
+ break ;
155
+
156
+ case Game::SR_SUCCESS_DONE:
157
+ g_events->send (InfoMessage (STRING[" spells.done" ]));
158
+ break ;
159
+
160
+ default :
161
+ // Spell done, but don't display done message
162
+ break ;
163
+ }
164
+ }
144
165
}
145
166
146
167
void CastSpell::spellError () {
You can’t perform that action at this time.
0 commit comments