Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combat Rework v1 (untested WiP) #377

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"damageFactorForPowerStrike": 0.08,
"damageFactorForPowerDraw": 0.14,
"damageFactorForPowerThrow": 0.1,
"handlingFactorForWeaponMaster": [0.7, 0.75, 0.8, 0.85, 0.95, 1.10, 1.25, 1.35, 1.45, 1.5, 1.55, 1.65, 1.7, 1.75],
"handlingFactorForWeaponMaster": [0.65, 0.71, 0.747, 0.779, 0.808, 0.835, 0.861, 0.887, 0.923, 0.98, 1.15, 1.33, 1.48, 1.6],
"durabilityFactorForShieldRecursiveCoefs": [1.0, 0.4, 0.1],
"infantryCoverageFactorForShieldCoef": 0.20,
"cavalryCoverageFactorForShieldCoef": 0.02,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private void UpdateHumanAgentStats(Agent agent, AgentDrivenProperties props)
float totalEncumbrance = props.ArmorEncumbrance + props.WeaponsEncumbrance;
float freeWeight = 2.5f * (1 + (strengthSkill - 3f) / 30f);
float perceivedWeight = Math.Max(totalEncumbrance - freeWeight, 0f) * weightReductionFactor;
props.TopSpeedReachDuration = 0.8f * (1f + perceivedWeight / 15f) * (20f / (20f + (float)Math.Pow(athleticsSkill / 120f, 2f))) + ImpactofStrAndWeaponLengthOnTimeToMaxSpeed(equippedItem != null ? equippedItem.WeaponLength : 22, strengthSkill);
props.TopSpeedReachDuration = 1.5f * (1f + perceivedWeight / 15f) * (20f / (20f + (float)Math.Pow(athleticsSkill / 120f, 2f))) + ImpactofStrAndWeaponLengthOnTimeToMaxSpeed(equippedItem != null ? equippedItem.WeaponLength : 22, strengthSkill);
float speed = 0.58f + 0.034f * athleticsSkill / 26f;
props.MaxSpeedMultiplier = MBMath.ClampFloat(
speed * (float)Math.Pow(361f / (361f + (float)Math.Pow(perceivedWeight, 5f)), 0.055f),
Expand All @@ -307,7 +307,7 @@ private void UpdateHumanAgentStats(Agent agent, AgentDrivenProperties props)
int itemSkill = GetEffectiveSkill(agent, equippedItem?.RelevantSkill ?? DefaultSkills.Athletics);
// Use weapon master here instead of wpf so the archer with no melee wpf can still fight.
int weaponMaster = GetEffectiveSkill(agent, CrpgSkills.WeaponMaster);
props.SwingSpeedMultiplier = 0.925f + 0.00237f * (float)Math.Pow(itemSkill, 0.9f);
props.SwingSpeedMultiplier = 0.85f + 0.00237f * (float)Math.Pow(itemSkill, 0.9f);
props.ThrustOrRangedReadySpeedMultiplier = props.SwingSpeedMultiplier;
props.HandlingMultiplier = 1.05f * _constants.HandlingFactorForWeaponMaster[Math.Min(weaponMaster, _constants.HandlingFactorForWeaponMaster.Length - 1)];
props.ShieldBashStunDurationMultiplier = 1f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public override float CalculateStrikeMagnitudeForThrust(
* (float)(Math.Pow(thrustSpeedPercentage, 2f) + magnitudeBonusFromExtraSpeed);
default:
return BladeDamageFactorToDamageRatio *
(float)(Math.Pow(thrustSpeedPercentage, 2f) + magnitudeBonusFromExtraSpeed);
(float)(Math.Pow(thrustSpeedPercentage, 6f) + magnitudeBonusFromExtraSpeed);
}
}

Expand Down
36 changes: 0 additions & 36 deletions src/Module.Server/ModuleData/combat_parameters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,6 @@
</definitions>

<combat_parameters>
<!--
left_rider_rot_limit here governs 1h left lower thrust max angle while mounted. native is 120
right_rider_rot_limit here governs 1h right lower thrust max angle while mounted. native is 90
-->
<combat_parameter
id="onehanded_thrust"
collision_check_starting_percent="0.0"
collision_damage_starting_percent="0.12"
collision_check_ending_percent="0.38"
vertical_rot_limit_multiplier_up="thrust_vertical_rot_limit"
vertical_rot_limit_multiplier_down="thrust_vertical_rot_limit"
left_rider_rot_limit="thrust_rider_rot_limit_left"
left_rider_min_rot_limit="down_and_upperstab_min_rider_rot_limit_left"
right_rider_rot_limit="thrust_rider_rot_limit_right"
right_rider_min_rot_limit="down_and_upperstab_min_rider_rot_limit_right"
rider_look_down_limit="thrust_rider_look_down_limit"
left_ladder_rot_limit="thrust_ladder_rot_limit_left"
right_ladder_rot_limit="thrust_ladder_rot_limit_right"
hit_bone_index="27"
shoulder_hit_bone_index="21" />
<combat_parameter id="onehanded_lance_thrust"
collision_check_starting_percent="0.15"
collision_damage_starting_percent="0.25"
collision_check_ending_percent="0.56"
weapon_offset="0,0,0.0"
vertical_rot_limit_multiplier_up="thrust_vertical_rot_limit"
vertical_rot_limit_multiplier_down="0.5"
left_rider_rot_limit="72"
left_rider_min_rot_limit="thrust_polearm_min_rider_rot_limit_left"
right_rider_rot_limit="54"
right_rider_min_rot_limit="thrust_polearm_min_rider_rot_limit_right"
rider_look_down_limit="thrust_rider_look_down_limit"
left_ladder_rot_limit="thrust_ladder_rot_limit_left"
right_ladder_rot_limit="thrust_ladder_rot_limit_right"
hit_bone_index="27"
shoulder_hit_bone_index="21" />
<!--
left_rider_rot_limit here governs 1h left lower upperthrust max angle while mounted. native is 120
right_rider_rot_limit here governs 1h right lower upperthrust max angle while mounted. native is 90
Expand Down
2 changes: 1 addition & 1 deletion src/Module.Server/ModuleData/managed_core_parameters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<managed_core_parameter id="OverSwingCombatSpeedGraphOneProgressValue" value="0.945"/>

<managed_core_parameter id="ThrustCombatSpeedGraphZeroProgressValue" value="0.0"/>
<managed_core_parameter id="ThrustCombatSpeedGraphFirstMaximumPoint" value="0.225"/>
<managed_core_parameter id="ThrustCombatSpeedGraphFirstMaximumPoint" value="0.275"/>
<managed_core_parameter id="ThrustCombatSpeedGraphSecondMaximumPoint" value="0.8"/>
<managed_core_parameter id="ThrustCombatSpeedGraphOneProgressValue" value="0.94"/>

Expand Down
6 changes: 0 additions & 6 deletions src/Module.Server/ModuleData/native_parameters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
<native_parameter id="minimum_anim_strength_for_chamber_block" value="0.01"/>
<native_parameter id="maximum_anim_strength_for_chamber_block" value="0.99"/>
<native_parameter id="lower_arc_when_defending_with_shield_horseback" value="-0.2" />
<native_parameter id="defend_speed_multiplier" value="20.2"/> <!-- Native = 3.2 -->
<native_parameter id="quick_release_skipped_progress" value="0"/> <!-- Native = 3.2 -->
<native_parameter id="release_skipped_progress_for_quick_ready" value="0"/> <!-- Native = 0.3 -->
<native_parameter id="ready_speed_multiplier" value="0.88"/> <!-- Native = 2.2 -->
<native_parameter id="running_backward_speed_multiplier" value="0.6" /> <!-- Native = 0.5 -->
<native_parameter id="running_sides_speed_multiplier" value="0.725" /> <!-- Native = 0.65-->
<native_parameter id="ladder_climb_up_speed_multiplier" value="0.88" /> <!-- Native = 0.68-->
<native_parameter id="humanoid_physics_capsule_radius_multiplier_for_friend" value="1.5" /> <!--Native = 0.95-->
<native_parameter id="humanoid_physics_capsule_radius_multiplier_for_enemy" value="1.85" /> <!--Native = 1.5-->
Expand Down
Loading