Skip to content

Commit d26b56c

Browse files
committed
Add support for fighting fantasy: Beneath Nightmare Castle, Phantoms of Fear and Sword of the Samurai
1 parent 659f035 commit d26b56c

File tree

5 files changed

+241
-10
lines changed

5 files changed

+241
-10
lines changed

extras/book_support.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<title></title>
88
<meta name="generator" content="LibreOffice 4.4.7.2 (Windows)"/>
99
<meta name="created" content="2018-12-27T07:35:15.609000000"/>
10-
<meta name="changed" content="2019-05-05T17:55:47.129000000"/>
10+
<meta name="changed" content="2019-05-08T22:39:43.446000000"/>
1111

1212
<style type="text/css">
1313
body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Liberation Sans"; font-size:x-small }
@@ -106,10 +106,10 @@
106106
<tr>
107107
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="28" align="right" sdval="25" sdnum="2057;"><font size=4>25</font></td>
108108
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4>Beneath Nightmare Castle</font></td>
109-
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font face="Courier New" size=4>ff_basic</font></td>
110-
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left" bgcolor="#FF6666"><font size=4>bad</font></td>
109+
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font face="Courier New" size=4>ff_bnc</font></td>
110+
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left" bgcolor="#66FF66"><font size=4>good</font></td>
111111
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4>No</font></td>
112-
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4>Willpower rules not supported</font></td>
112+
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4><br></font></td>
113113
</tr>
114114
<tr>
115115
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="28" align="right" sdval="42" sdnum="2057;"><font size=4>42</font></td>
@@ -402,10 +402,10 @@
402402
<tr>
403403
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="28" align="right" sdval="28" sdnum="2057;"><font size=4>28</font></td>
404404
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4>Phantoms of Fear</font></td>
405-
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font face="Courier New" size=4>ff_wofm</font></td>
406-
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left" bgcolor="#FFFF66"><font size=4>poor</font></td>
405+
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font face="Courier New" size=4>ff_pof</font></td>
406+
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left" bgcolor="#66FF66"><font size=4>good</font></td>
407407
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4>No</font></td>
408-
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4>This book's spells not supported</font></td>
408+
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4><br></font></td>
409409
</tr>
410410
<tr>
411411
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="28" align="right"><font size=4>-</font></td>
@@ -562,10 +562,10 @@
562562
<tr>
563563
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="28" align="right" sdval="20" sdnum="2057;"><font size=4>20</font></td>
564564
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4>Sword of the Samurai</font></td>
565-
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font face="Courier New" size=4>ff_basic</font></td>
566-
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left" bgcolor="#FF6666"><font size=4>bad</font></td>
565+
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font face="Courier New" size=4>ff_sots</font></td>
566+
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left" bgcolor="#66FF66"><font size=4>good</font></td>
567567
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4>No</font></td>
568-
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4>Honour Points and Skills not supported</font></td>
568+
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" align="left"><font size=4><br></font></td>
569569
</tr>
570570
<tr>
571571
<td style="border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000" height="28" align="right" sdval="11" sdnum="2057;"><font size=4>11</font></td>

extras/book_support.ods

-42 Bytes
Binary file not shown.

logic/rulesets/ff_bnc.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
require_once 'ff_basic.php';
4+
5+
class book_ff_bnc extends book_ff_basic {
6+
protected function getStats() {
7+
$stats = parent::getStats();
8+
$stats['will'] = [
9+
'friendly' => 'Willpower',
10+
'alias' => ['willpower'],
11+
'roll' => 'ff1die',
12+
'display' => 'current_and_max',
13+
'testdice' => 2,
14+
'testpass' => '{youare} strong willed',
15+
'testfail' => '{youare} weak willed',
16+
];
17+
return $stats;
18+
}
19+
20+
21+
// In Slack format
22+
protected function getCharcterSheetAttachments() {
23+
$player = &$this->player;
24+
$attachments = parent::getCharcterSheetAttachments();
25+
$attachments[0]['fields'][] = [
26+
'title' => 'Willpower',
27+
'value' => $player['will']." / ".$player['max']['will'],
28+
'short' => true
29+
];
30+
return $attachments;
31+
}
32+
33+
34+
//// !test <luck/skill/stam> (run a skill test)
35+
protected function _cmd_test($cmd) {
36+
// Extra processing for willpower check
37+
$result = parent::_cmd_test($cmd);
38+
$stat = strtolower($cmd[1]);
39+
if ($stat == 'will' || $stat == 'willpower') {
40+
$p = &$this->player;
41+
if ($result == false && $p['will'] < 6) {
42+
sendqmsg("*You willpower has failed you...*");
43+
$p['stam'] = 0;
44+
}
45+
$p['will'] = max(0, $p['will']-1);
46+
}
47+
}
48+
49+
50+
}

logic/rulesets/ff_pof.php

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?php
2+
3+
require_once 'ff_magic.php';
4+
5+
class book_ff_pof extends book_ff_magic {
6+
protected function getStats() {
7+
$stats = parent::getStats();
8+
$stats['magic']['friendly'] = 'Power';
9+
$stats['magic']['alias'] = ['power', 'pow'];
10+
return $stats;
11+
}
12+
13+
14+
protected function rollCharacter($name = '?', $gender = '?', $emoji = '?', $race = '?', $adjective = '?') {
15+
// Set race to elf unless otherwise specified
16+
if (!$race || $race == '?') {
17+
$race = 'Elf';
18+
}
19+
$p = parent::rollCharacter($name, $gender, $emoji, $race, $adjective);
20+
// Random Potion
21+
// The book rules actually give you a choice, but this is a bit more fun
22+
$d = dice();
23+
$p['creationdice'] .= ' '.diceemoji($d);
24+
switch ($d) {
25+
case 1: case 2:
26+
$p['stuff'][] = 'Potion of Skill [skill full]';
27+
break;
28+
case 3: case 4:
29+
$p['stuff'][] = 'Potion of Strength [stam full]';
30+
break;
31+
case 5: case 6:
32+
$p['stuff'][] = 'Potion of Luck [luck full]';
33+
// If the potion of luck is chosen, the player get 1 bonus luck
34+
$p['luck']++;
35+
$p['max']['luck']++;
36+
break;
37+
}
38+
return $p;
39+
}
40+
41+
42+
protected function getCharcterSheetAttachments() {
43+
$attachments = parent::getCharcterSheetAttachments();
44+
$attachments[0]['fields'][3]['title'] = 'Power';
45+
return $attachments;
46+
}
47+
48+
49+
protected function getSpells() {
50+
$spells[] = array(
51+
'name' => 'Protect',
52+
'cost' => 1,
53+
'type' => 'elf',
54+
'target' => false,
55+
'desc' => "Casts a pall of invisibility over the area surrounding you.",
56+
'reply' => 'You cast the protect spell...'
57+
);
58+
59+
$spells[] = array(
60+
'name' => 'Illusion',
61+
'cost' => 1,
62+
'type' => 'elf',
63+
'target' => false,
64+
'desc' => "Allows you to make anything, yourself included, appear to be anything else, within reason.",
65+
'reply' => 'You cast the illusion spell...'
66+
);
67+
68+
$spells[] = array(
69+
'name' => 'Weaken',
70+
'cost' => 1,
71+
'type' => 'elf',
72+
'target' => false,
73+
'desc' => "Reduces an opponent's stamina by 4 points.",
74+
'reply' => "You cast the weaken spell... (Reduce your opponent's stamina by 4 points.)"
75+
);
76+
77+
$spells[] = array(
78+
'name' => 'Levitation',
79+
'cost' => 1,
80+
'type' => 'elf',
81+
'target' => false,
82+
'desc' => "Allows you to float freely up to a ceiling of about 4 meters. Since you also float gently to the ground, it can also be used for descending falls.",
83+
'reply' => "You cast the levitation spell..."
84+
);
85+
86+
$spells[] = array(
87+
'name' => 'Finding',
88+
'cost' => 1,
89+
'type' => 'elf',
90+
'target' => false,
91+
'desc' => "Allows you to detect the presence of something - it may be treasure, a secret passage, or even a lurking enemy.",
92+
'reply' => "You cast the finding spell..."
93+
);
94+
95+
$spells[] = array(
96+
'name' => 'Fire',
97+
'cost' => 1,
98+
'type' => 'elf',
99+
'target' => false,
100+
'desc' => "Allows you to produce flames from your fingertips.",
101+
'reply' => "You cast the fire spell..."
102+
);
103+
104+
return $spells;
105+
}
106+
107+
108+
}

logic/rulesets/ff_sots.php

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
require_once 'ff_basic.php';
4+
5+
class book_ff_sots extends book_ff_basic {
6+
protected function getStats() {
7+
$stats = parent::getStats();
8+
$stats['honor'] = [
9+
'friendly' => 'Honor',
10+
'alias' => ['honour'],
11+
'roll' => 3,
12+
'display' => 'current_and_max'
13+
];
14+
$stats['prov']['roll'] = 10;
15+
return $stats;
16+
}
17+
18+
19+
protected function rollCharacter($name = '?', $gender = '?', $emoji = '?', $race = '?', $adjective = '?') {
20+
$p = parent::rollHumanCharacter($name, $gender, $emoji, $race, $adjective);
21+
// Random Skill
22+
switch (rand(0, 3)) {
23+
case 0:
24+
$p['sskill'] = 'Kyujutsu (Archery)';
25+
$p['stuff'] = ['Willow-leaf Arrow (2 dmg)', 'Willow-leaf Arrow (2 dmg)', 'Willow-leaf Arrow (2 dmg)',
26+
'Bowel-Raker Arrow (3 dmg)', 'Bowel-Raker Arrow (3 dmg)', 'Bowel-Raker Arrow (3 dmg)',
27+
'Armour-piercing Arrow (2 dmg)', 'Armour-piercing Arrow (2 dmg)', 'Armour-piercing Arrow (2 dmg)',
28+
'Humming-bulb Arrow (1 dmg)', 'Humming-bulb Arrow (1 dmg)', 'Humming-bulb Arrow (1 dmg)'];
29+
break;
30+
case 1:
31+
$p['sskill'] = 'Iaijutsu (Fast draw)';
32+
break;
33+
case 2:
34+
$p['sskill'] = 'Karumijutsu (Heroic leaping)';
35+
break;
36+
case 3:
37+
$p['sskill'] = 'Ni-to-Kenjutsu (Dual-wielding)';
38+
break;
39+
}
40+
return $p;
41+
}
42+
43+
44+
protected function getCharcterSheetAttachments() {
45+
$player = &$this->player;
46+
$attachments = parent::getCharcterSheetAttachments();
47+
$attachments[0]['fields'][] = [
48+
'title' => 'Honor',
49+
'value' => $player['honor'],
50+
'short' => true
51+
];
52+
$attachments[0]['fields'][] = [
53+
'title' => 'Special Skill',
54+
'value' => $player['sskill'],
55+
'short' => true
56+
];
57+
return $attachments;
58+
}
59+
60+
61+
protected function _cmd_stat_adjust($cmd) {
62+
parent::_cmd_stat_adjust($cmd);
63+
$stat = strtolower($cmd[0]);
64+
if ($stat == 'honor' || $stat == 'honour') {
65+
if ($this->player['honor'] < 1) {
66+
$this->addCommand('dead');
67+
$this->addCommand('page 99');
68+
}
69+
}
70+
}
71+
72+
73+
}

0 commit comments

Comments
 (0)