✨ feat(稷下学宫): c67747d87到5ff932e83
This commit is contained in:
@@ -359,13 +359,13 @@ export class RougeHandler {
|
||||
* @param session
|
||||
* @returns
|
||||
*/
|
||||
async battleEnd(msg: { gameCode: string, detailCode: string, battleCode: string, warId: number, status: number, round: number, rougeDamage: RougeDamageInter[], isAp: boolean, isRound: boolean }, session: BackendSession) {
|
||||
async battleEnd(msg: { gameCode: string, detailCode: string, battleCode: string, warId: number, status: number, round: number, rougeDamage: RougeDamageInter[] }, session: BackendSession) {
|
||||
let roleId = session.get('roleId');
|
||||
let roleName = session.get('roleName');
|
||||
let sid = session.get('sid');
|
||||
|
||||
|
||||
let { gameCode, detailCode, battleCode, warId, status, round, rougeDamage, isAp, isRound } = msg;
|
||||
let { gameCode, detailCode, battleCode, warId, status, round, rougeDamage } = msg;
|
||||
let dbDetail = await RougelikeRecordDetailModel.findByCode(gameCode, detailCode);
|
||||
if (!dbDetail || (dbDetail.warId || 0) != warId || warId == 0 || (dbDetail.status || 0) != 0) return resResult(STATUS.WAR_NO_CHOOSE);
|
||||
let { layer, nodeType, questType = 0 } = dbDetail;
|
||||
@@ -381,15 +381,23 @@ export class RougeHandler {
|
||||
$set: { status, 'record.round': round, 'record.rougeDamage': rougeDamage, }
|
||||
}, { new: true, upsert: true }).lean(true);
|
||||
|
||||
await updateChalleng(dbRecord, roleId, sid, gameCode, layer, rougeDamage, isAp, isRound);
|
||||
|
||||
const dbCharaMap = dbCharas.reduce((result, cur) => { result.set(cur.charaCode, { ...cur }); return result; }, new Map<string, RougelikeCharaType>());
|
||||
|
||||
let isAp: boolean = false, isRound: boolean = false;
|
||||
for (let obj of rougeDamage) {
|
||||
if (obj.isAp) isAp = true;
|
||||
if (obj.isRound) isRound = true;
|
||||
const chara = dbCharaMap.get(obj.charaCode);
|
||||
if (!chara) return resResult(STATUS.BATTLE_ABNORMAL)
|
||||
obj.maxHp = (chara.maxHp || 0);
|
||||
}
|
||||
await updateChalleng(dbRecord, roleId, sid, gameCode, layer, rougeDamage, isAp, isRound);
|
||||
|
||||
let updateCharas: RougelikeCharaPara[] = [], charas: CommonChara[] = [];
|
||||
|
||||
|
||||
let recoveryHp = false;
|
||||
if (status == 0 && nodeType != ROUGE_LIKE_NODE_TYPE.BOSS) {
|
||||
if (status != 0 && nodeType != ROUGE_LIKE_NODE_TYPE.BOSS) {
|
||||
recoveryHp = await getNoBossRecoveryHp(roleId, gameCode);
|
||||
if (recoveryHp) status = 1;
|
||||
}
|
||||
@@ -398,24 +406,25 @@ export class RougeHandler {
|
||||
if (status == 1) {
|
||||
hpRatio = await getCharaHp(roleId, gameCode);
|
||||
}
|
||||
|
||||
let recoveryNum = await getBattleRecoveryNum(roleId, gameCode);
|
||||
const minHp = rougeDamage.reduce((min, cur) => { return Math.min(min, cur.hp); }, Infinity);
|
||||
let recoveryNum = 0;
|
||||
if (minHp == 0) recoveryNum = await getBattleRecoveryNum(roleId, gameCode);
|
||||
|
||||
|
||||
for (let { charaCode, hp, ap, shield } of rougeDamage) {
|
||||
let updateCharasMap = new Map();
|
||||
for (let { charaCode, hp, ap, shield, others } of rougeDamage) {
|
||||
const chara = dbCharaMap.get(charaCode);
|
||||
if (!chara) return resResult(STATUS.BATTLE_ABNORMAL)
|
||||
if (chara.maxHp < hp) hp = chara.maxHp;
|
||||
|
||||
if (recoveryHp) hp = chara.maxHp;
|
||||
if (hpRatio > 0) hp = Math.min(Math.floor(hp * (1 + hpRatio / 100)), chara.maxHp);
|
||||
if (hpRatio > 0) hp = Math.min(Math.floor(hp + (chara.maxHp * hpRatio / 100)), chara.maxHp);
|
||||
|
||||
if (recoveryNum-- > 0 && hp == 0) hp = chara.maxHp;
|
||||
if ((recoveryNum--) > 0 && hp == 0) { hp = chara.maxHp; }
|
||||
|
||||
|
||||
|
||||
charas.push({ charaCode, charaId: chara.charaId, seqId: chara.seqId, cards: chara.cards, hp, maxHp: chara.maxHp, ap, shield, apSkill: chara.apSkill, roundSkill: chara.roundSkill })
|
||||
updateCharas.push({ gameCode, charaCode, hp, ap, shield });
|
||||
charas.push({ charaCode, charaId: chara.charaId, seqId: chara.seqId, cards: chara.cards, hp, maxHp: chara.maxHp, ap, shield, others, apSkill: chara.apSkill, roundSkill: chara.roundSkill })
|
||||
updateCharas.push({ gameCode, charaCode, hp, ap, shield, others });
|
||||
updateCharasMap.set(charaCode, { hp, ap, shield, others });
|
||||
}
|
||||
|
||||
let incCoin = 0;
|
||||
@@ -434,9 +443,13 @@ export class RougeHandler {
|
||||
// await RougelikeRecordDetailModel.findOneAndUpdate({ gameCode, detailCode, 'rewards.rewardType': 0 }, { 'rewards.$.chooseNum': coinReward.chooseNum, }, { new: true, upsert: true }).lean(true);
|
||||
// }
|
||||
|
||||
await RougelikeCharaModel.bulkWriteUpdate(updateCharas);
|
||||
await RougelikeRecordDetailModel.updateByCode(gameCode, detailCode, { $set: { status } })
|
||||
|
||||
if (incCoin > 0) {
|
||||
charas = await updateMaxHp(roleId, gameCode, dbRecord.type, dbRecord.grade, updateCharasMap)
|
||||
} else {
|
||||
await RougelikeCharaModel.bulkWriteUpdate(updateCharas);
|
||||
}
|
||||
|
||||
return resResult(STATUS.SUCCESS, { status, gameCode, detailCode, charas, incCoin });
|
||||
}
|
||||
@@ -457,7 +470,8 @@ export class RougeHandler {
|
||||
let dbDetail = await RougelikeRecordDetailModel.findByCode(gameCode, detailCode);
|
||||
if (!dbDetail) return resResult(STATUS.REWARD_NO_CHOOSE);
|
||||
|
||||
if (dbDetail.reRandRewardCnt > 0) return resResult(STATUS.ROUGE_RE_RANDOM_CNT_OVER);
|
||||
let dbDetailReward = dbDetail.rewards.find(cur => cur.rewardType == rewardType);
|
||||
if (!dbDetailReward || dbDetailReward.reRandRewardCnt > 0) return resResult(STATUS.ROUGE_RE_RANDOM_CNT_OVER);
|
||||
|
||||
const typeGradeData = gameData.rougeTypeGrade.get(dbRecord.type + '_' + dbRecord.grade);
|
||||
const nodeData = gameData.rougeNode.get(dbDetail.nodeId);
|
||||
@@ -471,10 +485,10 @@ export class RougeHandler {
|
||||
|
||||
let replaceReward = await getLayerNodeReward(roleId, gameCode, dbRecord.authorType, dbDetail.nodeId, layerPlanData.rewardPlan, dbDetail.layer);
|
||||
let { rewards } = dbDetail;
|
||||
let newRewards = [...rewards.filter(reward => reward.rewardType != rewardType), ...replaceReward.rewards.filter(reward => reward.rewardType == rewardType)].sort((a, b) => a.groupIndex - b.groupIndex);
|
||||
dbDetail = await RougelikeRecordDetailModel.updateByCode(gameCode, detailCode, { $set: { rewards: newRewards }, $inc: { reRandRewardCnt: 1 } });
|
||||
let newRewards = [...rewards.filter(reward => reward.rewardType != rewardType), ...replaceReward.rewards.filter(reward => reward.rewardType == rewardType)].map(reward => ({ ...reward, reRandRewardCnt: 1 })).sort((a, b) => a.groupIndex - b.groupIndex);
|
||||
dbDetail = await RougelikeRecordDetailModel.updateByCode(gameCode, detailCode, { $set: { rewards: newRewards } });
|
||||
|
||||
return resResult(STATUS.SUCCESS, { rewards: dbDetail.rewards, reRandRewardCnt: dbDetail.reRandRewardCnt });
|
||||
return resResult(STATUS.SUCCESS, { rewards: dbDetail.rewards });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -503,7 +517,7 @@ export class RougeHandler {
|
||||
if (!rewards || rewards.length == 0) return resResult(STATUS.REWARD_NO_CHOOSE);
|
||||
let { rewardType, options, groupStatus, chooseNum } = rewards.find((obj) => obj.groupIndex == groupIndex);
|
||||
|
||||
if (groupStatus == ROUGE_LIKE_CHOOSE_REWARD.CHOOSE) return resResult(STATUS.REWARD_NO_CHOOSE);
|
||||
// if (groupStatus == ROUGE_LIKE_CHOOSE_REWARD.CHOOSE) return resResult(STATUS.REWARD_NO_CHOOSE);
|
||||
|
||||
let handleAddFun = new HandleAddCard(roleId, sid, gameCode, dbDetail);
|
||||
let incCoin = 0, redCoin = 0;
|
||||
@@ -560,7 +574,7 @@ export class RougeHandler {
|
||||
|
||||
//处理特性卡组
|
||||
groupStatus = ROUGE_LIKE_CHOOSE_REWARD.CHOOSE;
|
||||
if (rewardType == ROUGE_LIKE_CARD_TYPE.PASSIVE || rewardType == ROUGE_LIKE_CARD_TYPE.CHARA) {
|
||||
if (rewardType == ROUGE_LIKE_CARD_TYPE.PASSIVE) {
|
||||
groupStatus = ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE;
|
||||
if (chooseNum - passiveChooseCount == optionIndexs.length) {
|
||||
groupStatus = ROUGE_LIKE_CHOOSE_REWARD.CHOOSE;
|
||||
@@ -572,7 +586,7 @@ export class RougeHandler {
|
||||
|
||||
// 挑战领奖
|
||||
let dbPara = {};
|
||||
if (rewards.find((obj) => obj.groupStatus != ROUGE_LIKE_CHOOSE_REWARD.CHOOSE) == undefined) {
|
||||
if (rewards.find((obj) => obj.groupStatus != ROUGE_LIKE_CHOOSE_REWARD.CHOOSE && rewardType != ROUGE_LIKE_CARD_TYPE.CHARA) == undefined) {
|
||||
if (nodeType == ROUGE_LIKE_NODE_TYPE.CHALLENGE) {
|
||||
challenge.status = 3;
|
||||
dbPara['challenge'] = challenge;
|
||||
@@ -742,7 +756,7 @@ export class RougeHandler {
|
||||
let hpRatio = await getRecoveryExtendHp(roleId, gameCode);
|
||||
for (let { gameCode, charaCode, charaId, cards, hp, maxHp = 0, ap, shield, roundSkill, apSkill } of dbCharas) {
|
||||
let beforeHp = hp;
|
||||
hp = Math.floor(Math.min(hp + maxHp * ROUGELIKE.RECOVERY_RATIO / 100 + hp * hpRatio / 100, maxHp));
|
||||
hp = Math.floor(Math.min(hp + maxHp * ROUGELIKE.RECOVERY_RATIO / 100 + maxHp * hpRatio / 100, maxHp));
|
||||
updateCharas.push({ gameCode, charaCode, hp });
|
||||
restPoint.recoveryCharas.push({ charaCode, charaId, beforeHp, afterHp: hp });
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export class HandleAddCard {
|
||||
cards.push({ index, cardCode, cardId });
|
||||
}
|
||||
let charaCode = genCode(8);
|
||||
this.addCharas.push({ ...this.getCommonParam(), cards, charaCode, charaId: id, maxHp, hp: maxHp, ap: 0, shield: 0, roundSkill: 0, apSkill: 0 });
|
||||
this.addCharas.push({ ...this.getCommonParam(), cards, charaCode, charaId: id, maxHp, hp: maxHp, ap: 0, shield: 0, others: '', roundSkill: 0, apSkill: 0 });
|
||||
return charaCode;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export class HandleAddCard {
|
||||
public pushHolyCard(id: number) {
|
||||
let cardCode = genCode(8);
|
||||
this.addHolyCards.push({
|
||||
...this.getCommonParam(), cardCode, cardId: id, type: ROUGE_LIKE_CARD_TYPE.HOLY, useCount: this.getHolyUseCount(id)
|
||||
...this.getCommonParam(), cardCode, cardId: id, type: ROUGE_LIKE_CARD_TYPE.HOLY, useCount: 0
|
||||
});
|
||||
return cardCode
|
||||
}
|
||||
@@ -138,7 +138,8 @@ export class HandleAddCard {
|
||||
await RougelikeCharaModel.bulkWriteUpdate([...charas.values()]);
|
||||
charasMap = new Map([...charasMap, ...charas])
|
||||
}
|
||||
if (cards && Object.entries(cards).length > 0) {
|
||||
if (cards && cards.size > 0) {
|
||||
await RougelikeCardModel.bulkWriteUpdate([...cards.values()])
|
||||
cardsMap = new Map([...cardsMap, ...cards])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { getRandEelm } from "../../pubUtils/util";
|
||||
import { RougelikeTechModel } from "../../db/RougelikeTech";
|
||||
import { getAuthorTypeCardNum } from "./rougeService";
|
||||
import * as util from 'util';
|
||||
import { DicRougePassiveCard } from "../../pubUtils/dictionary/DicRougePassiveCard";
|
||||
|
||||
|
||||
|
||||
@@ -98,6 +99,7 @@ export class RougeEffect {
|
||||
ROUGE_EFFECT_TYPE.HOLY_PASSIVE_UPDATE_RAND, //2006
|
||||
ROUGE_EFFECT_TYPE.HOLY_UPDATE_PASSIVE_BY_LV, //2012
|
||||
ROUGE_EFFECT_TYPE.HOLY_REPAIRE_HOLY, //2015
|
||||
ROUGE_EFFECT_TYPE.HOLY_CHARA_SLOT_UNLOCK_POINT,//2023
|
||||
], holyIds)
|
||||
|
||||
await this.getCharaSlot();
|
||||
@@ -110,6 +112,8 @@ export class RougeEffect {
|
||||
|
||||
await this.getRecoveryHoly();
|
||||
|
||||
await this.getSlotUnlockPoint()
|
||||
|
||||
result = { charas: this.updateCharaMap, cards: this.updateCardMap };
|
||||
|
||||
return result;
|
||||
@@ -119,9 +123,14 @@ export class RougeEffect {
|
||||
// 获得该圣物时,所有学员立刻解锁X个特性槽 2002
|
||||
private async getCharaSlot() {
|
||||
if (this.newEffect.length == 0 || this.dbCharas.length == 0) return;
|
||||
for (const { effectParam, effectType } of this.newEffect) {
|
||||
for (const { effectParam, effectType, cardCode } of this.newEffect) {
|
||||
if (effectType != ROUGE_EFFECT_TYPE.HOLY_CHARA_SLOT_UNLOCK_ALL) continue;
|
||||
if (effectParam.length == 0) continue;
|
||||
let isUseCount = false;
|
||||
console.log("xx-x-x-x-x-x-x-x-11111-x-xx-x-x- cardCode", cardCode)
|
||||
console.log("xx-x-x-x-x-x-x-x-11111-x-xx-x-x- this.holyMap", this.holyMap)
|
||||
if (!getHolyCardIsUse(this.holyMap.get(cardCode))) continue;
|
||||
console.log("xx-x-x-x-x-x-x-x--x-xx-x-x- this.holyMap", this.holyMap)
|
||||
for (let val of this.dbCharas) {
|
||||
let { charaCode, cards = [] } = val;
|
||||
let unlockNum = effectParam[0] || 0;
|
||||
@@ -133,18 +142,32 @@ export class RougeEffect {
|
||||
cards.push({ index, cardCode: '', cardId: 0 });
|
||||
this.updateCharaMap.set(charaCode, val);
|
||||
unlockNum--;
|
||||
isUseCount = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isUseCount) this.updateHolyMapUseCount(this.holyMap.get(cardCode));
|
||||
}
|
||||
}
|
||||
|
||||
private updateHolyMapUseCount(holy: { cardCode: string, cardId: number, useCount: number }) {
|
||||
let { cardCode, useCount = 0, cardId } = (holy || {});
|
||||
if (!cardId || !cardCode) return;
|
||||
let val = this.dbCards.find(cur => cur.cardCode == cardCode);
|
||||
if (val == undefined) return;
|
||||
useCount = (useCount + 1) >= 0 ? (useCount + 1) : 0
|
||||
this.updateCardMap.set(cardCode, { ...val, useCount });
|
||||
this.holyMap.set(cardCode, { cardCode, cardId, useCount });
|
||||
}
|
||||
|
||||
// 获得该圣物时,随机解锁X个学员的Y个特性槽 2003
|
||||
private async getRandCharaSlot() {
|
||||
if (this.newEffect.length == 0 || this.dbCharas.length == 0) return;
|
||||
for (const { effectParam, effectType } of this.newEffect) {
|
||||
for (const { effectParam, effectType, cardCode } of this.newEffect) {
|
||||
if (effectType != ROUGE_EFFECT_TYPE.HOLY_CHARA_SLOT_UNLOCK_RAND) continue;
|
||||
if (effectParam.length == 0) continue;
|
||||
let isUseCount = false;
|
||||
if (!getHolyCardIsUse(this.holyMap.get(cardCode))) continue;
|
||||
const randomNum = effectParam[0] || 0;
|
||||
let unlockNum = effectParam[1] || 0;
|
||||
let charas = getRandEelm(this.dbCharas.filter(cur => cur.cards.length < ROUGE_SLOT_LIMIT), randomNum);
|
||||
@@ -156,8 +179,10 @@ export class RougeEffect {
|
||||
cards.push({ index, cardCode: '', cardId: 0 });
|
||||
this.updateCharaMap.set(charaCode, val);
|
||||
unlockNum--;
|
||||
isUseCount = true;
|
||||
}
|
||||
}
|
||||
if (isUseCount) this.updateHolyMapUseCount(this.holyMap.get(cardCode));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,61 +190,129 @@ export class RougeEffect {
|
||||
private async getRandomCardLv() {
|
||||
let cards: RougelikeCardType[] = [];
|
||||
if (this.newEffect.length == 0 || this.dbCards.length == 0) return cards;
|
||||
for (const { effectParam, effectType } of this.newEffect) {
|
||||
for (const { effectParam, effectType, cardCode } of this.newEffect) {
|
||||
if (effectType != ROUGE_EFFECT_TYPE.HOLY_PASSIVE_UPDATE_RAND) continue;
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(this.holyMap.get(cardCode))) continue;
|
||||
const randomNum = effectParam[0] || 0;
|
||||
let random = this.dbCards.filter(cur => cur.type == ROUGE_LIKE_CARD_TYPE.PASSIVE && cur.charaId != 0 && cur.lv < (gameData.rougePassiveCard.get(cur.cardId)?.lv || 0))
|
||||
let cards = getRandEelm(random, randomNum);
|
||||
cards.forEach(cur => {
|
||||
cur.lv += 1;
|
||||
this.updateCardMap.set(cur.cardCode, cur);
|
||||
});
|
||||
let random = this.dbCards.filter(cur => cur.type == ROUGE_LIKE_CARD_TYPE.PASSIVE && cur.charaId && cur.charaId != 0 && cur.lv < (gameData.rougePassiveCard.get(cur.cardId)?.lv || 0))
|
||||
for (let cur of this.dbCards) {
|
||||
if (cur.type != ROUGE_LIKE_CARD_TYPE.PASSIVE || cur.charaId == 0) continue;
|
||||
let passiveCardDataMap = this.getPassiveData(cur.cardId);
|
||||
if (!passiveCardDataMap.has(cur.lv + 1)) continue;
|
||||
random.push({ ...cur, cardId: passiveCardDataMap.get(cur.lv + 1).id, lv: cur.lv + 1 })
|
||||
}
|
||||
|
||||
if (random && random.length > 0) {
|
||||
let cards = getRandEelm(random, randomNum);
|
||||
cards.forEach(async cur => { this.updateCardMap.set(cur.cardCode, cur), await this.updateCharaCards(cur, cardCode, cur.cardId); });
|
||||
|
||||
this.updateHolyMapUseCount(this.holyMap.get(cardCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private getPassiveData(cardId: number) {
|
||||
let passiveCardDataMap = new Map<number, DicRougePassiveCard>()
|
||||
const passiveCardData = gameData.rougePassiveCard.get(cardId);
|
||||
if (!passiveCardData) return passiveCardDataMap;
|
||||
const passiveCardByGroupData = gameData.rougePassiveCardByGroup.get(passiveCardData.group || 0);
|
||||
if (passiveCardByGroupData.length == 0 || passiveCardByGroupData.length == 1) return passiveCardDataMap;
|
||||
passiveCardDataMap = passiveCardByGroupData.reduce((result, cur) => { result.set(cur.lv, cur); return result; }, new Map<number, DicRougePassiveCard>());
|
||||
return passiveCardDataMap;
|
||||
}
|
||||
|
||||
// 获得该圣物时立即升级所有X星特性卡 2012
|
||||
private async getPassiveLv() {
|
||||
if (this.newEffect.length == 0) return;
|
||||
for (const { effectParam, effectType } of this.newEffect) {
|
||||
for (const { effectParam, effectType, cardCode } of this.newEffect) {
|
||||
if (effectType != ROUGE_EFFECT_TYPE.HOLY_UPDATE_PASSIVE_BY_LV) continue;
|
||||
if (effectParam.length == 0) continue;
|
||||
let isUseCount = false;
|
||||
if (!getHolyCardIsUse(this.holyMap.get(cardCode))) continue;
|
||||
const level = effectParam[0] || 0;
|
||||
for (let val of this.dbCards) {
|
||||
let { lv, cardId, cardCode } = val;
|
||||
const passiveCardData = gameData.rougePassiveCard.get(cardId);
|
||||
if (level != passiveCardData?.quality || 0 || lv >= passiveCardData?.lv || 0) continue;
|
||||
lv += 1;
|
||||
this.updateCardMap.set(cardCode, val);
|
||||
if (lv != level) continue;
|
||||
let passiveCardDataMap = this.getPassiveData(cardId);
|
||||
if (!passiveCardDataMap.has(lv + 1)) continue;
|
||||
let id = passiveCardDataMap.get(lv + 1).id;
|
||||
this.updateCardMap.set(cardCode, { ...val, lv: lv + 1, cardId: passiveCardDataMap.get(lv + 1).id });
|
||||
|
||||
if (val.charaId && val.charaId > 0) {
|
||||
await this.updateCharaCards(val, cardCode, id);
|
||||
}
|
||||
|
||||
isUseCount = true;
|
||||
}
|
||||
if (isUseCount) this.updateHolyMapUseCount(this.holyMap.get(cardCode));
|
||||
}
|
||||
}
|
||||
|
||||
private async updateCharaCards(val: RougelikeCardType, cardCode: string, id: number) {
|
||||
for (let obj of this.dbCharas) {
|
||||
if (obj.charaId != val.charaId) continue;
|
||||
for (let card of (obj.cards || [])) {
|
||||
if (card.cardCode != cardCode) continue;
|
||||
card.cardId = id;
|
||||
}
|
||||
this.updateCharaMap.set(obj.charaCode, obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 获得该圣物时,随机修复X个已损毁的圣物 2015
|
||||
private async getRecoveryHoly() {
|
||||
if (this.newEffect.length == 0) return;
|
||||
for (const { effectParam, effectType } of this.newEffect) {
|
||||
for (const { effectParam, effectType, cardCode } of this.newEffect) {
|
||||
if (effectType != ROUGE_EFFECT_TYPE.HOLY_REPAIRE_HOLY) continue;
|
||||
if (effectParam.length == 0) continue;
|
||||
let isUseCount = false;
|
||||
if (!getHolyCardIsUse(this.holyMap.get(cardCode))) continue;
|
||||
const num = effectParam[0] || 0;
|
||||
let canRandomCards: RougelikeCardType[] = []
|
||||
this.dbCards.forEach(cur => {
|
||||
const { cardCode, cardId, useCount = 0, type } = cur;
|
||||
const holyCardData = gameData.rougeHolyCard.get(cardId);
|
||||
let tempUseCount = holyCardData?.useCount || 0;
|
||||
if (tempUseCount > 0 && useCount < tempUseCount && type == ROUGE_LIKE_CARD_TYPE.HOLY) canRandomCards.push(cur);
|
||||
if (tempUseCount > 0 && useCount > 0 && type == ROUGE_LIKE_CARD_TYPE.HOLY) canRandomCards.push(cur);
|
||||
})
|
||||
|
||||
let randomCards = getRandEelm(canRandomCards, num);
|
||||
for (let val of randomCards) {
|
||||
let { cardCode, cardId } = val;
|
||||
val.useCount += 1;
|
||||
// if (this.holyMap.has(cardCode)) this.holyMap.set(cardCode, { cardCode, cardId, useCount });
|
||||
this.updateCardMap.set(cardCode, val)
|
||||
val.useCount -= 1;
|
||||
this.updateCardMap.set(cardCode, val);
|
||||
|
||||
if (this.holyMap.has(cardCode)) this.holyMap.set(cardCode, { cardCode, cardId, useCount: val.useCount });
|
||||
isUseCount = true;
|
||||
}
|
||||
|
||||
if (isUseCount) this.updateHolyMapUseCount(this.holyMap.get(cardCode));
|
||||
}
|
||||
}
|
||||
|
||||
//2023
|
||||
private async getSlotUnlockPoint() {
|
||||
if (this.newEffect.length == 0) return;
|
||||
for (const { effectParam, effectType, cardCode } of this.newEffect) {
|
||||
if (effectType != ROUGE_EFFECT_TYPE.HOLY_CHARA_SLOT_UNLOCK_POINT) continue;
|
||||
if (effectParam.length == 0) continue;
|
||||
let isUseCount = false;
|
||||
if (!getHolyCardIsUse(this.holyMap.get(cardCode))) continue;
|
||||
const num = effectParam[0] || 0;
|
||||
const index = effectParam[0] || 0;
|
||||
for (let val of this.dbCharas) {
|
||||
let { cards = [], charaCode } = val
|
||||
if (cards.find(cur => cur.index == index) == undefined) {
|
||||
cards.push({ index, cardCode: '', cardId: 0 });
|
||||
this.updateCharaMap.set(charaCode, val);
|
||||
isUseCount = true;
|
||||
}
|
||||
}
|
||||
if (isUseCount) this.updateHolyMapUseCount(this.holyMap.get(cardCode));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 和圣物相关maxhp
|
||||
@@ -235,6 +328,9 @@ export class RougeEffect {
|
||||
|
||||
addRatio += await this.getMaxHpByBase();
|
||||
|
||||
|
||||
await updateCards([...this.updateCardMap.values()]);
|
||||
|
||||
return addRatio;
|
||||
}
|
||||
|
||||
@@ -244,7 +340,8 @@ export class RougeEffect {
|
||||
const dbRecord = await RougelikeRecordModel.findByGameCode(this.gameCode);
|
||||
let coinTotal = dbRecord?.coin || 0;
|
||||
if (this.newEffect.length == 0) return addRatio;
|
||||
for (const { effectParam, effectType } of this.newEffect) {
|
||||
for (const { effectParam, effectType, cardCode } of this.newEffect) {
|
||||
if (!getHolyCardIsUse(this.holyMap.get(cardCode))) continue;
|
||||
if (effectType != ROUGE_EFFECT_TYPE.HOLY_CHARA_MAIN_ATTR_UP_BY_COIN) continue;
|
||||
if (effectParam.length == 0) continue;
|
||||
const count = effectParam[0] || 0;
|
||||
@@ -252,6 +349,9 @@ export class RougeEffect {
|
||||
const value = effectParam[2] || 0;
|
||||
if (count == 0 || id != ABI_TYPE.ABI_HP || value == 0) continue;
|
||||
addRatio += Math.floor(coinTotal / count * value)
|
||||
|
||||
this.updateHolyMapUseCount(this.holyMap.get(cardCode));
|
||||
|
||||
}
|
||||
|
||||
return addRatio;
|
||||
@@ -261,13 +361,15 @@ export class RougeEffect {
|
||||
private async getMaxHpByBase() {
|
||||
let addRatio = 0;
|
||||
if (this.newEffect.length == 0) return addRatio;
|
||||
for (const { effectParam, effectType } of this.newEffect) {
|
||||
for (const { effectParam, effectType, cardCode } of this.newEffect) {
|
||||
if (effectType != ROUGE_EFFECT_TYPE.HOLY_CHARA_MAIN_ATTR_UP && effectType != ROUGE_EFFECT_TYPE.TECH_CHARA_MAIN_ATTR_UP) continue;
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(this.holyMap.get(cardCode))) continue;
|
||||
const id = effectParam[0] || 0;
|
||||
const value = effectParam[1] || 0;
|
||||
if (id != ABI_TYPE.ABI_HP || value == 0) continue;
|
||||
addRatio += value;
|
||||
this.updateHolyMapUseCount(this.holyMap.get(cardCode));
|
||||
}
|
||||
return addRatio;
|
||||
}
|
||||
@@ -283,9 +385,11 @@ export async function getCharaHp(roleId: string, gameCode: string) {
|
||||
ROUGE_EFFECT_TYPE.HOLY_CHARA_HP_RECOVERY_UP,// 2001
|
||||
]);
|
||||
if (newEffect.length == 0) return hpRatio;
|
||||
for (const { effectType, effectParam } of newEffect) {
|
||||
for (const { effectType, effectParam, cardCode } of newEffect) {
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
hpRatio += (effectParam[0] || 0);
|
||||
await updateHolyUseCount(holyMap.get(cardCode), gameCode)
|
||||
}
|
||||
return hpRatio;
|
||||
}
|
||||
@@ -300,17 +404,19 @@ export async function getAddCoin(roleId: string, gameCode: string, nodeType: num
|
||||
ROUGE_EFFECT_TYPE.TECH_COIN_UP_BY_NODE_TYPE, //3007
|
||||
]);
|
||||
if (newEffect.length == 0) return { coinRatio, coinAdd };
|
||||
for (const { effectType, effectParam } of newEffect) {
|
||||
for (const { effectType, effectParam, cardCode } of newEffect) {
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
if (effectType == ROUGE_EFFECT_TYPE.HOLY_COIN_UP) {
|
||||
const type = effectParam[0] || 0;
|
||||
const value = effectParam[1] || 0;
|
||||
if (type == 1) coinAdd += value;
|
||||
else if (type == 2) coinRatio += value;
|
||||
await updateHolyUseCount(holyMap.get(cardCode), gameCode)
|
||||
}
|
||||
if (effectType == ROUGE_EFFECT_TYPE.TECH_COIN_UP_BY_NODE_TYPE) {
|
||||
let [targetNodeType = 0, value = 0] = effectParam;
|
||||
if (targetNodeType == nodeType) coinRatio += value;
|
||||
let [value = 0, ...targetNodeType] = effectParam;
|
||||
if (targetNodeType && targetNodeType.includes(nodeType)) coinRatio += value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -318,7 +424,6 @@ export async function getAddCoin(roleId: string, gameCode: string, nodeType: num
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 获得圣物后,X流派特性卡的权重增加Y 2007
|
||||
export async function getAddPassiveWeight(roleId: string, gameCode: string, authorType: number) {
|
||||
let addPassiveWeight = 0;
|
||||
@@ -327,12 +432,14 @@ export async function getAddPassiveWeight(roleId: string, gameCode: string, auth
|
||||
ROUGE_EFFECT_TYPE.HOLY_PASSIVE_WEIGHT_UP_BY_AUTHOR,//2007
|
||||
]);
|
||||
if (newEffect.length == 0) return addPassiveWeight;
|
||||
for (const { effectParam } of newEffect) {
|
||||
for (const { effectParam, cardCode } of newEffect) {
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
const type = effectParam[0] || 0;
|
||||
const value = effectParam[1] || 0;
|
||||
if (type != authorType) continue;
|
||||
addPassiveWeight += value;
|
||||
await updateHolyUseCount(holyMap.get(cardCode), gameCode)
|
||||
}
|
||||
return addPassiveWeight;
|
||||
}
|
||||
@@ -344,6 +451,12 @@ export async function getNoBossRecoveryHp(roleId: string, gameCode: string) {
|
||||
ROUGE_EFFECT_TYPE.HOLY_REVIVE_ALL,//2009
|
||||
]);
|
||||
if (newEffect.length == 0) return false;
|
||||
for (const { effectParam, cardCode } of newEffect) {
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
await updateHolyUseCount(holyMap.get(cardCode), gameCode)
|
||||
}
|
||||
|
||||
|
||||
return true; // 拿到true 将所有学员更新和hp=maxHp
|
||||
}
|
||||
|
||||
@@ -357,9 +470,11 @@ export async function getBattleRecoveryNum(roleId: string, gameCode: string) {
|
||||
]);
|
||||
if (newEffect.length == 0) return recoveryNum;
|
||||
|
||||
for (const { effectParam } of newEffect) {
|
||||
for (const { effectParam, cardCode } of newEffect) {
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
recoveryNum += (effectParam[0] || 0)
|
||||
await updateHolyUseCount(holyMap.get(cardCode), gameCode)
|
||||
}
|
||||
return recoveryNum;
|
||||
}
|
||||
@@ -373,10 +488,12 @@ export async function getShopDiscount(roleId: string, gameCode: string) {
|
||||
ROUGE_EFFECT_TYPE.HOLY_SHOP_DISCOUNT,//2011
|
||||
]);
|
||||
if (newEffect.length == 0) return discount;
|
||||
for (const { effectParam } of newEffect) {
|
||||
for (const { effectParam, cardCode } of newEffect) {
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
const tempDiscount = effectParam[0] || 0;
|
||||
discount *= (tempDiscount / 100);
|
||||
await updateHolyUseCount(holyMap.get(cardCode), gameCode)
|
||||
}
|
||||
return Math.floor(discount);
|
||||
}
|
||||
@@ -390,15 +507,20 @@ export async function getChooseQualityPassives(roleId: string, gameCode: string,
|
||||
ROUGE_EFFECT_TYPE.HOLY_PASSIVE_CHOOSE_FIX,//2013
|
||||
]);
|
||||
if (newEffect.length == 0) return targetPassives;
|
||||
for (const { effectParam } of newEffect) {
|
||||
for (const { effectParam, cardCode } of newEffect) {
|
||||
let isUseCount = false;
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
const level = effectParam[0] || 0;
|
||||
for (let val of passiveCards) {
|
||||
const { cardId } = val;
|
||||
const passiveCardData = gameData.rougePassiveCard.get(cardId);
|
||||
if (level != passiveCardData?.lv || 0) continue;
|
||||
targetPassives.push(val);
|
||||
isUseCount = true;
|
||||
}
|
||||
if (isUseCount) await updateHolyUseCount(holyMap.get(cardCode), gameCode);
|
||||
|
||||
}
|
||||
return targetPassives;
|
||||
}
|
||||
@@ -410,10 +532,12 @@ export async function getAddChoosePassive(roleId: string, gameCode: string) {
|
||||
let { newEffect, holyMap } = await rougeEffect.getEffectData([
|
||||
ROUGE_EFFECT_TYPE.HOLY_PASSIVE_CHOOSE_NUM_UP,//2014
|
||||
]);
|
||||
for (const { effectParam } of newEffect) {
|
||||
for (const { effectParam, cardCode } of newEffect) {
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
const num = effectParam[0] || 0;
|
||||
addChooseNum += num;
|
||||
await updateHolyUseCount(holyMap.get(cardCode), gameCode);
|
||||
}
|
||||
return addChooseNum
|
||||
}
|
||||
@@ -425,27 +549,26 @@ export async function getSlotUnlockPoint(roleId: string, gameCode: string, dbCha
|
||||
let { newEffect, holyMap } = await rougeEffect.getEffectData([
|
||||
ROUGE_EFFECT_TYPE.HOLY_CHARA_SLOT_UNLOCK_POINT,//2023
|
||||
]);
|
||||
for (const { effectParam } of newEffect) {
|
||||
for (const { effectParam, cardCode } of newEffect) {
|
||||
if (effectParam.length == 0) continue;
|
||||
let isUseCount = false;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
const index = effectParam[0] || 0;
|
||||
for (let { cards = [] } of dbCharas) {
|
||||
if (cards.length == 0) {
|
||||
cards.push({ index, cardCode: '', cardId: 0 });
|
||||
isUpdate = true;
|
||||
continue;
|
||||
}
|
||||
if (cards.find(cur => cur.index == index) == undefined) {
|
||||
isUpdate = true
|
||||
cards.push({ index, cardCode: '', cardId: 0 });
|
||||
isUseCount = true;
|
||||
}
|
||||
}
|
||||
if (isUseCount) await updateHolyUseCount(holyMap.get(cardCode), gameCode);
|
||||
}
|
||||
|
||||
return { isUpdate, dbCharas };
|
||||
}
|
||||
|
||||
|
||||
// 休整点额外恢复X%的生命 2017 3006
|
||||
// 休整点额外恢复上限X%的生命 2017 3006
|
||||
export async function getRecoveryExtendHp(roleId: string, gameCode: string) {
|
||||
let hpRatio = 0;
|
||||
let rougeEffect = new RougeEffect(roleId, gameCode);
|
||||
@@ -454,9 +577,11 @@ export async function getRecoveryExtendHp(roleId: string, gameCode: string) {
|
||||
ROUGE_EFFECT_TYPE.TECH_RECOVERY_POINT_UP, // 3006
|
||||
]);
|
||||
if (newEffect.length == 0) return hpRatio;
|
||||
for (const { effectType, effectParam } of newEffect) {
|
||||
for (const { effectType, effectParam, cardCode } of newEffect) {
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
hpRatio += (effectParam[0] || 0);
|
||||
await updateHolyUseCount(holyMap.get(cardCode), gameCode);
|
||||
}
|
||||
return hpRatio;
|
||||
}
|
||||
@@ -471,10 +596,13 @@ export async function getTrainCardDiscount(roleId: string, gameCode: string) {
|
||||
ROUGE_EFFECT_TYPE.TECH_TRAIN_POINT_DISCOUNT, // 3009
|
||||
]);
|
||||
if (newEffect.length == 0) return discount;
|
||||
for (const { effectParam } of newEffect) {
|
||||
for (const { effectParam, cardCode } of newEffect) {
|
||||
if (effectParam.length == 0) continue;
|
||||
if (!getHolyCardIsUse(holyMap.get(cardCode))) continue;
|
||||
const tempDiscount = effectParam[0] || 0;
|
||||
discount *= (tempDiscount / 100);
|
||||
await updateHolyUseCount(holyMap.get(cardCode), gameCode);
|
||||
|
||||
}
|
||||
return Math.floor(discount);
|
||||
}
|
||||
@@ -533,4 +661,25 @@ export async function checkCanReRandomReward(roleId: string, gameCode: string, r
|
||||
});
|
||||
if (!curParam) return { canReRandom: false, costCoin: 0 }
|
||||
return { canReRandom: true, costCoin: curParam.effectParam[1] || 0 };
|
||||
}
|
||||
|
||||
|
||||
export function getHolyCardIsUse(holy: { cardId: number, useCount: number }) {
|
||||
const { useCount = 0, cardId } = (holy || {});
|
||||
if (!cardId) return;
|
||||
const holyCardData = gameData.rougeHolyCard.get(cardId)
|
||||
if (!holyCardData) return;
|
||||
if ((holyCardData?.useCount || 0) <= useCount) return;
|
||||
return true
|
||||
}
|
||||
|
||||
export async function updateHolyUseCount(holy: { cardId: number, useCount: number, cardCode: string }, gameCode: string) {
|
||||
const { cardId, cardCode } = (holy || {});
|
||||
if (!cardId || !cardCode) return;
|
||||
await RougelikeCardModel.updateByCode(gameCode, cardCode, { $inc: { useCount: 1 } })
|
||||
}
|
||||
|
||||
export async function updateCards(updateCards: RougelikeCardPara[]) {
|
||||
if (updateCards.length == 0) return;
|
||||
await RougelikeCardModel.bulkWriteUpdate(updateCards)
|
||||
}
|
||||
@@ -41,7 +41,7 @@ export async function getRougeData(roleId: string) {
|
||||
const dbExtends = await RougelikeExtendModel.findByRoleId(roleId);
|
||||
const limitIds = dbExtends.map(cur => cur.limitId);
|
||||
|
||||
return { isPlaying, gameCode, weeklyScore: dbScore?.score || 0, receivedScore: dbScore?.received || [], ...techData, collections, limitIds }
|
||||
return { isPlaying, gameCode, weeklyScore: dbScore?.score || 0, receivedScore: dbScore?.received || [], ...techData, collections, limitIds, takeoutRewardCnt: dbScore?.takeoutRewardCnt }
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -283,18 +283,24 @@ export async function chooseNode(dbRecord: RougelikeRecordType, layerChooseNode:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let weightRecords = [];
|
||||
if ((!dbDetail || !dbDetail.shops || dbDetail.shops.length == 0) && isShop) {
|
||||
shops = await getLayerShopReward(roleId, gameCode, authorType, nodeId, layerPlanData.shopPlan);
|
||||
dbPara.shops = shops;
|
||||
let result = await getLayerShopReward(roleId, gameCode, authorType, nodeId, layerPlanData.shopPlan);
|
||||
dbPara.shops = shops = result.shops;
|
||||
weightRecords = dbPara.weightRecords = (result?.weightRecords || [])
|
||||
}
|
||||
if (dbDetail && dbDetail.shops) shops = dbDetail.shops || shops;
|
||||
if (dbDetail && dbDetail.shops) { shops = dbDetail.shops || shops; weightRecords = dbDetail.weightRecords }
|
||||
|
||||
if ((!dbDetail || !dbDetail.rewards || dbDetail.rewards.length == 0) && isReward) {
|
||||
let result = await getLayerNodeReward(roleId, gameCode, authorType, nodeId, layerPlanData.rewardPlan, layer, dbPara.questType);
|
||||
if (result) {
|
||||
if (result && result.rewards) {
|
||||
reward = result;
|
||||
dbPara.rewards = result.rewards;
|
||||
}
|
||||
|
||||
// TODO正式环境屏蔽
|
||||
weightRecords = dbPara.weightRecords = (result?.weightRecords || []);
|
||||
}
|
||||
if (dbDetail && dbDetail.rewards) {
|
||||
let tempType = (dbDetail?.questType || 0) > 0 ? dbDetail?.questType : nodeType
|
||||
@@ -302,6 +308,8 @@ export async function chooseNode(dbRecord: RougelikeRecordType, layerChooseNode:
|
||||
if (!layerRewardData) return;
|
||||
let { coin, score, tech } = layerRewardData;
|
||||
reward = { rewards: dbDetail.rewards || [], score: score || 0, techScore: tech || 0, takeoutReward: layerPlanData.takeoutReward || [] };
|
||||
// TODO正式环境屏蔽
|
||||
weightRecords = dbDetail.weightRecords
|
||||
}
|
||||
|
||||
if (!dbDetail) {
|
||||
@@ -311,7 +319,7 @@ export async function chooseNode(dbRecord: RougelikeRecordType, layerChooseNode:
|
||||
await RougelikeLayerModel.updateByGameCodeAndLayer(gameCode, layer, detailCode, ROUGE_LIKE_CHOOSE_REWARD.CHOOSE)
|
||||
}
|
||||
|
||||
let curNode = { detailCode, nodeId, nodeType, status, warId, reward, shops, challenge, question, restPoints, }
|
||||
let curNode = { detailCode, nodeId, nodeType, status, warId, reward, shops, challenge, question, restPoints, weightRecords }
|
||||
// console.log('-x-x--x-x-x-x-x-x-x-x-x- curNode', util.inspect(curNode, { depth: null }));
|
||||
return curNode;
|
||||
}
|
||||
@@ -356,55 +364,79 @@ export async function getLayerNodeReward(roleId: string, gameCode: string, type:
|
||||
options: tempOptions,
|
||||
groupStatus: charaChooseNum > 0 ? ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE : ROUGE_LIKE_CHOOSE_REWARD.CHOOSE,
|
||||
chooseNum: charaChooseNum,
|
||||
reRandRewardCnt: 0,
|
||||
});
|
||||
}
|
||||
|
||||
let passiveCards = await getPassiveCardPlan(passiveCardPlan, passiveCardRandomNum, type, dbRougelikeCards, gameCode, roleId);
|
||||
passiveCardRandomNum = await getPassiveCardRandom(passiveCardChooseNum, passiveCardRandomNum, gameCode, layer, roleId);
|
||||
let { passiveCards, passiveWeightRecords } = await getPassiveCardPlan(passiveCardPlan, passiveCardRandomNum, type, dbRougelikeCards, gameCode, roleId);
|
||||
if (passiveCards && passiveCards.length > 0) {
|
||||
let chooseNum = await getPassiveCardChooseNum(passiveCardChooseNum, passiveCardRandomNum, gameCode, layer, roleId);
|
||||
rewards.push({
|
||||
groupIndex: rewards.length + 1,
|
||||
rewardType: ROUGE_LIKE_CARD_TYPE.PASSIVE,
|
||||
options: passiveCards.map((ele, index) => { return { optionIndex: index++, rewardId: ele.cardId, optionStatus: ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE, weightRecord: ele.weightRecord } }),
|
||||
options: passiveCards.map((ele, index) => { return { optionIndex: index++, rewardId: ele.cardId, optionStatus: ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE } }),
|
||||
groupStatus: chooseNum > 0 ? ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE : ROUGE_LIKE_CHOOSE_REWARD.CHOOSE,
|
||||
chooseNum
|
||||
chooseNum,
|
||||
reRandRewardCnt: 0,
|
||||
});
|
||||
}
|
||||
|
||||
let holyCards = await getHolyCardPlan(holyCardPlan, holyCardRandomNum, dbRougelikeCards, gameCode, roleId);
|
||||
let { holyCards, holyWeightRecords } = await getHolyCardPlan(holyCardPlan, holyCardRandomNum, dbRougelikeCards, gameCode, roleId);
|
||||
if (holyCards && holyCards.length > 0) {
|
||||
rewards.push({
|
||||
groupIndex: rewards.length + 1,
|
||||
rewardType: ROUGE_LIKE_CARD_TYPE.HOLY,
|
||||
options: holyCards.map((ele, index) => { return { optionIndex: index++, rewardId: ele.cardId, optionStatus: ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE, weightRecord: ele.weightRecord } }),
|
||||
options: holyCards.map((ele, index) => { return { optionIndex: index++, rewardId: ele.cardId, optionStatus: ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE } }),
|
||||
groupStatus: holyCardChooseNum > 0 ? ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE : ROUGE_LIKE_CHOOSE_REWARD.CHOOSE,
|
||||
chooseNum: holyCardChooseNum,
|
||||
reRandRewardCnt: 0,
|
||||
});
|
||||
}
|
||||
|
||||
// rewards.push({ groupIndex: rewards.length + 1, rewardType: 0, groupStatus: (coin || 0) > 0 ? ROUGE_LIKE_CHOOSE_REWARD.NOCHOOSE : ROUGE_LIKE_CHOOSE_REWARD.CHOOSE, chooseNum: coin || 0 })
|
||||
|
||||
return { rewards, score, techScore: tech };
|
||||
return { rewards, score, techScore: tech, weightRecords: [...(passiveWeightRecords || []), ...(holyWeightRecords || [])] };
|
||||
}
|
||||
|
||||
// 处理挑战类型中 接下来X次选择特性卡时,可选择的卡片数量少1
|
||||
export async function getPassiveCardRandom(passiveCardChooseNum: number, passiveCardRandomNum: number, gameCode: string, layer: number, roleId: string) {
|
||||
let num = passiveCardRandomNum;
|
||||
let dbDetails = await RougelikeRecordDetailModel.findByGameCodeAndLtLayer(gameCode, layer);
|
||||
if (dbDetails.length == 0) return num;
|
||||
for (let { challenge } of dbDetails) {
|
||||
if (challenge && Object.entries(challenge).length != 0 && challenge.status == 1) {
|
||||
let { challengeId } = challenge;
|
||||
const rougeChallengeData = gameData.rougeChallenge.get(challengeId);
|
||||
if (!rougeChallengeData) return num;
|
||||
for (let effectId of (rougeChallengeData.effectId || [])) {
|
||||
const rougeEffectTypeData = gameData.rougeEffect.get(effectId);
|
||||
if (rougeEffectTypeData.effectType != ROUGE_EFFECT_TYPE.CHALLENGE_PASSIVE_CARD_REDUCE) continue;
|
||||
num -= (rougeEffectTypeData.effectParam[1] || 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return num >= 0 ? num : 0;
|
||||
}
|
||||
|
||||
export async function getPassiveCardChooseNum(passiveCardChooseNum: number, passiveCardRandomNum: number, gameCode: string, layer: number, roleId: string) {
|
||||
let chooseNum = passiveCardChooseNum;
|
||||
let dbDetails = await RougelikeRecordDetailModel.findByGameCodeAndLtLayer(gameCode, layer);
|
||||
if (dbDetails.length == 0) return chooseNum;
|
||||
|
||||
for (let { challenge } of dbDetails) {
|
||||
if (challenge && Object.entries(challenge).length != 0 && challenge.status == 1) {
|
||||
let { challengeId } = challenge;
|
||||
const rougeChallengeData = gameData.rougeChallenge.get(challengeId);
|
||||
if (!rougeChallengeData) return chooseNum;
|
||||
for (let effectId of (rougeChallengeData.effectId || [])) {
|
||||
const rougeEffectTypeData = gameData.rougeEffect.get(effectId);
|
||||
if (rougeEffectTypeData.effectType != ROUGE_EFFECT_TYPE.CHALLENGE_PASSIVE_CARD_REDUCE) continue;
|
||||
chooseNum -= (rougeEffectTypeData.effectParam[1] || 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (let { challenge } of dbDetails) {
|
||||
// if (challenge && Object.entries(challenge).length != 0 && challenge.status == 1) {
|
||||
// let { challengeId } = challenge;
|
||||
// const rougeChallengeData = gameData.rougeChallenge.get(challengeId);
|
||||
// if (!rougeChallengeData) return chooseNum;
|
||||
// for (let effectId of (rougeChallengeData.effectId || [])) {
|
||||
// const rougeEffectTypeData = gameData.rougeEffect.get(effectId);
|
||||
// if (rougeEffectTypeData.effectType != ROUGE_EFFECT_TYPE.CHALLENGE_PASSIVE_CARD_REDUCE) continue;
|
||||
// chooseNum -= (rougeEffectTypeData.effectParam[1] || 0);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
chooseNum += await getAddChoosePassive(roleId, gameCode);
|
||||
|
||||
if (chooseNum < 0) chooseNum = 0;
|
||||
@@ -427,7 +459,7 @@ export async function getSelfPassiveCards(charaId: number, passiveCardPlan: numb
|
||||
let charaData = gameData.rougeChara.get(charaId);
|
||||
if (!charaData) return result;
|
||||
if (charaData.charaType != ROUGE_CHARA_TYPE.HIGH) return result;
|
||||
let passiveCards = await getPassiveCardPlan(passiveCardPlan, charaData.initCardCnt, type, dbRougelikeCards, gameCode, roleId);
|
||||
let { passiveCards } = await getPassiveCardPlan(passiveCardPlan, charaData.initCardCnt, type, dbRougelikeCards, gameCode, roleId);
|
||||
if (passiveCards && passiveCards.length > 0) result.push(...passiveCards.map((ele) => { return ele.cardId }),);
|
||||
|
||||
return result;
|
||||
@@ -446,12 +478,12 @@ export async function getLayerShopReward(roleId: string, gameCode: string, type:
|
||||
let shopPlanData = gameData.rougeShopPlan.get(shopPlan);
|
||||
// let nodeData = gameData.rougeNode.get(nodeId);
|
||||
|
||||
if (!shopPlanData) return shops;
|
||||
if (!shopPlanData) return { shops };
|
||||
|
||||
|
||||
let dbRougelikeCards = await RougelikeCardModel.findByGameCodeAndType(gameCode, ROUGE_LIKE_CARD_TYPE.PASSIVE);
|
||||
|
||||
let passiveCards = await getPassiveCardPlan(shopPlanData.passivecardPlanId, shopPlanData.passiveCardRandomNum, type || 0, dbRougelikeCards, gameCode, roleId);
|
||||
let { passiveCards, passiveWeightRecords } = await getPassiveCardPlan(shopPlanData.passivecardPlanId, shopPlanData.passiveCardRandomNum, type || 0, dbRougelikeCards, gameCode, roleId);
|
||||
let index = 0, discount = await getShopDiscount(roleId, gameCode);
|
||||
if (passiveCards && passiveCards.length > 0) {
|
||||
for (let ele of passiveCards) {
|
||||
@@ -468,7 +500,7 @@ export async function getLayerShopReward(roleId: string, gameCode: string, type:
|
||||
}
|
||||
}
|
||||
|
||||
let holyCards = await getHolyCardPlan(shopPlanData?.holyCardPlanId, shopPlanData?.holyCardRandomNum, dbRougelikeCards, gameCode, roleId);
|
||||
let { holyCards, holyWeightRecords } = await getHolyCardPlan(shopPlanData?.holyCardPlanId, shopPlanData?.holyCardRandomNum, dbRougelikeCards, gameCode, roleId);
|
||||
if (holyCards && holyCards.length > 0) {
|
||||
for (let ele of holyCards) {
|
||||
let price = gameData.rougeHolyCard.get(ele.cardId)?.purchasePrice || 0;
|
||||
@@ -483,7 +515,7 @@ export async function getLayerShopReward(roleId: string, gameCode: string, type:
|
||||
}
|
||||
}
|
||||
|
||||
return shops;
|
||||
return { shops, weightRecords: [...(passiveWeightRecords || []), ...(holyWeightRecords || [])] };
|
||||
}
|
||||
|
||||
|
||||
@@ -533,7 +565,7 @@ export function getCharaCardPlan(planId: number, charaRandomNum: number) {
|
||||
*/
|
||||
export async function getPassiveCardPlan(passiveCardPlan: number, passiveCardRandomNum: number, type: number, dbRougelikeCards: RougelikeCardType[], gameCode: string, roleId: string) {
|
||||
let cards = checkRandomLimit(passiveCardPlan, passiveCardRandomNum, ROUGE_LIKE_CARD_TYPE.PASSIVE);
|
||||
if (cards.length <= passiveCardRandomNum) return cards;
|
||||
if (cards.length <= passiveCardRandomNum) return { passiveCards: cards };
|
||||
|
||||
// 计算变化权重
|
||||
let lableMap = new Map<number, number>(); //统计lable数量
|
||||
@@ -582,9 +614,11 @@ export async function getPassiveCardPlan(passiveCardPlan: number, passiveCardRan
|
||||
|
||||
|
||||
weight += await getAddPassiveWeight(roleId, gameCode, type);
|
||||
if ((passiveCardData?.authorType || 0) == type) weight += ROUGELIKE.AUTHOR_ADD_RANDOM;
|
||||
if ((passiveCardData?.authorType || 0) == type) {
|
||||
weight += ROUGELIKE.AUTHOR_ADD_RANDOM;
|
||||
weightRecord.authorAddWeight = ROUGELIKE.AUTHOR_ADD_RANDOM;
|
||||
}
|
||||
|
||||
weightRecord.authorAddWeight = ROUGELIKE.AUTHOR_ADD_RANDOM;
|
||||
|
||||
let labelNum = lableMap.get(cardId) || 0;
|
||||
if (labelNum >= ROUGELIKE.PASSIVE_LABLE_NUM) {
|
||||
@@ -611,7 +645,7 @@ export async function getPassiveCardPlan(passiveCardPlan: number, passiveCardRan
|
||||
|
||||
let randResult = getRandEelmWithWeightAndNum(newCards, passiveCardRandomNum - result.length);
|
||||
|
||||
return [...result, ...randResult.map(cur => cur.dic)]
|
||||
return { passiveCards: [...result, ...randResult.map(cur => cur.dic)], passiveWeightRecords: newCards }
|
||||
}
|
||||
|
||||
export async function getIsChooseCard(gameCode: string) {
|
||||
@@ -650,7 +684,7 @@ export async function getCardCount(gameCode: string, type: number) {
|
||||
export async function getHolyCardPlan(holyCardPlan: number, holyCardRandomNum: number, dbRougelikeCards: RougelikeCardType[], gameCode: string, roleId: string) {
|
||||
|
||||
let cards = checkRandomLimit(holyCardPlan, holyCardRandomNum, ROUGE_LIKE_CARD_TYPE.HOLY);
|
||||
if (cards.length <= holyCardRandomNum) return cards;
|
||||
if (cards.length <= holyCardRandomNum) return { holyCards: cards };
|
||||
|
||||
let lableMap = new Map<number, number>();//统计lable数量
|
||||
if (dbRougelikeCards && dbRougelikeCards.length > ROUGELIKE.HOLY_LABLE_NUM) {
|
||||
@@ -720,7 +754,7 @@ export async function getHolyCardPlan(holyCardPlan: number, holyCardRandomNum: n
|
||||
}
|
||||
|
||||
let randResult = getRandEelmWithWeightAndNum(newCards, holyCardRandomNum);
|
||||
return randResult.map(cur => cur.dic);
|
||||
return { holyCards: randResult.map(cur => cur.dic), holyWeightRecords: newCards }
|
||||
}
|
||||
|
||||
|
||||
@@ -755,8 +789,6 @@ export function getChallengePlan(planId: number) {
|
||||
|
||||
export async function updateChalleng(dbRecord: RougelikeRecordType, roleId: string, sid: string, gameCode: string, curLayer: number, rougeDamage, isAp?: boolean, isRound?: boolean) {
|
||||
let len = rougeDamage.length;
|
||||
const minHp = rougeDamage.reduce((min, cur) => { return Math.min(min, cur.hp); }, Infinity);
|
||||
|
||||
let challenges: { challengeId: number, status: number, progress: number, detailCode: string }[] = [];
|
||||
const { authorType, type, grade } = dbRecord;
|
||||
let dbDetails = await RougelikeRecordDetailModel.findByGameCodeAndLtLayer(gameCode, curLayer);
|
||||
@@ -778,8 +810,18 @@ export async function updateChalleng(dbRecord: RougelikeRecordType, roleId: stri
|
||||
if (rougeEffectTypeData.effectType == ROUGE_EFFECT_TYPE.CHALLENGE_PASSIVE_CARD_REDUCE) continue;
|
||||
if (rougeEffectTypeData.effectType == ROUGE_EFFECT_TYPE.CHALLENGE_CHARA_NO_AP_SKILL && isAp) continue;
|
||||
if (rougeEffectTypeData.effectType == ROUGE_EFFECT_TYPE.CHALLENGE_CHARA_NO_ROUND_SKILL && isRound) continue;
|
||||
if (rougeEffectTypeData.effectType == ROUGE_EFFECT_TYPE.CHALLENGE_CHARA_HP_LIMIT && (rougeEffectTypeData.effectParam[1] || 0) > minHp) continue;
|
||||
if (rougeEffectTypeData.effectType == ROUGE_EFFECT_TYPE.CHALLENGE_CHARA_NUM_LIMIT && (rougeEffectTypeData.effectParam[1] || 0) != len) continue;//接下来X场战斗,每场战斗只能上阵2名学员
|
||||
if (rougeEffectTypeData.effectType == ROUGE_EFFECT_TYPE.CHALLENGE_CHARA_HP_LIMIT) {
|
||||
let isNext = true;
|
||||
for (let obj of rougeDamage) {
|
||||
const { maxHp = 0, hp = 0 } = (obj || {});
|
||||
if (maxHp == 0 || hp == 0) { isNext = false; break; }
|
||||
if (maxHp * (rougeEffectTypeData.effectParam[1] || 0) / 100 > hp) { isNext = false; break; }
|
||||
}
|
||||
|
||||
if (!isNext) continue;
|
||||
}
|
||||
|
||||
if (rougeEffectTypeData.effectType == ROUGE_EFFECT_TYPE.CHALLENGE_CHARA_NUM_LIMIT && (rougeEffectTypeData.effectParam[1] || 0) < len) continue;//接下来X场战斗,每场战斗不超过上阵2名学员
|
||||
}
|
||||
|
||||
challenge.progress += 1;
|
||||
@@ -892,14 +934,17 @@ export async function getMaxHp(roleId: string, gameCode: string, charaId: number
|
||||
return Math.floor(maxHp);
|
||||
}
|
||||
|
||||
export async function updateMaxHp(roleId: string, gameCode: string, type: number, grade: number) {
|
||||
export async function updateMaxHp(roleId: string, gameCode: string, type: number, grade: number, updateCharasMap) {
|
||||
let dbCharas = await RougelikeCharaModel.findByGameCode(gameCode);
|
||||
if (dbCharas.length == 0) return [];
|
||||
|
||||
let result: RougelikeCharaType[] = [];
|
||||
for (let val of dbCharas) {
|
||||
if (updateCharasMap.has(val.charaCode)) {
|
||||
val = { ...val, ...updateCharasMap.get(val.charaCode) }
|
||||
}
|
||||
let tempMaxHp = await getMaxHp(roleId, gameCode, val.charaId, type, grade);
|
||||
if (tempMaxHp == val.maxHp) continue;
|
||||
if (tempMaxHp == val.maxHp && !updateCharasMap.has(val.charaCode)) continue;
|
||||
val.maxHp = tempMaxHp;
|
||||
result.push(val);
|
||||
}
|
||||
@@ -947,7 +992,7 @@ export async function getGame(roleId: string) {
|
||||
const charas: CommonChara[] = formateCharasOrCards(await RougelikeCharaModel.findByGameCode(gameCode), ROUGE_LIKE_CARD_TYPE.CHARA)?.charas || [];
|
||||
const cards: CommonCard[] = formateCharasOrCards(await RougelikeCardModel.findByGameCode(gameCode), ROUGE_LIKE_CARD_TYPE.PASSIVE | ROUGE_LIKE_CARD_TYPE.HOLY)?.cards || [];
|
||||
|
||||
console.log("x-x-x-x-x-x-x-x- dbCurLayerChooseNode", dbCurLayerChooseNode)
|
||||
// console.log("x-x-x-x-x-x-x-x- dbCurLayerChooseNode", dbCurLayerChooseNode)
|
||||
if (Object.entries(dbCurLayerChooseNode).length != 0) curNode = await chooseNode(dbRecord, dbCurLayerChooseNode, curLayer)
|
||||
|
||||
return {
|
||||
|
||||
@@ -913,10 +913,10 @@ export function checkRouteParam(route: string, msg: any) {
|
||||
|
||||
case "battle.rougeHandler.battleEnd":
|
||||
{
|
||||
let { gameCode, detailCode, battleCode, warId, status, round, rougeDamage, isAp, isRound } = msg;
|
||||
let { gameCode, detailCode, battleCode, warId, status, round, rougeDamage } = msg;
|
||||
if (!checkNaturalStrings(gameCode, detailCode, battleCode)) return false;
|
||||
if (!checkNaturalNumbers(warId, round, status)) return false;
|
||||
if (!checkBooleanIfExist(isAp, isRound)) return false;
|
||||
// if (!checkBooleanIfExist(isAp, isRound)) return false;
|
||||
if (!isArray(rougeDamage) || rougeDamage.length == 0) return false;
|
||||
let charaCodes: string[] = [];
|
||||
for (let { charaCode } of rougeDamage) {
|
||||
|
||||
@@ -35,6 +35,8 @@ class RougeCharaRecord {
|
||||
apSkill?: number; // 玩家选择的怒气技能卡
|
||||
@prop({ required: false, default: 0 })
|
||||
shield?: number
|
||||
@prop({ required: false, default: 0 })
|
||||
others?: string
|
||||
@prop({ required: false })
|
||||
damage?: number;
|
||||
@prop({ required: false })
|
||||
|
||||
@@ -44,7 +44,7 @@ export default class RougelikeCard extends BaseModel {
|
||||
useCount?: number // 可使用次数
|
||||
|
||||
|
||||
public static async updateByCode(gameCode: string, cardCode: string, params: { $set?: RougelikeCardPara, $inc?: { lv?: number } }, lean = true) {
|
||||
public static async updateByCode(gameCode: string, cardCode: string, params: { $set?: RougelikeCardPara, $inc?: { lv?: number, useCount?: number } }, lean = true) {
|
||||
const result: RougelikeCardType = await RougelikeCardModel.findOneAndUpdate({ gameCode, cardCode }, params, { new: true, upsert: true }).lean(lean);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,9 @@ export default class RougelikeChara extends BaseModel {
|
||||
@prop({ required: true, default: 0 })
|
||||
shield: number; // 盾
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
others: string; // 盾其他数据
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
roundSkill: number; // 玩家选择的回合技能卡
|
||||
|
||||
|
||||
@@ -97,7 +97,6 @@ export class Shop {
|
||||
discountPrice: number; //购买时折扣价格
|
||||
}
|
||||
|
||||
|
||||
export class WeightRecord {
|
||||
@prop({ required: false, default: 0 })
|
||||
originalWight?: number;
|
||||
@@ -118,6 +117,18 @@ export class WeightRecord {
|
||||
@prop({ required: false, default: 0 })
|
||||
finalWeight?: number;
|
||||
}
|
||||
export class RandomRec {
|
||||
@prop({ required: false, default: 0 })
|
||||
id?: number;
|
||||
@prop({ required: false, default: 0 })
|
||||
planId?: number; // 方案编号
|
||||
@prop({ required: false, default: 0 })
|
||||
cardId?: number; // 角色卡id
|
||||
@prop({ required: false, default: 0 })
|
||||
weight?: number; // 权重
|
||||
@prop({ required: false, type: WeightRecord, default: {} })
|
||||
weightRecords?: WeightRecord;
|
||||
}
|
||||
|
||||
export class Option {
|
||||
@prop({ required: true, default: 0 })
|
||||
@@ -130,8 +141,8 @@ export class Option {
|
||||
@prop({ required: false, type: Number, default: [] })
|
||||
passiveCardIds?: number[]; //高级学员自带特性卡
|
||||
|
||||
@prop({ required: false, type: WeightRecord, default: {} })
|
||||
weightRecord?: WeightRecord //用于测试权重记录
|
||||
// @prop({ required: false, type: WeightRecord, default: {} })
|
||||
// weightRecord?: WeightRecord //用于测试权重记录
|
||||
}
|
||||
export class RewardIn {
|
||||
@prop({ required: true, default: 0 })
|
||||
@@ -144,6 +155,8 @@ export class RewardIn {
|
||||
groupStatus: number; // 组选择 0-未选择 1-已选择
|
||||
@prop({ required: true, default: 0 })
|
||||
chooseNum: number; // 这一组总共能选的数量3选2
|
||||
@prop({ required: false, default: 0 })
|
||||
reRandRewardCnt: number; // 重新随机奖励
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,8 +216,8 @@ export default class RougelikeRecordDetail extends BaseModel {
|
||||
@prop({ required: false, type: RewardIn, default: [] })
|
||||
rewards?: RewardIn[]; // 通用过关后的奖励,挑战后的奖励
|
||||
|
||||
@prop({ required: false, default: 0 })
|
||||
reRandRewardCnt: number; // 重新随机奖励
|
||||
@prop({ required: false, type: RandomRec, default: [] })
|
||||
weightRecords?: RandomRec[];
|
||||
|
||||
public static async updateByCode(gameCode: string, detailCode: string, params: { $set: RougelikeRecordDetailPara, $inc?: { reRandRewardCnt: 1 } }, lean = true) {
|
||||
const result: RougelikeRecordDetailType = await RougelikeRecordDetailModel.findOneAndUpdate({ gameCode, detailCode }, params, { new: true, upsert: true }).lean(lean);
|
||||
|
||||
@@ -47,9 +47,13 @@ export interface RougeDamageInter {
|
||||
hp: number;
|
||||
ap: number;
|
||||
shield: number;
|
||||
others: string;
|
||||
damage: number;
|
||||
heal: number;
|
||||
unserDamage: number;
|
||||
isAp: boolean;
|
||||
isRound: boolean;
|
||||
maxHp?:number;
|
||||
}
|
||||
|
||||
export interface Uid {
|
||||
@@ -116,6 +120,7 @@ export class CommonChara {
|
||||
maxHp: number; // 最大hp
|
||||
ap: number; // 当前怒气
|
||||
shield: number;
|
||||
others: string;
|
||||
roundSkill: number; // 玩家选择的回合技能卡
|
||||
apSkill: number; // 玩家选择的怒气技能卡
|
||||
|
||||
@@ -128,6 +133,7 @@ export class CommonChara {
|
||||
this.maxHp = chara?.maxHp || 0;
|
||||
this.ap = chara?.ap || 0;
|
||||
this.shield = chara?.shield || 0;
|
||||
this.others = chara?.others || '';
|
||||
this.roundSkill = chara?.roundSkill || 0;
|
||||
this.apSkill = chara?.apSkill || 0;
|
||||
}
|
||||
@@ -161,23 +167,23 @@ export interface CommonNode {
|
||||
};
|
||||
|
||||
|
||||
export interface WeightRecord {
|
||||
originalWight?: number;
|
||||
passiveRedWight?: number;
|
||||
holyRedWight?: number;
|
||||
authorAddWeight?: number;
|
||||
passiveLableNum?: number;
|
||||
passiveLableNumAddWeight?: number;
|
||||
holyLableNum?: number;
|
||||
holyLableNumAddWeight?: number;
|
||||
finalWeight?: number;
|
||||
}
|
||||
// export interface WeightRecord {
|
||||
// originalWight?: number;
|
||||
// passiveRedWight?: number;
|
||||
// holyRedWight?: number;
|
||||
// authorAddWeight?: number;
|
||||
// passiveLableNum?: number;
|
||||
// passiveLableNumAddWeight?: number;
|
||||
// holyLableNum?: number;
|
||||
// holyLableNumAddWeight?: number;
|
||||
// finalWeight?: number;
|
||||
// }
|
||||
export interface RewardOption {
|
||||
optionIndex: number; // 第几个选项
|
||||
rewardId: number; // 角色卡的id或特性卡的id或圣物的id
|
||||
optionStatus: number; // 0-没有选择这个奖励 1-选择了这个奖励
|
||||
passiveCardIds?: number[]; //高级学员自带特性卡
|
||||
weightRecord?: WeightRecord //用于测试权重记录
|
||||
// weightRecord?: WeightRecord //用于测试权重记录
|
||||
}
|
||||
|
||||
export interface CommonReward {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"id": 1,
|
||||
"challengeId": 1,
|
||||
"effectId": "10010103&",
|
||||
"content": "<color=#2e190a>接下来2场战斗,敌军攻击提高30%</color>",
|
||||
"content": "<color=#2e190a>接下来2场战斗,敌军生命提高30%</color>",
|
||||
"condition": 2,
|
||||
"reward": "31002&10"
|
||||
},
|
||||
@@ -35,7 +35,7 @@
|
||||
"id": 5,
|
||||
"challengeId": 5,
|
||||
"effectId": "10050203&",
|
||||
"content": "<color=#2e190a>接下来2场战斗,战斗结束后我军学员生命不低于80%</color>",
|
||||
"content": "<color=#2e190a>接下来任意2场战斗,战斗结束后我军学员生命不低于80%</color>",
|
||||
"condition": 2,
|
||||
"reward": "31002&50"
|
||||
},
|
||||
@@ -43,7 +43,7 @@
|
||||
"id": 6,
|
||||
"challengeId": 6,
|
||||
"effectId": "10060102&",
|
||||
"content": "<color=#2e190a>接下来2场战斗,战斗过程中我军学员无法使用怒气技</color>",
|
||||
"content": "<color=#2e190a>接下来任意2场战斗,战斗过程中我军学员不使用怒气技</color>",
|
||||
"condition": 2,
|
||||
"reward": "31002&60"
|
||||
},
|
||||
@@ -51,7 +51,7 @@
|
||||
"id": 7,
|
||||
"challengeId": 7,
|
||||
"effectId": "10070102&",
|
||||
"content": "<color=#2e190a>接下来2场战斗,战斗过程中我军学员无法使用回合技</color>",
|
||||
"content": "<color=#2e190a>接下来任意2场战斗,战斗过程中我军学员不使用回合技</color>",
|
||||
"condition": 2,
|
||||
"reward": "31002&70"
|
||||
},
|
||||
@@ -59,7 +59,7 @@
|
||||
"id": 8,
|
||||
"challengeId": 8,
|
||||
"effectId": "10080102&",
|
||||
"content": "<color=#2e190a>接下来2次选择特性卡时,可选择的卡片数量少1</color>",
|
||||
"content": "<color=#2e190a>接下来2次选择特性卡时,随机出的卡片数量-1</color>",
|
||||
"condition": 2,
|
||||
"reward": "31002&80"
|
||||
},
|
||||
@@ -67,7 +67,7 @@
|
||||
"id": 9,
|
||||
"challengeId": 9,
|
||||
"effectId": "10090102&",
|
||||
"content": "<color=#2e190a>接下来2场战斗,每场战斗只能上阵2名学员</color>",
|
||||
"content": "<color=#2e190a>接下来任意2场战斗,每场战斗上阵不超出2名学员</color>",
|
||||
"condition": 2,
|
||||
"reward": "31002&90"
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -55,7 +55,7 @@
|
||||
"kind": 1,
|
||||
"param": "count&",
|
||||
"name": "挑战效果",
|
||||
"info": "接下来X场战斗,战斗过程中我军学员无法使用怒气技",
|
||||
"info": "接下来X场战斗,战斗过程中我军学员不使用怒气技",
|
||||
"conditon": "count",
|
||||
"tips": "&"
|
||||
},
|
||||
@@ -65,7 +65,7 @@
|
||||
"kind": 1,
|
||||
"param": "count&",
|
||||
"name": "挑战效果",
|
||||
"info": "接下来X场战斗,战斗过程中我军学员无法使用回合技",
|
||||
"info": "接下来X场战斗,战斗过程中我军学员不使用回合技",
|
||||
"conditon": "count",
|
||||
"tips": "&"
|
||||
},
|
||||
@@ -83,9 +83,9 @@
|
||||
"id": 1009,
|
||||
"effectType": 1009,
|
||||
"kind": 1,
|
||||
"param": "count&",
|
||||
"param": "count&num",
|
||||
"name": "挑战效果",
|
||||
"info": "接下来X场战斗,每场战斗只能上阵2名学员",
|
||||
"info": "接下来X场战斗,每场战斗只能不超出X名学员",
|
||||
"conditon": "count",
|
||||
"tips": "&"
|
||||
},
|
||||
@@ -295,7 +295,7 @@
|
||||
"kind": 2,
|
||||
"param": "num&属性id&value",
|
||||
"name": "圣物效果",
|
||||
"info": "每场战斗第X回合后,全员属性id提高Y",
|
||||
"info": "每场战斗第X回合后,全员属性id提高Y(用seid实现)",
|
||||
"conditon": "&",
|
||||
"tips": "num填多少,表示num%"
|
||||
},
|
||||
@@ -373,7 +373,7 @@
|
||||
"id": 3007,
|
||||
"effectType": 3007,
|
||||
"kind": 3,
|
||||
"param": "nodeType&nodeType|X",
|
||||
"param": "X&nodeType&nodeType",
|
||||
"name": "法阵效果",
|
||||
"info": "某些nodeType后获得的试炼币增加X%",
|
||||
"conditon": "&",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1000",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 300000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "&"
|
||||
},
|
||||
@@ -31,7 +31,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1000",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 400000,
|
||||
"heroValue": 4000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "&"
|
||||
},
|
||||
@@ -45,11 +45,11 @@
|
||||
"buyRewardPlan": 0,
|
||||
"layerCount": 15,
|
||||
"layerPlan": 301,
|
||||
"challengePlan": 3,
|
||||
"challengePlan": 7,
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1001",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 500000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "1&1&5|1&2&3"
|
||||
},
|
||||
@@ -67,7 +67,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1001",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 600000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "1&1&10|1&2&5"
|
||||
},
|
||||
@@ -85,7 +85,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1002",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 700000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "1&1&10|1&2&7|1&3&3"
|
||||
},
|
||||
@@ -103,7 +103,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1002",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 800000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "1&1&12|1&2&10|1&3&5"
|
||||
},
|
||||
@@ -121,7 +121,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1003",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 900000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "1&1&12|1&2&10|1&3&5|1&4&1"
|
||||
},
|
||||
@@ -139,7 +139,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1003",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 500000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "2&1&5|2&2&3"
|
||||
},
|
||||
@@ -157,7 +157,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1004",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 600000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "2&1&10|2&2&5"
|
||||
},
|
||||
@@ -175,7 +175,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1004",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 700000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "2&1&10|2&2&7|2&3&3"
|
||||
},
|
||||
@@ -193,7 +193,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1005",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 800000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "2&1&12|2&2&10|2&3&5"
|
||||
},
|
||||
@@ -211,7 +211,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1005",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 900000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "2&1&12|2&2&10|2&3&5|2&4&1"
|
||||
},
|
||||
@@ -229,7 +229,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1006",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 500000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "3&1&5|3&2&3"
|
||||
},
|
||||
@@ -247,7 +247,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1006",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 600000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "3&1&10|3&2&5"
|
||||
},
|
||||
@@ -265,7 +265,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1007",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 700000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "3&1&10|3&2&7|3&3&3"
|
||||
},
|
||||
@@ -283,7 +283,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1007",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 800000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "3&1&12|3&2&10|3&3&5"
|
||||
},
|
||||
@@ -301,7 +301,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1008",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 900000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "3&1&12|3&2&10|3&3&5|3&4&1"
|
||||
},
|
||||
@@ -319,7 +319,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1008",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 500000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "4&1&5|4&2&3"
|
||||
},
|
||||
@@ -337,7 +337,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1009",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 600000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "4&1&10|4&2&5"
|
||||
},
|
||||
@@ -355,7 +355,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1009",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 700000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "4&1&10|4&2&7|4&3&3"
|
||||
},
|
||||
@@ -373,7 +373,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1010",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 800000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "4&1&12|4&2&10|4&3&5"
|
||||
},
|
||||
@@ -391,7 +391,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1010",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 900000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "4&1&12|4&2&10|4&3&5|4&4&1"
|
||||
},
|
||||
@@ -409,7 +409,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1011",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 500000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "5&1&5|5&2&3"
|
||||
},
|
||||
@@ -427,7 +427,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1011",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 600000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "5&1&10|5&2&5"
|
||||
},
|
||||
@@ -445,7 +445,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1012",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 700000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "5&1&10|5&2&7|5&3&3"
|
||||
},
|
||||
@@ -463,7 +463,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1012",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 800000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "5&1&12|5&2&10|5&3&5"
|
||||
},
|
||||
@@ -481,7 +481,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1013",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 900000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "5&1&12|5&2&10|5&3&5|5&4&1"
|
||||
},
|
||||
@@ -499,7 +499,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1013",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 500000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "6&1&5|6&2&3"
|
||||
},
|
||||
@@ -517,7 +517,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1014",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 600000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "6&1&10|6&2&5"
|
||||
},
|
||||
@@ -535,7 +535,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1014",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 700000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "6&1&10|6&2&7|6&3&3"
|
||||
},
|
||||
@@ -553,7 +553,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1015",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 800000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "6&1&12|6&2&10|6&3&5"
|
||||
},
|
||||
@@ -571,7 +571,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1015",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 900000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "6&1&12|6&2&10|6&3&5|6&4&1"
|
||||
},
|
||||
@@ -589,7 +589,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1016",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 500000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "7&1&5|7&2&3"
|
||||
},
|
||||
@@ -607,7 +607,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1016",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 600000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "7&1&10|7&2&5"
|
||||
},
|
||||
@@ -625,7 +625,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1017",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 700000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "7&1&10|7&2&7|7&3&3"
|
||||
},
|
||||
@@ -643,7 +643,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1017",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 800000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "7&1&12|7&2&10|7&3&5"
|
||||
},
|
||||
@@ -661,7 +661,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1018",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 900000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "7&1&12|7&2&10|7&3&5|7&4&1"
|
||||
},
|
||||
@@ -679,7 +679,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1018",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 500000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "8&1&5|8&2&3"
|
||||
},
|
||||
@@ -697,7 +697,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1019",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 600000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "8&1&10|8&2&5"
|
||||
},
|
||||
@@ -715,7 +715,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1019",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 700000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "8&1&10|8&2&7|8&3&3"
|
||||
},
|
||||
@@ -733,7 +733,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&50|31001&1020",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 800000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "8&1&12|8&2&10|8&3&5"
|
||||
},
|
||||
@@ -751,7 +751,7 @@
|
||||
"randomEventPlan": 1,
|
||||
"firstReward": "31002&100|31001&1020",
|
||||
"heroRatioPlan": 1,
|
||||
"heroValue": 900000,
|
||||
"heroValue": 3000,
|
||||
"heroSecondAttrLevel": 1,
|
||||
"takeoutRewardShow": "8&1&12|8&2&10|8&3&5|8&4&1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user