forked from phenom/healer-man
Release Healer Man 0.1.55
This commit is contained in:
1 parent
2dbb0acfc1
commit
38b3d4d160
14 files changed
+279
-41
No files matched your search
+64
-22
@@ -5286,12 +5286,29 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
for (const recipientId of recipients) {
|
||||
const previousAuras = work.auras;
|
||||
if (effect.control && work.mobs[recipientId]?.characterDefender && work.mobs[recipientId].mechanicImmunities.includes(effect.control.kind as AzerothCoreMechanic)) continue;
|
||||
work.auras = [...applyCombatAura(previousAuras, {
|
||||
const auraResult = applyCombatAura(previousAuras, {
|
||||
definition: auraDefinition,
|
||||
sourceId: PLAYER_AURA_ENTITY_ID,
|
||||
targetId: recipientId,
|
||||
now,
|
||||
}).auras];
|
||||
});
|
||||
work.auras = [...auraResult.auras];
|
||||
const grantedAbsorb = auraResult.aura.absorbs.reduce((total, absorb) => total + absorb.remaining, 0);
|
||||
if (grantedAbsorb > 0) {
|
||||
recordCombatEventInWork(work, {
|
||||
occurredAt: now,
|
||||
kind: "absorb",
|
||||
sourceActorId: PLAYER_AURA_ENTITY_ID,
|
||||
targetActorId: recipientId,
|
||||
abilityId: ability.id,
|
||||
school: presentationSchoolForAbility(ability),
|
||||
rawAmount: grantedAbsorb,
|
||||
effectiveAmount: grantedAbsorb,
|
||||
overheal: 0,
|
||||
absorbed: grantedAbsorb,
|
||||
critical: false,
|
||||
});
|
||||
}
|
||||
applyAuraHealthTransitionInWork(work, recipientId, previousAuras, work.auras);
|
||||
if (auraDefinition.controlImmunities?.length) {
|
||||
if (
|
||||
@@ -6278,6 +6295,7 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
targetId: targetActorId,
|
||||
now,
|
||||
});
|
||||
const grantedAbsorb = result.aura.absorbs.reduce((total, absorb) => total + absorb.remaining, 0);
|
||||
let health = state.health;
|
||||
let maxHealth = state.maxHealth;
|
||||
const actors = { ...state.actors };
|
||||
@@ -6316,24 +6334,40 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
}
|
||||
}
|
||||
}
|
||||
let combatEvents = recordCombatEvent(state.combatEvents, {
|
||||
occurredAt: now,
|
||||
kind: "aura",
|
||||
sourceActorId,
|
||||
targetActorId,
|
||||
abilityId: ability.id,
|
||||
school: presentationSchoolForAbility(ability),
|
||||
rawAmount: 0,
|
||||
effectiveAmount: 1,
|
||||
overheal: 0,
|
||||
absorbed: 0,
|
||||
critical: false,
|
||||
});
|
||||
if (grantedAbsorb > 0) {
|
||||
combatEvents = recordCombatEvent(combatEvents, {
|
||||
occurredAt: now,
|
||||
kind: "absorb",
|
||||
sourceActorId,
|
||||
targetActorId,
|
||||
abilityId: ability.id,
|
||||
school: presentationSchoolForAbility(ability),
|
||||
rawAmount: grantedAbsorb,
|
||||
effectiveAmount: grantedAbsorb,
|
||||
overheal: 0,
|
||||
absorbed: grantedAbsorb,
|
||||
critical: false,
|
||||
});
|
||||
}
|
||||
set({
|
||||
auras: result.auras,
|
||||
health,
|
||||
maxHealth,
|
||||
actors,
|
||||
combatEvents: recordCombatEvent(state.combatEvents, {
|
||||
occurredAt: now,
|
||||
kind: "aura",
|
||||
sourceActorId,
|
||||
targetActorId,
|
||||
abilityId: ability.id,
|
||||
school: presentationSchoolForAbility(ability),
|
||||
rawAmount: 0,
|
||||
effectiveAmount: 1,
|
||||
overheal: 0,
|
||||
absorbed: 0,
|
||||
critical: false,
|
||||
}),
|
||||
combatEvents,
|
||||
});
|
||||
if (companionActor) mirrorCompanionActor(companionActor);
|
||||
return true;
|
||||
@@ -8330,13 +8364,13 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
if (
|
||||
summon.health <= 0
|
||||
|| summon.controlledUntil > now
|
||||
|| summon.nextActionAt > now
|
||||
|| summon.globalCooldownEndsAt > now
|
||||
|| summon.cast
|
||||
|| summon.attackDamage <= 0
|
||||
) return summon;
|
||||
const readyToAct = summon.nextActionAt <= now && summon.globalCooldownEndsAt <= now;
|
||||
const summonAbility = abilityById(summon.sourceAbilityId);
|
||||
if (summon.kind === "totem" && summonAbility?.effects.some((effect) => effect.kind === "heal" || effect.kind === "hot")) {
|
||||
if (!readyToAct) return summon;
|
||||
const partyMembers = usePartyStore.getState().members;
|
||||
const injured = [
|
||||
{ id: PLAYER_AURA_ENTITY_ID, health: work.health, maxHealth: work.maxHealth, position: state.playerPosition },
|
||||
@@ -8374,12 +8408,14 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
}
|
||||
return { ...summon, nextActionAt: now + Math.max(500, summon.pulseIntervalMs) };
|
||||
}
|
||||
const targetId = summon.targetId && !work.mobs[summon.targetId]?.dead
|
||||
const targetId = summon.targetId && work.mobs[summon.targetId] && !work.mobs[summon.targetId].dead
|
||||
? summon.targetId
|
||||
: state.selectedTargetId && !work.mobs[state.selectedTargetId]?.dead
|
||||
: state.selectedTargetId && work.mobs[state.selectedTargetId] && !work.mobs[state.selectedTargetId].dead
|
||||
? state.selectedTargetId
|
||||
: Object.values(work.mobs).find((mob) => mob.engaged && !mob.dead)?.id ?? null;
|
||||
if (!targetId) return { ...summon, nextActionAt: now + Math.max(500, summon.pulseIntervalMs) };
|
||||
if (!targetId) return readyToAct
|
||||
? { ...summon, nextActionAt: now + Math.max(500, summon.pulseIntervalMs) }
|
||||
: summon;
|
||||
const targetPosition = getMobPosition(targetId);
|
||||
let position = summon.position;
|
||||
if (targetPosition) {
|
||||
@@ -8392,7 +8428,8 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
position = projectCombatGroundPoint(requested, step, position) ?? position;
|
||||
}
|
||||
if (
|
||||
Math.sqrt(distanceSquared(position, targetPosition)) <= (summon.kind === "totem" ? 30 : 5)
|
||||
readyToAct
|
||||
&& Math.sqrt(distanceSquared(position, targetPosition)) <= (summon.kind === "totem" ? 30 : 5)
|
||||
&& combatHasLineOfSight(position, targetPosition)
|
||||
) {
|
||||
damageMobInWork(
|
||||
@@ -8406,7 +8443,12 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
);
|
||||
}
|
||||
}
|
||||
return { ...summon, targetId, position, nextActionAt: now + Math.max(500, summon.pulseIntervalMs) };
|
||||
return {
|
||||
...summon,
|
||||
targetId,
|
||||
position,
|
||||
nextActionAt: readyToAct ? now + Math.max(500, summon.pulseIntervalMs) : summon.nextActionAt,
|
||||
};
|
||||
});
|
||||
|
||||
for (const [id, mob] of Object.entries(work.mobs)) {
|
||||
|
||||
Reference in new issue
Block a user