Ejemplo n.º 1
0
 private void Client_TurnBegin_CheckKaijuStatus()
 {
     if (this.Kaiju != null)
     {
         if (this.Kaiju.IsStunned())
         {
             if (this.Kaiju.NextTurnToRecoverFromStun > 0 && (this.gameService.Game as global::Game).Turn == this.Kaiju.NextTurnToRecoverFromStun)
             {
                 this.Kaiju.ChangeToWildState();
             }
         }
         else if (this.Kaiju.IsWild() && this.Kaiju.OnArmyMode())
         {
             global::PlayerController server = this.KaijuEmpire.PlayerControllers.Server;
             if (server != null)
             {
                 Region validKaijuRegion = KaijuCouncil.GetValidKaijuRegion();
                 if (validKaijuRegion == null)
                 {
                     Diagnostics.LogWarning("Unable to find suitable region");
                     return;
                 }
                 WorldPosition validKaijuPosition = KaijuCouncil.GetValidKaijuPosition(validKaijuRegion, false);
                 if (validKaijuPosition == WorldPosition.Zero)
                 {
                     Diagnostics.LogWarning("Unable to find suitable position in target region");
                     return;
                 }
                 OrderRelocateKaiju order = new OrderRelocateKaiju(this.Kaiju.GUID, validKaijuPosition);
                 server.PostOrder(order);
             }
         }
     }
 }
Ejemplo n.º 2
0
    public void TryRelocateKaijuOrResetETA()
    {
        global::PlayerController server = this.KaijuEmpire.PlayerControllers.Server;
        Region validKaijuRegion         = KaijuCouncil.GetValidKaijuRegion();

        if (validKaijuRegion == null)
        {
            if (this.Kaiju != null)
            {
                this.ResetRelocationETA();
            }
            Diagnostics.LogWarning("Unable to find suitable region. Reset Kaiju ETA!");
            return;
        }
        WorldPosition validKaijuPosition = KaijuCouncil.GetValidKaijuPosition(validKaijuRegion, false);

        if (validKaijuPosition == WorldPosition.Zero)
        {
            if (this.Kaiju != null)
            {
                this.ResetRelocationETA();
            }
            Diagnostics.LogWarning("Unable to find suitable position in target region. Reset Kaiju ETA.");
            return;
        }
        if (server != null && this.Kaiju != null && this.Kaiju.OnGarrisonMode() && this.Kaiju.IsWild())
        {
            IPlayerControllerRepositoryService service = this.gameService.Game.Services.GetService <IPlayerControllerRepositoryService>();
            OrderRelocateKaiju order = new OrderRelocateKaiju(this.Kaiju.GUID, validKaijuPosition);
            server.PostOrder(order);
        }
    }