Compare commits

...

15 Commits

Author SHA1 Message Date
b44250e728 fix: tailles du Phong et du Behemathon
- Phong : petité créature et non grande
- Behemathon : monstrueuse créature et non grande
2023-10-15 16:11:56 +02:00
63c3e24296 fix: typage des créatures
- Utilisation de "cartype" et non "type"
2023-10-15 16:08:41 +02:00
ade88fb54b Corrections sur encaissement 2023-09-16 09:40:08 +02:00
f1a3f2df36 Rollback to previous release system 2023-08-26 21:45:33 +02:00
a357c6ddfc Add gitea CI/CD 2023-08-26 19:17:02 +02:00
26a6c7fc28 Add gitea CI/CD 2023-08-26 19:11:37 +02:00
6fcac36580 Add gitea CI/CD 2023-08-26 19:08:53 +02:00
34924b07c0 Add gitea CI/CD 2023-08-26 19:04:48 +02:00
66bf299ea4 Add gitea CI/CD 2023-08-26 19:01:51 +02:00
37ab0d01dc Add gitea CI/CD 2023-08-26 19:00:25 +02:00
2e3a97de04 Add gitea CI/CD 2023-08-26 18:11:41 +02:00
01dbe76f59 Minor fixes 2023-08-26 18:03:08 +02:00
ca33defd75 Update v11 2023-06-23 09:02:45 +02:00
2e616e3e31 Update v11 2023-06-23 08:37:56 +02:00
3be7f4bf9f Update v11 2023-06-23 08:37:50 +02:00
17 changed files with 328 additions and 131 deletions

54
.gitea/workflows/main.yml Normal file
View File

@ -0,0 +1,54 @@
name: Release Creation
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "💡 The ${{ gitea.repository }} repository will cloned to the runner."
#- uses: actions/checkout@v3
- uses: RouxAntoine/checkout@v3.5.4
with:
ref: 'v10'
# get part of the tag after the `v`
- name: Extract tag version number
id: get_version
uses: battila7/get-version-action@v2
# Substitute the Manifest and Download URLs in the module.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'system.json'
env:
version: ${{steps.get_version.outputs.version-without-v}}
url: https://www.uberwald.me/gitea/public/bol
manifest: https://www.uberwald.me/gitea/public/bol/releases/latest/system.json
download: https://www.uberwald.me/gitea/public/bol/releases/download/${{github.event.release.tag_name}}/bol.zip
# Create a zip file with all files required by the module to add to the release
- run: |
apt update -y
apt install -y zip
- run: zip -r ./bol.zip system.json template.json README.md LICENSE assets/ css/ fonts/ images/ lang/ module/ packs/ styles/ templates/ ui/
- name: setup go
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: Use Go Action
id: use-go-action
uses: https://gitea.com/actions/release-action@main
with:
files: |-
./bol.zip
system.json
api_key: '${{secrets.RELEASE_TOKEN_UBERWALD}}'

15
.gitignore vendored
View File

@ -1 +1,14 @@
.history/
.vscode/settings.json
.idea
.history
todo.md
/.vscode
/ignored/
/node_modules/
/jsconfig.json
/package.json
/package-lock.json
/packs/*/
/packs/*/CURRENT
/packs/*/LOG
/packs/*/LOCK

View File

@ -1,3 +1,7 @@
# v11.0.8
- Correction sur les malus de bouclier (blocage)
- Corrrection sur le malus d'init des boucliers qui était mal affiché dans la fiche d'item
# v10.4.0
- Ajout de la gestion d'effets

View File

@ -1044,9 +1044,18 @@ body.system-bol img#logo {
justify-content: flex-start;
flex-direction: column;
position: absolute;
top: 2.75rem;
/*transform: translate(0, -30%);*/
top: -4rem;
max-width: 250px;
left: 4rem;
}
.tokenhudext.right2 {
justify-content: flex-start;
flex-direction: column;
position: absolute;
top: -4rem;
left: 12rem;
}
.control-icon.tokenhudicon {
width: fit-content;
height: fit-content;
@ -1063,7 +1072,7 @@ body.system-bol img#logo {
z-index: 2;
}
.bol-hud-menu label {
font-size: 0.75rem;
font-size: 0.6rem;
}
.bol-margin-tb-2 {
margin-top: 2px;

View File

@ -355,6 +355,16 @@
"BOL.vehicleCategory.boat" : "Schiff",
"BOL.vehicleCategory.other" : "Anderes",
"BOL.ui.astrologerPoints": "Points d'Astrologie",
"BOL.ui.astrologerPointsLabel": "Points d'Astrologie actuels",
"BOL.ui.ishoroscopemajor": "Horoscope Majeur (ie de groupe) ?",
"BOL.ui.answer": "Réponse",
"BOL.ui.horoscopefavorable": "Favorable (1dB)",
"BOL.ui.horoscopeunfavorable": "Défavorable (1dM)",
"BOL.ui.horoscopes": "Horoscopes",
"BOL.ui.horoscopesBonus": "Horoscopes (Bonus)",
"BOL.ui.horoscopesMalus": "Horoscopes (Malus)",
"BOL.ui.groupHoroscope": "Horoscrope de Groupe de ",
"BOL.range.PointBlank": "Direkt",
"BOL.range.Short": "Kurz",

View File

@ -35,6 +35,17 @@
"BOL.ui.tab.spellalchemy": "Spells & Alchemy",
"BOL.ui.tab.astrologer": "Astrologer",
"BOL.ui.astrologerPoints": "Points d'Astrologie",
"BOL.ui.astrologerPointsLabel": "Points d'Astrologie actuels",
"BOL.ui.ishoroscopemajor": "Horoscope Majeur (ie de groupe) ?",
"BOL.ui.answer": "Réponse",
"BOL.ui.horoscopefavorable": "Favorable (1dB)",
"BOL.ui.horoscopeunfavorable": "Défavorable (1dM)",
"BOL.ui.horoscopes": "Horoscopes",
"BOL.ui.horoscopesBonus": "Horoscopes (Bonus)",
"BOL.ui.horoscopesMalus": "Horoscopes (Malus)",
"BOL.ui.groupHoroscope": "Horoscrope de Groupe de ",
"BOL.ui.properties": "Properties",
"BOL.ui.description": "Description",
"BOL.ui.actions": "Actions",

View File

@ -1,6 +1,5 @@
import { BoLDefaultRoll } from "../controllers/bol-rolls.js";
import { BoLDefaultRoll, BoLRoll } 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.
@ -22,6 +21,18 @@ export class BoLActor extends Actor {
super.prepareData()
}
/* -------------------------------------------- */
async _preCreate(data, options, user) {
await super._preCreate(data, options, user);
// Configure prototype token settings
const prototypeToken = {};
if (this.type === "character") Object.assign(prototypeToken, {
sight: { enabled: true }, actorLink: true, disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
});
this.updateSource({ prototypeToken });
}
/* -------------------------------------------- */
isHeroAdversary() {
if (this.type === 'character') {
@ -596,16 +607,18 @@ export class BoLActor extends Actor {
/*-------------------------------------------- */
heroReroll() {
if (this.type == 'character') {
if (this.type == 'character' || this.system.villainy == 'adversary') {
return this.system.resources.hero.value > 0;
} else {
if (this.system.villainy == 'adversary') {
return this.system.resources.hero.value > 0;
}
}
return false
}
/*-------------------------------------------- */
getHeroPoints() {
if (this.type == 'character' || this.system.villainy == 'adversary') {
return this.system.resources.hero.value
}
return 0
}
/*-------------------------------------------- */
getResourcesFromType() {
let resources = {};
@ -753,7 +766,7 @@ export class BoLActor extends Actor {
/*-------------------------------------------- */
buildListeActions() {
return this.melee.concat(this.ranged).concat(this.natural)
return this.melee.concat(this.ranged).concat(this.natural).concat(this.fightoptions)
}
/*-------------------------------------------- */

View File

@ -424,6 +424,7 @@ export class BoLRoll {
} else {
this.rollData.shieldMalus = 0
}
this.updateTotalDice()
})
html.find('#career').change((event) => {
@ -490,12 +491,13 @@ export class BoLRoll {
if (defender) { // If target is selected
rollData.defence = defender.defenseValue
rollData.armorMalus = defender.armorMalusValue
rollData.defenderHeroPoints = defender.getHeroPoints()
rollData.shieldBlock = 'none'
let shields = defender.shields
//console.log("Defender stats", defender)
for (let shield of shields) {
rollData.shieldBlock = (shield.system.properties.blocking.blockingAll) ? 'blockall' : 'blockone';
rollData.shieldAttackMalus = (shield.system.properties.blocking.malus) ? shield.system.properties.blocking.malus : 1;
rollData.applyShieldMalus = false
}
}
}
@ -528,11 +530,6 @@ export class BoLRoll {
rollData.nbFlaws = 0
rollData.nbDice = 0
rollData.isHeroAdversary = actor.isHeroAdversary()
if (rollData.shieldBlock == 'blockall') {
rollData.shieldMalus = rollData.shieldAttackMalus;
} else {
rollData.shieldMalus = 0
}
rollData.careerBonus = rollData.careerBonus ?? 0
rollData.modRanged = rollData.modRanged ?? 0
rollData.mod = rollData.mod ?? 0
@ -545,6 +542,12 @@ export class BoLRoll {
this.preProcessFightOption(rollData)
this.updateArmorMalus(rollData)
this.updatePPCost(rollData)
// Prepare blocking case
if (rollData.shieldBlock == 'blockall') {
rollData.shieldMalus = rollData.shieldAttackMalus;
} else {
rollData.shieldMalus = 0
}
// Save
this.rollData = rollData
console.log("ROLLDATA", rollData)
@ -571,24 +574,21 @@ export class BoLRoll {
ui.notifications.warn("Pas assez de Points de Pouvoir !")
return
}
//console.log("ROLLMALUS", rollData)
rollData.registerInit = (rollData.aptitude && rollData.aptitude.key == 'init') ? $('#register-init').is(":checked") : false;
const isMalus = (rollData.bmDice < 0)
//rollData.nbDice += (rollData.attackBonusDice) ? 1 : 0
let rollbase = rollData.attrValue + rollData.aptValue
if (rollData.weapon && rollData.weapon.system.properties.onlymodifier) {
if (rollData.weapon?.system.properties.onlymodifier) {
rollbase = 0
}
let diceData = BoLUtility.getDiceData()
let malusInit = rollData.combatData?.malusInit || 0
const modifiers = rollbase + rollData.careerBonus + rollData.mod + rollData.weaponModifier - rollData.defence - rollData.modArmorMalus + rollData.shieldMalus + rollData.attackModifier + rollData.appliedArmorMalus + rollData.effectModifier - malusInit
const formula = (isMalus) ? rollData.nbDice + "d" + diceData.diceFormula + "kl2 + " + modifiers : rollData.nbDice + "d" + diceData.diceFormula + "kh2 + " + modifiers
rollData.formula = formula
rollData.modifiers = modifiers
console.log("Rolldata before", rollData)
let r = new BoLDefaultRoll(rollData);
r.roll();

View File

@ -64,7 +64,27 @@ export class BoLItemSheet extends ItemSheet {
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
let chatData = duplicate(this.item)
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
BoLUtility.postItem(chatData);
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);

View File

@ -1,5 +1,6 @@
/* -------------------------------------------- */
import { BoLRoll } from "../controllers/bol-rolls.js";
import { BoLUtility } from "../system/bol-utility.js";
/* -------------------------------------------- */
export class BoLTokenHud {
@ -30,9 +31,16 @@ export class BoLTokenHud {
(event) => {
let actionIndex = Number(event.currentTarget.attributes['data-action-index'].value)
let action = hudData.actionsList[actionIndex]
const weapon = actor.items.get( action._id )
BoLRoll.weaponCheckWithWeapon(hudData.actor, duplicate(weapon))
//console.log("Clicked", action)
const actionItem = actor.items.get(action._id)
if (actionItem.system.subtype == "weapon") {
BoLRoll.weaponCheckWithWeapon(hudData.actor, duplicate(actionItem))
} else if (actionItem.system.subtype == "fightoption") {
let chatData = duplicate(actionItem)
if (actionItem.actor) {
chatData.actor = { id: actionItem.actor._id };
}
BoLUtility.postItem(chatData);
}
})
const controlIconTarget = html.find('.control-icon[data-action=target]');

View File

@ -199,6 +199,44 @@ export class BoLUtility {
CONFIG.statusEffects = duplicate(game.bol.config.statusEffects)
}
/* -------------------------------------------- */
static chatDataSetup(content, modeOverride, isRoll = false, forceWhisper) {
let chatData = {
user: game.user.id,
rollMode: modeOverride || game.settings.get("core", "rollMode"),
content: content
};
if (["gmroll", "blindroll"].includes(chatData.rollMode)) chatData["whisper"] = ChatMessage.getWhisperRecipients("GM").map(u => u.id);
if (chatData.rollMode === "blindroll") chatData["blind"] = true;
else if (chatData.rollMode === "selfroll") chatData["whisper"] = [game.user];
if (forceWhisper) { // Final force !
chatData["speaker"] = ChatMessage.getSpeaker();
chatData["whisper"] = ChatMessage.getWhisperRecipients(forceWhisper);
}
return chatData;
}
/* -------------------------------------------- */
static postItem(chatData) {
// Don't post any image for the item (which would leave a large gap) if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null;
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
renderTemplate('systems/bol/templates/item/post-item.hbs', chatData).then(html => {
let chatOptions = BoLUtility.chatDataSetup(html);
ChatMessage.create(chatOptions, "selfroll")
});
}
/* -------------------------------------------- */
static createDirectOptionList(min, max) {
let options = {};
@ -573,6 +611,7 @@ export class BoLUtility {
attackId: rollData.id,
attacker: rollData.attacker,
defender: defender,
defenderHeroPoints:defender.getHeroPoints(),
defenderWeapons: defenderWeapons,
damageTotal: rollData.damageTotal,
damagesIgnoresArmor: rollData.damagesIgnoresArmor,
@ -620,7 +659,7 @@ export class BoLUtility {
let formula = damageString
if (damageString.includes("d") || damageString.includes("D")) {
var myReg = new RegExp('(\\d+)[dD]([\\d]+)([MB]*)?([\\+\\d]*)?', 'g')
let myReg = new RegExp('(\\d+)[dD]([\\d]+)([MB]*)?([\\+\\d]*)?', 'g')
let res = myReg.exec(damageString)
let nbDice = parseInt(res[1])
let postForm = 'kh' + nbDice

File diff suppressed because one or more lines are too long

View File

@ -14,10 +14,9 @@
],
"url": "https://www.uberwald.me/gitea/public/bol",
"license": "LICENSE.txt",
"version": "11.0.5",
"version": "11.0.14",
"compatibility": {
"minimum": "10",
"maximum": "11",
"verified": "11"
},
"esmodules": [
@ -203,7 +202,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-v11.0.5.zip",
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v11.0.14.zip",
"background": "systems/bol/ui/page_accueil.webp",
"gridDistance": 1.5,
"gridUnits": "m",

View File

@ -8,15 +8,13 @@
<button class="damage-handling" data-defense-mode="damage-with-armor" data-attack-id="{{attackId}}">{{localize "BOL.chat.witharmor"}}</button>
<button class="damage-handling" data-defense-mode="damage-without-armor" data-attack--id="{{attackId}}">{{localize "BOL.chat.withoutarmor"}}</button>
{{#if isHeroAdversary}}
{{#if (gt defender.system.resources.hero.value 0)}}
{{#if (gt defenderHeroPoints 0)}}
<button class="damage-handling" data-defense-mode="hero-reduce-damage" data-attack-id="{{attackId}}">{{localize "BOL.chat.shakeoff"}}</button>
{{#each defenderWeapons as |weapon idx|}}
<button class="damage-handling" data-defense-mode="hero-in-extremis" data-attack-id="{{@root.attackId}}" data-weapon-id="{{weapon._id}}">{{localize "BOL.chat.splinteredshield" name=weapon.name}}</button>
{{/each}}
{{/if}}
{{/if}}
<button class="damage-handling" data-defense-mode="damage-not-applied" data-attack-id="{{attackId}}">{{localize "BOL.chat.nodamage"}}</button>

View File

@ -76,7 +76,7 @@
<div class="form-group">
<label class="property-label">{{localize "BOL.itemModifiers.init"}}</label>
<div class="form-fields">
<input class="field-value" type="text" name="system.properties.modifiers.init" value="{{item.system.properties.modifiers.c}}" data-dtype="Number"/>
<input class="field-value" type="text" name="system.properties.modifiers.init" value="{{item.system.properties.modifiers.init}}" data-dtype="Number"/>
</div>
</div>
<div class="form-group">

View File

@ -0,0 +1,8 @@
<div class="post-item" data-transfer="{{transfer}}">
<h3><b>{{name}}</b></h3>
{{#if img}}
<img class="chat-icon" src="{{img}}" title="{{name}}" />
{{/if}}
<h4><b>Description : </b></h4>
<p class="card-content">{{{system.description}}}</p>
</div>

View File

@ -2,9 +2,20 @@
<img class="bol-hud-togglebutton" src="icons/svg/sword.svg" width="36" height="36" title="Action" />
<div class="bol-hud-list tokenhudext right">
{{#each actionsList as |action key|}}
{{#if (eq system.subtype "weapon")}}
<div class="control-icon tokenhudicon bol-hud-menu" data-action-index="{{key}}" title="{{action.name}}">
<label>{{action.name}}</label>
</div>
{{/if}}
{{/each}}
</div>
<div class="bol-hud-list tokenhudext right2">
{{#each actionsList as |action key|}}
{{#if (eq system.subtype "fightoption")}}
<div class="control-icon tokenhudicon bol-hud-menu" data-action-index="{{key}}" title="{{action.name}}">
<label>{{action.name}}</label>
</div>
{{/if}}
{{/each}}
</div>
</div>