mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-19 18:44:45 +00:00
Scoring (#1202)
* cep from towers set to 10; reorganized an if...else * replacing maxBy with maxByOption and then resolving maxBy the long way with appropriate fallback value
This commit is contained in:
parent
2dd44142d2
commit
cacb9ad18a
|
|
@ -132,12 +132,12 @@ final case class TowerHackParticipation(building: Building) extends FacilityHack
|
||||||
overwhelmingOddsBonus = 30L
|
overwhelmingOddsBonus = 30L
|
||||||
)
|
)
|
||||||
//6. calculate overall command experience points
|
//6. calculate overall command experience points
|
||||||
val finalCep: Long = math.ceil(
|
val finalCep: Long = 10L /*math.ceil(
|
||||||
baseExperienceFromFacilityCapture *
|
baseExperienceFromFacilityCapture *
|
||||||
populationModifier *
|
populationModifier *
|
||||||
competitionMultiplier *
|
competitionMultiplier *
|
||||||
Config.app.game.experience.cep.rate + competitionBonus
|
Config.app.game.experience.cep.rate + competitionBonus
|
||||||
).toLong
|
).toLong*/
|
||||||
//7. reward participants
|
//7. reward participants
|
||||||
//Classically, only players in the SOI are rewarded
|
//Classically, only players in the SOI are rewarded
|
||||||
//terminal hacker (always cep)
|
//terminal hacker (always cep)
|
||||||
|
|
|
||||||
|
|
@ -190,10 +190,12 @@ object KillAssists {
|
||||||
val victimUnique = victim.unique
|
val victimUnique = victim.unique
|
||||||
val lastDeath = killer.progress.prior.flatMap(_.death)
|
val lastDeath = killer.progress.prior.flatMap(_.death)
|
||||||
val sameLastKiller = lastDeath.map(_.assailant.map(_.unique)).flatMap(_.headOption).contains(victimUnique)
|
val sameLastKiller = lastDeath.map(_.assailant.map(_.unique)).flatMap(_.headOption).contains(victimUnique)
|
||||||
if (revenge.defaultExperience != 0 && sameLastKiller) {
|
if (sameLastKiller) {
|
||||||
revenge.defaultExperience
|
if (revenge.defaultExperience != 0) {
|
||||||
} else if (sameLastKiller) {
|
revenge.defaultExperience
|
||||||
math.min(revenge.maxExperience, (lastDeath.map(_.experienceEarned.toFloat).getOrElse(0f) * revenge.rate).toLong)
|
} else {
|
||||||
|
math.min(revenge.maxExperience, (lastDeath.map(_.experienceEarned.toFloat).getOrElse(0f) * revenge.rate).toLong)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
0L
|
0L
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ object Support {
|
||||||
individualThreatEstimates.filter(_._1 < 10)
|
individualThreatEstimates.filter(_._1 < 10)
|
||||||
} else {
|
} else {
|
||||||
individualThreatEstimates.filter(_._1 > 10)
|
individualThreatEstimates.filter(_._1 > 10)
|
||||||
}).maxBy(_._2)._1,
|
}).maxByOption(_._2).map(_._1).getOrElse(0),
|
||||||
defaultValue
|
defaultValue
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue