forked from phenom/healer-man
Update Healer Man server
This commit is contained in:
1 parent
6cc1b9217f
commit
6114a2295f
67 files changed
+6241
-347
No files matched your search
@@ -112,6 +112,14 @@ import {
|
||||
romWarlockMageSoulBrandEffects,
|
||||
} from "./romWarlockMageSoulBrand";
|
||||
import { ROM_WARLOCK_PRIEST_SPREADING_PAIN_CRIT_TAG } from "./romWarlockPriestSpreadingPain";
|
||||
import {
|
||||
hasOwnedRomScoutBloodArrow,
|
||||
isRomBloodArrowOwner,
|
||||
isRomScoutRogueBloodArrowOwner,
|
||||
isRomScoutBloodArrowAbility,
|
||||
ROM_SCOUT_BLOOD_ARROW_AURA_TAG,
|
||||
romScoutRogueBloodArrowRangedAutoAttackCost,
|
||||
} from "./romBloodArrow";
|
||||
import {
|
||||
ROM_ROGUE_POISON_AURA_TAG,
|
||||
ROM_ROGUE_POISON_ATTACK_SPEED_TAG,
|
||||
@@ -2319,6 +2327,21 @@ function advancePartyWeaponAttack(member: PartyMember, targetId: string, now: nu
|
||||
}
|
||||
if (now < (nextWeaponAttackAt.get(member.id) ?? 0)) return member;
|
||||
nextWeaponAttackAt.set(member.id, now + memberSwingMs(member, now));
|
||||
const scoutRogueRangedAutoAttack = isRomScoutRogueBloodArrowOwner(member)
|
||||
&& partyUsesRangedAttacks(member);
|
||||
const bloodArrowAutoAttackCost = scoutRogueRangedAutoAttack
|
||||
? romScoutRogueBloodArrowRangedAutoAttackCost(
|
||||
member,
|
||||
useCombatStore.getState().auras,
|
||||
member.id,
|
||||
member.maxHealth,
|
||||
now,
|
||||
)
|
||||
: 0;
|
||||
if (bloodArrowAutoAttackCost > 0 && member.health <= bloodArrowAutoAttackCost) return member;
|
||||
if (bloodArrowAutoAttackCost > 0) {
|
||||
member = { ...member, health: member.health - bloodArrowAutoAttackCost };
|
||||
}
|
||||
const abilityId = "party-auto-attack";
|
||||
const scentRank = member.classId === "death-knight"
|
||||
? member.talentRanks[WOW335_DEATH_KNIGHT_SCENT_OF_BLOOD_TALENT_ID] ?? 0
|
||||
@@ -2351,7 +2374,20 @@ function advancePartyWeaponAttack(member: PartyMember, targetId: string, now: nu
|
||||
? "rom-rogue-dual-wield-main-hand"
|
||||
: forgeAutoAttackActive ? "rom-champion-forge-auto-attack" : "scent-of-blood-auto-attack"}`;
|
||||
useCombatStore.getState().notifyOwnerHostileAction(member.id, targetId);
|
||||
const ownerAttackDamage = partyAttackDamage(member, now);
|
||||
const baseOwnerAttackDamage = partyAttackDamage(member, now);
|
||||
const bloodArrowRangedAuras = scoutRogueRangedAutoAttack
|
||||
? activeAuras.filter((aura) => aura.sourceId === member.id
|
||||
&& aura.targetId === member.id
|
||||
&& (aura.expiresAt === null || aura.expiresAt > now)
|
||||
&& aura.definition.utilityTags?.includes(ROM_SCOUT_BLOOD_ARROW_AURA_TAG))
|
||||
: [];
|
||||
const ownerAttackDamage = bloodArrowRangedAuras.length > 0
|
||||
? Math.max(1, Math.round(resolveAuraDamageValue(baseOwnerAttackDamage, bloodArrowRangedAuras, {
|
||||
direction: "dealt",
|
||||
school: "physical",
|
||||
attackKind: "ranged",
|
||||
})))
|
||||
: baseOwnerAttackDamage;
|
||||
const result = useCombatStore.getState().damageMob(targetId, ownerAttackDamage, now,
|
||||
{ actorId: member.id, role: member.role, abilityId }, "physical", needsAttackRoll ? {
|
||||
attackKind: goForTheThroatRank > 0 ? "ranged" : "melee",
|
||||
@@ -5166,8 +5202,12 @@ export function advanceDungeonPartyCombat(now = Date.now()): void {
|
||||
if (member.activeCast) {
|
||||
const activeCast = member.activeCast;
|
||||
const catalogAbility = abilityById(member.activeCast.abilityId);
|
||||
const castingAbility = catalogAbility
|
||||
? learnedAbilityForBuild(catalogAbility, member.level, member.talentRanks)
|
||||
const ownerAbility = catalogAbility && isRomScoutBloodArrowAbility(catalogAbility)
|
||||
? abilitiesForCharacter(member.classId, member.secondaryClassId)
|
||||
.find((ability) => ability.id === catalogAbility.id) ?? catalogAbility
|
||||
: catalogAbility;
|
||||
const castingAbility = ownerAbility
|
||||
? learnedAbilityForBuild(ownerAbility, member.level, member.talentRanks)
|
||||
: null;
|
||||
const castTargetId = member.activeCastTargetId;
|
||||
if (!castingAbility || !castTargetId) {
|
||||
@@ -5574,15 +5614,27 @@ export function advanceDungeonPartyCombat(now = Date.now()): void {
|
||||
&& aura.definition.id === effect.aura.id && aura.targetId === abilityTargetId));
|
||||
},
|
||||
});
|
||||
const selectedAbility = selectedDecision?.ability ?? null;
|
||||
const bloodArrowAbility = isRomBloodArrowOwner(runtimeMember)
|
||||
? abilitiesForCharacter(runtimeMember.classId, runtimeMember.secondaryClassId)
|
||||
.find(isRomScoutBloodArrowAbility) ?? null
|
||||
: null;
|
||||
const shouldActivateBloodArrow = Boolean(bloodArrowAbility
|
||||
&& !hasOwnedRomScoutBloodArrow(currentCombat.auras, runtimeMember.id, now)
|
||||
&& partyAbilityIsReady(runtimeMember, bloodArrowAbility, now)
|
||||
&& partyAbilityTargetIsValid(runtimeMember, bloodArrowAbility, runtimeMember.id, undefined, now));
|
||||
const selectedAbility = shouldActivateBloodArrow
|
||||
? bloodArrowAbility
|
||||
: selectedDecision?.ability ?? null;
|
||||
if (!selectedAbility) {
|
||||
const inAttackRange = targetVisible && targetPosition
|
||||
&& distanceSquared(memberPosition, targetPosition) <= partyAttackRange(member) ** 2;
|
||||
nextMembers[index] = { ...runtimeMember, status: inAttackRange ? desiredStatus : "advancing", nextActionAt: now + 250 };
|
||||
continue;
|
||||
}
|
||||
const abilityTargetId = selectedDecision?.targetId
|
||||
?? (selectedAbility.target === "self" || selectedAbility.target === "friendly" ? member.id : memberTargetId);
|
||||
const abilityTargetId = shouldActivateBloodArrow
|
||||
? member.id
|
||||
: selectedDecision?.targetId
|
||||
?? (selectedAbility.target === "self" || selectedAbility.target === "friendly" ? member.id : memberTargetId);
|
||||
const inRange = (selectedAbility.target === "self" || targetVisible)
|
||||
&& partyAbilityTargetIsValid(runtimeMember, selectedAbility, abilityTargetId, undefined, now);
|
||||
if (!inRange) {
|
||||
|
||||
Reference in new issue
Block a user