Category: | Fun Stuff |
Author/Contact Info | void_Anthony() |
Description: | Wizardv1.0 with some minor modifications to the 'shop' sub, a new level, a new enemy, and a little bit of small error catching. -credit for Wizard v1.0 goes to 'legolas' |
$wizard=50; $wizardl=1; $gold=10; $damage=3; print"Welcome to Wizard! Type your wizard's name..."; $name=<STDIN>; chomp ($name); print "Welcome $name to Wizard. You are now in the Merlins + castle. You are surrounded by other mages and disscussion flo +ws back\n"; print "and forth in the room. Suddenly Merlin stands up in front of +all and says, I need a powerful man to go out and slay all the monste +rs that have been plauging my land.\n"; print "Which one of you can raise to the challenge. Slowly all those +in the room rise, including yourself.\n\n"; print "Good, good merlin utters. Then be off.\n\n\n"; print "(note: the higher the number you choose, the more often you wil +l encouter enemies!)\n\n\n"; sub die{ if($wizard==0){ print "Thanks for playing"; die; } sub toad { if($room!=6){ my $toad=int (rand 4)+1; if($toad<=$wizardl){ print "The goblins have been zapped into toads!\n"; $gold=$gold+3; print "good job you got 3 gold!\n"; &freedale }else{ print "your spell has failed! -2 health\n"; $wizard=$wizard-2; &battle; } }else{ my $toad=int (rand 7)+1; if($toad<=$wizardl){ print "The demons have been zapped into toads!\n"; $gold=$gold+6; print "great job you got 6 gold!\n"; &freedale }elsif($toad>$wizardl){ print "your spell has failed! -2 health\n"; $wizard=$wizard-2; &battle2; } } } sub battle { my $goblin=12; print "What do you want to do...press 1 to use spells or 2 for combat +\n"; $choice=<STDIN>; if($choice==1){ &toad; }elsif($choice=="q"){ ¨ }elsif($choice==2){ do{ $goblin=$goblin-$damage; $wizard=$wizard-2; print "wizard health: $wizard\t"; print "goblin health: $goblin\n"; }until($goblin==0 || $wizard==0); if($wizard>0){ print "good job you got 3 gold!\n"; $gold=$gold+3; &freedale; }elsif($wizard<=0){ ¨ } } } sub battle2 { my $demon=18; print "What do you want to do...press 1 to use magic or 2 for comba +t\n"; $choice=<STDIN>; if($choice==1){ &toad; }elsif($choice=="q"){ ¨ }elsif($choice==2){ do{ $demon=$demon-$damage; $wizard=$wizard-2; print "wizard health: $wizard\t"; print "demon health: $demon\n"; }until($demon==0 || $wizard==0); if(wizard>0){ print "good job, you got 6 gold!\n"; $gold=$gold+6; &freedale; }elsif($wizard<=0){ ¨ } } } sub forest { print "The forest is dark and smells of old mold and rotton fish. + The foul waters have turned this once peaceful place in to a\n"; + print "dark evil place.\n"; my $gobbo=int (rand 6)+1; if ($gobbo>=5){ print "goblins attack!\n"; &battle; }elsif($gobbo!=5 || $gobbo!=6){ print "There are no monsters here now.\n"; &freedale } } sub mountain { print "Its pretty cold up here, but from this altitude you can see + the whole town below you.\n"; print "Although it is clear that you are not the first one here!\n +"; my $gobbo=int (rand 6)+1; if ($gobbo>=4){ print "goblins attack\n"; &battle; }elsif($gobbo!=4 || $gobbo!=5 || $gobbo!=6){ print "There are no monsters here now.\n"; &freedale } } sub dungeon { print "There is a heavy feeling in the air, it's very dark and mus +ty down here.\n"; print "You can see clear signs that goblins have been here, and ma +ybe worse things!\n"; my $gobbo=int (rand 6)+1; if ($gobbo>=3){ print "goblins attack\n"; &battle; }elsif($gobbo!=3 || $gobbo!=4 || $gobbo!=5 || $gobbo!=6){ print "There are no monsters here now.\n"; &freedale } } sub splane { print "This is a mysterious place full of horribly powerful monsters. +..\n"; print "You see tracks unlike any other you have encountered before.\n +"; my $gobbo=int (rand 8)+1; if ($gobbo>=2){ print "Demons attack!\n"; &battle2 }elsif($gobbo!=2 || $gobbo!=3 || $gobbo!=4 || $gobbo!=5 || $go +bbo!=6 || $gobbo!=7 || $gobbo!=8){ print "There are no demons here now.\n"; &freedale } } sub shop { print "Hello welcome to freedale market may I help you?\n"; print "type 1 for 30 more health.................................. +....... +.....10 gold\n"; print "type 2 for daggers (increases damage per round by one)..... +.................................... +....15 gold\n"; print "type 3 for magic wands(increases magic level by one)....... +.............................. +30 gold\n"; print "type 4 to leave the shop\n"; $shop=<STDIN>; if($shop==1){ if($gold<10){ print "you don't have enough gold\n"; &freedale; }else{ print "Thank you\n"; $gold=$gold-10; $wizard=$wizard +30; &freedale; } }elsif($shop==2){ if($gold<15){ print "you don't have enough gold\n"; &freedale; }else{ print "thank you\n"; $gold=$gold-15; $damage=$damage + 1; &freedale; } }elsif($shop==3){ if($gold<15){ print "you don't have enough gold\n"; &freedale; }else{ print "thank you\n"; $gold=$gold-30; $wizardl=$wizardl+1; &freedale } }elsif($shop==4){ print "Thank you for coming!\n"; &freedale; }else{ print "Please enter a number between 1 and 4!\n"; &freedale } } sub cheat{ $wizardl = $wizardl + 2; $wizard = 100; $gold = 60; &freedale } sub error{ &freedale } sub stat{ print "health:\t$wizard\n"; print "magic level:\t$wizardl\n"; print "gold:\t$gold\n"; &freedale } sub freedale{ print "you are in freedale\n"; print "where do you want to go\n"; print "type 1 for the forest, 2 for the mountain, or 3 for the dung +eon, 4 for the shop, 5 to view stats, 6 for the Shadow Plane, or q t +o quit.\n "; print "press q at anytime to quit.\n"; $room=<STDIN>; if($room==1){ &forest; }elsif($room==2){ &mountain; }elsif($room==3){ &dungeon; }elsif($room==4){ &shop }elsif($room==5){ &stat }elsif($room==6){ if($wizardl < 3){ print "You're level isn't high enough! You must have a magic lvl o +f 3 to come here.\n"; &freedale }elsif($wizardl => 3){ &splane } }elsif($room==7){ &cheat }elsif($room=="q"){ &die }else{ print "Please enter a number between 1 and 6 or q to quit!\n"; &error } } } &freedale |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Wizard v1.2
by wazoox (Prior) on May 06, 2005 at 11:59 UTC | |
by CountZero (Bishop) on May 06, 2005 at 19:07 UTC | |
by wazoox (Prior) on May 06, 2005 at 21:00 UTC | |
by deibyz (Hermit) on May 10, 2005 at 08:30 UTC | |
by wazoox (Prior) on May 10, 2005 at 15:50 UTC | |
by deibyz (Hermit) on May 10, 2005 at 17:20 UTC | |
by wazoox (Prior) on May 10, 2005 at 20:40 UTC | |
| |
by void_Anthony() (Acolyte) on May 11, 2005 at 12:26 UTC | |
by wazoox (Prior) on May 11, 2005 at 13:12 UTC | |
by Roy Johnson (Monsignor) on May 09, 2005 at 18:08 UTC | |
by wazoox (Prior) on May 09, 2005 at 19:27 UTC | |
by Roy Johnson (Monsignor) on May 09, 2005 at 20:51 UTC | |
by wazoox (Prior) on May 10, 2005 at 07:09 UTC | |
Re: Wizardv1.1
by cbrandtbuffalo (Deacon) on May 06, 2005 at 21:40 UTC | |
by wazoox (Prior) on May 07, 2005 at 09:57 UTC | |
by void_Anthony() (Acolyte) on May 09, 2005 at 17:19 UTC | |
by wazoox (Prior) on May 09, 2005 at 17:49 UTC | |
by void_Anthony() (Acolyte) on May 11, 2005 at 19:14 UTC | |
Re: Wizardv1.1
by void_Anthony() (Acolyte) on May 10, 2005 at 14:53 UTC | |
by eric256 (Parson) on May 10, 2005 at 17:50 UTC | |
Re: Wizardv1.1
by void_Anthony() (Acolyte) on May 12, 2005 at 14:34 UTC | |
by wazoox (Prior) on May 13, 2005 at 11:38 UTC | |
by void_Anthony() (Acolyte) on May 16, 2005 at 14:35 UTC | |
by holli (Abbot) on May 12, 2005 at 14:40 UTC |