-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathevents-assassination.cpp
More file actions
85 lines (71 loc) · 1.84 KB
/
events-assassination.cpp
File metadata and controls
85 lines (71 loc) · 1.84 KB
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
#include "events.h"
#include "logger.hpp"
#include <memory>
#include <stdexcept>
#include <sstream>
#include "rng.hpp"
#include "string_filters.hpp"
AssassinationFact::AssassinationFact() {
this->location = EventLocation();
}
AssassinationFact::~AssassinationFact() {
}
const std::vector<std::string> SENTIMENT = {
"fearsome",
"alarming",
"horrifying",
"frightening",
"worrisome"
};
const std::vector<std::string> LOCALS = {
"citizens",
"inhabitants",
"locals",
"commoners"
};
const std::vector<std::string> FEELING = {
"shocked",
"stunned",
"horrified",
"terrified",
"afraid",
"scared"
};
void AssassinationFact::GetEvents(std::list<Event> &events) {
std::ostringstream buffer;
buffer
<< (rng::one_of(SENTIMENT) | filter::capitalize)
<< " news were coming from the"
<< " " << this->location.GetTerrainName(true)
<< " of " << this->location.province
<< "."
;
buffer
<< " " << (rng::one_of(LOCALS) | filter::capitalize)
<< " were " << rng::one_of(FEELING)
<< " by the assassination"
;
if (this->outcome != BATTLE_LOST) {
buffer << " attempt";
}
auto mark = this->location.GetSignificantLandmark();
if (mark) {
buffer
<< " " << (mark->distance == 0 ? "in" : "near")
<< " the " << mark->title;
}
if (this->outcome == BATTLE_LOST) {
buffer << ". The assassin escaped unnoticed.";
}
else if (this->outcome == BATTLE_DRAW) {
buffer << "; thankfully, the victim survived, but the assassin was able to escape unnoticed.";
}
else {
buffer << "; thankfully, the victim survived.";
}
events.push_back({
.category = EventCategory::EVENT_ASSASSINATION,
.score = 1,
.text = buffer.str()
});
}