3 Commits

Author SHA1 Message Date
Vick Scarlet
ab705dd46c build version 2021-12-14 18:48:42 +08:00
Vick Scarlet
a1e4232369 change talent replace before property allocate 2021-12-14 18:47:05 +08:00
Vick Scarlet
f4d7b3ae3c add event grade 2021-12-14 18:06:18 +08:00
35 changed files with 1146 additions and 60 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,8 +1,8 @@
{
"x":0,
"type":"View",
"selectedBox":1,
"selecteID":152,
"selectedBox":88,
"selecteID":153,
"props":{"width":1125,"sceneColor":"#000000","sceneBg":"laya/views/view/CyberTheme/CyberTrajectory.png","runtime":"Laya.runtime.ViewBase","height":2436},
"nodeParent":-1,
"label":"View",
@@ -889,13 +889,14 @@
"props":{"top":440,"right":20,"left":20,"bottom":250},
"nodeParent":1,
"label":"Box",
"isOpen":false,
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":102,
"child":[
{
"x":30,
"type":"Image",
"props":{"top":0,"skin":"images/border/border_1@3x.png","right":0,"left":0,"bottom":0},
"nodeParent":102,
@@ -908,6 +909,7 @@
]
},
{
"x":30,
"type":"Panel",
"props":{"var":"panelTrajectory","vScrollBarSkin":"images/slider/vslider_1@3x.png","top":80,"right":20,"name":"panelTrajectory","left":0,"bottom":80},
"nodeParent":102,
@@ -919,17 +921,19 @@
"compId":18,
"child":[
{
"x":45,
"type":"VBox",
"props":{"var":"vboxTrajectory","top":0,"right":40,"name":"vboxTrajectory","left":20},
"nodeParent":18,
"label":"VBox(vboxTrajectory)",
"isOpen":false,
"isOpen":true,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
"compId":17,
"child":[
{
"x":60,
"type":"Box",
"props":{"right":0,"name":"boxTrajectoryItem","left":0},
"nodeParent":17,
@@ -941,11 +945,25 @@
"compId":88,
"child":[
{
"x":75,
"type":"Box",
"props":{"y":0,"width":10,"top":0,"runtime":"Laya.runtime.ColorfulBox","name":"boxGrade","left":0,"height":50},
"nodeParent":88,
"label":"Box(boxGrade)",
"isDirectory":false,
"isAniNode":true,
"hasChild":false,
"compId":153,
"child":[
]
},
{
"x":75,
"type":"HBox",
"props":{"y":0,"x":200,"name":"hboxAge","anchorX":1,"align":"middle"},
"props":{"y":0,"x":220,"name":"hboxAge","anchorX":1,"align":"middle"},
"nodeParent":88,
"label":"HBox(hboxAge)",
"isOpen":true,
"isOpen":false,
"isDirectory":true,
"isAniNode":true,
"hasChild":true,
@@ -989,8 +1007,9 @@
}]
},
{
"x":75,
"type":"Label",
"props":{"wordWrap":true,"text":"你的父母开始辅导你数学和英语,智力+1","right":0,"name":"labContent","left":220,"leading":44,"fontSize":50,"font":"方正像素12","color":"#ffffff"},
"props":{"wordWrap":true,"text":"你的父母开始辅导你数学和英语,智力+1","right":0,"name":"labContent","left":240,"leading":44,"fontSize":50,"font":"方正像素12","color":"#ffffff"},
"nodeParent":88,
"label":"Label(labContent)",
"isDirectory":false,
@@ -1005,6 +1024,7 @@
"$HIDDEN":false
},
{
"x":30,
"type":"Box",
"props":{"y":20,"x":20,"var":"btnUp","top":20,"right":20,"name":"btnUp","left":20,"height":50},
"nodeParent":102,
@@ -1053,6 +1073,7 @@
}]
},
{
"x":30,
"type":"Box",
"props":{"y":1676,"x":20,"var":"btnDown","right":20,"name":"btnDown","left":20,"height":50,"bottom":20},
"nodeParent":102,

View File

@@ -16,7 +16,7 @@
"babel-loader": "^8.2.2",
"core-js": "^3.17.2",
"html-webpack-plugin": "^5.5.0",
"v-transform": "^1.0.1",
"v-transform": "^1.0.2",
"webpack": "^5.64.4",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.1.0"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
public/chunk/33.6a18b.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="やり直すんだ。そして、次はうまくやる。"/><meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/><meta name="renderer" content="webkit"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="full-screen" content="true"/><meta name="x5-fullscreen" content="true"/><meta name="360-fullscreen" content="true"/><meta name="theme-color" content="#157878"/><meta name="laya" screenorientation="landscape"/><meta http-equiv="expires" content="0"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>Life Restart</title><script src="libs/laya/min/laya.core.min.js"></script><script src="libs/laya/min/laya.webgl.min.js"></script><script src="libs/laya/min/laya.filter.min.js"></script><script src="libs/laya/min/laya.particle.min.js"></script><script src="libs/laya/min/laya.ui.min.js"></script><script defer="defer" src="chunk/main.09389.js"></script></head><body style="background:black"></body></html>
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="やり直すんだ。そして、次はうまくやる。"/><meta name="keywords" content="人生重开模拟器 liferestart life restart remake 人生重来"/><meta name="renderer" content="webkit"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="full-screen" content="true"/><meta name="x5-fullscreen" content="true"/><meta name="360-fullscreen" content="true"/><meta name="theme-color" content="#157878"/><meta name="laya" screenorientation="landscape"/><meta http-equiv="expires" content="0"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>Life Restart</title><script src="libs/laya/min/laya.core.min.js"></script><script src="libs/laya/min/laya.webgl.min.js"></script><script src="libs/laya/min/laya.filter.min.js"></script><script src="libs/laya/min/laya.particle.min.js"></script><script src="libs/laya/min/laya.ui.min.js"></script><script defer="defer" src="chunk/main.c7a9c.js"></script></head><body style="background:black"></body></html>

View File

@@ -120,9 +120,14 @@ class App{
$ui.popup(UI.popups.ACHIEVEMENT, {achievement});
})
$$on('message', ([message, ...args]) => {
$ui.popup(UI.popups.MESSAGE, {message: $_.format(
$lang[message], ...args
) });
if(Array.isArray(message)) {
message = message.map(([m, ...a]) => $_.format($lang[m], ...a)) .join('\n');
} else {
message = $_.format(
$lang[message], ...args
);
}
$ui.popup(UI.popups.MESSAGE, {message});
})
}

View File

@@ -83,10 +83,17 @@ function deepMapSet(target, source) {
return target;
}
function deepGet(obj, path) {
for(const key of path.split('.')) {
if(!(key in obj)) return undefined;
obj = obj[key];
}
return obj;
}
function format(str, ...args) {
const replace = set => (match, key) => {
const value = set[key];
const value = deepGet(set, key);
switch(typeof value) {
case 'object': return JSON.stringify(value);
case 'boolean':

View File

@@ -143,5 +143,6 @@ export default ({
F_TalentConflict: 'Conflict with talent ({0})',
F_TalentSelectLimit: 'Talent select limit {0}',
F_TalentSelectNotComplect: 'Please select {0} talent',
F_PropertyPointLeft: 'You have left {0} property point'
F_PropertyPointLeft: 'You have left {0} property point',
F_TalentReplace: 'Talent replace [{source.name}] -> [{target.name}]',
});

View File

@@ -143,5 +143,6 @@ export default ({
F_TalentConflict: '与已选的「{0}」天赋冲突',
F_TalentSelectLimit: '只能选 {0} 个天赋',
F_TalentSelectNotComplect: '要选满{0}个天赋',
F_PropertyPointLeft: '你还有 {0} 属性点没有分配完'
F_PropertyPointLeft: '你还有 {0} 属性点没有分配完',
F_TalentReplace: '天赋替换【{source.name}】->【{target.name}】',
});

View File

@@ -22,6 +22,7 @@ class Life {
#propertyAllocateLimit;
#defaultPropertys;
#specialThanks;
#initialData;
async initial(i18nLoad, commonLoad) {
const [age, talents, events, achievements, specialThanks] = await Promise.all([
@@ -58,25 +59,28 @@ class Life {
this.#property.config(propertyConfig);
}
restart(allocation) {
const propertys = clone(this.#defaultPropertys);
for(const key in allocation) {
propertys[key] = clone(allocation[key]);
}
remake(talents) {
this.#initialData = clone(this.#defaultPropertys);
this.#initialData.TLT = clone(talents);
this.#triggerTalents = {};
const contents = this.talentReplace(propertys.TLT);
this.#property.restart(propertys);
return this.talentReplace(this.#initialData.TLT);
}
start(allocation) {
for(const key in allocation) {
this.#initialData[key] = clone(allocation[key]);
}
this.#property.restart(this.#initialData);
this.doTalent()
this.#property.restartLastStep();
this.#achievement.achieve(
this.AchievementOpportunity.START,
this.#property
)
return contents;
);
}
getPropertyPoints(selectedTalentIds) {
return this.#defaultPropertyPoints + this.#talent.allocationAddition(selectedTalentIds);
getPropertyPoints() {
return this.#defaultPropertyPoints + this.#talent.allocationAddition(this.#initialData.TLT);
}
getTalentCurrentTriggerCount(talentId) {

File diff suppressed because one or more lines are too long

View File

@@ -41,9 +41,11 @@ export default class CyberProperty extends ui.view.CyberTheme.CyberPropertyUI {
init({talents}) {
this.listSelectedTalents.array = talents;
const talentIds = talents.map(talent => talent.id);
// core.talentReplace(talentIds);
this.#propertyPoints = core.getPropertyPoints(talentIds);
const replace = core.remake(talents.map(talent => talent.id));
if(replace.length > 0) {
$$event('message', [replace.map(v => ['F_TalentReplace', v])]);
}
this.#propertyPoints = core.getPropertyPoints();
this.#propertyAllocateLimit = core.propertyAllocateLimit;
this.labLeftPropertyPoint.text = this.#propertyPoints;
this.#propertyAllocate = {
@@ -51,7 +53,6 @@ export default class CyberProperty extends ui.view.CyberTheme.CyberPropertyUI {
[this.#types.INT]: 0,
[this.#types.STR]: 0,
[this.#types.MNY]: 0,
[this.#types.TLT]: talentIds,
}
this.updateAllocate();
}

View File

@@ -60,6 +60,7 @@ export default class CyberTrajectory extends ui.view.CyberTheme.CyberTrajectoryU
const item = CyberTrajectory.#createComponent('boxTrajectoryItem');
item.labContent = item.getChildByName('labContent');
item.labAge = item.getChildByName('hboxAge').getChildByName('labAge');
item.boxGrade = item.getChildByName('boxGrade');
return item;
}
#isEnd;
@@ -73,7 +74,7 @@ export default class CyberTrajectory extends ui.view.CyberTheme.CyberTrajectoryU
this.#trajectoryItems = [];
this.#isEnd = false;
this.#talents = talents;
core.restart(propertyAllocate);
core.start(propertyAllocate);
this.updateProperty();
this.onNext();
}
@@ -134,6 +135,10 @@ export default class CyberTrajectory extends ui.view.CyberTheme.CyberTrajectoryU
}
}
).join('\n');
$_.deepMapSet(
item.boxGrade,
$ui.common.gradeBlk[content[content.length - 1].grade || 0]
);
this.vboxTrajectory.addChild(item);
this.#trajectoryItems.push(item);
this.#trajectoryItems.forEach((item, index) => item.y = index);

View File

@@ -41,9 +41,11 @@ export default class Property extends ui.view.DefaultTheme.PropertyUI {
init({talents}) {
this.listSelectedTalents.array = talents;
const talentIds = talents.map(talent => talent.id);
// core.talentReplace(talentIds);
this.#propertyPoints = core.getPropertyPoints(talentIds);
const replace = core.remake(talents.map(talent => talent.id));
if(replace.length > 0) {
$$event('message', [replace.map(v => ['F_TalentReplace', v])]);
}
this.#propertyPoints = core.getPropertyPoints();
this.#propertyAllocateLimit = core.propertyAllocateLimit;
this.labLeftPropertyPoint.text = this.#propertyPoints;
this.#propertyAllocate = {
@@ -51,7 +53,6 @@ export default class Property extends ui.view.DefaultTheme.PropertyUI {
[this.#types.INT]: 0,
[this.#types.STR]: 0,
[this.#types.MNY]: 0,
[this.#types.TLT]: talentIds,
}
this.updateAllocate();
}

View File

@@ -35,6 +35,9 @@ export default class Trajectory extends ui.view.DefaultTheme.TrajectoryUI {
item.labAge = item.getChildByName('hboxAge').getChildByName('labAge');
const config = $ui.common.trajectoryItem;
$_.deepMapSet(item, config.box);
item.grade = grade => {
$_.deepMapSet(item, config.grade[grade || 0]);
}
item.getChildByName('hboxAge')._childs.forEach(child => child.color = config.ageColor);
item.labContent.color = config.contentColor;
return item;
@@ -50,7 +53,7 @@ export default class Trajectory extends ui.view.DefaultTheme.TrajectoryUI {
this.#trajectoryItems = [];
this.#isEnd = false;
this.#talents = talents;
core.restart(propertyAllocate);
core.start(propertyAllocate);
this.updateProperty();
this.onNext();
}
@@ -111,6 +114,7 @@ export default class Trajectory extends ui.view.DefaultTheme.TrajectoryUI {
}
}
).join('\n');
item.grade(content[content.length - 1].grade);
this.vboxTrajectory.addChild(item);
this.#trajectoryItems.push(item);
this.#trajectoryItems.forEach((item, index) => item.y = index);

View File

@@ -8,10 +8,12 @@ export default class MessagePopup extends ui.view.MessagePopupUI {
}
async popup({message}, parent) {
this.message.text = message;
this.message.commitMeasure();
this.height = this.message.height + this.boxBg.radius * 2 + this.message.fontSize;
Laya.Tween.clearAll(this);
this.alpha = 0;
this.y = - 2 * this.height;
this.message.text = message;
await Laya.promises.Tween.to(this, { y: 0, alpha: 1 }, 300, Laya.Ease.backOut),
await Laya.promises.Tween.to(this, { alpha: 0}, 300, Laya.Ease.strongIn, 3000);
}

View File

@@ -55,6 +55,24 @@ const cyber = {
'#b17cffff',
'#ffce45ff',
],
gradeBlk: [
{
defaultColor: '#cccccc',
hoverColor: '#cccccc',
},
{
defaultColor: '#55fffe',
hoverColor: '#55fffe',
},
{
defaultColor: '#b17cff',
hoverColor: '#b17cff',
},
{
defaultColor: '#ffce45',
hoverColor: '#ffce45',
},
]
},
pages: {
[pages.MAIN]: {
@@ -183,12 +201,26 @@ const dark = {
defaultFontColor: '#eeeeee',
trajectoryItem: {
box: {
defaultColor: '#4a5361',
defaultStroke: '#4a5361',
hoverColor: '#4a5361',
hoverStroke: '#4a5361',
filters: ()=>[new Laya.GlowFilter("#eeeeee", 8, 0, 0)],
},
grade: [
{
defaultColor: '#4a5361',
hoverColor: '#4a5361',
},
{
defaultColor: '#1160b0',
hoverColor: '#1160b0',
},
{
defaultColor: '#9379ca',
hoverColor: '#9379ca',
},
{
defaultColor: '#ab6157',
hoverColor: '#ab6157',
},
],
ageColor: '#ffffee',
contentColor: '#eeeeee',
},
@@ -625,6 +657,21 @@ const light = {
box: {
filters: ()=>[new Laya.GlowFilter("#b1b1b1", 8, 0, 0)],
},
grade: [
{},
{
defaultColor: '#55fffe',
hoverColor: '#55fffe',
},
{
defaultColor: '#b17cff',
hoverColor: '#b17cff',
},
{
defaultColor: '#ffce45',
hoverColor: '#ffce45',
},
],
ageColor: '#000000',
contentColor: '#000000',
},

View File

@@ -3537,10 +3537,10 @@ uuid@^3.4.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
v-transform@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/v-transform/-/v-transform-1.0.1.tgz#380dd837e3b14189ccc47aafa8e675601403f2f2"
integrity sha512-F1VBbBLoFkFdpxFiHCq5neSoBsfFPDbecye5+B5OjE05U0K2RcdZR7lFkziqo1WP4Do36lUjN5Ok/E6GLUJgiQ==
v-transform@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/v-transform/-/v-transform-1.0.2.tgz#93f5be5e7ea6f070d544ab3d96569bace91c754d"
integrity sha512-oBl76Q/JWVvglT3yHujWj6uNS4QygAERhdcdPKHpd47+K9+gotBUvCrdiVnizLscLzsz8GGi/KlOwZHnm9STxA==
dependencies:
commander "^8.2.0"
xlsx "^0.17.1"