#!/usr/bin/perl -w use strict; use warnings; use diagnostics; use CGI; use CGI::Carp qw(fatalsToBrowser); use Games::Dice qw(roll); use HTML::Template; use Lingua::EN::Inflect qw(PL PL_N PL_V PL_ADJ NO NUM PL_eq PL_N_eq PL_V_eq PL_ADJ_eq A AN PART_PRES ORD NUMWORDS inflect classical def_noun def_verb def_adj def_a def_an); use B; =pod =head1 NAME F =head1 AUTHOR Lady_Aleena =head1 ACKNOWLEDGEMENTS Perl Monks: Anno, bradenshep, Corion, ikegami, Limbic~Region, Petruchio, shmem, Sidhekin, wfsp, ysth and the rest of the community that has been so kind to me. =head1 SYNOPSIS This script randomly generates mutations of player characters. =cut print "content-type: text/html \n\n"; my %Data; sub random { my ($name) = @_; my $array = $Data{$name}; my $pick = $array->[rand @$array]; if (ref($pick) eq 'CODE') {return $pick->();} else {return $pick;} } #### #Static# $Data{AbNm} = [qw(strength dexterity constitution intelligence wisdom charisma)]; $Data{Algn} = [qw(lawful chaotic good evil neutral)]; $Data{BdPt} = ['eye','lip','nail','nose','hair','skin','entire body']; $Data{ClSp} = [qw(Air All Animal Astral Chaos Charm Combat Creation Divination Earth Fire Guardian Healing Law Necromatic Numbers Plant Protection Summoning Sun Thought Time Travelers War Wards Water Weather)]; $Data{Clss} = [qw(Warrior Rogue Priest Wizard Psionisist)]; $Data{Dice} = [qw(1d4 1d6 1d8 1d10 1d12 1d20)]; $Data{Divn} = ['Demi-','Lesser ','Intermediate ','Greater ']; $Data{Eff1} = [qw(Acid Cold Electricity Fire Gas Sonic)]; $Data{Eff2} = ['Acid','Cold','Electricity','Fire','Poison','Energy Drain']; $Data{Eff3} = ['Acid','Cold','Electricity','Fire','Energy Drain','Gas','Poison','Sonic']; $Data{Emtn} = [qw(joy sorrow trust fear love hate indifference)]; $Data{Fail} = ['all crtical misses','failed backstabs','failed saving throws']; $Data{Gaze} = [qw(Paralysis Stone Stun Death)]; $Data{Gems} = [qw(diamond ruby sapphire emerald amethyst garnet spinel zircon crystal quartz)]; $Data{ImDm} = ['immune to','takes ×2 dmg from']; $Data{LNWp} = ['language','non-weapon proficiency','weapon']; $Data{MITp} = ['Magical Liquids','Scrolls','Rings','Rods','Staves','Wands','Books','Gems & Jewelry','Clothing','Boots & Gloves','Girdles & Helms','Bags & Bottles','Dust & Stones','Household Items','Musical Instruments','Weird Stuff','Humorous Items','Armor and Shields','Weapons','Artifacts']; $Data{Mtls} = [qw(platinum gold silver copper nickel bronze tin iron steel lead aluminum)]; $Data{PlMi} = [qw(+ -)]; $Data{Radi} = ["1' or Touch","5'","10'","20'","50'","100'"]; $Data{Siz1} = [qw(taller shorter)]; $Data{Siz2} = [qw(longer shorter)]; $Data{SpFr} = ['common','uncommon','rare','very rare']; $Data{SvTr} = ['Paralyzation','Poison','Death Magic','Rods','Staves','Wands','Petrifaction','Polymorph','Breath Weapon','Spells']; $Data{Thng} = ['animals','plants','constructs','dragons','lycenthropes','undead','inanimate objects']; $Data{Time} = [qw(round turn hour day week month year)]; $Data{Toch} = ['befouls','purifies','nullifies holy water','nullifies unholy water']; $Data{Vocl} = [qw(Deafen Fear Terror Flight)]; $Data{WpMg} = ['non-','']; $Data{WpMt} = [qw(bone metal stone wooden)]; $Data{WpTp} = [qw(bludgeoning piercing slashing missile)]; $Data{WzSc} = [qw(Abjuration Air Alteration Conjuration/Summoning Divination Earth Enchantment/Charm Fire Illusion/Phantasm Invocation/Evocation Necromancy Water)]; #### #Dynamic# sub radius {"in a ".random("Radi")." radius"} sub tdice { my $tdice = roll(random("Dice")); return "$tdice ".PL_N("time",$tdice)." ".A(random("Time")); } $Data{SpellsT} = [ sub {random("WzSc")." school"}, sub {random("ClSp")." sphere"} ]; $Data{Resist} = [ "immune", sub {"is ".roll('1d100')."% magic resistant"}, "has no resistance" ]; $Data{Spells} = [ "all spells", "all Wizard spells", "all Priest spells", sub {"the ".random("WzSc")." school of wizard spells"}, sub {"the ".random("ClSp")." sphere of priest spells"}, sub {random("Eff3")." spells and spell-like effects"} ]; $Data{MIGp} = [ sub {"magic items in the ".random("MITp")." group"}, "all magic items" ]; $Data{MagicItems} = [ "can use all magic items", "can not use any magic items", sub {"can only use magic items in the ".random("MITp")." group"}, sub {"can not use magic items in the ".random("MITp")." group"}, sub {"causes ".random("MIGp")." to dysfunction ".radius}, sub {"causes ".random("MIGp")." to loose their power ".radius}, sub {"attracts ".random("MIGp")." ".radius}, sub {"repels ".random("MIGp")." ".radius}, sub {"destroys ".random("MIGp")." ".radius} ]; $Data{OtherMagic} = [ "magic dead", sub {"a ".random("Radi")." radius Wild Magic zone"}, "a magic attracter", "addicted to magic energies" ]; $Data{Weapon} = [ sub {random("WpTp")}, sub {random("WpMt")}, sub {random("WpMg")."magical"}, "all" ]; $Data{NWPlearn} = [ sub {random("AbNm")." based"}, sub {random("Clss")." specific"} ]; $Data{SATS} = [ sub {"to saving throws vs. ".random("SvTr")}, "Armor Class", "THAC0 modifier", "to Surprise" ]; $Data{Attack} = [ sub {"Breath Weapon - ".random("Eff1")." for ".random("Dice")." damage"}, sub {"Gaze Attack - ".random("Gaze")}, sub {"Touch Attack - ".random("Eff2")." for ".random("Dice")." damage"}, sub {"Vocal Attack - ".random("Vocl")} ]; my %color_info = (red=>'f00',yellow=>'ff0',green=>'0f0',cyan=>'0ff',blue=>'00f',magenta=>'f0f',white=>'fff',black=>'000'); $Data{Color} = [map {"$_"} keys %color_info]; $Data{Aura} = [ sub {"visible ".random("Color")}, sub {random("Emtn")}, sub {random("Algn")} ]; #### my %mammal_info = (bovine=>'cattle', canine =>'dog', caprine =>'goat', equine=>'horse', feline =>'cat', leporine=>'rabbit', lupine=>'wolf', ovine =>'sheep', porcine =>'pig', ursine=>'bear', vulpine=>'fox'); $Data{Mammal} = [map {"$_"} keys %mammal_info]; $Data{Animal} = [ "amphibian", "insetoid", sub {random("Mammal")}, "reptilian" ]; $Data{Animal2} = [qw(amphibian insetoid mammallian reptilian)]; $Data{Head} = [ "an enlarged head", "a shrunken head", "horns" ]; $Data{Eyes} = [ "glowing eyes", "the appearance of no eyes", sub {random("Color")." eyes"}, "eyes in an odd position", "only one eye", sub {roll('1d4+2')." eyes"}, "infravision

† ultravision if infravision is already present

", sub {my $clrbld = (roll('1d100')>80?'green':'red'); "$clrbld-weakness color blindness"}, "photo-sensitivity" ]; $Data{Ears} = [ "lobeless ears", "only ear holes", "no ears", "extra-sensitive hearing", sub {roll('1d10*10')."% deafness"}, sub {roll('1d4+2')." ears"} ]; $Data{Nose} = [ "an oversized nose", "only nose holes", "no nose", sub {"a nose with an ".random("Animal")." appearance"}, "an extra-sensitive nose", "no sense of smell" ]; $Data{Mouth} = [ sub {random("Color")." lips"}, "no lips", "an oversized mouth", sub {roll('1d2+1')." mouths"}, ]; $Data{Arms} = [ sub {"arms that are ".roll('1d50')."% ".random("Siz2")." than average"}, "no elbow joint", "no wrist joint", sub {roll('1d4+2')." arms (all arms above triple the normal amount are vestigial)"}, sub {random("Animal")."-like arms"} ]; $Data{Hands} = [ "elongated fingers", "one less finger on each hand", "double jointed fingers", "animal claws", "snake fingers", "webbed fingers" ]; $Data{Legs} = [ sub {"legs that are ".roll('1d50')."% ".random("Siz2")." than average"}, "no knee joint", "no ankle joint", sub {roll('1d4+2')." legs (all legs above double the normal amount are vestigial)"}, sub {random("Animal")." legs"} ]; $Data{Feet} = [ "elongated toes", "one less toe on each foot", "no toes", "animal paws", "claws for toes", "webbed toes" ]; $Data{Skin} = [ "fur covered skin", sub {random("Animal")." skin"}, "fish scales", "feathers", "invisible skin", sub {random("Color")." skin"}, "ultra-sensitive skin" ]; $Data{Bones} = [ "wooden bones", sub {random("Gems")." bones"}, sub {random("Mtls")." bones"}, "fragile bones", "unbreakable bones" ]; $Data{Teeth} = [ "enlarged teeth", "fangs", "fangs with venom", sub {random("Gems")." teeth"}, sub {random("Mtls")." teeth"}, "two sets of teeth" ]; $Data{Hair} = [ sub {random("Color")." hair"}, "odd textured hair", "uncuttable hair", "no hair anywhere", "invisible hair", sub {random("Mtls")." hair"} ]; $Data{Nails} = [ sub {random("Gems")." nails"}, sub {random("Mtls")." nails"}, "no nails", "unbreakable nails" ]; $Data{Blood} = [ "icor for blood", "poisonous blood", sub {random("Color")." blood"} ]; $Data{Body} = [ sub {random("Skin")}, sub {random("Bones")}, sub {random("Blood")}, sub {random("Head")}, sub {random("Hair")}, sub {random("Eyes")}, sub {random("Ears")}, sub {random("Nose")}, sub {random("Mouth")}, sub {random("Teeth")}, sub {random("Arms")}, sub {random("Hands")}, sub {random("Legs")}, sub {random("Feet")}, sub {random("Nails")}, sub {random("Animal2")." wings"}, sub {random("Animal")." tail"}, "gills" ]; ##
## $Data{Sleep} = [ 'hardly ever wakes up', 'needs twice as much sleep', 'needs half as much sleep', 'does not need sleep', 'is an insomniac', 'is a narcoleptic', 'is unable to remember the past after sleeping' ]; $Data{Eat} = [ 'can not stop eating', 'needs twice as much food', 'needs half as much food', 'does not need to eat', 'is carnivorous', 'is herbivorous', 'is lethargic after eating any amount of food' ]; $Data{Drink} = [ 'can not stop drinking', 'needs twice as much liquid', 'needs half as much liquid', 'does not need liquids', 'is an alcoholic', 'can not get drunk', 'is intoxicated after injesting any liquid' ]; $Data{SED} = [ sub {random("Sleep")}, sub {random("Eat")}, sub {random("Drink")}, sub {random("Sleep")." and ".random("Eat")}, sub {random("Sleep")." and ".random("Drink")}, sub {random("Eat")." and ".random("Drink")}, sub {random("Sleep").", ".random("Eat").", and ".random("Drink")} ]; #### $Data{Mutation} = [ "no unusual effect", "General ability", #See note 1 "Sub-ability", #See note 2 sub {"casts up to ".random("SpFr")." ".random("SpellsT")." spells as a natural ability ".tdice." (See the spell progession for maximum spell level.)"}, sub {random("Resist")." to ".random("Spells")}, sub {random("MagicItems")}, sub {"is ".random("OtherMagic")}, sub {random("ImDm")." ".random("Weapon")." weapons"}, "takes only magical damage", sub {"knows one ".random("LNWp")." that parent knows"}, sub {"knows all ".PL_N(random("LNWp"))." that parent knows"}, sub {"unable to learn ".PL_N(random("LNWp"))." that parent knows"}, "unable to learn any language other than racial language", sub {random("PlMi").roll('1d4')." on all non-weapon proficiency checks"}, sub {"unable to learn ".random("NWPlearn")." non-weapon proficiencies"}, sub {"unable to learn ".random("WpTp")." weapons"}, sub {"can not use ".random("WpMt")." weapons"}, sub {"born already at ".ORD(roll(random("Dice")))." level"}, sub {"unable to advance past ".ORD(roll('5d6'))." level"}, sub {random("PlMi").roll('1d10')." ".random("SATS")}, sub {"a Wild Magic Surge accompanies ".random("Fail")}, "attacks as a warrior of the same level. If already a warrior, attacks at 1 level higher.", "can not make a Critical Hit", "attracts these followers: ", # See note 5 sub {"repels all animals ".radius}, "backstabs as a thief of the same level. If already a thief, backstabs at 1 level higher.", "turns undead as a priest of the same level. If already a priest, turns at 1 level higher.", "Wild Psionic Talent: (Psionics.pl)", ## See note 5 "unable to use Psionics", sub {"Special Attack: ".random("Attack")." ".tdice}, sub {"is ".roll('1d50')."% ".random("Siz1")." than average"}, sub {"has ".random("Body")}, sub {"can change ".random("BdPt")." color at will to ".random("Color")}, sub {$Data{BdPt}[roll('1d3-1')]."s turn ".random("Color")." when magic is used ".radius}, sub {$Data{BdPt}[roll('3d2+1')]." turns ".random("Color")." when magic is used ".radius}, sub {"has ".A(random("Aura"))." aura"}, sub {"communicates with ".random("Thng")." ".radius}, sub {"knows history of ".random("Thng")." ".radius}, "is blessed", "is cursed", sub {"touch ".random("Toch")}, sub {random("SED")}, sub {do 'rg_ins.pl'}, ####****This is where rg_ins.pl goes.****#### "has characteristics of (AAn-AllMonsters.pl)", # See note 5 "has lycanthropy as a (Lycanthrope.pl)", #See note 5 sub {random("SED")." after seeing (AAn-AllMonsters.pl) for a ".$Data{Time}[roll('1d4+2')]}, # See note 5 sub {"is ".random("Divn")."power - character should be retired"} ]; #### print ''; print 'Character Mutations

Character Mutations Generator

All effects are cumulative, and one can be cancelled out by another.

    '; for(1..roll(random("Dice"))){print "
  1. ".random("Mutation")."
  2. \n"}; print "
"; ##
## #!/usr/bin/perl -w use strict; use warnings; use diagnostics; use CGI; use CGI::Carp qw(fatalsToBrowser); use HTML::Template; sub Disorder { my @Disorder = ('amnesia','catatonia','dementia','hallucinatory insanity','manic despression','paranoia','schizophrenia'); return $Disorder[rand @Disorder] } my %InsDesc = ( abluto=>'washing or bathing', acaro=>'ticks and mites, and the diseases they transmit', aero=>'air, atmosphere, weather, or gas', agro=>'agricultural soils, or open spaces', ailuro=>'cats', xeno=>'foreigners, strangers, foreign things, or outside causes', xero=>'dry conditions or dryness', xylo=>'wood, wooden objects, or forests', zoo=>'animals', zym=>'fermentation' ); sub Ins { my @InsKeys = keys %InsDesc; my $InsRand = $InsKeys[rand @InsKeys]; my @InsType = ( $InsRand."phobia (fear of ".$InsDesc{$InsRand}.")", $InsRand."mania (obsession of or with ".$InsDesc{$InsRand}.")", $InsRand."philia (insatiable desire for ".$InsDesc{$InsRand}.")" ); } sub Insanity { my @InsGen = (Disorder,Ins); return $InsGen[rand @InsGen]; } print Insanity; if (!caller) { print "This will only show up when run directly" };