/
common_steps.cpp
76 lines (62 loc) · 1.61 KB
/
common_steps.cpp
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
//
// common_steps.cpp
// revenge
//
// Created by Chris Wild on 25/03/2023.
//
// "No, Morkin, Corleth was testing your spirit: it is better to know your
// comrade’s mettle before the real battle begins, is it not?"
//
#include "common_steps.h"
#include "../../src/tme/scenarios/ddr/scenario_ddr_internal.h"
using namespace std;
inline ddr_character* GetDDRCharacter(LPCSTR name)
{
return static_cast<tme::ddr_character*>(GetCharacter(name));
}
void DDRStep::GameWon()
{
GetCharacter(DDRStep::ch_shareth)->Cmd_Dead();
TMEStep::NightFalls();
}
void DDRStep::GameLost()
{
GetCharacter(TMEStep::ch_luxor)->Cmd_Dead();
TMEStep::NightFalls();
}
void DDRStep::LordKilledByCharacter(LPCSTR name, LPCSTR killedby)
{
auto lord = GetDDRCharacter(name);
lord->Cmd_Dead();
lord->fighting_against = GetDDRCharacter(killedby);
}
void DDRStep::MorkinRescued()
{
auto morkin = GetCharacter(TMEStep::ch_morkin);
auto tarithel = GetCharacter(ch_tarithel);
morkin->Recruited(tarithel);
}
void DDRStep::LordAtGateOfVarenorn(LPCSTR name)
{
mxgridref gate_varenorn = mxgridref(6,92);
auto lord = GetCharacter(name);
lord->Location(gate_varenorn);
}
void DDRStep::LordNotAtGateOfVarenorn(LPCSTR name)
{
mxgridref loc = mxgridref(0,0);
auto lord = GetCharacter(name);
lord->Location(loc);
}
void DDRStep::LordsAtGateOfVarenorn(vector<string> names)
{
for (string &name : names) {
LordAtGateOfVarenorn(name.c_str());
}
}
void DDRStep::LordsNotAtGateOfVarenorn(vector<string> names)
{
for (string &name : names) {
LordNotAtGateOfVarenorn(name.c_str());
}
}