Created
May 2, 2020 13:19
-
-
Save Nishisonic/4d6f63cd7cab4be438d3e19bb2d11d57 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ComparableArrayType = Java.type("java.lang.Comparable[]"); | |
function header() { | |
return ["特殊攻撃"]; | |
} | |
function begin() {} | |
function body(battle) { | |
var ret = new ComparableArrayType(1); | |
ret[0] = ""; | |
if (battle.isPractice()) return ret; | |
ret[0] = (function () { | |
var type = Array.prototype.concat | |
.apply( | |
[], | |
Java.from(battle.phaseList).map(function (phase) { | |
return ["", 1, 2, 3].map(function (suffix) { | |
return getSpecialAttack(phase["hougeki" + suffix]); | |
}); | |
}) | |
) | |
.filter(function (type) { | |
return type; | |
})[0]; | |
switch (type) { | |
case 100: | |
return "Nelson Touch"; | |
case 101: | |
return "一斉射かッ…胸が熱いな!"; | |
case 102: | |
return "長門、いい? いくわよ! 主砲一斉射ッ!"; | |
case 103: | |
return "Colorado 特殊攻撃"; | |
case 104: | |
return "僚艦夜戦突撃"; | |
case undefined: | |
return ""; | |
default: | |
return "不明(" + type + ")"; | |
} | |
})(); | |
return ret; | |
} | |
function end() {} | |
function getSpecialAttack(attacks) { | |
if (!attacks) return null; | |
var result = Java.from(attacks) | |
.map(function (attack) { | |
return attack.type; | |
}) | |
.filter(function (type) { | |
return type >= 100 && type < 200; | |
}); | |
return result[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment