feat(throwing): wire SA loot flavor via IsStygian (Ter Mur)
Complete the SA-loot path Joe's original PR left dead: add SAWeaponTypes / SARangedWeaponTypes pools + isStygian branches to Loot.RandomWeapon / RandomRangedWeapon, and — the piece that was missing — compute IsStygian (map == Map.TerMur) in LootPackEntry.Construct and thread it through LootPackItem.Construct. Creatures in Ter Mur now roll SA gear + the three throwing weapons (Boomerang/Cyclone/SoulGlaive) from their normal BaseWeapon/BaseRanged loot entries. Conservative IsStygian: Ter Mur map only (not ServUO's extra `|| RandomBool()` that would sprinkle SA gear everywhere). Server (UOContent.csproj) builds clean; full test verification is blocked by an unrelated pre-existing break in the OPL PropertyList tests on main (PR #2501). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e42a62b1d3
commit
350d8fffdc
2 changed files with 32 additions and 6 deletions
|
|
@ -6,6 +6,17 @@ namespace Server
|
|||
{
|
||||
public static class Loot
|
||||
{
|
||||
public static Type[] SAWeaponTypes { get; } =
|
||||
{
|
||||
typeof(DiscMace), typeof(GargishTalwar), typeof(DualPointedSpear),
|
||||
typeof(GlassStaff), typeof(DualShortAxes), typeof(GlassSword)
|
||||
};
|
||||
|
||||
public static Type[] SARangedWeaponTypes { get; } =
|
||||
{
|
||||
typeof(Boomerang), typeof(Cyclone), typeof(SoulGlaive)
|
||||
};
|
||||
|
||||
public static Type[] MLWeaponTypes { get; } =
|
||||
{
|
||||
typeof(AssassinSpike), typeof(DiamondMace), typeof(ElvenMachete),
|
||||
|
|
@ -374,12 +385,18 @@ namespace Server
|
|||
return Construct<BaseClothing>(ClothingTypes);
|
||||
}
|
||||
|
||||
private static readonly Type[][] _saRangedWeaponTypes = [SARangedWeaponTypes, AosRangedWeaponTypes, RangedWeaponTypes];
|
||||
private static readonly Type[][] _mlRangedWeaponTypes = [MLRangedWeaponTypes, AosRangedWeaponTypes, RangedWeaponTypes];
|
||||
private static readonly Type[][] _seRangedWeaponTypes = [SERangedWeaponTypes, AosRangedWeaponTypes, RangedWeaponTypes];
|
||||
private static readonly Type[][] _aosRangedWeaponTypes = [AosRangedWeaponTypes, RangedWeaponTypes];
|
||||
|
||||
public static BaseWeapon RandomRangedWeapon(bool inTokuno = false, bool isMondain = false)
|
||||
public static BaseWeapon RandomRangedWeapon(bool inTokuno = false, bool isMondain = false, bool isStygian = false)
|
||||
{
|
||||
if (Core.SA && isStygian)
|
||||
{
|
||||
return Construct<BaseWeapon>(_saRangedWeaponTypes);
|
||||
}
|
||||
|
||||
if (Core.ML && isMondain)
|
||||
{
|
||||
return Construct<BaseWeapon>(_mlRangedWeaponTypes);
|
||||
|
|
@ -398,12 +415,18 @@ namespace Server
|
|||
return Construct<BaseWeapon>(RangedWeaponTypes);
|
||||
}
|
||||
|
||||
private static readonly Type[][] _saWeaponTypes = [SAWeaponTypes, AosWeaponTypes, WeaponTypes];
|
||||
private static readonly Type[][] _mlWeaponTypes = [MLWeaponTypes, AosWeaponTypes, WeaponTypes];
|
||||
private static readonly Type[][] _seWeaponTypes = [SEWeaponTypes, AosWeaponTypes, WeaponTypes];
|
||||
private static readonly Type[][] _aosWeaponTypes = [AosWeaponTypes, WeaponTypes];
|
||||
|
||||
public static BaseWeapon RandomWeapon(bool inTokuno = false, bool isMondain = false)
|
||||
public static BaseWeapon RandomWeapon(bool inTokuno = false, bool isMondain = false, bool isStygian = false)
|
||||
{
|
||||
if (Core.SA && isStygian)
|
||||
{
|
||||
return Construct<BaseWeapon>(_saWeaponTypes);
|
||||
}
|
||||
|
||||
if (Core.ML && isMondain)
|
||||
{
|
||||
return Construct<BaseWeapon>(_mlWeaponTypes);
|
||||
|
|
|
|||
|
|
@ -619,6 +619,9 @@ namespace Server
|
|||
|
||||
private static bool IsMondain(Mobile m) => MondainsLegacy.IsMLRegion(m.Region);
|
||||
|
||||
// Stygian Abyss loot flavor: creatures in Ter Mur draw from the SA gear pools.
|
||||
private static bool IsStygian(Mobile m) => m.Map == Map.TerMur;
|
||||
|
||||
public Item Construct(Mobile from, int luckChance, bool spawning)
|
||||
{
|
||||
if (m_AtSpawnTime != spawning)
|
||||
|
|
@ -641,7 +644,7 @@ namespace Server
|
|||
|
||||
if (rnd < item.Chance)
|
||||
{
|
||||
return Mutate(from, luckChance, item.Construct(IsInTokuno(from), IsMondain(from)));
|
||||
return Mutate(from, luckChance, item.Construct(IsInTokuno(from), IsMondain(from), IsStygian(from)));
|
||||
}
|
||||
|
||||
rnd -= item.Chance;
|
||||
|
|
@ -970,18 +973,18 @@ namespace Server
|
|||
return Loot.RandomScroll(minCircle * 8, maxCircle * 8 + 7, SpellbookType.Regular);
|
||||
}
|
||||
|
||||
public Item Construct(bool inTokuno, bool isMondain)
|
||||
public Item Construct(bool inTokuno, bool isMondain, bool isStygian)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Type == typeof(BaseRanged))
|
||||
{
|
||||
return Loot.RandomRangedWeapon(inTokuno, isMondain);
|
||||
return Loot.RandomRangedWeapon(inTokuno, isMondain, isStygian);
|
||||
}
|
||||
|
||||
if (Type == typeof(BaseWeapon))
|
||||
{
|
||||
return Loot.RandomWeapon(inTokuno, isMondain);
|
||||
return Loot.RandomWeapon(inTokuno, isMondain, isStygian);
|
||||
}
|
||||
|
||||
if (Type == typeof(BaseArmor))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue