Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ソフィーのアトリエDXの武器・防具強化時の組み合わせを全部出して表示するスクリプト
/*
* ソフィーのアトリエDXの武器・防具強化時の組み合わせを全部出して表示するスクリプト
* 割りと雑に書いてますが、出す分には問題ないはずです。
* テストが無いですが、自分が手で計算した結果は出ていたので、たいしたことやってないですし、問題は無さそうです。
*/
// 127を超えると切り捨てられるため、超えたら下記値にする
const MAX_VALUE = 127
/* 武器の計算 */
function buki() {
const list = [
{name:"イ", HP:11, MP:0, LP:0, DA:0, AT:11, DF:0, SP:0},
{name:"ュ", HP:0, MP:0, LP:7, DA:3, AT:9, DF:11, SP:0},
{name:"シ", HP:0, MP:0, LP:0, DA:7, AT:0, DF:0, SP:0},
{name:"ル", HP:0, MP:0, LP:0, DA:3, AT:11, DF:0, SP:11},
{name:"ゴ", HP:7, MP:7, LP:7, DA:0, AT:7, DF:7, SP:7},
{name:"ハ", HP:0, MP:0, LP:0, DA:5, AT:22, DF:0, SP:0},
]
// ボーナス特性リスト
let blist = [
{name:"O", HP:0, MP:0, LP:0, DA:9, AT:0, DF:0, SP:0},
{name:"P", HP:5, MP:5, LP:5, DA:6, AT:5, DF:5, SP:5},
{name:"Q", HP:10, MP:10, LP:10, DA:3, AT:10, DF:10, SP:10},
{name:"R", HP:15, MP:15, LP:15, DA:0, AT:15, DF:15, SP:15},
]
// 5回分なので、5倍する
blist.forEach(x1 => {
Object.keys(x1).forEach(k => {
if (k==="name") return;
x1[k] = x1[k] * 5
})
})
console.log(blist)
const bukiList = []
const tyohukuMap = {}
list.forEach(x1=>{
list.forEach(x2=>{
list.forEach(x3=>{
list.forEach(x4=>{
list.forEach(x5=>{
blist.forEach(y1=>{ // 特性ボーナスリスト
const result = {name:"", HP:0, MP:0, LP:0, DA:0, AT:0, DF:0, SP:0}
Object.keys(x1).forEach(k => result[k] = x1[k] + x2[k] + x3[k] + x4[k] + x5[k] + y1[k])
Object.keys(x1).forEach(k => result[k] = (MAX_VALUE < result[k]) ? MAX_VALUE : result[k])
// パターンが重複するので、削減する
const sortedName = result.name.split("").sort().join("")
if (tyohukuMap[sortedName] === undefined) {
tyohukuMap[sortedName] = 1
} else {
return
}
bukiList.push(result)
// if (sortedName.startsWith("Qハハルルル")) console.log(result)
return
if (
result.HP > 40
&& result.DA > 30
&& result.AT > 100
&& result.DF > 49
&& result.SP > 60
) {
console.log(
sortedName, '\t',
result.HP + result.DA + result.AT + result.DF + result.SP, '\t',
result.HP, '\t',
result.MP, '\t',
result.LP, '\t',
result.DA, '\t',
result.AT, '\t',
result.DF, '\t',
result.SP
)
}
})
})
})
})
})
})
return bukiList
}
/* 防具の計算 */
function vougu() {
const list = [
{name:"ク", HP:7, MP:0, LP:0, DA:0, AT:0, DF:3, SP:5},
{name:"モ", HP:7, MP:0, LP:7, DA:0, AT:0, DF:7, SP:0},
{name:"ア", HP:5, MP:5, LP:5, DA:5, AT:0, DF:0, SP:0},
{name:"フ", HP:0, MP:7, LP:0, DA:3, AT:0, DF:5, SP:7},
{name:"ェ", HP:0, MP:0, LP:0, DA:0, AT:7, DF:7, SP:7},
{name:"ベ", HP:0, MP:0, LP:0, DA:0, AT:14, DF:0, SP:0},
]
// ボーナス特性リスト
let blist = [
{name:"O", HP:0, MP:0, LP:0, DA:9, AT:0, DF:0, SP:0},
{name:"P", HP:5, MP:5, LP:5, DA:6, AT:5, DF:5, SP:5},
{name:"Q", HP:10, MP:10, LP:10, DA:3, AT:10, DF:10, SP:10},
{name:"R", HP:15, MP:15, LP:15, DA:0, AT:15, DF:15, SP:15},
]
// 6回分なので、6倍する
blist.forEach(x1 => {
Object.keys(x1).forEach(k => {
if (k==="name") return;
x1[k] = x1[k] * 6
})
})
console.log(blist)
const vouguList = []
const tyohukuMap = {}
list.forEach(x1=>{
list.forEach(x2=>{
list.forEach(x3=>{
list.forEach(x4=>{
list.forEach(x5=>{
list.forEach(x6=>{
blist.forEach(y1=>{ // 特性ボーナスリスト
const result = {name:"", HP:0, MP:0, LP:0, DA:0, AT:0, DF:0, SP:0}
Object.keys(x1).forEach(k => result[k] = x1[k] + x2[k] + x3[k] + x4[k] + x5[k] + x6[k] + y1[k])
Object.keys(x1).forEach(k => result[k] = (MAX_VALUE < result[k]) ? MAX_VALUE : result[k])
// パターンが重複するので、削減する
const sortedName = result.name.split("").sort().join("")
if (tyohukuMap[sortedName] === undefined) {
tyohukuMap[sortedName] = 1
} else {
return
}
vouguList.push(result)
// if (sortedName.startsWith("Qハハルルル")) console.log(result)
return
if (
result.HP > 40
&& result.DA > 23
// && result.AT > 100
&& result.DF > 80
&& result.SP > 80
) {
console.log(
sortedName, '\t',
result.HP + result.DA + result.AT + result.DF + result.SP, '\t',
result.HP, '\t',
result.MP, '\t',
result.LP, '\t',
result.DA, '\t',
result.AT, '\t',
result.DF, '\t',
result.SP
)
}
})
})
})
})
})
})
})
return vouguList
}
const _bukiList = buki()
const _vouguList = vougu()
const tyohukuMap = {}
_bukiList.forEach(b1=>{
_vouguList.forEach(v1=>{
const result = {name:"", HP:0, MP:0, LP:0, DA:0, AT:0, DF:0, SP:0}
Object.keys(b1).forEach(k => result[k] = v1[k] + b1[k])
// パターンが重複するので、削減する
const sortedName = result.name
// const sortedName = result.name.split("").sort().join("")
if (tyohukuMap[sortedName] === undefined) {
tyohukuMap[sortedName] = 1
} else {
return
}
// if (sortedName.startsWith("Qハハルルル")) console.log(result)
// return
if (
// result.HP >= 120
result.DA >= 70
&& result.AT >= 200
&& result.DF >= 100
&& result.SP >= 160
) {
console.log(
sortedName, '\t',
result.HP + result.DA + result.AT + result.DF + result.SP, '\t',
result.HP, '\t',
result.MP, '\t',
result.LP, '\t',
result.DA, '\t',
result.AT, '\t',
result.DF, '\t',
result.SP
)
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment