Fix #24 : Add SAN rolls
This commit is contained in:
@ -207,6 +207,11 @@ export default class CthulhuEternalProtagonistSheet extends CthulhuEternalActorS
|
||||
li = $(event.currentTarget).parents(".item");
|
||||
item = this.actor.items.get(li.data("item-id"));
|
||||
break
|
||||
case "san":
|
||||
item = foundry.utils.duplicate(this.actor.system.san)
|
||||
item.name = game.i18n.localize("CTHULHUETERNAL.Label.SAN")
|
||||
item.targetScore = item.value
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unknown roll type ${rollType}`)
|
||||
}
|
||||
|
@ -34,6 +34,13 @@ export const AVAILABLE_SETTINGS = {
|
||||
postapo: "CTHULHUETERNAL.Settings.PostApo"
|
||||
}
|
||||
|
||||
export const INSANITY = {
|
||||
"none": "CTHULHUETERNAL.Insanity.None",
|
||||
"flee": "CTHULHUETERNAL.Insanity.Flee",
|
||||
"struggle": "CTHULHUETERNAL.Insanity.Struggle",
|
||||
"submit": "CTHULHUETERNAL.Insanity.Submit"
|
||||
}
|
||||
|
||||
export const ERA_CSS = {
|
||||
jazz: { primaryFont: "RozhaOne", secondaryFont: "RozhaOne", titleFont: "Broadway", imgFilter: "brightness(0) saturate(100%) invert(52%) sepia(9%) saturate(2368%) hue-rotate(360deg) brightness(86%) contrast(84%)" },
|
||||
modern: { primaryFont: "Georama", secondaryFont: "Georama", titleFont: "Georama", imgFilter: "brightness(0) saturate(100%) invert(92%) sepia(11%) saturate(1214%) hue-rotate(51deg) brightness(93%) contrast(86%)" },
|
||||
@ -181,5 +188,6 @@ export const SYSTEM = {
|
||||
RESOURCE_RATING,
|
||||
MENTAL_ILLNESS_CURE_SKILL,
|
||||
ERA_CSS,
|
||||
INSANITY,
|
||||
ASCII
|
||||
}
|
||||
|
@ -95,11 +95,12 @@ export default class CthulhuEternalRoll extends Roll {
|
||||
*/
|
||||
static async prompt(options = {}) {
|
||||
let formula = "1d100"
|
||||
switch (options.rollType) {
|
||||
switch (options.rollType) {
|
||||
case "skill":
|
||||
console.log(options.rollItem)
|
||||
options.initialScore = options.rollItem.system.computeScore()
|
||||
break
|
||||
case "san":
|
||||
case "char":
|
||||
options.initialScore = options.rollItem.targetScore
|
||||
break
|
||||
@ -269,6 +270,10 @@ export default class CthulhuEternalRoll extends Roll {
|
||||
return `${game.i18n.localize("CTHULHUETERNAL.Label.titleSkill")}`
|
||||
case "weapon":
|
||||
return `${game.i18n.localize("CTHULHUETERNAL.Label.titleWeapon")}`
|
||||
case "char":
|
||||
return `${game.i18n.localize("CTHULHUETERNAL.Label.titleCharacteristic")}`
|
||||
case "san":
|
||||
return `${game.i18n.localize("CTHULHUETERNAL.Label.titleSAN")}`
|
||||
default:
|
||||
return game.i18n.localize("CTHULHUETERNAL.Label.titleStandard")
|
||||
}
|
||||
|
@ -44,7 +44,8 @@ export default class CthulhuEternalProtagonist extends foundry.abstract.TypeData
|
||||
recovery: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
violence: new fields.ArrayField(new fields.BooleanField(), { required: true, initial: [false, false, false], min:3, max:3}),
|
||||
helplessness: new fields.ArrayField(new fields.BooleanField(), { required: true, initial: [false, false, false], min:3, max:3 }),
|
||||
breakingPoint: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
breakingPoint: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
insanity: new fields.StringField({ required: true, nullable: false, initial: "none", choices:SYSTEM.INSANITY }),
|
||||
})
|
||||
|
||||
schema.damageBonus = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
@ -66,6 +67,8 @@ export default class CthulhuEternalProtagonist extends foundry.abstract.TypeData
|
||||
eyes: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
hair: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
harshness: new fields.StringField({ required: true, nullable: false, initial: "normal", choices:SYSTEM.HARSHNESS }),
|
||||
adaptedToViolence: new fields.BooleanField({ required: true, initial: false }),
|
||||
adaptedToHelplessness: new fields.BooleanField({ required: true, initial: false })
|
||||
})
|
||||
|
||||
return schema
|
||||
|
Reference in New Issue
Block a user