抽卡:修改抽卡奖池逻辑

This commit is contained in:
luying
2022-07-08 14:09:18 +08:00
parent e4d8708898
commit 35c7c57bda
20 changed files with 695 additions and 579 deletions

View File

@@ -13,7 +13,7 @@ import { dicTower, loadTower } from "./dictionary/DicTower";
import { dicTowerTask, loadTowerTask } from "./dictionary/DicTowerTask";
import { dicWar, dicWarPvp, dicDailyWarByType, loadWar, dicHeroIdByWar } from "./dictionary/DicWar";
import { dicWarJson, loadWarJson } from "./dictionary/DicWarJson";
import { AUCTION_TIME, GACHA_CONTENT_TYPE } from "../consts";
import { AUCTION_TIME } from "../consts";
import { dicFashions, dicFashionsByHeroId, loadFashions } from "./dictionary/DicFashions";
import { friendShips, friendShipHidAandIds, loadFriendShip } from "./dictionary/DicFriendShip";
import { maxFriendShipLv, dicFriendShipLevelMap, loadFriendShipLevel } from "./dictionary/DicFriendShipLevel";
@@ -67,8 +67,9 @@ import { dicRankReward, loadRankReward } from "./dictionary/DicRankReward";
import { dicTaskType, taskMap, dicMainTask, dicDailyTask, dicAchievement, loadTask, dicPvpDailyTask } from "./dictionary/DicTask";
import { dicMainTaskStage, loadMainTaskStage } from "./dictionary/DicMainTaskStage";
import { dicTaskBox, loadTaskBox } from './dictionary/DicTaskBox';
import { dicGacha, loadGacha } from "./dictionary/DicGacha";
import { dicGachaContent, dicGachaContentHero, loadGachaContent } from "./dictionary/DicGachaContent";
import { dicGacha, dicGachaByGachaType, loadGacha } from "./dictionary/DicGacha";
import { dicGachaPlan, dicGachaPlanQuality, loadGachaPlan } from "./dictionary/DicGachaPlan";
import { dicGachaFloor, loadGachaFloor } from "./dictionary/DicGachaFloor";
import { dicGiftPackage, loadGiftPackage } from "./dictionary/DicGiftPackage";
import { dicRecruit, loadRecruit } from './dictionary/DicRecruit';
import { loadRMB, dicRMB } from './dictionary/DicRMB';
@@ -212,10 +213,12 @@ export const gameData = {
mainTaskStage: dicMainTaskStage,
taskBox: dicTaskBox,
gacha: dicGacha,
gachaContent: dicGachaContent,
gachaContentHero: dicGachaContentHero,
gachaByType: dicGachaByGachaType,
gachaPlan: dicGachaPlan,
gachaPlanQuality: dicGachaPlanQuality,
gachaFloor: dicGachaFloor,
gachaHope: new Array<{id: number, weight: number}>(),
gachaTurntable: new Array<{quality: number, count: number}>(),
gachaTurntable: new Array<{quality: number, count: number, planId: number}>(),
gachaPickHeroCnt: new Map<number, number>(),
heroTransPiece: new Map<number, number>(),
giftPackage: dicGiftPackage,
@@ -604,13 +607,6 @@ export function getFriendLvByExp(exp: number) {
return resultLv;
}
export function getGachaContentOfHeroQuality(quality: number) {
for(let [id, { type, param }] of gameData.gachaContent) {
if(type == GACHA_CONTENT_TYPE.HERO && param[0] == quality) return id;
}
return 0
}
/**
* 根据主公当前经验获得当前等级
* @param exp 累积经验
@@ -763,7 +759,7 @@ function getGachaHopePercent() {
function getGachaTurntablePercent() {
let arr = decodeArrayListStr(RECRUIT.RECRUIT_BONUS_HERO_QUANTITY);
gameData.gachaTurntable = arr.map(cur => {
return { quality: parseInt(cur[0]), count: parseInt(cur[1]) }
return { quality: parseInt(cur[0]), count: parseInt(cur[1]), planId: parseInt(cur[2]) }
});
}
@@ -1106,7 +1102,8 @@ function loadDatas() {
loadMainTaskStage();
loadTaskBox();
loadGacha();
loadGachaContent();
loadGachaPlan();
loadGachaFloor();
loadGiftPackage();
loadRecruit();
loadRMB();