示例#1
0
        // Token: 0x0600866D RID: 34413 RVA: 0x0022E4D0 File Offset: 0x0022C6D0
        public override bool Invoke(CombatGameState combatGameState)
        {
            InvocationMessage.logger.Log("Invoking a MOVE!");
            AbstractActor abstractActor = combatGameState.FindActorByGUID(this.ActorGUID);

            if (abstractActor == null)
            {
                InvocationMessage.logger.LogError(string.Format("MechMovement.Invoke Actor with GUID {0} not found!", this.ActorGUID));
                return(false);
            }
            ICombatant combatant = null;

            if (!string.IsNullOrEmpty(this.MeleeTargetGUID))
            {
                combatant = combatGameState.FindCombatantByGUID(this.MeleeTargetGUID, false);
                if (combatant == null)
                {
                    InvocationMessage.logger.LogError(string.Format("MechMovement.Invoke ICombatant with GUID {0} not found!", this.MeleeTargetGUID));
                    return(false);
                }
            }
            if (!combatGameState.TurnDirector.IsInterleaved && this.MoveType != MoveType.Sprinting)
            {
                abstractActor.AutoBrace = true;
            }
            ActorMovementSequence stackSequence = new ActorMovementSequence(abstractActor, this.Waypoints, this.FinalOrientation, this.MoveType, combatant, this.AbilityConsumesFiring);

            base.PublishStackSequence(combatGameState.MessageCenter, stackSequence, this);
            return(true);
        }
示例#2
0
        public static void OnActorTargeted(MessageCenterMessage message)
        {
            Mod.Log.Trace?.Write("CHUD:STM:OAT - entered.");

            ActorTargetedMessage actorTargetedMessage = message as ActorTargetedMessage;

            if (message == null || actorTargetedMessage == null || actorTargetedMessage.affectedObjectGuid == null)
            {
                return;                                                                                                     // Nothing to do, bail
            }
            ICombatant combatant = Combat.FindActorByGUID(actorTargetedMessage.affectedObjectGuid);

            if (combatant == null)
            {
                combatant = Combat.FindCombatantByGUID(actorTargetedMessage.affectedObjectGuid);
            }

            try {
                if (Combat.LocalPlayerTeam.VisibilityToTarget(combatant) >= VisibilityLevel.Blip0Minimum)
                {
                    Mod.Log.Trace?.Write("CombatHUD:SubscribeToMessages:OnActorTargeted - Visibility >= Blip0, showing target.");
                    if (ShowTargetMethod != null)
                    {
                        ShowTargetMethod.GetValue(combatant);
                    }
                    else
                    {
                        Mod.Log.Info?.Write("WARNING: CHUD:STM caled with a null traverse!");
                    }
                }
                else
                {
                    Mod.Log.Trace?.Write("CombatHUD:SubscribeToMessages:OnActorTargeted - Visibility < Blip0, hiding target.");
                }
            } catch (Exception e) {
                Mod.Log.Error?.Write($"Failed to display HUD target: {CombatantUtils.Label(combatant)}!");
                Mod.Log.Error?.Write(e);
            }
        }