Wow I kept thinking I'll lose but I won lol with 10hp left
Code archives/Miscellaneous/Big Bad Dragon
This code has been declared by its author to be Public Domain code.
Download source code
| A simple Text-based RPG game I wrote in 10 minutes, explaining to a coworker on what inspired me to get into Game Programming. He got a kick out of it, thought you would too. Hack the code to create your own variations, additions, etc. Have Fun! |
Graphics 800,200,32,2 Print "*** Big Bad Dragon ***" Print Print "The Big Bad Dragon has kidnapped The Little Princess." Print "Being the Brave Knight you are, you have tracked" Print "down the beast to its Lair. Here the beast snores " Print "loudly, flames jet out from its nostrils. You use the " Print "element of suprize to plan your attack... CHARGE!" Print ;The Dragon Type character Field name$ Field health% Field weapon% Field special% End Type player.character = New character player\name$= Input("Name your Warrior:") player\health = 100 player\weapon = 10 player\special = 3 monster.character = New character monster\name$ = "Dragon" monster\health="200" monster\weapon = 5 monster\special = 10 SeedRnd MilliSecs() ;game loop Repeat attack=Input("You attack with [1]Sword [2]Magic("+player\special+"): ") If attack=1 playerpower = Rnd(player\weapon) success = Rnd(6) failed = Rnd(6) If success > failed Then Print "Sword does "+playerpower+" points of damage." monster\health=monster\health-playerpower success = Rnd(10) failed = Rnd(10) If success>failed Then playerpower = Rnd(25)*2 Print "You inflicted a Critical Wound for "+playerpower+" points of damage." monster\health=monster\health-playerpower EndIf Else Print "Your attack failed:(" EndIf If Rnd(12)>Rnd(15) Print Print "The Tooth Fairy appears before you." Print "She holds a of small pouch of Jellybeans." Print "Guess the number of Jellybeans in the bag" magicnumber = Input("to be granted a wish: ") If magicnumber>Rnd(38) player\special=player\special+1 Print Print "POW!!!! You recieve a Magic Snowball." Else Print "You received Didly Squat!" EndIf EndIf ElseIf attack=2 If player\special=0 Print "Sorry no Magic" Else player\special = player\special -1 playerpower = Rnd(50) success = Rnd(6) failed = Rnd(6) If success > failed Then Print "Snowball does "+playerpower+" points of damage." monster\health=monster\health-playerpower Else Print "Your attack failed:(" EndIf EndIf End If ;Dragon attack Dragonattack = Rnd(30) If Dragonattack > 15 Dragonweapon = Rnd(1) If Dragonweapon = 1 If monster\special > 0 monsterpower = Rnd(100) success = Rnd(6) failed = Rnd(6) If success > failed Then Print "The Dragon's Bad Breath does "+monsterpower +" points of damage" player\health=player\health-monsterpower Else Print "The Dragon blew steam." EndIf Else Print "The Dragon is out of Breath." EndIf Else monsterpower = Rnd(monster\weapon) success = Rnd(6) failed = Rnd(6) If success > failed Then Print "Dragon Claws does "+monsterpower +" points of damage." player\health=player\health-monsterpower Else Print "The Dragon tried to bite, but, has no teeth." EndIf EndIf Else Print "The Dragon is too tired to attack." EndIf FlushKeys() Print Print player\name+":"+player\health+" vs Dragon:"+monster\health Until monster\health<0 Or player\health<0 If monster\health < 0 Print "You slayed the Bad Breath Dragon." Else Print "The Dragon is having smoked Hero for dinner." End If If player\health < 0 Print "You are Toast." Else Print "You live up to your name Great Knight." End If WaitKey() |
Comments
THANKS man this code is really helpful I'm really learning from this :)
One of 2 code archive entries that I can actually understand
One of 2 code archive entries that I can actually understand
Hahaha kill it with a piano by instead of typing 1 or 2 type 1749553984 MUAHAHAHAHA!!!
Graphics 800,200,32,2 Print "*** Big Bad Dragon ***" Print Print "The Big Bad Dragon has kidnapped The Little Princess." Print "Being the Brave Knight you are, you have tracked" Print "down the beast to its Lair. Here the beast snores " Print "loudly, flames jet out from its nostrils. You use the " Print "element of suprize to plan your attack... CHARGE!" Print ;The Dragon Type character Field name$ Field health% Field weapon% Field special% Field piano% End Type player.character = New character player\name$= Input("Name your Warrior:") player\health = 150 player\weapon = 10 player\special = 10 player\piano = 1 monster.character = New character monster\name$ = "Dragon" monster\health="200" monster\weapon = 5 monster\special = 10 SeedRnd MilliSecs() ;game loop Repeat attack=Input("You attack with [1]Sword [2]Magic("+player\special+") [?]Piano(1): ") If attack=1 playerpower = Rnd(player\weapon) success = Rnd(6) failed = Rnd(6) If success > failed Then Print "Sword does "+playerpower+" points of damage." monster\health=monster\health-playerpower success = Rnd(10) failed = Rnd(10) If success>failed Then playerpower = Rnd(25)*2 Print "You inflicted a Critical Wound for "+playerpower+" points of damage." monster\health=monster\health-playerpower EndIf Else Print "Your attack failed :(" EndIf If Rnd(12)>Rnd(15) Print Print "The Tooth Fairy appears before you." Print "She holds a of small pouch of Jellybeans." Print "Guess the number of Jellybeans in the bag" magicnumber = Input("to be granted a wish: ") If magicnumber>Rnd(38) player\special=player\special+1 Print Print "POW!!!! You recieve a Magic Snowball." Else Print "You received Didly Squat!" EndIf EndIf ElseIf attack=2 If player\special=0 Print "Sorry no Magic" Else player\special = player\special -1 playerpower = Rnd(50) success = Rnd(6) failed = Rnd(6) If success > failed Then Print "Snowball does "+playerpower+" points of damage." monster\health=monster\health-playerpower Else Print "Your attack failed:(" EndIf EndIf ElseIf attack=1749553984 Print "You squash the dragon with a piano, mission accomplished :)" monster\health=-1000000000 ;sorry bout the goto Goto dragonslayed EndIf ;Dragon attack Dragonattack = Rnd(30) If Dragonattack > 15 Dragonweapon = Rnd(1) If Dragonweapon = 1 If monster\special > 0 monsterpower = Rnd(100) success = Rnd(6) failed = Rnd(6) If success > failed Then Print "The Dragon's Bad Breath does "+monsterpower +" points of damage" player\health=player\health-monsterpower Else Print "The Dragon blew steam." EndIf Else Print "The Dragon is out of Breath." EndIf Else monsterpower = Rnd(monster\weapon) success = Rnd(6) failed = Rnd(6) If success > failed Then Print "Dragon Claws does "+monsterpower +" points of damage." player\health=player\health-monsterpower Else Print "The Dragon tried to bite, but, has no teeth." EndIf EndIf Else Print "The Dragon is too tired to attack." EndIf .dragonslayed FlushKeys() Print Print player\name+":"+player\health+" vs Dragon:"+monster\health Until monster\health<0 Or player\health<0 If monster\health < 0 Print "You slayed the Bad Breath Dragon." Else Print "The Dragon is having smoked Hero for dinner." End If If player\health < 0 Print "You are Toast." Else Print "You live up to your name Great Knight." End If WaitKey()
LOL. A Piano!
Try this Adlib-able Version with Fairy Healing.
Try this Adlib-able Version with Fairy Healing.
Graphics 800,200,32,2 Print "*** The Big Bad Monster ***" Print playername$=Input("Name your Hero:") playerweaponname$=Input("Name your Weapon:") playerweaponpowermovename$=Input("Name your Weapon's Super Move:") playermagicname$=Input("Name your Magic Attack Spell:") princessname$=Input("Name of the Damsel in Distress:") monstername$=Input("Name of the Big Bad Monster:") monsterweaponname$=Input("Name of the Big Bad Monster's Weapon:") fairyname$=Input("Name your favorite person in the world:") fairycandy$=Input("Name favorite candy:") Cls() Print "The notorious "+monstername+" has kidnapped "+princessname+"." Print "Being the Brave Knight you are, you have tracked" Print "down the beast to its Lair. Here the beast snores " Print "loudly. You use the element of suprize to plan your" Print "attack... CHARGE!" Print ;The monster Type character Field name$ Field health% Field weapon% Field special% End Type player.character = New character player\name$= playername player\health = 100 player\weapon = 10 player\special = 3 monster.character = New character monster\name$ = monstername monster\health= 200 monster\weapon = 5 monster\special = 10 SeedRnd MilliSecs() ;game loop Repeat attack=Input("You attack with [1]"+playerweaponname+" [2]"+playermagicname+"("+player\special+"): ") If attack=1 playerpower = Rnd(player\weapon) success = Rnd(6) failed = Rnd(6) If success > failed Then Print playerweaponname+" does "+playerpower+" points of damage." monster\health=monster\health-playerpower success = Rnd(10) failed = Rnd(10) If success>failed Then playerpower = Rnd(25)*2 Print "Your "+playerweaponpowermovename+" Super Move inflicts a Critical Wound For "+playerpower+" points of damage." monster\health=monster\health-playerpower EndIf Else Print "Your attack failed:(" EndIf If Rnd(12)>Rnd(15) Print Print fairyname+" The Fairy appears before you." Print "holding a small pouch of magic "+fairycandy+"." Print "Guess the number of "+fairycandy+"s (1-6) " magicnumber = Input("in the bag to receive a gift: ") d6=Rnd(6)+1 If magicnumber=d6 player\special=player\special+1 Print Print "POW!!!! You recieve a Magic "+playermagicname+"." Else Print:Print fairyname+" had "+d6+" "+fairycandy+"s in the pouch." d6 = Rnd(6) Select d6 Case 0 nothing$ = "Diddly Squat" Case 1 nothing$ = "Notta" Case 2 nothing$ = "Zelch" Case 3 nothing$ = "Stinky Goose Egg" Case 4 nothing$ = "0" Case 5 nothing$ = "Zippo" End Select Print "You received "+nothing+"!" EndIf healing = Rnd(25) player\health=player\health+healing If player\health > 100 player\health=100 Print fairyname+" restores "+healing+" points." EndIf Print ElseIf attack=2 If player\special=0 Print "Sorry NO Magic" Else player\special = player\special -1 playerpower = Rnd(50) success = Rnd(6) failed = Rnd(6) If success > failed Then Print playermagicname+" does "+playerpower+" points of damage." monster\health=monster\health-playerpower Else Print "Your attack failed:(" EndIf EndIf End If ;monster attack monsterattack = Rnd(30) If monsterattack > 15 monsterweapon = Rnd(2) If monsterweapon = 1 If monster\special > 0 monsterpower = Rnd(100) success = Rnd(6) failed = Rnd(6) If success > failed Then Print monstername+"'s "+monsterweaponname+" does "+monsterpower +" points of damage." player\health=player\health-monsterpower Else Print monstername+"'s attack was a miserable failure." monsterrage = monsterrage + 1 If Rnd(6)=3 monsterpower=Rnd(10) Print monstername+"Inflicted "+monsterpower+ "points of self damage." monster\health=monster\health-monsterpower EndIf EndIf Else Print monstername+" is out of Breath." monsterrage = monsterrage + 1 EndIf Else monsterpower = Rnd(monster\weapon) success = Rnd(6) failed = Rnd(6) If success > failed Then Print monstername+ "'s claws does "+monsterpower +" points of damage." player\health=player\health-monsterpower Else Print monstername+" tried to bite, but, has no teeth." EndIf EndIf Else Print monstername+" is too tired to attack." monsterrage=monsterrage+1 EndIf If monsterrage > 10 Print "You have made "+monstername+" extremely angry." monsterpower = Rnd(100) Print monstername+"'s "+monsterweaponname+" does "+monsterpower +" points of damage." player\health=player\health-monsterpower monsterrage=0 EndIf FlushKeys() Print Print player\name+":"+player\health+" vs "+monstername+":"+monster\health Until monster\health<0 Or player\health<0 Print Print "G A M E O V E R ************************************" If monster\health < 0 Print "You slayed "+monstername Else d6 = Rnd(6) Select d6 Case 0 cooking$ = "smoked" Case 1 cooking$ = "stewed" Case 2 cooking$ = "iced" Case 3 cooking$ = "fried" Case 4 cooking$ = "baked" Case 5 cooking$ = "steamed" End Select Print monstername+" is having "+cooking+" "+playername+" For dinner." End If If player\health < 0 Print "You are Toast." Else rank$="Daring Fool" If player\health>25 rank$="Brave Knight" If player\health>50 rank$="Ultimate Warrior" If player\health>75 rank$="Undefeatable Hero" Print "You live up to your name as a "+rank+"." End If WaitKey()
LOL my Super Wound is a piano :)
"Your drop a piano Super Move inflitcts a Critical Wound for 40 points of damage."
"Your drop a piano Super Move inflitcts a Critical Wound for 40 points of damage."
LOL. "Your Big Mac Attack Super Move inflicts a Critical Wound For 49 points of damage."