Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
theflyingape committed Feb 24, 2018
1 parent 4bbe754 commit 6dcdc82
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 39 deletions.
6 changes: 3 additions & 3 deletions build/etc/dankdomain.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
Expand Down Expand Up @@ -287,4 +287,4 @@
]
}
}
}
}
46 changes: 28 additions & 18 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand All @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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}'`)
Expand Down Expand Up @@ -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()
}

Expand Down Expand Up @@ -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')
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/tty/hall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ')
Expand All @@ -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)
}
Expand All @@ -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 ')
Expand All @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion src/tty/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
44 changes: 31 additions & 13 deletions src/tty/naval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
}
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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}`

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 6dcdc82

Please sign in to comment.