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

util: improve empty-name actor logic in make_timeline #19

Merged
merged 2 commits into from
Dec 28, 2023
Merged
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
30 changes: 24 additions & 6 deletions util/logtools/make_timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,26 @@ const extractTLEntriesFromLog = (
const ignoreTimelineAbilityEntry = (entry: TimelineEntry, args: ExtendedArgs): boolean => {
const abilityName = entry.abilityName;
const abilityId = entry.abilityId;
const combatant = entry.combatant;
const combatant = entry.combatant ?? '';

// Ignore auto-attacks named "attack"
if (abilityName?.toLowerCase() === 'attack')
return true;

// Ignore abilities from NPC allies.
if (combatant !== undefined && ignoredCombatants.includes(combatant))
// If a no-name combatant, we will ignore only if its also an unnamed ability, as
// a named ability has more potential for being relevant to timeline/trigger creation.
// Unnamed (e.g. 'unknown_*') abilities have been converted to '--sync--' at this point.
if (ignoredCombatants.includes(combatant) && combatant !== '')
return true;
if (combatant === '') {
if (
abilityName === undefined ||
abilityName === '' ||
abilityName?.toLowerCase().includes('--sync--')
)
return true;
}

// Ignore abilities by name.
if (abilityName !== undefined && args.ignore_ability?.includes(abilityName))
Expand All @@ -340,11 +351,11 @@ const ignoreTimelineAbilityEntry = (entry: TimelineEntry, args: ExtendedArgs): b
return true;

// Ignore combatants by name
if (combatant !== undefined && args.ignore_combatant?.includes(combatant))
if (args.ignore_combatant?.includes(combatant))
return true;

// If only-combatants was specified, ignore all combatants not in the list.
if (combatant !== undefined && args.only_combatant && !args.only_combatant?.includes(combatant))
if (args.only_combatant && !args.only_combatant?.includes(combatant))
return true;
return false;
};
Expand Down Expand Up @@ -427,8 +438,15 @@ const assembleTimelineStrings = (
const name = entry.abilityName;
if (id !== undefined && name !== undefined && encounterAbilityList[id] === undefined) {
// We want all enemy abilities *except* from the specific NPCs in the curated ignore list.
const combatant = entry.combatant;
if (combatant !== undefined && !ignoredCombatants.includes(combatant))
//
// For most purposes, we ignore ability lines where the combatant name is empty.
// But when building a timeline, we want to include named abilities
// used by no-name combatants, given the increased likelihood they may be relevant.
// Unnamed (e.g. 'unknown_*') abilities have been converted to '--sync--' at this point.
const combatant = entry.combatant ?? '';
if (!ignoredCombatants.includes(combatant))
encounterAbilityList[id] = name;
else if (combatant === '' && name !== '' && !name.toLowerCase().includes('--sync--'))
encounterAbilityList[id] = name;
}

Expand Down