mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-10 09:59:00 +08:00
add summary
This commit is contained in:
@@ -29,17 +29,22 @@ class Talent {
|
||||
return { grade, name, description };
|
||||
}
|
||||
|
||||
talentRandom() {
|
||||
talentRandom(include) {
|
||||
// 1000, 100, 10, 1
|
||||
const talentList = {};
|
||||
for(const talentId in this.#talents) {
|
||||
const { id, grade, name, description } = this.#talents[talentId];
|
||||
if(id == include) {
|
||||
include = { grade, name, description, id };
|
||||
continue;
|
||||
}
|
||||
if(!talentList[grade]) talentList[grade] = [{ grade, name, description, id }];
|
||||
else talentList[grade].push({ grade, name, description, id });
|
||||
}
|
||||
|
||||
return new Array(10)
|
||||
.fill(1).map(()=>{
|
||||
.fill(1).map((i)=>{
|
||||
if(!i && include) return include;
|
||||
const gradeRandom = Math.random();
|
||||
let grade;
|
||||
if(gradeRandom>=0.111) grade = 0;
|
||||
|
||||
Reference in New Issue
Block a user