Anvil
Anvil.Services.WeaponService Class Reference
+ Inheritance diagram for Anvil.Services.WeaponService:
+ Collaboration diagram for Anvil.Services.WeaponService:

Public Member Functions

 WeaponService (HookService hookService, EventService eventService)
 
void AddEpicWeaponDevastatingCriticalFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as a devastating critical feat for the specified base item type. More...
 
void AddEpicWeaponFocusFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as an epic weapon focus feat for the specified base item type. More...
 
void AddEpicWeaponOverwhelmingCriticalFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as an epic overwhelming critical feat for the specified base item type. More...
 
void AddEpicWeaponSpecializationFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as an epic weapon specialization feat for the specified base item type. More...
 
void AddGreaterWeaponFocusFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as a greater weapon focus feat for the specified base item type.
This adds the GreaterWeaponFocusAttackBonus to the weapon's attack roll for characters with the specified feat. More...
 
void AddGreaterWeaponSpecializationFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as a greater weapon specialization feat for the specified base item type.
This adds the GreaterWeaponSpecializationDamageBonus to the weapon's damage roll for characters with the specified feat. More...
 
void AddWeaponFocusFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as a weapon focus feat for the specified base item type. More...
 
void AddWeaponImprovedCriticalFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as an improved critical feat for the specified base item type. More...
 
void AddWeaponOfChoiceFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as a weapon of choice feat for the specified base item type. More...
 
void AddWeaponSpecializationFeat (NwBaseItem baseItem, NwFeat feat)
 Adds the specified feat as a weapon specialization feat for the specified base item type. More...
 
CreatureSize GetWeaponFinesseSize (NwBaseItem baseItem)
 Gets the required creature size needed for the specified base item type to be finessable. This function only returns values assigned in SetWeaponFinesseSize. More...
 
void SetMaxRangedAttackDistanceOverride (NwBaseItem baseItem, float max, float maxPassive, float preferred)
 Overrides the max attack distance of ranged weapons. More...
 
void SetWeaponFinesseSize (NwBaseItem baseItem, CreatureSize size)
 Sets the required creature size needed for the specified base item type to be finessable. More...
 
void SetWeaponIsMonkWeapon (NwBaseItem baseItem)
 Sets the specified weapon base item to be considered a monk weapon. More...
 
void SetWeaponUnarmed (NwBaseItem baseItem)
 Sets the specified weapon base item to be considered as unarmed for the weapon finesse feat. More...
 

Properties

bool EnableSlingGoodAimFeat = false [get, set]
 Gets or sets whether the "Good Aim" feat should also apply to slings. More...
 
int GreaterWeaponFocusAttackBonus = 1 [get, set]
 Gets or sets the attack bonus granted to a creature with a "Greater Weapon Focus" feat.
This does not exist in the base game, see AddGreaterWeaponFocusFeat to add feats that grant this bonus. More...
 
int GreaterWeaponSpecializationDamageBonus = 2 [get, set]
 Gets or sets the damage bonus granted to a creature with a "Greater Weapon Specialization" feat.
This does not exist in the base game, see AddGreaterWeaponSpecializationFeat to add feats that grant this bonus. More...
 

Events

Action< DevastatingCriticalData >? OnDevastatingCriticalHit
 Called when an attack results in a devastating critical hit. Subscribe and modify the event data to implement custom behaviours. More...
 

Member Function Documentation

◆ AddEpicWeaponDevastatingCriticalFeat()

void Anvil.Services.WeaponService.AddEpicWeaponDevastatingCriticalFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as a devastating critical feat for the specified base item type.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ AddEpicWeaponFocusFeat()

void Anvil.Services.WeaponService.AddEpicWeaponFocusFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as an epic weapon focus feat for the specified base item type.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ AddEpicWeaponOverwhelmingCriticalFeat()

void Anvil.Services.WeaponService.AddEpicWeaponOverwhelmingCriticalFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as an epic overwhelming critical feat for the specified base item type.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ AddEpicWeaponSpecializationFeat()

void Anvil.Services.WeaponService.AddEpicWeaponSpecializationFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as an epic weapon specialization feat for the specified base item type.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ AddGreaterWeaponFocusFeat()

void Anvil.Services.WeaponService.AddGreaterWeaponFocusFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as a greater weapon focus feat for the specified base item type.
This adds the GreaterWeaponFocusAttackBonus to the weapon's attack roll for characters with the specified feat.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ AddGreaterWeaponSpecializationFeat()

void Anvil.Services.WeaponService.AddGreaterWeaponSpecializationFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as a greater weapon specialization feat for the specified base item type.
This adds the GreaterWeaponSpecializationDamageBonus to the weapon's damage roll for characters with the specified feat.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ AddWeaponFocusFeat()

void Anvil.Services.WeaponService.AddWeaponFocusFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as a weapon focus feat for the specified base item type.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ AddWeaponImprovedCriticalFeat()

void Anvil.Services.WeaponService.AddWeaponImprovedCriticalFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as an improved critical feat for the specified base item type.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ AddWeaponOfChoiceFeat()

void Anvil.Services.WeaponService.AddWeaponOfChoiceFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as a weapon of choice feat for the specified base item type.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ AddWeaponSpecializationFeat()

void Anvil.Services.WeaponService.AddWeaponSpecializationFeat ( NwBaseItem  baseItem,
NwFeat  feat 
)
inline

Adds the specified feat as a weapon specialization feat for the specified base item type.

Parameters
baseItemThe base item type to be mapped.
featThe feat to map to the base item.

◆ GetWeaponFinesseSize()

CreatureSize Anvil.Services.WeaponService.GetWeaponFinesseSize ( NwBaseItem  baseItem)
inline

Gets the required creature size needed for the specified base item type to be finessable. This function only returns values assigned in SetWeaponFinesseSize.

Parameters
baseItemThe base item type to query.
Returns
The size of the creature needed to consider this weapon finessable.

◆ SetMaxRangedAttackDistanceOverride()

void Anvil.Services.WeaponService.SetMaxRangedAttackDistanceOverride ( NwBaseItem  baseItem,
float  max,
float  maxPassive,
float  preferred 
)
inline

Overrides the max attack distance of ranged weapons.

Parameters
baseItemThe base item type.
maxThe maximum attack distance. Default is 40.0f.
maxPassiveThe maximum passive attack distance. Default is 20.0f. Seems to be used by the engine to determine a new nearby target when needed.
preferredThe preferred attack distance. See the PrefAttackDist column in baseitems.2da, default seems to be 30.0f for ranged weapons.

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.

◆ SetWeaponFinesseSize()

void Anvil.Services.WeaponService.SetWeaponFinesseSize ( NwBaseItem  baseItem,
CreatureSize  size 
)
inline

Sets the required creature size needed for the specified base item type to be finessable.

Parameters
baseItemThe base item type to be mapped.
sizeThe size of the creature needed to consider this weapon finessable.

◆ SetWeaponIsMonkWeapon()

void Anvil.Services.WeaponService.SetWeaponIsMonkWeapon ( NwBaseItem  baseItem)
inline

Sets the specified weapon base item to be considered a monk weapon.

Parameters
baseItemThe base item type to be considered a monk weapon.

◆ SetWeaponUnarmed()

void Anvil.Services.WeaponService.SetWeaponUnarmed ( NwBaseItem  baseItem)
inline

Sets the specified weapon base item to be considered as unarmed for the weapon finesse feat.

Parameters
baseItemThe base item type to be considered unarmed.

Property Documentation

◆ EnableSlingGoodAimFeat

bool Anvil.Services.WeaponService.EnableSlingGoodAimFeat = false
getset

Gets or sets whether the "Good Aim" feat should also apply to slings.

◆ GreaterWeaponFocusAttackBonus

int Anvil.Services.WeaponService.GreaterWeaponFocusAttackBonus = 1
getset

Gets or sets the attack bonus granted to a creature with a "Greater Weapon Focus" feat.
This does not exist in the base game, see AddGreaterWeaponFocusFeat to add feats that grant this bonus.

◆ GreaterWeaponSpecializationDamageBonus

int Anvil.Services.WeaponService.GreaterWeaponSpecializationDamageBonus = 2
getset

Gets or sets the damage bonus granted to a creature with a "Greater Weapon Specialization" feat.
This does not exist in the base game, see AddGreaterWeaponSpecializationFeat to add feats that grant this bonus.

Event Documentation

◆ OnDevastatingCriticalHit

Action<DevastatingCriticalData>? Anvil.Services.WeaponService.OnDevastatingCriticalHit

Called when an attack results in a devastating critical hit. Subscribe and modify the event data to implement custom behaviours.


The documentation for this class was generated from the following file: