Skip to content

Commit

Permalink
Merge branch 'master' into features
Browse files Browse the repository at this point in the history
  • Loading branch information
doug1234 committed Feb 6, 2024
2 parents eb48ba6 + 3e707ee commit c37667a
Show file tree
Hide file tree
Showing 25 changed files with 1,010 additions and 231 deletions.
23 changes: 8 additions & 15 deletions TemplePlus/action_sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3414,23 +3414,16 @@ void ActionSequenceSystem::FullAttackCostCalculate(D20Actn* d20a, TurnBasedStatu
auto mainWeapon = inventory.ItemWornAt(performer, EquipSlot::WeaponPrimary);
auto offhand = inventory.ItemWornAt(performer, EquipSlot::WeaponSecondary);

if (offhand){
if (mainWeapon){
if (objects.GetType(offhand) != obj_t_armor) {
_attackTypeCodeHigh = ATTACK_CODE_OFFHAND + 1; // originally 5
_attackTypeCodeLow = ATTACK_CODE_OFFHAND; // originally 4
usingOffhand = 1;
}
}
else {
mainWeapon = offhand;
}
auto style = critterSys.GetFightingStyle(performer);

if ((style & FightingStyle::Mask) == FightingStyle::TwoWeapon) {
_attackTypeCodeHigh = ATTACK_CODE_OFFHAND + 1; // originally 5
_attackTypeCodeLow = ATTACK_CODE_OFFHAND; // originally 4
usingOffhand = 1;
}
if (mainWeapon){
int weapFlags = objects.getInt32(mainWeapon, obj_f_weapon_flags);
if (weapFlags & OWF_RANGED_WEAPON)
d20a->d20Caf |= D20CAF_RANGED;

if ((style & FightingStyle::Ranged) == FightingStyle::Ranged) {
d20a->d20Caf |= D20CAF_RANGED;
}

// if unarmed check natural attacks (for monsters)
Expand Down
Loading

0 comments on commit c37667a

Please sign in to comment.