大侠
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

67 lines
1.4 KiB

import CsvMgr from "../Mgr_CSV/CsvMgr";
import { ConfidanteDataProxy } from "../Mgr_LocalData/DataTypeProxy/ConfidanteDataProxy";
import { ConfidanteData } from "./GameInterface";
export default class ConfidanteDataPoxy{
Data:ConfidanteData;
constructor (_data:ConfidanteData){
this.Data = _data;
}
/**
* 获取经脉id
*/
get id() {
return this.Data.id;
}
/**
* 获取经脉等级
*/
get level() {
return this.Data.level;
}
/**
* 设置经脉等级
* @param {number} value - 新的等级值
*/
set level(value) {
this.Data.level = value;
ConfidanteDataProxy.Ins.Save();
}
/**
* 获取经脉是否解锁
*/
get state() {
return this.Data.state;
}
/**
* 设置经脉是否解锁
* @param {boolean} value - 新的解锁状态
*/
set state(value) {
this.Data.state = value;
ConfidanteDataProxy.Ins.Save();
}
/**
* 获取经脉配置数据
*/
get config() {
return CsvMgr.Confidante_csv[this.Data.id];
}
get cost(){
return this.level * this.config.cost;
}
/**
* 获取第一个属性值(基础值 + 等级成长)
*/
get prop() {
const config = this.config;
return this.state? (config.prop + Number(config.prop_add) * (this.level - 1)) : 0;
}
}