diff --git a/xtrn/tw2/enter.ans b/xtrn/tw2/enter.ans new file mode 100644 index 0000000000000000000000000000000000000000..ab5893497158b04dbfa426b2634f6fbadaa26936 --- /dev/null +++ b/xtrn/tw2/enter.ans @@ -0,0 +1,8 @@ +[2J[1;35mɹForward View������ͻ[0;34m�[1;34mTradeWars2/JavaScript Sector Invasion[0;34m���������������ͻ +[1;35m� [30m.[3C[0;37m� [1;37m.[3C[0;37m�[4C[1;30m. [35m�[0;34m�[55C� +[1;35m�[0;37m� � [1;37m. [0;37m� [1;30m. [0;37m�[3C[1;37m. [35m�[0;34m� [1;36mA[0;36mttack[10C[35C[3C[34m� +[1;35m� [37m. [30m.[3C[37m.[6C[30m.[4C[35m�[0;34m� [1;36mI[0;36mnfo on you[37C[6C[34m� +[1;35m�[3C[0;37m�[3C�[3C[1;30m. [37m. [0;37m� [1;35m�[0;34m� [1;36mQ[0;36muit the Game[39C[37m [34m� +[1;35m� [30m. [37m� [30m.[6C[0;37m�[3C[1;30m. [35m�[0;34m� [36mRe[1;36mD[0;36misplay Sector[31C[7C[34m� +[1;35m�[3C[0;37m� [1;37m. [0;37m�[3C�[6C[1;35m�[0;34m�[37m [1;36mR[0;36metreat[47C[34m� +[1;35m��������������������ͼ[0;34m�������������������������������������������������������ͼ[0m diff --git a/xtrn/tw2/players.js b/xtrn/tw2/players.js index 0480bed8798f2fa64996d78335beae7518e68142..ef1f937abd58b03ffa99553dcff4a6e84865c9eb 100644 --- a/xtrn/tw2/players.js +++ b/xtrn/tw2/players.js @@ -195,8 +195,8 @@ function AttackPlayer() var j; console.writeln("You destroyed the ship and salvaged these cargo holds:"); - var holds=new Array(Commodities.length+1); - for(i=0; i<holds.length+1; i++) + var holds=new Array(Commodities.length); + for(i=0; i<holds.length; i++) holds[i]=0; for(i=0; i<otherplayer.Holds; i++) { var limit=0; @@ -549,9 +549,9 @@ function DoBattle(opp, otherteam) console.writeln("You lost "+lost+" fighter(s), "+player.Fighters+" remain."); if(opp.Fighters > 0) - console.write("You destroyed "+killed+" enemy fighters, "+opp.Fighters+" remain."); + console.writeln("You destroyed "+killed+" enemy fighters, "+opp.Fighters+" remain."); else - console.write("You destroyed all of the enemy fighters."); + console.writeln("You destroyed all of the enemy fighters."); return(killed); } } diff --git a/xtrn/tw2/sectors.js b/xtrn/tw2/sectors.js index b2f505c61b067ab92510c1901bd256466635467c..f4e2092b20bd28fc7ae23a68a88bc3b2d53cd421 100644 --- a/xtrn/tw2/sectors.js +++ b/xtrn/tw2/sectors.js @@ -79,13 +79,13 @@ function EnterSector() /* 20000 */ console.attributes="Y"; sector=db.read(Settings.DB,'sectors.'+player.Sector,LOCK_READ); - DisplaySector(sector,player.Sector,false); if(sector.FighterOwner > 0) { otherplayer=players.Get(sector.FighterOwner); if(otherplayer.TeamNumber > 0) fighterteam=otherplayer.TeamNumber; } while(sector.FighterOwner != player.Record && sector.Fighters > 0 && fighterteam != player.TeamNumber) { + DisplaySector(sector,player.Sector,false,'enter.ans'); console.writeln("You have to destroy the fighters before you can enter this sector."); console.writeln("Fighters: "+player.Fighters+" / "+sector.Fighters); console.write("Option? (A,D,I,Q,R,?):? "); @@ -111,7 +111,7 @@ function EnterSector() /* 20000 */ case 'D': console.writeln("<Display>"); sector=db.read(Settings.DB,'sectors.'+player.Sector,LOCK_READ); - DisplaySector(sector,player.Sector,false); + DisplaySector(sector,player.Sector,false,'enter.ans'); break; case 'I': console.writeln("<Info>"); @@ -198,10 +198,11 @@ function EnterSector() /* 20000 */ console.writeln("Invalid command. ? = Help"); } } + DisplaySector(sector,player.Sector,false,'main.ans'); return(true); } -function DisplaySector(sector, secnum, helponly) +function DisplaySector(sector, secnum, helponly, mainfname) { var i; var count=0; @@ -215,7 +216,7 @@ function DisplaySector(sector, secnum, helponly) } if(user.settings&USER_ANSI) { - console.printfile(fname("main.ans")); + console.printfile(fname(mainfname)); if(sector.Port > 0) console.printfile(fname("port.ans")); if(sector.Planet > 0) diff --git a/xtrn/tw2/tw2.js b/xtrn/tw2/tw2.js index a8deaa7456f00d9175e3e8ce0a1d2a9a349037cb..6e98ada5f67819bc1b234a4b849c79e2d1b84708 100644 --- a/xtrn/tw2/tw2.js +++ b/xtrn/tw2/tw2.js @@ -85,7 +85,7 @@ function Menu(sector) case 'D': console.writeln("<Display>"); sector=db.read(Settings.DB,'sectors.'+player.Sector,LOCK_READ); - DisplaySector(sector,player.Sector,false); + DisplaySector(sector,player.Sector,false,'main.ans'); continue; case 'E': if(user.level < 90) @@ -138,7 +138,7 @@ function Menu(sector) console.crlf(); if(user.settings&USER_ANSI) { sector=db.read(Settings.DB,'sectors.'+player.Sector,LOCK_READ); - DisplaySector(sector,player.Sector,true); + DisplaySector(sector,player.Sector,true,'main.ans'); } else console.printfile(fname("main.asc"));