属性:加值和加百分比的type值修改
This commit is contained in:
@@ -110,7 +110,7 @@ export async function initMaintenance(maintenance?: MaintenanceType) {
|
||||
let { startTime, marquee } = maintenance;
|
||||
if(marquee) {
|
||||
let result = await generateMarqueeSchedule(<MarqueeType>marquee);
|
||||
console.log(result);
|
||||
// console.log(result);
|
||||
}
|
||||
if(Date.now() > startTime.getTime()) {
|
||||
await startMaintenance(maintenance);
|
||||
|
||||
@@ -360,7 +360,7 @@ export async function incOnlineTime(userCode: string, isToday: boolean, incTime:
|
||||
let tomorrow = moment().add(1, 'days').hours(0).minutes(0).seconds(0).unix();
|
||||
let result = await redisClient().hincrbyAsync(key, userCode, incTime);
|
||||
let result2 = await redisClient().expireatAsync(key, tomorrow);
|
||||
console.log(result2)
|
||||
// console.log(result2)
|
||||
return result;
|
||||
} else {
|
||||
return await redisClient().hincrbyAsync(key, userCode, incTime);
|
||||
|
||||
@@ -99,13 +99,11 @@ export const ABI_TYPE_SUB = [
|
||||
|
||||
export enum SEID_TYPE {
|
||||
/**属性固定值加成(数值) */
|
||||
TYPE101 = 101,
|
||||
/**属性固定值加成(百分比) */
|
||||
TYPE102 = 102,
|
||||
TYPE101 = 1,
|
||||
/**基础属性加百分比,除以1000以后加到ratioUp */
|
||||
TYPE103 = 103,
|
||||
TYPE103 = 2,
|
||||
/**次级属性的百分比加成,乘以100后加到fixUp */
|
||||
TYPE104 = 104,
|
||||
TYPE104 = 3,
|
||||
/**复合属性 */
|
||||
TYPE999 = 999,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ABI_STAGE, ABI_STAGE_TO_TYPE, ABI_TYPE, ABI_TYPE_MAIN, HERO_SUB_ATTR_RATIO, HERO_SYSTEM_TYPE, SEID_TYPE } from "../../consts";
|
||||
import { ABI_STAGE, ABI_STAGE_TO_TYPE, ABI_TYPE, ABI_TYPE_MAIN, HERO_CE_RATIO, HERO_SUB_ATTR_RATIO, HERO_SYSTEM_TYPE, SEID_TYPE } from "../../consts";
|
||||
import { HeroModel, HeroUpdate, CeAttrData } from "../../db/Hero";
|
||||
import { CeAttrDataRole, RoleUpdate } from "../../db/Role";
|
||||
import { gameData, getHeroStarByQuality, getHeroWakeByQuality } from "../../pubUtils/data";
|
||||
@@ -217,13 +217,16 @@ function addSeidEffect(this: CalRoleCe|CalHeroCe, seidList: number[]) {
|
||||
for (let { type, gainValueArr: [ability, value] } of effectList) {
|
||||
if (type == SEID_TYPE.TYPE101) { // 加值
|
||||
this.getSingleAttrObj(ability).updateAttr({ inc: { fixUp: value } });
|
||||
} else if (type == SEID_TYPE.TYPE102) { // 加百分比
|
||||
} else if (type == SEID_TYPE.TYPE103) { // 主属性加百分比
|
||||
if(ABI_TYPE_MAIN.includes(ability)) {
|
||||
this.getSingleAttrObj(ability).updateAttr({ inc: {ratioUp: value } });
|
||||
} else { // 次级属性102特殊处理
|
||||
this.getSingleAttrObj(ability).updateAttr({ inc: {fixUp: value * HERO_SUB_ATTR_RATIO } });
|
||||
this.getSingleAttrObj(ability).updateAttr({ inc: {ratioUp: value / 1000} });
|
||||
}
|
||||
} else if (type == SEID_TYPE.TYPE104) { // 次级属性加百分比
|
||||
if(!ABI_TYPE_MAIN.includes(ability)) {
|
||||
this.getSingleAttrObj(ability).updateAttr({ inc: { fixUp: value * 100 * HERO_CE_RATIO } });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -865,12 +865,6 @@ function addSeidEffect(heroAttrs: CeAttrData[], addSeidList: Array<number>, remo
|
||||
for (let { type, gainValueArr: [ability, value] } of effectList) {
|
||||
if (type == SEID_TYPE.TYPE101) { // 加值
|
||||
updateHeroAttr(heroAttrs, ability, { inc: {fixUp: value * multi * HERO_CE_RATIO} });
|
||||
} else if (type == SEID_TYPE.TYPE102) { // 加百分比
|
||||
if(ABI_TYPE_MAIN.includes(ability)) {
|
||||
updateHeroAttr(heroAttrs, ability, { inc: {ratioUp: value * multi} });
|
||||
} else { // 次级属性102特殊处理
|
||||
updateHeroAttr(heroAttrs, ability, { inc: {fixUp: value * multi * HERO_SUB_ATTR_RATIO } });
|
||||
}
|
||||
} else if (type == SEID_TYPE.TYPE103) { // 主属性加百分比
|
||||
if(ABI_TYPE_MAIN.includes(ability)) {
|
||||
updateHeroAttr(heroAttrs, ability, { inc: {ratioUp: value / 1000 * multi} });
|
||||
|
||||
Reference in New Issue
Block a user