Last active
June 6, 2022 17:28
-
-
Save antonioeduardofernandes/bf962149a895aefa944089a41ab1b533 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//MODULES USED: HOTBAR USES & NARRATOR TOOLS | |
//HOTBAR USES - YOU'LL NEED TO CHANGE ACTORNAME AFTER EQUAL SIGN (NO SPACES) TO FIT YOUR FELLOWSHIP ACTOR | |
//HotbarUsesGeneric | |
//ActorName=PUT_HERE_YOUR_COMMUNITY_ACTOR_NAME | |
//Available=data.eyeAwareness.value | |
let currentEye = game.actors.getName("Comitiva").data.data.eyeAwareness.value // CURRENT VALUE OF THE EYE - (YOU NEED TO CHANGE FELLOWSHIP'S NAME TO FIT YOURS) | |
let maxEye = 18 // EYE LIMIT - CHANGE THIS VALUE IF THE MAP AREA IS DIFFERENT | |
let defaultEye = 2 // HARDCODED - CHANGE THIS VALUE ACCORDINGLY TO FIT YOUR PLAYERS CULTURE COMPOSITION | |
// If currentEye is one less than the limit, triggers the Hunt | |
if (currentEye === maxEye - 1) { | |
updateEyeAwareness(defaultEye) | |
await NarratorTools.chatMessage.narrate("A Consciência do Olho atingiu seu valor máximo") | |
} | |
else { | |
updateEyeAwareness(++currentEye) | |
await NarratorTools.chatMessage.narrate(`A Consciência do Olho aumentou para ${currentEye}`) | |
} | |
//data to update the value on the Fellowship Actor | |
async function updateEyeAwareness(value) { | |
let updatedValue = { | |
data: { | |
eyeAwareness: { | |
value: value | |
} | |
} | |
} | |
//updates data in the Actor (YOU NEED TO CHANGE FELLOWSHIP'S NAME TO FIT YOURS) | |
await game.actors.getName("Comitiva").update(updatedValue) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment