break up initial hack statement; fix the !list command; fixed resource silo math (failed simplification of dividing over division)

This commit is contained in:
Fate-JH 2023-11-25 09:57:41 -05:00
parent 42d1422fc7
commit 30627ae59f
4 changed files with 15 additions and 21 deletions

View file

@ -352,9 +352,9 @@ game {
] ]
} }
# Support experience points # Command experience points
cep = { cep = {
# After all calculations are complete, multiple the result by this value # After all calculations are complete, multiply the result by this value
rate = 1.0 rate = 1.0
# When command experience points are rewarded to the lattice link unit carrier, # When command experience points are rewarded to the lattice link unit carrier,
# modify the original value by this modifier. # modify the original value by this modifier.

View file

@ -1132,8 +1132,8 @@ class ChatActor(
true true
} else if (contents.startsWith("!list")) { } else if (contents.startsWith("!list")) {
val zone = dropFirstWord(contents).split(" ").headOption match { val zone = dropFirstWord(contents).split("\\s+").headOption match {
case None => case Some("") | None =>
Some(session.zone) Some(session.zone)
case Some(id) => case Some(id) =>
Zones.zones.find(_.id == id) Zones.zones.find(_.id == id)
@ -1178,7 +1178,7 @@ class ChatActor(
true true
} else if (contents.startsWith("!ntu") && gmCommandAllowed) { } else if (contents.startsWith("!ntu") && gmCommandAllowed) {
val buffer = dropFirstWord(contents).toLowerCase.split("\\s+") val buffer = dropFirstWord(contents).split("\\s+")
val (facility, customNtuValue) = (buffer.headOption, buffer.lift(1)) match { val (facility, customNtuValue) = (buffer.headOption, buffer.lift(1)) match {
case (Some(x), Some(y)) if y.toIntOption.nonEmpty => (Some(x), Some(y.toInt)) case (Some(x), Some(y)) if y.toIntOption.nonEmpty => (Some(x), Some(y.toInt))
case (Some(x), None) if x.toIntOption.nonEmpty => (None, Some(x.toInt)) case (Some(x), None) if x.toIntOption.nonEmpty => (None, Some(x.toInt))
@ -1210,7 +1210,7 @@ class ChatActor(
true true
} else if (contents.startsWith("!zonerotate") && gmCommandAllowed) { } else if (contents.startsWith("!zonerotate") && gmCommandAllowed) {
val buffer = dropFirstWord(contents).toLowerCase.split("\\s+") val buffer = dropFirstWord(contents).split("\\s+")
cluster ! InterstellarClusterService.CavernRotation(buffer.headOption match { cluster ! InterstellarClusterService.CavernRotation(buffer.headOption match {
case Some("-list") | Some("-l") => case Some("-list") | Some("-l") =>
CavernRotationService.ReportRotationOrder(sessionActor.toClassic) CavernRotationService.ReportRotationOrder(sessionActor.toClassic)

View file

@ -192,7 +192,7 @@ class ResourceSiloControl(resourceSilo: ResourceSilo)
//experience is reported as normal //experience is reported as normal
val deposit: Long = val deposit: Long =
(Config.app.game.experience.sep.ntuSiloDepositReward.toFloat * (Config.app.game.experience.sep.ntuSiloDepositReward.toFloat *
amount / (resourceSilo.MaxNtuCapacitor * resourceSilo.Definition.ChargeTime.toSeconds.toFloat) amount * resourceSilo.Definition.ChargeTime.toSeconds.toFloat / resourceSilo.MaxNtuCapacitor
).toLong ).toLong
vehicle.Zone.AvatarEvents ! AvatarServiceMessage( vehicle.Zone.AvatarEvents ! AvatarServiceMessage(
owner.name, owner.name,

View file

@ -32,23 +32,17 @@ class HackCaptureActor extends Actor {
private var hackedObjects: List[HackCaptureActor.HackEntry] = Nil private var hackedObjects: List[HackCaptureActor.HackEntry] = Nil
def receive: Receive = { def receive: Receive = {
case HackCaptureActor.StartCaptureTerminalHack(target, _, _, _, _)
if target.HackedBy.isEmpty =>
log.error(s"StartCaptureTerminalHack: initial $target hack information is missing; can not proceed")
case HackCaptureActor.StartCaptureTerminalHack(target, zone, unk1, unk2, startTime) => case HackCaptureActor.StartCaptureTerminalHack(target, zone, unk1, unk2, startTime) =>
log.trace(s"StartCaptureTerminalHack: ${target.GUID} is hacked.") log.trace(s"StartCaptureTerminalHack: ${target.GUID} is hacked")
val duration = target.Definition.FacilityHackTime val duration = target.Definition.FacilityHackTime
target.HackedBy match { target.HackedBy.map {
case Some(hackInfo) => hackInfo => target.HackedBy = hackInfo.Duration(duration.toMillis)
target.HackedBy = hackInfo.Duration(duration.toMillis)
case None =>
log.error(s"Initial $target hack information is missing")
} }
hackedObjects.find(_.target == target).foreach { _ => hackedObjects = hackedObjects.filterNot(_.target == target) :+ HackCaptureActor.HackEntry(target, zone, unk1, unk2, duration, startTime)
log.trace(
s"StartCaptureTerminalHack: ${target.GUID} was already hacked - removing it from the hacked objects list before re-adding it."
)
hackedObjects = hackedObjects.filterNot(x => x.target == target)
}
hackedObjects = hackedObjects :+ HackCaptureActor.HackEntry(target, zone, unk1, unk2, duration, startTime)
// Restart the timer, in case this is the first object in the hacked objects list or the object was removed and re-added
RestartTimer() RestartTimer()
NotifyHackStateChange(target, isResecured = false) NotifyHackStateChange(target, isResecured = false)
TrySpawnCaptureFlag(target) TrySpawnCaptureFlag(target)