Use bougette v1.2

This commit is contained in:
sladecraven 2022-11-29 15:23:05 +01:00
parent e1c7304551
commit c0e83eb7e9
14 changed files with 88 additions and 23 deletions

View File

@ -531,6 +531,10 @@ ul.no-bullets {
min-width: 3rem;
width: 3rem;
}
.bougette-dice-img {
color:rgba(150, 44, 44, 0.70);
}
/* ----------------------------------------- */
/* Premade colors */
/* ----------------------------------------- */

View File

@ -474,7 +474,10 @@
"BOL.chat.rangenotvisible": "La ligne de vue est bloquée entre les protagonistes.",
"BOL.chat.rangetitle": "Information MJ",
"BOL.chat.weaponreroll1": "Pour information, cette arme relance les 1 sur ses dégâts.",
"BOL.chat.rollbougette": "Jet de Bougette",
"BOL.chat.bougettesuccess": "Votre bougette reste inchangée !",
"BOL.chat.bougettefailure": "Vous avez trop dépensé, votre bougette s'est réduite...",
"BOL.dialog.soeasy": "Inmanquable (+4)",
"BOL.dialog.veryeasy": "Trés Facile (+2)",
"BOL.dialog.easy": "Facile (+1)",

View File

@ -147,7 +147,8 @@ export class BoLActorSheet extends ActorSheet {
formData.options = this.options
formData.owner = this.document.isOwner
formData.editScore = this.options.editScore
formData.useBougette = BoLUtility.getUseBougette()
formData.useBougette = BoLUtility.getUseBougette()
formData.bougette = this.actor.getBougette()
formData.charType = this.actor.getCharType()
formData.villainy = this.actor.getVillainy()
formData.biography = await TextEditor.enrichHTML(this.object.system.details.biography, {async: true})
@ -236,6 +237,9 @@ export class BoLActorSheet extends ActorSheet {
case "attributexp":
this.actor.incAttributeXP(dataset.key)
break;
case "bougette":
this.actor.rollBougette()
break;
case "careerxp":
this.actor.incCareerXP( li.data("item-id"))
break;

View File

@ -1,5 +1,6 @@
import { BoLDefaultRoll } from "../controllers/bol-rolls.js";
import { BoLUtility } from "../system/bol-utility.js";
import { BoLRoll } from "../controllers/bol-rolls.js";
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
@ -37,6 +38,28 @@ export class BoLActor extends Actor {
return true
}
/* -------------------------------------------- */
getBougette() {
let b = duplicate(this.system.bougette)
b.label = game.i18n.localize( game.bol.config.bougetteState[String(this.system.bougette.value)] )
b.diceImg = "icons/dice/" + game.bol.config.bougetteDice[String(this.system.bougette.value)] + "black.svg"
return b
}
/* -------------------------------------------- */
async rollBougette() {
//ui.notifications.info("Roll bougette done !")
let attribute = duplicate(this.system.attributes.vigor)
let rollData = BoLRoll.getCommonRollData(this, "bougette", attribute, undefined )
rollData.formula = game.bol.config.bougetteDice[String(this.system.bougette.value)]
let r = new BoLDefaultRoll(rollData)
r.roll()
}
/* -------------------------------------------- */
decBougette() {
let bougette = duplicate(this.system.bougette)
bougette.value = Math.max( Number(bougette.value) - 1, 0)
this.update( { 'system.bougette': bougette } )
}
/* -------------------------------------------- */
updateResourcesData() {
if (this.type == 'character') {
@ -429,7 +452,7 @@ export class BoLActor extends Actor {
/*-------------------------------------------- */
heroReroll() {
if (this.villainy == 'character') {
if (this.type == 'character') {
return this.system.resources.hero.value > 0;
} else {
if (this.system.villainy == 'adversary') {

View File

@ -577,6 +577,9 @@ export class BoLDefaultRoll {
if (this.rollData.mode == "alchemy") { // PP cost management
actor.resetAlchemyStatus(this.rollData.alchemy._id)
}
if ( this.rollData.mode == "bougette" && this.rollData.isFailure) {
actor.decBougette()
}
await this.sendChatMessage()
}
@ -689,8 +692,8 @@ export class BoLDefaultRoll {
/* -------------------------------------------- */
_buildChatMessage(rollData) {
const rollMessageTpl = 'systems/bol/templates/chat/rolls/default-roll-card.hbs';
return renderTemplate(rollMessageTpl, rollData);
const rollMessageTpl = 'systems/bol/templates/chat/rolls/default-roll-card.hbs'
return renderTemplate(rollMessageTpl, rollData)
}
}

View File

@ -17,15 +17,15 @@ export class BoLCharacterSummary extends Application {
/* -------------------------------------------- */
static ready() {
if ( !game.user.isGM ) { // Uniquement si GM
return
}
let charSummary = new BoLCharacterSummary()
game.bol.charSummary = charSummary
}
/* -------------------------------------------- */
constructor() {
if ( !game.user.isGM ) { // Uniquement si GM
return;
}
super();
//game.settings.set("world", "character-summary-data", {npcList: [], x:0, y:0})
this.settings = game.settings.get("world", "character-summary-data")

View File

@ -297,11 +297,18 @@ BOL.actorIcons = {
}
BOL.bougetteState = {
"nomoney": "BOL.bougette.nomoney",
"tolive": "BOL.bougette.tolive",
"easylife": "BOL.bougette.easylife",
"luxury": "BOL.bougette.luxury",
"rich": "BOL.bougette.rich"
"0": "BOL.bougette.nomoney",
"1": "BOL.bougette.tolive",
"2": "BOL.bougette.easylife",
"3": "BOL.bougette.luxury",
"4": "BOL.bougette.rich"
}
BOL.bougetteDice = {
"0": "0",
"1": "2d6-1",
"2": "2d6",
"3": "2d6+1",
"4": "2d6+2"
}
BOL.creatureSize = {

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@
],
"url": "https://www.uberwald.me/gitea/public/bol",
"license": "LICENSE.txt",
"version": "10.4.4",
"version": "10.4.5",
"compatibility": {
"minimum": "10",
"verified": "10",
@ -203,7 +203,7 @@
],
"socket": true,
"manifest": "https://www.uberwald.me/gitea/public/bol/raw/v10/system.json",
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.4.4.zip",
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.4.5.zip",
"background": "systems/images/map_lemurie.webp",
"gridDistance": 1.5,
"gridUnits": "m",

View File

@ -141,7 +141,8 @@
"chartype": "player",
"villainy": false,
"bougette": {
"state": "nomoney"
"state": "nomoney",
"value": 0
},
"xp": {
"key": "xp",

View File

@ -12,13 +12,20 @@
<div class="item-image"><img src="icons/containers/bags/coinpouch-simple-leather-brown.webp" title="{{localize "BOL.ui.money"}}" /></div>
{{localize "BOL.ui.money"}}
</h4>
<select class="field-value" name="system.bougette.state" data-dtype="String">
{{#select system.bougette.state}}
{{#each config.bougetteState as |value id|}}
<option value="{{id}}">{{localize value}}</option>
{{/each}}
<div class="item-image">
<a class="bougette-roll rollable" data-roll-type="bougette"><i class="darkgreen fas fa-dice"></i></a>
</div>
{{#if isGM}}
<select class="field-value" name="system.bougette.value" data-dtype="String">
{{#select bougette.value}}
{{#each config.bougetteState as |value id|}}
<option value="{{id}}">{{localize value}}</option>
{{/each}}
{{/select}}
</select>
{{else}}
<label class="">{{localize bougette.label}}</label></a>
{{/if}}
</li>
</ol>
{{/if}}

View File

@ -3,7 +3,7 @@
<div class="attribute stat flex1 flex-group-center {{key}}">
<label class="stat-label"><a class="rollable" data-roll-type="attribute" data-roll="2d6+@attributes.{{key}}.value" data-adv="0" data-key="{{key}}">{{localize label}}</a></label><br/>
<input class="stat-value rounded" type="text" name="system.attributes.{{key}}.value" value="{{numberFormat value decimals=0 sign=true}}" data-dtype="Number"/><br/>
<span class="stat-roll rollable" title="2d6" data-roll-type="attribute" data-roll="2d6+@attributes.{{key}}.value" data-adv="0" data-key="{{key}}">
<span class="stat-roll rollable" title="2d6" data-roll-type="attribute" data-roll="2d6+@attributes.{{key}}.value" data-adv="0" data-key="{{key}}">
<i class="darkgreen fas fa-dice"></i>
</span>
<span class="tooltip-container">

View File

@ -34,8 +34,21 @@
</div>
{{/if}}
{{#if (eq mode "bougette")}}
<div>
{{localize "BOL.chat.rollbougette"}} :
{{#if isSuccess}}
{{localize "BOL.chat.bougettesuccess"}}
{{else}}
{{localize "BOL.chat.bougettefailure"}}
{{/if}}
</div>
{{/if}}
<div id="{{optionsId}}">
{{#if isRealCritical}}
<div class="bol-margin-tb-2">
<a class="content-link" draggable="true" data-uuid="Compendium.bol.aides-de-jeu.Yl1RKQb0BjVUtilk" data-id="Yl1RKQb0BjVUtilk" data-type="JournalEntry" data-pack="bol.aides-de-jeu" data-tooltip="un journal"><i class="fas fa-book-open"></i>Succès Héroïque</a>