add achievement

This commit is contained in:
Vick Scarlet
2021-09-10 11:24:24 +08:00
parent e06139d5c0
commit d2f3392722
22 changed files with 16365 additions and 495 deletions

View File

@ -517,7 +517,7 @@
"name": "妖孽",
"description": "成为亲传弟子",
"grade": 1,
"condition": "EVT?[20348]",
"condition": "EVT?[20348,40015]",
"hide": 1,
"opportunity": "TRAJECTORY"
},
@ -535,7 +535,7 @@
"name": "掌控混沌",
"description": "悟出混沌大道",
"grade": 2,
"condition": "EVT?[10388]",
"condition": "EVT?[10388,40036]",
"hide": 1,
"opportunity": "TRAJECTORY"
},
@ -1324,11 +1324,47 @@
},
"248": {
"id": 248,
"name": "破碎虚空",
"name": "无上存在",
"description": "总评超过6000",
"grade": 3,
"condition": "SUM>6000",
"hide": 1,
"opportunity": "SUMMARY"
},
"249": {
"id": 249,
"name": "太古仙传",
"description": "突破到净息境",
"grade": 3,
"condition": "EVT?[40001]",
"hide": 1,
"opportunity": "TRAJECTORY"
},
"250": {
"id": 250,
"name": "你是我的了",
"description": "被夺舍",
"grade": 1,
"condition": "EVT?[40033]",
"hide": 1,
"opportunity": "TRAJECTORY"
},
"251": {
"id": 251,
"name": "破碎虚空",
"description": "撕裂世界之壁",
"grade": 3,
"condition": "EVT?[40040]",
"hide": 1,
"opportunity": "TRAJECTORY"
},
"252": {
"id": 252,
"name": "不祥之胎",
"description": "总评小于0",
"grade": 2,
"condition": "SUM<0",
"hide": 0,
"opportunity": "SUMMARY"
}
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -2920,24 +2920,6 @@
"include": "(EVT?[10344])&(STR>400)&(TLT?[1048])",
"exclude": "EVT?[10345,10361]"
},
"10346": {
"id": 10346,
"event": "寿元终。",
"include": "TLT?[1048]",
"exclude": "EVT?[10333]",
"branch": [
"TLT?[1048]:10000"
]
},
"10347": {
"id": 10347,
"event": "寿元终。",
"include": "TLT?[1048]",
"exclude": "EVT?[10345,10361]",
"branch": [
"TLT?[1048]:10000"
]
},
"10348": {
"id": 10348,
"event": "你突破到金丹二层。",
@ -3140,7 +3122,7 @@
"id": 10368,
"event": "寿元终。",
"include": "TLT?[1048]",
"exclude": "EVT?[10365,10361]",
"exclude": "EVT?[10365,10361,40001]",
"branch": [
"TLT?[1048]:10000"
]
@ -3907,9 +3889,12 @@
},
"10458": {
"id": 10458,
"event": "有个乞丐向你推销“仙法”秘籍,你没有搭理他。",
"include": "EVT?[10009]",
"exclude": "EVT?[10458]"
"event": "有个乞丐向你推销“仙法”秘籍。",
"postEvent": "你没有搭理他。",
"exclude": "EVT?[10458]",
"branch": [
"INT>9:20461"
]
},
"10459": {
"id": 10459,
@ -9963,7 +9948,8 @@
"11349": {
"id": 11349,
"event": "你没有这段记忆。",
"include": "TLT?[1129]"
"include": "TLT?[1129]",
"exclude": "EVT?[20349]"
},
"11350": {
"id": 11350,
@ -11181,7 +11167,7 @@
"id": 20340,
"event": "你喜欢的小师妹在一次外出执行任务中,被一个筑基修士斩杀了。",
"effect": {
"SPR": -1
"SPR": -2
},
"include": "EVT?[20339]",
"exclude": "EVT?[20340]",
@ -11210,7 +11196,10 @@
"effect": {
"STR": 5
},
"NoRandom": 1
"NoRandom": 1,
"branch": [
"TLT?[1129]:20349"
]
},
"20344": {
"id": 20344,
@ -11263,6 +11252,14 @@
},
"NoRandom": 1
},
"20349": {
"id": 20349,
"event": "你悲伤攻心走火入魔,人格也因此合并了。",
"effect": {
"STR": -5
},
"NoRandom": 1
},
"20367": {
"id": 20367,
"event": "你悟出了一条天道!",
@ -11272,7 +11269,8 @@
"STR": 1000,
"SPR": 10
},
"include": "(EVT?[10365])&(TLT?[1048])&((TLT?[1033,1122])|(EVT?[10715]))"
"include": "(EVT?[10365])&(TLT?[1048])&((TLT?[1033,1122])|(EVT?[10715]))",
"exclude": "EVT?[20367]"
},
"20369": {
"id": 20369,
@ -11514,6 +11512,10 @@
"event": "你突然感觉人生无憾了。",
"NoRandom": 1
},
"20461": {
"id": 20461,
"event": "你购买了一本《仙脉图录》。"
},
"20529": {
"id": 20529,
"event": "你拿了第一名。",
@ -11844,5 +11846,401 @@
"LIF": -1
},
"NoRandom": 1
},
"40001": {
"id": 40001,
"event": "你打开小盒子,获得练气法门,但你发现乞丐给你的《仙脉图录》更加高明,是传说中的太古修行法门。",
"postEvent": "你修炼太古法门突破到净息前期。寿元提升到500年。",
"effect": {
"CHR": 5,
"INT": 5,
"STR": 5,
"SPR": 3
},
"include": "(TLT?[1048])&(EVT?[20461])",
"exclude": "EVT?[40001]"
},
"40002": {
"id": 40002,
"event": "净息,排除凡胎杂质。体质提升。",
"effect": {
"STR": 5
},
"include": "EVT?[40001]",
"exclude": "EVT?[40010]"
},
"40003": {
"id": 40003,
"event": "你突破到净息中期。",
"effect": {
"STR": 10
},
"include": "(EVT?[40001])&(STR>100)",
"exclude": "EVT?[40003]"
},
"40004": {
"id": 40004,
"event": "你突破到净息后期。",
"effect": {
"STR": 10
},
"include": "(EVT?[40003])&(STR>200)",
"exclude": "EVT?[40004]"
},
"40005": {
"id": 40005,
"event": "你突破到净息巅峰。",
"effect": {
"STR": 10
},
"include": "(EVT?[40004])&(STR>300)",
"exclude": "EVT?[40005]"
},
"40006": {
"id": 40006,
"event": "你闯入一处秘境,夺得大量资源。",
"effect": {
"STR": 20
},
"include": "EVT?[40001]",
"exclude": "EVT?[40010]"
},
"40007": {
"id": 40007,
"event": "你排出大量杂质,颜值提升。",
"effect": {
"CHR": 1
},
"include": "EVT?[40001]",
"exclude": "EVT?[40010]"
},
"40008": {
"id": 40008,
"event": "你斩杀一个凝气修士,得到少量宝物。",
"effect": {
"INT": 1,
"STR": 3
},
"include": "EVT?[40001]",
"exclude": "EVT?[40010]"
},
"40009": {
"id": 40009,
"event": "你斩杀了一个筑基修士,得到宝物。",
"effect": {
"INT": 2,
"STR": 10
},
"include": "(EVT?[40001])&(STR>100)",
"exclude": "EVT?[40010]"
},
"40010": {
"id": 40010,
"event": "你进行无垢筑基,实力远胜于寻常筑基。",
"postEvent": "你突破到筑基前期。",
"effect": {
"STR": 20
},
"include": "(EVT?[40005])&(STR>500)",
"exclude": "EVT?[40010]"
},
"40011": {
"id": 40011,
"event": "无垢淬体。体质提升。",
"effect": {
"STR": 10
},
"include": "EVT?[40010]",
"exclude": "EVT?[40023]"
},
"40012": {
"id": 40012,
"event": "你突破到筑基中期。",
"effect": {
"STR": 30
},
"include": "(EVT?[40010])&(STR>800)",
"exclude": "EVT?[40012]"
},
"40013": {
"id": 40013,
"event": "你突破到筑基后期。",
"effect": {
"STR": 30
},
"include": "(EVT?[40012])&(STR>1200)",
"exclude": "EVT?[40013]"
},
"40014": {
"id": 40014,
"event": "你突破到筑基巅峰。",
"effect": {
"STR": 30
},
"include": "(EVT?[40013])&(STR>1600)",
"exclude": "EVT?[40014]"
},
"40015": {
"id": 40015,
"event": "你参加筑基天才战,夺得第一。",
"postEvent": "得到大量奖励。并被一位渡劫大能收为亲传。",
"effect": {
"INT": 10,
"STR": 100
},
"include": "EVT?[40010]",
"exclude": "EVT?[40015]"
},
"40016": {
"id": 40016,
"event": "你觉醒一般元婴期才有的神识。",
"include": "EVT?[40010]",
"exclude": "EVT?[40016]"
},
"40017": {
"id": 40017,
"event": "你悟出了火之大道。",
"effect": {
"INT": 20,
"STR": 20
},
"include": "EVT?[40010]",
"exclude": "EVT?[40017]"
},
"40018": {
"id": 40018,
"event": "你悟出了金之大道。",
"effect": {
"INT": 20,
"STR": 20
},
"include": "EVT?[40010]",
"exclude": "EVT?[40018]"
},
"40019": {
"id": 40019,
"event": "你悟出了木之大道。",
"effect": {
"INT": 20,
"STR": 20
},
"include": "EVT?[40010]",
"exclude": "EVT?[40019]"
},
"40020": {
"id": 40020,
"event": "你悟出了水之大道。",
"effect": {
"INT": 20,
"STR": 20
},
"include": "EVT?[40010]",
"exclude": "EVT?[40020]"
},
"40021": {
"id": 40021,
"event": "你悟出了土之大道。",
"effect": {
"INT": 20,
"STR": 20
},
"include": "EVT?[40010]",
"exclude": "EVT?[40021]"
},
"40022": {
"id": 40022,
"event": "完美淬体,体质大幅提升。",
"effect": {
"STR": 20
},
"include": "EVT?[40010]",
"exclude": "EVT?[40023]"
},
"40023": {
"id": 40023,
"event": "你体内灵息汇聚成丹海,又复归流转周身经脉,形成灵脉。",
"postEvent": "你突破到灵脉前期。",
"effect": {
"INT": 30,
"STR": 50
},
"include": "(EVT?[40014])&(STR>2000)",
"exclude": "EVT?[40023]"
},
"40024": {
"id": 40024,
"event": "灵脉运行,体质和智力提升。",
"effect": {
"INT": 10,
"STR": 20
},
"include": "EVT?[40023]"
},
"40025": {
"id": 40025,
"event": "悟道。",
"effect": {
"INT": 30
},
"include": "EVT?[40023]"
},
"40026": {
"id": 40026,
"event": "你突破到灵脉中期。",
"postEvent": "丹海中凝聚出两颗金丹。",
"effect": {
"INT": 30,
"STR": 50
},
"include": "(EVT?[40023])&(INT>500)",
"exclude": "EVT?[40026]"
},
"40027": {
"id": 40027,
"event": "你突破到灵脉后期。",
"postEvent": "丹海中凝聚出四颗金丹。",
"effect": {
"INT": 30,
"STR": 50
},
"include": "(EVT?[40023])&(INT>1000)",
"exclude": "EVT?[40027]"
},
"40028": {
"id": 40028,
"event": "你突破到灵脉巅峰。",
"postEvent": "丹海中凝聚出八颗金丹。",
"effect": {
"INT": 30,
"STR": 100
},
"include": "(EVT?[40023])&(INT>2000)",
"exclude": "EVT?[40028]"
},
"40029": {
"id": 40029,
"event": "你斩杀了一位渡劫期修士。获得大量资源。",
"effect": {
"INT": 50,
"STR": 200
},
"include": "(EVT?[40023])&(STR>2000)"
},
"40030": {
"id": 40030,
"event": "你斩杀一位元婴修士,获得大量资源。",
"effect": {
"INT": 20,
"STR": 100
},
"include": "(EVT?[40023])&(STR>1000)"
},
"40031": {
"id": 40031,
"event": "你摧毁了一个魔道宗门,斩杀数位灾劫境魔修。",
"effect": {
"INT": 50,
"STR": 500
},
"include": "(EVT?[40023])&(STR>2000)"
},
"40032": {
"id": 40032,
"event": "你遇到一位伪仙境的魂修,他想夺舍你,被你反杀。",
"effect": {
"INT": 100
},
"include": "(EVT?[40023])&(INT>1000)",
"exclude": "EVT?[40032]"
},
"40033": {
"id": 40033,
"event": "你遇到一位神游境魂修大能,你被夺舍了。",
"include": "EVT?[40001]",
"exclude": "EVT?[40010]",
"branch": [
"EVT?[40001]:10000"
]
},
"40034": {
"id": 40034,
"event": "你悟出了空间大道。",
"effect": {
"INT": 50,
"STR": 50
},
"include": "EVT?[40010]",
"exclude": "EVT?[40034]"
},
"40035": {
"id": 40035,
"event": "你悟出了时间大道。",
"effect": {
"INT": 50,
"STR": 50
},
"include": "EVT?[40010]",
"exclude": "EVT?[40035]"
},
"40036": {
"id": 40036,
"event": "你悟出了混沌大道。",
"effect": {
"INT": 100,
"STR": 100
},
"include": "EVT?[40010]",
"exclude": "EVT?[40036]"
},
"40037": {
"id": 40037,
"event": "你悟出了生命大道。",
"effect": {
"INT": 75,
"STR": 75
},
"include": "EVT?[40010]",
"exclude": "EVT?[40037]"
},
"40038": {
"id": 40038,
"event": "你悟出了毁灭大道。",
"effect": {
"INT": 75,
"STR": 75
},
"include": "EVT?[40010]",
"exclude": "EVT?[40038]"
},
"40039": {
"id": 40039,
"event": "你突破到化神期。",
"postEvent": "你本应该感应古天劫之力修炼,随时引动天劫渡劫,但古仙界已经覆灭,没有古天劫了。",
"effect": {
"INT": 200,
"STR": 200
},
"include": "(EVT?[40028])&(EVT?[40036])",
"exclude": "EVT?[40039]",
"branch": [
"EVT?[40028]:40040"
]
},
"40040": {
"id": 40040,
"event": "你撕裂世界之壁,踏碎虚空而去。",
"postEvent": "你在这个世界的“人生”结束了。",
"effect": {
"LIF": -1
},
"NoRandom": 1
},
"40041": {
"id": 40041,
"event": "寿元终。",
"include": "EVT?[40001]",
"branch": [
"EVT?[40001]:10000"
]
}
}

Binary file not shown.

Binary file not shown.

View File

@ -1095,6 +1095,30 @@
"group": 2,
"name": "白鲤"
},
{
"group": 2,
"name": "daydream2333"
},
{
"group": 2,
"name": "乔衡"
},
{
"group": 2,
"name": "神之领域"
},
{
"group": 2,
"name": "困爱揽典珈"
},
{
"group": 2,
"name": "灰孤逗"
},
{
"group": 2,
"name": "风滚草"
},
{
"group": 2,
"name": "有梦人天涯若比邻"

2
lib/dom-to-image.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
lib/jquery-3.6.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -18,6 +18,10 @@ class Achievement {
this.#achievements = achievements;
}
count() {
return Object.keys(this.#achievements).length;
}
list(property) {
return Object
.values(this.#achievements)

View File

@ -1,5 +1,6 @@
import { summary } from './functions/summary.js'
import Life from './life.js'
import { summary } from './functions/summary.js';
import { getGrade } from './functions/addition.js';
import Life from './life.js';
class App{
constructor(){
@ -53,8 +54,7 @@ class App{
// Index
const indexPage = $(`
<div id="main">
<div id="cnt" class="head">已重开1次</div>
<button id="rank">排行榜</button>
<button id="achievement">成就</button>
<button id="specialthanks">特别感谢</button>
<button id="themeToggleBtn">黑</button>
<div id="title">
@ -62,7 +62,7 @@ class App{
<div style="font-size:1.5rem; font-weight:normal;">这垃圾人生一秒也不想呆了</div>
</div>
<button id="restart" class="mainbtn"><span class="iconfont">&#xe6a7;</span>立即重开</button>
<a href="https://discord.gg/U3qrf49NMQ" style="z-index: 9999;" aria-label="Chat on Discord"><button class="discord-btn"><svg width="50%" height="55" viewBox="0 0 71 55" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z" fill="#ffffff"/></g><defs><clipPath id="clip0"><rect width="71" height="55" fill="white"/></clipPath></defs></svg>CHAT</button><style>.discord-btn {position: fixed;bottom: 0.5rem;left: 0.5rem;background-color: #5865F2;padding: 0.7rem;height: auto;color: white;text-align: right;vertical-align: middle;border: none;width: 6.5rem;font-size: 1rem;border-radius: 4px;}.discord-btn svg {height: 1.5rem;position: absolute;top: 50%;left: 0;transform: translateY(-50%);}.discord-btn:hover svg{animation:discord-wave 560ms ease-in-out;}@keyframes discord-wave{0%,100%{transform:translateY(-50%) rotate(0)}20%,60%{transform:translateY(-50%) rotate(-25deg)}40%,80%{transform:translateY(-50%) rotate(10deg)}}@media (max-width:500px){.discord-btn:hover svg{animation:none}.discord-btn svg{animation:discord-wave 560ms ease-in-out}}</style></a>
<a id="discord" href="https://discord.gg/U3qrf49NMQ" style="z-index: 9999;" aria-label="Chat on Discord"><button class="discord-btn"><svg width="50%" height="55" viewBox="0 0 71 55" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z" fill="#ffffff"/></g><defs><clipPath id="clip0"><rect width="71" height="55" fill="white"/></clipPath></defs></svg>CHAT</button><style>.discord-btn {position: fixed;bottom: 0.5rem;left: 0.5rem;background-color: #5865F2;padding: 0.7rem;height: auto;color: white;text-align: right;vertical-align: middle;border: none;width: 6.5rem;font-size: 1rem;border-radius: 4px;}.discord-btn svg {height: 1.5rem;position: absolute;top: 50%;left: 0;transform: translateY(-50%);}.discord-btn:hover svg{animation:discord-wave 560ms ease-in-out;}@keyframes discord-wave{0%,100%{transform:translateY(-50%) rotate(0)}20%,60%{transform:translateY(-50%) rotate(-25deg)}40%,80%{transform:translateY(-50%) rotate(10deg)}}@media (max-width:500px){.discord-btn:hover svg{animation:none}.discord-btn svg{animation:discord-wave 560ms ease-in-out}}</style></a>
</div>
`);
@ -74,8 +74,8 @@ class App{
.click(()=>this.switch('talent'));
indexPage
.find('#rank')
.click(()=>this.hint('别卷了!没有排行榜'));
.find('#achievement')
.click(()=>this.switch('achievement'));
if(localStorage.getItem('theme') == 'light') {
indexPage.find('#themeToggleBtn').text('黑')
@ -117,6 +117,20 @@ class App{
.find('#specialthanks')
.click(()=>this.switch('index'));
const achievementPage = $(`
<div id="main">
<button id="specialthanks">返回</button>
<span class="title">统计</span>
<ul id="total"></ul>
<span style="padding:0.25rem; margin: 0.5rem 0; border: none; background: #ccc;"></span>
<span class="title">成就</span>
<ul id="achievements"></ul>
`)
achievementPage
.find('#specialthanks')
.click(()=>this.switch('index'));
// Talent
const talentPage = $(`
<div id="main">
@ -366,7 +380,7 @@ class App{
$(document).unbind("keydown");
this.#isEnd = true;
trajectoryPage.find('#summary').show();
trajectoryPage.find('#domToImage').show();
// trajectoryPage.find('#domToImage').show();
} else {
// 如未死亡,更新数值
// Update properties if not die yet
@ -400,11 +414,13 @@ class App{
});
})
.hide();
trajectoryPage
.find('#summary')
.click(()=>{
this.switch('summary');
})
});
// Summary
const summaryPage = $(`
@ -447,10 +463,9 @@ class App{
},
index: {
page: indexPage,
btnRank: indexPage.find('#rank'),
btnAchievement: indexPage.find('#achievement'),
btnRestart: indexPage.find('#restart'),
hint: indexPage.find('.hint'),
cnt: indexPage.find('#cnt'),
pressEnter: ()=>{
this.#pages.index.btnRestart.click();
},
@ -459,17 +474,20 @@ class App{
indexPage.find('.hint').hide();
const times = this.times;
const btnRank = indexPage.find('#rank');
const cnt = indexPage.find('#cnt');
const achievement = indexPage.find('#achievement');
const discord = indexPage.find('#discord');
const specialthanks = indexPage.find('#specialthanks');
if(times > 0) {
btnRank.show();
cnt.show();
cnt.text(`已重开${times}`);
achievement.show();
discord.show();
specialthanks.show();
return;
}
btnRank.hide();
cnt.hide();
achievement.hide();
discord.hide();
specialthanks.hide();
},
},
specialthanks: {
@ -490,6 +508,37 @@ class App{
`))
}
},
achievement: {
page: achievementPage,
clear: () => {
const total = achievementPage.find("ul#total");
const achievements = achievementPage.find("ul#achievements");
total.empty();
achievements.empty();
`<li><span class="achievementtitle">重开次数</span>紫色几率翻倍</li>`
const { times, achievement, talentRate, eventRate } = this.#life.getTotal();
total.append(`
<li class="achvg${getGrade('times', times)}"><span class="achievementtitle">已重开${times}次</span>抽到紫色几率不变</li>
<li class="achvg${getGrade('achievement', achievement)}"><span class="achievementtitle">成就达成${achievement}个</span>抽到橙色几率翻倍</li>
<li class="achvg${getGrade('talentRate', talentRate)}"><span class="achievementtitle">事件收集率</span>${Math.floor(talentRate * 100)}%</li>
<li class="achvg${getGrade('eventRate', eventRate)}"><span class="achievementtitle">天赋选择率</span>${Math.floor(eventRate * 100)}%</li>
`);
const achievementsData = this.#life.getAchievements();
achievementsData.forEach(({
name, description, hide,
grade, isAchieved
})=>{
if(hide && !isAchieved) name = description = '???';
achievements.append(
`<li class="achvg${grade} ${isAchieved?'':'mask'}"><span class="achievementtitle">${name}</span>${description}</li>`
);
})
}
},
talent: {
page: talentPage,
talentList: talentPage.find('#talents'),

View File

@ -19,6 +19,10 @@ class Event {
}
}
count() {
return Object.keys(this.#events).length;
}
check(eventId, property) {
const { include, exclude, NoRandom } = this.get(eventId);
if(NoRandom) return false;

29
src/functions/addition.js Normal file
View File

@ -0,0 +1,29 @@
export function getRate(type, value) {
switch(type) {
case 'times':
case 'achievement':
default: return 0;
}
}
export function getGrade(type, value) {
switch(type) {
case 'times':
case 'achievement':
if(value >= 100) return 3;
if(value >= 50) return 2;
if(value >= 10) return 1;
return 0;
case 'talentRate':
if(value >= 0.9) return 3;
if(value >= 0.5) return 2;
if(value >= 0.1) return 1;
return 0;
case 'eventRate':
if(value >= 0.5) return 3;
if(value >= 0.3) return 2;
if(value >= 0.1) return 1;
return 0;
default: return 0;
}
}

View File

@ -152,7 +152,46 @@ class Life {
}
getAchievements() {
return this.#achievement.list();
const ticks = {};
this.#property
.get(this.#property.TYPES.ACHV)
.forEach(([id, tick]) => ticks[id] = tick);
return this
.#achievement
.list(this.#property)
.sort((
{id: a, grade: ag, hide: ah},
{id: b, grade: bg, hide: bh}
)=>{
a = ticks[a];
b = ticks[b];
if(a&&b) return a - b;
if(!a&&!b) {
if(ah&&bh) return bg - ag;
if(ah) return 1;
if(bh) return -1;
return bg - ag;
}
if(!a) return 1;
if(!b) return -1;
});
}
getTotal() {
const TMS = this.#property.get(this.#property.TYPES.TMS);
const CACHV = this.#property.get(this.#property.TYPES.CACHV);
const CTLT = this.#property.get(this.#property.TYPES.CTLT);
const CEVT = this.#property.get(this.#property.TYPES.CEVT);
const totalTalent = this.#talent.count();
const totalEvent = this.#event.count();
return {
times: TMS,
achievement: CACHV,
talentRate: CTLT / totalTalent,
eventRate: CEVT / totalEvent,
}
}
get times() { return this.#property?.get(this.#property.TYPES.TMS) || 0; }

View File

@ -38,8 +38,12 @@ class Property {
// Achievement Total
ATLT: "ATLT", // 拥有过的天赋 Achieve Talent
AEVT: "AEVT", // 触发过的事件 Achieve Event
ACHV: "ACHV", // 达成的成就 Achievement
CTLT: "RTLT", // 天赋选择数 Count Talent
CEVT: "REVT", // 事件收集数 Count Event
CACHV: "CACHV", // 成就达成数 Count Achievement
};
#ageData;
@ -164,9 +168,16 @@ class Property {
case this.TYPES.AEVT:
case this.TYPES.ACHV:
return this.lsget(prop) || [];
case this.TYPES.CTLT:
case this.TYPES.CEVT:
case this.TYPES.CACHV:
return this.get(
this.fallback(prop)
).length;
default: return 0;
}
}
fallback(prop) {
switch(prop) {
case this.TYPES.LAGE:
@ -181,6 +192,9 @@ class Property {
case this.TYPES.HMNY: return this.TYPES.MNY;
case this.TYPES.LSPR:
case this.TYPES.HSPR: return this.TYPES.SPR;
case this.TYPES.CTLT: return this.TYPES.ATLT;
case this.TYPES.CEVT: return this.TYPES.AEVT;
case this.TYPES.CACHV: return this.TYPES.ACHV;
default: return;
}
}

View File

@ -16,6 +16,10 @@ class Talent {
}
}
count() {
return Object.keys(this.#talents).length;
}
check(talentId, property) {
const { condition } = this.get(talentId);
return checkCondition(property, condition);

View File

@ -136,7 +136,7 @@ body {
.sponsor,
#specialthanks,
#rank {
#achievement {
position: fixed;
top: 4rem;
right: 1rem;
@ -219,6 +219,44 @@ body {
text-align: center;
}
.title {
color: white;
font-size: 1.5rem;
font-weight: 700;
padding: 1rem;
}
ul#total,
#achievements {
list-style-type: none;
display: grid;
justify-items: center;
grid-template-columns: 50% 50%;
grid-auto-columns: max-content;
justify-content: center;
}
ul#total li,
#achievements li {
position: relative;
color: white;
display: inline-grid;
margin: 0.5rem;
width: 12rem;
height: 6rem;
align-items: center;
}
ul#total li .achievementtitle,
#achievements li .achievementtitle{
font-weight: 700;
font-size: 1.2rem;
}
#achievements {
overflow: scroll;
}
#themeToggleBtn {
padding: 0 0.7rem;
width: 6.5rem;
@ -296,26 +334,41 @@ body {
margin-bottom: 0;
}
.achvg0,
.grade0b {
background-color: #464646;
border: #f8f8f8 2px solid !important;
}
.achvg1,
.grade1b {
background-color: #6495ed;
border: #f8f8f8 2px solid !important;
}
.achvg2,
.grade2b {
background-color: #e2a7ff;
border: #f8f8f8 2px solid !important;
}
.achvg3,
.grade3b {
background-color: #ffa07a;
border: #f8f8f8 2px solid !important;
}
.mask::before {
display: block;
content: " ";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000;
opacity: 0.5;
}
@media (min-width:1080px) {
.grade0b:hover {
background-color: #c0c0c0;

View File

@ -6,9 +6,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="やり直すんだ。そして、次はうまくやる。"/>
<meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/>
<title>Life Restart</title>
<link id="themeLink" rel="stylesheet" href="light.css">
<link rel="manifest" href="./manifest.json">
<title>Life Restart</title>
</head>
<body>
<div class="banners-container">
@ -32,8 +32,8 @@
</div>
<a href="https://github.com/VickScarlet/lifeRestart" class="github-corner" style="z-index: 9999;" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; left: 0; transform: scale(-1, 1);" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style></a>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.js" integrity="sha512-wUa0ktp10dgVVhWdRVfcUO4vHS0ryT42WOEcXjVVF2+2rcYBKTY7Yx7JCEzjWgPV+rj2EDUr8TwsoWF6IoIOPg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="../lib/jquery-3.6.0.min.js"></script>
<script src="../lib/dom-to-image.min.js"></script>
<script src="../public/bundle.js"></script>
<script>
if ('serviceWorker' in navigator) {

View File

@ -135,7 +135,7 @@ body {
.sponsor,
#specialthanks,
#rank {
#achievement {
position: fixed;
top: 4rem;
right: 1rem;
@ -217,6 +217,42 @@ body {
text-align: center;
}
.title {
font-size: 1.5rem;
font-weight: 700;
padding: 1rem;
}
ul#total,
#achievements {
list-style-type: none;
display: grid;
justify-items: center;
grid-template-columns: 50% 50%;
grid-auto-columns: max-content;
justify-content: center;
}
ul#total li,
#achievements li {
position: relative;
display: inline-grid;
margin: 0.5rem;
width: 12rem;
height: 6rem;
align-items: center;
}
ul#total li .achievementtitle,
#achievements li .achievementtitle{
font-weight: 700;
font-size: 1.2rem;
}
#achievements {
overflow: scroll;
}
#themeToggleBtn {
padding: 0 0.7rem;
width: 6.5rem;
@ -525,26 +561,42 @@ i {
animation-iteration-count: 1;
}
.achvg0,
.grade0b {
background-color: #ededed;
border: #c5c5c5 2px solid !important;
}
.achvg1,
.grade1b {
background-color: #7ea5ec;
border: #c5c5c5 2px solid !important;
}
.achvg2,
.grade2b {
background-color: #e2a7ff;
border: #c5c5c5 2px solid !important;
}
.achvg3,
.grade3b {
background-color: #ffa07a;
border: #c5c5c5 2px solid !important;
}
.mask::before {
display: block;
content: " ";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000;
opacity: 0.5;
}
@media (min-width:1080px) {
.grade0b:hover {
background-color: #868686;

View File

@ -7,9 +7,8 @@
<meta name="description" content="やり直すんだ。そして、次はうまくやる。"/>
<meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/>
<link id="themeLink" rel="stylesheet" href="light.css">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9857163863537600" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.js" integrity="sha512-wUa0ktp10dgVVhWdRVfcUO4vHS0ryT42WOEcXjVVF2+2rcYBKTY7Yx7JCEzjWgPV+rj2EDUr8TwsoWF6IoIOPg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="../lib/jquery-3.6.0.min.js"></script>
<script src="../lib/dom-to-image.min.js"></script>
<script type="module" src="../src/index.js"></script>
<title>Life Restart</title>
</head>