浏览代码

Refactor 6

improved how merge_desc works
gave more fade time on the text modes as text was fading too fast to read before
master
jsb5468 5 年前
父节点
当前提交
cdd6b0e8aa
共有 2 个文件被更改,包括 6 次插入8 次删除
  1. +2
    -2
      game.js
  2. +4
    -6
      recursive-macro.js

+ 2
- 2
game.js 查看文件

@@ -48,12 +48,12 @@ const textFadeChoices = {
}, },
dims: { dims: {
name: "Text Dims", name: "Text Dims",
animation: "log-dim 10s linear",
animation: "log-dim 15s linear",
next: "fades" next: "fades"
}, },
fades: { fades: {
name: "Text Fades", name: "Text Fades",
animation: "log-fade 10s linear",
animation: "log-fade 20s linear",
next: "stays" next: "stays"
} }
}; };


+ 4
- 6
recursive-macro.js 查看文件

@@ -543,6 +543,7 @@ function merge_desc(list) {
if (result.length > 0) { if (result.length > 0) {
result = result.substring(0, result.length - 1); result = result.substring(0, result.length - 1);
} }
let article = "a "
//a/an overwriting terms //a/an overwriting terms
let forcedTerms = ["honor","heir"]; //words that need to start with an but don't start with a,e,i,o,u let forcedTerms = ["honor","heir"]; //words that need to start with an but don't start with a,e,i,o,u
let force = false; let force = false;
@@ -555,14 +556,11 @@ function merge_desc(list) {
for (let i of exceptionTerms){ for (let i of exceptionTerms){
if (i === result.substring(0, i.length)){exception = true;} if (i === result.substring(0, i.length)){exception = true;}
} }
//check if the string should start with a or an
//check if the string should start with an
if ((force == true) || (exception == false && ((result.charAt(0) == "a")||(result.charAt(0) == "e")||(result.charAt(0) == "i")||(result.charAt(0) == "o")||(result.charAt(0) == "u")))){ if ((force == true) || (exception == false && ((result.charAt(0) == "a")||(result.charAt(0) == "e")||(result.charAt(0) == "i")||(result.charAt(0) == "o")||(result.charAt(0) == "u")))){
result = "an " + result;
}else{
result = "a " + result;
article = "an ";
} }


result = article + result;
return result; return result;
} }




正在加载...
取消
保存