feat(throwing): core gargoyle Throwing skill (SA) (#2510)
Supersedes #2376 (@jwvalentine). This is a reviewed, corrected, and scoped-down **Phase 1** of Joe Valentine's throwing implementation — his original commits are cherry-picked here with authorship preserved, plus a fix/scoping pass. Phase 1 lands only the **core gargoyle Throwing skill**; the incomplete content is excised for follow-up PRs (see below). ## What's included (core skill) - `BaseThrown` combat mechanics on top of the existing skeleton: close-quarters penalty, below-min-range penalty, shield penalty, STR-scaled range, overthrow damage penalty. - Base weapons: **Boomerang, Cyclone, SoulGlaive** (gargoyle-only), + blacksmith crafting (SA-gated). - Two symmetric hooks on `BaseWeapon` (`ModifyHitChance`, new `ModifyDamage`) that are inert no-ops for every other weapon. ## Fixes over the original - **Overthrow damage**: was dead code (the swing gate already guarantees you're within `MaxRange`, so the old `ComputeDamage` check never fired). Reimplemented as `finalDamage × 0.53` applied *after* all offensive bonuses via a new `ModifyDamage` hook, firing at the outer range ring. - **`DefMaxRange`**: clamped to `[MinThrowRange, MaxThrowRange]` (uncapped before → e.g. range 13 at 200 Str) and guarded against a latent divide-by-zero. - **Close-quarters mitigation** now uses `RawDex` (matches ServUO/OSI; deterministic under stat mods). - **Return-throw timer** guarded against a deleted/unmapped thrower/target. - Reverted the `MovingShot` change (it rebalanced archery — belongs in a separate PR). - Kept only complex-logic tests (hit-chance/range/damage math); dropped property-value assertions. ## Excised for follow-up PRs (Phase 2/3) 7 named artifacts, the Into-the-Void quest + Agralem, GargishOutcast, the Bladeweaver vendor, and the SA loot tables — these were unwired/non-functional (loot never triggered, quest/creature never spawned) and will return properly wired. `StormCaller` also needs its missing Battle Lust, and the quest its correct void-creature target. ## Verification - Build: 0 warnings / 0 errors. - `UOContent.Tests`: **501/501** passing (the `ModifyDamage` hook causes zero regressions across all weapons). - Full whole-branch review completed: no must-fix defects.
This commit is contained in:
parent
d7668df5ee
commit
0bfbdd0764
7 changed files with 497 additions and 8 deletions
|
|
@ -1357,6 +1357,8 @@ public abstract partial class BaseWeapon
|
|||
|
||||
var chance = ourValue / (theirValue * 2.0) * 1.0 + (double)bonus / 100;
|
||||
|
||||
chance = ModifyHitChance(attacker, defender, chance);
|
||||
|
||||
if (Core.AOS && chance < 0.02)
|
||||
{
|
||||
chance = 0.02;
|
||||
|
|
@ -1365,6 +1367,19 @@ public abstract partial class BaseWeapon
|
|||
return attacker.CheckSkill(atkSkill.SkillName, chance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows subclasses to modify the final hit chance before the dice roll.
|
||||
/// Called after all standard AOS bonuses are applied but before the 2% floor.
|
||||
/// Supports both additive adjustments (chance -= 0.12) and multiplicative ones (chance *= scalar).
|
||||
/// </summary>
|
||||
protected virtual double ModifyHitChance(Mobile attacker, Mobile defender, double chance) => chance;
|
||||
|
||||
/// <summary>
|
||||
/// Allows subclasses to modify the final post-bonus damage (e.g. range-based penalties)
|
||||
/// before defender mitigation is applied. Mirrors <see cref="ModifyHitChance" />.
|
||||
/// </summary>
|
||||
protected virtual int ModifyDamage(Mobile attacker, Mobile defender, int damage) => damage;
|
||||
|
||||
public virtual TimeSpan GetDelay(Mobile m)
|
||||
{
|
||||
double speed = Speed;
|
||||
|
|
@ -1874,6 +1889,7 @@ public abstract partial class BaseWeapon
|
|||
percentageBonus = Math.Min(percentageBonus, 300);
|
||||
|
||||
damage = AOS.Scale(damage, 100 + percentageBonus);
|
||||
damage = ModifyDamage(attacker, defender, damage);
|
||||
|
||||
var defLoc = new WorldLocation(defender);
|
||||
var bcAtt = attacker as BaseCreature;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue