fix errors
@@ -1,93 +0,0 @@
1
<?php
2
3
class NPC
4
{
5
private $id;
6
private $saveId;
7
private $name;
8
private $npcType; // 'tribe' or 'individual'
9
private $isRival;
10
private $data = [];
11
12
public function __construct($id, $saveId, $name, $npcType, $isRival = false)
13
{
14
$this->id = $id;
15
$this->saveId = $saveId;
16
$this->name = $name;
17
$this->npcType = $npcType;
18
$this->isRival = $isRival;
19
}
20
21
public static function create($saveId, $name, $npcType, $isRival = false)
22
{
23
$id = uniqid('npc_');
24
return new self($id, $saveId, $name, $npcType, $isRival);
25
}
26
27
public static function fromArray($data)
28
{
29
$npc = new self(
30
$data['id'] ?? uniqid('npc_'),
31
$data['save_id'] ?? null,
32
$data['name'] ?? '',
33
$data['npc_type'] ?? 'individual',
34
$data['is_rival'] ?? false
35
);
36
37
if (isset($data['data'])) {
38
$npc->data = $data['data'];
39
}
40
41
return $npc;
42
}
43
44
public function toArray()
45
{
46
return [
47
'id' => $this->id,
48
'save_id' => $this->saveId,
49
'name' => $this->name,
50
'npc_type' => $this->npcType,
51
'is_rival' => $this->isRival,
52
'data' => $this->data
53
];
54
}
55
56
public function getId()
57
{
58
return $this->id;
59
}
60
61
public function getName()
62
{
63
return $this->name;
64
}
65
66
public function getNpcType()
67
{
68
return $this->npcType;
69
}
70
71
public function isRival()
72
{
73
return $this->isRival;
74
}
75
76
public function setData($key, $value)
77
{
78
$this->data[$key] = $value;
79
}
80
81
public function getData($key = null)
82
{
83
if ($key === null) {
84
return $this->data;
85
}
86
return $this->data[$key] ?? null;
87
}
88
89
public function save()
90
{
91
// NPCs are saved as part of the Tribe's npcs.json
92
}
93
}
@@ -1,93 +0,0 @@1
<?php2
3
class NPC4
{5
private $id;6
private $saveId;7
private $name;8
private $npcType; // 'tribe' or 'individual'9
private $isRival;10
private $data = [];11
12
public function __construct($id, $saveId, $name, $npcType, $isRival = false)13
{14
$this->id = $id;15
$this->saveId = $saveId;16
$this->name = $name;17
$this->npcType = $npcType;18
$this->isRival = $isRival;19
}20
21
public static function create($saveId, $name, $npcType, $isRival = false)22
{23
$id = uniqid('npc_');24
return new self($id, $saveId, $name, $npcType, $isRival);25
}26
27
public static function fromArray($data)28
{29
$npc = new self(30
$data['id'] ?? uniqid('npc_'),31
$data['save_id'] ?? null,32
$data['name'] ?? '',33
$data['npc_type'] ?? 'individual',34
$data['is_rival'] ?? false35
);36
37
if (isset($data['data'])) {38
$npc->data = $data['data'];39
}40
41
return $npc;42
}43
44
public function toArray()45
{46
return [47
'id' => $this->id,48
'save_id' => $this->saveId,49
'name' => $this->name,50
'npc_type' => $this->npcType,51
'is_rival' => $this->isRival,52
'data' => $this->data53
];54
}55
56
public function getId()57
{58
return $this->id;59
}60
61
public function getName()62
{63
return $this->name;64
}65
66
public function getNpcType()67
{68
return $this->npcType;69
}70
71
public function isRival()72
{73
return $this->isRival;74
}75
76
public function setData($key, $value)77
{78
$this->data[$key] = $value;79
}80
81
public function getData($key = null)82
{83
if ($key === null) {84
return $this->data;85
}86
return $this->data[$key] ?? null;87
}88
89
public function save()90
{91
// NPCs are saved as part of the Tribe's npcs.json92
}93
}@@ -226,10 +226,12 @@ class Tribe
226
226
}
227
227
228
228
// Kobold management
229
public function getKobolds($includeDeadAndExpelled = false)
229
public function getKobolds($rivals = false)
230
230
{
231
if ($includeDeadAndExpelled) {
232
return $this->kobolds;
231
if ($rivals) {
232
return array_filter($this->rivals, function (Kobold $k) {
233
return !$k->isDead() && !$k->isExpelled();
234
});
233
235
}
234
236
235
237
return array_filter($this->kobolds, function (Kobold $k) {
@@ -239,22 +241,35 @@ class Tribe
239
241
240
242
public function getKobold($id)
241
243
{
242
return $this->kobolds[$id] ?? null;
244
return $this->kobolds[$id] ?? $this->rivals[$id] ?? null;
243
245
}
244
246
245
public function addKobold(Kobold $kobold)
247
public function addKobold(Kobold $kobold, $rival = false)
246
248
{
249
if ($rival) {
250
$this->rivals[$kobold->getId()] = $kobold;
251
return $kobold;
252
}
253
247
254
$this->kobolds[$kobold->getId()] = $kobold;
248
255
return $kobold;
249
256
}
250
257
251
258
public function removeKobold($id)
252
259
{
253
unset($this->kobolds[$id]);
260
if (isset($this->kobolds[$id]))
261
unset($this->kobolds[$id]);
262
263
if (isset($this->rivals[$id]))
264
unset($this->rivals[$id]);
254
265
}
255
266
256
public function getAliveKobolds()
267
public function getAliveKobolds($rivals = false)
257
268
{
269
if ($rivals) {
270
return array_filter($this->rivals, fn($k) => !$k->isDead());
271
}
272
258
273
return array_filter($this->kobolds, fn($k) => !$k->isDead());
259
274
}
260
275
@@ -226,10 +226,12 @@ class Tribe226
}226
}227
227
228
// Kobold management228
// Kobold management229
public function getKobolds($includeDeadAndExpelled = false)229
public function getKobolds($rivals = false)230
{230
{231
if ($includeDeadAndExpelled) {231
if ($rivals) {232
return $this->kobolds;232
return array_filter($this->rivals, function (Kobold $k) {233
return !$k->isDead() && !$k->isExpelled();234
});233
}235
}234
236
235
return array_filter($this->kobolds, function (Kobold $k) {237
return array_filter($this->kobolds, function (Kobold $k) {@@ -239,22 +241,35 @@ class Tribe239
241
240
public function getKobold($id)242
public function getKobold($id)241
{243
{242
return $this->kobolds[$id] ?? null;244
return $this->kobolds[$id] ?? $this->rivals[$id] ?? null;243
}245
}244
246
245
public function addKobold(Kobold $kobold)247
public function addKobold(Kobold $kobold, $rival = false)246
{248
{249
if ($rival) {250
$this->rivals[$kobold->getId()] = $kobold;251
return $kobold;252
}253
247
$this->kobolds[$kobold->getId()] = $kobold;254
$this->kobolds[$kobold->getId()] = $kobold;248
return $kobold;255
return $kobold;249
}256
}250
257
251
public function removeKobold($id)258
public function removeKobold($id)252
{259
{253
unset($this->kobolds[$id]);260
if (isset($this->kobolds[$id]))261
unset($this->kobolds[$id]);262
263
if (isset($this->rivals[$id]))264
unset($this->rivals[$id]);254
}265
}255
266
256
public function getAliveKobolds()267
public function getAliveKobolds($rivals = false)257
{268
{269
if ($rivals) {270
return array_filter($this->rivals, fn($k) => !$k->isDead());271
}272
258
return array_filter($this->kobolds, fn($k) => !$k->isDead());273
return array_filter($this->kobolds, fn($k) => !$k->isDead());259
}274
}260
275
@@ -7,7 +7,7 @@ class ActivityInjuryEvent extends MonthEndEvent
7
7
{
8
8
public function getMinAge()
9
9
{
10
return 5;
10
return 12;
11
11
}
12
12
13
13
public function getMinParticipants()
@@ -51,7 +51,7 @@ class ActivityInjuryEvent extends MonthEndEvent
51
51
$activities = [
52
52
'gathering expedition',
53
53
'hunting trip',
54
'exploration mission',
54
'fishing outing',
55
55
'water crossing',
56
56
'climbing exercise',
57
57
];
@@ -73,10 +73,10 @@ class ActivityInjuryEvent extends MonthEndEvent
73
73
74
74
$variations = [
75
75
"During a {$activity}, {$namesStr} had a rough time, with some coming away injured.",
76
"Things went awry during the {$activity}. Not all of the group made it back unscathed.",
77
"The {$activity} was more treacherous than expected, and several members returned hurt.",
78
"Accidents happened during the {$activity}, leaving some of the participants bruised.",
79
"The {$activity} was poorly executed, resulting in injuries for some participants.",
76
"Things went awry during a {$activity}. Not all of the group made it back unscathed.",
77
"A {$activity} was more treacherous than expected, and several members returned hurt.",
78
"Accidents happened during a {$activity}, leaving some of the participants bruised.",
79
"A {$activity} was poorly executed, resulting in injuries for some participants.",
80
80
"{$namesStr} engaged in a {$activity} that did not go as planned, with injuries sustained.",
81
81
"A {$activity} left several of the participants nursing wounds they received.",
82
82
];
@@ -7,7 +7,7 @@ class ActivityInjuryEvent extends MonthEndEvent7
{7
{8
public function getMinAge()8
public function getMinAge()9
{9
{10
return 5;10
return 12;11
}11
}12
12
13
public function getMinParticipants()13
public function getMinParticipants()@@ -51,7 +51,7 @@ class ActivityInjuryEvent extends MonthEndEvent51
$activities = [51
$activities = [52
'gathering expedition',52
'gathering expedition',53
'hunting trip',53
'hunting trip',54
'exploration mission',54
'fishing outing',55
'water crossing',55
'water crossing',56
'climbing exercise',56
'climbing exercise',57
];57
];@@ -73,10 +73,10 @@ class ActivityInjuryEvent extends MonthEndEvent73
73
74
$variations = [74
$variations = [75
"During a {$activity}, {$namesStr} had a rough time, with some coming away injured.",75
"During a {$activity}, {$namesStr} had a rough time, with some coming away injured.",76
"Things went awry during the {$activity}. Not all of the group made it back unscathed.",76
"Things went awry during a {$activity}. Not all of the group made it back unscathed.",77
"The {$activity} was more treacherous than expected, and several members returned hurt.",77
"A {$activity} was more treacherous than expected, and several members returned hurt.",78
"Accidents happened during the {$activity}, leaving some of the participants bruised.",78
"Accidents happened during a {$activity}, leaving some of the participants bruised.",79
"The {$activity} was poorly executed, resulting in injuries for some participants.",79
"A {$activity} was poorly executed, resulting in injuries for some participants.",80
"{$namesStr} engaged in a {$activity} that did not go as planned, with injuries sustained.",80
"{$namesStr} engaged in a {$activity} that did not go as planned, with injuries sustained.",81
"A {$activity} left several of the participants nursing wounds they received.",81
"A {$activity} left several of the participants nursing wounds they received.",82
];82
];@@ -84,7 +84,7 @@ class ExplorationEvent extends Event
84
84
85
85
$this->tribe->addFood($totalFood);
86
86
$this->story .= "Success! The explorers discovered edible plants and small game.\n";
87
$this->story .= "The tribe gained " . $totalFood . " units of food.\n\n";
87
$this->story .= "The tribe gained " . $this->tribe->foodTimeStr($totalFood) . " of food.\n\n";
88
88
} else {
89
89
$this->story .= "The terrain was barren. No food was found.\n\n";
90
90
}
@@ -84,7 +84,7 @@ class ExplorationEvent extends Event84
84
85
$this->tribe->addFood($totalFood);85
$this->tribe->addFood($totalFood);86
$this->story .= "Success! The explorers discovered edible plants and small game.\n";86
$this->story .= "Success! The explorers discovered edible plants and small game.\n";87
$this->story .= "The tribe gained " . $totalFood . " units of food.\n\n";87
$this->story .= "The tribe gained " . $this->tribe->foodTimeStr($totalFood) . " of food.\n\n";88
} else {88
} else {89
$this->story .= "The terrain was barren. No food was found.\n\n";89
$this->story .= "The terrain was barren. No food was found.\n\n";90
}90
}@@ -7,7 +7,7 @@ class IllnessEvent extends MonthEndEvent
7
7
{
8
8
public function getMinAge()
9
9
{
10
return 0;
10
return 5;
11
11
}
12
12
13
13
public function getMinParticipants()
@@ -22,7 +22,7 @@ class IllnessEvent extends MonthEndEvent
22
22
23
23
public function getCost()
24
24
{
25
return 10;
25
return 60;
26
26
}
27
27
28
28
public function isAvailable()
@@ -7,7 +7,7 @@ class IllnessEvent extends MonthEndEvent7
{7
{8
public function getMinAge()8
public function getMinAge()9
{9
{10
return 0;10
return 5;11
}11
}12
12
13
public function getMinParticipants()13
public function getMinParticipants()@@ -22,7 +22,7 @@ class IllnessEvent extends MonthEndEvent22
22
23
public function getCost()23
public function getCost()24
{24
{25
return 10;25
return 60;26
}26
}27
27
28
public function isAvailable()28
public function isAvailable()@@ -22,7 +22,7 @@ class IncreaseConsumptionEvent extends MonthEndEvent
22
22
23
23
public function getCost()
24
24
{
25
return 15;
25
return 85;
26
26
}
27
27
28
28
public function isAvailable()
@@ -50,9 +50,7 @@ class IncreaseConsumptionEvent extends MonthEndEvent
50
50
51
51
$reasons = [
52
52
'grew a significant appetite',
53
'had a growth spurt',
54
53
'was always hungry',
55
'consumed extra food',
56
54
'had an insatiable appetite this month',
57
55
'seemed particularly famished',
58
56
'ate with vigor',
@@ -22,7 +22,7 @@ class IncreaseConsumptionEvent extends MonthEndEvent22
22
23
public function getCost()23
public function getCost()24
{24
{25
return 15;25
return 85;26
}26
}27
27
28
public function isAvailable()28
public function isAvailable()@@ -50,9 +50,7 @@ class IncreaseConsumptionEvent extends MonthEndEvent50
50
51
$reasons = [51
$reasons = [52
'grew a significant appetite',52
'grew a significant appetite',53
'had a growth spurt',54
'was always hungry',53
'was always hungry',55
'consumed extra food',56
'had an insatiable appetite this month',54
'had an insatiable appetite this month',57
'seemed particularly famished',55
'seemed particularly famished',58
'ate with vigor',56
'ate with vigor',@@ -22,12 +22,25 @@ class InjuryRecoveryEvent extends MonthEndEvent
22
22
23
23
public function getCost()
24
24
{
25
return 5;
25
return 40;
26
26
}
27
27
28
28
public function isAvailable()
29
29
{
30
return true;
30
$eligible = array_filter($this->tribe->getAliveKobolds(), function ($k) {
31
$injuries = $k->getInjuries() ?? [];
32
foreach ($injuries as $inj) {
33
$category = $inj['category'] ?? null;
34
// Only these categories can heal naturally
35
if (in_array($category, ['cut', 'bruise', 'burn'])) {
36
return true;
37
}
38
}
39
return false;
40
});
41
42
$eligible = array_values($eligible);
43
return !empty($eligible);
31
44
}
32
45
33
46
public function execute()
@@ -22,12 +22,25 @@ class InjuryRecoveryEvent extends MonthEndEvent22
22
23
public function getCost()23
public function getCost()24
{24
{25
return 5;25
return 40;26
}26
}27
27
28
public function isAvailable()28
public function isAvailable()29
{29
{30
return true;30
$eligible = array_filter($this->tribe->getAliveKobolds(), function ($k) {31
$injuries = $k->getInjuries() ?? [];32
foreach ($injuries as $inj) {33
$category = $inj['category'] ?? null;34
// Only these categories can heal naturally35
if (in_array($category, ['cut', 'bruise', 'burn'])) {36
return true;37
}38
}39
return false;40
});41
42
$eligible = array_values($eligible);43
return !empty($eligible);31
}44
}32
45
33
public function execute()46
public function execute()@@ -2,7 +2,6 @@
2
2
3
3
require_once __DIR__ . '/../../src/Events/MonthEndEvent.php';
4
4
require_once __DIR__ . '/../../src/Classes/Kobold.php';
5
require_once __DIR__ . '/../../src/Classes/NPC.php';
6
5
7
6
class RivalEncounterEvent extends MonthEndEvent
8
7
{
@@ -23,7 +22,7 @@ class RivalEncounterEvent extends MonthEndEvent
23
22
24
23
public function getCost()
25
24
{
26
return 25;
25
return 55;
27
26
}
28
27
29
28
public function isAvailable()
@@ -58,12 +57,11 @@ class RivalEncounterEvent extends MonthEndEvent
58
57
// Generate a new rival
59
58
$rivalNames = ['Gruk', 'Zag', 'Mog', 'Drog', 'Bik', 'Kra', 'Nik', 'Tug', 'Vox', 'Warg'];
60
59
$rivalName = $rivalNames[array_rand($rivalNames)];
61
$rival = NPC::create($this->tribe->getSaveId(), $rivalName, 'individual', true);
62
$this->tribe->rivals[] = $rival->toArray();
60
$rival = Kobold::generate($this->tribe->getUserId(), $this->tribe->getSaveId(), rand(13, 50), true);
61
$this->tribe->rivals[] = $this->tribe->addKobold($rival, true);
63
62
} elseif (!empty($rivals)) {
64
63
// Pick an existing rival
65
$rivalData = $rivals[array_rand($rivals)];
66
$rival = NPC::fromArray($rivalData);
64
$rival = $rivals[array_rand($rivals)];
67
65
}
68
66
69
67
// If no rival exists, return
@@ -2,7 +2,6 @@2
2
3
require_once __DIR__ . '/../../src/Events/MonthEndEvent.php';3
require_once __DIR__ . '/../../src/Events/MonthEndEvent.php';4
require_once __DIR__ . '/../../src/Classes/Kobold.php';4
require_once __DIR__ . '/../../src/Classes/Kobold.php';5
require_once __DIR__ . '/../../src/Classes/NPC.php';6
5
7
class RivalEncounterEvent extends MonthEndEvent6
class RivalEncounterEvent extends MonthEndEvent8
{7
{@@ -23,7 +22,7 @@ class RivalEncounterEvent extends MonthEndEvent23
22
24
public function getCost()23
public function getCost()25
{24
{26
return 25;25
return 55;27
}26
}28
27
29
public function isAvailable()28
public function isAvailable()@@ -58,12 +57,11 @@ class RivalEncounterEvent extends MonthEndEvent58
// Generate a new rival57
// Generate a new rival59
$rivalNames = ['Gruk', 'Zag', 'Mog', 'Drog', 'Bik', 'Kra', 'Nik', 'Tug', 'Vox', 'Warg'];58
$rivalNames = ['Gruk', 'Zag', 'Mog', 'Drog', 'Bik', 'Kra', 'Nik', 'Tug', 'Vox', 'Warg'];60
$rivalName = $rivalNames[array_rand($rivalNames)];59
$rivalName = $rivalNames[array_rand($rivalNames)];61
$rival = NPC::create($this->tribe->getSaveId(), $rivalName, 'individual', true);60
$rival = Kobold::generate($this->tribe->getUserId(), $this->tribe->getSaveId(), rand(13, 50), true);62
$this->tribe->rivals[] = $rival->toArray();61
$this->tribe->rivals[] = $this->tribe->addKobold($rival, true);63
} elseif (!empty($rivals)) {62
} elseif (!empty($rivals)) {64
// Pick an existing rival63
// Pick an existing rival65
$rivalData = $rivals[array_rand($rivals)];64
$rival = $rivals[array_rand($rivals)];66
$rival = NPC::fromArray($rivalData);67
}65
}68
66
69
// If no rival exists, return67
// If no rival exists, return@@ -89,7 +89,7 @@ class SocialEvent extends MonthEndEvent
89
89
"A quiet understanding passed between {$nameA} and {$nameB} as they watched the sunset together, their friendship strengthening in the peaceful silence.",
90
90
"{$nameA} and {$nameB} explored the nearby stream, skipping stones and sharing dreams, growing closer with every moment.",
91
91
"Through shared hardship and triumph, {$nameA} and {$nameB} found their connection deepening, each grateful for the other's presence.",
92
"{$nameA} taught {$nameB} a new skill this month, and in return {$nameB} shared wisdom of their own—their mutual respect blossomed.",
92
"{$nameA} taught {$nameB} a new skill this month, and in return {$nameB} shared wisdom of {$koboldB->his()} own—their mutual respect blossomed.",
93
93
"A chance encounter led {$nameA} and {$nameB} to spend the day together, discovering common interests and kindred spirits.",
94
94
"{$nameA} and {$nameB} found comfort in each other's company during a stormy night, their bond growing stronger through the shared experience.",
95
95
"The tribe noticed {$nameA} and {$nameB} seeking each other out more often, their friendship becoming a source of joy for both.",
@@ -109,12 +109,12 @@ class SocialEvent extends MonthEndEvent
109
109
"While {$nameB} was preoccupied with other matters, {$nameA} grew more appreciative of {$nameB}'s qualities and presence in the tribe.",
110
110
"{$nameA} made several attempts to connect with {$nameB}, and though the responses were lukewarm, {$nameA}'s fondness only grew.",
111
111
"As {$nameA} watched {$nameB} from afar, admiration bloomed—though {$nameB} remained largely unaware of the attention.",
112
"{$nameA} went out of their way to help {$nameB} with various tasks, developing a quiet affection despite {$nameB}'s apparent indifference.",
112
"{$nameA} went out of {$koboldA->his()} way to help {$nameB} with various tasks, developing a quiet affection despite {$nameB}'s apparent indifference.",
113
113
"Through patient observation, {$nameA} came to appreciate {$nameB}'s unique strengths, even as {$nameB} barely noticed the growing admiration.",
114
"{$nameA} found {$nameB}'s quirks increasingly endearing this month, though their interactions remained somewhat one-sided.",
114
"{$nameA} found {$nameB}'s quirks increasingly endearing this month, though {$koboldA->his()} interactions remained somewhat one-sided.",
115
115
"A series of small gestures from {$nameA} toward {$nameB} went largely unacknowledged, yet {$nameA}'s regard only deepened.",
116
116
"{$nameA} discovered a growing respect for how {$nameB} handled challenges, even if {$nameB} didn't reciprocate the sentiment.",
117
"Despite {$nameB}'s cool demeanor, {$nameA} saw glimpses of something admirable beneath the surface, and their fondness grew."
117
"Despite {$nameB}'s cool demeanor, {$nameA} saw glimpses of something admirable beneath the surface, and {$koboldA->his()} fondness grew."
118
118
];
119
119
120
120
$this->story = $aSuccessVariations[array_rand($aSuccessVariations)];
@@ -127,12 +127,12 @@ class SocialEvent extends MonthEndEvent
127
127
"While {$nameA} was preoccupied with other matters, {$nameB} grew more appreciative of {$nameA}'s qualities and presence in the tribe.",
128
128
"{$nameB} made several attempts to connect with {$nameA}, and though the responses were lukewarm, {$nameB}'s fondness only grew.",
129
129
"As {$nameB} watched {$nameA} from afar, admiration bloomed—though {$nameA} remained largely unaware of the attention.",
130
"{$nameB} went out of their way to help {$nameA} with various tasks, developing a quiet affection despite {$nameA}'s apparent indifference.",
130
"{$nameB} went out of {$koboldB->his()} way to help {$nameA} with various tasks, developing a quiet affection despite {$nameA}'s apparent indifference.",
131
131
"Through patient observation, {$nameB} came to appreciate {$nameA}'s unique strengths, even as {$nameA} barely noticed the growing admiration.",
132
"{$nameB} found {$nameA}'s quirks increasingly endearing this month, though their interactions remained somewhat one-sided.",
132
"{$nameB} found {$nameA}'s quirks increasingly endearing this month, though {$koboldB->his()} interactions remained somewhat one-sided.",
133
133
"A series of small gestures from {$nameB} toward {$nameA} went largely unacknowledged, yet {$nameB}'s regard only deepened.",
134
134
"{$nameB} discovered a growing respect for how {$nameA} handled challenges, even if {$nameA} didn't reciprocate the sentiment.",
135
"Despite {$nameA}'s cool demeanor, {$nameB} saw glimpses of something admirable beneath the surface, and their fondness grew."
135
"Despite {$nameA}'s cool demeanor, {$nameB} saw glimpses of something admirable beneath the surface, and {$koboldB->his()} fondness grew."
136
136
];
137
137
138
138
$this->story = $bSuccessVariations[array_rand($bSuccessVariations)];
@@ -89,7 +89,7 @@ class SocialEvent extends MonthEndEvent89
"A quiet understanding passed between {$nameA} and {$nameB} as they watched the sunset together, their friendship strengthening in the peaceful silence.",89
"A quiet understanding passed between {$nameA} and {$nameB} as they watched the sunset together, their friendship strengthening in the peaceful silence.",90
"{$nameA} and {$nameB} explored the nearby stream, skipping stones and sharing dreams, growing closer with every moment.",90
"{$nameA} and {$nameB} explored the nearby stream, skipping stones and sharing dreams, growing closer with every moment.",91
"Through shared hardship and triumph, {$nameA} and {$nameB} found their connection deepening, each grateful for the other's presence.",91
"Through shared hardship and triumph, {$nameA} and {$nameB} found their connection deepening, each grateful for the other's presence.",92
"{$nameA} taught {$nameB} a new skill this month, and in return {$nameB} shared wisdom of their own—their mutual respect blossomed.",92
"{$nameA} taught {$nameB} a new skill this month, and in return {$nameB} shared wisdom of {$koboldB->his()} own—their mutual respect blossomed.",93
"A chance encounter led {$nameA} and {$nameB} to spend the day together, discovering common interests and kindred spirits.",93
"A chance encounter led {$nameA} and {$nameB} to spend the day together, discovering common interests and kindred spirits.",94
"{$nameA} and {$nameB} found comfort in each other's company during a stormy night, their bond growing stronger through the shared experience.",94
"{$nameA} and {$nameB} found comfort in each other's company during a stormy night, their bond growing stronger through the shared experience.",95
"The tribe noticed {$nameA} and {$nameB} seeking each other out more often, their friendship becoming a source of joy for both.",95
"The tribe noticed {$nameA} and {$nameB} seeking each other out more often, their friendship becoming a source of joy for both.",@@ -109,12 +109,12 @@ class SocialEvent extends MonthEndEvent109
"While {$nameB} was preoccupied with other matters, {$nameA} grew more appreciative of {$nameB}'s qualities and presence in the tribe.",109
"While {$nameB} was preoccupied with other matters, {$nameA} grew more appreciative of {$nameB}'s qualities and presence in the tribe.",110
"{$nameA} made several attempts to connect with {$nameB}, and though the responses were lukewarm, {$nameA}'s fondness only grew.",110
"{$nameA} made several attempts to connect with {$nameB}, and though the responses were lukewarm, {$nameA}'s fondness only grew.",111
"As {$nameA} watched {$nameB} from afar, admiration bloomed—though {$nameB} remained largely unaware of the attention.",111
"As {$nameA} watched {$nameB} from afar, admiration bloomed—though {$nameB} remained largely unaware of the attention.",112
"{$nameA} went out of their way to help {$nameB} with various tasks, developing a quiet affection despite {$nameB}'s apparent indifference.",112
"{$nameA} went out of {$koboldA->his()} way to help {$nameB} with various tasks, developing a quiet affection despite {$nameB}'s apparent indifference.",113
"Through patient observation, {$nameA} came to appreciate {$nameB}'s unique strengths, even as {$nameB} barely noticed the growing admiration.",113
"Through patient observation, {$nameA} came to appreciate {$nameB}'s unique strengths, even as {$nameB} barely noticed the growing admiration.",114
"{$nameA} found {$nameB}'s quirks increasingly endearing this month, though their interactions remained somewhat one-sided.",114
"{$nameA} found {$nameB}'s quirks increasingly endearing this month, though {$koboldA->his()} interactions remained somewhat one-sided.",115
"A series of small gestures from {$nameA} toward {$nameB} went largely unacknowledged, yet {$nameA}'s regard only deepened.",115
"A series of small gestures from {$nameA} toward {$nameB} went largely unacknowledged, yet {$nameA}'s regard only deepened.",116
"{$nameA} discovered a growing respect for how {$nameB} handled challenges, even if {$nameB} didn't reciprocate the sentiment.",116
"{$nameA} discovered a growing respect for how {$nameB} handled challenges, even if {$nameB} didn't reciprocate the sentiment.",117
"Despite {$nameB}'s cool demeanor, {$nameA} saw glimpses of something admirable beneath the surface, and their fondness grew."117
"Despite {$nameB}'s cool demeanor, {$nameA} saw glimpses of something admirable beneath the surface, and {$koboldA->his()} fondness grew."118
];118
];119
119
120
$this->story = $aSuccessVariations[array_rand($aSuccessVariations)];120
$this->story = $aSuccessVariations[array_rand($aSuccessVariations)];@@ -127,12 +127,12 @@ class SocialEvent extends MonthEndEvent127
"While {$nameA} was preoccupied with other matters, {$nameB} grew more appreciative of {$nameA}'s qualities and presence in the tribe.",127
"While {$nameA} was preoccupied with other matters, {$nameB} grew more appreciative of {$nameA}'s qualities and presence in the tribe.",128
"{$nameB} made several attempts to connect with {$nameA}, and though the responses were lukewarm, {$nameB}'s fondness only grew.",128
"{$nameB} made several attempts to connect with {$nameA}, and though the responses were lukewarm, {$nameB}'s fondness only grew.",129
"As {$nameB} watched {$nameA} from afar, admiration bloomed—though {$nameA} remained largely unaware of the attention.",129
"As {$nameB} watched {$nameA} from afar, admiration bloomed—though {$nameA} remained largely unaware of the attention.",130
"{$nameB} went out of their way to help {$nameA} with various tasks, developing a quiet affection despite {$nameA}'s apparent indifference.",130
"{$nameB} went out of {$koboldB->his()} way to help {$nameA} with various tasks, developing a quiet affection despite {$nameA}'s apparent indifference.",131
"Through patient observation, {$nameB} came to appreciate {$nameA}'s unique strengths, even as {$nameA} barely noticed the growing admiration.",131
"Through patient observation, {$nameB} came to appreciate {$nameA}'s unique strengths, even as {$nameA} barely noticed the growing admiration.",132
"{$nameB} found {$nameA}'s quirks increasingly endearing this month, though their interactions remained somewhat one-sided.",132
"{$nameB} found {$nameA}'s quirks increasingly endearing this month, though {$koboldB->his()} interactions remained somewhat one-sided.",133
"A series of small gestures from {$nameB} toward {$nameA} went largely unacknowledged, yet {$nameB}'s regard only deepened.",133
"A series of small gestures from {$nameB} toward {$nameA} went largely unacknowledged, yet {$nameB}'s regard only deepened.",134
"{$nameB} discovered a growing respect for how {$nameA} handled challenges, even if {$nameA} didn't reciprocate the sentiment.",134
"{$nameB} discovered a growing respect for how {$nameA} handled challenges, even if {$nameA} didn't reciprocate the sentiment.",135
"Despite {$nameA}'s cool demeanor, {$nameB} saw glimpses of something admirable beneath the surface, and their fondness grew."135
"Despite {$nameA}'s cool demeanor, {$nameB} saw glimpses of something admirable beneath the surface, and {$koboldB->his()} fondness grew."136
];136
];137
137
138
$this->story = $bSuccessVariations[array_rand($bSuccessVariations)];138
$this->story = $bSuccessVariations[array_rand($bSuccessVariations)];@@ -8,7 +8,7 @@ class WalkDiscoveryEvent extends MonthEndEvent
8
8
{
9
9
public function getMinAge()
10
10
{
11
return 8;
11
return 13;
12
12
}
13
13
14
14
public function getMinParticipants()
@@ -23,7 +23,7 @@ class WalkDiscoveryEvent extends MonthEndEvent
23
23
24
24
public function getCost()
25
25
{
26
return 20;
26
return 40;
27
27
}
28
28
29
29
public function isAvailable()
@@ -54,14 +54,16 @@ class WalkDiscoveryEvent extends MonthEndEvent
54
54
$foodAmount = rand(3, 8);
55
55
$this->tribe->addFood($foodAmount);
56
56
57
$foodStr = $this->tribe->foodTimeStr($foodAmount);
58
57
59
$foodVariations = [
58
"{$nameA} found some edible plants during a walk and brought back {$foodAmount} food.",
59
"While exploring, {$nameA} discovered a cache of berries and returned with {$foodAmount} food.",
60
"{$nameA}'s keen eye spotted food sources, adding {$foodAmount} to the tribe's stores.",
61
"A fortunate walk led {$nameA} to gather {$foodAmount} food for the tribe.",
62
"{$nameA} returned from a walk with {$foodAmount} food, a welcome find.",
63
"During a solitary walk, {$nameA} found edible resources and collected {$foodAmount} food.",
64
"{$nameA} stumbled upon a food source during a walk, bringing back {$foodAmount}.",
60
"{$nameA} found some edible plants during a walk and brought back {$foodStr} worth of food.",
61
"While exploring, {$nameA} discovered a cache of berries and returned with {$foodStr} worth of food.",
62
"{$nameA}'s keen eye spotted food sources, adding {$foodStr} worth of food to the tribe's stores.",
63
"A fortunate walk led {$nameA} to gather {$foodStr} worth of food for the tribe.",
64
"{$nameA} returned from a walk with {$foodStr} worth of food, a welcome find.",
65
"During a solitary walk, {$nameA} found edible resources and collected {$foodStr} worth of food.",
66
"{$nameA} stumbled upon a food source during a walk, bringing back {$foodStr} worth of food.",
65
67
];
66
68
67
69
$this->story = $foodVariations[array_rand($foodVariations)];
@@ -8,7 +8,7 @@ class WalkDiscoveryEvent extends MonthEndEvent8
{8
{9
public function getMinAge()9
public function getMinAge()10
{10
{11
return 8;11
return 13;12
}12
}13
13
14
public function getMinParticipants()14
public function getMinParticipants()@@ -23,7 +23,7 @@ class WalkDiscoveryEvent extends MonthEndEvent23
23
24
public function getCost()24
public function getCost()25
{25
{26
return 20;26
return 40;27
}27
}28
28
29
public function isAvailable()29
public function isAvailable()@@ -54,14 +54,16 @@ class WalkDiscoveryEvent extends MonthEndEvent54
$foodAmount = rand(3, 8);54
$foodAmount = rand(3, 8);55
$this->tribe->addFood($foodAmount);55
$this->tribe->addFood($foodAmount);56
56
57
$foodStr = $this->tribe->foodTimeStr($foodAmount);58
57
$foodVariations = [59
$foodVariations = [58
"{$nameA} found some edible plants during a walk and brought back {$foodAmount} food.",60
"{$nameA} found some edible plants during a walk and brought back {$foodStr} worth of food.",59
"While exploring, {$nameA} discovered a cache of berries and returned with {$foodAmount} food.",61
"While exploring, {$nameA} discovered a cache of berries and returned with {$foodStr} worth of food.",60
"{$nameA}'s keen eye spotted food sources, adding {$foodAmount} to the tribe's stores.",62
"{$nameA}'s keen eye spotted food sources, adding {$foodStr} worth of food to the tribe's stores.",61
"A fortunate walk led {$nameA} to gather {$foodAmount} food for the tribe.",63
"A fortunate walk led {$nameA} to gather {$foodStr} worth of food for the tribe.",62
"{$nameA} returned from a walk with {$foodAmount} food, a welcome find.",64
"{$nameA} returned from a walk with {$foodStr} worth of food, a welcome find.",63
"During a solitary walk, {$nameA} found edible resources and collected {$foodAmount} food.",65
"During a solitary walk, {$nameA} found edible resources and collected {$foodStr} worth of food.",64
"{$nameA} stumbled upon a food source during a walk, bringing back {$foodAmount}.",66
"{$nameA} stumbled upon a food source during a walk, bringing back {$foodStr} worth of food.",65
];67
];66
68
67
$this->story = $foodVariations[array_rand($foodVariations)];69
$this->story = $foodVariations[array_rand($foodVariations)];@@ -676,7 +676,7 @@ if ($method === 'POST') {
676
676
677
677
$events = [];
678
678
foreach (get_declared_classes() as $className) {
679
if (!is_subclass_of($className, 'Event')) {
679
if (!is_subclass_of($className, 'Event') || $className === 'MonthEndEvent') {
680
680
continue;
681
681
}
682
682
@@ -676,7 +676,7 @@ if ($method === 'POST') {676
676
677
$events = [];677
$events = [];678
foreach (get_declared_classes() as $className) {678
foreach (get_declared_classes() as $className) {679
if (!is_subclass_of($className, 'Event')) {679
if (!is_subclass_of($className, 'Event') || $className === 'MonthEndEvent') {680
continue;680
continue;681
}681
}682
682