mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-14 16:04:41 +00:00
grant exp for captures
This commit is contained in:
parent
2b7648c1f0
commit
d9c913e3ff
4 changed files with 16 additions and 8 deletions
|
|
@ -59,7 +59,7 @@ class SessionAvatarHandlers(
|
||||||
//TODO squad services deactivated, participation trophy rewards for now - 11-20-2023
|
//TODO squad services deactivated, participation trophy rewards for now - 11-20-2023
|
||||||
//must be in a squad to earn experience
|
//must be in a squad to earn experience
|
||||||
val charId = player.CharId
|
val charId = player.CharId
|
||||||
val squadUI = sessionLogic.squad.squadUI
|
/*val squadUI = sessionLogic.squad.squadUI
|
||||||
val participation = continent
|
val participation = continent
|
||||||
.Building(buildingId)
|
.Building(buildingId)
|
||||||
.map { building =>
|
.map { building =>
|
||||||
|
|
@ -117,7 +117,10 @@ class SessionAvatarHandlers(
|
||||||
exp.ToDatabase.reportFacilityCapture(charId, buildingId, zoneNumber, modifiedExp, expType="bep")
|
exp.ToDatabase.reportFacilityCapture(charId, buildingId, zoneNumber, modifiedExp, expType="bep")
|
||||||
avatarActor ! AvatarActor.AwardFacilityCaptureBep(modifiedExp)
|
avatarActor ! AvatarActor.AwardFacilityCaptureBep(modifiedExp)
|
||||||
Some(modifiedExp)
|
Some(modifiedExp)
|
||||||
}
|
}*/
|
||||||
|
//if not in squad (temporary)
|
||||||
|
exp.ToDatabase.reportFacilityCapture(charId, buildingId, zoneNumber, cep, expType="bep")
|
||||||
|
avatarActor ! AvatarActor.AwardFacilityCaptureBep(cep)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -41,13 +41,13 @@ trait FacilityHackParticipation extends ParticipationLogic {
|
||||||
.filterNot { case (_, (_, _, t)) => curr - t > hackTime }
|
.filterNot { case (_, (_, _, t)) => curr - t > hackTime }
|
||||||
.partition { case (p, _) => uniqueList2.contains(p) }
|
.partition { case (p, _) => uniqueList2.contains(p) }
|
||||||
}
|
}
|
||||||
val newParticipaants = list
|
val newParticipants = list
|
||||||
.filterNot { p =>
|
.filterNot { p =>
|
||||||
playerContribution.exists { case (u, _) => p.CharId == u }
|
playerContribution.exists { case (u, _) => p.CharId == u }
|
||||||
}
|
}
|
||||||
playerContribution =
|
playerContribution =
|
||||||
vanguardParticipants.map { case (u, (p, d, _)) => (u, (p, d + 1, curr)) } ++
|
vanguardParticipants.map { case (u, (p, d, _)) => (u, (p, d + 1, curr)) } ++
|
||||||
newParticipaants.map { p => (p.CharId, (p, 1, curr)) } ++
|
newParticipants.map { p => (p.CharId, (p, 1, curr)) } ++
|
||||||
missingParticipants
|
missingParticipants
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,9 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
||||||
|
|
||||||
def TryUpdate(): Unit = {
|
def TryUpdate(): Unit = {
|
||||||
val list = building.PlayersInSOI
|
val list = building.PlayersInSOI
|
||||||
updatePlayers(list)
|
if (list.nonEmpty) {
|
||||||
|
updatePlayers(list)
|
||||||
|
}
|
||||||
val now = System.currentTimeMillis()
|
val now = System.currentTimeMillis()
|
||||||
if (now - lastInfoRequest > 60000L) {
|
if (now - lastInfoRequest > 60000L) {
|
||||||
updatePopulationOverTime(list, now, before = 900000L)
|
updatePopulationOverTime(list, now, before = 900000L)
|
||||||
|
|
@ -123,7 +125,7 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
||||||
hackStart,
|
hackStart,
|
||||||
completionTime,
|
completionTime,
|
||||||
opposingFaction,
|
opposingFaction,
|
||||||
contributionOpposing
|
contributionVictor
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
//1) experience from killing opposingFaction across duration of hack
|
//1) experience from killing opposingFaction across duration of hack
|
||||||
|
|
@ -336,7 +338,7 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
||||||
val towerRadius = math.pow(tower.Definition.SOIRadius.toDouble * 0.7d, 2d).toFloat
|
val towerRadius = math.pow(tower.Definition.SOIRadius.toDouble * 0.7d, 2d).toFloat
|
||||||
list
|
list
|
||||||
.map { case (p, f, kills) =>
|
.map { case (p, f, kills) =>
|
||||||
val filteredKills = kills.filter { kill => Vector3.DistanceSquared(kill.victim.Position.xy, towerPosition) <= towerRadius }
|
val filteredKills = kills.filter { kill => Vector3.DistanceSquared(kill.victim.Position.xy, towerPosition) >= towerRadius }
|
||||||
(p, f, filteredKills)
|
(p, f, filteredKills)
|
||||||
}
|
}
|
||||||
.filter { case (_, _, kills) => kills.nonEmpty }
|
.filter { case (_, _, kills) => kills.nonEmpty }
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,14 @@ import net.psforever.util.Config
|
||||||
final case class TowerHackParticipation(building: Building) extends FacilityHackParticipation {
|
final case class TowerHackParticipation(building: Building) extends FacilityHackParticipation {
|
||||||
def TryUpdate(): Unit = {
|
def TryUpdate(): Unit = {
|
||||||
val list = building.PlayersInSOI
|
val list = building.PlayersInSOI
|
||||||
updatePlayers(building.PlayersInSOI)
|
if (list.nonEmpty) {
|
||||||
|
updatePlayers(list)
|
||||||
|
}
|
||||||
val now = System.currentTimeMillis()
|
val now = System.currentTimeMillis()
|
||||||
if (now - lastInfoRequest > 60000L) {
|
if (now - lastInfoRequest > 60000L) {
|
||||||
updatePopulationOverTime(list, now, before = 300000L)
|
updatePopulationOverTime(list, now, before = 300000L)
|
||||||
}
|
}
|
||||||
|
lastInfoRequest = now
|
||||||
}
|
}
|
||||||
|
|
||||||
def RewardFacilityCapture(
|
def RewardFacilityCapture(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue