装备:强化

This commit is contained in:
luying
2022-02-15 18:01:37 +08:00
parent 465cc15e43
commit f25d44e391
18 changed files with 12919 additions and 187 deletions

View File

@@ -102,6 +102,7 @@ import { pick } from "underscore";
import _ = require("underscore");
import { dicEquipById, dicEquipIdByJobClassAndEplace, loadEquip } from "./dictionary/DicEquip";
import { dicJewel, loadJewel } from "./dictionary/DicJewel";
import { dicEquipStrength, loadEquipStrength } from "./dictionary/DicEquipStrength";
export const gameData = {
blurprtCompose: dicBlueprtCompose,
@@ -253,6 +254,7 @@ export const gameData = {
equipById: dicEquipById,
equipIdByJobAndEPlace: dicEquipIdByJobClassAndEplace,
jewel: dicJewel,
equipStrengthenCost: dicEquipStrength,
};
// 在此提供一些原先在gamedata中提供的方法以便更方便获取gameData数据
@@ -1005,6 +1007,7 @@ function loadDatas() {
loadApi();
loadServerConst();
loadEquip();
loadEquipStrength();
loadJewel();
}

View File

@@ -6,7 +6,7 @@ import { RewardInter } from '../interface';
export interface DicEquipStrength {
// id
readonly id: number;
// 等级
// 等级,1级升2级读2级数据
readonly lv: number;
// 消耗
readonly consume: RewardInter[];
@@ -16,7 +16,7 @@ export interface DicEquipStrength {
export const dicEquipStrength = new Map<number, DicEquipStrength>();
export function loadEquipStrength() {
dicEquipStrength.clear();
let arr = readFileAndParse(FILENAME.DIC_EQUIP);
let arr = readFileAndParse(FILENAME.DIC_EQUIP_STRENGTH);
arr.forEach(o => {
o.consume = parseGoodStr(o.consume);

View File

@@ -167,19 +167,22 @@ export function calPlayerCe(hero: HeroType, update: HeroUpdate, type: number, ar
case HERO_SYSTEM_TYPE.COMPOSE_EQUIP:
heroAttrs = calComposeEquipIncAttr(hero, update, args[0]);
break;
case HERO_SYSTEM_TYPE.EQUIP:
case HERO_SYSTEM_TYPE.EQUIP_STRENGTH:
heroAttrs = calEquipStrengthIncAttr(hero, update, args);
break;
case HERO_SYSTEM_TYPE.EQUIP: //
heroAttrs = calEquipPutOnOffIncAttr(hero, args, addSeidList, removeSeidList);
break;
case HERO_SYSTEM_TYPE.EQUIP_BASE:
case HERO_SYSTEM_TYPE.EQUIP_BASE: //
heroAttrs = calHeroEquipIncAttr(hero);
break;
case HERO_SYSTEM_TYPE.RESTRENGTHEN:
case HERO_SYSTEM_TYPE.RESTRENGTHEN: //
heroAttrs = calRestrengthenIncAttr(hero, args.shift(), args, addSeidList, removeSeidList);
break;
case HERO_SYSTEM_TYPE.JEWEL_ON:
case HERO_SYSTEM_TYPE.JEWEL_ON: //
heroAttrs = calHeroCeWhenJewelOnOrOff(hero, args[0], args[1]);
break;
case HERO_SYSTEM_TYPE.JEWEL_OFF:
case HERO_SYSTEM_TYPE.JEWEL_OFF: //
heroAttrs = calHeroCeWhenJewelOnOrOff(hero, 0, args[0]);
break;
case HERO_SYSTEM_TYPE.SCROLL:
@@ -616,6 +619,22 @@ export function calComposeEquipIncAttr(hero: HeroType, update: HeroUpdate, eplac
return heroAttrs;
}
export function calEquipStrengthIncAttr(hero: HeroType, update: HeroUpdate, eplaceIds: number[]) {
let { attr: heroAttrs, ePlace: oldEplace } = hero;
let { ePlace: newEplace } = update;
for(let eplaceId of eplaceIds) {
let oldEquip = oldEplace.find(cur => cur.id == eplaceId);
let newEquip = newEplace.find(cur => cur.id == eplaceId);
if(newEquip && oldEquip) {
let dicEquip = gameData.equipById.get(oldEquip.equipId);
for(let attr of dicEquip.attributeUp) {
updateHeroAttr(heroAttrs, attr.id, { inc: { fixUp: attr.num * (newEquip.lv - oldEquip.lv) * HERO_CE_RATIO } });
}
}
}
return heroAttrs
}
/**
* 穿脱, removeSeidList原来身上穿着的所有装备的seid包括套装的
* @param {HeroType} hero 武将