Пример #1
0
        /// <summary>
        /// Sets the specified weapon base item to be considered a monk weapon.
        /// </summary>
        /// <param name="baseItem">The base item type to be considered a monk weapon.</param>
        public void SetWeaponIsMonkWeapon(NwBaseItem baseItem)
        {
            monkWeaponSet.Add(baseItem.Id);

            if (!combatModeEventSubscribed)
            {
                eventService.SubscribeAll <OnCombatModeToggle, OnCombatModeToggle.Factory>(OnCombatModeToggle);
                combatModeEventSubscribed = true;
            }
        }
Пример #2
0
        /// <summary>
        /// Overrides the max attack distance of ranged weapons.
        /// </summary>
        /// <param name="baseItem">The base item type.</param>
        /// <param name="max">The maximum attack distance. Default is 40.0f.</param>
        /// <param name="maxPassive">The maximum passive attack distance. Default is 20.0f. Seems to be used by the engine to determine a new nearby target when needed.</param>
        /// <param name="preferred">The preferred attack distance. See the PrefAttackDist column in baseitems.2da, default seems to be 30.0f for ranged weapons.</param>
        /// <remarks>maxPassive should probably be lower than max, half of max seems to be a good start. preferred should be at least ~0.5f lower than max.</remarks>
        public void SetMaxRangedAttackDistanceOverride(NwBaseItem baseItem, float max, float maxPassive, float preferred)
        {
            if (!baseItem.IsRangedWeapon)
            {
                return;
            }

            baseItem.PreferredAttackDistance = preferred;

            MaxRangedAttackDistanceOverride overrideData;

            overrideData.MaxRangedAttackDistance        = max;
            overrideData.MaxRangedPassiveAttackDistance = maxPassive;

            maxRangedAttackDistanceOverrideMap[baseItem.Id] = overrideData;
            maxAttackRangeHook ??= hookService.RequestHook <MaxAttackRangeHook>(OnMaxAttackRange, FunctionsLinux._ZN12CNWSCreature14MaxAttackRangeEjii, HookOrder.Final);
        }
Пример #3
0
 /// <summary>
 /// Sets the specified weapon base item to be considered as unarmed for the weapon finesse feat.
 /// </summary>
 /// <param name="baseItem">The base item type to be considered unarmed.</param>
 public void SetWeaponUnarmed(NwBaseItem baseItem)
 {
     weaponUnarmedSet.Add(baseItem.Id);
 }
Пример #4
0
 /// <summary>
 /// Sets the required creature size needed for the specified base item type to be finessable.
 /// </summary>
 /// <param name="baseItem">The base item type to be mapped.</param>
 /// <param name="size">The size of the creature needed to consider this weapon finessable.</param>
 public void SetWeaponFinesseSize(NwBaseItem baseItem, CreatureSize size)
 {
     weaponFinesseSizeMap[baseItem.Id] = (byte)size;
 }
Пример #5
0
 /// <summary>
 /// Gets the required creature size needed for the specified base item type to be finessable. This function only returns values assigned in <see cref="SetWeaponFinesseSize"/>.
 /// </summary>
 /// <param name="baseItem">The base item type to query.</param>
 /// <returns>The size of the creature needed to consider this weapon finessable.</returns>
 public CreatureSize GetWeaponFinesseSize(NwBaseItem baseItem)
 {
     return(weaponFinesseSizeMap.TryGetValue(baseItem.Id, out byte size) ? (CreatureSize)size : CreatureSize.Invalid);
 }
Пример #6
0
 /// <summary>
 /// Adds the specified feat as a weapon specialization feat for the specified base item type.
 /// </summary>
 /// <param name="baseItem">The base item type to be mapped.</param>
 /// <param name="feat">The feat to map to the base item.</param>
 public void AddWeaponSpecializationFeat(NwBaseItem baseItem, NwFeat feat)
 {
     weaponSpecializationMap.AddElement(baseItem.Id, feat.Id);
 }
Пример #7
0
 /// <summary>
 /// Adds the specified feat as a weapon of choice feat for the specified base item type.
 /// </summary>
 /// <param name="baseItem">The base item type to be mapped.</param>
 /// <param name="feat">The feat to map to the base item.</param>
 public void AddWeaponOfChoiceFeat(NwBaseItem baseItem, NwFeat feat)
 {
     weaponOfChoiceMap.AddElement(baseItem.Id, feat.Id);
 }
Пример #8
0
 /// <summary>
 /// Adds the specified feat as an improved critical feat for the specified base item type.
 /// </summary>
 /// <param name="baseItem">The base item type to be mapped.</param>
 /// <param name="feat">The feat to map to the base item.</param>
 public void AddWeaponImprovedCriticalFeat(NwBaseItem baseItem, NwFeat feat)
 {
     weaponImprovedCriticalMap.AddElement(baseItem.Id, feat.Id);
 }
Пример #9
0
 /// <summary>
 /// Adds the specified feat as a weapon focus feat for the specified base item type.
 /// </summary>
 /// <param name="baseItem">The base item type to be mapped.</param>
 /// <param name="feat">The feat to map to the base item.</param>
 public void AddWeaponFocusFeat(NwBaseItem baseItem, NwFeat feat)
 {
     weaponFocusMap.AddElement(baseItem.Id, feat.Id);
 }
Пример #10
0
 /// <summary>
 /// Adds the specified feat as an epic overwhelming critical feat for the specified base item type.
 /// </summary>
 /// <param name="baseItem">The base item type to be mapped.</param>
 /// <param name="feat">The feat to map to the base item.</param>
 public void AddEpicWeaponOverwhelmingCriticalFeat(NwBaseItem baseItem, NwFeat feat)
 {
     epicWeaponOverwhelmingCriticalMap.AddElement(baseItem.Id, feat.Id);
 }