From a66fa490a70bb562b1efc29ed31e140d64dcbe51 Mon Sep 17 00:00:00 2001 From: Alex Kerr Date: Mon, 26 Jan 2015 19:45:09 +0000 Subject: [PATCH] Unfinished, but laptop is dying --- lib/OSRIC/Races.pm | 52 +++++++++++++++++++++++++++++++++++ lib/OSRIC/Races/Dwarf.pm | 53 +++++++++++++++++++++++++++++++++++ lib/OSRIC/Races/Elf.pm | 55 +++++++++++++++++++++++++++++++++++++ lib/OSRIC/Races/Gnome.pm | 55 +++++++++++++++++++++++++++++++++++++ lib/OSRIC/Races/HalfElf.pm | 55 +++++++++++++++++++++++++++++++++++++ lib/OSRIC/Races/HalfOrc.pm | 5 ++++ lib/OSRIC/Races/Halfling.pm | 5 ++++ lib/OSRIC/Races/Human.pm | 5 ++++ 8 files changed, 285 insertions(+) create mode 100644 lib/OSRIC/Races.pm create mode 100644 lib/OSRIC/Races/Dwarf.pm create mode 100644 lib/OSRIC/Races/Elf.pm create mode 100644 lib/OSRIC/Races/Gnome.pm create mode 100644 lib/OSRIC/Races/HalfElf.pm create mode 100644 lib/OSRIC/Races/HalfOrc.pm create mode 100644 lib/OSRIC/Races/Halfling.pm create mode 100644 lib/OSRIC/Races/Human.pm diff --git a/lib/OSRIC/Races.pm b/lib/OSRIC/Races.pm new file mode 100644 index 0000000..2638b45 --- /dev/null +++ b/lib/OSRIC/Races.pm @@ -0,0 +1,52 @@ +package OSRIC::Races; + +# The stat buffs/nerfs a race gives: +sub stats_boosts +{ + { + str => 0, + dex => 0, + con => 0, + int => 0, + wis => 0, + cha => 0, + } +} + +# The permitted classes: +sub permitted_classes +{ + [ "Assassin", "Cleric", "Druid", "Fighter", "Illusionist", "MagicUser", + "Paladin", "Ranger", "Thief" ] +} + +# A hash of subs to generate the starting age based on class: +sub ages +{ + { + assassin => sub { }, + cleric => sub { }, + druid => sub { }, + fighter => sub { }, + illusionist => sub { }, + magicuser => sub { }, + paladin => sub { }, + ranger => sub { }, + theif => sub { }, + } +} + +# The racial limitations: +sub racial_limitations +{ + { + str => { min => 0, max => 0 }, + dex => { min => 0, max => 0 }, + con => { min => 0, max => 0 }, + int => { min => 0, max => 0 }, + wis => { min => 0, max => 0 }, + cha => { min => 0, max => 0 }, + } +} + +1; diff --git a/lib/OSRIC/Races/Dwarf.pm b/lib/OSRIC/Races/Dwarf.pm new file mode 100644 index 0000000..e9bcccb --- /dev/null +++ b/lib/OSRIC/Races/Dwarf.pm @@ -0,0 +1,53 @@ +package OSRIC::Races::Dwarf +use parent qw(OSRIC::Races); +use OSRIC::Util qw/d/; + +# The stat buffs/nerfs a race gives: +sub stats_boosts +{ + { + str => 0, + dex => 0, + con => 1, + int => 0, + wis => 0, + cha => -1, + } +} + +# The permitted classes: +sub permitted_classes +{ + [ "Assassin", "Cleric", "Fighter", "Thief", [ "Fighter", "Thief" ] ] +} + +# A hash of subs to generate the starting age based on class: +sub ages +{ + { + assassin => sub { (75 + (d(6) + d(6) + d(6))) }, + cleric => sub { (250 + (d(20) + d(20))) }, + druid => sub { 0 }, + fighter => sub { (40 + (d(4) + d(4) + d(4) + d(4) + d(4))) }, + illusionist => sub { 0 }, + magicuser => sub { 0 }, + paladin => sub { 0 }, + ranger => sub { 0 }, + theif => sub { (75 + (d(6) + d(6) + d(6))) }, + } +} + +# The racial limitations: +sub racial_limitations +{ + { + str => { min => 8, max => 18 }, + dex => { min => 3, max => 17 }, + con => { min => 12, max => 19 }, + int => { min => 3, max => 18 }, + wis => { min => 3, max => 18 }, + cha => { min => 3, max => 16 }, + } +} + +1; diff --git a/lib/OSRIC/Races/Elf.pm b/lib/OSRIC/Races/Elf.pm new file mode 100644 index 0000000..2b82f54 --- /dev/null +++ b/lib/OSRIC/Races/Elf.pm @@ -0,0 +1,55 @@ +package OSRIC::Races::Elf; +use parent qw(OSRIC::Races); +use OSRIC::Util qw/d/; + +# The stat buffs/nerfs a race gives: +sub stats_boosts +{ + { + str => 0, + dex => 1, + con => -1, + int => 0, + wis => 0, + cha => 0, + } +} + +# The permitted classes: +sub permitted_classes +{ + [ "Assassin", "Cleric", "Fighter", "MagicUser", "Thief", + [ "Fighter", "MagicUser" ], [ "Fighter", "Thief" ], + [ "MagicUser", "Thief" ], [ "Fighter", "MagicUser", "Thief" ] ] +} + +# A hash of subs to generate the starting age based on class: +sub ages +{ + { + assassin => sub { 0 }, + cleric => sub { my $i = 0; $i += d(10) for(1..10); $i += 500; }, + druid => sub { 0 }, + fighter => sub { my $i = 0; $i += d(6) for(1..5); $i += 130; }, + illusionist => sub { 0 }, + magicuser => sub { my $i = 0; $i += d(6) for(1..5); $i += 150; }, + paladin => sub { 0 }, + ranger => sub { 0 }, + theif => sub { my $i = 0; $i += d(6) for(1..5); $i += 100; }, + } +} + +# The racial limitations: +sub racial_limitations +{ + { + str => { min => 3, max => 18 }, + dex => { min => 7, max => 19 }, + con => { min => 8, max => 17 }, + int => { min => 8, max => 18 }, + wis => { min => 3, max => 18 }, + cha => { min => 3, max => 18 }, + } +} + +1; diff --git a/lib/OSRIC/Races/Gnome.pm b/lib/OSRIC/Races/Gnome.pm new file mode 100644 index 0000000..56bb843 --- /dev/null +++ b/lib/OSRIC/Races/Gnome.pm @@ -0,0 +1,55 @@ +package OSRIC::Races::Gnome; +use parent qw(OSRIC::Races); +use OSRIC::Util qw/d/; + +# The stat buffs/nerfs a race gives: +sub stats_boosts +{ + { + str => 0, + dex => 0, + con => 0, + int => 0, + wis => 0, + cha => 0, + } +} + +# The permitted classes: +sub permitted_classes +{ + [ "Assassin", "Cleric", "Fighter", "Illusionist", "Thief", + [ "Fighter", "Illusionist" ], [ "Fighter", "Thief" ], + [ "Illusionist", "Thief" ] ] +} + +# A hash of subs to generate the starting age based on class: +sub ages +{ + { + assassin => sub { my $i = 0; $i += d(4) for(1..5); $i += 80; }, + cleric => sub { my $i = 0; $i += d(12) for(1..3); $i += 300; }, + druid => sub { 0 }, + fighter => sub { my $i = 0; $i += d(4) for(1..5); $i += 60; }, + illusionist => sub { my $i = 0; $i += d(12) for(1..2); $i += 100; } + magicuser => sub { 0 }, + paladin => sub { 0 }, + ranger => sub { 0 }, + theif => sub { my $i = 0; $i += d(4) for(1..5); $i += 80; }, + } +} + +# The racial limitations: +sub racial_limitations +{ + { + str => { min => 6, max => 18 }, + dex => { min => 3, max => 19 }, + con => { min => 8, max => 17 }, + int => { min => 7, max => 18 }, + wis => { min => 3, max => 18 }, + cha => { min => 3, max => 18 }, + } +} + +1; diff --git a/lib/OSRIC/Races/HalfElf.pm b/lib/OSRIC/Races/HalfElf.pm new file mode 100644 index 0000000..047f6ab --- /dev/null +++ b/lib/OSRIC/Races/HalfElf.pm @@ -0,0 +1,55 @@ +package OSRIC::Races::HalfElf; +use parent qw(OSRIC::Races); +use OSRIC::Util qw/d/; + +# The stat buffs/nerfs a race gives: +sub stats_boosts +{ + { + str => 0, + dex => 0, + con => 0, + int => 0, + wis => 0, + cha => 0, + } +} + +# The permitted classes: +sub permitted_classes +{ + [ "Assassin", "Cleric", "Fighter", "MagicUser", "Ranger", "Thief", + [ "Cleric", "Fighter" ], [ "Cleric", "Ranger" ], + [ "Illusionist", "Thief" ] ] +} + +# A hash of subs to generate the starting age based on class: +sub ages +{ + { + assassin => sub { my $i = 0; $i += d(4) for(1..5); $i += 80; }, + cleric => sub { my $i = 0; $i += d(12) for(1..3); $i += 300; }, + druid => sub { 0 }, + fighter => sub { my $i = 0; $i += d(4) for(1..5); $i += 60; }, + illusionist => sub { my $i = 0; $i += d(12) for(1..2); $i += 100; } + magicuser => sub { 0 }, + paladin => sub { 0 }, + ranger => sub { 0 }, + theif => sub { my $i = 0; $i += d(4) for(1..5); $i += 80; }, + } +} + +# The racial limitations: +sub racial_limitations +{ + { + str => { min => 6, max => 18 }, + dex => { min => 3, max => 19 }, + con => { min => 8, max => 17 }, + int => { min => 7, max => 18 }, + wis => { min => 3, max => 18 }, + cha => { min => 3, max => 18 }, + } +} + +1; diff --git a/lib/OSRIC/Races/HalfOrc.pm b/lib/OSRIC/Races/HalfOrc.pm new file mode 100644 index 0000000..4c662e6 --- /dev/null +++ b/lib/OSRIC/Races/HalfOrc.pm @@ -0,0 +1,5 @@ +package OSRIC::Races:: +use parent qw(OSRIC::Races); +use OSRIC::Util qw/d/; + +1; diff --git a/lib/OSRIC/Races/Halfling.pm b/lib/OSRIC/Races/Halfling.pm new file mode 100644 index 0000000..4c662e6 --- /dev/null +++ b/lib/OSRIC/Races/Halfling.pm @@ -0,0 +1,5 @@ +package OSRIC::Races:: +use parent qw(OSRIC::Races); +use OSRIC::Util qw/d/; + +1; diff --git a/lib/OSRIC/Races/Human.pm b/lib/OSRIC/Races/Human.pm new file mode 100644 index 0000000..4c662e6 --- /dev/null +++ b/lib/OSRIC/Races/Human.pm @@ -0,0 +1,5 @@ +package OSRIC::Races:: +use parent qw(OSRIC::Races); +use OSRIC::Util qw/d/; + +1;