# Errors include skipping of first battle, magic system # and possibly difficulty #!/usr/bin/perl # Coding began Monday January 26th, 2004 # Last updated 26/01/04 # Monster combat routine # This is a test to see if the "monster" routine from Syrosian Legacy # will actually work. $str = 5; $dex = 5; $con = 2; $mag = 1; # User stats # Configuration of user stats into health/mana points $vit = $con * 5; $vitstat = $con *5; $mana = $mag * 5; # Configuration of monster stats into health/mana points $vitality = $constitution * 5; $vitalitystat = 5 *2; $manapoints = $magic * 5; print "Welcome to Syrosian Legacy Arena Mode!\n"; print "\n"; print "Here is a basic run-down of how this works..\n"; print "You and your opponent fight one another obviously\n"; print "You both check for dex, which is a random number. Whoever is higher gets to attack first. Nifty Eh?\n"; print "The main attacker has a strength count. Two random numbers are rolled and added together. This equals your attack damage.\n"; print "This continues till one of you is K.O. \n"; print "Fortunately, I have decided to update! So choose your difficulty....\n"; print "a)easy b)medium c)hard (a,b,c)\n"; $diff = ; chomp ($diff); if ($diff eq "a") { $str = 10; $dex = 10; $con = 5; $mag = 4; $fire = 5; $ice = 6; $bolt = 7; $dstrike = 4; $sdagger = 2; }elsif ($diff eq "b") { $str = 8; $dex = 8; $con = 3; $mag = 2; $fire = 5; $ice = 0; $bolt = 0; $dstrike = 4; $sdagger = 2; }else { $str = 5; $dex = 5; $con = 2; $mag = 1; $fire = 0; $ice = 0; $bolt = 0; $dstrike = 4; $sdagger = 2; } print "\n"; print "Stats have now been set based on your difficulty...\n"; print "Plus a few MAGICAL surprises..\n"; print "\n"; print "When you are ready for your first battle, hit enter to continue\n"; $ready = ; chomp ($ready); print "Alright, your first fight will be one-on-one versus a weak opponent\n"; print "Ready.....FIGHT !\n"; $victory = 0; if ($victory = 0) { #opponent stats $strength = 5; $dexterity = 5; $constitution = 2; $magic = 0; #conversion into vitality & magic $vitality = $constitution * 5; $vitalitystat = $constitution * 5; while (($vit > 0) && ($vitality > 0)){ srand; $dex1=rand($dex); $dex2=rand($dexterity); if ($dex1 > $dex2) { print "You gain an advantage!\n"; print "Shall you...\n"; print "Attack? (attack)\n"; print "Use Magic? (magic)\n"; $choice = ; chomp ($choice); if ($choice eq "attack") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $streng; $vitality -= $streng; print "You hit your opponent for "; printf ("%.1f", $streng); print " damage.\n"; print "Your opponent has "; printf ("%.1f", $vitality); print " out of $vitalitystat health\n"; }elsif ($choice eq "magic") { print "Which magical attack shall you use?\n"; print "Fire? (fire)\n"; print "Ice? (ice)\n"; print "Bolt? (bolt)\n"; print "Dark Strike? (dstrike)\n"; print "Shadow Dagger? (sdagger)\n"; $magicattack = ; chomp ($magicattack); if ($magicattack eq "fire") { srand; $magdamage =rand($fire); $vitality -= $magdamage; print "You BURN you opponent for "; printf ("%.1f", $magdamage); print " damage.\n"; print "Your opponent has "; printf ("%.1f", $vitality); print " out of $vitalitystat health\n"; }elsif ($magicattack eq "ice") { srand; $magdamage =rand($ice); $vitality -= $magdamage; print "You FREEZE you opponent for "; printf ("%.1f", $magdamage); print " damage.\n"; print "Your opponent has "; printf ("%.1f", $vitality); print " out of $vitalitystat health\n"; }elsif ($magicattack eq "bolt") { srand; $magdamage =rand($bolt); $vitality -= $magdamage; print "You ZAP you opponent for "; printf ("%.1f", $magdamage); print " damage.\n"; print "Your opponent has "; printf ("%.1f", $vitality); print " out of $vitalitystat health\n"; }elsif ($magicattack eq "dstrike") { srand; $magdamage =rand($fire); $vitality -= $magdamage; print "You PIERCE you opponent for "; printf ("%.1f", $magdamage); print " damage.\n"; print "Your opponent has "; printf ("%.1f", $vitality); print " out of $vitalitystat health\n"; }elsif ($magicattack eq "sdagger") { srand; $magdamage =rand($fire); $vitality -= $magdamage; print "You STAB you opponent for "; printf ("%.1f", $magdamage); print " damage.\n"; print "Your opponent has "; printf ("%.1f", $vitality); print " out of $vitalitystat health\n"; }else{ print "You attempt to cast the spell, yet it fails you.\n"; } }else{ print "You lose the opportunity to attack.\n"; } }elsif ($dex2 > $dex1) { srand; $stre =rand($strength); $stren =rand($strength); $streng = $stre + $stren; $vit -= $streng; print "You are struck for "; printf ("%.1f", $streng); print " damage.\n"; print "You now have "; printf ("%.1f", $vit); print " out of $vit remaining.\n"; }else{ print "Weapons clash together, then part again as both you and your opponent seek an opening.\n"; } #Death if ($vit < 0) { print "You have been knocked out!\n"; print "Game Over\n"; die; } if ($vitality < 0) { print "You have knocked out your opponent!\n"; print "Your victories increase by 1\n"; $victory += 1; } } }elsif ($victory = 1) { #Battle system for the two guards in the Fishing Town #Guards' Stats $guardonestr = 8; $guardonedex = 5; $guardonecon = 3; $guardtwostr = 7; $guardtwodex = 3; $guardtwocon = 2; #Conversion into vitality $vitalityone = $guardonecon * 5; $vitalityonestat = $guardcon * 5; $vitalitytwo = $guardtwocon * 5; $vitalitytwostat = $guardtwocon * 5; print "Welcome to the second battle! You have done well to defeat your first opponent.\n"; print "Now, as you go through the various levels, the challenge will increase.\n"; print "Seeing as how you successfully completed your last round, the arena gods shall grant you a boon.\n"; print "Con't (hit enter)\n"; $ready = ; chomp ($ready); print "Well then, you have three boons to choose from...choose wisely..\n"; print "a)weapon (Grants you access to a weapons locker)\n"; print "b)magic (Grants you access to new spells)\n"; print "c)speed (Grants you access to an adrenaline supply)\n"; print "Choose carefully, as some may have consequences.\n"; $firstboon = ; chomp ($firstboon); if ($firstboon eq "weapon") { print "\n"; print "Ah, I see you have wished weapons. Your attacks have increased in strength.\n"; $str += 2; }elsif ($firstboon eq "magic") { print "\n"; print "Ah, I see you favour the arcane magics. More spells have been granted to you.\n"; if ($diff eq "a") { $fire = 5; $ice = 6; $bolt = 7; $dstrike = 4; $sdagger = 2; $bio = 10; $earth = 7; }elsif ($diff eq "b") { $fire = 5; $ice = 6; $bolt = 7; $dstrike = 4; $sdagger = 2; $bio = 0; $earth = 0; }else { $fire = 5; $ice = 6; $bolt = 0; $dstrike = 4; $sdagger = 2; $bio = 0; $earth = 0; } }elsif ($firstboon eq "speed") { print "\n"; print "Ah, I see you wish to be swifter. You have been granted access to adrenaline.\n"; $dex += 3; } print "Are you ready for your next instructions?\n"; print "(hit enter)\n"; $ready = ; chomp ($ready); $restore = $vitstat - vit; $vit = $restore; print "Good. Your vitality has been restored, and you are ready for the next round.\n"; print "In the next round you will fight two samurai. These are elite warriors.\n"; print "Each will attack you together as a team, and can easily take you down.\n"; print "Good luck in the next round...the arena gods are watching.\n"; print "\n"; print "Continue to the next round?\n"; print "(hit enter)\n"; $ready = ; chomp ($ready); print "\n"; print "Welcome to the arena! Today we have a spectacular match!\n"; print "Today we have newcomer, $name, fighting against the Shintao samurai. This is sure to be an amazing test of skills.\n"; print "Now, let the fight begin!\n"; } # Barrier ----------------------------------------------------------------------------------------- print "You draw your sword as the two guardsmen do, and prepare for combat.\n"; while (($vit > 0) && ($vitalityone + $vitalitytwo > 0)){ srand; $dex1=rand($dex); $dex2=rand($guardonedex); $dex3=rand($guardtwodex); if ($dex1 > $dex2 && $dex3) { print "Shall you...\n"; print "Attack guard one?(attackone)\n"; print "Attack guard two?(attacktwo)\n"; print "Use Magic on guard one?(magicone)\n"; print "Use Magic on guard two?(magictwo)\n"; $choice = ; chomp ($choice); if ($choice eq "attackone") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalityone -= $streng; print "You hit the first guard with your sword for $streng damage!!\n"; }elsif ($choice eq "attacktwo") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; }elsif ($choice eq "magicone") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicattone = ; chomp ($magicattone); if ($magicattone eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalityone -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the first guard for $magdamage damage.\n"; }elsif ($magicattone eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalityone -= $magdamage; print "You summon a dagger composed of the shadows. You slash the first guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }elsif ($choice eq "magictwo") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicatttwo = ; chomp ($magicatttwo); if ($magicatttwo eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalitytwo -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the second guard for $magdamage damage.\n"; }elsif ($magicatttwo eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalitytwo -= $magdamage; print "You summon a dagger composed of the shadows. You slash the second guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }else{ print "You cannot remember a spell quick enough, you attack instead.\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; } }elsif ($dex2 > $dex1 && $dex3) { #First guard attack srand; $stre=rand($guardonestr); $stren=rand($guardonestr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the first guard's pike for $streng damage!!\n"; }elsif ($dex3 > $dex1 && $dex2){ #Second guard attack srand; $stre=rand($guardtwostr); $stren=rand($guardtwostr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the second guard's knife for $streng damage!!\n"; }else{ print "A clang of metal is heard as your sword strikes against the second guard's dagger, the pike of the first barely misses you.\n"; } if ($vitalityone < 0) { print "The first guard crumples, falling to the ground in a pool of his blood.\n"; while(($vit > 0) && ($vitalitytwo > 0)){ srand; $dex1=rand($dex); $dex3=rand($guardtwodex); if ($dex1 > $dex3) { print "Shall you...\n"; print "Attack guard two?(attacktwo)\n"; print "Use Magic on guard two?(magictwo)\n"; $choice = ; chomp ($choice); if ($choice eq "attacktwo") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; }elsif ($choice eq "magictwo") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicatttwo = ; chomp ($magicatttwo); if ($magicatttwo eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalitytwo -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the second guard for $magdamage damage.\n"; }elsif ($magicatttwo eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalitytwo -= $magdamage; print "You summon a dagger composed of the shadows. You slash the second guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }else{ print "You cannot remember a spell quick enough, you attack instead.\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; } }elsif ($dex3 > $dex1){ srand; $stre=rand($guardtwostr); $stren=rand($guardtwostr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the second guard's knife for $streng damage!!\n"; }else{ print "Both blades strike together for a moment before drawing back once again to attack.\n"; } if ($vit < 0){ print "You have died....\n"; } if ($vitalitytwo < 0){ print "The second guard succumbs to your attacks.\n"; } if ($vitalitytwo < 0) { print "The second guard succumbs to your attacks.\n"; while(($vit > 0) && ($vitvitalityone > 0)){ srand; $dex1=rand($dex); $dex2=rand($guardonedex); if ($dex1 > $dex2) { print "Shall you...\n"; print "Attack guard one?(attackone)\n"; print "Use Magic on guard one?(magicone)\n"; $choice = ; chomp ($choice); if ($choice eq "attackone") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalityone -= $streng; print "You hit the first guard with your sword for $streng damage!!\n"; }elsif ($choice eq "magicone") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicattone = ; chomp ($magicattone); if ($magicattone eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalityone -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the first guard for $magdamage damage.\n"; }elsif ($magicattone eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalityone -= $magdamage; print "You summon a dagger composed of the shadows. You slash the first guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }else{ print "You cannot remember a spell quick enough, you attack instead.\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalityone -= $streng; print "You hit the first guard with your sword for $streng damage!!\n"; } }elsif ($dex2 > $dex1){ srand; $stre=rand($guardonestr); $stren=rand($guardonestr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the first guard's pike for $streng damage!!\n"; }else{ print "Both blades strike together for a moment before drawing back once again to attack.\n"; } if ($vit < 0){ print "You have died....\n"; } if ($vitalitytwo < 0){ print "The second guard succumbs to your attacks.\n"; } } } } } } #### #!usr/bin/perl -w #Coded by Shinwa Okami #Coded during 2003...began December print "\n"; print "\n"; print "----___- Welcome To Shinny RPG! -___----\n"; print "Please enter a name: \n"; $name = ; chomp ($name); print "Please select a class..(war,thf,wiz)\n"; $class = ; chomp ($class); if ($class eq "war") { $str = 8; # Used to calculate Damage $dex = 4; # Used to calculate hit Ratio $con = 7; # Used to calculate Health $mag = 2; # Used to calculate magicalness...ness... print "\n"; print "Excellent choice warrior!\n"; }elsif ($class eq "thf") { $str = 6; # Used to calculate Damage $dex = 7; # Used to calculate hit Ratio $con = 5; # Used to calculate Health $mag = 4; # Used to calculate magicalness...ness... print "\n"; print "Excellent choice thief!\n"; }elsif ($class eq "wiz") { $str = 4; # Used to calculate Damage $dex = 5; # Used to calculate hit Ratio $con = 4; # Used to calculate Health $mag = 7; # Used to calculate magicalness...ness... print "\n"; print "Excellent choice sorcerer!\n"; }elsif ($class eq "penguin") { $str = 20; # Used to calculate Damage score $dex = 20; # Used to calculate Hit Ratio $con = 20; # Used to calculate Health $mag = 20; # Used to calculate magicalness...ness... print "\n"; print "You are one with the Penguin...\n"; }else{ print "Please select one of the classes next time...\n"; die; } $mana = $mag * 5; # Mana/Magic points $vit = $con * 10; # Actual health score #Magical Database... $dstrike = 2; $sdagger = 4; print"\n"; print "So young adventurer, welcome to the lands of Syrosia!\n"; print "Your day begins outside of your home in Thet forest, to your left you see your grandfather and teacher. The right contains a pathway. Where shall you journey first?(left/right) \n"; $begin = ; chomp ($begin); if ($begin eq "left") { print "You walk over to your grandfather to begin your daily training.\n"; }elsif ($begin eq "right") { print "You gaze down the path but find nothing of interest. Instead you go over to your grandfather to begin training.\n"; }else{ print "This is not a choice! I cause death to program!\n"; die; } print "\n"; print "Grandfather: You have many lessons to learn yet young $name. The time will come when you will have to use all that I have taught you to face your destiny.\n"; print"\n"; print "Grandfather: Now, what area of training shall we focus upon today? (str/dex/con/mag) \n"; $train = ; chomp ($train); if ($train eq "str") { print " "; print "Grandfather: Strength is a key component in wounding your opponent. You may be quicker in battle, but if you cannot break past an enemy's armour, you are as good as dead. \n"; print "Grandfather: Go behind the house, and carry many stones to build your strength. \n"; print "\n"; print "For the next few hours you train...your strength increases by 1! \n"; $str += 1; }elsif ($train eq "dex") { print "\n"; print "Grandfather: Dexterity is key to hitting your opponent and dodging his attacks. Even the strongest fall to the blades of those that are swifter than themselves. \n"; print "Grandfather: Go behind the house, and practice your stretching and dodging techniques. \n"; print "\n"; print "For the next few hours you train...your dexterity increases by 1! \n"; $dex += 1; }elsif ($train eq "con") { print "\n"; print "Grandfather: Being physically healthy is the best way to stay alive. Being able to take an attack and survive will give you an edge in battle, as well as give you time to attack your opponent once more. \n"; print "Grandfather: Go behind the house, there you will find Barak plants. Eat the roots, after all, what doesn't kill you makes you stronger. \n"; print "\n"; print "For the next few hours you train...your consitution increases by 1! \n"; $con += 1; $vit -= 3; }elsif ($train eq "mag") { print "\n"; print "Grandfather: So you wish to learn of the magics of the Syrosian people yes? Well every furre of Syros is born with Shadow magic...\n"; print "Grandfather: Go behind the house, there you will find books. Read and learn. \n"; print "\n"; print "For the next few hours you train...your magicalness increases by 1! \n"; $mag += 1; } else { print "This is not a choice ! I cause death to program !"; die; } print "\n"; print "Grandfather: You have trained for many years $name. From a child I have teached you everything that I know in hopes of preparing you for the future.\n"; print "\n"; print "Your Grandfather presents you with a sword made of Syrosian steel..\n"; print "\n"; print "Grandfather: You have learned well the lessons and skills your parents were gifted with. As you know, your parents were the greatest assassins of Syros. This sword is made from the blood metals mined by the Ku'tari. Through time it will grow stronger as it tastes the blood of your opponents. I hope one day you will be strong enough to...\n"; print "\n"; print "Cont..\n"; $cont = ; chomp ($cont); print "A rustling nearby grabs your Grandfather's attention...\n"; print "\n"; print "Grandfather: $name be still, there are others nearby..\n"; print "\n"; print "Both you and your Grandfather listen, crouching perfectly still outside your home. Voices can be heard nearby, and are slowly getting closer.\n"; print "\n"; print "Voice1: There! In the clearing! Grab them quickly!\n"; print "\n"; print "Grandfather: $name take this with you and run! It is soldiers from the army of Kuragari. I will hold them off as long as I can for you to escape!\n"; print "\n"; print "You have received Pendent of Wishing!\n"; print "\n"; print "What shall you do? (stay/run)\n"; $choice = ; chomp ($choice); if ($choice eq "stay") { print "$name: Grandfather let me stay with you ! I know we can both defeat them..I know we can do it !n"; print " }elsif ($choice eq "run") { print "You nod to your grandfather, and run off into the woods as he commanded.\n"; }else{ print "This is not a choice! I cause death to program!\n"; die; } print "\n"; print "You take off into the woods. Sounds of battle fade behind you, yet you can hear the sounds of pursuit closely behind. Using your training you manage to evade, hide, and even fell one of your pursuers.\n"; print "\n"; print "After two long days you manage to lose your pursuers. Remaining cautious, you venture to a nearby fishing village. You spend time looking around, and generally keeping to yourself. Your path leads you to the docks.\n"; print "\n"; print "Where shall you go?\n"; print "a) Shipping desk(desk)\n"; print "b) Local Guard Station(guard)\n"; print "c) Observe your surroundings(observe)\n"; $docks = ; chomp ($docks); if ($docks eq "desk") { print "\n"; print "You walk over to the Shipping Desk. Behind the desk is an old man in a worn down sailor outfit. He seems to hardly be able to stand, yet his voice remains crisp and loud over the noise of the docks.\n"; }elsif ($docks eq "guard") { print "\n"; print "You walk over to the Local Guard Station. Standing next to it are two guards similar to the ones who attacked you and your Grandfather. They don't seem to recongnize you for the moment.\n"; print "What shall you do?\n"; print "Check out the Shipping Desk(desk)\n"; print "State your name and challenge them to a duel(duel)\n"; $guardchoice = ; chomp ($guardchoice); if ($guardchoice eq "desk") { print "\n"; print "You walk over to the Shipping Desk. Behind the desk is an old man in a worn down sailor outfit. He seems to hardly be able to stand, yet his voice remains crisp and loud over the noise of the docks.\n"; }elsif ($guardchoice eq "duel") { print "You step before the two guards.\n"; print "\n"; print "Guard One: What do you want kit?\n"; print "$name: I am $name and I challenge you both to a duel!\n"; #Battle system for the two guards in the Fishing Town #Guards' Stats $guardonestr = 8; $guardonedex = 5; $guardonecon = 3; $guardtwostr = 7; $guardtwodex = 3; $guardtwocon = 2; #Conversion into vitality $vitalityone = $guardonecon * 5; $vitalitytwo = $guardtwocon * 5; print "You draw your sword as the two guardsmen do, and prepare for combat.\n"; while (($vit > 0) && ($vitalityone + $vitalitytwo > 0)){ srand; $dex1=rand($dex); $dex2=rand($guardonedex); $dex3=rand($guardtwodex); if ($dex1 > $dex2 && $dex3) { print "Shall you...\n"; print "Attack guard one?(attackone)\n"; print "Attack guard two?(attacktwo)\n"; print "Use Magic on guard one?(magicone)\n"; print "Use Magic on guard two?(magictwo)\n"; $choice = ; chomp ($choice); if ($choice eq "attackone") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalityone -= $streng; print "You hit the first guard with your sword for $streng damage!!\n"; }elsif ($choice eq "attacktwo") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; }elsif ($choice eq "magicone") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicattone = ; chomp ($magicattone); if ($magicattone eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalityone -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the first guard for $magdamage damage.\n"; }elsif ($magicattone eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalityone -= $magdamage; print "You summon a dagger composed of the shadows. You slash the first guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }elsif ($choice eq "magictwo") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicatttwo = ; chomp ($magicatttwo); if ($magicatttwo eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalitytwo -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the second guard for $magdamage damage.\n"; }elsif ($magicatttwo eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalitytwo -= $magdamage; print "You summon a dagger composed of the shadows. You slash the second guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }else{ print "You cannot remember a spell quick enough, you attack instead.\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; } }elsif ($dex2 > $dex1 && $dex3) { #First guard attack srand; $stre=rand($guardonestr); $stren=rand($guardonestr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the first guard's pike for $streng damage!!\n"; }elsif ($dex3 > $dex1 && $dex2){ #Second guard attack srand; $stre=rand($guardtwostr); $stren=rand($guardtwostr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the second guard's knife for $streng damage!!\n"; }else{ print "A clang of metal is heard as your sword strikes against the second guard's dagger, the pike of the first barely misses you.\n"; } if ($vitalityone < 0) { print "The first guard crumples, falling to the ground in a pool of his blood.\n"; while(($vit > 0) && ($vitalitytwo > 0)){ srand; $dex1=rand($dex); $dex3=rand($guardtwodex); if ($dex1 > $dex3) { print "Shall you...\n"; print "Attack guard two?(attacktwo)\n"; print "Use Magic on guard two?(magictwo)\n"; $choice = ; chomp ($choice); if ($choice eq "attacktwo") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; }elsif ($choice eq "magictwo") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicatttwo = ; chomp ($magicatttwo); if ($magicatttwo eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalitytwo -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the second guard for $magdamage damage.\n"; }elsif ($magicatttwo eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalitytwo -= $magdamage; print "You summon a dagger composed of the shadows. You slash the second guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }else{ print "You cannot remember a spell quick enough, you attack instead.\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; } }elsif ($dex3 > $dex1){ srand; $stre=rand($guardtwostr); $stren=rand($guardtwostr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the second guard's knife for $streng damage!!\n"; }else{ print "Both blades strike together for a moment before drawing back once again to attack.\n"; } if ($vit < 0){ print "You have died....\n"; } if ($vitalitytwo < 0){ print "The second guard succumbs to your attacks.\n"; } if ($vitalitytwo < 0) { print "The second guard succumbs to your attacks.\n"; while(($vit > 0) && ($vitvitalityone > 0)){ srand; $dex1=rand($dex); $dex2=rand($guardonedex); if ($dex1 > $dex2) { print "Shall you...\n"; print "Attack guard one?(attackone)\n"; print "Use Magic on guard one?(magicone)\n"; $choice = ; chomp ($choice); if ($choice eq "attackone") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalityone -= $streng; print "You hit the first guard with your sword for $streng damage!!\n"; }elsif ($choice eq "magicone") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicattone = ; chomp ($magicattone); if ($magicattone eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalityone -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the first guard for $magdamage damage.\n"; }elsif ($magicattone eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalityone -= $magdamage; print "You summon a dagger composed of the shadows. You slash the first guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }else{ print "You cannot remember a spell quick enough, you attack instead.\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalityone -= $streng; print "You hit the first guard with your sword for $streng damage!!\n"; } }elsif ($dex2 > $dex1){ srand; $stre=rand($guardonestr); $stren=rand($guardonestr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the first guard's pike for $streng damage!!\n"; }else{ print "Both blades strike together for a moment before drawing back once again to attack.\n"; } if ($vit < 0){ print "You have died....\n"; } if ($vitalitytwo < 0){ print "The second guard succumbs to your attacks.\n"; } } } print "Both guards lay at your feet, slain by your sword. You feel no shame in taking the lives of these two. They hurt you, took your Grandfather away, and for that you killed.\n"; print "\n"; print "The town is on alert now. Guards can be seen coming in the distance towards you. Quickly you shealth your blade, and take off at a run for the nearby docks.\n"; print "Upon your arrival you see a ship, the Crimson Jewel, departing from port. Running still, you unshealth your sword, and leap towards the hull.\n"; }else{ print "This is not a choice!\n"; die; } }elsif ($docks eq "observe") { print "\n"; print "You take a closer look at your surroundings. You can see that this is a poor town under the rule of Kuragari Tenshii, the one who killed your family. Guards populate the town mainly, as well as a few fishermen and their families.\n"; print "\n"; print "Where shall you go now?" print "a) Shipping desk(desk)\n"; print "b) Local Guard Station(guard)\n"; $obchoice = ; chomp ($obchoice); if ($obchoice eq "desk") { print "\n"; print "You walk over to the Shipping Desk. Behind the desk is an old man in a worn down sailor outfit. He seems to hardly be able to stand, yet his voice remains crisp and loud over the noise of the docks.\n"; }elsif ($docks eq "guard") { print "\n"; print "You walk over to the Local Guard Station. Standing next to it are two guards similar to the ones who attacked you and your Grandfather. They don't seem to recongnize you for the moment.\n"; print "What shall you do?\n"; print "Check out the Shipping Desk(desk)\n"; print "State your name and challenge them to a duel(duel)\n"; $guardchoice = ; chomp ($guardchoice); if ($guardchoice eq "desk") { print "\n"; print "You walk over to the Shipping Desk. Behind the desk is an old man in a worn down sailor outfit. He seems to hardly be able to stand, yet his voice remains crisp and loud over the noise of the docks.\n"; }elsif ($guardchoice eq "duel") { print "You step before the two guards.\n"; print "\n"; print "Guard One: What do you want kit?\n"; print "$name: I am $name and I challenge you both to a duel!\n"; #Battle system for the two guards in the Fishing Town #Guards' Stats $guardonestr = 8; $guardonedex = 5; $guardonecon = 3; $guardtwostr = 7; $guardtwodex = 3; $guardtwocon = 2; #Conversion into vitality $vitalityone = $guardonecon * 5; $vitalitytwo = $guardtwocon * 5; print "You draw your sword as the two guardsmen do, and prepare for combat.\n"; while (($vit > 0) && ($vitalityone + $vitalitytwo > 0)){ srand; $dex1=rand($dex); $dex2=rand($guardonedex); $dex3=rand($guardtwodex); if ($dex1 > $dex2 && $dex3) { print "Shall you...\n"; print "Attack guard one?(attackone)\n"; print "Attack guard two?(attacktwo)\n"; print "Use Magic on guard one?(magicone)\n"; print "Use Magic on guard two?(magictwo)\n"; $choice = ; chomp ($choice); if ($choice eq "attackone") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalityone -= $streng; print "You hit the first guard with your sword for $streng damage!!\n"; }elsif ($choice eq "attacktwo") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; }elsif ($choice eq "magicone") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicattone = ; chomp ($magicattone); if ($magicattone eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalityone -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the first guard for $magdamage damage.\n"; }elsif ($magicattone eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalityone -= $magdamage; print "You summon a dagger composed of the shadows. You slash the first guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }elsif ($choice eq "magictwo") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicatttwo = ; chomp ($magicatttwo); if ($magicatttwo eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalitytwo -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the second guard for $magdamage damage.\n"; }elsif ($magicatttwo eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalitytwo -= $magdamage; print "You summon a dagger composed of the shadows. You slash the second guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }else{ print "You cannot remember a spell quick enough, you attack instead.\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; } }elsif ($dex2 > $dex1 && $dex3) { #First guard attack srand; $stre=rand($guardonestr); $stren=rand($guardonestr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the first guard's pike for $streng damage!!\n"; }elsif ($dex3 > $dex1 && $dex2){ #Second guard attack srand; $stre=rand($guardtwostr); $stren=rand($guardtwostr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the second guard's knife for $streng damage!!\n"; }else{ print "A clang of metal is heard as your sword strikes against the second guard's dagger, the pike of the first barely misses you.\n"; } if ($vitalityone < 0) { print "The first guard crumples, falling to the ground in a pool of his blood.\n"; while(($vit > 0) && ($vitalitytwo > 0)){ srand; $dex1=rand($dex); $dex3=rand($guardtwodex); if ($dex1 > $dex3) { print "Shall you...\n"; print "Attack guard two?(attacktwo)\n"; print "Use Magic on guard two?(magictwo)\n"; $choice = ; chomp ($choice); if ($choice eq "attacktwo") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; }elsif ($choice eq "magictwo") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicatttwo = ; chomp ($magicatttwo); if ($magicatttwo eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalitytwo -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the second guard for $magdamage damage.\n"; }elsif ($magicatttwo eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalitytwo -= $magdamage; print "You summon a dagger composed of the shadows. You slash the second guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }else{ print "You cannot remember a spell quick enough, you attack instead.\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalitytwo -= $streng; print "You hit the second guard with your sword for $streng damage!!\n"; } }elsif ($dex3 > $dex1){ srand; $stre=rand($guardtwostr); $stren=rand($guardtwostr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the second guard's knife for $streng damage!!\n"; }else{ print "Both blades strike together for a moment before drawing back once again to attack.\n"; } if ($vit < 0){ print "You have died....\n"; } if ($vitalitytwo < 0){ print "The second guard succumbs to your attacks.\n"; } if ($vitalitytwo < 0) { print "The second guard succumbs to your attacks.\n"; while(($vit > 0) && ($vitvitalityone > 0)){ srand; $dex1=rand($dex); $dex2=rand($guardonedex); if ($dex1 > $dex2) { print "Shall you...\n"; print "Attack guard one?(attackone)\n"; print "Use Magic on guard one?(magicone)\n"; $choice = ; chomp ($choice); if ($choice eq "attackone") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalityone -= $streng; print "You hit the first guard with your sword for $streng damage!!\n"; }elsif ($choice eq "magicone") { print "Which magical attack shall you use?\n"; print "Dark Strike\n"; print "Shadow Dagger\n"; $magicattone = ; chomp ($magicattone); if ($magicattone eq "Dark Strike") { srand; $magdamage=rand($dstrike); $vitalityone -= $magdamage; print "Your paw darts forward. A dark needle springs from the center, piercing into the first guard for $magdamage damage.\n"; }elsif ($magicattone eq "Shadow Dagger") { srand; $magdamage=rand($sdagger); $vitalityone -= $magdamage; print "You summon a dagger composed of the shadows. You slash the first guard, wounding him for $magdamage damage.\n"; }else{ print "Your spell fails you and nothing happens..\n"; } }else{ print "You cannot remember a spell quick enough, you attack instead.\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitalityone -= $streng; print "You hit the first guard with your sword for $streng damage!!\n"; } }elsif ($dex2 > $dex1){ srand; $stre=rand($guardonestr); $stren=rand($guardonestr); $streng = $stre + $stren; $vit -= $streng; print "You are hit by the first guard's pike for $streng damage!!\n"; }else{ print "Both blades strike together for a moment before drawing back once again to attack.\n"; } if ($vit < 0){ print "You have died....\n"; } if ($vitalitytwo < 0){ print "The second guard succumbs to your attacks.\n"; } } } print "Both guards lay at your feet, slain by your sword. You feel no shame in taking the lives of these two. They hurt you, took your Grandfather away, and for that you killed.\n"; print "\n"; print "The town is on alert now. Guards can be seen coming in the distance towards you. Quickly you shealth your blade, and take off at a run for the nearby docks.\n"; print "Upon your arrival you see a ship, the Crimson Jewel, departing from port. Running still, you unshealth your sword, and leap towards the hull.\n"; }else{ print "This is not a choice!\n"; die; } sub combat { # Coding began Monday January 26th, 2004 # Last updated 26/01/04 # Monster combat routine # This is an actual working version of the "combat" routine from Syrosian Legacy # will actually work. # version 1.8 # Fixed spell system # Added Spells # Added Spells # User stats are taken from earlier on $strength = 5; $dexterity = 5; $constitution = 2; $magic = 1; # Monster stats # Configuration of monster stats into health/mana points $vitality = $constitution * 5; $manapoints = $magic * 5; # Magic damage figures $fire = 5; $ice = 6; $bolt = 7; $quake = 8; $shadow = 9; while (($vit > 0) && ($vitality > 0)){ srand; $dex1=rand($dex); $dex2=rand($dexterity); if ($dex1 > $dex2) { print "Shall you...\n"; print "Attack?\n"; print "Use Magic?\n"; $choice = ; chomp ($choice); if ($choice eq "attack") { srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $streng *= 1; $vitality -= $streng; print "You hit your opponent for $streng damage!!\n"; }elsif ($choice eq "magic") { if ($mana != 0) { print "Which magical attack shall you use?\n"; print "Fire\n"; print "Ice\n"; print "Bolt\n"; print "Quake\n"; print "Shadow\n"; $magchoice = ; chomp ($magchoice); if ($magchoice eq "fire") { $mana -= 1; srand; $magdamage=rand($fire); $vitality -= $magdamage; print "You BURN your opponent for $magdamage damage!!\n"; }elsif ($magchoice eq "ice") { $mana -= 1; srand; $magdamage=rand($ice); $vitality -= $magdamage; print "You FREEZE your opponent for $magdamage damage!!\n"; }elsif ($magchoice eq "bolt") { $mana -= 2; srand; $magdamage=rand($bolt); $vitality -= $magdamage; print "You ZAP your opponent for $magdamage damage!!\n"; }elsif ($magchoice eq "quake") { $mana -= 3; srand; $magdamage=rand($quake); $vitality -= $magdamage; print "You SHAKE your opponent for $magdamage damage!!\n"; }elsif ($magchoice eq "shadow") { $mana -= 4; srand; $magdamage=rand($shadow); $vitality -= $magdamage; print "You DECAY your opponent for $magdamage damage!!\n"; }else{ print "You mutter a bunch of gibberish and nothing happens..\n"; } }else{ print "You cannot muster enough energy for a spell...you attack instead\n"; srand; $stre=rand($str); $stren=rand($str); $streng = $stre + $stren; $vitality -= $streng; print "You hit your opponent for $streng; damage!!\n"; } } }else{ srand; $stre=rand($strength); $stren=rand($strength); $streng = $stre + $stren; $vit -= $streng; print "You are hit for $streng; damage!!\n"; } if ($vit <= 0) { print "You have been Knocked Out!!\n"; } if ($vitality <= 0) { print "You have Knocked Out your opponent!!\n"; } } }