diff --git a/client/src/utils/fight/FighterHolder.ts b/client/src/utils/fight/FighterHolder.ts index 34a2577e5..a1b1942ce 100644 --- a/client/src/utils/fight/FighterHolder.ts +++ b/client/src/utils/fight/FighterHolder.ts @@ -497,8 +497,8 @@ export default class FighterHolder { } else if (this.type === 'pet') { this.#animationType = (fighter.name.startsWith('dog') || fighter.name === 'panther') ? 'dog' : 'bear'; } else { - const bossType = bosses.find((b) => b.name === fighter.name)?.base as 'bear' | 'panther' || 'bear'; - this.#animationType = bossType === 'panther' ? 'dog' : bossType; + const bossType = bosses.find((b) => b.name === fighter.name)?.base as 'bear' | 'panther' | 'dog1' || 'bear'; + this.#animationType = bossType === 'dog1' || bossType === 'panther' ? 'dog' : bossType; } // Get all animations @@ -578,6 +578,13 @@ export default class FighterHolder { green: 0.8, blue: 0.8, })]; + } else if (fighter.name === BossName.Cerberus) { + this.container.filters = [new AdjustmentFilter({ + gamma: 1, + brightness: 0.37, + red: 1.1, + blue: 1.02, + })]; } } } diff --git a/client/src/utils/fight/utils/getFighterType.ts b/client/src/utils/fight/utils/getFighterType.ts index c35696788..3bb38b849 100644 --- a/client/src/utils/fight/utils/getFighterType.ts +++ b/client/src/utils/fight/utils/getFighterType.ts @@ -8,7 +8,8 @@ const getFighterType = ( if (fighter.type === 'pet') { type = fighter.name.startsWith('dog') ? 'dog' : fighter.name as 'bear' | 'panther'; } else if (fighter.type === 'boss') { - type = bosses.find((b) => b.name === fighter.name)?.base as 'bear' | 'panther' || 'bear'; + const bossType = bosses.find((b) => b.name === fighter.name)?.base as 'bear' | 'panther' | 'dog1' || 'bear'; + type = bossType === 'dog1' ? 'dog' : bossType; } return type; diff --git a/core/src/brute/bosses.ts b/core/src/brute/bosses.ts index 776a960af..cd543171b 100644 --- a/core/src/brute/bosses.ts +++ b/core/src/brute/bosses.ts @@ -22,6 +22,7 @@ export interface Boss { const bear = pets.find((p) => p.name === PetName.bear) as Pet; const panther = pets.find((p) => p.name === PetName.panther) as Pet; +const dog1 = pets.find((p) => p.name === PetName.dog1) as Pet; const bosses: Boss[] = [ { @@ -60,6 +61,24 @@ const bosses: Boss[] = [ damage: panther.damage, reach: 3, }, + { + name: BossName.Cerberus, + base: PetName.dog1, + scale: 2.15, + initiative: 1.5, + strength: dog1.strength * 7.5, + agility: dog1.agility, + speed: dog1.speed, + hp: 30000, + counter: dog1.counter, + combo: 0, + block: dog1.block, + evasion: -0.2, + accuracy: 0.75, + disarm: dog1.disarm, + damage: dog1.damage, + reach: 1, + }, ]; export default bosses; diff --git a/core/src/constants.ts b/core/src/constants.ts index d18a98960..18f951af3 100644 --- a/core/src/constants.ts +++ b/core/src/constants.ts @@ -84,6 +84,7 @@ export const RESET_PRICE = 100; export const CLAN_SIZE_LIMIT = 50; export const BOSS_XP_REWARD = 500; +export const FIRST_BOSS_GOLD_REWARD = 100; export const BOSS_GOLD_REWARD = 500; export enum BruteDeletionReason { diff --git a/server/src/controllers/Clans.ts b/server/src/controllers/Clans.ts index d191311f7..c0ce12c12 100644 --- a/server/src/controllers/Clans.ts +++ b/server/src/controllers/Clans.ts @@ -3,10 +3,9 @@ import { ClanCreateResponse, ClanGetResponse, ClanGetThreadResponse, ClanGetThreadsResponse, ClanListResponse, ClanSort, ExpectedError, bosses, getFightsLeft, - randomItem, } from '@labrute/core'; import { - Clan, ClanWarStatus, Prisma, PrismaClient, + Clan, ClanWarStatus, Prisma, PrismaClient, BossName } from '@labrute/prisma'; import type { Request, Response } from 'express'; import { DISCORD, LOGGER } from '../context.js'; @@ -165,7 +164,7 @@ const Clans = { name: clanName, master: { connect: { id: brute.id } }, brutes: { connect: { id: brute.id } }, - boss: randomItem(bosses).name, + boss: BossName.Cerberus, }, select: { id: true, name: true }, }); diff --git a/server/src/utils/fight/generateFight.ts b/server/src/utils/fight/generateFight.ts index 93550726a..b7b413ff3 100644 --- a/server/src/utils/fight/generateFight.ts +++ b/server/src/utils/fight/generateFight.ts @@ -1,6 +1,7 @@ /* eslint-disable no-param-reassign */ import { AchievementsStore, + FIRST_BOSS_GOLD_REWARD, BOSS_GOLD_REWARD, Boss, CLAN_SIZE_LIMIT, @@ -12,7 +13,7 @@ import { weightedRandom, } from '@labrute/core'; import { - Brute, FightModifier, InventoryItemType, LogType, Prisma, PrismaClient, + Brute, FightModifier, InventoryItemType, LogType, Prisma, PrismaClient, BossName } from '@labrute/prisma'; import applySpy from './applySpy.js'; import { @@ -359,13 +360,15 @@ const generateFight = async ({ count: 1, })), }); - + + // Filter out Cerberus from potential bosses most of the time + const potentialBosses = bosses.filter((boss) => boss.name != BossName.Cerberus || Math.random() * 4 < 1) // Update clan await prisma.clan.update({ where: { id: clanId }, data: { // Set new boss - boss: randomItem(bosses).name, + boss: randomItem(potentialBosses).name, damageOnBoss: 0, // Increase clan limit limit: Math.min(CLAN_SIZE_LIMIT, clan.limit + 5), @@ -383,7 +386,8 @@ const generateFight = async ({ clan.bossDamages.forEach((damage) => { userIds.add(damage.brute.userId || ''); }); - const goldGains = Math.floor(BOSS_GOLD_REWARD / userIds.size); + const goldReward = bossFighter.name === BossName.Cerberus ? FIRST_BOSS_GOLD_REWARD : BOSS_GOLD_REWARD; + const goldGains = Math.floor(goldReward / userIds.size); await prisma.user.updateMany({ where: { id: { in: Array.from(userIds) } },