public override float GetMountDamage(
     WeaponComponentData attackerWeapon,
     DamageTypes damageType,
     bool isAlternativeAttack)
 {
     return(!this.IsSatisfied(attackerWeapon, damageType) ? 0.0f : this._value);
 }
        private float GetMountDamage(
            Agent agent,
            WeaponComponentData attackerWeapon,
            DamageTypes damageType,
            bool isAlternativeAttack)
        {
            agent = agent ?? this._peer?.ControlledAgent;
            float num = 0.0f;

            foreach (MPPerkEffectBase effect in this._effects)
            {
                num += effect.GetMountDamage(attackerWeapon, damageType, isAlternativeAttack);
            }
            foreach (MPConditionalEffect conditionalEffect in (List <MPConditionalEffect>) this._conditionalEffects)
            {
                if (conditionalEffect.Check(agent))
                {
                    foreach (MPPerkEffectBase effect in (IEnumerable <MPPerkEffectBase>)conditionalEffect.Effects)
                    {
                        num += effect.GetMountDamage(attackerWeapon, damageType, isAlternativeAttack);
                    }
                }
            }
            return(num);
        }
        public static void Prefix(ref short value, WeaponComponentData __instance)
        {
            switch (__instance.WeaponClass)
            {
            case WeaponClass.Arrow:
            case WeaponClass.Bolt:
            case WeaponClass.Cartridge:
            case WeaponClass.Stone:
            case WeaponClass.Boulder:
            case WeaponClass.SmallShield:
            case WeaponClass.LargeShield:
                return;

            case WeaponClass.ThrowingAxe:
                value = (short)Math.Round((double)(((float)value + (float)CustomStackAmount.axeFlat) * CustomStackAmount.axeFactor), MidpointRounding.AwayFromZero);
                return;

            case WeaponClass.ThrowingKnife:
                value = (short)Math.Round((double)(((float)value + (float)CustomStackAmount.daggerFlat) * CustomStackAmount.daggerFactor), MidpointRounding.AwayFromZero);
                return;

            case WeaponClass.Javelin:
                value = (short)Math.Round((double)(((float)value + (float)CustomStackAmount.javelinFlat) * CustomStackAmount.javelinFactor), MidpointRounding.AwayFromZero);
                return;
            }
            return;
        }
 public override float GetDamage(
     WeaponComponentData attackerWeapon,
     DamageTypes damageType,
     bool isAlternativeAttack)
 {
     return(isAlternativeAttack || attackerWeapon == null || WeaponComponentData.GetItemTypeFromWeaponClass(attackerWeapon.WeaponClass) != ItemObject.ItemTypeEnum.Thrown ? 0.0f : this._value);
 }
Exemplo n.º 5
0
        public static void Process(WeaponData weapon)
        {
            var components = WeaponComponentCollection.GetComponentsFromHash(weapon.hash);

            foreach (var component in components)
            {
                if (weapon.components.ContainsKey((uint)component))
                {
                    continue;
                }

                var displayName = WeaponComponent.GetComponentDisplayNameFromHash(weapon.hash, component);
                var name        = "COMPONENT_" +
                                  Enum.GetName(typeof(WeaponComponentHash), component)?.ToUnderscoreCase().ToUpper();
                name = FixNameProcessor.FixWeaponName(name);

                var comp = new WeaponComponentData
                {
                    name               = name,
                    displayName        = displayName,
                    displayDescription = displayName.ReplaceAt(2, 'D')
                };
                comp.Hash();

                if (comp.hash != component)
                {
                    Console.Error("WRONG HASH! -> " + name);
                }

                Main.WeaponStorage.AddWeaponComponent(weapon, comp);
            }
        }
Exemplo n.º 6
0
 static void Postfix(ref bool __result, WeaponComponentData __instance)
 {
     __result = (Settings.Instance.TwoHandedWeaponsSliceThroughEnabled && __instance.WeaponClass == WeaponClass.TwoHandedAxe || __instance.WeaponClass == WeaponClass.TwoHandedMace ||
                 __instance.WeaponClass == WeaponClass.TwoHandedPolearm || __instance.WeaponClass == WeaponClass.TwoHandedSword) ||
                (Settings.Instance.SingleHandedWeaponsSliceThroughEnabled && __instance.WeaponClass == WeaponClass.OneHandedSword ||
                 __instance.WeaponClass == WeaponClass.OneHandedPolearm || __instance.WeaponClass == WeaponClass.OneHandedAxe);
 }
Exemplo n.º 7
0
        private float GetRangedWeaponStrength(ItemObject item)
        {
            WeaponComponentData weaponData = item.PrimaryWeapon;
            double num1;

            switch (item.ItemType)
            {
            case ItemObject.ItemTypeEnum.Crossbow:
                num1 = 0.7;
                break;

            case ItemObject.ItemTypeEnum.Musket:
                num1 = 0.5;
                break;

            default:
                num1 = 1.0;
                break;
            }
            double num2  = (double)weaponData.ThrustDamage * 0.2 + (double)weaponData.ThrustSpeed * 0.02 + (double)weaponData.Accuracy * 0.02;
            float  tierf = (float)(num1 * num2 - 11.0);

            tierf = MathF.Clamp(tierf, 0, 10);

            return(tierf * 0.2f + 0.8f);
        }
 public virtual float GetMountDamage(
     WeaponComponentData attackerWeapon,
     DamageTypes damageType,
     bool isAlternativeAttack)
 {
     return(0.0f);
 }
Exemplo n.º 9
0
        protected bool IsSatisfied(WeaponComponentData attackerWeapon, DamageTypes damageType)
        {
            if (!this.DamageType.HasValue || this.DamageType.Value == damageType)
            {
                if (this.WeaponClass.HasValue)
                {
                    int num = (int)this.WeaponClass.Value;
                    TaleWorlds.Core.WeaponClass?weaponClass = attackerWeapon?.WeaponClass;
                    int valueOrDefault = (int)weaponClass.GetValueOrDefault();
                    if (!(num == valueOrDefault & weaponClass.HasValue))
                    {
                        goto label_7;
                    }
                }
                switch (this.EffectHitType)
                {
                case MPCombatPerkEffect.HitType.Any:
                    return(true);

                case MPCombatPerkEffect.HitType.Melee:
                    return(!this.IsWeaponRanged(attackerWeapon));

                case MPCombatPerkEffect.HitType.Ranged:
                    return(this.IsWeaponRanged(attackerWeapon));
                }
            }
label_7:
            return(false);
        }
Exemplo n.º 10
0
 protected bool IsWeaponRanged(WeaponComponentData attackerWeapon)
 {
     if (attackerWeapon == null)
     {
         return(false);
     }
     return(attackerWeapon.IsConsumable || attackerWeapon.IsRangedWeapon);
 }
Exemplo n.º 11
0
 public abstract bool DecideCrushedThrough(
     Agent attackerAgent,
     Agent defenderAgent,
     float totalAttackEnergy,
     Agent.UsageDirection attackDirection,
     StrikeType strikeType,
     WeaponComponentData defendItem,
     bool isPassiveUsageHit);
Exemplo n.º 12
0
 public static ItemObject.ItemUsageSetFlags GetItemUsageSetFlag(WeaponComponentData item)
 {
     if (!string.IsNullOrEmpty(item.ItemUsage))
     {
         return(MBItem.GetItemUsageSetFlags(item.ItemUsage));
     }
     return((ItemObject.ItemUsageSetFlags) 0);
 }
 void IAgentOriginBase.OnScoreHit(
     BasicCharacterObject victim,
     BasicCharacterObject captain,
     int damage,
     bool isFatal,
     bool isTeamKill,
     WeaponComponentData attackerWeapon)
 {
 }
Exemplo n.º 14
0
 public abstract void CalculateCollisionStunMultipliers(
     Agent attackerAgent,
     Agent defenderAgent,
     bool isAlternativeAttack,
     CombatCollisionResult collisionResult,
     WeaponComponentData attackerWeapon,
     WeaponComponentData defenderWeapon,
     out float attackerStunMultiplier,
     out float defenderStunMultiplier);
 public virtual float CalculateAdjustedArmorForBlow(
     float baseArmor,
     BasicCharacterObject attackerCharacter,
     BasicCharacterObject attackerCaptainCharacter,
     BasicCharacterObject victimCharacter,
     BasicCharacterObject victimCaptainCharacter,
     WeaponComponentData weaponComponent)
 {
     return(baseArmor);
 }
Exemplo n.º 16
0
        public WeaponComponentData AddWeaponComponent(WeaponComponentData data)
        {
            data.Hash();
            if (this.componentData.ContainsKey(data.hash))
            {
                return(this.componentData[data.hash]);
            }

            this.componentData.Add(data.hash, data);
            return(data);
        }
Exemplo n.º 17
0
            static protected int GetMeleeSkill(Agent agent, WeaponComponentData equippedItem, WeaponComponentData secondaryItem)
            {
                SkillObject skill = DefaultSkills.Athletics;

                if (equippedItem != null)
                {
                    SkillObject relevantSkill = equippedItem.RelevantSkill;
                    skill = ((relevantSkill == DefaultSkills.OneHanded || relevantSkill == DefaultSkills.Polearm) ? relevantSkill : ((relevantSkill != DefaultSkills.TwoHanded) ? DefaultSkills.OneHanded : ((secondaryItem == null) ? DefaultSkills.TwoHanded : DefaultSkills.OneHanded)));
                }
                return(GetEffectiveSkill(agent.Character, agent.Origin, agent.Formation, skill));
            }
Exemplo n.º 18
0
        private MatrixFrame GetWeaponTipFrame(WeaponComponentData weapon, Agent wieldingAgent)
        {
            var weaponLength = weapon.GetRealWeaponLength();
            var skeleton     = wieldingAgent.AgentVisuals.GetSkeleton();
            var itemFrame    = skeleton.GetBoneEntitialFrame((int)HumanBone.ItemR);
            var agentFrame   = wieldingAgent.AgentVisuals.GetFrame();
            var transformedWeaponTipFrame = agentFrame.TransformToParent(itemFrame);
            var weaponTipOriginOffset     = transformedWeaponTipFrame.rotation.u * weaponLength;

            transformedWeaponTipFrame.origin += weaponTipOriginOffset;
            return(transformedWeaponTipFrame);
        }
Exemplo n.º 19
0
        private float GetMeleeWeaponStrength(WeaponComponentData weaponData)
        {
            float num1 = Math.Max((float)weaponData.ThrustDamage * GetFactor(weaponData.ThrustDamageType)
                                  * MathF.Pow((float)weaponData.ThrustSpeed * 0.01f, 1.5f),
                                  (float)weaponData.SwingDamage * GetFactor(weaponData.SwingDamageType)
                                  * MathF.Pow((float)weaponData.SwingSpeed * 0.01f, 1.5f));
            float num2  = (float)weaponData.WeaponLength * 0.01f;
            float tierf = (float)(0.06 * ((double)num1 * (1.0 + (double)num2)) - 3.5);

            tierf = MathF.Clamp(tierf, 0, 10);
            return(tierf * 0.2f + 0.8f);
        }
        public override void OnScoreHit(
            Agent affectedAgent,
            Agent affectorAgent,
            WeaponComponentData attackerWeapon,
            bool isBlocked,
            float damage,
            float movementSpeedDamageModifier,
            float hitDistance,
            AgentAttackType attackType,
            float shotDifficulty,
            BoneBodyPartType victimHitBodyPart)
        {
            bool flag1 = affectorAgent != null && affectorAgent.IsMainAgent;

            if (affectorAgent == null || affectedAgent == null || (!affectorAgent.IsHuman || !affectedAgent.IsHuman))
            {
                return;
            }
            HighlightsController.Highlight highlight = new HighlightsController.Highlight();
            highlight.Start = Mission.Current.Time;
            highlight.End   = Mission.Current.Time;
            bool flag2 = false;

            if (flag1 && (double)shotDifficulty >= 7.5)
            {
                highlight.HighlightType = this.GetHighlightTypeWithId("hlid_high_ranged_shot_difficulty");
                flag2 = true;
            }
            if (flag1 && affectedAgent.HasMount && (attackType == AgentAttackType.Standard && affectorAgent.HasMount) && affectorAgent.IsDoingPassiveAttack)
            {
                highlight.HighlightType = this.GetHighlightTypeWithId("hlid_couched_lance_against_mounted_opponent");
                flag2 = true;
            }
            if (this._isFirstImpact && affectorAgent.Formation != null && (affectorAgent.Formation.IsCavalry() && affectorAgent.Formation.MovementOrder == (object)MovementOrder.MovementOrderCharge) && this.CanSaveHighlight(this.GetHighlightTypeWithId("hlid_cavalry_charge_first_impact"), affectedAgent.Position))
            {
                this._cavalryChargeHitTimes.RemoveAll((Predicate <float>)(ht => (double)ht + 3.0 < (double)Mission.Current.Time));
                this._cavalryChargeHitTimes.Add(Mission.Current.Time);
                if (this._cavalryChargeHitTimes.Count >= 5)
                {
                    highlight.HighlightType = this.GetHighlightTypeWithId("hlid_cavalry_charge_first_impact");
                    highlight.Start         = this._cavalryChargeHitTimes[0];
                    highlight.End           = this._cavalryChargeHitTimes.Last <float>();
                    flag2 = true;
                    this._isFirstImpact = false;
                    this._cavalryChargeHitTimes.Clear();
                }
            }
            if (!flag2)
            {
                return;
            }
            this.SaveHighlight(highlight, affectedAgent.Position);
        }
Exemplo n.º 21
0
        private float GetThrownWeaponStrength(WeaponComponentData weaponData)
        {
            if (weaponData.WeaponClass == WeaponClass.Stone)
            {
                return(0.5f);
            }
            float num1 = (float)weaponData.ThrustDamage * GetFactor(weaponData.ThrustDamageType)
                         * MathF.Pow((float)weaponData.ThrustSpeed * 0.01f, 1.5f);
            float tierf = (float)(0.072 * ((double)num1 - 3.5));

            tierf = MathF.Clamp(tierf, 0, 12);
            return(tierf * 0.2f + 0.8f);
        }
Exemplo n.º 22
0
        public void AddWeaponComponent(WeaponData weapon, WeaponComponentData data)
        {
            data.Hash();
            if (weapon.components.ContainsKey((uint)data.hash))
            {
                return;
            }
            data = AddWeaponComponent(data);

            TranslationProcessor.ProcessComponentLanguage(data);
            AttachmentPointProcessor.Process(weapon.hash, data);

            weapon.components.Add((uint)data.hash, data);
        }
        public override bool IsDisabledForAgent(Agent agent)
        {
            EquipmentIndex wieldedItemIndex = agent.GetWieldedItemIndex(Agent.HandIndex.MainHand);

            if (wieldedItemIndex == EquipmentIndex.None)
            {
                return(true);
            }
            WeaponComponentData currentUsageItem = agent.Equipment[wieldedItemIndex].CurrentUsageItem;

            if (currentUsageItem == null || !currentUsageItem.IsRangedWeapon)
            {
                return(true);
            }
            return(wieldedItemIndex == EquipmentIndex.Weapon4 ? (double)this.ThrowingValueMultiplier <= 0.0 || base.IsDisabledForAgent(agent) : (double)this.RangedWeaponValueMultiplier <= 0.0 || base.IsDisabledForAgent(agent));
        }
Exemplo n.º 24
0
        public static void Postfix(WeaponComponent weaponComponent, ref float __result)
        {
            WeaponComponentData weaponComponentData = weaponComponent.PrimaryWeapon;

            if (weaponComponentData.WeaponClass == WeaponClass.Javelin ||
                weaponComponentData.WeaponClass == WeaponClass.TwoHandedAxe ||
                weaponComponentData.WeaponClass == WeaponClass.TwoHandedSword ||
                weaponComponentData.WeaponClass == WeaponClass.TwoHandedPolearm)
            {
                if (__result > 3)
                {
                    // Javelie price is extradinarily high with high smithing skills.
                    // Use sqrt to smooth the curve.
                    __result = 3 + (float)Math.Sqrt(__result - 3);
                }
            }
        }
        public virtual float GetWeaponInaccuracy(
            Agent agent,
            WeaponComponentData weapon,
            int weaponSkill)
        {
            float val1 = 0.0f;

            if (weapon.IsRangedWeapon)
            {
                val1 = (float)((100.0 - (double)weapon.Accuracy) * (1.0 - 1.0 / 500.0 * (double)weaponSkill) * (1.0 / 1000.0));
            }
            else if (weapon.WeaponFlags.HasAllFlags <WeaponFlags>(WeaponFlags.WideGrip))
            {
                val1 = (float)(1.0 - (double)weaponSkill * 0.00999999977648258);
            }
            return(Math.Max(val1, 0.0f));
        }
Exemplo n.º 26
0
        private void HandleAgentNearWeaponTip(
            Agent affectedAgent,
            Agent affectorAgent,
            WeaponComponentData weapon,
            MatrixFrame weaponTipFrame
            )
        {
            var impactedBone = GetImpactedBone(affectedAgent, weaponTipFrame);

            if (impactedBone == HumanBone.Invalid)
            {
                return;
            }
            var blow = CreateBlow(affectedAgent, impactedBone, affectorAgent, weapon, weaponTipFrame);

            affectedAgent.RegisterBlow(blow);
            affectedAgent.CreateBloodBurstAtLimb((sbyte)impactedBone, ref weaponTipFrame.origin, blow.BaseMagnitude);
        }
Exemplo n.º 27
0
 public override void OnScoreHit(
     Agent affectedAgent,
     Agent affectorAgent,
     WeaponComponentData attackerWeapon,
     bool isBlocked,
     float damage,
     float movementSpeedDamageModifier,
     float hitDistance,
     AgentAttackType attackType,
     float shotDifficulty,
     BoneBodyPartType victimHitBodyPart)
 {
     if (!GameNetwork.IsServer || isBlocked || (affectorAgent == affectedAgent || affectorAgent.MissionPeer == null) || (double)damage <= 0.0)
     {
         return;
     }
     affectedAgent.AddHitter(affectorAgent.MissionPeer, damage, affectorAgent.IsFriendOf(affectedAgent));
 }
Exemplo n.º 28
0
        public static void Postfix(Agent agent, AgentDrivenProperties agentDrivenProperties)
        {
            if (agent != null && agentDrivenProperties != null)
            {
                if (!agent.IsHero && agent.IsHuman)
                {
                    try
                    {
                        Agent     leader           = agent.Team.Leader;
                        Equipment leader_equipment = leader.SpawnEquipment;
                        float     total_armor      = leader_equipment.GetHeadArmorSum() + leader_equipment.GetHumanBodyArmorSum() +
                                                     leader_equipment.GetLegArmorSum() + leader_equipment.GetArmArmorSum();
                        EquipmentIndex      wieldedItemIndex3   = agent.GetWieldedItemIndex(Agent.HandIndex.MainHand);
                        MissionEquipment    equipment           = agent.Equipment;
                        WeaponComponentData weaponComponentData = (wieldedItemIndex3 != EquipmentIndex.None) ? equipment[wieldedItemIndex3].CurrentUsageItem : null;
                        if (total_armor > 9000)
                        {
                            agentDrivenProperties.ArmorHead  += leader_equipment.GetHeadArmorSum() / 10;
                            agentDrivenProperties.ArmorTorso += leader_equipment.GetHumanBodyArmorSum() / 10;
                            agentDrivenProperties.ArmorLegs  += leader_equipment.GetLegArmorSum() / 10;
                            agentDrivenProperties.ArmorArms  += leader_equipment.GetArmArmorSum() / 10;
                            agent.HealthLimit = Math.Min(agent.HealthLimit + (total_armor / 100) * (total_armor > 9000 ? 3f : 0.5f), 50000f);
                            agent.Health      = agent.HealthLimit;
                            agentDrivenProperties.SwingSpeedMultiplier += (total_armor > 9000 ? 1f : 0f);
                            agentDrivenProperties.ThrustOrRangedReadySpeedMultiplier += (total_armor > 9000 ? 1f : 0f);
                            agentDrivenProperties.WeaponInaccuracy       *= (total_armor > 9000 ? 0.01f : 1f);
                            agentDrivenProperties.MaxSpeedMultiplier     *= (total_armor > 9000 ? 2f : 1f);
                            agentDrivenProperties.WeaponUnsteadyBeginTime = (total_armor > 9000 ? 0.01f : 1f);
                            agentDrivenProperties.WeaponUnsteadyEndTime   = (total_armor > 9000 ? 0.05f : 1f);
                            agentDrivenProperties.ReloadSpeed             = (total_armor > 9000 ? 0.01f : 0.93f);
                        }


                        //ModDebug.ShowMessage($"Test: ArmorHead {agentDrivenProperties.ArmorHead} | ArmorTorso {agentDrivenProperties.ArmorTorso} | ArmorLegs {agentDrivenProperties.ArmorLegs} | ArmorArms {agentDrivenProperties.ArmorArms}" +
                        //    $"Test: HealthLimit {agent.HealthLimit}"
                        //        , "Test");
                    }
                    catch (Exception ex)
                    {
                        ModDebug.ShowError($"An exception occurred whilst trying to apply the god mode", "", ex);
                    }
                }
            }
        }
Exemplo n.º 29
0
        private void HandleBracedPolearm(WeaponComponentData weapon, Agent wieldingAgent)
        {
            var weaponTipFrame = GetWeaponTipFrame(weapon, wieldingAgent);

            if (SubModule.Config.IsDebugMode)
            {
                MBDebug.RenderDebugDirectionArrow(weaponTipFrame.origin, weaponTipFrame.rotation.u);
                MBDebug.RenderDebugSphere(weaponTipFrame.origin, SubModule.Config.BoneCollisionRadius);
            }
            var agentsNearWeaponTip = _mission.GetNearbyAgents(weaponTipFrame.origin.AsVec2, SubModule.Config.AgentCollisionCheckRadius);

            foreach (var agentNearWeaponTip in agentsNearWeaponTip)
            {
                if (agentNearWeaponTip != wieldingAgent)
                {
                    HandleAgentNearWeaponTip(agentNearWeaponTip, wieldingAgent, weapon, weaponTipFrame);
                }
            }
        }
Exemplo n.º 30
0
 protected internal override void OnTickAsAI(float dt)
 {
     if (this.Agent.Mission.MissionEnded())
     {
         this._itemToPickUp = (SpawnedItemEntity)null;
     }
     else
     {
         if (this._itemToPickUp != null && !this._itemToPickUp.MovingAgents.ContainsKey(this.Agent))
         {
             this._itemToPickUp = (SpawnedItemEntity)null;
         }
         if (this._itemToPickUp != null && (NativeObject)this._itemToPickUp.GameEntity == (NativeObject)null)
         {
             this.Agent.StopUsingGameObject(false);
         }
         if (this._tickTimer.Check(true))
         {
             EquipmentIndex      wieldedItemIndex    = this.Agent.GetWieldedItemIndex(Agent.HandIndex.MainHand);
             WeaponComponentData weaponComponentData = wieldedItemIndex == EquipmentIndex.None ? (WeaponComponentData)null : this.Agent.Equipment[wieldedItemIndex].CurrentUsageItem;
             bool  flag        = weaponComponentData != null && weaponComponentData.IsRangedWeapon;
             Agent targetAgent = this.Agent.GetTargetAgent();
             if (this.CheckEquipmentForAgentForPickUpAvailability() && this.Agent.CanBeAssignedForScriptedMovement() && (this.Agent.IsAlarmed() && (this.Agent.GetAgentFlags() & AgentFlag.CanAttack) != AgentFlag.None) && !this.IsInImportantCombatAction() && (targetAgent == null || (!flag || this.IsAnyConsumableDepleted() || ((double)this.Agent.GetTargetRange() >= (double)this.Agent.GetMissileRange() || this.Agent.GetLastTargetVisibilityState() != AITargetVisibilityState.TargetIsClear)) && (double)targetAgent.Position.DistanceSquared(this.Agent.Position) > 400.0))
             {
                 float forwardUnlimitedSpeed = this.Agent.MaximumForwardUnlimitedSpeed;
                 if (this._itemToPickUp == null)
                 {
                     this._itemToPickUp = this.SelectPickableItem(this.Agent.Position - new Vec3(forwardUnlimitedSpeed, forwardUnlimitedSpeed, 1f), this.Agent.Position + new Vec3(forwardUnlimitedSpeed, forwardUnlimitedSpeed, 1.8f));
                     if (this._itemToPickUp != null)
                     {
                         this.RequestMoveToItem(this._itemToPickUp);
                     }
                 }
             }
         }
         if (this._itemToPickUp == null || (this.Agent.AIStateFlags & Agent.AIStateFlag.UseObjectMoving) == Agent.AIStateFlag.None || !this.Agent.CanReachAndUseObject((UsableMissionObject)this._itemToPickUp, this.Agent.Frame.origin.DistanceSquared(this._itemToPickUp.GetUserFrameForAgent(this.Agent).Origin.Position)))
         {
             return;
         }
         this.Agent.UseGameObject((UsableMissionObject)this._itemToPickUp);
     }
 }