Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@willxyu
Last active March 27, 2020 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willxyu/6738af926852f3055b5fccea81f95a93 to your computer and use it in GitHub Desktop.
Save willxyu/6738af926852f3055b5fccea81f95a93 to your computer and use it in GitHub Desktop.
cb
var t = {}
t.scripts = ``
t.aliases = ``
t.triggers = `
+trigger
+n cb.deathsights-k-v
+p ^(.*?) has battered (\\w+) to death\\.$
+p ^In accordance with the traditions of the Quisalis Mark, (\\w+) has assassinated (\\w+)\\.$
+do
-en
+trigger
+n cb.deathsights-v-k
+p ^(\\w+) dies screaming under the assault of (.*?)\\'s fire and flame\\.$
+p ^(\\w+) falls to (.*?), (?:his|her) body seared to a crisp by electric energy\\.$
+p ^(\\w+) has bled out, slain by the might of (.*?)\\.$
+p ^(\\w+) is slain by (.*?)\\'s psychic assault\\.$
+p ^(\\w+) has been ruthlessly cut down by the Avenging Arrow Champion\\.$
+p ^(\\w+) dies gasping for breath, asphyxiated by the power of (.*?)\\'s kai\\.$
+do
-en
+trigger
+n cb.deathsights-g
+p ^(\\w+) meets a bloody end, bludgeoned into an unrecognisable mess by a Brighthold watchman\\.$
+do
-en
`
gsr.append('cb',t)
var t = {}
t.aliases = `
`
t.triggers = `
+trigger +n cb.def.already
+p ^You already possess the (.*) defence\\.$
+do
-en
+trigger +n cb.def.gain
+p ^You bring a (curseward) into being to protect you from harm\\.$
+do
-en
`
t.scripts = `
`
gsr.append('cb', t)
var t = {}
t.scripts = `
+script
cb.dragon = typeof cb.dragon !== 'undefined' ? cb.dragon : {}
-script
`
t.aliases = ``
t.triggers = `
+trigger +n cb.dragon.complete
+p ^Reveling in your total mastery of the form, you beat your mighty wings, throw your massive head back, and roar your challenge to the world\\. You are Dragon\\!$
+do
bsend('dragonarmour')
-en
`
gsr.append('cb', t)
var t = {}
t.triggers = ``
t.aliases = ``
t.scripts = `
+script
me = typeof me !== 'undefined' ? me : {} // !self identity
me.affs = {}
me.classwear = {
'Shaman' : {armour: '89660', left: '', right: '', },
}
cb.mydefreport = true
cb.myaffreport = true
cb.gmcp = function(e) {
switch(e) {
case 'Room.Info':
break;
case 'Char.Afflictions.List':
cb.myaffs()
break;
case 'Char.Afflictions.Remove':
cb.myaffremove()
break;
case 'Char.Afflictions.Add':
cb.myaffadd()
break;
case 'Char.Defences.List':
cb.mydefs()
break;
case 'Char.Defences.Add':
cb.mydefadd()
break;
case 'Char.Defences.Remove':
cb.mydefremove()
break;
case 'Char.Status':
cb.mystatus()
break;
default:
break;
}
}
cb.myincrementals = {
'pressure' : true,
'temperedsanguine' : true,
'temperedcholeric' : true,
'temperedmelancholic' : true,
'temperedphlegmatic' : true, }
cb.myaffs = function() {
var incrementals = cb.myincrementals
/*
"List": {
"0": {
"name": "temperedsanguine",
"cure": "EAT GINGER",
"desc": "A tempered sanguine humour causes bleeding to increase over time."
},
"1": {
"name": "lethargy",
"cure": "EAT GINSENG",
"desc": "Lethargy leaves you feeling physically drained, making movement and action harder."
}, */
if (typeof gmcp === 'undefined') { return }
if (typeof gmcp.Char === 'undefined') { return }
if (typeof gmcp.Char.Afflictions === 'undefined') { return }
if (typeof gmcp.Char.Afflictions.List === 'undefined') { return }
var t = cb.copy(gmcp.Char.Afflictions.List)
var s = {}
for (var k in me.affs) { if (incrementals[k]) { s[k] = me.affs[k] } }
me.affs = {}
for (var k in t) {
var aff = t[k]
aff = aff.name
if (incrementals[aff]) {
me.affs[aff] = 1
if (s[aff]) { me.affs[aff] = s[aff] }
} else {
me.affs[aff] = true
}
}
}
cb.myaffremove = function() {
/*
"Remove": { "0": "temperedphlegmatic" } */
if (typeof gmcp === 'undefined') { return }
if (typeof gmcp.Char === 'undefined') { return }
if (typeof gmcp.Char.Afflictions === 'undefined') { return }
if (typeof gmcp.Char.Afflictions.Remove === 'undefined') { return }
var t = cb.copy(gmcp.Char.Afflictions.Remove)
for (var i=0; i<t.length; i++) {
var aff = t[i]
for (var affliction in me.affs) {
if (affliction == aff) {
if (typeof me.affs[affliction] !== 'number') {
delete me.affs[affliction]
} else {
me.affs[affliction] -= 1
if (me.affs[affliction] < 0) { delete me.affs[affliction] }
}
}
}
}
}
cb.myaffadd = function() {
var incrementals = cb.myincrementals
/*
"Add": { "name": "pressure", "cure": "", "desc": "" } */
if (typeof gmcp === 'undefined') { return }
if (typeof gmcp.Char === 'undefined') { return }
if (typeof gmcp.Char.Afflictions === 'undefined') { return }
if (typeof gmcp.Char.Afflictions.Add === 'undefined') { return }
var t = cb.copy(gmcp.Char.Afflictions.Add)
var aff = t.name || ''
if (me.affs[aff]) {
if (typeof me.affs[aff] == 'number') {
me.affs[aff] += 1
} else { /* already exists! */ }
} else {
if (incrementals[aff]) {
me.affs[aff] = 0
} else {
me.affs[aff] = true
}
}
}
cb.mydefs = function() {
if (typeof gmcp === 'undefined') { return }
if (typeof gmcp.Char === 'undefined') { return }
if (typeof gmcp.Char.Defences === 'undefined') { return }
if (typeof gmcp.Char.Defences.List === 'undefined') { return }
me.defs = {}
var t = cb.copy(gmcp.Char.Defences.List)
for (var k in t) {
me.defs[t[k].name] = t[k].desc
}
}
cb.mydefadd = function() {
if (typeof gmcp === 'undefined') { return }
if (typeof gmcp.Char === 'undefined') { return }
if (typeof gmcp.Char.Defences === 'undefined') { return }
if (typeof gmcp.Char.Defences.Add === 'undefined') { return }
var t = gmcp.Char.Defences.Add
me.defs[t.name] = t.desc
if (cb.mydefreport) {
cb.report('Gained <span class="turquoise">defence [<i><span class="cyan">' + t.name + '</span></i>]</span>')
}
}
cb.mydefremove = function() {
if (typeof gmcp === 'undefined') { return }
if (typeof gmcp.Char === 'undefined') { return }
if (typeof gmcp.Char.Defences === 'undefined') { return }
if (typeof gmcp.Char.Defences.Remove === 'undefined') { return }
var t = cb.copy(gmcp.Char.Defences.Remove)
var out = []
for (var k in t) {
if (me.defs[t[k]]) { delete me.defs[t[k]]; out.push(t[k]) }
}
if (cb.mydefreport) {
var s = 'Lost <span class="cyan">defence ['
for (var i=0; i<out.length; i++) {
s += '<i><span class="darkred">' + out[i]
if (i < (out.length -1)) {
s += '</span></i>,'
} else {
s += '</span></i>]</span>' }
}
cb.report(s)
}
}
cb.mystatus = function() {
if (typeof gmcp === 'undefined') { return }
if (typeof gmcp.Char === 'undefined') { return }
if (typeof gmcp.Char.Status === 'undefined') { return }
var oldname = me.name || ''
var oldprof = me.prof || ''
var oldcity = me.city || ''
me.name = gmcp.Char.Status.name
me.prof = gmcp.Char.Status.class
var c = gmcp.Char.Status.city || ''
c = c.replace('(','').replace(')','').replace(/\\d+/g,'')
c = c.trim()
me.city = c
if (me.name != oldname) { }
if (me.prof != oldprof) {
// swap armour
if (me.classwear[me.prof] && me.classwear[me.prof].armour) { bsend('wear ' + me.classwear[me.prof].armour) }
}
if (me.city != oldcity) { }
}
-script
`
gsr.append('cb', t)
var t = {}
t.scripts = `
+script
cb = typeof cb !== 'undefined' ? cb : {}
cb.print = jm.print
cb.comma = ju.commaThis
cb.timestamp = jm.timestamp
cb.copy = ju.clone
cb.rpad = ju.rpad
cb.lpad = ju.lpad
cb.round = ju.round
cb.scroll = function() {
if ($('#output').length) { $('#output').scrollTop(document.getElementById('output').scrollHeight) } }
cb.prefix = '<span class="mute">(<span class="cb">cb</span>): </span>'
cb.report = function(str, noPrefix) {
var p = cb.timestamp()
str = '<span class="cb-outer">[<span class="cb">cb</span>] ' + str + '</span><br >'
cb.print(p + str)
cb.scroll() }
cb.inject = function(rule) { $('body').append('<div class="cb-injected">&shy;<style>' + rule + '</style></div>') }
cb.assignTarget = function(name) {
var name = name.toProperCase()
cb.target = name
cb.report('Target changed to <span class="violent">' + name + '</span>.') }
cb.lookup = function(list, item) {
if (typeof list[item] !== 'undefined') { return list[item] }; return item }
cb.reverse = function(list, item) {
for (var k in list) { if (list[k] == item) { return k } }; return item }
cb.pick = function(list, exclude, andexclude) {
for (var i=0; i<list.length; i++) {
var aff = list[i]
if (!cb.has(aff)) {
if (exclude && exclude == aff) {
} else if (andexclude && andexclude == aff) {} else { return aff } }
}
return undefined }
cb.strike = function(arg) {
switch (arg) {
case 'd':
var str = cb.shaman.attack(cb.target)
bsend(str)
break
default:
break
} }
cb.mpe = function() {
mpe.emptyRegistry()
mpe.make('shaman', 'cb.shaman.priority', 'cb.give', 'aff', cb.has, true)
mpe.attach('shaman', 'cb.take', 'aff', cb.has, true)
}
cb.mpe_off = function() {
$('.mpe-holder').remove()
}
cb.prompt = function() {
if (typeof cb.shaman !== 'undefined') {
if (cb.shaman.p2pBindings) { cb.shaman.p2pBindings = false }
}
}
-script
`
t.triggers = `
+trigger +n cb.login
+p ^Password correct\\. Welcome to Achaea\\.$
+do
cb.shaman.spirits = []
cb.shaman.attunes = []
-en
+trigger +n cb.queue-eqbal
+p ^\\[System\\]\\: Running queued eqbal command\\: (.*)$
+do
var m = matches[1].toLowerCase()
var c = m.split(sp)
for (var k in c) {
if (cb.shaman && c[k].match(cb.shaman.curseRegex)) { cb.shaman.parseCurse(c[k]) }
}
-en
`
t.aliases = `
+alias +n cb.target
+p ^t[ ]+(\\w+)$
+do
cb.assignTarget(matches[1])
-en
+alias +n cb.pk
+p ^pk$
+do
cb.strike('d')
-en
+alias +n cb.mpe+
+p ^mpe$
+do
cb.mpe()
-en
+alias +n cb.mpe-
+p ^mpeo$
+do
cb.mpe_off()
-en
`
t.secondaries = `
styles
gmcp
defensive
tracker
dragon
shaman
mpe
misc
deathsights
`
gsr.register('cb', t)
var t = {}
t.scripts = ``
t.aliases = ``
t.triggers = `
+trigger
+n cb.challenged
+p ^(\\w+) has accepted the challenge to mortal combat issued by (\\w+)\\.$
+do
-en
+trigger
+n cb.balance
+p ^You have recovered balance on all limbs\\.$
+do
if (gm && gm.balTime) {
tagOn(' (<span class="cyan">' + gm.balTime + '</span>s)')
}
-en
+trigger
+n cb.equilibrium
+p ^You have recovered equilibrium\\.$
+do
if (gm && gm.equTime) {
tagOn(' (<span class="violent">' + gm.equTime + '</span>s)')
}
-en
`
gsr.append('cb',t)
mpe = typeof mpe !== 'undefined' ? mpe : {}
mpe.inject = function(rule) { $('body').append('<div class="mpe-style">&shy;<style>' + rule + '</style></div>') }
if ($('.mpe-style').length) { $('.mpe-style').remove() }
mpe.inject(`.mpe-holder {
pointer: cursor;
list-style: none;
width: 230px;
height: 500px;
position: absolute;
right: 4px;
bottom: 14px;
background: rgba( 11, 67, 91, 0.89);
border: 2px solid rgba( 1, 1, 1, 1);
border-radius: 6px;
padding: 6px;
padding-top: 27px;
boxShadow: inset 0 1px 0 rgba(255,255,255,0.5),
0 2px 2px rgba(0,0,0,0.3), 0 0 4px 1px rgba(0,0,0,0.2),
inset 0 3px 2px rgba(255,255,255,0.22),
inset 0 -3px 2px rgba(0,0,0,0.15),
inset 0 20px 10px rgba(255,255,255,0.12),
0 0 4px 1px rgba(0,0,0,0.1), 0 3px 2px rgba(0,0,0,0.2);
z-index: 100; }
`)
mpe.inject('.mpe-true-element { color: rgba( 14, 144, 14, 1); }')
mpe.inject('.mpe-false-element { color: rgba( 178, 67, 91, 1); }')
mpe.inject(`.mpe-element {
font-family: 'Overpass','Fantasque';
font-size: 9pt;
height: 1.2em;
width: 222px;
padding: 0.2em;
border-radius: 3px;
border: 1px solid rgba( 34, 34, 34, 1);
list-style-type: none; }`)
mpe.inject(`.mpe-element:hover {
border: 1px solid rgba( 104, 104, 104, 1); }`)
mpe.inject(`.mpe-element.mpe-true-element:hover {
background: rgba( 27, 96, 66, 0.23);
border: 1px solid rgba( 104, 104, 104, 1); }`)
mpe.inject(`.mpe-element.mpe-false-element:hover {
background: rgba( 96, 27, 53, 0.23);
border: 1px solid rgba( 104, 104, 104, 1); }`)
mpe.functional = function(func) { // remember, please pass me the actual function, not its name
// https://stackoverflow.com/a/9924463
var stripper = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg
var argnames = /([^\s,]+)/g
var fxstr = func.toString().replace(stripper,'')
var result = fxstr.slice(fxstr.indexOf("(")+1, fxstr.indexOf(")")).match(argnames)
return result
}
mpe.remove = function(id) {
if ($('#mpe-'+id).length) { $('#mpe-'+id).remove() }
if (typeof mpe.registry[id] !== 'undefined') {
// retrieve old altered assignment function
var x = mpe.registry[id]
if (typeof x.listeners !== 'undefined') {
for (var k in x.listeners) {
var exec = x.listeners[k]
window[k] = exec
}
}
// if (typeof x.assign !== 'undefined' && x.originalX instanceof Function) { window[x.assign] = x.originalX }
}
delete mpe.registry[id] }
mpe.emptyRegistry = function() {
if (mpe.registry instanceof Object) {
for (var k in mpe.registry) { mpe.remove(k) } }
}
mpe.emptyRegistry()
mpe.registry = []
mpe.make = function(id, anchor, assign, locate, query, evaluateToTrue, x, y, w, h, form) {
var copy = ju.clone // or your cloning facility
var actualA = mpe.namespaceReader(anchor) // window[anchor]
var actualX = mpe.namespaceReader(assign) // window[assign]
var a = copy(actualA)
if (typeof mpe.registry[id] !== 'undefined') {
mpe.remove(id) }
var d = ''
d += '<ul id="mpe-'+id+'" class="mpe-holder mpe-'+id+'" data="'+anchor+'">'
for (var i=0; i<a.length; i++) {
var element = a[i]
d += '<li id="mpe-element-'+id+'-'+element+'" class="mpe-element mpe-element-'+id+' mpe-false-element">'
d += element
d += '</li>'
}
d += '</ul>'
$('body').append(d)
var g = $('#mpe-'+id)
g.sortable({
placeholder: "ui-state-highlight",
stop: function(e, ui) {
var t = ui.item[0].id
t = t.replace('mpe-element-')
var u = mpe.registry[t] || {}
var v = g.toArray()
v = v[0].innerText
v = v.split('\n')
mpe.namespaceReader(anchor, copy(v))
// window[anchor] = copy(v)
// window[anchor] = g.toArray() // console.log(window[anchor])
}
})
g.disableSelection()
g.draggable()
// Register the damned thing
mpe.registry[id] = {
actual : g,
anchor : anchor,
actualA: actualA,
assign : assign,
actualX: actualX,
evaluated: evaluateToTrue,
}
mpe.attach(id, assign, locate, query, evaluateToTrue)
}
mpe.attach = function(id, assign, locate, query, evaluateToTrue) {
// if (!window[assign] instanceof Function) { return }
if (!mpe.namespaceReader(assign) instanceof Function) { return }
var original = mpe.namespaceReader(assign) // window[assign]
// save the original
mpe.registry[id].listeners = mpe.registry[id].listeners || {}
mpe.registry[id].listeners[assign] = original
// window[assign] = function(...args) {
var m = mpe.namespaceReader(assign, function(...args) {
original(...args)
var r = mpe.functional(original)
for (var i=0; i<r.length; i++) {
if (r[i] == locate) {
// console.log(args[0]); console.log(query(args[0])); console.log(evaluateToTrue)
if (query(args[0]) == evaluateToTrue) {
mpe.update(id, args[0], true)
} else {
mpe.update(id, args[0], false)
}
}
}
})
}
mpe.update = function(id, element, value) {
// color changes
var g = $('#mpe-element-'+id+'-'+element)
// console.log(value); console.log('true-element'); console.log(g.hasClass('mpe-true-element')); console.log('false-element'); console.log(g.hasClass('mpe-false-element'))
if (g.hasClass('mpe-false-element') && value == true) {
g.removeClass('mpe-false-element')
g.addClass('mpe-true-element')
} else if (g.hasClass('mpe-true-element') && value == false) {
g.removeClass('mpe-true-element')
g.addClass('mpe-false-element')
}
}
mpe.namespaceReader = function(str, newValue) {
var s = str.split('.')
var parent = window
for (var i=0; i<s.length; i++) {
var n = s[i]
if (parent[n]) {
if (i >= (s.length - 1) && newValue) {
parent[n] = newValue
parent = parent[n]
} else {
parent = parent[n]
}
// console.log(parent)
} else if (i >= (s.length - 1)) {
log('approaching terminus')
return parent
} else {
log('Could not resolve address: ' + str + '.')
return false
}
}
return parent
}
// Test unit
/*
afflictAsPriority = [
'paralysis',
'asthma',
'impatience',
'anorexia',
'dementia',
]
tracked = {
asthma: false,
paralysis: false,
impatience: false,
dementia: false,
anorexia: false,
}
give = function(aff, value) {
tracked[aff] = value
}
remove = function(affliction) {
tracked[affliction] = false
}
have = function(what) {
return tracked[what]
}
mpe.make('MalleableList','afflictAsPriority','give','aff',have,true)
mpe.attach('MalleableList','remove','affliction',have,true)
give('asthma',true)
have('asthma')
setTimeout( function() { give('impatience',true); }, 3100 )
setTimeout( function() { give('asthma', false); }, 5600 )
setTimeout( function() { have('impatience') }, 7000 )
setTimeout( function() { remove('impatience'); }, 8600 )
*/
var t = {}
t.scripts = `
+script
cb.shaman = typeof cb.shaman !== 'undefined' ? cb.shaman : {}
cb.shaman.malign = false
cb.shaman.curseTarget = 'Tysandr'
cb.shaman.bloodTarget = 'Tysandr'
cb.shaman.nextCurse = ''
cb.shaman.nextInvoke = ''
cb.shaman.curseRegex = \/curse \\w+ .*?\/
cb.shaman.swiftcurse = 0
cb.shaman.spirits = []
cb.shaman.attunes = []
cb.shaman.bindings = ['Aspar','Arayan','Maligus','Syvis','Teraile']
cb.shaman.attunements = ['Arayan','Maligus','Teraile']
cb.shaman.bloodletBalance = true
cb.shaman.coagBalance = true
cb.shaman.relapseBalance = true
cb.shaman.p2pBindings = false
cb.shaman.priority = [
'paralysis',
'addiction',
'nausea',
'clumsiness',
'sensitivity',
'healthleech',
'impatience',
'haemophilia',
'asthma',
'stupidity',
'dizziness',
'anorexia',
'weariness',
'recklessness',
'peace',
'dementia',
'agoraphobia',
'masochism',
'manaleech',
'epilepsy',
'claustrophobia',
'paranoia',
]
cb.shaman.curseDictionary = {
'paralysis':'paralyse', 'clumsiness':'clumsy', 'dizziness':'dizzy',
'stupidity':'stupid', 'nausea':'vomiting', 'recklessness':'reckless', }
cb.shaman.spiritp = [
'impatience',
'haemophilia',
'paralysis',
'slickness',
'asthma',
'weariness',
'clumsiness',
'lethargy',
'anorexia',
]
cb.shaman.spiritDictionary = {}
cb.shaman.attack = function(tar) {
var re = cb.targetRegex
var str = ''
var aff = cb.pick(cb.shaman.priority)
var af2 = aff
var afg = cb.pick(cb.shaman.priority, aff)
var afh = cb.pick(cb.shaman.spiritp, aff)
aff = cb.lookup(cb.shaman.curseDictionary, aff)
afg = cb.lookup(cb.shaman.curseDictionary, afg)
afh = cb.lookup(cb.shaman.spiritDictionary, afh)
str += 'queue addclear eqbal '
str += 'stand' + sp
if (cb.keys.curseward) {
str += 'curse target breach' + sp
} else if (cb.shaman.relapseBalance) {
str += 'curse target aff '
str += 'invoke relapse af2' + sp
} else if (cb.shaman.bloodletBalance) {
str += 'curse target aff '
str += 'invoke bloodlet' + sp
} else if (cb.shaman.malign) {
str += 'jinx aff afg target' + sp
} else if (cb.shaman.swiftcurse > 0) {
str += 'swiftcurse target aff' + sp
} else {
str += 'curse target aff '
str += 'invoke coagulation afh' + sp
/*
} else if (cb.shaman.swiftcurse == 0 && cb.count() < 5) {
str += 'swiftcurse' + sp */
}
str += 'discern target' + sp
str += 'clearqueue all' + sp
str = str.replace(' aff',' '+aff)
str = str.replace(' af2',' '+af2)
str = str.replace(' afg',' '+afg)
str = str.replace(' afh',' '+afh)
str = str.replace(re, tar)
return str }
cb.shaman.parseCurse = function(str) {
var coag = false
if (str.match('invoke coagulation ')) { coag = true }
var m = str.split(' ')
cb.shaman.curseTarget = m[1].toProperCase()
cb.shaman.nextCurse = cb.reverse(cb.shaman.curseDictionary, m[2])
if (coag && m[5]) { cb.shaman.nextInvoke = m[5] } }
cb.shaman.convert = function(spirit) {
var t = {
['Aspar, The Iron Handed'] : 'Aspar',
['Arayan, The Healer'] : 'Arayan',
['Maligus, The Cleric'] : 'Maligus',
['Syvis, The Venomous'] : 'Syvis',
['Teraile, The Swordsman'] : 'Teraile',
}
if (t[spirit]) { return t[spirit] } else { return spirit } }
-script
`
t.triggers = `
+trigger +n cb.curses.warded
+p ^You try to curse (\\w+), but (?:he|she) is warded\\.$
+do
cb.keys.curseward = true
-en
+trigger +n cb.curses.breached
+p ^(\\w+)'s curseward shatters\\!$
+p ^Your attempt to breach finds no curseward\\.$
+do
if (matches[1] == target) { cb.keys.curseward = false } // !important
-en
+trigger +n cb.curses.breached
+p ^Your attempt to breach finds no curseward\\.$
+do
cb.keys.curseward = false
-en
+trigger +n cb.curses.cursing
+p ^You point an imperious finger at (\\w+)\.$
+do
if (matches[1] == cb.shaman.curseTarget) { cb.give(cb.shaman.nextCurse) }
-en
+trigger +n cb.curses.jinxing
+p ^Summoning your malign power, you direct a twin assault of the curses (.*?) and (.*?) at (\\w+)\.$
+do
if (matches[3] == cb.shaman.curseTarget) {
cb.give(cb.reverse(cb.shaman.curseDictionary, matches[1]))
cb.give(cb.reverse(cb.shaman.curseDictionary, matches[2]))
}
cb.shaman.malign = false
-en
+trigger +n cb.bleeding
+p ^You observe a (small) amount of blood trickling from minor wounds on (\\w+)\\'s body\\.$
+p ^You observe that (\\w+) is bleeding (slightly)\\.$
+do
-en
+trigger +n cb.curses.jinx+
+p ^Your malign power may be unleashed in the form of a jinx against your victim\\.$
+do
cb.shaman.malign = true
-en
+trigger +n cb.curses.jinx-
+p ^Your malign power dissipates back to normal levels\\.$
+p ^You have not built up enough malign power to unleash a jinx\\.$
+do
cb.shaman.malign = false
-en
+trigger +n cb.curses.swift+
+p ^You weave your fingers together, calling upon the swiftcurse to aid you\\.$
+do
cb.shaman.swiftcurse = 10
-en
+trigger +n cb.curses.swift-
+p ^The swiftcurse is empowered with another (\\d+) curses\\.$
+do
cb.shaman.swiftcurse = matches[1]
-en
+trigger +n cb.curses.swift-
+p ^The swiftcurse leaves you\\.$
+do
cb.shaman.swiftcurse = 0
-en
+trigger +n cb.spiritlore.coagulation+
+p ^You may channel spiritual energy to cause a coagulation once again\\.$
+do
cb.shaman.coagBalance = true
-en
+trigger +n cb.spiritlore.coagulation-
+p ^(\\w+) does not yet bleed enough for you to unleash the coagulation\\.$
+do
tagOn(' <span class="darkred">(failed <span class="magenta">coagulation</span>)</span>')
-en
+trigger +n cb.spiritlore.coagulation
+p ^With methodical ruthlessness you cast your hand at (\\w+), a wash of cold causing (?:his|her) blood to evolve into something new\\.$
+do
if (matches[1] == cb.shaman.curseTarget) { cb.give(cb.shaman.nextInvoke) }
cb.shaman.coagBalance = false
-en
+trigger +n cb.spiritlore.relapse+
+p ^You may utilise spiritual energy to relapse afflictions once again\\.$
+do
cb.shaman.relapseBalance = true
-en
+trigger +n cb.spiritlore.relapse
+p ^You manipulate the (.*?) affliction affecting (\\w+), altering it to relapse at a later time\\.$
+do
cb.shaman.relapseBalance = false
tagOn(' <span class="seagreen">(<span class="darkyellow">' + matches[1] + '</span>)</span>')
-en
+trigger +n cb.spiritlore.relapse-
+p ^You may not yet channel spiritual energy to cause a relapse again\\.$
+do
cb.shaman.relapseBalance = false
-en
+trigger +n cb.spiritlore.bloodlet
+p ^With grim resolve, you gesture sharply at (\\w+)\\.$
+do
cb.shaman.bloodTarget = matches[1]
cb.shaman.bloodletBalance = false
-en
+trigger +n cb.spiritlore.bloodlet-2
+p ^Lacerations appear upon (?:his|her) form, as if slashed by an invisible blade\\.$
+do
if (cb.shaman.curseTarget == cb.shaman.bloodTarget) { cb.give('haemophilia'); cb.shaman.bloodTarget = '' }
-en
+trigger +n cb.spiritlore.bloodlet+
+p ^You may let your victim\\'s blood once again\\.$
+do
cb.shaman.bloodletBalance = true
-en
+trigger +n cb.spiritlore.communing
+p ^An unwavering certainty of the value of Creation washes over you for the briefest instant, before you suppress the (alien) will\\.$
+p ^A clinical, (ruthless) presence overcomes you for an instant, before you reassert control\\.$
+p ^A feeling of terrible, unquenchable devotion to (evil) threatens to overcome you, but your mental fortitude proves victorious\\.$
+p ^A (sinister) sensation washes over you for the briefest instant, but quickly fades into little more than a persistent unease\\.$
+p ^The realisation that none can match you with the (blade) suddenly dawns upon you\\.$
+do
var t = {
alien : 'Arayan',
ruthless: 'Aspar',
evil : 'Maligus',
sinister: 'Syvis',
blade : 'Teraile',
}
var spirit = t[matches[1]]
tagOn(' <span class="turquoise">(<span class="cyan">' + spirit + '</span>)</span>')
if (typeof spirit !== 'undefined' && cb.shaman.spirits.indexOf(spirit) == -1) { cb.shaman.spirits.push(spirit) }
for (var k in cb.shaman.bindings) {
if (cb.shaman.spirits.indexOf(cb.shaman.bindings[k]) == -1) {
bsend('spirit bind ' + cb.shaman.bindings[k])
break
}
}
-en
+trigger
+n cb.spiritlore.spirits
+p ^You have bound the following spirits\:$
+do
cb.shaman.spirits = []
cb.shaman.p2pBindings = true
-en
+trigger
+n cb.spiritlore.bindings
+p ^(Aspar, The Iron Handed)$
+p ^(Arayan, The Healer)$
+p ^(Maligus, The Cleric)$
+p ^(Syvis, The Venomous)$
+p ^(Teraile, The Swordsman)$
+do
if (cb.shaman.p2pBindings) {
var s = cb.shaman.convert(matches[1])
cb.shaman.spirits.push(s)
}
-en
+trigger +n cb.spiritlore.commune+
+p ^Your communion with the departed may begin\\.$
+do
for (var k in cb.shaman.bindings) {
if (cb.shaman.spirits.indexOf(cb.shaman.bindings[k]) == -1) {
bsend('spirit bind ' + cb.shaman.bindings[k])
break
}
}
-en
+trigger +n cb.spiritlore.unbinds
+p ^You sever the bindings with all of the spirits you have bound\\.$
+do
cb.shaman.spirits = []
-en
+trigger +n cb.spiritlore.unbound
+p ^You dissolve your bond with the spirit of (.*)\\.$
+do
var x = cb.shaman.spirits.indexOf(cb.shaman.convert(matches[1]))
if (x > -1) { cb.shaman.spirits.splice(x, 1) }
-en
+trigger +n cb.spiritlore.attune
+p ^Focusing on your binding with the spirit of (.*), you carefully strengthen the connection, allowing more of the spirit\\'s power to use your body as a conduit\\.$
+do
var spirit = cb.shaman.convert(matches[1])
if (typeof spirit !== 'undefined' && cb.shaman.attunes.indexOf(spirit) == -1) { cb.shaman.attunes.push(spirit) }
-en
`
t.aliases = `
+alias +n cb.shaman.swiftcurse
+p ^cc$
+do
bsend('swiftcurse')
-en
+alias +n cb.shaman.s,commune
+p ^scom$
+do
var str = ''
str += 'sit' + sp + 'commune' + sp
bsend(str)
-en
+alias +n cb.shaman.s,bind
+p ^sbind$
+do
var str = ''
str += 'spirit bind '
for (var k in cb.shaman.bindings) {
str += cb.shaman.bindings[k] + sp
}
bsend(str)
-en
+alias +n cb.shaman.s,attune
+p ^satt$
+do
var str = ''
str += 'spirit attune arayan' + sp
str += 'spirit attune maligus' + sp
str += 'spirit attune teraile' + sp
bsend(str)
-en
`
gsr.append('cb', t)
var t = {}
t.scripts = `
+script
if ($('.cb-injected').length) { $('.cb-injected').remove() }
cb.inject('.cb-outer { color: rgba( 79, 111, 163, 1); }')
cb.inject('.cb { color: rgba( 73, 17, 224, 1); }')
-script
`
t.triggers = ``
t.aliases = ``
gsr.append('cb', t)
var t = {}
t.scripts = `
+script
cb.target = 'Tysandr'
cb.tracked = {}
cb.recall = {}
cb.keys = {}
cb.trueValue = true
cb.falseValue = false
cb.targetRegex = \/target\/g
cb.cures = {}
cb.cures.ash = ['confusion','dementia','hallucinations','hypersomnia','paranoia']
cb.cures.bloodroot = ['paralysis','slickness']
cb.cures.bellwort = ['generosity','indifference','justice','lovers','pacified','peace','retribution','timeloop']
cb.cures.elm = ['aeon','dazed','deadening','whisperingmadness']
cb.cures.ginseng = ['addiction','darkshade','haemophilia','lethargy','nausea','scytherus']
cb.cures.goldenseal= ['depression','dissonance','dizziness','epilepsy','impatience','insomnia','shadowmadness','shyness','stupidity']
cb.cures.kelp = ['asthma','clumsiness','healthleech','hypochondria','parasite','sensitivity','weariness']
cb.cures.lobelia = ['agoraphobia','airdisrupt','claustrophobia','earthdisrupt','firedisrupt','loneliness','masochism','recklessness','spiritdisrupt','vertigo','waterdisrupt']
cb.cures.valerian = ['disloyalty','hellsight','manaleech','slickness']
cb.cures.focus = [
'agoraphobia','airdisrupt','anorexia','claustrophobia','confusion','dementia','dizziness','epilepsy',
'generosity','hallucinations','loneliness','lovers','masochism','pacified','paranoia','recklessness',
'shyness','stupidity','stuttering','vertigo','waterdisrupt'
]
cb.cures.tree = [
'addiction','agoraphobia','airdisrupt','anorexia','asthma','impatience',
'claustrophobia','confusion','clumsiness','healthleech','hypochondria',
'darkshade','dazed','deadening','dementia','dizziness',
'epilepsy','depression','dissonance','dizziness','generosity',
'parasite','sensitivity','weariness','earthdisrupt','firedisrupt','disloyalty','hellsight','manaleech',
'hallucinations','haemophilia','hypersomnia','indifference','justice','lethargy','loneliness','lovers','masochism','nausea',
'pacified','paranoia','peace',
'recklessness','retribution','shyness','slickness','stupidity','stuttering','timeloop','vertigo','waterdisrupt'
]
cb.reset = function() { cb.tracked = {} }
cb.give = function(aff) {
if (aff && aff.length < 1) { return }
cb.tracked[aff] = cb.trueValue
tagOn(' <span class="black">[<span class="white">'+aff+'</span>]</span><span class="seagreen">+</span>')
}
cb.take = function(aff) { // cb.tracked[aff] = cb.falseValue
delete cb.tracked[aff]
tagOn(' <span class="violent">[<span class="white">' + aff + '</span>]</span><span class="darkred">-</span>')
}
cb.has = function(aff) {
if (typeof cb.tracked[aff] !== 'undefined') {
if (cb.tracked[aff] == cb.trueValue) { return true } else { return false } }
return false }
cb.count = function() {
var c = 0
for (var k in cb.tracked) {
if (cb.tracked[k] == cb.trueValue) { c += 1 }
}
return c }
cb.remember = function(curetype, affliction) {
cb.recall[curetype] = {whom: cb.target, when: new Date().getTime(), what: affliction} }
cb.cure = function(curetype) {
if (typeof cb.cures[curetype] == 'undefined') { cb.report('No cure table found.'); return }
var t = cb.cures[curetype]
for (var i=0; i<t.length; i++) {
var consider = t[i]
if (cb.has(consider)) {
if (true) { log('Cured ' + consider + ' with ' + curetype + '.') }
cb.take(consider)
cb.remember(curetype, consider)
break
}
} }
cb.parseCure = function(perceived) {
return cb.reverse(cb.cureDictionary, perceived) }
cb.equate = function(cure) {
return cb.reverse(cb.equivalents, cure) }
cb.cureDictionary = {
'ash' : 'some prickly ash bark',
'bayberry' : 'bayberry bark',
'bellwort' : 'a bellwort flower',
'cohosh' : 'a black cohosh',
'bloodroot' : 'a bloodroot leaf',
'burdock' : 'burdock',
'echinacea' : 'an echinacea',
'elm' : 'slippery elm',
'ginger' : 'a ginger root',
'ginseng' : 'a ginseng root',
'goldenseal': 'a goldenseal root',
'hawthorn' : 'a hawthorn berry',
'kelp' : 'a piece of kelp',
'kola' : 'a kola nut',
'kuzu' : 'kuzu root',
'lobelia' : 'a lobelia seed',
'moss' : 'some irid moss',
'myrrh' : 'myrrh gum',
'pear' : 'prickly pear',
'sileris' : 'sileris',
'skullcap' : 'skullcap',
'slipper' : "lady's slipper root",
'valerian' : 'valerian',
'antimony' : 'an antimony flake',
'argentum' : 'an argentum flake',
'arsenic' : 'an arsenic pellet',
'aurum' : 'an aurum flake',
'azurite' : 'an azurite mote',
'bisemutum' : 'a bisemutum chip',
'calamine' : 'a calamine crystal',
'calcite' : 'a calcite mote',
'cinnabar' : 'a pinch of ground cinnabar',
'cuprum' : 'a cuprum flake',
'dolomite' : 'a dolomite grain',
'ferrum' : 'a ferrum flake',
'gypsum' : 'a gypsum crystal',
'magnesium' : 'a magnesium chip',
'malachite' : 'a pinch of ground malachite',
'plumbum' : 'a plumbum flake',
'potash' : 'a potash crystal',
'quartz' : 'a quartz grain',
'quicksilver': 'a quicksilver droplet',
'realgar' : 'a pinch of realgar crystals',
'stannum' : 'a stannum flake',
}
cb.equivalents = {
'ash' : 'stannum',
'bayberry' : 'arsenic',
'bellwort' : 'cuprum',
'bloodroot' : 'magnesium',
'elm' : 'cinnabar',
'kelp' : 'aurum',
'lobelia' : 'argentum',
'ginseng' : 'ferrum',
'goldenseal' : 'plumbum',
'pear' : 'calcite',
'valerian' : 'realgar',
}
-script
`
t.triggers = `
+trigger +n cb.cures
+p ^(\\w+) eats (.*)\\.$
+p ^(\\w+) touches a (tree) of life tattoo\\.$
+p ^(\\w+) takes a long drag off (?:his|her) (pipe)\\.$
+do
if (matches[2] == 'pipe') { matches[2] == 'valerian' }
if (matches[1] == cb.target) {
var cure = cb.parseCure(matches[2])
cure = cb.equate(cure)
cb.cure(cure) }
-en
+trigger +n cb.cures
+p ^A look of extreme (focus) crosses the face of (\\w+)\\.$
+do
if (matches[2] == cb.target) {
var cure = cb.parseCure(matches[1])
cure = cb.equate(cure)
cb.cure(cure) }
-en
+trigger +n cb.gags
+p ^\\[System\\]\\: Added (.*) to your eqbal queue\\.$
+p ^\\[System\\]\\: Queued eqbal commands cleared\\.$
+p ^You feel revitalised in body and mind\\.$
+p ^Blood begins to run from the eyes and nose of (\\w+)\\.$
+p ^(\\w+) seems diminished\\.$
+do sub() -en
+trigger +n cb.third-party
+p ^Horror overcomes (\\w+)\'s face as (?:his|her) body stiffens into paralysis\\.$
+do
if (matches[2] == cb.target) { cb.give('paralysis') }
-en
`
t.aliases = `
+alias +n cb.reset
+p ^cbr$
+do cb.reset() -en
`
gsr.append('cb',t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment