diff --git a/build/etc/dankdomain.json b/build/etc/dankdomain.json index 5c03cd1a..ad85b9c9 100644 --- a/build/etc/dankdomain.json +++ b/build/etc/dankdomain.json @@ -164,8 +164,8 @@ "specialty": "Skillful Scroll/Steal", "description": [ "A Rogue is similar to a Thief class with a backstab, poison, and stealing.", - "But, their advantage lies in their effective use of magic scrolls.", - "Rogues can achieve better than average abilities across the board and", + "Their advantage lies with effective use of magic scrolls.", + "Rogues can achieve better than average abilities, and also", "receive an extra bonus in Charisma per experience level." ] }, @@ -287,4 +287,4 @@ ] } } -} \ No newline at end of file +} diff --git a/src/common.ts b/src/common.ts index 9d597ee8..8e790002 100644 --- a/src/common.ts +++ b/src/common.ts @@ -551,12 +551,10 @@ export function checkXP(rpc: active, cb: Function): boolean { } let eligible = rpc.user.level < sysop.level / 2 let bonus = false - let jumped = 0 let i: number - while (rpc.user.xp >= experience(rpc.user.level, undefined, rpc.user.int)) { + while (rpc.user.xp >= experience(rpc.user.level, undefined, rpc.user.int) && rpc.user.level < sysop.level) { rpc.user.level++ - jumped++ if (rpc.user.level == Access.name[rpc.user.access].promote) { let title = Object.keys(Access.name).indexOf(rpc.user.access) @@ -632,6 +630,8 @@ export function checkXP(rpc: active, cb: Function): boolean { let deed = mydeeds.find((x) => { return x.deed === 'levels' }) if (!deed) deed = mydeeds[mydeeds.push(loadDeed(player.pc, 'levels')[0]) - 1] + let rs = query(`SELECT level FROM Players WHERE id = '${player.id}'`)[0] + let jumped = player.level - rs.level if ((deed && jumped >= deed.value)) { deed.value = jumped sound('outstanding') @@ -641,29 +641,29 @@ export function checkXP(rpc: active, cb: Function): boolean { if (player.level < sysop.level) { xvt.out(xvt.bright, xvt.white, sprintf('%+6d', award.hp), xvt.reset, ' Hit points\n') xvt.waste(125) - if(award.sp) { + if (award.sp) { xvt.out(xvt.bright, xvt.white, sprintf('%+6d', award.sp), xvt.reset, ' Spell points\n') xvt.waste(125) } - if(award.str) { + if (award.str) { xvt.out(xvt.bright, xvt.white, sprintf('%+6d', award.str), xvt.reset, ' Strength\n') xvt.waste(125) } - if(award.int) { + if (award.int) { xvt.out(xvt.bright, xvt.white, sprintf('%+6d', award.int), xvt.reset, ' Intellect\n') xvt.waste(125) } - if(award.dex) { + if (award.dex) { xvt.out(xvt.bright, xvt.white, sprintf('%+6d', award.dex), xvt.reset, ' Dexterity\n') xvt.waste(125) } - if(award.cha) { + if (award.cha) { xvt.out(xvt.bright, xvt.white, sprintf('%+6d', award.cha), xvt.reset, ' Charisma\n') xvt.waste(125) } xvt.out('\n') xvt.waste(125) - if(eligible && bonus) { + if (eligible && bonus) { skillplus(rpc, cb) return true } @@ -1478,16 +1478,17 @@ export function reroll(user: user, dd?: string, level = 1) { // the Ancient Riddle of the Keys export function riddle() { + action('clear') xvt.out(xvt.reset, '\n') if (player.coward) { player.coward = false - xvt.out(xvt.reset, 'Welcome back to play with the rest of us.\n') + xvt.out('Welcome back to play with the rest of us.\n') xvt.waste(2000) } if (player.novice) { - xvt.out(xvt.reset, 'You are no longer a novice. Welcome to the next level of play.\n') + xvt.out('You are no longer a novice. Welcome to the next level of play.\n') player.novice = false player.expert = true xvt.waste(2000) @@ -1550,6 +1551,7 @@ export function riddle() { } } + if (bonus) xvt.out(xvt.reset, '\n') xvt.out(xvt.bright, xvt.cyan, '\nYou have become so powerful that you are now immortal and you leave your \n') xvt.out('worldly possessions behind.\n') loadUser(taxman) @@ -1565,17 +1567,28 @@ export function riddle() { if (max > 2) { music('victory') + const log = `./files/winners.txt` fs.appendFileSync(log, `${player.handle} won on ${date2full(now().date)} - game took ${now().date - sysop.dob + 1} days\n`) + + + loadUser(sysop) + sysop.dob = now().date + 1 + sysop.plays = 0 + saveUser(sysop) + player.wins++ + run(`UPDATE Players set wins=${player.wins} WHERE id='${player.id}'`) reason = 'WON THE GAME !!' xvt.waste(player.emulation === 'XT' ? 4321 : 432) + xvt.out(xvt.reset, '\n') xvt.out(xvt.bright, xvt.yellow, 'CONGRATULATIONS!!' - , xvt.reset, ' You have won the game!\n' + , xvt.reset, ' You have won the game!\n\n' ) - sound('winner', 25) + profile({ jpg:'winner', effect:'fadeInUp' }) + sound('winner', 21) xvt.out(xvt.yellow, 'The board will now reset ') let rs = query(`SELECT id, pid FROM Online WHERE id != '${player.id}'`) @@ -1603,10 +1616,7 @@ export function riddle() { } xvt.out(xvt.reset, '\nHappy hunting tomorrow!\n') - loadUser(sysop) - sysop.dob = now().date + 1 - sysop.plays = 0 - saveUser(sysop) + sound('winner', 51) xvt.hangup() } @@ -1916,7 +1926,7 @@ export function logoff() { , xvt.reset, '\n' ) xvt.waste(1965) - if (player.today) + if (player.today && player.level > 1) music(online.hp > 0 ? 'logoff' : 'death') } } diff --git a/src/tty/hall.ts b/src/tty/hall.ts index 5f31169d..0941f8ea 100644 --- a/src/tty/hall.ts +++ b/src/tty/hall.ts @@ -54,7 +54,7 @@ function choice() { for (let best in keys) { let deed = deeds.find((x) => { return x.deed === keys[best] }) if (deed) { - xvt.out(sprintf('%-22s %-11s %6d ' + xvt.out(sprintf('%-22.22s %-11s %6d ' , deed.hero, $.date2full(deed.date).slice(4), deed.value) , $.Deed.name[deed.deed].description) xvt.out('\n ') @@ -78,7 +78,7 @@ function choice() { for (let goat in keys) { let deed = deeds.find((x) => { return x.deed === keys[goat] }) if (deed) { - xvt.out('\n', sprintf('%-22s %-11s %6d ' + xvt.out('\n', sprintf('%-22.22s %-11s %6d ' , deed.hero, $.date2full(deed.date).slice(4), deed.value) , $.Deed.name[deed.deed].description) } @@ -103,7 +103,7 @@ function choice() { for (let hurt in keys) { let deed = deeds.find((x) => { return x.deed === keys[hurt] }) if (deed) { - xvt.out(sprintf('%-22s %-11s %6d ' + xvt.out(sprintf('%-22.22s %-11s %6d ' , deed.hero, $.date2full(deed.date).slice(4), deed.value) , $.Deed.name[deed.deed].description) xvt.out('\n ') @@ -130,7 +130,7 @@ function choice() { `) for (let n in rs) { - xvt.out(sprintf('%-4s %-22s %-9s %3d %4d' + xvt.out(sprintf('%-4s %-22.22s %-9s %3d %4d' , rs[n].id[0] !== '_' ? rs[n].id : ' \u00B7 ', rs[n].handle, rs[n].pc, rs[n].level, rs[n].tw) , '\n') } diff --git a/src/tty/main.ts b/src/tty/main.ts index 7fca4dd0..5e26c4de 100644 --- a/src/tty/main.ts +++ b/src/tty/main.ts @@ -113,7 +113,7 @@ function choice() { xvt.out(xvt.bright, xvt.white) else if (+rs[n].xplevel !== +rs[n].level && +rs[n].xplevel < 2) xvt.out(xvt.faint) - xvt.out(sprintf('%-4s %-22s %-9s %3d ', rs[n].id, rs[n].handle, rs[n].pc, rs[n].level)) + xvt.out(sprintf('%-4s %-22.22s %-9s %3d ', rs[n].id, rs[n].handle, rs[n].pc, rs[n].level)) if (!rs[n].status.length) xvt.out('Alive!') else xvt.out(xvt.faint, rs[n].status === 'jail' ? '#jail#' : '^dead^') xvt.out(' ', rs[n].id === $.player.id ? xvt.bright : xvt.normal) diff --git a/src/tty/naval.ts b/src/tty/naval.ts index c5f4b5cd..d6dda1dc 100644 --- a/src/tty/naval.ts +++ b/src/tty/naval.ts @@ -109,7 +109,6 @@ function choice() { xvt.out('\nYou don\'t have a ship!\n') break } - $.online.altered = true xvt.out('\nIt is a fine day for sailing. You cast your reel into the ocean and feel\n') xvt.out('a gentle tug... ') xvt.waste(600) @@ -453,7 +452,7 @@ function Shipyard(suppress = true) { $.player.hull = ship $.player.ram = false $.online.hull = $.player.hull - $.online.altered = true + $.run(`UPDATE Players set hull=${ship},ram=0 WHERE id='${$.player.id}'`) xvt.out(`\nYou now have a brand new ${$.player.hull} hull point ship, with no ram.\n`) $.sound('boat') } @@ -523,6 +522,7 @@ function Shipyard(suppress = true) { $.player.cannon += buy $.beep() xvt.out(`\nCannons = ${$.player.cannon}\n`) + $.run(`UPDATE Players set cannon=${$.player.cannon} WHERE id='${$.player.id}'`) } Shipyard() return @@ -560,6 +560,7 @@ function Shipyard(suppress = true) { $.player.ram = true $.beep() xvt.out(`\nYou now have a ram.\n`) + $.run(`UPDATE Players set ram=1 WHERE id='${$.player.id}'`) } Shipyard() return @@ -620,7 +621,7 @@ function BattleUser(nme: active) { $.player.retreats++ xvt.out('\nYou sail away safely out of range.\n') $.saveUser(nme, false, true) - $.online.altered = true + $.run(`UPDATE Players set hull=${$.player.hull},cannon=${$.player.cannon},ram=${+$.player.ram},retreats=${$.player.retreats} WHERE id='${$.player.id}'`) $.log(nme.user.id, `\n${$.player.handle}, the coward, sailed away from you.`) menu() return @@ -632,9 +633,11 @@ function BattleUser(nme: active) { if ($.dice(50 + nme.int / 2) > 100 * nme.hull / (nme.hull + $.online.hull)) { xvt.out(`\n${$.who(nme, 'He')}quickly outmaneuvers your ship.\n`) xvt.out(xvt.cyan, 'You yell at your helmsman, "', xvt.reset, - [ 'Aim for the head, not the tail!' - , 'I said port, bastards, not starboard!' - , 'Whose side are you on anyways?!' ][$.dice(3) - 1] + [ 'Your aim is going to kill us all!' + , 'I said port, bastard, not starboard!' + , 'Get me my brown pants!', + , 'Someone throw this traitor overboard!', + , 'She\'s turning onto US now!' ][$.dice(5) - 1] , xvt.cyan, '"\n') xvt.waste(600) } @@ -653,7 +656,10 @@ function BattleUser(nme: active) { else { $.sound('oops') xvt.out('\nYour first mate cries back, \"But we don\'t have a ram!\"\n') - xvt.waste(500) + xvt.waste(2000) + $.sound('fire', 8) + xvt.out('You shoot your first mate.\n') + xvt.waste(800) } if (him()) { menu() @@ -706,19 +712,28 @@ function BattleUser(nme: active) { } booty.value += nme.user.coin.value $.saveUser(nme, false, true) - $.online.altered = true } function you(): boolean { let result = fire($.online, nme) - if (nme.hull > 0) + if (nme.hull > 0) { + if ($.dice(10) == 1) { + xvt.out(xvt.cyan, 'You call out to your crew, "', xvt.reset, + [ 'Fire at crest to hit the best!' + , 'Crying will not save you!' + , 'Look alive, or I\'ll kill you first!', + , 'Get me my red shirt!', + , 'Y\'all fight like the will-o-wisp!' ][$.dice(5) - 1] + , xvt.cyan, '"\n') + xvt.waste(600) + } return false + } booty() return true } function him(): boolean { - $.online.altered = true if (!nme.user.cannon && !nme.user.ram) { xvt.out('They are defenseless and attempt to flee . . . ') xvt.waste(1000) @@ -738,6 +753,7 @@ function BattleUser(nme: active) { ram(nme, $.online) if ($.online.hull < 1) { + $.online.altered = true $.log(nme.user.id, `\nYou sank ${$.player.handle}'s ship!`) $.reason=`sunk by ${nme.user.handle}` @@ -833,9 +849,11 @@ function MonsterHunt() { if ($.dice(50 + monsters[mon].int / 2) > 100 * sm.hull / (sm.hull + $.online.hull)) { xvt.out('\nIt quickly outmaneuvers your ship.\n') xvt.out(xvt.cyan, 'You yell at your helmsman, "', xvt.reset, - [ 'Aim for the head, not the tail!' - , 'I said starboard, bitches, not port!' - , 'Whose side are you on anyways?!' ][$.dice(3) - 1] + [ 'Not the tail, aim for the beastie\'s head!' + , 'I said starboard, bitch, not port!' + , 'Look alive, or it\'ll be fine dining yer bones!', + , 'Get me my brown pants!', + , 'Whose side are you on anyways?!' ][$.dice(5) - 1] , xvt.cyan, '"\n') xvt.waste(600) }