战斗:远征&pvp,属性字段修改

This commit is contained in:
luying
2021-07-30 16:33:14 +08:00
parent a48706fb8d
commit 6ab6a381e2
9 changed files with 144 additions and 176 deletions

View File

@@ -57,7 +57,7 @@ import { dicArmyBossRank, loadArmyBossRank } from './dictionary/DicArmyBossRank'
import { dicArmyDonate, loadArmyDonate } from './dictionary/DicArmyDonateBoxReward';
import { dicRoleFriend, DicRoleFriend, loadRoleFriend } from "./dictionary/DicRoleFriend";
import { dicRoleFriendLv, loadRoleFriendLv } from "./dictionary/DicRoleFriendLv";
import { Attribute } from "../domain/roleField/attribute";
import { AttributeCal } from "../domain/roleField/attribute";
import { dicGuildActivity, DicGuildActivity, loadGuildActivity } from './dictionary/DicGuildActivity';
import { dicGateActivityPoint, loadGateActivityPoint } from './dictionary/DicGateActivityPoint';
import { dicGuildAuction, loadGuildAuction } from './dictionary/DicGuildAuction';
@@ -298,7 +298,7 @@ export function getBossHpByWarId(warId: number) {
warInfo.forEach(hero => {
let { attribute, dataId, relation, actorId } = hero;
if (relation === 2) {
let newAttr = new Attribute();
let newAttr = new AttributeCal();
newAttr.setByWarJson(attribute, 1);
let attrJson = newAttr.getReduceAttributes();

View File

@@ -1,7 +1,5 @@
// 一些通用的interface定义
import { Attribute } from "../domain/roleField/attribute";
export interface RewardInter {
id: number;
count: number;
@@ -45,27 +43,6 @@ export interface oppPlayersInter {
rankLv: number;
}
export interface oppHeroesDefenseInter {
actorId: number; // 武将id
actorName: string; // 武将名
dataId: number; // 出兵表唯一id
relation: number; // 地方还是我方
direction: number; // 方向
outIndex: number; // 玩家设置的出场顺序即order字段
x: number; // 战场x坐标
y: number; // 战场y坐标
var: number; // 变量
lv: number; // 等级
hide: number; // 是否隐藏
initial_ai: number; // ai类型
attribute: Attribute;
star: number; // 星级
skill: string | number; // 技能
seid: string; // 技能
spine: string | number; // 动画
}
export interface pvpEndParamInter {
hid: number;
damage: number;

View File

@@ -7,7 +7,7 @@ import { HERO_SYSTEM_TYPE, ABI_TYPE, HERO_CE_RATIO, HERO_SUB_ATTR_RATIO, LINEUP_
import { cal, deepCopy, getAllAttrStage, reduceCe } from './util';
import { HeroModel, HeroType, HeroUpdate } from '../db/Hero';
import { RoleModel, RoleType, RoleUpdate } from '../db/Role';
import { CeAttrData, CeAttrDataRole, Attribute } from '../domain/roleField/attribute';
import { CeAttrData, CeAttrDataRole, AttributeCal } from '../domain/roleField/attribute';
import { ABI_STAGE, SEID_TYPE } from '../consts';
import { gameData, getJobByGradeAndClass, getHeroWakeByQuality, getHeroStarByQuality, getFriendShipById, getSchoolRateByStar, getScollByStar, getTeraph, getDicSuitByTypeAndLv } from './data';
import { DicSe } from './dictionary/DicSe';
@@ -29,7 +29,7 @@ export async function calPlayerCeAndSave(type: number, roleId: string, originHer
let heroAttrs = calPlayerCe(originHero, update, type, args); // 根据操作计算attr的增加
let newAttr = new Attribute();
let newAttr = new AttributeCal();
newAttr.setByDbData(roleAttrs, heroAttrs);
let heroCe = newAttr.calCe(); // 计算最终战力
let incCe = heroCe - originHero.ce;
@@ -70,7 +70,7 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
let allIncCe = 0;
for (let hero of heros) {
let { attr: heroAttrs } = hero;
let newAttr = new Attribute();
let newAttr = new AttributeCal();
newAttr.setByDbData(roleAttrs, heroAttrs);
let heroCe = newAttr.calCe(); // 计算最终战力