羁绊:修改武将羁绊格式
This commit is contained in:
@@ -5,7 +5,7 @@ import { RoleUpdate, Teraph } from "../../db/Role";
|
||||
import { AttrCell, Attribute, EquipAttr, HeroAttr, RoleCeType, SchoolAttr, ScrollAttr } from "../../db/RoleCe";
|
||||
import { TopHero } from "../../domain/dbGeneral";
|
||||
import { AttributeCal } from "../../domain/roleField/attribute";
|
||||
import { gameData, getEquipQualityIdByEquipIdAndPoint, getEquipStarAttrByStage, getEquipStrenthenAttr, getEquipSuitByHero, getFriendShipById, getHeroStarByQuality, getHeroWakeByQuality, getJewelConditionByLvAndSeId, getJobByGradeAndClass, getSchoolRateByStar, getScollByStar, getTeraph } from "../../pubUtils/data";
|
||||
import { gameData, getEquipQualityIdByEquipIdAndPoint, getEquipStarAttrByStage, getEquipStrenthenAttr, getEquipSuitByHero, getFriendShipByIdAndLv, getHeroStarByQuality, getHeroWakeByQuality, getJewelConditionByLvAndSeId, getJobByGradeAndClass, getSchoolRateByStar, getScollByStar, getTeraph } from "../../pubUtils/data";
|
||||
import { DicRandomEffectPool } from "../../pubUtils/dictionary/DicRandomEffectPool";
|
||||
import { DicSe } from "../../pubUtils/dictionary/DicSe";
|
||||
import { addToMap, deepCopy } from "../../pubUtils/util";
|
||||
@@ -45,13 +45,13 @@ export class CalCe {
|
||||
let lv = this.data.heroLv.get(hid)||1;
|
||||
for(let attrId = ABI_TYPE.ABI_HP; attrId < ABI_TYPE.ABI_MAX; attrId++) {
|
||||
if(!this.data.heroAttrs.has(`${hid}_${attrId}`) && !this.data.globalAttrs.has(attrId)) continue;
|
||||
let { mainBase = 0, subBase = 0, job = 0, starUp = 0, connect = 0, favour = 0, talent = 0, equipQuality = 0, equipStrength = 0, equipStar = 0, equipSuit = 0, jewel = 0, stone = 0 } = this.data.heroAttrs.get(`${hid}_${attrId}`)||{};
|
||||
let { mainBase = 0, subBase = 0, job = 0, starUp = 0, connect = 0, talent = 0, equipQuality = 0, equipStrength = 0, equipStar = 0, equipSuit = 0, jewel = 0, stone = 0 } = this.data.heroAttrs.get(`${hid}_${attrId}`)||{};
|
||||
let { school = 0, teraph = 0, title = 0, scroll = 0, skin = 0 } = this.data.getGlobalAttrById(attrId)||{};
|
||||
let val = 0, str = '';
|
||||
if(ABI_TYPE_MAIN.indexOf(attrId) != -1) {
|
||||
// {[hp1 + lv * hp2 + hp3 * ( 1 + hp4 )] * (1 + hp5 ) + [( hp6 + hp7 ) * ( 1 + hp8 )] } * ( 1 + hp9 ) + hp10 + hp11
|
||||
val = ((mainBase + job + lv * starUp + connect * ( 1 + favour/100 )) * ( 1 + school/100 + talent/100 ) + (( equipQuality + equipStrength ) * ( 1 + ( equipStar/100 + equipSuit/100 ))) ) * ( 1 + jewel/100 ) + stone + teraph + title + scroll + skin;
|
||||
str += `{[${mainBase}+${job}+${lv}*${starUp}+${connect}*(1+${favour}/100)]*(1+${school}/100+${talent}/100)+[(${equipQuality}+${equipStrength})*(1+${equipStar}/100+${equipSuit}/100)]}*(1+${jewel}/100)+${stone}+${teraph}+${title}+${scroll}+${skin}`;
|
||||
val = ((mainBase + job + lv * starUp + connect ) * ( 1 + school/100 + talent/100 ) + (( equipQuality + equipStrength ) * ( 1 + ( equipStar/100 + equipSuit/100 ))) ) * ( 1 + jewel/100 ) + stone + teraph + title + scroll + skin;
|
||||
str += `{[${mainBase}+${job}+${lv}*${starUp}+${connect}]*(1+${school}/100+${talent}/100)+[(${equipQuality}+${equipStrength})*(1+${equipStar}/100+${equipSuit}/100)]}*(1+${jewel}/100)+${stone}+${teraph}+${title}+${scroll}+${skin}`;
|
||||
} else {
|
||||
// attr1 + attr2 + attr3 + attr4 + attr5 + attr6 + attr7 + attr8 + attr9
|
||||
val = subBase + job + talent + teraph + school + title + jewel + skin + equipStar;
|
||||
@@ -191,26 +191,12 @@ export class CalCe {
|
||||
}
|
||||
}
|
||||
|
||||
// 好感度
|
||||
public setFavour(hid: number, favourLv: number, connections: Connect[]) {
|
||||
this.data.clearHeroAttrByHid(hid, 'favour');
|
||||
let currentFiendShipLevel = gameData.friendShipLevelMap.get(favourLv);
|
||||
let add = currentFiendShipLevel.add;
|
||||
for (let {shipId, level} of connections) {
|
||||
let dicHeroFriendShip = getFriendShipById(shipId, level);
|
||||
for (let { id } of dicHeroFriendShip.attributes) {
|
||||
let heroAttr = this.data.getHeroAttrByHidAndId(hid, id);
|
||||
heroAttr.favour = add;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 羁绊
|
||||
public setConnection(hid: number, connections: Connect[]) {
|
||||
this.data.clearHeroAttrByHid(hid, 'connect');
|
||||
let map = new Map<number, number>(); // attrId => val;
|
||||
for(let { shipId, level = 0 } of connections) {
|
||||
let currentShip = getFriendShipById(shipId, level);
|
||||
let currentShip = getFriendShipByIdAndLv(hid, shipId, level);
|
||||
if (currentShip) {
|
||||
for (let { id, number: val } of currentShip.attributes) {
|
||||
if(!map.has(id)) {
|
||||
@@ -988,7 +974,7 @@ abstract class HeroAllAttr {
|
||||
job: number = 0; // hp1 & attr2, 职业属性(dic_zyz_job的attr)
|
||||
starUp: number = 0; // hp2, 角色升星成长(dic_zyz_hero_star的hp或dic_zyz_hero_wake的hp)
|
||||
connect: number = 0; // hp3, 角色羁绊固定值(dic_zyz_friend_ship的attribute)
|
||||
favour: number = 0; // hp4, 声望加成(dic_zyz_friend_ship_level的add)
|
||||
favour: number = 0; // 删除-hp4, 声望加成(dic_zyz_friend_ship_level的add)
|
||||
talent: number = 0; // hp5 & attr3, 天赋树百分比加成(dic_zyz_hero_talent的levelSeid,然后对应到dic_zyz_se)
|
||||
equipQuality: number = 0; // hp6, 装备品质基础值(dic_zyz_equipQuality的attribute)
|
||||
equipStrength: number = 0; // hp7, 装备强化值(dic_zyz_equipStrenthAttr的attr)
|
||||
|
||||
Reference in New Issue
Block a user