Skip to content
Snippets Groups Projects
Commit 385ab755 authored by deuce's avatar deuce
Browse files

Use the new console.writeln() function rather than the global writeln()

parent ddfc9ec6
Branches
No related tags found
No related merge requests found
...@@ -31,8 +31,8 @@ if(armourfile.open("r", true)) { ...@@ -31,8 +31,8 @@ if(armourfile.open("r", true)) {
} }
else { else {
console.attributes="HIR0"; console.attributes="HIR0";
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Cannot open armours file!"+armourfile.name); console.writeln("Cannot open armours file!"+armourfile.name);
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
} }
...@@ -111,8 +111,8 @@ function playerlist() ...@@ -111,8 +111,8 @@ function playerlist()
var i; var i;
console.attributes="M0"; console.attributes="M0";
/*console.*/writeln("Hero Rankings:"); console.writeln("Hero Rankings:");
/*console.*/writeln("!!!!!!!!!!!!!!"); console.writeln("!!!!!!!!!!!!!!");
for(i=0; i<list.length; i++) { for(i=0; i<list.length; i++) {
console.attributes="M0"; console.attributes="M0";
console.print(format("%2u. \x01H\x01C%.30s%.*s\x01N\x01GLev=%-2u W=%-6u L=%-6u S=%s \x01I\x01R%s\r\n" console.print(format("%2u. \x01H\x01C%.30s%.*s\x01N\x01GLev=%-2u W=%-6u L=%-6u S=%s \x01I\x01R%s\r\n"
...@@ -139,11 +139,11 @@ function weaponlist() ...@@ -139,11 +139,11 @@ function weaponlist()
if(max<armour.length) if(max<armour.length)
max=armour.length; max=armour.length;
/*console.*/writeln("Num. Weapon Price Armour Price"); console.writeln("Num. Weapon Price Armour Price");
/*console.*/writeln("------------------------------------------------------------------------------"); console.writeln("------------------------------------------------------------------------------");
for(i=1; i<max; i++) { for(i=1; i<max; i++) {
if((i < weapon.length && weapon[i].cost != 0) || (i < armour.length && armour[i].cost != 0)) { if((i < weapon.length && weapon[i].cost != 0) || (i < armour.length && armour[i].cost != 0)) {
/*console.*/writeln(format("%2d> %-25.25s %9s %-25.25s %9s" console.writeln(format("%2d> %-25.25s %9s %-25.25s %9s"
, i , i
, ((i>=weapon.length || weapon[i].cost==0)?"":weapon[i].name) , ((i>=weapon.length || weapon[i].cost==0)?"":weapon[i].name)
, ((i>=weapon.length || weapon[i].cost==0)?"":weapon[i].cost) , ((i>=weapon.length || weapon[i].cost==0)?"":weapon[i].cost)
...@@ -158,17 +158,17 @@ function credits() ...@@ -158,17 +158,17 @@ function credits()
{ {
console.clear(); console.clear();
console.attributes="G0"; console.attributes="G0";
/*console.*/writeln("Dragonlance 3.0 Credits"); console.writeln("Dragonlance 3.0 Credits");
/*console.*/writeln("@@@@@@@@@@@@@@@@@@@@@@@"); console.writeln("@@@@@@@@@@@@@@@@@@@@@@@");
/*console.*/writeln("Original Dragonlance : Raistlin Majere & TML"); console.writeln("Original Dragonlance : Raistlin Majere & TML");
/*console.*/writeln("Special Thanks To : The Authours of Dragonlance"); console.writeln("Special Thanks To : The Authours of Dragonlance");
/*console.*/writeln("Drangonlance's Home : The Tower Of High Sorcery"); console.writeln("Drangonlance's Home : The Tower Of High Sorcery");
/*console.*/writeln("Originally modified from the Brazil Source Code"); console.writeln("Originally modified from the Brazil Source Code");
/*console.*/writeln("C Port : Deuce"); console.writeln("C Port : Deuce");
/*console.*/writeln("JavaScript Port : Deuce"); console.writeln("JavaScript Port : Deuce");
/*console.*/writeln("Home Page : http://doors.bbsdev.net/"); console.writeln("Home Page : http://doors.bbsdev.net/");
/*console.*/writeln("Support : deuce@nix.synchro.net"); console.writeln("Support : deuce@nix.synchro.net");
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
} }
...@@ -183,8 +183,8 @@ function listplayers() ...@@ -183,8 +183,8 @@ function listplayers()
{ {
console.clear(); console.clear();
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("Heroes That Have Been Defeated"); console.writeln("Heroes That Have Been Defeated");
/*console.*/writeln("++++++++++++++++++++++++++++++"); console.writeln("++++++++++++++++++++++++++++++");
console.attributes="HC0"; console.attributes="HC0";
if(file_exists(getpath()+"yester.log")) if(file_exists(getpath()+"yester.log"))
console.printfile(getpath()+"yester.log"); console.printfile(getpath()+"yester.log");
...@@ -217,29 +217,29 @@ function weaponshop() ...@@ -217,29 +217,29 @@ function weaponshop()
console.clear(); console.clear();
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("Weapon & Armour Shop"); console.writeln("Weapon & Armour Shop");
console.attributes="G0"; console.attributes="G0";
/*console.*/writeln("$$$$$$$$$$$$$$$$$$$$"); console.writeln("$$$$$$$$$$$$$$$$$$$$");
while(1) { while(1) {
/*console.*/writeln(); console.writeln();
console.write("(B)rowse, (S)ell, (P)urchase, or (Q)uit? "); console.write("(B)rowse, (S)ell, (P)urchase, or (Q)uit? ");
switch(dgn_getkeys("BSQP")) { switch(dgn_getkeys("BSQP")) {
case 'Q': case 'Q':
/*console.*/writeln("Quit"); console.writeln("Quit");
return; return;
case 'B': case 'B':
/*console.*/writeln("Browse"); console.writeln("Browse");
weaponlist(); weaponlist();
break; break;
case 'P': case 'P':
/*console.*/writeln("Purchase"); console.writeln("Purchase");
/*console.*/writeln(); console.writeln();
/*console.*/writeln(); console.writeln();
console.write("Enter weapon/armour # you wish to buy: "); console.write("Enter weapon/armour # you wish to buy: ");
buy=console.getnum(max); buy=console.getnum(max);
if(buy==0) if(buy==0)
continue; continue;
/*console.*/writeln(); console.writeln();
if(buy >= weapon.length) if(buy >= weapon.length)
type="A"; type="A";
else if(buy >= armour.length) else if(buy >= armour.length)
...@@ -248,105 +248,105 @@ function weaponshop() ...@@ -248,105 +248,105 @@ function weaponshop()
console.write("(W)eapon or (A)rmour: "); console.write("(W)eapon or (A)rmour: ");
type=dgn_getkeys("WA"); type=dgn_getkeys("WA");
if(type=='A') if(type=='A')
/*console.*/writeln("Armour"); console.writeln("Armour");
else if(type=='W') else if(type=='W')
/*console.*/writeln("Weapon"); console.writeln("Weapon");
else else
continue; continue;
} }
switch(type) { switch(type) {
case 'W': case 'W':
if(weapon[buy].cost==0) { if(weapon[buy].cost==0) {
/*console.*/writeln("You want to buy a what?"); console.writeln("You want to buy a what?");
continue; continue;
} }
console.write("Are you sure you want to buy it? "); console.write("Are you sure you want to buy it? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
if(weapon[buy].cost > player.gold) { if(weapon[buy].cost > player.gold) {
/*console.*/writeln("You do not have enough Steel."); console.writeln("You do not have enough Steel.");
continue; continue;
} }
if(weapon[buy].cost==0) { if(weapon[buy].cost==0) {
/*console.*/writeln("You can not buy one of those..."); console.writeln("You can not buy one of those...");
continue; continue;
} }
player.gold -= weapon[buy].cost; player.gold -= weapon[buy].cost;
player.weapon=new Weapon(weapon[buy].name, weapon[buy].attack, weapon[buy].power, weapon[buy].cost); player.weapon=new Weapon(weapon[buy].name, weapon[buy].attack, weapon[buy].power, weapon[buy].cost);
/*console.*/writeln(); console.writeln();
console.attributes="M0"; console.attributes="M0";
/*console.*/writeln("You've bought a "+player.weapon.name); console.writeln("You've bought a "+player.weapon.name);
} }
else else
/*console.*/writeln("No"); console.writeln("No");
break; break;
case 'A': case 'A':
if(weapon[buy].cost==0) { if(weapon[buy].cost==0) {
/*console.*/writeln("You want to buy a what?"); console.writeln("You want to buy a what?");
continue; continue;
} }
console.write("Are you sure you want to buy it? "); console.write("Are you sure you want to buy it? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
if(armour[buy].cost > player.gold) { if(armour[buy].cost > player.gold) {
/*console.*/writeln("You do not have enough Steel."); console.writeln("You do not have enough Steel.");
continue; continue;
} }
if(armour[buy].cost==0) { if(armour[buy].cost==0) {
/*console.*/writeln("You can not buy one of those..."); console.writeln("You can not buy one of those...");
continue; continue;
} }
player.gold -= armour[buy].cost; player.gold -= armour[buy].cost;
player.armour=new Armour(armour[buy].name, armour[buy].power, armour[buy].cost); player.armour=new Armour(armour[buy].name, armour[buy].power, armour[buy].cost);
/*console.*/writeln(); console.writeln();
console.attributes="M0"; console.attributes="M0";
/*console.*/writeln("You've bought a "+player.armour.name); console.writeln("You've bought a "+player.armour.name);
} }
else else
/*console.*/writeln("No"); console.writeln("No");
break; break;
} }
break; break;
case 'S': case 'S':
/*console.*/writeln("Sell"); console.writeln("Sell");
/*console.*/writeln(); console.writeln();
console.write("(W)eapon, (A)rmour, (Q)uit: "); console.write("(W)eapon, (A)rmour, (Q)uit: ");
switch(dgn_getkeys("AWQ")) { switch(dgn_getkeys("AWQ")) {
case 'Q': case 'Q':
/*console.*/writeln("Quit"); console.writeln("Quit");
break; break;
case 'W': case 'W':
/*console.*/writeln("Weapon"); console.writeln("Weapon");
buyprice=player.charisma; buyprice=player.charisma;
buyprice*=player.weapon.cost; buyprice*=player.weapon.cost;
buyprice/=20; buyprice/=20;
/*console.*/writeln(); console.writeln();
console.write("I will purchase it for "+buyprice+", okay? "); console.write("I will purchase it for "+buyprice+", okay? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
console.attributes="G0"; console.attributes="G0";
/*console.*/writeln("Is it Dwarven Made?"); console.writeln("Is it Dwarven Made?");
player.weapon=new Weapon(weapon[0].name, weapon[0].attack, weapon[0].power, weapon[0].cost); player.weapon=new Weapon(weapon[0].name, weapon[0].attack, weapon[0].power, weapon[0].cost);
player.gold += buyprice; player.gold += buyprice;
} }
else else
/*console.*/writeln("No"); console.writeln("No");
break; break;
case 'A': case 'A':
/*console.*/writeln("Armour"); console.writeln("Armour");
buyprice=player.charisma; buyprice=player.charisma;
buyprice*=player.armour.cost; buyprice*=player.armour.cost;
buyprice/=20; buyprice/=20;
/*console.*/writeln(); console.writeln();
console.write("I will purchase it for "+buyprice+", okay? "); console.write("I will purchase it for "+buyprice+", okay? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
/*console.*/writeln("Fine Craftsmanship!"); console.writeln("Fine Craftsmanship!");
player.armour=new Armour(armour[0].name, armour[0].power, armour[0].cost); player.armour=new Armour(armour[0].name, armour[0].power, armour[0].cost);
player.gold += buyprice; player.gold += buyprice;
} }
else else
/*console.*/writeln("No"); console.writeln("No");
break; break;
} }
...@@ -361,18 +361,18 @@ function spy() ...@@ -361,18 +361,18 @@ function spy()
var spyon; var spyon;
console.clear(); console.clear();
/*console.*/writeln("Spying on another user eh.. well you may spy, but to keep"); console.writeln("Spying on another user eh.. well you may spy, but to keep");
/*console.*/writeln("you from copying this person's stats, they will not be"); console.writeln("you from copying this person's stats, they will not be");
/*console.*/writeln("available to you. Note that this is gonna cost you some"); console.writeln("available to you. Note that this is gonna cost you some");
/*console.*/writeln("cash too. Cost: 20 Steel pieces"); console.writeln("cash too. Cost: 20 Steel pieces");
/*console.*/writeln(); console.writeln();
console.write("Who do you wish to spy on? "); console.write("Who do you wish to spy on? ");
spyon=console.getstr("", 30, K_LINE); spyon=console.getstr("", 30, K_LINE);
if(spyon=='') if(spyon=='')
return; return;
if(player.gold < 20) { if(player.gold < 20) {
console.attributes="HR0"; console.attributes="HR0";
/*console.*/writeln("You do not have enough Steel!"); console.writeln("You do not have enough Steel!");
} }
else { else {
/* Find this user */ /* Find this user */
...@@ -380,33 +380,33 @@ function spy() ...@@ -380,33 +380,33 @@ function spy()
if(i.pseudo.match(new RegExp("spyon","i")!=-1)) { if(i.pseudo.match(new RegExp("spyon","i")!=-1)) {
console.write("Do you mean \""+users[i].pseudo+"\"?"); console.write("Do you mean \""+users[i].pseudo+"\"?");
if(dgn_getkeys("YN")=="Y") { if(dgn_getkeys("YN")=="Y") {
/*console.*/writeln("Yes"); console.writeln("Yes");
break; break;
} }
/*console.*/writeln("No"); console.writeln("No");
} }
} }
if(i>=users.length) if(i>=users.length)
return; return;
player.gold -= 20; player.gold -= 20;
/*console.*/writeln(); console.writeln();
console.attributes="HR0"; console.attributes="HR0";
/*console.*/writeln(users[i].pseudo); console.writeln(users[i].pseudo);
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Level : "+users[i].level); console.writeln("Level : "+users[i].level);
/*console.*/writeln("Exp : "+users[i].experience); console.writeln("Exp : "+users[i].experience);
/*console.*/writeln("Flights: "+users[i].flights); console.writeln("Flights: "+users[i].flights);
/*console.*/writeln("HPs : "+users[i].hps); console.writeln("HPs : "+users[i].hps);
/*console.*/writeln(); console.writeln();
console.attributes="M0"; console.attributes="M0";
/*console.*/writeln("Weapon : "+users[i].weapon.name); console.writeln("Weapon : "+users[i].weapon.name);
/*console.*/writeln("Armour : "+users[i].armour.name); console.writeln("Armour : "+users[i].armour.name);
/*console.*/writeln(); console.writeln();
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("Steel (in hand): "+users[i].gold); console.writeln("Steel (in hand): "+users[i].gold);
/*console.*/writeln("Steel (in bank): "+users[i].bank); console.writeln("Steel (in bank): "+users[i].bank);
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
} }
} }
...@@ -421,11 +421,11 @@ function bulletin() ...@@ -421,11 +421,11 @@ function bulletin()
console.printfile(getpath()+"byester.asc"); console.printfile(getpath()+"byester.asc");
if(file_exists(getpath()+"btoday.asc")) if(file_exists(getpath()+"btoday.asc"))
console.printfile(getpath()+"btoday.asc"); console.printfile(getpath()+"btoday.asc");
/*console.*/writeln(); console.writeln();
console.write("Do you wish to enter a News Bulletin? "); console.write("Do you wish to enter a News Bulletin? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
/*console.*/writeln(); console.writeln();
var bullet=new Array();; var bullet=new Array();;
while(bullet.length<4) { while(bullet.length<4) {
console.attributes="HY0"; console.attributes="HY0";
...@@ -436,11 +436,11 @@ function bulletin() ...@@ -436,11 +436,11 @@ function bulletin()
break; break;
bullet.push(bline); bullet.push(bline);
} }
/*console.*/writeln(); console.writeln();
console.write("Is the bulletin correct? "); console.write("Is the bulletin correct? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
/*console.*/writeln("Saving Bulletin..."); console.writeln("Saving Bulletin...");
if(bfile.open("a",true)) { if(bfile.open("a",true)) {
bfile.writeln("At "+system.timestr()+", "+player.pseudo+" wrote:"); bfile.writeln("At "+system.timestr()+", "+player.pseudo+" wrote:");
while(bullet.length) { while(bullet.length) {
...@@ -452,10 +452,10 @@ function bulletin() ...@@ -452,10 +452,10 @@ function bulletin()
} }
} }
else else
/*console.*/writeln("No"); console.writeln("No");
} }
else else
/*console.*/writeln("No"); console.writeln("No");
} }
function afight(lvl) function afight(lvl)
...@@ -464,10 +464,10 @@ function afight(lvl) ...@@ -464,10 +464,10 @@ function afight(lvl)
var monster; var monster;
if(player.fights<1) { if(player.fights<1) {
/*console.*/writeln(); console.writeln();
console.attributes="M0"; console.attributes="M0";
/*console.*/writeln("It's Getting Dark Out!"); console.writeln("It's Getting Dark Out!");
/*console.*/writeln("Return to the Nearest Inn!"); console.writeln("Return to the Nearest Inn!");
} }
else { else {
console.clear(); console.clear();
...@@ -513,8 +513,8 @@ function doggie() ...@@ -513,8 +513,8 @@ function doggie()
if(player.battles > 0) { if(player.battles > 0) {
console.clear(); console.clear();
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("Battle Another Hero"); console.writeln("Battle Another Hero");
/*console.*/writeln("*******************"); console.writeln("*******************");
players=getplayerlist(); players=getplayerlist();
for(i=0; i<players.length; i++) { for(i=0; i<players.length; i++) {
if((players[i].level > player.level-4) if((players[i].level > player.level-4)
...@@ -537,7 +537,7 @@ function doggie() ...@@ -537,7 +537,7 @@ function doggie()
console.pause(); console.pause();
} }
} }
/*console.*/writeln(); console.writeln();
console.attributes="HC0"; console.attributes="HC0";
console.write("Enter the # of your opponent: "); console.write("Enter the # of your opponent: ");
opp=console.getnum(avail_players.length); opp=console.getnum(avail_players.length);
...@@ -548,10 +548,10 @@ function doggie() ...@@ -548,10 +548,10 @@ function doggie()
player.battles--; player.battles--;
avail_players[opp].experience /= 10; avail_players[opp].experience /= 10;
avail_players[opp].damage = 0; avail_players[opp].damage = 0;
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Your opponent screams out:"); console.writeln("Your opponent screams out:");
/*console.*/writeln('"'+avail_players[opp].bcry+'" as battle is joined.'); console.writeln('"'+avail_players[opp].bcry+'" as battle is joined.');
/*console.*/writeln(); console.writeln();
player.battle(avail_players[opp]); player.battle(avail_players[opp]);
} }
} }
...@@ -573,9 +573,9 @@ function main() ...@@ -573,9 +573,9 @@ function main()
console.print(" / \\ \x01C Help the People Of Krynn. \x01Y \\==/ \r\n"); console.print(" / \\ \x01C Help the People Of Krynn. \x01Y \\==/ \r\n");
console.print("/ \\ ## \r\n"); console.print("/ \\ ## \r\n");
console.print("----------\x01N\x01I\x01R ON WARD!!! \x01N\x01H\x01Y ## \r\n"); console.print("----------\x01N\x01I\x01R ON WARD!!! \x01N\x01H\x01Y ## \r\n");
/*console.*/writeln(); console.writeln();
/*console.*/writeln("News Bulletin:"); console.writeln("News Bulletin:");
/*console.*/writeln(); console.writeln();
if(file_exists(getpath()+"byester.asc")) if(file_exists(getpath()+"byester.asc"))
console.printfile(getpath()+"byester.asc"); console.printfile(getpath()+"byester.asc");
if(file_exists(getpath()+"btoday.asc")) if(file_exists(getpath()+"btoday.asc"))
...@@ -585,13 +585,13 @@ function main() ...@@ -585,13 +585,13 @@ function main()
js.on_exit("player.leave()"); js.on_exit("player.leave()");
if(player.status & Status.DEAD) { if(player.status & Status.DEAD) {
if(player.laston==system.datestr()) { if(player.laston==system.datestr()) {
/*console.*/writeln("You have already died today..."); console.writeln("You have already died today...");
/*console.*/writeln("Return tomorrow for your revenge!"); console.writeln("Return tomorrow for your revenge!");
return(0); return(0);
} }
/*console.*/writeln(); console.writeln();
console.attributes="HC0"; console.attributes="HC0";
/*console.*/writeln("A defeat was lead over you by "+player.killer); console.writeln("A defeat was lead over you by "+player.killer);
} }
player.lastone=system.datestr(); player.lastone=system.datestr();
if(player.flights < 1) { if(player.flights < 1) {
...@@ -600,7 +600,7 @@ function main() ...@@ -600,7 +600,7 @@ function main()
} }
else else
player.flights--; player.flights--;
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
console.clear(); console.clear();
console.attributes="HY0"; console.attributes="HY0";
...@@ -610,149 +610,149 @@ function main() ...@@ -610,149 +610,149 @@ function main()
while(player.damage < player.hps) { while(player.damage < player.hps) {
player.levelupdate(); player.levelupdate();
if((player.wins+1)*4 < player.losses) { if((player.wins+1)*4 < player.losses) {
/*console.*/writeln(); console.writeln();
/*console.*/writeln("As you were Travelling along a Wilderness Page an"); console.writeln("As you were Travelling along a Wilderness Page an");
/*console.*/writeln("Evil Wizard Confronted You. When you tried to fight"); console.writeln("Evil Wizard Confronted You. When you tried to fight");
/*console.*/writeln("Him off, he cast a Spell of Instant Death Upon you."); console.writeln("Him off, he cast a Spell of Instant Death Upon you.");
/*console.*/writeln("Instantly you were slain by the Archmage, Leaving you"); console.writeln("Instantly you were slain by the Archmage, Leaving you");
/*console.*/writeln("as nothing more than a pile of ashes. Re-Rolled!"); console.writeln("as nothing more than a pile of ashes. Re-Rolled!");
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
player.create(false); player.create(false);
if(player.flights) if(player.flights)
player.flights--; player.flights--;
} }
/*console.*/writeln(); console.writeln();
/*console.*/writeln(); console.writeln();
console.attributes="HY0"; console.attributes="HY0";
console.write("Command (?): "); console.write("Command (?): ");
switch(dgn_getkeys("QVP12345CHWLADGFRSTX+-?EZ*#")) { switch(dgn_getkeys("QVP12345CHWLADGFRSTX+-?EZ*#")) {
case 'Q': case 'Q':
/*console.*/writeln("Quit"); console.writeln("Quit");
console.write("LEAVE KRYNN? Are you sure? "); console.write("LEAVE KRYNN? Are you sure? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
return(0); return(0);
} }
/*console.*/writeln("No"); console.writeln("No");
break; break;
case '1': case '1':
/*console.*/writeln("1"); console.writeln("1");
afight(1); afight(1);
break; break;
case '2': case '2':
/*console.*/writeln("2"); console.writeln("2");
afight(2); afight(2);
break; break;
case '3': case '3':
/*console.*/writeln("3"); console.writeln("3");
afight(3); afight(3);
break; break;
case '4': case '4':
/*console.*/writeln("4"); console.writeln("4");
afight(4); afight(4);
break; break;
case '5': case '5':
/*console.*/writeln("5"); console.writeln("5");
afight(5); afight(5);
break; break;
case 'C': case 'C':
/*console.*/writeln("Change Stats"); console.writeln("Change Stats");
player.chstats(); player.chstats();
break; break;
case 'H': case 'H':
/*console.*/writeln("Heal"); console.writeln("Heal");
player.heal(); player.heal();
break; break;
case 'W': case 'W':
/*console.*/writeln("Weapon Shop"); console.writeln("Weapon Shop");
weaponshop(); weaponshop();
break; break;
case 'L': case 'L':
/*console.*/writeln("Level Update"); console.writeln("Level Update");
player.levelupdate(); player.levelupdate();
break; break;
case 'A': case 'A':
/*console.*/writeln("Battle Another User"); console.writeln("Battle Another User");
doggie(); doggie();
break; break;
case 'D': case 'D':
/*console.*/writeln("Docs"); console.writeln("Docs");
docs(); docs();
break; break;
case 'G': case 'G':
/*console.*/writeln("Gamble"); console.writeln("Gamble");
player.gamble(); player.gamble();
break; break;
case 'F': case 'F':
/*console.*/writeln("Battles Today"); console.writeln("Battles Today");
listplayers(); listplayers();
break; break;
case 'R': case 'R':
/*console.*/writeln("Rank Players"); console.writeln("Rank Players");
playerlist(); playerlist();
break; break;
case 'S': case 'S':
/*console.*/writeln("Status"); console.writeln("Status");
player.statshow(); player.statshow();
break; break;
case 'T': case 'T':
/*console.*/writeln("Training Grounds"); console.writeln("Training Grounds");
player.training(); player.training();
break; break;
case 'X': case 'X':
/*console.*/writeln("Re-Roll"); console.writeln("Re-Roll");
/*console.*/writeln("Please not that this will completely purge"); console.writeln("Please not that this will completely purge");
/*console.*/writeln("your current hero of all attributes!"); console.writeln("your current hero of all attributes!");
/*console.*/writeln(); console.writeln();
console.write("Are you sure you want to REROLL your character? "); console.write("Are you sure you want to REROLL your character? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
player.create(false); player.create(false);
if(player.flights) if(player.flights)
player.flights--; player.flights--;
} }
else else
/*console.*/writeln("No"); console.writeln("No");
break; break;
case '+': case '+':
/*console.*/writeln("Deposit"); console.writeln("Deposit");
player.depobank(); player.depobank();
break; break;
case '-': case '-':
/*console.*/writeln("Withdraw"); console.writeln("Withdraw");
player.withdrawbank(); player.withdrawbank();
break; break;
case 'P': case 'P':
/*console.*/writeln("Plug"); console.writeln("Plug");
console.clear(); console.clear();
console.printfile(getpath()+"plug.asc"); console.printfile(getpath()+"plug.asc");
break; break;
case '?': case '?':
/*console.*/writeln("Help"); console.writeln("Help");
console.clear(); console.clear();
console.printfile(getpath()+"menu.asc"); console.printfile(getpath()+"menu.asc");
break; break;
case 'E': case 'E':
/*console.*/writeln("Edit Announcement"); console.writeln("Edit Announcement");
bulletin(); bulletin();
break; break;
case 'Z': case 'Z':
/*console.*/writeln("Spy"); console.writeln("Spy");
spy(); spy();
break; break;
case 'V': case 'V':
/*console.*/writeln("Version"); console.writeln("Version");
console.attributes="HB0"; console.attributes="HB0";
/*console.*/writeln("This Is Dragonlance version 3.0 (JS)"); console.writeln("This Is Dragonlance version 3.0 (JS)");
console.pause(); console.pause();
break; break;
case '*': case '*':
/*console.*/writeln("Change Name"); console.writeln("Change Name");
player.changename(); player.changename();
break; break;
case '#': case '#':
/*console.*/writeln("Change Battle Cry"); console.writeln("Change Battle Cry");
player.vic(); player.vic();
break; break;
} }
......
...@@ -158,24 +158,24 @@ function Player_statshow() ...@@ -158,24 +158,24 @@ function Player_statshow()
{ {
console.clear(); console.clear();
console.attributes="M0"; console.attributes="M0";
/*console.*/writeln("Name: "+this.pseudo+" Level: "+this.level); console.writeln("Name: "+this.pseudo+" Level: "+this.level);
console.attributes="HC0"; console.attributes="HC0";
console.write("W/L: "+this.wins+"/"+this.losses); console.write("W/L: "+this.wins+"/"+this.losses);
/*console.*/writeln(" Exp: "+this.experience); console.writeln(" Exp: "+this.experience);
/*console.*/writeln(); console.writeln();
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("Steel (in hand): "+this.gold); console.writeln("Steel (in hand): "+this.gold);
/*console.*/writeln("Steel (in bank): "+this.bank); console.writeln("Steel (in bank): "+this.bank);
/*console.*/writeln(); console.writeln();
console.attributes="HB0"; console.attributes="HB0";
console.write("Battles: "+this.battles); console.write("Battles: "+this.battles);
console.write(" Flights: "+this.flights); console.write(" Flights: "+this.flights);
console.write(" Fights: "+this.fights); console.write(" Fights: "+this.fights);
/*console.*/writeln(" HPs: "+(this.hps-this.damage)+"("+this.hps+")"); console.writeln(" HPs: "+(this.hps-this.damage)+"("+this.hps+")");
/*console.*/writeln(); console.writeln();
console.attributes="HC0"; console.attributes="HC0";
console.write("Weapon: "+this.weapon.name); console.write("Weapon: "+this.weapon.name);
/*console.*/writeln(" Armor: "+this.armour.name); console.writeln(" Armor: "+this.armour.name);
} }
function Player_load(filename) function Player_load(filename)
...@@ -189,9 +189,9 @@ function Player_load(filename) ...@@ -189,9 +189,9 @@ function Player_load(filename)
var item_attack; var item_attack;
if(!Lock(players.name, bbs.node_num, false, 1)) { if(!Lock(players.name, bbs.node_num, false, 1)) {
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Cannot lock "+players.name+" for read!"); console.writeln("Cannot lock "+players.name+" for read!");
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
return(false); return(false);
} }
...@@ -253,9 +253,9 @@ function Player_save(name) ...@@ -253,9 +253,9 @@ function Player_save(name)
var players=new File(getpath()+"players.ini"); var players=new File(getpath()+"players.ini");
if(!Lock(players.name, bbs.node_num, true, 1)) { if(!Lock(players.name, bbs.node_num, true, 1)) {
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Cannot lock "+players.name+" for write!"); console.writeln("Cannot lock "+players.name+" for write!");
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
return(false); return(false);
} }
...@@ -309,7 +309,7 @@ function Player_levelupdate() ...@@ -309,7 +309,7 @@ function Player_levelupdate()
if(this.experience > required[this.level+1]) { if(this.experience > required[this.level+1]) {
this.level++; this.level++;
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("Welcome to level "+this.level+"!"); console.writeln("Welcome to level "+this.level+"!");
x=random(6)+1; x=random(6)+1;
switch(random(6)) { switch(random(6)) {
case 0: case 0:
...@@ -342,31 +342,31 @@ function Player_chstats() ...@@ -342,31 +342,31 @@ function Player_chstats()
console.write("Increase which stat? "); console.write("Increase which stat? ");
switch(dgn_getkeys("123456Q")) { switch(dgn_getkeys("123456Q")) {
case '1': case '1':
/*console.*/writeln("Strength"); console.writeln("Strength");
this_obj.strength++; this_obj.strength++;
break; break;
case '2': case '2':
/*console.*/writeln("Intelligence"); console.writeln("Intelligence");
this_obj.intelligence++; this_obj.intelligence++;
break; break;
case '3': case '3':
/*console.*/writeln("Dexterity"); console.writeln("Dexterity");
this_obj.dexterity++; this_obj.dexterity++;
break; break;
case '4': case '4':
/*console.*/writeln("Luck"); console.writeln("Luck");
this_obj.luck++; this_obj.luck++;
break; break;
case '5': case '5':
/*console.*/writeln("Constitution"); console.writeln("Constitution");
this_obj.constitution++; this_obj.constitution++;
break; break;
case '6': case '6':
/*console.*/writeln("Charisma"); console.writeln("Charisma");
this_obj.charisma++; this_obj.charisma++;
break; break;
case 'Q': case 'Q':
/*console.*/writeln("Quit"); console.writeln("Quit");
return(false); return(false);
} }
return(true); return(true);
...@@ -377,31 +377,31 @@ function Player_chstats() ...@@ -377,31 +377,31 @@ function Player_chstats()
console.write("Decrease which stat? "); console.write("Decrease which stat? ");
switch(dgn_getkeys("123456Q")) { switch(dgn_getkeys("123456Q")) {
case '1': case '1':
/*console.*/writeln("Strength"); console.writeln("Strength");
this_obj.strength--; this_obj.strength--;
break; break;
case '2': case '2':
/*console.*/writeln("Intelligence"); console.writeln("Intelligence");
this_obj.intelligence--; this_obj.intelligence--;
break; break;
case '3': case '3':
/*console.*/writeln("Dexterity"); console.writeln("Dexterity");
this_obj.dexterity--; this_obj.dexterity--;
break; break;
case '4': case '4':
/*console.*/writeln("Luck"); console.writeln("Luck");
this_obj.luck--; this_obj.luck--;
break; break;
case '5': case '5':
/*console.*/writeln("Constitution"); console.writeln("Constitution");
this_obj.constitution--; this_obj.constitution--;
break; break;
case '6': case '6':
/*console.*/writeln("Charisma"); console.writeln("Charisma");
this_obj.charisma--; this_obj.charisma--;
break; break;
case 'Q': case 'Q':
/*console.*/writeln("Quit"); console.writeln("Quit");
return(false); return(false);
} }
return(true); return(true);
...@@ -415,8 +415,8 @@ function Player_chstats() ...@@ -415,8 +415,8 @@ function Player_chstats()
function check(value, name) { function check(value, name) {
if(value < 6) { if(value < 6) {
valid=false; valid=false;
/*console.*/writeln(); console.writeln();
/*console.*/writeln(name+" cannot go below 6"); console.writeln(name+" cannot go below 6");
} }
} }
...@@ -436,16 +436,16 @@ function Player_chstats() ...@@ -436,16 +436,16 @@ function Player_chstats()
orig.constitution=this_obj.constitution; orig.constitution=this_obj.constitution;
orig.charisma=this_obj.charisma; orig.charisma=this_obj.charisma;
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Status Change:"); console.writeln("Status Change:");
/*console.*/writeln("^^^^^^^^^^^^^^"); console.writeln("^^^^^^^^^^^^^^");
/*console.*/writeln("1> Str: "+(this_obj.strength)); console.writeln("1> Str: "+(this_obj.strength));
/*console.*/writeln("2> Int: "+(this_obj.intelligence)); console.writeln("2> Int: "+(this_obj.intelligence));
/*console.*/writeln("3> Dex: "+(this_obj.dexterity)); console.writeln("3> Dex: "+(this_obj.dexterity));
/*console.*/writeln("4> Luk: "+(this_obj.luck)); console.writeln("4> Luk: "+(this_obj.luck));
/*console.*/writeln("5> Con: "+(this_obj.constitution)); console.writeln("5> Con: "+(this_obj.constitution));
/*console.*/writeln("6> Chr: "+(this_obj.charisma)); console.writeln("6> Chr: "+(this_obj.charisma));
/*console.*/writeln(); console.writeln();
check(this_obj.strength,"Strength"); check(this_obj.strength,"Strength");
check(this_obj.intelligence,"Intelligence"); check(this_obj.intelligence,"Intelligence");
check(this_obj.dexterity,"Dexterity"); check(this_obj.dexterity,"Dexterity");
...@@ -455,11 +455,11 @@ function Player_chstats() ...@@ -455,11 +455,11 @@ function Player_chstats()
if(valid) { if(valid) {
console.write("Is this correct? "); console.write("Is this correct? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
return(true); return(true);
} }
else { else {
/*console.*/writeln("No"); console.writeln("No");
restore(this_obj); restore(this_obj);
return(false); return(false);
} }
...@@ -470,18 +470,18 @@ function Player_chstats() ...@@ -470,18 +470,18 @@ function Player_chstats()
console.clear(); console.clear();
while(1) { while(1) {
/*console.*/writeln("Status Change:"); console.writeln("Status Change:");
/*console.*/writeln("@@@@@@@@@@@@@@"); console.writeln("@@@@@@@@@@@@@@");
/*console.*/writeln("You may increase any stat by one,"); console.writeln("You may increase any stat by one,");
/*console.*/writeln("yet you must decrease another by two."); console.writeln("yet you must decrease another by two.");
/*console.*/writeln(); console.writeln();
/*console.*/writeln("1> Str: "+this.strength); console.writeln("1> Str: "+this.strength);
/*console.*/writeln("2> Int: "+this.intelligence); console.writeln("2> Int: "+this.intelligence);
/*console.*/writeln("3> Dex: "+this.dexterity); console.writeln("3> Dex: "+this.dexterity);
/*console.*/writeln("4> Luk: "+this.luck); console.writeln("4> Luk: "+this.luck);
/*console.*/writeln("5> Con: "+this.constitution); console.writeln("5> Con: "+this.constitution);
/*console.*/writeln("6> Chr: "+this.charisma); console.writeln("6> Chr: "+this.charisma);
/*console.*/writeln(); console.writeln();
if(incre(this)) { if(incre(this)) {
if(decre(this)) { if(decre(this)) {
if(ministat(this)) if(ministat(this))
...@@ -498,9 +498,9 @@ function Player_depobank() ...@@ -498,9 +498,9 @@ function Player_depobank()
var tmp=this.gold; var tmp=this.gold;
this.gold -= tmp; this.gold -= tmp;
this.bank += tmp; this.bank += tmp;
/*console.*/writeln(); console.writeln();
console.attributes="HC0"; console.attributes="HC0";
/*console.*/writeln(this.bank+" Steel pieces are in the bank."); console.writeln(this.bank+" Steel pieces are in the bank.");
} }
function Player_withdrawbank() function Player_withdrawbank()
...@@ -508,9 +508,9 @@ function Player_withdrawbank() ...@@ -508,9 +508,9 @@ function Player_withdrawbank()
var tmp=this.bank; var tmp=this.bank;
this.gold += tmp; this.gold += tmp;
this.bank -= tmp; this.bank -= tmp;
/*console.*/writeln(); console.writeln();
console.attributes="HC0"; console.attributes="HC0";
/*console.*/writeln("You are now carrying "+this.gold+" Steel pieces."); console.writeln("You are now carrying "+this.gold+" Steel pieces.");
} }
function Player_heal() function Player_heal()
...@@ -519,23 +519,23 @@ function Player_heal() ...@@ -519,23 +519,23 @@ function Player_heal()
console.clear(); console.clear();
console.attributes="M0"; console.attributes="M0";
/*console.*/writeln("Clerics want "+(8*this.level)+" Steel pieces per wound."); console.writeln("Clerics want "+(8*this.level)+" Steel pieces per wound.");
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("You have "+this.damage+" points of damage to heal."); console.writeln("You have "+this.damage+" points of damage to heal.");
console.attributes="HC0"; console.attributes="HC0";
console.write("How many points do you want healed? "); console.write("How many points do you want healed? ");
// TODO: We need max as default an some way to cancel... // TODO: We need max as default an some way to cancel...
opt=console.getnum(this.damage); opt=console.getnum(this.damage);
if((opt*this.level*8) > this.gold) { if((opt*this.level*8) > this.gold) {
console.attributes="HR0"; console.attributes="HR0";
/*console.*/writeln("Sorry, you do not have enough Steel."); console.writeln("Sorry, you do not have enough Steel.");
opt=0; opt=0;
} }
else if (opt > this.damage) else if (opt > this.damage)
opt = this.damage; opt = this.damage;
this.damage -= opt; this.damage -= opt;
this.gold -= 8*opt*this.level; this.gold -= 8*opt*this.level;
/*console.*/writeln(opt+" hit points healed."); console.writeln(opt+" hit points healed.");
} }
function Player_changemessage() function Player_changemessage()
...@@ -543,17 +543,17 @@ function Player_changemessage() ...@@ -543,17 +543,17 @@ function Player_changemessage()
function getmessage(prompt, msg) function getmessage(prompt, msg)
{ {
while(1) { while(1) {
/*console.*/writeln(); console.writeln();
console.attributes="HC0"; console.attributes="HC0";
/*console.*/writeln(prompt); console.writeln(prompt);
console.write("> "); console.write("> ");
msg=console.getstr(msg, 77, K_EDIT|K_AUTODEL|K_LINE); msg=console.getstr(msg, 77, K_EDIT|K_AUTODEL|K_LINE);
console.write("Is this correct? "); console.write("Is this correct? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
return(msg); return(msg);
} }
/*console.*/writeln("No"); console.writeln("No");
} }
} }
...@@ -587,7 +587,7 @@ function Player_create(isnew) ...@@ -587,7 +587,7 @@ function Player_create(isnew)
this.bcry=""; this.bcry="";
this.gaspd=""; this.gaspd="";
this.winmsg=""; this.winmsg="";
/*console.*/writeln(); console.writeln();
this.pseudo=user.alias; this.pseudo=user.alias;
this.vic(); this.vic();
this.battles = Config.BATTLES_PER_DAY; this.battles = Config.BATTLES_PER_DAY;
...@@ -596,7 +596,7 @@ function Player_create(isnew) ...@@ -596,7 +596,7 @@ function Player_create(isnew)
} }
console.write("What sex would you like your character to be? (M/F) "); console.write("What sex would you like your character to be? (M/F) ");
this.sex=dgn_getkeys("MF"); this.sex=dgn_getkeys("MF");
/*console.*/writeln(); console.writeln();
} }
function Player_gamble() function Player_gamble()
...@@ -605,40 +605,40 @@ function Player_gamble() ...@@ -605,40 +605,40 @@ function Player_gamble()
var okea=0; var okea=0;
if(this.fighs==0) if(this.fighs==0)
/*console.*/writeln("The Shooting Gallery is closed until tomorrow!"); console.writeln("The Shooting Gallery is closed until tomorrow!");
else { else {
console.clear(); console.clear();
/*console.*/writeln(" Welcome to the Shooting Gallery"); console.writeln(" Welcome to the Shooting Gallery");
/*console.*/writeln(" Maximum wager is 25,000 Steel pieces"); console.writeln(" Maximum wager is 25,000 Steel pieces");
/*console.*/writeln(); console.writeln();
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("How many Steel pieces do you wish to wager? "); console.writeln("How many Steel pieces do you wish to wager? ");
console.attributes="W0"; console.attributes="W0";
realgold=console.getnum(25000); realgold=console.getnum(25000);
if(realgold > this.gold) { if(realgold > this.gold) {
/*console.*/writeln(); console.writeln();
/*console.*/writeln("You do not have enough Steel!"); console.writeln("You do not have enough Steel!");
} }
if(realgold != 0 && this.gold >= realgold && realgold <= 25000 && realgold >= 1) { if(realgold != 0 && this.gold >= realgold && realgold <= 25000 && realgold >= 1) {
okea=random(99)+1; okea=random(99)+1;
if(okea <= 3) { if(okea <= 3) {
realgold *= 100; realgold *= 100;
this.gold += realgold; this.gold += realgold;
/*console.*/writeln("You shot all the targets and win "+realgold+" Steel pieces!"); console.writeln("You shot all the targets and win "+realgold+" Steel pieces!");
} }
else if (okea <= 15) { else if (okea <= 15) {
realgold *= 10; realgold *= 10;
this.gold += realgold; this.gold += realgold;
/*console.*/writeln("You shot 50% of the targets and win "+realgold+" Steel pieces!"); console.writeln("You shot 50% of the targets and win "+realgold+" Steel pieces!");
} }
else if (okea <= 30) { else if (okea <= 30) {
realgold *= 3; realgold *= 3;
this.gold += realgold; this.gold += realgold;
/*console.*/writeln("You shot 25% of the targets and win "+realgold+" Steel pieces!"); console.writeln("You shot 25% of the targets and win "+realgold+" Steel pieces!");
} }
else { else {
this.gold -= realgold; this.gold -= realgold;
/*console.*/writeln("Sorry, You Hath Lost!"); console.writeln("Sorry, You Hath Lost!");
} }
} }
} }
...@@ -650,37 +650,37 @@ function Player_training() ...@@ -650,37 +650,37 @@ function Player_training()
function dotrain(this_obj, attr) function dotrain(this_obj, attr)
{ {
/*console.*/writeln(attr); console.writeln(attr);
console.write("Are you sure? "); console.write("Are you sure? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
this_obj.gold -= upcost; this_obj.gold -= upcost;
return(1); return(1);
} }
/*console.*/writeln("No"); console.writeln("No");
return(0); return(0);
} }
if(this.fights < 1) if(this.fights < 1)
/*console.*/writeln("The Training Grounds are closed until tomorrow!"); console.writeln("The Training Grounds are closed until tomorrow!");
else { else {
console.clear(); console.clear();
/*console.*/writeln("Training Grounds"); console.writeln("Training Grounds");
/*console.*/writeln("%%%%%%%%%%%%%%%%"); console.writeln("%%%%%%%%%%%%%%%%");
/*console.*/writeln("Each characteristic you wish to upgrade"); console.writeln("Each characteristic you wish to upgrade");
/*console.*/writeln("will cost 1,000,000 Steel pieces per point."); console.writeln("will cost 1,000,000 Steel pieces per point.");
/*console.*/writeln(); console.writeln();
console.write("Do you wish to upgrade a stat? "); console.write("Do you wish to upgrade a stat? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
if(this.gold < upcost) if(this.gold < upcost)
/*console.*/writeln("Sorry, but you do not have enough Steel!"); console.writeln("Sorry, but you do not have enough Steel!");
else { else {
/*console.*/writeln(); console.writeln();
/*console.*/writeln("1> Strength 2> Intelligence"); console.writeln("1> Strength 2> Intelligence");
/*console.*/writeln("3> Dexterity 4> Luck"); console.writeln("3> Dexterity 4> Luck");
/*console.*/writeln("5> Constitution 5> Charisma"); console.writeln("5> Constitution 5> Charisma");
/*console.*/writeln(); console.writeln();
console.attributes="HY0"; console.attributes="HY0";
console.write("Which stat do you wish to increase? "); console.write("Which stat do you wish to increase? ");
console.attributes="W0"; console.attributes="W0";
...@@ -707,7 +707,7 @@ function Player_training() ...@@ -707,7 +707,7 @@ function Player_training()
} }
} }
else else
/*console.*/writeln("No"); console.writeln("No");
} }
} }
...@@ -750,29 +750,29 @@ function Player_battle(opp) ...@@ -750,29 +750,29 @@ function Player_battle(opp)
} }
if(opp.status==Status.MONSTER) if(opp.status==Status.MONSTER)
opp.gold=opp.gold * supplant(); opp.gold=opp.gold * supplant();
/*console.*/writeln(); console.writeln();
if(won && opp.gold > 0) if(won && opp.gold > 0)
/*console.*/writeln("You take "+opp.his+" "+opp.gold+" Steel pieces."); console.writeln("You take "+opp.his+" "+opp.gold+" Steel pieces.");
else { else {
if(opp.status != Status.MONSTER && this_obj.gold > 0) if(opp.status != Status.MONSTER && this_obj.gold > 0)
/*console.*/writeln(opp.He+" takes your "+this_obj.gold+" Steel pieces"); console.writeln(opp.He+" takes your "+this_obj.gold+" Steel pieces");
} }
winner.gold += loser.gold; winner.gold += loser.gold;
loser.gold = 0; loser.gold = 0;
if(opp.status != Status.MONSTER) { if(opp.status != Status.MONSTER) {
/*console.*/writeln(); console.writeln();
console.attributes="G0"; console.attributes="G0";
if(won) { if(won) {
/*console.*/writeln("The Last Words "+loser.he+" utters are..."); console.writeln("The Last Words "+loser.he+" utters are...");
/*console.*/writeln(); console.writeln();
/*console.*/writeln(opp.gaspd); console.writeln(opp.gaspd);
/*console.*/writeln(); console.writeln();
} }
else { else {
/*console.*/writeln("The Last Words You Hear Are..."); console.writeln("The Last Words You Hear Are...");
/*console.*/writeln(); console.writeln();
/*console.*/writeln(opp.winmsg); console.writeln(opp.winmsg);
/*console.*/writeln(); console.writeln();
} }
winner.wins++; winner.wins++;
loser.losses++; loser.losses++;
...@@ -785,7 +785,7 @@ function Player_battle(opp) ...@@ -785,7 +785,7 @@ function Player_battle(opp)
loser.weapon=winner.weapon; loser.weapon=winner.weapon;
winner.weapon=tmpweap; winner.weapon=tmpweap;
console.attributes="G0"; console.attributes="G0";
/*console.*/writeln(wstr+" Hath Taken "+lstr+" Weapon."); console.writeln(wstr+" Hath Taken "+lstr+" Weapon.");
} }
if(loser.armour.power > winner.armour.power) { if(loser.armour.power > winner.armour.power) {
var tmparm=loser.armour; var tmparm=loser.armour;
...@@ -793,7 +793,7 @@ function Player_battle(opp) ...@@ -793,7 +793,7 @@ function Player_battle(opp)
loser.armour=winner=armour; loser.armour=winner=armour;
winner.armour=tmparm; winner.armour=tmparm;
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln(wstr+" Hath Taken "+lstr+" Armour."); console.writeln(wstr+" Hath Taken "+lstr+" Armour.");
} }
if(Lock(logfile.name, bbs.node_num, true, 1)) { if(Lock(logfile.name, bbs.node_num, true, 1)) {
if(logfile.open("a",true)) { if(logfile.open("a",true)) {
...@@ -803,16 +803,16 @@ function Player_battle(opp) ...@@ -803,16 +803,16 @@ function Player_battle(opp)
Unlock(logfile.name); Unlock(logfile.name);
} }
else { else {
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Cannot lock "+logfile.name+" for write!"); console.writeln("Cannot lock "+logfile.name+" for write!");
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
} }
} }
opp.experience *= supplant(); opp.experience *= supplant();
winner.experience += opp.experience; winner.experience += opp.experience;
if(won || opp.status != Status.MONSTER) if(won || opp.status != Status.MONSTER)
/*console.*/writeln(wstr+" obtain "+opp.experience+" exp points."); console.writeln(wstr+" obtain "+opp.experience+" exp points.");
if(!(opp.status & Status.MONSTER)) if(!(opp.status & Status.MONSTER))
opp.save(); opp.save();
} }
...@@ -821,38 +821,38 @@ function Player_battle(opp) ...@@ -821,38 +821,38 @@ function Player_battle(opp)
{ {
var rnd; var rnd;
/*console.*/writeln(); console.writeln();
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("The Vile Enemy Dropped Something!"); console.writeln("The Vile Enemy Dropped Something!");
console.write("Do you want to get it? "); console.write("Do you want to get it? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
/*console.*/writeln("Yes"); console.writeln("Yes");
rnd=random(100)+1; rnd=random(100)+1;
if(rnd<10) { if(rnd<10) {
var i; var i;
for(i=1; i<weapon.length; i++) { for(i=1; i<weapon.length; i++) {
if(weapon[i].attack+weapon[i].power > this_obj.weapon.attack+this_obj.weapon.power) { if(weapon[i].attack+weapon[i].power > this_obj.weapon.attack+this_obj.weapon.power) {
/*console.*/writeln("You have found a "+weapon[i].name+"."); console.writeln("You have found a "+weapon[i].name+".");
this_obj.weapon=new Weapon(weapon[i].name, weapon[i].attack, weapon[i].power, weapon[i].cost); this_obj.weapon=new Weapon(weapon[i].name, weapon[i].attack, weapon[i].power, weapon[i].cost);
break; break;
} }
} }
if(i>=weapon.length) { if(i>=weapon.length) {
/*console.*/writeln("It's gone!!!"); console.writeln("It's gone!!!");
} }
// TODO: Next weapon! // TODO: Next weapon!
} }
else if(rnd < 40) { else if(rnd < 40) {
this_obj.gold += 40; this_obj.gold += 40;
/*console.*/writeln("You have come across 40 Steel pieces"); console.writeln("You have come across 40 Steel pieces");
} }
else { else {
/*console.*/writeln("It's gone!!!!"); console.writeln("It's gone!!!!");
} }
} }
else { else {
/*console.*/writeln("No"); console.writeln("No");
/*console.*/writeln("I wonder what it was?!?"); console.writeln("I wonder what it was?!?");
} }
} }
...@@ -864,16 +864,16 @@ function Player_battle(opp) ...@@ -864,16 +864,16 @@ function Player_battle(opp)
if(roll<1.5) { if(roll<1.5) {
switch(random(4)) { switch(random(4)) {
case 0: case 0:
/*console.*/writeln("Swish you missed!"); console.writeln("Swish you missed!");
break; break;
case 1: case 1:
/*console.*/writeln("HA HA! "+opp.he+" dodges your swing!"); console.writeln("HA HA! "+opp.he+" dodges your swing!");
break; break;
case 2: case 2:
/*console.*/writeln("CLANG, The attack is blocked"); console.writeln("CLANG, The attack is blocked");
break; break;
case 3: case 3:
/*console.*/writeln("You Fight vigorously and miss!"); console.writeln("You Fight vigorously and miss!");
break; break;
} }
} }
...@@ -886,29 +886,29 @@ function Player_battle(opp) ...@@ -886,29 +886,29 @@ function Player_battle(opp)
opp.damage += roll; opp.damage += roll;
switch(random(3)) { switch(random(3)) {
case 0: case 0:
/*console.*/writeln(format("You sliced %s for %1.0f.",opp.him,roll)); console.writeln(format("You sliced %s for %1.0f.",opp.him,roll));
break; break;
case 1: case 1:
/*console.*/writeln(format("You made contact to %s body for %1.0f.",opp.his,roll)); console.writeln(format("You made contact to %s body for %1.0f.",opp.his,roll));
break; break;
case 2: case 2:
/*console.*/writeln(format("You hacked %s for %1.0f.",opp.him,roll)); console.writeln(format("You hacked %s for %1.0f.",opp.him,roll));
break; break;
} }
if(opp.hps <= opp.damage) { if(opp.hps <= opp.damage) {
/*console.*/writeln(); console.writeln();
switch(random(4)) { switch(random(4)) {
case 0: case 0:
/*console.*/writeln("A Painless Death!"); console.writeln("A Painless Death!");
break; break;
case 1: case 1:
/*console.*/writeln(opp.He+" Had died!"); console.writeln(opp.He+" Had died!");
break; break;
case 2: case 2:
/*console.*/writeln("A Smooth killing!"); console.writeln("A Smooth killing!");
break; break;
case 3: case 3:
/*console.*/writeln(opp.He+" has gone to the Abyss!"); console.writeln(opp.He+" has gone to the Abyss!");
break; break;
} }
if(random(100)<30) if(random(100)<30)
...@@ -926,7 +926,7 @@ function Player_battle(opp) ...@@ -926,7 +926,7 @@ function Player_battle(opp)
roll=opp.tohit(this_obj); roll=opp.tohit(this_obj);
if(roll < 1.5) { if(roll < 1.5) {
console.attributes="G0"; console.attributes="G0";
/*console.*/writeln(opp.His+" attack tears your armour."); console.writeln(opp.His+" attack tears your armour.");
} }
else { else {
roll=opp.damageroll(this_obj); roll=opp.damageroll(this_obj);
...@@ -936,30 +936,30 @@ function Player_battle(opp) ...@@ -936,30 +936,30 @@ function Player_battle(opp)
roll=1; roll=1;
switch(random(3)) { switch(random(3)) {
case 0: case 0:
/*console.*/writeln(format("%s hammered you for %1.0f",opp.He,roll)); console.writeln(format("%s hammered you for %1.0f",opp.He,roll));
break; break;
case 1: case 1:
/*console.*/writeln(format("%s swung and hit for %1.0f",opp.He,roll)); console.writeln(format("%s swung and hit for %1.0f",opp.He,roll));
break; break;
case 2: case 2:
/*console.*/writeln(format("You are surprised when %s hits you for %1.0f",opp.he,roll)); console.writeln(format("You are surprised when %s hits you for %1.0f",opp.he,roll));
break; break;
} }
this_obj.damage += roll; this_obj.damage += roll;
if(this_obj.damage >= this_obj.hps) { if(this_obj.damage >= this_obj.hps) {
/*console.*/writeln(); console.writeln();
switch(random(4)) { switch(random(4)) {
case 0: case 0:
/*console.*/writeln("Return This Knight To Huma's Breast...."); console.writeln("Return This Knight To Huma's Breast....");
break; break;
case 1: case 1:
/*console.*/writeln("You Hath Been Slain!!"); console.writeln("You Hath Been Slain!!");
break; break;
case 2: case 2:
/*console.*/writeln("Return Soon Brave Warrior!"); console.writeln("Return Soon Brave Warrior!");
break; break;
case 3: case 3:
/*console.*/writeln("May Palidine Be With You!"); console.writeln("May Palidine Be With You!");
break; break;
} }
endofbattle(this_obj,opp,this_obj); endofbattle(this_obj,opp,this_obj);
...@@ -985,42 +985,42 @@ function Player_battle(opp) ...@@ -985,42 +985,42 @@ function Player_battle(opp)
} }
while(this.damage < this.hps && opp.damage < opp.hps) { while(this.damage < this.hps && opp.damage < opp.hps) {
/*console.*/writeln(); console.writeln();
console.attributes="HY0"; console.attributes="HY0";
/*console.*/writeln("You are attacked by a "+opp.pseudo); console.writeln("You are attacked by a "+opp.pseudo);
for(option='?'; option=='?'; ) { for(option='?'; option=='?'; ) {
console.attributes="HB0"; console.attributes="HB0";
console.write("Combat ("+(this.hps-this.damage)+"): (B,F,S): "); console.write("Combat ("+(this.hps-this.damage)+"): (B,F,S): ");
option=dgn_getkeys("BFS?"); option=dgn_getkeys("BFS?");
if(option=="?") { if(option=="?") {
/*console.*/writeln("Help"); console.writeln("Help");
/*console.*/writeln(); console.writeln();
/*console.*/writeln(); console.writeln();
/*console.*/writeln("(B)attle your opponent."); console.writeln("(B)attle your opponent.");
/*console.*/writeln("(F)lee from your opponent."); console.writeln("(F)lee from your opponent.");
/*console.*/writeln("(S)tatus check"); console.writeln("(S)tatus check");
} }
} }
switch(option) { switch(option) {
case 'B': case 'B':
/*console.*/writeln("Battle"); console.writeln("Battle");
attackmodes(this); attackmodes(this);
break; break;
case 'S': case 'S':
/*console.*/writeln("Stats"); console.writeln("Stats");
this.statshow(); this.statshow();
break; break;
case 'F': case 'F':
/*console.*/writeln("Flee"); console.writeln("Flee");
if(random(4)+1 + this.dexterity > opp.dexterity) { if(random(4)+1 + this.dexterity > opp.dexterity) {
/*console.*/writeln(); console.writeln();
console.attributes="G0"; console.attributes="G0";
/*console.*/writeln("You Ride away on a Silver Dragon."); console.writeln("You Ride away on a Silver Dragon.");
return; return;
} }
else { else {
console.attributes="G0"; console.attributes="G0";
/*console.*/writeln("You cannot escape!."); console.writeln("You cannot escape!.");
bmode(this); bmode(this);
} }
break; break;
...@@ -1032,22 +1032,22 @@ function Player_changename() ...@@ -1032,22 +1032,22 @@ function Player_changename()
{ {
var oldpseudo=this.pseudo; var oldpseudo=this.pseudo;
/*console.*/writeln(); console.writeln();
console.attributes="HC0"; console.attributes="HC0";
/*console.*/writeln("Your family crest has been stolen, they"); console.writeln("Your family crest has been stolen, they");
/*console.*/writeln("inscribe a new one with the name..."); console.writeln("inscribe a new one with the name...");
console.write("> "); console.write("> ");
this.pseudo=console.getstr(this.pseudo, 30, K_EDIT|K_AUTODEL|K_LINE); this.pseudo=console.getstr(this.pseudo, 30, K_EDIT|K_AUTODEL|K_LINE);
/*console.*/writeln(); console.writeln();
/*console.*/write("Are you sure? "); console.write("Are you sure? ");
if(dgn_getkeys("YN")=='Y') { if(dgn_getkeys("YN")=='Y') {
// TODO: No duplicate names! // TODO: No duplicate names!
if(this.pseudo=='') if(this.pseudo=='')
this.pseudo=oldpseudo; this.pseudo=oldpseudo;
/*console.*/writeln("Yes"); console.writeln("Yes");
} }
else { else {
/*console.*/writeln("No"); console.writeln("No");
this.pseudo=oldpseudo; this.pseudo=oldpseudo;
} }
} }
...@@ -1077,17 +1077,17 @@ function getplayerlist(filename) ...@@ -1077,17 +1077,17 @@ function getplayerlist(filename)
var list=new Array(); var list=new Array();
if(!Lock(players.name, bbs.node_num, false, 1)) { if(!Lock(players.name, bbs.node_num, false, 1)) {
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Cannot lock "+players.name+" for read!"); console.writeln("Cannot lock "+players.name+" for read!");
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
return(list); return(list);
} }
if(!players.open("r", true)) { if(!players.open("r", true)) {
Unlock(players.name); Unlock(players.name);
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Cannot open "+players.name+" for read!"); console.writeln("Cannot open "+players.name+" for read!");
/*console.*/writeln(); console.writeln();
console.pause(); console.pause();
return(list); return(list);
} }
......
...@@ -37,7 +37,7 @@ if(weaponfile.open("r", true)) { ...@@ -37,7 +37,7 @@ if(weaponfile.open("r", true)) {
} }
else { else {
console.attributes="HIR0"; console.attributes="HIR0";
/*console.*/writeln(); console.writeln();
/*console.*/writeln("Cannot open weapons file!"); console.writeln("Cannot open weapons file!");
/*console.*/writeln(); console.writeln();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment