Skip to content

Commit

Permalink
Run prettier-standard --format and prettier-standard --lint on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
snap01 committed Jan 1, 2022
1 parent ecceb11 commit 93a4b51
Show file tree
Hide file tree
Showing 36 changed files with 2,342 additions and 2,242 deletions.
1 change: 0 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -879,5 +879,4 @@

"CoC7.getTheExample": "Copy Example",
"CoC7.Copied": "Copied the Example Text to Clipboard"

}
1,770 changes: 885 additions & 885 deletions lang/es.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"CoC7.OtherCosts": "Autres coûts",
"CoC7.CastingSpell": "Jette <i>{spell}</i>.",
"CoC7.NotEnoughMagicPoints": "{spell} coûte {originalMagicPoints} Points de Magie, vous n'en avez que {actorMagicPoints}. Vouslez-vous utiliser vos {convertedHitPoints} Points de Vie restants? Vous subirez {convertedHitPoints} points de dommage en le faisant.",

"CoC7.CopyToClipboard": "Copier vers le presse-papier",
"CoC7.WhisperToSelection": "Murmurer aux tokens sélectionnés",
"CoC7.WhisperTo": "Murmurer à",
Expand Down Expand Up @@ -874,7 +874,7 @@
"SETTINGS.CheckElevation": "Inclut l'altitude",
"SETTINGS.CheckElevationHint": "Utiliser l'altitude dans le calcul des distances en combat",
"CoC7.toolTipDelay": "Délai en millisecondes avant qu'une info-bulle apparaisse, 0 pour jamais",

"CoC7.getTheExample": "Copier l'Exemple",
"CoC7.Copied": "Texte de l'Exemple copié dans le presse-papier"
}
1,750 changes: 875 additions & 875 deletions lang/ko.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions lang/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@
"CoC7.Eras": "Cthulhu-varianter",
"CoC7.EraAvailability": "Tillgänglighet",


"CoC7.SkillNoAdjustments": "Ingen modifiering",
"CoC7.SkillNoXpGain": "Ingen erfarenhet",
"CoC7.SkillSpecial": "Specialicering",
Expand Down Expand Up @@ -673,7 +672,7 @@
"CoC7.WarnTooManyTarget": "För många mål valda. Behåller bara det senast valda målet",

"CoC7.allActors": "Alla karaktärer",
"CoC7.restTargets": "Vila valda mål",
"CoC7.restTargets": "Vila valda mål",
"CoC7.startRest": "Påbörja vila",
"CoC7.dreaming": "Utredaren väntar i drömmen",
"CoC7.healthRecovered": "Återfick en kroppspoäng",
Expand Down Expand Up @@ -720,7 +719,7 @@
"CoC7.English": "Engelska",
"CoC7.Spanish": "Spanska",
"CoC7.French": "Franska",
"CoC7.German": "Tyska",
"CoC7.German": "Tyska",
"CoC7.Polish": "Polska",
"CoC7.TraditionalChinese": "Traditionell kinesiska",
"CoC7.SelectSourceLanguage": "Välj ursprungstextens språk",
Expand Down Expand Up @@ -888,5 +887,4 @@

"CoC7.getTheExample": "Kopiera exempel",
"CoC7.Copied": "Kopierade exempeltexten till Urklipp"

}
44 changes: 21 additions & 23 deletions module/actors/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,15 @@ export class CoCActor extends Actor {
}
let boutDurationText = this.isInABoutOfMadness
? boutRealTime
? `${duration} ${game.i18n.localize('CoC7.rounds')}`
: `${duration} ${game.i18n.localize('CoC7.hours')}`
? `${duration} ${game.i18n.localize('CoC7.rounds')}`
: `${duration} ${game.i18n.localize('CoC7.hours')}`
: null
const insanityDurationText = insaneDuration
? this.isInsane
? indefiniteInstanity
? null
: `${insaneDuration} ${game.i18n.localize('CoC7.hours')}`
: null
? indefiniteInstanity
? null
: `${insaneDuration} ${game.i18n.localize('CoC7.hours')}`
: null
: null
if (this.isInsane && !insanityDurationText && !indefiniteInstanity) {
indefiniteInstanity = true
Expand All @@ -261,8 +261,8 @@ export class CoCActor extends Actor {
durationText: boutDurationText || '',
hint: this.isInABoutOfMadness
? `${game.i18n.localize('CoC7.BoutOfMadness')}${
boutDurationText ? ': ' + boutDurationText : ''
}`
boutDurationText ? ': ' + boutDurationText : ''
}`
: game.i18n.localize('CoC7.BoutOfMadness')
},
underlying: {
Expand All @@ -272,10 +272,10 @@ export class CoCActor extends Actor {
durationText: insanityDurationText || '',
hint: this.isInsane
? indefiniteInstanity
? game.i18n.localize('CoC7.IndefiniteInsanity')
: `${game.i18n.localize(
'CoC7.TemporaryInsanity'
)} ${insanityDurationText || ''}`
? game.i18n.localize('CoC7.IndefiniteInsanity')
: `${game.i18n.localize('CoC7.TemporaryInsanity')} ${
insanityDurationText || ''
}`
: game.i18n.localize('CoC7.NotInsane')
}
}
Expand Down Expand Up @@ -959,12 +959,10 @@ export class CoCActor extends Actor {
data.data.characteristics.list.luck.value = isNaN(this.luck)
? null
: this.luck
data.data.characteristics.list.luck.label = game.i18n.localize(
'CoC7.Luck'
)
data.data.characteristics.list.luck.shortName = game.i18n.localize(
'CoC7.Luck'
)
data.data.characteristics.list.luck.label =
game.i18n.localize('CoC7.Luck')
data.data.characteristics.list.luck.shortName =
game.i18n.localize('CoC7.Luck')

if (!data.data.characteristics.values) {
data.data.characteristics.values = {}
Expand Down Expand Up @@ -1031,11 +1029,10 @@ export class CoCActor extends Actor {
data.data.characteristics.values.pow
updateData['data.attribs.san.oneFifthSanity'] =
' / ' + Math.floor(data.data.characteristics.values.pow / 5)
updateData['data.indefiniteInsanityLevel.max'] = updateData[
'data.attribs.mp.value'
] = updateData['data.attribs.mp.max'] = Math.floor(
data.data.characteristics.values.pow / 5
)
updateData['data.indefiniteInsanityLevel.max'] =
updateData['data.attribs.mp.value'] =
updateData['data.attribs.mp.max'] =
Math.floor(data.data.characteristics.values.pow / 5)
}
await this.update(updateData)
await this.update({
Expand Down Expand Up @@ -3413,6 +3410,7 @@ export class CoCActor extends Actor {
let armorValue = 0
if (!options.ignoreArmor) {
if (armorData === null) {
// nop
} else if (CoC7Utilities.isFormula(armorData)) {
armorValue = (await new Roll(armorData).roll({ async: true })).total
} else if (!isNaN(Number(armorData))) {
Expand Down
143 changes: 69 additions & 74 deletions module/actors/sheets/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { OpposedCheckCard } from '../../chat/cards/opposed-roll.js'
import { CombinedCheckCard } from '../../chat/cards/combined-roll.js'
import { DamageCard } from '../../chat/cards/damage.js'
import { CoC7LinkCreationDialog } from '../../apps/link-creation-dialog.js'
import { testCard } from '../../chat/cards/test.js'
import { TestCard } from '../../chat/cards/test.js'

/**
* Extend the basic ActorSheet with some very simple modifications
Expand Down Expand Up @@ -340,32 +340,32 @@ export class CoC7ActorSheet extends ActorSheet {
a.data.properties.special &&
typeof a.data.specialization !== 'undefined'
? a.data.specialization
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase() +
a.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase() +
a.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
: a.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
lcb =
b.data.properties.special &&
typeof b.data.specialization !== 'undefined'
? b.data.specialization
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase() +
b.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase() +
b.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
: b.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
} else {
lca = a.name
.normalize('NFD')
Expand All @@ -389,30 +389,30 @@ export class CoC7ActorSheet extends ActorSheet {
if (a.data.properties && b.data.properties) {
lca = a.data.properties.special
? a.data.specialization
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase() +
a.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase() +
a.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
: a.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
lcb = b.data.properties.special
? b.data.specialization
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase() +
b.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase() +
b.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
: b.name
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
} else {
lca = a.name
.normalize('NFD')
Expand Down Expand Up @@ -882,7 +882,7 @@ export class CoC7ActorSheet extends ActorSheet {
.on('dragstart', event => CoC7Parser._onDragCoC7Link(event))

html.find('.test-trigger').click(async event => {
const test = new testCard({})
const test = new TestCard({})
test.toMessage()
// await OpposedCheckCard.dispatch({
// type: OpposedCheckCard.defaultConfig.type,
Expand Down Expand Up @@ -972,8 +972,8 @@ export class CoC7ActorSheet extends ActorSheet {
game.settings.get('CoC7', 'stanbyGMRolls') &&
sheet.actor.hasPlayerOwner
? game.i18n.format('CoC7.ToolTipKeeperStandbySkill', {
name: sheet.actor.name
})
name: sheet.actor.name
})
: ''
})
}
Expand Down Expand Up @@ -1009,8 +1009,8 @@ export class CoC7ActorSheet extends ActorSheet {
game.settings.get('CoC7', 'stanbyGMRolls') &&
sheet.actor.hasPlayerOwner
? game.i18n.format('CoC7.ToolTipKeeperStandbySkill', {
name: sheet.actor.name
})
name: sheet.actor.name
})
: ''
})
}
Expand Down Expand Up @@ -1049,8 +1049,8 @@ export class CoC7ActorSheet extends ActorSheet {
game.settings.get('CoC7', 'stanbyGMRolls') &&
sheet.actor.hasPlayerOwner
? game.i18n.format('CoC7.ToolTipKeeperStandbySkill', {
name: sheet.actor.name
})
name: sheet.actor.name
})
: ''
})
}
Expand All @@ -1076,8 +1076,8 @@ export class CoC7ActorSheet extends ActorSheet {
(game.settings.get('CoC7', 'stanbyGMRolls') &&
sheet.actor.hasPlayerOwner
? game.i18n.format('CoC7.ToolTipKeeperStandbySkill', {
name: sheet.actor.name
})
name: sheet.actor.name
})
: '')
})
}
Expand Down Expand Up @@ -1434,9 +1434,7 @@ export class CoC7ActorSheet extends ActorSheet {

_onInventoryHeader (event) {
event.preventDefault()
$(event.currentTarget)
.siblings('li')
.toggle()
$(event.currentTarget).siblings('li').toggle()
}

async _onItemPopup (event) {
Expand Down Expand Up @@ -1653,9 +1651,8 @@ export class CoC7ActorSheet extends ActorSheet {
event.currentTarget.parentElement.dataset.characteristic
roll.attribute = event.currentTarget.parentElement.dataset.attrib
roll.item = event.currentTarget.closest('.item')?.dataset.itemId
roll.weaponAltSkill = event.currentTarget.classList.contains(
'alternativ-skill'
)
roll.weaponAltSkill =
event.currentTarget.classList.contains('alternativ-skill')
roll.skillId = event.currentTarget.closest('.item')?.dataset.skillId
roll.rollMode = game.settings.get('core', 'rollMode')
roll.initiator = game.user.id
Expand Down Expand Up @@ -1793,19 +1790,19 @@ export class CoC7ActorSheet extends ActorSheet {
if (isCtrlKey(event) && game.user.isGM && ['lck', 'san'].includes(attrib)) {
const linkData = event.altKey
? {
check: 'sanloss',
hasPlayerOwner: this.actor.hasPlayerOwner,
actorKey: this.actor.actorKey,
forceModifiers: event.shiftKey
}
check: 'sanloss',
hasPlayerOwner: this.actor.hasPlayerOwner,
actorKey: this.actor.actorKey,
forceModifiers: event.shiftKey
}
: {
check: 'check',
type: 'attribute',
name: attrib,
hasPlayerOwner: this.actor.hasPlayerOwner,
actorKey: this.actor.actorKey,
forceModifiers: event.shiftKey
}
check: 'check',
type: 'attribute',
name: attrib,
hasPlayerOwner: this.actor.hasPlayerOwner,
actorKey: this.actor.actorKey,
forceModifiers: event.shiftKey
}
if (game.settings.get('core', 'rollMode') === 'blindroll') {
linkData.blind = true
}
Expand Down Expand Up @@ -2096,9 +2093,8 @@ export class CoC7ActorSheet extends ActorSheet {
value: event.currentTarget.value
})
)
formData[event.currentTarget.name] = game.i18n.format(
'CoC7.ErrorInvalid'
)
formData[event.currentTarget.name] =
game.i18n.format('CoC7.ErrorInvalid')
}
}
}
Expand All @@ -2118,9 +2114,8 @@ export class CoC7ActorSheet extends ActorSheet {
value: event.currentTarget.value
})
)
formData[event.currentTarget.name] = game.i18n.format(
'CoC7.ErrorInvalid'
)
formData[event.currentTarget.name] =
game.i18n.format('CoC7.ErrorInvalid')
}
}
}
Expand Down
Loading

0 comments on commit 93a4b51

Please sign in to comment.