diff --git a/src/004-base/basePitFight.js b/src/004-base/basePitFight.js index 38962ec438c605f66a5fee1beaaecbaef559cc12..19a44d5ba2a8aa3be812900e7e7c0ca99a65561e 100644 --- a/src/004-base/basePitFight.js +++ b/src/004-base/basePitFight.js @@ -190,5 +190,17 @@ App.Facilities.Pit.Fights.FighterMap = class { const oldCount = this.fightCount(slaveId); this.map.set(slaveId, oldCount + 1); } + + fighterCount() { + return this.map.size; + } + + fightsCount() { + let count = 0; + this.map.forEach((v, k) => { + count += k; + }); + return count; + } }; diff --git a/src/events/scheduled/pitFight.js b/src/events/scheduled/pitFight.js index 08d895aca5e87c1b82fc9b88159dcc76bd7df04d..56e29514dce1d7e9fb274f63acfb864a3a7ff995 100644 --- a/src/events/scheduled/pitFight.js +++ b/src/events/scheduled/pitFight.js @@ -288,6 +288,21 @@ App.Events.SEPitFight = class SEPitFight extends App.Events.BaseEvent { } } + const fighterRatio = fighterMap.fighterCount() / fighterMap.fightsCount(); + if (fighterRatio > 0.95) { + r.push("The audience is <span class='green'>happy</span> seeing a lot of different fighters."); + totalSuccess *= 1.1; + } else if (fighterRatio > 0.8) { + // no reaction + } else { + if (fighterRatio > 0.5) { + r.push("The audience is <span class='red'>unhappy</span> seeing a lot the same fighters."); + } else { + r.push("Almost every fight had repeat fighters, <span class='red'>boring</span> the audience."); + } + totalSuccess *= 0.5 + 0.5 * (fighterRatio + 0.1); + } + totalSuccess *= 0.5 + 0.5 * V.pit.seats; if (V.pit.seats === 0) { r.push("The small visitors section <span class='red'>limited</span> the impact today's fights had.");