expanded scope of 'csr override message for Capitol force dome state; spelling and guard condition changes to dismount blocking cases

This commit is contained in:
Fate-JH 2026-01-19 14:37:21 -05:00
parent 398b98514a
commit c7368d47a4
2 changed files with 13 additions and 13 deletions

View file

@ -123,14 +123,12 @@ object ForceDomeControl {
building: Building, building: Building,
state: Boolean state: Boolean
): Unit = { ): Unit = {
val events = building.Zone.LocalEvents val zone = building.Zone
val message = LocalAction.SendResponse(ChatMsg( val message = LocalAction.SendResponse(ChatMsg(
ChatMessageType.UNK_227, ChatMessageType.UNK_229,
s"Capitol force dome state change was suppressed. ${building.Name} will remain ${if (state) "enveloped" else "exposed"}." s"The Capitol force dome at ${building.Name} will remain ${if (state) "activated" else "deactivated"}."
)) ))
building.PlayersInSOI.foreach { player => zone.LocalEvents ! LocalServiceMessage(zone.id, message)
events ! LocalServiceMessage(player.Name, message)
}
} }
/** /**
@ -473,7 +471,6 @@ class ForceDomeControl(dome: ForceDomePhysics)
private def blockedByCustomStateOr(func: (Building, ForceDomePhysics) => Boolean): Boolean = { private def blockedByCustomStateOr(func: (Building, ForceDomePhysics) => Boolean): Boolean = {
import scala.concurrent.duration._ import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.ExecutionContext.Implicits.global
customState match { customState match {
case None => case None =>
val oldState = dome.Energized val oldState = dome.Energized
@ -484,9 +481,12 @@ class ForceDomeControl(dome: ForceDomePhysics)
context.system.scheduler.scheduleOnce(delay = 4000 milliseconds, self, ForceDomeControl.ApplyProtection) context.system.scheduler.scheduleOnce(delay = 4000 milliseconds, self, ForceDomeControl.ApplyProtection)
} }
newState newState
case Some(state) => case Some(state)
if !ForceDomeControl.CheckForceDomeStatus(domeOwnerAsABuilding, dome).contains(state) =>
ForceDomeControl.CustomDomeStateEnforcedMessage(domeOwnerAsABuilding, state) ForceDomeControl.CustomDomeStateEnforcedMessage(domeOwnerAsABuilding, state)
state state
case Some(state) =>
state
} }
} }
} }

View file

@ -119,7 +119,7 @@ class VehicleControl(vehicle: Vehicle)
sender() ! Mountable.MountMessages(user, Mountable.CanNotMount(vehicle, mountPoint)) sender() ! Mountable.MountMessages(user, Mountable.CanNotMount(vehicle, mountPoint))
} }
private val disountingFailureReasons: Receive = { private val dismountingFailureReasons: Receive = {
case Mountable.TryDismount(user, seat_num, bailType) case Mountable.TryDismount(user, seat_num, bailType)
if vehicle.DeploymentState == DriveState.AutoPilot => if vehicle.DeploymentState == DriveState.AutoPilot =>
sender() ! Mountable.MountMessages(user, Mountable.CanNotDismount(vehicle, seat_num, bailType)) sender() ! Mountable.MountMessages(user, Mountable.CanNotDismount(vehicle, seat_num, bailType))
@ -142,7 +142,7 @@ class VehicleControl(vehicle: Vehicle)
case Mountable.TryDismount(user, seat_num, bailType) case Mountable.TryDismount(user, seat_num, bailType)
if vehicle.Health <= (vehicle.Definition.MaxHealth * .1).round && bailType == BailType.Bailed if vehicle.Health <= (vehicle.Definition.MaxHealth * .1).round && bailType == BailType.Bailed
&& GlobalDefinitions.isFlightVehicle(vehicle.Definition) && GlobalDefinitions.isFlightVehicle(vehicle.Definition)
&& (seat_num == 0 || vehicle.SeatPermissionGroup(seat_num).getOrElse(0) == AccessPermissionGroup.Gunner) && (seat_num == 0 || vehicle.SeatPermissionGroup(seat_num).contains(AccessPermissionGroup.Gunner))
&& (vehicle.History.findLast { entry => entry.isInstanceOf[DamagingActivity] } match { && (vehicle.History.findLast { entry => entry.isInstanceOf[DamagingActivity] } match {
case Some(entry) if System.currentTimeMillis() - entry.time < 4000L => true case Some(entry) if System.currentTimeMillis() - entry.time < 4000L => true
case _ if Random.nextInt(10) == 1 => false case _ if Random.nextInt(10) == 1 => false
@ -152,7 +152,7 @@ class VehicleControl(vehicle: Vehicle)
case Mountable.TryDismount(user, seat_num, bailType) case Mountable.TryDismount(user, seat_num, bailType)
if vehicle.Health <= (vehicle.Definition.MaxHealth * .2).round && bailType == BailType.Bailed if vehicle.Health <= (vehicle.Definition.MaxHealth * .2).round && bailType == BailType.Bailed
&& GlobalDefinitions.isFlightVehicle(vehicle.Definition) && GlobalDefinitions.isFlightVehicle(vehicle.Definition)
&& (seat_num == 0 || vehicle.SeatPermissionGroup(seat_num).getOrElse(0) == AccessPermissionGroup.Gunner) && (seat_num == 0 || vehicle.SeatPermissionGroup(seat_num).contains(AccessPermissionGroup.Gunner))
&& (vehicle.History.findLast { entry => entry.isInstanceOf[DamagingActivity] } match { && (vehicle.History.findLast { entry => entry.isInstanceOf[DamagingActivity] } match {
case Some(entry) if System.currentTimeMillis() - entry.time < 3500L => true case Some(entry) if System.currentTimeMillis() - entry.time < 3500L => true
case _ if Random.nextInt(5) == 1 => false case _ if Random.nextInt(5) == 1 => false
@ -162,7 +162,7 @@ class VehicleControl(vehicle: Vehicle)
case Mountable.TryDismount(user, seat_num, bailType) case Mountable.TryDismount(user, seat_num, bailType)
if vehicle.Health <= (vehicle.Definition.MaxHealth * .35).round && bailType == BailType.Bailed if vehicle.Health <= (vehicle.Definition.MaxHealth * .35).round && bailType == BailType.Bailed
&& GlobalDefinitions.isFlightVehicle(vehicle.Definition) && GlobalDefinitions.isFlightVehicle(vehicle.Definition)
&& (seat_num == 0 || vehicle.SeatPermissionGroup(seat_num).getOrElse(0) == AccessPermissionGroup.Gunner) && (seat_num == 0 || vehicle.SeatPermissionGroup(seat_num).contains(AccessPermissionGroup.Gunner))
&& (vehicle.History.findLast { entry => entry.isInstanceOf[DamagingActivity] } match { && (vehicle.History.findLast { entry => entry.isInstanceOf[DamagingActivity] } match {
case Some(entry) if System.currentTimeMillis() - entry.time < 3000L => true case Some(entry) if System.currentTimeMillis() - entry.time < 3000L => true
case _ if Random.nextInt(4) == 1 => false case _ if Random.nextInt(4) == 1 => false
@ -177,7 +177,7 @@ class VehicleControl(vehicle: Vehicle)
def commonEnabledBehavior: Receive = checkBehavior def commonEnabledBehavior: Receive = checkBehavior
.orElse(mountingFailureReasons) .orElse(mountingFailureReasons)
.orElse(mountBehavior) .orElse(mountBehavior)
.orElse(disountingFailureReasons) .orElse(dismountingFailureReasons)
.orElse(dismountBehavior) .orElse(dismountBehavior)
.orElse(attributeBehavior) .orElse(attributeBehavior)
.orElse(jammableBehavior) .orElse(jammableBehavior)