Skip to content
Snippets Groups Projects
Commit ee7b187c authored by klorpa's avatar klorpa
Browse files

PunctuationFix

parent 502375b1
No related branches found
No related tags found
No related merge requests found
...@@ -7,8 +7,8 @@ App.FindSlave = {}; ...@@ -7,8 +7,8 @@ App.FindSlave = {};
* @returns {boolean} * @returns {boolean}
*/ */
App.FindSlave._fragmentSearch = function(haystacks, needles) { App.FindSlave._fragmentSearch = function(haystacks, needles) {
const hs = haystacks.join(" "); const hs = haystacks.join(" ");
return needles.every((needle) => { return needle.test(hs); }); return needles.every((needle) => { return needle.test(hs); });
}; };
/** /**
...@@ -17,12 +17,12 @@ App.FindSlave._fragmentSearch = function(haystacks, needles) { ...@@ -17,12 +17,12 @@ App.FindSlave._fragmentSearch = function(haystacks, needles) {
* @returns {number[]} * @returns {number[]}
*/ */
App.FindSlave._slaveIndices = function(predicate) { App.FindSlave._slaveIndices = function(predicate) {
return V.slaves.reduce((acc, slave, ind) => { return V.slaves.reduce((acc, slave, ind) => {
if (predicate(createReadonlyProxy(slave))) { if (predicate(createReadonlyProxy(slave))) {
acc.push(ind); acc.push(ind);
} }
return acc; return acc;
}, []); }, []);
}; };
/** /**
...@@ -31,9 +31,9 @@ App.FindSlave._slaveIndices = function(predicate) { ...@@ -31,9 +31,9 @@ App.FindSlave._slaveIndices = function(predicate) {
* @returns {DocumentFragment} * @returns {DocumentFragment}
*/ */
App.FindSlave.searchByName = function(query) { App.FindSlave.searchByName = function(query) {
const needles = query.split(" ").map((needle) => { return new RegExp(needle, "i"); }); const needles = query.split(" ").map((needle) => { return new RegExp(needle, "i"); });
const indices = this._slaveIndices((slave) => { return this._fragmentSearch([slave.slaveName, slave.slaveSurname, slave.birthName, slave.birthSurname], needles); }); const indices = this._slaveIndices((slave) => { return this._fragmentSearch([slave.slaveName, slave.slaveSurname, slave.birthName, slave.birthSurname], needles); });
return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract); return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract);
}; };
/** /**
...@@ -42,9 +42,9 @@ App.FindSlave.searchByName = function(query) { ...@@ -42,9 +42,9 @@ App.FindSlave.searchByName = function(query) {
* @returns {DocumentFragment} * @returns {DocumentFragment}
*/ */
App.FindSlave.searchByBackground = function(query) { App.FindSlave.searchByBackground = function(query) {
const needles = query.split(" ").map((needle) => { return new RegExp(needle, "i"); }); const needles = query.split(" ").map((needle) => { return new RegExp(needle, "i"); });
const indices = this._slaveIndices((slave) => { return this._fragmentSearch([slave.career, slave.origin], needles); }); const indices = this._slaveIndices((slave) => { return this._fragmentSearch([slave.career, slave.origin], needles); });
return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract); return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract);
}; };
/** /**
...@@ -53,7 +53,7 @@ App.FindSlave.searchByBackground = function(query) { ...@@ -53,7 +53,7 @@ App.FindSlave.searchByBackground = function(query) {
* @returns {DocumentFragment} * @returns {DocumentFragment}
*/ */
App.FindSlave.searchByExpression = function(query) { App.FindSlave.searchByExpression = function(query) {
const pred = new Function("slave", "return (" + query + ");"); const pred = new Function("slave", "return (" + query + ");");
const indices = runWithReadonlyProxy(() => { return this._slaveIndices(pred); }); const indices = runWithReadonlyProxy(() => { return this._slaveIndices(pred); });
return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract); return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract);
}; };
...@@ -4,29 +4,29 @@ ...@@ -4,29 +4,29 @@
After spending a minute trying to remember some details about one of your slaves, you sit down behind your desk and tell $assistantName that you need to locate a particular slave's records.<br><br> After spending a minute trying to remember some details about one of your slaves, you sit down behind your desk and tell $assistantName that you need to locate a particular slave's records.<br><br>
"Certainly, <<= properMaster()>>. What can you tell me about them?"<br><br> "Certainly, <<= properMaster()>>. What can you tell me about them?"<br><br>
"They're called something like: "They're called something like:
<<textbox "_nameSearch" "" autofocus>> <<textbox "_nameSearch" "" autofocus>>
<<link "Locate">> <<link "Locate">>
<<script>>$('#slaveList').empty().append(App.FindSlave.searchByName(State.temporary.nameSearch));<</script>> <<script>>$('#slaveList').empty().append(App.FindSlave.searchByName(State.temporary.nameSearch));<</script>>
<</link>> <</link>>
<br>//(Enter a fragment of their nickname, name, surname, birth name, or birth surname)//<br><br> <br>//(Enter a fragment of their nickname, name, surname, birth name, or birth surname)//<br><br>
"In the past, they were: "In the past, they were:
<<textbox "_backgroundSearch" "">> <<textbox "_backgroundSearch" "">>
<<link "Locate">> <<link "Locate">>
<<script>>$('#slaveList').empty().append(App.FindSlave.searchByBackground(State.temporary.backgroundSearch));<</script>> <<script>>$('#slaveList').empty().append(App.FindSlave.searchByBackground(State.temporary.backgroundSearch));<</script>>
<</link>> <</link>>
<br>//(Enter a fragment of their origin or past job, for example, "shelter" or "lawyer")//<br><br> <br>//(Enter a fragment of their origin or past job, for example, "shelter" or "lawyer")//<br><br>
"Their data should meet this condition: "Their data should meet this condition:
<<textbox "_dataSearch" "">> <<textbox "_dataSearch" "">>
<<link "Locate">> <<link "Locate">>
<<script>>$('#slaveList').empty().append(App.FindSlave.searchByExpression(State.temporary.dataSearch));<</script>> <<script>>$('#slaveList').empty().append(App.FindSlave.searchByExpression(State.temporary.dataSearch));<</script>>
<</link>> <</link>>
<br>//(Enter a conditional expression which evaluates to true for the slave you want to find, such as "slave.physicalAge >= 18 && slave.physicalAge < 21")// <br><br> <br>//(Enter a conditional expression which evaluates to true for the slave you want to find, such as "slave.physicalAge >= 18 && slave.physicalAge < 21")// <br><br>
<span id="slaveList"> <span id="slaveList">
/* results list gets populated here by jQuery */ /* results list gets populated here by jQuery */
</span> </span>
...@@ -93,9 +93,9 @@ ...@@ -93,9 +93,9 @@
<<set $enduringRep *= .5>> <<set $enduringRep *= .5>>
<<elseif ($personalAttention == "upkeep")>> <<elseif ($personalAttention == "upkeep")>>
<<if $PC.belly >= 5000>> <<if $PC.belly >= 5000>>
You spend your free time hustling around your penthouse, cleaning and making sure everything is in order. You manage to reduce your upkeep by 20%. Your <<if $PC.preg > 0>>pregnancy<<else>>big belly<</if>> slows you down some<<if $PC.counter.birthMaster > 0>>, but you're used to working around it.<</if>> You spend your free time hustling around your penthouse, cleaning and making sure everything is in order. You manage to reduce your upkeep by 20%. Your <<if $PC.preg > 0>>pregnancy<<else>>big belly<</if>> slows you down some<<if $PC.counter.birthMaster > 0>>, but you're used to working around it<</if>>.
<<else>> <<else>>
You spend your free time hustling around your penthouse, cleaning and making sure everything is in order. You manage to reduce your upkeep by 25%. <<if $PC.counter.birthMaster > 0>>This is much easier to do without a big baby bump in the way.<</if>> You spend your free time hustling around your penthouse, cleaning and making sure everything is in order. You manage to reduce your upkeep by 25%.<<if $PC.counter.birthMaster > 0>> This is much easier to do without a big baby bump in the way.<</if>>
<</if>> <</if>>
<<elseif ($personalAttention == "proclamation")>> <<elseif ($personalAttention == "proclamation")>>
/* handled after this if chain */ /* handled after this if chain */
...@@ -407,7 +407,7 @@ ...@@ -407,7 +407,7 @@
<</if>> <</if>>
<<set $SecExp.proclamation.cooldown = 4, $personalAttention = "business">> <<set $SecExp.proclamation.cooldown = 4, $personalAttention = "business">>
<<else>> <<else>>
As you currently lack the minimum amount of your chosen proclamation currency, $SecExp.proclamation.currency, it woudld be unwise to attempt execution of your $SecExp.proclamation.type this week. As you currently lack the minimum amount of your chosen proclamation currency, $SecExp.proclamation.currency, it would be unwise to attempt execution of your $SecExp.proclamation.type this week.
<</if>> <</if>>
<</if>> <</if>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment