-
Notifications
You must be signed in to change notification settings - Fork 0
/
MagicItem.pm
49 lines (38 loc) · 1.61 KB
/
MagicItem.pm
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
package Page::Story::Magic::MagicItem;
use v5.8.8;
use strict;
use warnings;
use Exporter qw(import);
use Lingua::EN::Inflect qw(NO);
use Page::File qw(file_directory file_list);
use Page::HTML qw(list anchor);
use Page::Convert qw(searchify);
our $VERSION = "1.0";
our @EXPORT_OK = qw(magic_item_magic);
sub magic_item_magic {
my $magic;
for my $count (0..9) {
my $charges = ucfirst NO('charge', $count, { words_below => 101 });
$magic->{$charges} = qq(STRONG<$charges:>);
}
$magic->{'XP'} = 'ABBR<XP|title="experience point value">';
$magic->{'GP'} = 'ABBR<GP|title="gold piece value">';
$magic->{'MR'} = 'ABBR<MR|title="magic resistance">';
$magic->{'magic items of the specialist'} = 'A<magic items of the specialist|href="?select=magic+items+of+the+specialist">';
$magic->{'spellbooks'} = sub {
my $spellbook_dir = file_directory('Role_playing/Player_characters/Spellbooks');
my @spellbook_list = file_list($spellbook_dir, { 'sort' => 'name', 'text' => 1 });
my @spellbooks;
for my $spellbook (@spellbook_list) {
my $search = searchify($spellbook);
push @spellbooks, anchor($spellbook, { href => qq(../Player_characters/Spellbooks.pl?spellbook=$search) });
}
list(4, 'u', \@spellbooks, { 'class' => 'three' })
};
return $magic;
}
# Version 1.0
# Depends on Page::Convert, Page::File, Page::HTML, Lingua::EN::Inflect, and Exporter
# This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See https://dev.perl.org/licenses/artistic.html.
# Copyright © 2020, Lady Aleena (aleena@cpan.org). All rights reserved.
1;