将 consts 整理到几个文件中

This commit is contained in:
liangtongchuan
2020-12-15 16:02:59 +08:00
parent 3a78f667c3
commit e877b0190d
61 changed files with 402 additions and 69 deletions

View File

@@ -4,7 +4,7 @@
* @Last Modified by: 梁桐川
* @Last Modified time: 2020-12-03 21:36:00
*/
import { IT_TYPE, GOLD_COST_RATIO, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, GOOD_QUALITY, CONSUME_TYPE } from './../../../consts/consts';
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, GOOD_QUALITY, CONSUME_TYPE } from './../../../consts';
import { getGoodById, getBossHpByBlueprtId, getComBtlSetByQuality, getBlueprtComposeByQuality, getBluePrtByQuality, getWarById, getWarIdByBlueprtId } from '../../../pubUtils/gamedata';
import { ComBattleTeamModel, BossHp } from '../../../db/ComBattleTeam';
import Role, { RoleModel } from '../../../db/Role';

View File

@@ -1,7 +1,7 @@
import { Application, BackendSession } from 'pinus';
import { DailyRecordModel } from '../../../db/DailyRecord';
import { getGamedata } from '../../../pubUtils/gamedata';
import { GOLD_COST_RATIO } from '../../../consts/consts';
import { GOLD_COST_RATIO } from '../../../consts';
import { STATUS } from '../../../consts/statusCode';
import { resResult, calculateNum } from '../../../pubUtils/util';
import { RoleModel } from '../../../db/Role';

View File

@@ -1,5 +1,5 @@
import { Application, BackendSession } from 'pinus';
import { GOLD_COST_RATIO, DUNGEON_CONST } from '../../../consts/consts';
import { GOLD_COST_RATIO, DUNGEON_CONST } from '../../../consts';
import { STATUS } from '../../../consts/statusCode';
import { resResult, calculateNum, shouldRefresh } from '../../../pubUtils/util';
import { RoleModel } from '../../../db/Role';

View File

@@ -2,7 +2,7 @@ import { Application, BackendSession } from 'pinus';
import { getGamedata } from '../../../pubUtils/gamedata';
import { EventRecordModel } from '../../../db/EventRecord';
import { RoleModel } from '../../../db/Role';
import { EVENT_STATUS, EVENT_RECORD_STATUS, EVENT_ANSWER_STATUS } from '../../../consts/consts';
import { EVENT_STATUS, EVENT_RECORD_STATUS, EVENT_ANSWER_STATUS } from '../../../consts';
import { checkEvent, checkEventStatus, getEventSuccessStatus, getEvent, checkQuiz } from '../../../services/eventSercive';
import { handleFixedReward } from '../../../services/rewardService';
import { STATUS } from '../../../consts/statusCode';

View File

@@ -7,7 +7,7 @@ import { ExpeditionPointModel } from '../../../db/ExpeditionPoint';
import { RoleModel } from '../../../db/Role';
import { calculateSumCE, genCode } from '../../../pubUtils/util';
import { getPointRewardStatus, getResetRemainCnt, findOrCreateEnemies } from '../../../services/expeditionService';
import { EXPEDITION_CONST, EXPEDITION_WAR_RECORD_STATUS } from '../../../consts/consts';
import { EXPEDITION_CONST, EXPEDITION_WAR_RECORD_STATUS } from '../../../consts';
import { WarReward } from '../../../services/warRewardService';
import { handleFixedReward } from '../../../services/rewardService';
import { getAp, setAp } from '../../../services/actionPointService';

View File

@@ -3,7 +3,7 @@ import { BattleRecordModel } from '../../../db/BattleRecord';
import { BattleSweepRecordModel } from '../../../db/BattleSweepRecord';
import { getWarById, } from '../../../pubUtils/gamedata';
import { genCode } from '../../../pubUtils/util';
import { WAR_TYPE, EVENT_STATUS, FUNC_OPT_TYPE } from '../../../consts/consts';
import { WAR_TYPE, EVENT_STATUS, FUNC_OPT_TYPE } from '../../../consts';
import { checkDaily, checkDailyAndIncrease } from '../../../services/dailyBattleService';
import { checkTowerWar, towerBattleEnd } from '../../../services/battleService';
import { WarReward } from '../../../services/warRewardService';

View File

@@ -1,5 +1,5 @@
import { STATUS } from './../../../consts/statusCode';
import { HANG_UP_CONSTS, GOLD_COST_RATIO, TOWER_TASK_CONST, REDIS_KEY } from './../../../consts/consts';
import { HANG_UP_CONSTS, GOLD_COST_RATIO, TOWER_TASK_CONST, REDIS_KEY } from './../../../consts';
import { TowerTaskRecModel } from './../../../db/TowerTaskRec';
import { HangUpSpdUpRecModel } from './../../../db/HangUpSpdUpRec';
import { HangUpRecordModel } from './../../../db/HangUpRecord';

View File

@@ -8,7 +8,7 @@ import {FrontendSession} from 'pinus';
import { HeroModel } from './../../../db/Hero';
import { resResult } from '../../../pubUtils/util';
import { startEvent } from '../../../services/eventSercive';
import { EVENT_START_LV, FUNC_OPT_TYPE } from '../../../consts/consts';
import { EVENT_START_LV, FUNC_OPT_TYPE } from '../../../consts';
import { getAp } from '../../../services/actionPointService';
import Actor from '../../../pubUtils/actor';
import { ItemModel } from '../../../db/Item';

View File

@@ -4,8 +4,7 @@ import { calPlayerCeAndSave, getAllAttrStage } from '../../../services/playerCeS
import { resResult } from '../../../pubUtils/util';
import { STATUS } from '../../../consts/statusCode';
import {HeroModel} from '../../../db/Hero';
import {CURRENCY_BY_TYPE, CURRENCY_TYPE, CONSUME_TYPE, HERO_GROW_MAX, HERO_SYSTEM_TYPE, ITID} from '../../../consts/consts';
import { ABI_STAGE } from '../../../consts/abilityConst';
import {CURRENCY_BY_TYPE, CURRENCY_TYPE, CONSUME_TYPE, HERO_GROW_MAX, HERO_SYSTEM_TYPE, ITID, ABI_STAGE} from '../../../consts';
import { RoleModel } from '../../../db/Role';
import { ItemModel } from '../../../db/Item';
import { gameData, getHeroExpByLv, getHeroStarByQuality, getHeroWakeByQuality, getHeroLvByExp, getMaxGradeByjobClass, getJobByGradeAndClass, getFriendShipById } from '../../../pubUtils/data';

View File

@@ -5,7 +5,7 @@ import { HeroModel } from '../../../db/Hero';
import { EquipModel } from '../../../db/Equip';
import { calculateCE, resResult } from '../../../pubUtils/util';
import {Application, BackendSession, createTcpMailBox} from 'pinus';
import { COUNTER } from '../../../consts/consts';
import { COUNTER } from '../../../consts';
export default function(app: Application) {
return new RoleHandler(app);

View File

@@ -3,7 +3,7 @@
*/
import { ActionPointModel } from '../db/ActionPoint';
import { ACTION_POIN } from '../consts/consts';
import { ACTION_POIN } from '../consts';
export async function getAp(now: number, roleId: string) {
let dataAp = await ActionPointModel.getAp(roleId);

View File

@@ -1,7 +1,7 @@
import { HeroModel } from './../db/Hero';
import { HangUpRecordModel } from './../db/HangUpRecord';
import { ChannelService } from 'pinus';
import { HANG_UP_CONSTS, TOWER_TASK_CONST, REDIS_KEY } from './../consts/consts';
import { HANG_UP_CONSTS, TOWER_TASK_CONST, REDIS_KEY } from './../consts';
import { BattleRecordModel } from './../db/BattleRecord';
import { TowerRecordModel } from './../db/TowerRecord';
import { RoleModel } from './../db/Role';

View File

@@ -1,6 +1,6 @@
import { FriendPointModel } from './../db/FriendPoint';
import { STATUS } from './../consts/statusCode';
import { COM_BATTLE_ROBOT_ID_NAME, COM_TEAM_STATUS, CURRENCY_BY_TYPE, CURRENCY_TYPE, FRIEND_DROP_TYPE, COM_BTL_CONST, FRIEND_DROP_MAX } from './../consts/consts';
import { COM_BATTLE_ROBOT_ID_NAME, COM_TEAM_STATUS, CURRENCY_BY_TYPE, CURRENCY_TYPE, FRIEND_DROP_TYPE, COM_BTL_CONST, FRIEND_DROP_MAX } from './../consts';
import { RoleStatus, ComBattleTeamModel } from './../db/ComBattleTeam';
import { getBluePrtByQuality, getComBtlSetByQuality, getRewardByBlueprtId, getWarById, getWarIdByBlueprtId } from "../pubUtils/gamedata";
import { getRandEelm, getRandValue, resResult, ratioReward } from "../pubUtils/util";

View File

@@ -5,7 +5,7 @@
import { resResult, shouldRefresh } from '../pubUtils/util';
import { STATUS } from '../consts/statusCode';
import { RoleModel } from '../db/Role';
import { DUNGEON_CONST } from '../consts/consts';
import { DUNGEON_CONST } from '../consts';
// 检查秘境本次数checkBattle使用
export async function checkDungeonNum(roleId: string, inc: number) {

View File

@@ -3,8 +3,8 @@ import { getGamedata } from '../pubUtils/gamedata';
import EventRecord, { EventRecordModel } from '../db/EventRecord';
import { RoleModel } from '../db/Role';
import { genCode, decodeStrSingle, decodeStr, getRandomWithWeight, resResult, setLocalHours } from '../pubUtils/util';
import { EVENT_STATUS, EVENT_RECORD_STATUS, EVENT_TYPE, EVENT_RANDOM_TYPE_ONE_OPEN, EVENT_QUIZ_NUM, EVENT_ANSWER_STATUS, FUNCS_ID } from '../consts/consts';
import { EVENT_REFRESH_NUM } from '../consts/consts';
import { EVENT_STATUS, EVENT_RECORD_STATUS, EVENT_TYPE, EVENT_RANDOM_TYPE_ONE_OPEN, EVENT_QUIZ_NUM, EVENT_ANSWER_STATUS, FUNCS_ID } from '../consts';
import { EVENT_REFRESH_NUM } from '../consts';
import { STATUS } from '../consts/statusCode';
/**

View File

@@ -5,8 +5,8 @@ import { PvpDefenseModel } from '../db/PvpDefense';
import { getWarJsons, getGamedata, getExpeditionById } from '../pubUtils/gamedata';
import { decodeStr, resResult, setLocalHours, shouldRefresh } from '../pubUtils/util';
import { EXPEDITION_CONST } from '../consts/consts';
import { getAtrrNameById} from '../consts/abilityConst';
import { EXPEDITION_CONST } from '../consts';
import { getAtrrNameById} from '../consts';
import Actor from '../pubUtils/actor';
import { ExpeditionWarRecordModel } from '../db/ExpeditionWarRecord';

View File

@@ -1,7 +1,7 @@
import { Application, BackendSession, FrontendSession } from "pinus";
import { getGamedata } from "../pubUtils/gamedata";
import Role, { RoleModel } from "../db/Role";
import { FUNC_OPT_TYPE } from "../consts/consts";
import { FUNC_OPT_TYPE } from "../consts";
// 开启功能
export async function switchOnFunc(roleId: string, type: number, param: number, app: Application, session: (BackendSession|FrontendSession)) {

View File

@@ -4,7 +4,7 @@ import Role, { RoleModel } from '../db/Role'
import { getLvByExp, getExpByLv } from '../pubUtils/gamedata';
import { redisUserInfoUpdate } from './redisService';
import { switchOnFunc } from './funcSwitchService';
import { FUNC_OPT_TYPE } from '../consts/consts';
import { FUNC_OPT_TYPE } from '../consts';
import { Application, BackendSession } from 'pinus';
export async function roleLevelup(roleId: string, kingExp: number, app: Application, session: BackendSession) {

View File

@@ -2,7 +2,7 @@
* 体力系统
*/
import { HERO_SYSTEM_TYPE } from '../consts/consts';
import { HERO_SYSTEM_TYPE } from '../consts';
import { pinus } from 'pinus';
import { STATUS } from '../consts/statusCode';
@@ -11,8 +11,7 @@ import Hero from '../db/Hero';
import { RoleModel } from '../db/Role';
import { CeAttrData, CeAttr } from '../db/BaseModel';
import { getFashionsById, getJobInfoById, getJobByGradeAndClass, getHeroInfoById, getHeroStar, getHeroWake, getFiendShipLevel, getFriendShipById, getHeroSkillById, getSeidById } from '../pubUtils/gamedata';
import { getAttrNameByJobStage, getAttrCeRatio, getAtrrNameById, ABI_TYPE_TO_STAGE, ABI_STAGE, SEID_TYPE, HERO_ATTR} from '../consts/abilityConst';
import { getAttrNameByJobStage, getAttrCeRatio, getAtrrNameById, ABI_TYPE_TO_STAGE, ABI_STAGE, SEID_TYPE, HERO_ATTR} from '../consts';
const HERO_CE_RATIO = 100;
const _ = require('underscore');
//战力计算TODO

View File

@@ -1,7 +1,7 @@
import { GOOD_QUALITY } from './../consts/consts';
import { GOOD_QUALITY } from './../consts';
import { RoleModel } from "../db/Role";
import * as Redis from 'redis';
import {REDIS_KEY} from '../consts/consts'
import {REDIS_KEY} from '../consts'
import { GameModel } from "../db/Game";
import { promisifyAll } from 'bluebird';

View File

@@ -1,4 +1,4 @@
import { GOOD_TYPE, ITID, CURRENCY, CURRENCY_TYPE, COUNTER } from './../consts/consts';
import { GOOD_TYPE, ITID, CURRENCY, CURRENCY_TYPE, COUNTER } from './../consts';
import { EquipModel } from './../db/Equip';
import { CounterModel } from './../db/Counter';
import { decodeStr, resResult } from '../pubUtils/util';

View File

@@ -6,7 +6,7 @@
import { BattleDropModel } from '../db/BattleDrop';
import { getWarById, getBluePrtByQuality, getGamedata } from '../pubUtils/gamedata';
import { decodeStr, getRefTime, getRandomWithWeight, getRandomByLen } from '../pubUtils/util';
import { BATTLE_REWARD_TYPE, BLUEPRT_CONST } from '../consts/consts';
import { BATTLE_REWARD_TYPE, BLUEPRT_CONST } from '../consts';
import { handleReward } from './rewardService';
import { BattleBlueprtDropModel } from '../db/BattleBlueprtDrop'
import { RoleModel } from '../db/Role';