用户:
23332808查看:0 回复:2 评论:0 创建时间:2023-05-27T21:25:28
case 0:
shuaxing(entity)
buffer = []
buffer1 = []
for (i in entity.player.t1) {
if (Array.isArray(entity.player.t2[i])) {
if (entity.player.t2[i][0]["效果"] == undefined) {
ba = ""
nj = 1
if (entity.player.t2[i][1] != undefined) {
ba = JSON.stringify(entity.player.t2[i][1])
if (entity.player.t2[i][1]["耐久"] != undefined) { nj = 1 + entity.player.t2[i][1]["耐久"] }
}
if (entity.player.t2[i][0] > list[entity.player.t1[i]][1] * nj) entity.player.t2[i][0] = list[entity.player.t1[i]][1] * nj
buffer.push(`${entity.player.t1[i]} [${entity.player.t2[i][0]}/${list[entity.player.t1[i]][1] * nj}]${ba}`)
buffer1.push(entity.player.t1[i])
} else { buffer.push(`${entity.player.t1[i]} [效果:${entity.player.t2[i][0]["效果"]} 等级:${entity.player.t2[i][0]["等级"]}]`) }
}
else if (list[entity.player.t1[i]][0] == 7) {
buffer.push(`${entity.player.t1[i]} [等级:${entity.player.t2[i]["等级"]} 持续时间:${entity.player.t2[i]["时间"]}]`)
} else {
buffer.push(`${entity.player.t1[i]}*${entity.player.t2[i]}`)
buffer1.push(entity.player.t1[i])
}
}
const result = await entity.player.dialog({
type: Box3DialogType.SELECT,
title: "物品切换",
content: `${entity.player.name},请选择你切换的物品`,
options: buffer,
});
if (!result || result === null) {
return;
break
} else {
if (result["value"] != "") {
entity.player.directMessage(`主手切换为${entity.player.t1[result["index"]]}`)
const allWearables = entity.player.wearables("rightHand");
allWearables.forEach((item) => { item.remove() })
entity.player.b = entity.player.t1[result["index"]]
entity.player.right_hand = entity.player.b
entity.player.num = list_copy[entity.player.b][0]
entity.player.number = result["index"]
if (list_copy[entity.player.b][0] == 4) {
orient = new Box3Quaternion(0, 1, 0, 0)
if (entity.player.god != 1) {
entity.player.hand = [list_copy[entity.player.b][2], list_copy[entity.player.b][5], list_copy[entity.player.b][6], list_copy[entity.player.b][3]]
} if (entity.player.b == "盾牌") { return }
let e = entity.player.a喵Wearable({
bodyPart: 'rightHand',
mesh: list_copy[entity.player.b][7],
offset: new Box3Vector3(-0.16, 0.3, 0.25),
orientation: orient.rotateY(90)
})
if (entity.player.t2[result["index"]][1] != undefined) {
e.color = new Box3RGBAColor(209 / 255, 2 / 255, 250 / 255)
e.emissive = 0.5
e.metalness = 1
e.metalness = 1
e.shininess = 1
}
} else if (list_copy[entity.player.b][0] == 7 && list_copy[entity.player.b][1] != 3) {
if (entity.player.god != 1) {
entity.player.hand = [false, 1, 1, 1]
}
orient = new Box3Quaternion(0, 1, 0, 0)
entity.player.a喵Wearable({
bodyPart: 'rightHand',
mesh: list_copy[entity.player.b][2],
offset: new Box3Vector3(-0.2, -0.1, 0),
orientation: orient.rotateY(180)
})
} else {
if (entity.player.god != 1) {
entity.player.hand = [false, 1, 1, 1]
}
}
} return
break
} return
case 1:
entity.player.tf = true
while (entity.player.tf) {
entity.player.buffer = Object.keys(compose)
entity.player.compose_list = []
entity.player.compose_list_2 = {}
for (var i = 0; i < entity.player.buffer.length; i++) {
entity.player.compose_name = Object.keys(compose)[i]
entity.player.compose_name_list = Object.keys(compose[entity.player.compose_name][1])
entity.player.buffer_2 = true
for (var j = 0; j < entity.player.compose_name_list.length; j++) {
entity.player.buffer_3 = null
if (entity.player.things[entity.player.compose_name_list[j]] != undefined) {
if (entity.player.things[entity.player.compose_name_list[j]][1] >= compose[entity.player.compose_name][1][entity.player.compose_name_list[j]]) {
if (entity.player.buffer_3 == null) { entity.player.buffer_3 = entity.player.compose_name_list[j] + "*" + compose[entity.player.compose_name][1][entity.player.compose_name_list[j]] }
else { entity.player.buffer_3 = entity.player.buffer_3 + " " + entity.player.things[entity.player.compose_name_list[j]][1] + "*" + compose[entity.player.compose_name][1][entity.player.compose_name_list[j]] }
} else { entity.player.buffer_2 = false }
} else { entity.player.buffer_2 = false }
}
if (entity.player.buffer_2 == true) {
entity.player.compose_list.push(entity.player.buffer[i] + "*" + compose[entity.player.buffer[i]][0] + "(" + entity.player.buffer_3 + ")")
entity.player.compose_list_2[entity.player.buffer[i] + "*" + compose[entity.player.buffer[i]][0] + "(" + entity.player.buffer_3 + ")"] = entity.player.buffer[i]
}
}
const hc = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: `配方表`,
title: "合成",
options: entity.player.compose_list,
})
if (!hc || hc === null) {
entity.player.tf = false
return;
break
} else {
entity.player.hc = hc[Object.keys(hc)[1]]
if (entity.player.hc != "") {
if (entity.player.hc != 4) {
entity.player.th = entity.player.compose_list_2[hc[Object.keys(hc)[1]]]
if (entity.player.things[entity.player.th] == undefined) {
entity.player.buffer = list_copy[entity.player.th][0]
entity.player.things[entity.player.th] = [entity.player.buffer, 0]
} entity.player.things[entity.player.th][1] = entity.player.things[entity.player.th][1] + compose[entity.player.th][0]
const a = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: `合成成功`,
title: "合成",
options: ["确认"],
})
entity.player.butter = compose[entity.player.th][1]
for (i = 0; i < Object.keys(entity.player.butter).length; i++) {
entity.player.things[Object.keys(entity.player.butter)[i]][1] = entity.player.things[Object.keys(entity.player.butter)[i]][1] - entity.player.butter[Object.keys(entity.player.butter)[i]]
if (entity.player.things[Object.keys(entity.player.butter)[i]][1] <= 0) { entity.player.things = pop(entity.player.things, Object.keys(entity.player.butter)[i]) }
}
}
} else { entity.player.tf = false }
}
} break
希望传奇大大可以了解事实,不要被流言蜚语所欺喵