internal static bool ApplyHorseCrippleLogic(Agent victim, BoneBodyPartType victimHitBodyPart)
            {
                bool makesRear = false;

                if (Config.ConfigSettings.HorseProjectileCrippleEnabled)
                {
                    if (victim != null && victim.IsMount)
                    {
                        if (victim.RiderAgent != null && !victim.RiderAgent.IsMainAgent)
                        {
                            if (victimHitBodyPart == BoneBodyPartType.Head || victimHitBodyPart == BoneBodyPartType.Neck)
                            {
                                makesRear = Config.ConfigSettings.HorseHeadshotRearingEnabled;
                            }
                            else
                            {
                                if (victim.IsActive() && victim.RiderAgent)
                                {
                                    victim.RiderAgent.AgentDrivenProperties.MountSpeed = 0f;
                                    HorseCrippleLogic.CrippleHorseNew(victim, MissionTime.SecondsFromNow((float)Config.ConfigSettings.HorseProjectileCrippleDuration));
                                    victim.UpdateAgentStats();
                                }
                            }
                        }
                    }
                }

                return(makesRear);
            }
 internal static void CreateHyperArmorBuff(Agent defenderAgent)
 {
     if (defenderAgent != null && defenderAgent.IsActive())
     {
         hyperArmorCollection[defenderAgent] = MissionTime.MillisecondsFromNow((float)Config.ConfigSettings.HyperArmorDuration * 1000);
     }
 }
 internal static void CrippleHorseNew(Agent victim, MissionTime missionTime)
 {
     if (victim != null && victim.IsActive())
     {
         horseCrippleQueue.Enqueue(Tuple.Create(victim, missionTime));
         crippledHorseCollection[victim] = missionTime;
     }
 }
Example #4
0
        public bool Check(bool reset = false)
        {
            int num = (double)this.GetRemainingTimeInSeconds() <= 0.0 ? 1 : 0;

            if ((num & (reset ? 1 : 0)) == 0)
            {
                return(num != 0);
            }
            this._startTime = MissionTime.Now;
            return(num != 0);
        }
 internal static void ResetVoiceCommandTimer(float delay = 2000f)
 {
     VoiceCommandTimer = MissionTime.MillisecondsFromNow(delay);
 }
Example #6
0
 public MissionTimer(float duration)
 {
     this._startTime = MissionTime.Now;
     this._duration  = duration;
 }
 private void InitBattleTest()
 {
     _nextCheckTime = MissionTime.SecondsFromNow(Config.Instance.Start_delay);
 }
Example #8
0
 internal MissionTimeTracker(MissionTime intialMapTime) => this.NumberOfTicks = intialMapTime.NumberOfTicks;
Example #9
0
        public void OnDuelRequested(Agent requesterAgent)
        {
            this._requesters.Add(new Tuple <Agent, MissionTime>(requesterAgent, MissionTime.Now + MissionTime.Seconds(3f)));
            switch (this.PlayerType)
            {
            case MissionRepresentativeBase.PlayerTypes.Bot:
                this._missionMultiplayerDuel.DuelRequestAccepted(requesterAgent, this.ControlledAgent);
                break;

            case MissionRepresentativeBase.PlayerTypes.Client:
                if (this.IsMine)
                {
                    Action duelRequestedEvent = this.OnDuelRequestedEvent;
                    if (duelRequestedEvent == null)
                    {
                        break;
                    }
                    duelRequestedEvent();
                    break;
                }
                GameNetwork.BeginModuleEventAsServer(this.Peer);
                GameNetwork.WriteMessage((GameNetworkMessage) new NetworkMessages.FromServer.DuelRequest(requesterAgent, this.ControlledAgent));
                GameNetwork.EndModuleEventAsServer();
                break;

            case MissionRepresentativeBase.PlayerTypes.Server:
                Action duelRequestedEvent1 = this.OnDuelRequestedEvent;
                if (duelRequestedEvent1 == null)
                {
                    break;
                }
                duelRequestedEvent1();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }