Compare commits

...

3 Commits

Author SHA1 Message Date
39f5b5619c
fmt 2024-04-05 13:05:54 +08:00
4c18b05b5c
Merge remote-tracking branch 'origin/work/prop' 2024-04-05 13:05:46 +08:00
4e34e09add 技能捏人中 2024-04-05 13:03:15 +08:00

View File

@ -16936,7 +16936,7 @@ T.Plr.prototype = {
this_.f = r this_.f = r
q = this_.d // + 号以后的东西 q = this_.d // + 号以后的东西
if (q != null && q !== "") { if (q != null && q !== "") {
// DIY part // MARK: DIY part
if (q.startsWith("diy")) { if (q.startsWith("diy")) {
this_.diy = q.slice(3) this_.diy = q.slice(3)
} else { } else {
@ -17056,7 +17056,7 @@ T.Plr.prototype = {
this_.aU() // initRawAttr this_.aU() // initRawAttr
this_.bP() // initLists this_.bP() // initLists
this_.dm(C.Array.cL(this_.t, $.au()), C.Array.cL(this_.E, $.au())) // initSkills
// DIY自定义属性 // DIY自定义属性
diy = this_.diy diy = this_.diy
@ -17064,7 +17064,7 @@ T.Plr.prototype = {
try { try {
var tmparr = diy.split("]"); var tmparr = diy.split("]");
var attrs = JSON.parse(tmparr[0] + "]"); var attrs = JSON.parse(tmparr[0] + "]");
if (tmparr[1].startsWith("{")) var skills = JSON.parse(tmparr[1]); if (tmparr[1].startsWith("{")) var diyskills = JSON.parse(tmparr[1]);
if (attrs.length != 8) throw new Error('八围要有八个元素') if (attrs.length != 8) throw new Error('八围要有八个元素')
} catch (error) { } catch (error) {
console.error(error) console.error(error)
@ -17076,6 +17076,12 @@ T.Plr.prototype = {
} }
this.q = attrs this.q = attrs
} }
if (diyskills) {
console.log("this.k1", this.k1)
this.diy_skills(diyskills)
} else this_.dm(C.Array.cL(this_.t, $.au()), C.Array.cL(this_.E, $.au())) // initSkills
} else {
this_.dm(C.Array.cL(this_.t, $.au()), C.Array.cL(this_.E, $.au())) // initSkills
} }
weapon = this_.weapon weapon = this_.weapon
@ -17188,22 +17194,20 @@ T.Plr.prototype = {
skills.push(new T.SkillVoid(0)) skills.push(new T.SkillVoid(0))
skills.push(new T.SkillVoid(0)) skills.push(new T.SkillVoid(0))
}, },
diy_skills(diyskills){ diy_skills(diyskills) {
// MARK: 自定义技能 // MARK: 自定义技能
var skills=this.k1 var skills = this.k1
// 遍历diyskills字典的键 // 遍历diyskills字典的键
for (var key in diyskills) { for (var key in diyskills) {
// 遍历skills数组中的对象 // 遍历skills数组中的对象
for (var i = 0; i < skills.length; i++) { for (var i = 0; i < skills.length; i++) {
if (skills[i].name === key) {
if (skills[i].name === key) { skills[i].f = diyskills[key];
// 如果找到匹配的对象设置其f属性为diyskills字典中对应的值 break;
skills[i].f = diyskills[key]; }
break;
}
} }
} }
}, },
dm(list, original) { dm(list, original) {
// initSkills // initSkills
@ -17244,7 +17248,7 @@ T.Plr.prototype = {
skl = sortedSkills[s] skl = sortedSkills[s]
if (skl.f > 0 && skl instanceof T.ActionSkill) actions.push(skl) if (skl.f > 0 && skl instanceof T.ActionSkill) actions.push(skl)
} }
if (actions.length > 0) if (actions.length > 0)
for (s = actions.length - 1; s >= 0; --s) { for (s = actions.length - 1; s >= 0; --s) {
act = actions[s] act = actions[s]