Skip to content

Commit

Permalink
docs: update documentation to use player objects (#5907)
Browse files Browse the repository at this point in the history
Followup to #5861.
  • Loading branch information
quisquous authored Nov 5, 2023
1 parent 5672f89 commit 3b7f09a
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 45 deletions.
22 changes: 12 additions & 10 deletions docs/CactbotCustomization.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,18 @@ Options.Triggers.push({
// or I am not a tank.
return true;
},
infoText: function(data, matches) {
let name = data.ShortName(matches.source);
return {
en: 'Provoke: ' + name,
de: 'Herausforderung: ' + name,
fr: 'Provocation: ' + name,
ja: '挑発: ' + name,
cn: '挑衅: ' + name,
ko: '도발: ' + name,
};
infoText: (data, matches, output) => {
return output.text!({ player: data.party.member(matches.source) });
},
outputStrings: {
text: {
en: 'Provoke: ${player}',
de: 'Herausforderung: ${player}',
fr: 'Provocation: ${player}',
ja: '挑発: ${player}',
cn: '挑衅: ${player}',
ko: '도발: ${player}',
},
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion docs/OopsyraidsyGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ Current hp/mp/tp values are not 100% precise. ACT polls these values periodical
* `data.job`: string, the player's job, e.g. WAR.
* `data.role`: string, the role of the player's job: tank, healer, dps-melee, dps-ranged, dps-caster, crafting, gathering.
* `data.inCombat`: bool, whether or not the game thinks the player is in combat. This is different than whether ACT thinks the player is in combat.
* `data.ShortName`: helper function to turn full player names into shorter names or nicknames.
* `data.IsPlayerId`: helper function to check if a target or attacker id represents a player (vs a pet or a mob).
* `data.party`: the PartyTracker object, you can use this to check names and roles of players in the party, or to call `data.party.member(name).toString()` to get a shorter nickname or job name.

`data` is something that triggers can and should store state on, if state is needed to be tracked across multiple triggers.

Expand Down
2 changes: 1 addition & 1 deletion docs/RaidbossGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ A simple example using `outputStrings` and `Outputs` as below:
return output.tankSwap();

if (data.role === 'healer')
return output.tankBusters({ player: data.ShortName(matches.target) });
return output.tankBusters({ player: data.party.member(matches.target) });
},
infoText: function(data, _matches, output) {
if (data.role !== 'tank' && data.role !== 'healer')
Expand Down
22 changes: 12 additions & 10 deletions docs/ko-KR/CactbotCustomization.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,18 @@ Options.Triggers.push({
// 내가 탱커가 아닌 경우
return true;
},
infoText: function(data, matches) {
let name = data.ShortName(matches.source);
return {
en: 'Provoke: ' + name,
de: 'Herausforderung: ' + name,
fr: 'Provocation: ' + name,
ja: '挑発: ' + name,
cn: '挑衅: ' + name,
ko: '도발: ' + name,
};
infoText: (data, matches, output) => {
return output.text!({ player: data.party.member(matches.source) });
},
outputStrings: {
text: {
en: 'Provoke: ${player}',
de: 'Herausforderung: ${player}',
fr: 'Provocation: ${player}',
ja: '挑発: ${player}',
cn: '挑衅: ${player}',
ko: '도발: ${player}',
},
},
},
],
Expand Down
22 changes: 12 additions & 10 deletions docs/zh-CN/CactbotCustomization.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,18 @@ Options.Triggers.push({
// 也不管我是不是坦克。
return true;
},
infoText: function(data, matches) {
let name = data.ShortName(matches.source);
return {
en: 'Provoke: ' + name,
de: 'Herausforderung: ' + name,
fr: 'Provocation: ' + name,
ja: '挑発: ' + name,
cn: '挑衅: ' + name,
ko: '도발: ' + name,
};
infoText: (data, matches, output) => {
return output.text!({ player: data.party.member(matches.source) });
},
outputStrings: {
text: {
en: 'Provoke: ${player}',
de: 'Herausforderung: ${player}',
fr: 'Provocation: ${player}',
ja: '挑発: ${player}',
cn: '挑衅: ${player}',
ko: '도발: ${player}',
},
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/RaidbossGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ comment: {
return output.tankSwap();

if (data.role === 'healer')
return output.tankBusters({ player: data.ShortName(matches.target) });
return output.tankBusters({ player: data.party.member(matches.target) });
},
infoText: function(data, _matches, output) {
if (data.role !== 'tank' && data.role !== 'healer')
Expand Down
22 changes: 12 additions & 10 deletions docs/zh-TW/CactbotCustomization.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,18 @@ Options.Triggers.push({
// 即便我不是坦克。
return true;
},
infoText: function(data, matches) {
let name = data.ShortName(matches.source);
return {
en: 'Provoke: ' + name,
de: 'Herausforderung: ' + name,
fr: 'Provocation: ' + name,
ja: '挑発: ' + name,
cn: '挑衅: ' + name,
ko: '도발: ' + name,
};
infoText: (data, matches, output) => {
return output.text!({ player: data.party.member(matches.source) });
},
outputStrings: {
text: {
en: 'Provoke: ${player}',
de: 'Herausforderung: ${player}',
fr: 'Provocation: ${player}',
ja: '挑発: ${player}',
cn: '挑衅: ${player}',
ko: '도발: ${player}',
},
},
},
],
Expand Down
5 changes: 3 additions & 2 deletions ui/raidboss/data/00-misc/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ const triggerSet: TriggerSet<Data> = {
return false;
return caresAboutTankStuff(data);
},
infoText: (data, matches, output) =>
output.text!({ player: data.party.member(matches.source) }),
infoText: (data, matches, output) => {
return output.text!({ player: data.party.member(matches.source) });
},
outputStrings: {
text: {
en: 'Provoke: ${player}',
Expand Down

0 comments on commit 3b7f09a

Please sign in to comment.