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 = {
# 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
# When command experience points are rewarded to the lattice link unit carrier,
# modify the original value by this modifier.

View file

@ -1132,8 +1132,8 @@ class ChatActor(
true
} else if (contents.startsWith("!list")) {
val zone = dropFirstWord(contents).split(" ").headOption match {
case None =>
val zone = dropFirstWord(contents).split("\\s+").headOption match {
case Some("") | None =>
Some(session.zone)
case Some(id) =>
Zones.zones.find(_.id == id)
@ -1178,7 +1178,7 @@ class ChatActor(
true
} 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 {
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))
@ -1210,7 +1210,7 @@ class ChatActor(
true
} 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 {
case Some("-list") | Some("-l") =>
CavernRotationService.ReportRotationOrder(sessionActor.toClassic)

View file

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

View file

@ -32,23 +32,17 @@ class HackCaptureActor extends Actor {
private var hackedObjects: List[HackCaptureActor.HackEntry] = Nil
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) =>
log.trace(s"StartCaptureTerminalHack: ${target.GUID} is hacked.")
log.trace(s"StartCaptureTerminalHack: ${target.GUID} is hacked")
val duration = target.Definition.FacilityHackTime
target.HackedBy match {
case Some(hackInfo) =>
target.HackedBy = hackInfo.Duration(duration.toMillis)
case None =>
log.error(s"Initial $target hack information is missing")
target.HackedBy.map {
hackInfo => target.HackedBy = hackInfo.Duration(duration.toMillis)
}
hackedObjects.find(_.target == target).foreach { _ =>
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
hackedObjects = hackedObjects.filterNot(_.target == target) :+ HackCaptureActor.HackEntry(target, zone, unk1, unk2, duration, startTime)
RestartTimer()
NotifyHackStateChange(target, isResecured = false)
TrySpawnCaptureFlag(target)