mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-14 07:55:07 +00:00
ensure different factions and reward changes
This commit is contained in:
parent
5a5ed7425c
commit
0ce5e1ab0c
1 changed files with 24 additions and 11 deletions
|
|
@ -121,12 +121,25 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
||||||
} else {
|
} else {
|
||||||
(defenderFaction, attackingFaction, socketOpt.nonEmpty, None)
|
(defenderFaction, attackingFaction, socketOpt.nonEmpty, None)
|
||||||
}
|
}
|
||||||
val (contributionVictor, contributionOpposing, _) = {
|
val (contributionVictor, contributionOpposing) = {
|
||||||
val (a, b1) = playerContribution.partition { case (_, (p, _, _)) => p.Faction == victorFaction }
|
val (a, b) = playerContribution.partition { case (_, (p, _, _)) => p.Faction == victorFaction }
|
||||||
val (b, c) = b1.partition { case (_, (p, _, _)) => p.Faction == opposingFaction }
|
//val (b, c) = b1.partition { case (_, (p, _, _)) => p.Faction == opposingFaction }
|
||||||
(a.values, b.values, c.values)
|
(a.values, b.values)
|
||||||
}
|
}
|
||||||
val contributionVictorSize = contributionVictor.size
|
val contributionVictorSize = contributionVictor.size
|
||||||
|
|
||||||
|
//sometimes attackingFaction and defenderFaction are the same *shrug*
|
||||||
|
val failSafeOpposingFaction =
|
||||||
|
contributionOpposing
|
||||||
|
.map { case (p, _, _) => p.Faction }
|
||||||
|
.groupBy(identity)
|
||||||
|
.view.mapValues(_.size)
|
||||||
|
.toSeq
|
||||||
|
.sortBy(-_._2)
|
||||||
|
.headOption
|
||||||
|
.map(_._1)
|
||||||
|
.getOrElse(PlanetSideEmpire.NEUTRAL)
|
||||||
|
|
||||||
if (contributionVictorSize > 0) {
|
if (contributionVictorSize > 0) {
|
||||||
//setup for ...
|
//setup for ...
|
||||||
val populationIndices = playerPopulationOverTime.indices
|
val populationIndices = playerPopulationOverTime.indices
|
||||||
|
|
@ -137,7 +150,7 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
||||||
val individualPopulationByLayer = allFactions.map { f =>
|
val individualPopulationByLayer = allFactions.map { f =>
|
||||||
(f, populationIndices.indices.map { i => playerPopulationOverTime(i)(f) })
|
(f, populationIndices.indices.map { i => playerPopulationOverTime(i)(f) })
|
||||||
}.toMap[PlanetSideEmpire.Value, Seq[Int]]
|
}.toMap[PlanetSideEmpire.Value, Seq[Int]]
|
||||||
(individualPopulationByLayer(victorFaction), individualPopulationByLayer(opposingFaction))
|
(individualPopulationByLayer(victorFaction), individualPopulationByLayer(failSafeOpposingFaction))
|
||||||
}
|
}
|
||||||
val contributionOpposingSize = contributionOpposing.size
|
val contributionOpposingSize = contributionOpposing.size
|
||||||
val killsByPlayersNotInTower = eliminateClosestTowerFromParticipating(
|
val killsByPlayersNotInTower = eliminateClosestTowerFromParticipating(
|
||||||
|
|
@ -147,7 +160,7 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
||||||
building.Definition.SOIRadius.toFloat,
|
building.Definition.SOIRadius.toFloat,
|
||||||
hackStart,
|
hackStart,
|
||||||
completionTime,
|
completionTime,
|
||||||
opposingFaction,
|
failSafeOpposingFaction,
|
||||||
contributionVictor
|
contributionVictor
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -215,7 +228,7 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
||||||
}
|
}
|
||||||
val heatMapModifier = FacilityHackParticipation.heatMapComparison(
|
val heatMapModifier = FacilityHackParticipation.heatMapComparison(
|
||||||
FacilityHackParticipation.diffHeatForFactionMap(regionHeatMapProgression, victorFaction).values,
|
FacilityHackParticipation.diffHeatForFactionMap(regionHeatMapProgression, victorFaction).values,
|
||||||
FacilityHackParticipation.diffHeatForFactionMap(regionHeatMapProgression, opposingFaction).values
|
FacilityHackParticipation.diffHeatForFactionMap(regionHeatMapProgression, failSafeOpposingFaction).values
|
||||||
)
|
)
|
||||||
heatMapModifier * populationBalanceModifier
|
heatMapModifier * populationBalanceModifier
|
||||||
}
|
}
|
||||||
|
|
@ -275,13 +288,13 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
||||||
Config.app.game.experience.cep.rate + competitionBonus
|
Config.app.game.experience.cep.rate + competitionBonus
|
||||||
).toLong
|
).toLong
|
||||||
//8. reward participants that are still in the zone
|
//8. reward participants that are still in the zone
|
||||||
val hackerId = hacker.CharId
|
//val hackerId = hacker.CharId
|
||||||
val contributingPlayers = contributionVictor
|
val contributingPlayers = contributionVictor
|
||||||
.filter { case (player, _, _) => player.Zone.id == building.Zone.id }
|
.filter { case (player, _, _) => player.Zone.id == building.Zone.id }
|
||||||
.map { case (player, _, _) => player }
|
.map { case (player, _, _) => player }
|
||||||
.toList
|
.toList
|
||||||
//terminal hacker (always cep)
|
//terminal hacker (always cep)
|
||||||
if (contributingPlayers.exists(_.CharId == hackerId) && flagCarrier.map(_.CharId).getOrElse(0L) != hackerId) {
|
/*if (contributingPlayers.exists(_.CharId == hackerId) && flagCarrier.map(_.CharId).getOrElse(0L) != hackerId) {
|
||||||
ToDatabase.reportFacilityCapture(
|
ToDatabase.reportFacilityCapture(
|
||||||
hackerId,
|
hackerId,
|
||||||
zoneNumber,
|
zoneNumber,
|
||||||
|
|
@ -290,10 +303,10 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
||||||
expType = "cep"
|
expType = "cep"
|
||||||
)
|
)
|
||||||
events ! AvatarServiceMessage(hacker.Name, AvatarAction.AwardCep(hackerId, finalCep))
|
events ! AvatarServiceMessage(hacker.Name, AvatarAction.AwardCep(hackerId, finalCep))
|
||||||
}
|
}*/
|
||||||
//bystanders (cep if squad leader, bep otherwise)
|
//bystanders (cep if squad leader, bep otherwise)
|
||||||
contributingPlayers
|
contributingPlayers
|
||||||
.filterNot { _.CharId == hackerId }
|
//.filterNot { _.CharId == hackerId }
|
||||||
.foreach { player =>
|
.foreach { player =>
|
||||||
val charId = player.CharId
|
val charId = player.CharId
|
||||||
val contributionMultiplier = contributionPerPlayerByTime.getOrElse(charId, 1f)
|
val contributionMultiplier = contributionPerPlayerByTime.getOrElse(charId, 1f)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue