Initial import

This commit is contained in:
sladecraven 2021-12-02 07:38:59 +01:00
parent af2436a676
commit 522cad2ff8
77 changed files with 4607 additions and 0 deletions

BIN
fonts/middlesaxonytext.ttf Executable file

Binary file not shown.

BIN
fonts/zag_bold.otf Executable file

Binary file not shown.

BIN
fonts/zag_regular.otf Executable file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

1
images/dice/d10-grey.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="40 40 100 100" width="64" height="64"><g><g transform="matrix(1.1679092,0,0,1.1679092,-274.931,-137.53749)"><path fill="#AAAAAA" d="M313.653,154.602l-26.488,55.612l24.356,15.89l26.354-15.928 L313.653,154.602z"/><path fill="#AAAAAA" d="M314.9,153.687l24.49,55.919l14.175-4.584l0.915-22.612 L314.9,153.687z"/><path fill="#AAAAAA" d="M312.359,227.393v8.568l40.76-28.762l-13.608,3.825 L312.359,227.393z"/><path fill="#AAAAAA" d="M312.359,153.927l-26.756,55.732l-13.925-5.99l-1.229-22.679 L312.359,153.927z"/><path fill="#AAAAAA" d="M310.517,227.213v8.75l-39.019-30.157l13.513,5.275 L310.517,227.213z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 676 B

1
images/dice/d10black.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="40 40 100 125" width="64" height="64"><g><g transform="matrix(1.1679092,0,0,1.1679092,-274.931,-137.53749)"><path fill="#000000" d="M313.653,154.602l-26.488,55.612l24.356,15.89l26.354-15.928 L313.653,154.602z"/><path fill="#000000" d="M314.9,153.687l24.49,55.919l14.175-4.584l0.915-22.612 L314.9,153.687z"/><path fill="#000000" d="M312.359,227.393v8.568l40.76-28.762l-13.608,3.825 L312.359,227.393z"/><path fill="#000000" d="M312.359,153.927l-26.756,55.732l-13.925-5.99l-1.229-22.679 L312.359,153.927z"/><path fill="#000000" d="M310.517,227.213v8.75l-39.019-30.157l13.513,5.275 L310.517,227.213z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 676 B

BIN
images/dice/d6_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/dice/d6_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/dice/d6_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
images/dice/d6_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/dice/d6_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
images/dice/d6_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

6
images/icons/.directory Normal file
View File

@ -0,0 +1,6 @@
[Dolphin]
SortRole=creationtime
Timestamp=2021,4,13,9,23,48.267
Version=4
ViewMode=1
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

BIN
images/icons/Language.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
images/icons/Outfit.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/icons/Perks.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
images/icons/Races.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/icons/Research.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/icons/Skills.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
images/icons/Traits.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
images/icons/Utility.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/icons/icon_art.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

60
images/icons/locked.svg Normal file
View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
viewBox="0 0 74.999964 74.999964"
version="1.1"
id="svg3"
sodipodi:docname="locked.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
<metadata
id="metadata9">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs7" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3840"
inkscape:window-height="2066"
id="namedview5"
showgrid="false"
inkscape:zoom="11.84917"
inkscape:cx="66.242132"
inkscape:cy="3.3681778"
inkscape:window-x="-11"
inkscape:window-y="-11"
inkscape:window-maximized="1"
inkscape:current-layer="svg3"
inkscape:document-rotation="0"
units="px" />
<path
id="Sélection #1"
fill="none"
stroke="#000000"
stroke-width="0.43031"
d="m 17.920882,31.968974 c -0.275398,-1.686814 -0.02152,-6.407314 0.253883,-8.175887 1.613662,-10.314528 8.033886,-24.37275369 20.400992,-23.77462269 11.489274,0.5551 17.423247,13.45579069 19.041212,23.34431269 0.309823,1.919182 0.619646,6.773077 0.322733,8.606197 0,0 4.303099,0 4.303099,0 0,0 0,43.030993 0,43.030993 0,0 -49.485638,0 -49.485638,0 0,0 0,-43.030993 0,-43.030993 0,0 5.163719,0 5.163719,0 z m 36.146031,0 c 0,-7.517513 -1.080078,-14.703688 -5.38748,-21.085184 C 46.23097,7.2562774 43.124132,4.5453244 38.575757,4.4334444 26.699204,4.1451364 21.810883,19.614778 21.793671,29.387115 c 0,0 0,2.581859 0,2.581859 0,0 32.273242,0 32.273242,0 z"
style="fill:#000000;fill-opacity:1;stroke:#1a1a1a;stroke-opacity:1;opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

64
images/icons/unlocked.svg Normal file
View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="26.240078"
height="24.137722"
viewBox="0 0 82.000206 75.430344"
version="1.1"
id="svg3"
sodipodi:docname="unlocked.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
<metadata
id="metadata9">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs7" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1818"
inkscape:window-height="1345"
id="namedview5"
showgrid="false"
inkscape:zoom="9.407583"
inkscape:cx="32.22484"
inkscape:cy="24.325892"
inkscape:window-x="630"
inkscape:window-y="276"
inkscape:window-maximized="1"
inkscape:current-layer="svg3"
inkscape:document-rotation="0"
units="px"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<path
id="Sélection #1"
fill="none"
stroke="#000000"
stroke-width="0.430321"
d="m 41.525985,32.183078 c -0.757365,-3.180073 0.619662,-10.938762 1.600794,-14.200596 1.097319,-3.636213 2.990736,-7.836147 5.422046,-10.7580268 1.36842,-1.639523 3.63191,-3.85998 5.45647,-4.957299 2.39689,-1.44587897 5.38332,-2.17312097 8.1761,-2.03541897 9.56174,0.460444 15.50017,9.83713977 17.88845,18.18106577 1.04138,3.636213 1.32539,5.723271 1.4717,9.467064 0.0645,0.933797 0.50347,2.891758 0,3.614697 -0.667,0.890765 -2.86164,0.688514 -3.86859,0.688514 0,-7.620987 -1.35551,-15.23767 -5.99007,-21.516054 -2.30652,-3.1198278 -5.46077,-5.8308508 -9.50149,-6.0072828 -4.9573,-0.21516 -8.35253,2.543198 -11.09798,6.4376038 -4.39788,6.239655 -5.684541,13.615359 -5.684541,21.085733 0,0 4.303211,0 4.303211,0 0,0 0,43.032105 0,43.032105 0,0 -49.4869245,0 -49.4869245,0 0,0 0,-43.032105 0,-43.032105 0,0 41.3108245,0 41.3108245,0 z"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:0.5" />
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 KiB

BIN
images/ui/wotg_logo_01.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

3
lang/en.json Normal file
View File

@ -0,0 +1,3 @@
{
}

View File

@ -0,0 +1,193 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { PegasusUtility } from "./pegasus-utility.js";
import { PegasusItemSheet } from "./pegasus-item-sheet.js";
/* -------------------------------------------- */
export class PegasusActorSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-pegasus-rpg", "sheet", "actor"],
template: "systems/fvtt-pegasus-rpg/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
});
}
/* -------------------------------------------- */
async getData() {
const objectData = PegasusUtility.data(this.object);
let actorData = duplicate(PegasusUtility.templateData(this.object));
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: actorData,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
specs: this.actor.getSpecs( ),
weapons: this.actor.checkAndPrepareWeapons( duplicate(this.actor.getWeapons()) ),
armors: duplicate(this.actor.getArmors()),
shields: duplicate(this.actor.getShields()),
equipments: duplicate(this.actor.getEquipments()),
perks: duplicate(this.actor.getPerks()),
powers: duplicate(this.actor.getPowers()),
subActors: duplicate(this.actor.getSubActors()),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
const item = this.actor.items.get( itemId );
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
PegasusUtility.confirmDelete(this, li);
});
html.find('.subactor-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
let actor = game.actors.get( actorId );
actor.sheet.render(true);
});
html.find('.subactor-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
this.actor.delSubActor(actorId);
});
html.find('.equipement-moins').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.decrementeQuantite( li.data("item-id") );
} );
html.find('.equipement-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incrementeQuantite( li.data("item-id") );
} );
html.find('.skill-roll').click((event) => {
const li = $(event.currentTarget).parents(".item");
const skillId = li.data("item-id");
this.actor.rollSkill(skillId);
});
html.find('.technique-roll').click((event) => {
const li = $(event.currentTarget).parents(".item");
const techId = li.data("item-id");
this.actor.rollTechnique(techId);
});
html.find('.weapon-roll').click((event) => {
const li = $(event.currentTarget).parents(".item");
const weaponId = li.data("item-id");
this.actor.rollWeapon(weaponId);
});
html.find('.river-flush').click((event) => {
const diceIndex = $(event.currentTarget).data("dice-index");
this.actor.flushDice(diceIndex);
});
html.find('.river-use').click((event) => {
const diceIndex = $(event.currentTarget).data("dice-index");
this.actor.addDice(diceIndex);
});
html.find('.weapon-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const armeId = li.data("item-id");
const statId = li.data("stat-id");
this.actor.rollWeapon(armeId, statId);
});
html.find('.weapon-damage').click((event) => {
const li = $(event.currentTarget).parents(".item");
const weapon = this.actor.getOwnedItem(li.data("item-id"));
this.actor.rollDamage(weapon, 'damage');
});
html.find('.weapon-damage-critical').click((event) => {
const li = $(event.currentTarget).parents(".item");
const weapon = this.actor.getOwnedItem(li.data("item-id"));
this.actor.rollDamage(weapon, 'criticaldamage');
});
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-link a').click((event) => {
const itemId = $(event.currentTarget).data("item-id");
const item = this.actor.getOwnedItem(itemId);
item.sheet.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDrop(event) {
let data = event.dataTransfer.getData('text/plain');
if (data) {
let dataItem = JSON.parse( data);
let npc = game.actors.get( dataItem.id);
if ( npc ) {
this.actor.addSubActor( dataItem.id);
return;
}
}
super._onDrop(event);
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
}
}

512
modules/pegasus-actor.js Normal file
View File

@ -0,0 +1,512 @@
/* -------------------------------------------- */
import { PegasusUtility } from "./pegasus-utility.js";
import { PegasusRollDialog } from "./pegasus-roll-dialog.js";
/* -------------------------------------------- */
const coverBonusTable = { "nocover": 0, "lightcover": 2, "heavycover": 4, "entrenchedcover": 6};
/* -------------------------------------------- */
/* -------------------------------------------- */
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
* @extends {Actor}
*/
export class PegasusActor extends Actor {
/* -------------------------------------------- */
/**
* Override the create() function to provide additional SoS functionality.
*
* This overrided create() function adds initial items
* Namely: Basic skills, money,
*
* @param {Object} data Barebones actor data which this function adds onto.
* @param {Object} options (Unused) Additional options which customize the creation workflow.
*
*/
static async create(data, options) {
// Case of compendium global import
if (data instanceof Array) {
return super.create(data, options);
}
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
if (data.items) {
let actor = super.create(data, options);
return actor;
}
if ( data.type == 'character') {
const skills = await PegasusUtility.loadCompendium("fvtt-weapons-of-the-gods.skills");
data.items = skills.map(i => i.toObject());
}
if ( data.type == 'npc') {
}
return super.create(data, options);
}
/* -------------------------------------------- */
prepareBaseData() {
}
/* -------------------------------------------- */
async prepareData() {
super.prepareData();
}
/* -------------------------------------------- */
prepareDerivedData() {
if (this.type == 'character') {
let h = 0;
let updates = [];
for (let key in this.data.data.statistics) {
let attr = this.data.data.statistics[key];
}
/*if ( h != this.data.data.secondary.health.max) {
this.data.data.secondary.health.max = h;
updates.push( {'data.secondary.health.max': h} );
}*/
if ( updates.length > 0 ) {
this.update( updates );
}
}
super.prepareDerivedData();
}
/* -------------------------------------------- */
_preUpdate(changed, options, user) {
super._preUpdate(changed, options, user);
}
/* -------------------------------------------- */
getPerks() {
let comp = this.data.items.filter( item => item.type == 'perk');
return comp;
}
/* -------------------------------------------- */
getPowers() {
let comp = this.data.items.filter( item => item.type == 'power');
return comp;
}
/* -------------------------------------------- */
getArmors() {
let comp = this.data.items.filter( item => item.type == 'armor');
return comp;
}
/* -------------------------------------------- */
getShields() {
let comp = this.data.items.filter( item => item.type == 'shield');
return comp;
}
/* -------------------------------------------- */
checkAndPrepareWeapon(item) {
let types=[];
let specs=[];
let stats=[];
item.data.specs = specs;
item.data.stats = stats;
item.data.typeText = types.join('/');
}
/* -------------------------------------------- */
checkAndPrepareWeapons(weapons) {
for ( let item of weapons) {
this.checkAndPrepareWeapon(item);
}
return weapons;
}
/* -------------------------------------------- */
getWeapons() {
let comp = this.data.items.filter( item => item.type == 'weapon' );
return comp;
}
/* -------------------------------------------- */
getSpecs() {
let comp = this.data.items.filter( item => item.type == 'specialisation');
return comp;
}
/* -------------------------------------------- */
async equipItem(itemId ) {
let item = this.data.items.find( item => item.id == itemId );
if (item && item.data.data) {
let update = { _id: item.id, "data.equipped": !item.data.data.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
compareName( a, b) {
if ( a.name < b.name ) {
return -1;
}
if ( a.name > b.name ) {
return 1;
}
return 0;
}
/* ------------------------------------------- */
getEquipments() {
return this.data.items.filter( item => item.type == 'shield' || item.type == 'armor' || item.type == "weapon" || item.type == "equipment");
}
/* -------------------------------------------- */
getActiveEffects(matching = it => true) {
let array = Array.from(this.getEmbeddedCollection("ActiveEffect").values());
return Array.from(this.getEmbeddedCollection("ActiveEffect").values()).filter(it => matching(it));
}
/* -------------------------------------------- */
getEffectByLabel(label) {
return this.getActiveEffects().find(it => it.data.label == label);
}
/* -------------------------------------------- */
getEffectById(id) {
return this.getActiveEffects().find(it => it.id == id);
}
/* -------------------------------------------- */
getAttribute( attrKey ) {
return this.data.data.attributes[attrKey];
}
/* -------------------------------------------- */
async equipGear( equipmentId ) {
let item = this.data.items.find( item => item.id == equipmentId );
if (item && item.data.data) {
let update = { _id: item.id, "data.equipped": !item.data.data.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
getInitiativeScore( ) {
if ( this.type == 'character') {
// TODO
}
return 0.0;
}
/* -------------------------------------------- */
getArmorModifier( ) {
let armors = this.getArmors();
let modifier = 0;
for (let armor of armors) {
if (armor.data.data.equipped) {
if (armor.data.data.type == 'light') modifier += 5;
if (armor.data.data.type == 'medium') modifier += 10;
if (armor.data.data.type == 'heavy') modifier += 15;
}
}
return modifier;
}
/* -------------------------------------------- */
async applyDamageLoss( damage) {
let chatData = {
user: game.user.id,
alias : this.name,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat( ChatMessage.getWhisperRecipients('GM') ),
};
//console.log("Apply damage chat", chatData );
if (damage > 0 ) {
let health = duplicate(this.data.data.secondary.health);
health.value -= damage;
if (health.value < 0 ) health.value = 0;
this.update( { "data.secondary.health.value": health.value});
chatData.content = `${this.name} looses ${damage} health. New health value is : ${health.value}` ;
} else {
chatData.content = `No health loss for ${this.name} !`;
}
await ChatMessage.create( chatData );
}
/* -------------------------------------------- */
processNoDefense( attackRollData) {
let defenseRollData = {
mode : "nodefense",
finalScore: 0,
defenderName: this.name,
attackerName: attackRollData.alias,
armorModifier: this.getArmorModifier(),
actorId: this.id,
alias: this.name,
result: 0,
}
this.syncRoll( defenseRollData );
this.processDefenseResult(defenseRollData, attackRollData);
}
/* -------------------------------------------- */
async processApplyDamage(defenseRollData, attackRollData) { // Processed by the defender actor
if ( attackRollData && attackRollData ) {
let result = attackRollData.finalScore;
defenseRollData.damageDices = WotGUtility.getDamageDice( result );
defenseRollData.damageRoll = await this.rollDamage(defenseRollData);
chatData.damages = true;
chatData.damageDices = defenseRollData.damageDices;
WotGUtility.createChatWithRollMode( this.name, {
content: await renderTemplate(`systems/fvtt-weapons-of-the-gods/templates/chat-opposed-damages.html`, chatData)
});
}
}
/* -------------------------------------------- */
async processDefenseResult(defenseRollData, attackRollData) { // Processed by the defenser
if ( defenseRollData && attackRollData) {
let result = attackRollData.finalScore - defenseRollData.finalScore;
defenseRollData.defenderName = this.name,
defenseRollData.attackerName = attackRollData.alias
defenseRollData.result= result
defenseRollData.damages = false
defenseRollData.damageDices = 0;
if ( result > 0 ) {
defenseRollData.damageDices = WotGUtility.getDamageDice( result );
defenseRollData.damageRoll = await this.rollDamage(defenseRollData, attackRollData);
defenseRollData.damages = true;
defenseRollData.finalDamage = defenseRollData.damageRoll.total;
WotGUtility.updateRollData( defenseRollData);
console.log("DAMAGE ROLL OBJECT", defenseRollData);
WotGUtility.createChatWithRollMode( this.name, {
content: await renderTemplate(`systems/fvtt-weapons-of-the-gods/templates/chat-opposed-damage.html`, defenseRollData)
});
} else {
WotGUtility.updateRollData( defenseRollData );
WotGUtility.createChatWithRollMode( this.name, {
content: await renderTemplate(`systems/fvtt-weapons-of-the-gods/templates/chat-opposed-fail.html`, defenseRollData)
});
}
}
}
/* -------------------------------------------- */
async rollDamage( defenseRollData, attackRollData ) {
let weaponDamage = 0;
if (attackRollData.weapon?.data?.damage) {
weaponDamage = Number(attackRollData.weapon.data.damage);
}
let formula = defenseRollData.damageDices+"d10+"+defenseRollData.armorModifier + "+" + weaponDamage;
console.log("ROLL : ", formula);
let myRoll = new Roll(formula).roll( { async: false} );
await WotGUtility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode") );
return myRoll;
}
/* -------------------------------------------- */
getSubActors() {
let subActors = [];
for (let id of this.data.data.subactors) {
subActors.push(duplicate(game.actors.get(id)));
}
return subActors;
}
/* -------------------------------------------- */
async addSubActor( subActorId) {
let subActors = duplicate( this.data.data.subactors);
subActors.push( subActorId);
await this.update( { 'data.subactors': subActors } );
}
/* -------------------------------------------- */
async delSubActor( subActorId) {
let newArray = [];
for (let id of this.data.data.subactors) {
if ( id != subActorId) {
newArray.push( id);
}
}
await this.update( { 'data.subactors': newArray } );
}
/* -------------------------------------------- */
setDefenseMode( rollData ) {
console.log("DEFENSE MODE IS SET FOR", this.name);
this.data.defenseRollData = rollData;
this.data.defenseDefenderId = rollData.defenderId;
this.data.defenseAttackerId = rollData.attackerId;
}
/* -------------------------------------------- */
clearDefenseMode( ) {
this.data.defenseDefenderId = undefined;
this.data.defenseAttackerId = undefined;
this.data.defenseRollData = undefined;
}
/* -------------------------------------------- */
syncRoll( rollData ) {
let linkedRollId = WotGUtility.getDefenseState(this.id);
if ( linkedRollId) {
rollData.linkedRollId = linkedRollId;
}
rollData.rollId = randomID(16);
this.lastRollId = rollData.rollId;
WotGUtility.saveRollData( rollData );
}
/* -------------------------------------------- */
async rollSkill( skillId ) {
let skill = this.data.items.find( item => item.type == 'skill' && item.id == skillId);
if (skill) {
let rollData = {
mode: "skill",
alias: this.name,
actorImg: this.img,
actorId: this.id,
img: skill.img,
rollMode: game.settings.get("core", "rollMode"),
armorModifier: this.getArmorModifier(),
title: `Skill ${skill.name} `,
skill: duplicate(skill),
skillAttr: this.getAttribute( skill.data.data.attribute ),
optionsNegative: WotGUtility.getNegativeModifiers(),
optionsPositive: WotGUtility.getPositiveModifiers(),
negativeModifier: 0,
positiveModifier: 0,
specialtiesBonus: 0,
}
this.syncRoll( rollData);
let rollDialog = await WotGRollDialog.create( this, rollData);
console.log(rollDialog);
rollDialog.render( true );
} else {
ui.notifications.warn("Skill not found !");
}
}
/* -------------------------------------------- */
applyTechniqueCost( techId) {
let tech = duplicate(this.data.items.find( item => item.id == techId));
if (tech ) {
let attr = this.getAttributeFromChiName( tech.data.chicolor);
let chiscore = attr.chiscore - tech.data.chicost;
chiscore = (chiscore < 0) ? 0 : chiscore;
this.update( { [`data.attributes.${attr.key}.chiscore`]: chiscore } );
}
}
/* -------------------------------------------- */
updateWithTarget( rollData) {
let objectDefender
let target = WotGUtility.getTarget();
if ( !target) {
ui.notifications.warn("You are using a Weapon without a Target.");
} else {
let defenderActor = game.actors.get(target.data.actorId);
objectDefender = WotGUtility.data(defenderActor);
objectDefender = mergeObject(objectDefender, target.data.actorData);
rollData.defender = objectDefender;
rollData.attackerId = this.id;
rollData.defenderId = objectDefender._id;
console.log("ROLLDATA DEFENDER !!!", rollData);
}
}
/* -------------------------------------------- */
async rollTechnique( techId ) {
let technique = this.data.items.find( item => item.type == 'technique' && item.id == techId);
if (technique) {
let usedChi = this.getAttributeFromChiName( technique.data.data.chicolor);
if ( usedChi.chiscore < 0 || technique.data.data.chicost > usedChi.chiscore) {
ui.notifications.warn(`Not enough ${usedChi.chi} to use Technique ${technique.name}`);
return;
}
let chi = undefined;
let skill = this.data.items.find( item => item.type == 'skill' && item.name == technique.data.data.skillchi);
if ( !skill) {
chi = this.getAttributeFromChiName( technique.data.data.skillchi);
}
let rollData = {
mode: "technique",
alias: this.name,
armorModifier: this.getArmorModifier(),
actorImg: this.img,
actorId: this.id,
img: technique.img,
rollMode: game.settings.get("core", "rollMode"),
title: `Technique ${technique.name} `,
technique: duplicate(technique),
optionsNegative: WotGUtility.getNegativeModifiers(),
optionsPositive: WotGUtility.getPositiveModifiers(),
negativeModifier: 0,
positiveModifier: 0,
specialtiesBonus: 0
}
if ( skill) {
rollData.skill = duplicate(skill);
rollData.attr = this.getAttribute( skill.data.data.attribute );
} else {
rollData.attr = chi;
}
this.updateWithTarget(rollData);
this.syncRoll( rollData);
let rollDialog = await WotGRollDialog.create( this, rollData);
console.log(rollDialog);
rollDialog.render( true );
} else {
ui.notifications.warn("Technique not found !");
}
}
/* -------------------------------------------- */
async rollWeapon( weaponId ) {
let weapon = this.data.items.find( item => item.id == weaponId);
console.log("WEAPON :", weaponId, weapon );
if ( weapon ) {
weapon = duplicate(weapon);
this.checkAndPrepareWeapon( weapon );
let rollData = {
mode: 'weapon',
actorType: this.type,
alias: this.name,
actorId: this.id,
img: weapon.img,
rollMode: game.settings.get("core", "rollMode"),
armorModifier: this.getArmorModifier(),
title: "Attack : " + weapon.name,
weapon: weapon,
skillKey : 0,
optionsNegative: WotGUtility.getNegativeModifiers(),
optionsPositive: WotGUtility.getPositiveModifiers(),
negativeModifier: 0,
positiveModifier: 0,
specialtiesBonus: 0,
}
this.updateWithTarget(rollData);
this.syncRoll( rollData);
let rollDialog = await WotGRollDialog.create( this, rollData);
console.log("WEAPON ROLL", rollData);
rollDialog.render( true );
} else {
ui.notifications.warn("Weapon not found !", weaponId);
}
}
}

20
modules/pegasus-combat.js Normal file
View File

@ -0,0 +1,20 @@
import { PegasusUtility } from "./pegasus-utility.js";
/* -------------------------------------------- */
export class PegasusCombat extends Combat {
/* -------------------------------------------- */
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
console.log("Initiative is requested !!!");
ids = typeof ids === "string" ? [ids] : ids;
const currentId = this.combatant._id;
for (let cId = 0; cId < ids.length; cId++) {
const c = this.getCombatant(ids[cId]);
let initBonus = c.actor ? c.actor.getInitiativeScore() : 0;
await this.updateEmbeddedEntity("Combatant", { _id: c._id, initiative: initBonus });
}
return this;
}
}

View File

@ -0,0 +1,176 @@
import { PegasusUtility } from "./pegasus-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class PegasusItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-pegasus-rpg", "sheet", "item"],
template: "systems/fvtt-pegasus-rpg/templates/item-sheet.html",
dragDrop: [{dragSelector: null, dropSelector: null}],
width: 620,
height: 550
//tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => {}
})
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options={}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if ( this.item.type.includes('weapon')) {
position.width = 640;
}
return position;
}
/* -------------------------------------------- */
async getData() {
const objectData = PegasusUtility.data(this.object);
let itemData = foundry.utils.deepClone(PegasusUtility.templateData(this.object));
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: itemData,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
isGM: game.user.isGM
}
this.options.editable = !(this.object.data.origin == "embeddedItem");
console.log("ITEM DATA", formData, this);
return formData;
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
console.log(this.item);
let chatData = duplicate(PegasusUtility.data(this.item));
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
// 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/fvtt-pegasus-rpg/templates/post-item.html', chatData).then(html => {
let chatOptions = WotGUtility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
const item = this.object.options.actor.getOwnedItem(li.data("item-id"));
item.sheet.render(true);
});
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
let itemType = li.data("item-type");
let array = duplicate(this.object.data.data[itemType]);
let newArray = array.filter( item => item._id != itemId);
if ( itemType == 'variations') {
this.object.update( {"data.variations": newArray} );
} else if (itemType == "modifications") {
this.object.update( { "data.modifications": newArray} );
} else {
this.object.update( { "data.traits": newArray} );
}
});
html.find('.trait-name').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
this.manageTrait( itemId);
});
html.find('.variation-name').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
this.manageVariation( itemId);
});
html.find('.modification-name').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
this.manageModification( itemId);
});
}
/* -------------------------------------------- */
async _onDrop(event) {
}
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-pegasus-rpg/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData);
}
}

28
modules/pegasus-item.js Normal file
View File

@ -0,0 +1,28 @@
import { PegasusUtility } from "./pegasus-utility.js";
export const defaultItemImg = {
skill: "systems/fvtt-pegasus-rpg/images/icons/icon_skill.webp",
advantage: "systems/fvtt-pegasus-rpg/images/icons/icon_advantage.webp",
disadvantage: "systems/fvtt-pegasus-rpg/images/icons/icon_disadvantage.webp",
technique: "systems/fvtt-pegasus-rpg/images/icons/icon_technique.webp",
armor: "systems/fvtt-pegasus-rpg/images/icons/icon_armor.webp",
art: "systems/fvtt-pegasus-rpg/icons/images/icon_art.webp",
weapon: "systems/fvtt-pegasus-rpg/images/icons/icon_weapon.webp",
equipment: "systems/fvtt-pegasus-rpg/images/icons/icon_equipment.webp",
style: "systems/fvtt-pegasus-rpg/images/icons/icon_style.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class PegasusItem extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}

101
modules/pegasus-main.js Normal file
View File

@ -0,0 +1,101 @@
/**
* Pegasus system
* Author: Uberwald
* Software License: Prop
*/
/* -------------------------------------------- */
/* -------------------------------------------- */
// Import Modules
import { PegasusActor } from "./pegasus-actor.js";
import { PegasusItemSheet } from "./pegasus-item-sheet.js";
import { PegasusActorSheet } from "./pegasus-actor-sheet.js";
import { PegasusNPCSheet } from "./pegasus-npc-sheet.js";
import { PegasusUtility } from "./pegasus-utility.js";
import { PegasusCombat } from "./pegasus-combat.js";
import { PegasusItem } from "./pegasus-item.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
/************************************************************************************/
Hooks.once("init", async function () {
console.log(`Initializing Pegasus RPG`);
/* -------------------------------------------- */
// preload handlebars templates
PegasusUtility.preloadHandlebarsTemplates();
/* -------------------------------------------- */
// Set an initiative formula for the system
CONFIG.Combat.initiative = {
formula: "1d6",
decimals: 1
};
/* -------------------------------------------- */
game.socket.on("system.fvtt-pegasus-rpg", data => {
PegasusUtility.onSocketMesssage(data);
});
/* -------------------------------------------- */
// Define custom Entity classes
CONFIG.Combat.documentClass = PegasusCombat;
CONFIG.Actor.documentClass = PegasusActor;
CONFIG.Item.documentClass = PegasusItem;
CONFIG.WOTG = {
}
/* -------------------------------------------- */
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("fvtt-pegasus", PegasusActorSheet, { types: ["character"], makeDefault: true });
Actors.registerSheet("fvtt-pegasus", PegasusNPCSheet, { types: ["npc"], makeDefault: false });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("fvtt-pegasus", PegasusItemSheet, { makeDefault: true });
PegasusUtility.init();
});
/* -------------------------------------------- */
function welcomeMessage() {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-pegasus"><span class="rdd-roll-part">Welcome !</div>
` });
}
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("ready", function () {
PegasusUtility.ready();
// User warning
if (!game.user.isGM && game.user.character == undefined) {
ui.notifications.info("Warning ! No character linked to your user !");
ChatMessage.create({
content: "<b>WARNING</b> The player " + game.user.name + " is not linked to a character !",
user: game.user._id
});
}
welcomeMessage();
});
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
let regExp = /(\S+)/g;
let commands = content.toLowerCase().match(regExp);
console.log(commands);
}
return true;
});

View File

@ -0,0 +1,139 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { PegasusUtility } from "./pegasus-utility.js";
import { PegasusItemSheet } from "./pegasus-item-sheet.js";
/* -------------------------------------------- */
export class PegasusNPCSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["pegasus-rpg", "sheet", "actor"],
template: "systems/fvtt-pegasus-rpg/templates/npc-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
});
}
/* -------------------------------------------- */
async getData() {
const objectData = PegasusUtility.data(this.object);
this.actor.prepareTraitsAttributes();
let actorData = duplicate(PegasusUtility.templateData(this.object));
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: actorData,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
equipments: this.actor.getEquipments(),
defenseBase: this.actor.getDefenseBase(),
bodyArmourBase: this.actor.getBodyArmour(),
headArmourBase: this.actor.getHeadArmour(),
weapons: this.actor.getWeapons(),
traits: this.actor.getTraits(),
optionsBase: FraggedKingdomUtility.createDirectOptionList(0, 20),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
console.log("NPC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
const item = this.actor.items.get( itemId );
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
FraggedKingdomUtility.confirmDelete(this, li);
});
html.find('.trait-link').click((event) => {
const itemId = $(event.currentTarget).data("item-id");
const item = this.actor.getOwnedItem(itemId);
item.sheet.render(true);
});
html.find('.competence-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const competenceId = li.data("item-id");
this.actor.rollSkill(competenceId);
});
html.find('.weapon-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const armeId = li.data("item-id");
const statId = li.data("stat-id");
this.actor.rollWeapon(armeId, statId);
});
html.find('.npc-fight-roll').click((event) => {
this.actor.rollNPCFight();
});
html.find('.npc-skill-roll').click((event) => {
this.actor.rollGenericSkill();
});
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-link a').click((event) => {
const itemId = $(event.currentTarget).data("item-id");
const item = this.actor.getOwnedItem(itemId);
item.sheet.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
}
}

View File

@ -0,0 +1,84 @@
import { PegasusUtility } from "./pegasus-utility.js";
export class PegasusRollDialog extends Dialog {
/* -------------------------------------------- */
static async create(actor, rollData ) {
let html
let options = { classes: ["WotGdialog"], width: 420, height: 320, 'z-index': 99999 };
if ( rollData.mode == "skill") {
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-skill.html', rollData);
options.height = 360;
} else if (rollData.mode == "chidamage") {
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-damage-chi.html', rollData);
options.height = 380;
} else if (rollData.mode == "technique") {
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-technique.html', rollData);
options.height = 380;
} else if (rollData.mode == "weapon") {
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-weapon.html', rollData);
options.height = 460;
} else {
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-skill.html', rollData);
}
return new PegasusRollDialog(actor, rollData, html, options );
}
/* -------------------------------------------- */
constructor(actor, rollData, html, options, close = undefined) {
let conf = {
title: (rollData.mode == "skill") ? "Skill" : "Roll",
content: html,
buttons: {
roll: {
icon: '<i class="fas fa-check"></i>',
label: "Roll !",
callback: () => { this.roll() }
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Cancel",
callback: () => { this.close() }
} },
default: "roll",
close: close
}
super(conf, options);
this.actor = actor;
this.rollData = rollData;
}
/* -------------------------------------------- */
roll () {
PegasusUtility.rollWotG( this.rollData )
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
var dialog = this;
function onLoad() {
}
$(function () { onLoad(); });
html.find('#negativeModifier').change((event) => {
this.rollData.negativeModifier = Number(event.currentTarget.value);
});
html.find('#positiveModifier').change((event) => {
this.rollData.positiveModifier = Number(event.currentTarget.value);
});
html.find('#specialtiesBonus').change((event) => {
this.rollData.specialtiesBonus = Number(event.currentTarget.value);
});
html.find('#selectedChi').change((event) => {
this.rollData.selectedChi = Number(event.currentTarget.value);
});
html.find('#bonusMalus').change((event) => {
this.rollData.bonusMalus = Number(event.currentTarget.value);
});
}
}

593
modules/pegasus-utility.js Normal file
View File

@ -0,0 +1,593 @@
/* -------------------------------------------- */
/* -------------------------------------------- */
export class PegasusUtility {
/* -------------------------------------------- */
static async init() {
Hooks.on('renderChatLog', (log, html, data) => PegasusUtility.chatListeners(html));
this.rollDataStore = {}
this.defenderStore = {}
}
/* -------------------------------------------- */
static getSpecs( ) {
return this.specs;
}
/* -------------------------------------------- */
static async ready() {
const specs = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.specialisations");
this.specs = specs.map(i => i.toObject());
}
/* -------------------------------------------- */
static computeAttackDefense(defenseRollId) {
let defenseRollData = this.getRollData(defenseRollId );
let attackRollData = this.getRollData(defenseRollData.linkedRollId);
let defender = game.actors.get( defenseRollData.actorId);
defender.processDefenseResult(defenseRollData, attackRollData);
}
/* -------------------------------------------- */
static applyDamage( defenseRollId) {
let defenseRollData = this.getRollData(defenseRollId );
let defender = game.actors.get( defenseRollData.actorId);
defender.applyDamageLoss( defenseRollData.finalDamage) ;
}
/* -------------------------------------------- */
static applyNoDefense( actorId, attackRollId ) {
let attackRollData = this.getRollData(attackRollId );
let defender = game.actors.get( actorId );
defender.processNoDefense( attackRollData ) ;
}
/* -------------------------------------------- */
static reduceDamageWithChi( defenseRollId) {
let defenseRollData = this.getRollData(defenseRollId );
let attackRollData = this.getRollData(defenseRollData.linkedRollId);
let defender = game.actors.get( defenseRollData.actorId);
defender.reduceDamageWithChi(defenseRollData, attackRollData);
}
/* -------------------------------------------- */
static async chatListeners(html) {
html.on("click", '.apply-technique-cost', event => {
const rollId = $(event.currentTarget).data("roll-id");
const actorId = $(event.currentTarget).data("actor-id");
const techId = $(event.currentTarget).data("technique-id");
let actor = game.actors.get( actorId);
actor.applyTechniqueCost(techId);
});
html.on("click", '.apply-defense-roll', event => {
const defenseRollId = $(event.currentTarget).data("roll-id");
this.computeAttackDefense(defenseRollId);
});
html.on("click", '.apply-nodefense', event => {
const actorId = $(event.currentTarget).data("actor-id");
const rollId = $(event.currentTarget).data("roll-id");
this.applyNoDefense(actorId, rollId);
});
html.on("click", '.apply-damage', event => {
const rollId = $(event.currentTarget).data("roll-id");
this.applyDamage(rollId);
});
}
/* -------------------------------------------- */
static async preloadHandlebarsTemplates() {
const templatePaths = [
'systems/fvtt-pegasus-rpg/templates/editor-notes-gm.html',
'systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html',
'systems/fvtt-pegasus-rpg/templates/partial-options-level.html',
'systems/fvtt-pegasus-rpg/templates/partial-options-equipment-types.html'
]
return loadTemplates(templatePaths);
}
/* -------------------------------------------- */
static templateData(it) {
return PegasusUtility.data(it)?.data ?? {}
}
/* -------------------------------------------- */
static data(it) {
if (it instanceof Actor || it instanceof Item || it instanceof Combatant) {
return it.data;
}
return it;
}
/* -------------------------------------------- */
static getChiList() {
let chi = [];
chi.push( { name: "Jade" });
chi.push( { name: "Crimson" });
chi.push( { name: "Gold" });
chi.push( { name: "White" });
chi.push( { name: "Silver" });
return chi;
}
/* -------------------------------------------- */
static getskillChiList( ) {
let skillsName = [];
let skills = this.getSkills();
console.log("SKILLS", skills);
for (let skill of skills) {
skillsName.push( { name: skill.name });
}
skillsName = skillsName.concat( this.getChiList() );
return skillsName;
}
/* -------------------------------------------- */
static createDirectOptionList( min, max) {
let options = {};
for(let i=min; i<=max; i++) {
options[`${i}`] = `${i}`;
}
return options;
}
/* -------------------------------------------- */
static buildListOptions(min, max) {
let options = ""
for (let i = min; i <= max; i++) {
options += `<option value="${i}">${i}</option>`
}
return options;
}
/* -------------------------------------------- */
static getNegativeModifiers(min, max) {
let options = ""
options += `<option value="0">0</option>`
options += `<option value="-5">-5</option>`
options += `<option value="-10">-10</option>`
return options;
}
/* -------------------------------------------- */
static getPositiveModifiers(min, max) {
let options = ""
options += `<option value="0">0</option>`
options += `<option value="5">+5</option>`
options += `<option value="10">+10</option>`
options += `<option value="15">+15</option>`
options += `<option value="20">+20</option>`
options += `<option value="30">+30</option>`
options += `<option value="40">+40</option>`
options += `<option value="50">+60</option>`
options += `<option value="60">+50</option>`
options += `<option value="70">+70</option>`
return options;
}
/* -------------------------------------------- */
static getTarget() {
if (game.user.targets && game.user.targets.size == 1) {
for (let target of game.user.targets) {
return target;
}
}
return undefined;
}
/* -------------------------------------------- */
static getDefenseState( actorId) {
return this.defenderStore[actorId];
}
/* -------------------------------------------- */
static async updateDefenseState( defenderId, rollId) {
this.defenderStore[defenderId] = rollId;
if ( game.user.character && game.user.character.id == defenderId ) {
let defender = game.actors.get( defenderId);
let chatData = {
user: game.user.id,
alias : defender.name,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat( ChatMessage.getWhisperRecipients('GM') ),
content: `<div>${defender.name} is under attack. He must roll a skill/weapon/technique to defend himself or suffer damages (button below).
<button class="chat-card-button apply-nodefense" data-actor-id="${defenderId}" data-roll-id="${rollId}" >No defense</button></div`
};
//console.log("Apply damage chat", chatData );
await ChatMessage.create( chatData );
}
}
/* -------------------------------------------- */
static clearDefenseState( defenderId) {
this.defenderStore[defenderId] = undefined;
}
/* -------------------------------------------- */
static storeDefenseState( rollData ) {
game.socket.emit("system.fvtt-weapons-of-the-gods", {
name: "msg_update_defense_state", data: { defenderId: rollData.defenderId, rollId: rollData.rollId } } );
this.updateDefenseState(rollData.defenderId, rollData.rollId );
}
/* -------------------------------------------- */
static updateRollData( rollData) {
let id = rollData.rollId;
let oldRollData = this.rollDataStore[id] || {};
let newRollData = mergeObject( oldRollData, rollData);
this.rollDataStore[id] = newRollData;
}
/* -------------------------------------------- */
static saveRollData( rollData ) {
game.socket.emit("system.pegasus-rpg", {
name: "msg_update_roll", data: rollData } ); // Notify all other clients of the roll
this.updateRollData( rollData);
}
/* -------------------------------------------- */
static getRollData( id ) {
return this.rollDataStore[id];
}
/* -------------------------------------------- */
static onSocketMesssage( msg ) {
//console.log("SOCKET MESSAGE", msg.name, game.user.character.id, msg.data.defenderId);
if (msg.name == "msg_update_defense_state" ) {
this.updateDefenseState( msg.data.defenderId, msg.data.rollId );
}
if (msg.name == "msg_update_roll" ) {
this.updateRollData( msg.data );
}
}
/* -------------------------------------------- */
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 async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium);
return await pack?.getDocuments() ?? [];
}
/* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) {
let compendiumData = await this.loadCompendiumData(compendium);
//console.log("Compendium", compendiumData);
return compendiumData.filter(filter);
}
/* -------------------------------------------- */
static async showDiceSoNice(roll, rollMode) {
if (game.modules.get("dice-so-nice")?.active) {
if (game.dice3d) {
let whisper = null;
let blind = false;
rollMode = rollMode ?? game.settings.get("core", "rollMode");
switch (rollMode) {
case "blindroll": //GM only
blind = true;
case "gmroll": //GM + rolling player
whisper = this.getUsers(user => user.isGM);
break;
case "roll": //everybody
whisper = this.getUsers(user => user.active);
break;
case "selfroll":
whisper = [game.user.id];
break;
}
await game.dice3d.showForRoll(roll, game.user, true, whisper, blind);
}
}
}
/* -------------------------------------------- */
static async rollWotG( rollData ) {
if (rollData.mode == "chidamage" ) {
let defender = game.actors.get( rollData.actorId);
defender.rollChiDamage(rollData);
return;
}
let nbDice = 0;
if ( rollData.mode == 'skill' || rollData.mode == 'technique') {
nbDice = rollData.skill?.data.level || 0;
}
if ( rollData.mode == 'weapon' ) {
rollData.skill = rollData.weapon.data.skills[rollData.skillKey];
rollData.skillAttr = rollData.weapon.data.skills[rollData.skillKey].data.attr;
nbDice = rollData.skill?.data.level || 0;
}
if ( rollData.mode == 'technique') {
// Compute number of dice
if (rollData.attr ) {
rollData.skillAttr = rollData.attr;
}
if (rollData.chi ) {
rollData.skillAttr = rollData.chi;
nbDice = rollData.skillAttr.value || 0;
}
}
if ( rollData.skill && rollData.skillAttr.value >= rollData.skill.data.level) {
nbDice++;
}
if ( nbDice == 0) nbDice = 1;
nbDice += rollData.specialtiesBonus;
// Build dice formula
let diceTab = [];
for(let i=0; i<nbDice; i++) {
diceTab[i] = "1d10";
}
let formula = "{"+ diceTab.join(',') + '}';
// Performs roll
let myRoll = rollData.roll;
if ( !myRoll ) { // New rolls only of no rerolls
myRoll = new Roll(formula).roll( { async: false} );
console.log("ROLL : ", formula);
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode") );
rollData.roll = myRoll
}
// Build the list of dices per number of occurence
let sortedRoll = [];
let bestScore = 0;
let diceResults = [];
for (let i=0; i<10; i++) {
sortedRoll[i] = 0;
}
for (let i=0; i<nbDice; i++) {
let dice1 = duplicate(myRoll.dice[i]);
if (dice1.results[0].result == 10) dice1.results[0].result = 0;
dice1.results[0].diceIndex = i;
diceResults.push( dice1.results[0] );
let nbFound = 1;
for (let j=0; j<nbDice; j++) {
if (j!=i) {
let dice2 = myRoll.dice[j];
if (dice2.results[0].result == 10) dice2.results[0].result = 0;
if (dice1.results[0].result == dice2.results[0].result) {
nbFound++;
}
}
}
let score = (nbFound * 10) + dice1.results[0].result;
if (score > bestScore) bestScore = score;
sortedRoll[dice1.results[0].result] = nbFound;
}
// Final score and keep data
rollData.nbDice = nbDice;
rollData.bestScore = bestScore;
rollData.diceResults = diceResults;
rollData.finalScore = bestScore + rollData.negativeModifier + rollData.positiveModifier;
console.log("ROLLLL!!!!", rollData);
let actor = game.actors.get(rollData.actorId);
this.createChatWithRollMode( rollData.alias, {
content: await renderTemplate(`systems/fvtt-weapons-of-the-gods/templates/chat-generic-result.html`, rollData)
});
if ( rollData.defender ) {
this.storeDefenseState( rollData );
}
this.saveRollData( rollData );
}
/* -------------------------------------------- */
static getDamageDice( result ) {
if ( result < 0) return 0;
return Math.floor(result/5) + 1;
}
/* -------------------------------------------- */
static removeDice( rollData, diceIndex) {
let diceResults = rollData.diceResults;
diceResults.splice( diceIndex, 1);
rollData.diceResults = diceResults;
rollData.nbDice = diceResults.length;
this.updateRoll(rollData);
}
/* -------------------------------------------- */
static addDice(rollId, diceValue) {
let rollData = this.getRollData( rollId );
let diceResults = rollData.diceResults;
let newResult = duplicate(diceResults[0]);
newResult.result = diceValue;
diceResults.push( newResult);
rollData.diceResults = diceResults;
rollData.nbDice = diceResults.length;
this.updateRoll(rollData);
}
/* ------------------------- ------------------- */
static async updateRoll( rollData) {
let diceResults = rollData.diceResults;
let sortedRoll = [];
for (let i=0; i<10; i++) {
sortedRoll[i] = 0;
}
for (let dice of diceResults) {
sortedRoll[dice.result]++;
}
let index = 0;
let bestRoll = 0;
for (let i=0; i<10; i++) {
if ( sortedRoll[i] > bestRoll) {
bestRoll = sortedRoll[i];
index = i;
}
}
let bestScore = (bestRoll * 10) + index;
rollData.bestScore = bestScore;
rollData.finalScore = bestScore + rollData.negativeModifier + rollData.positiveModifier;
this.saveRollData(rollData );
this.createChatWithRollMode( rollData.alias, {
content: await renderTemplate(`systems/fvtt-weapons-of-the-gods/templates/chat-generic-result.html`, rollData)
});
}
/* ------------------------- ------------------- */
static async rerollDice( actorId, diceIndex = -1 ) {
let actor = game.actors.get(actorId);
let rollData = actor.getRollData( );
if ( diceIndex == -1 ) {
rollData.hasWillpower = actor.decrementWillpower();
rollData.roll = undefined;
} else {
let myRoll = new Roll("1d6").roll( { async: false} );
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode") );
console.log("Result: ", myRoll);
rollData.roll.dice[0].results[diceIndex].result = myRoll.total; // Patch
rollData.nbStrongHitUsed++;
}
this.rollFraggedKingdom( rollData );
}
/* -------------------------------------------- */
static getUsers(filter) {
return game.users.filter(filter).map(user => user.data._id);
}
/* -------------------------------------------- */
static getWhisperRecipients(rollMode, name) {
switch (rollMode) {
case "blindroll": return this.getUsers(user => user.isGM);
case "gmroll": return this.getWhisperRecipientsAndGMs(name);
case "selfroll": return [game.user.id];
}
return undefined;
}
/* -------------------------------------------- */
static getWhisperRecipientsAndGMs(name) {
let recep1 = ChatMessage.getWhisperRecipients(name) || [];
return recep1.concat(ChatMessage.getWhisperRecipients('GM'));
}
/* -------------------------------------------- */
static blindMessageToGM(chatOptions) {
let chatGM = duplicate(chatOptions);
chatGM.whisper = this.getUsers(user => user.isGM);
chatGM.content = "Blinde message of " + game.user.name + "<br>" + chatOptions.content;
console.log("blindMessageToGM", chatGM);
game.socket.emit("system.fvtt-weapons-of-the-gods", { msg: "msg_gm_chat_message", data: chatGM });
}
/* -------------------------------------------- */
static split3Columns(data) {
let array = [ [], [], [] ];
if (data== undefined) return array;
let col = 0;
for (let key in data) {
let keyword = data[key];
keyword.key = key; // Self-reference
array[col].push( keyword);
col++;
if (col == 3) col = 0;
}
return array;
}
/* -------------------------------------------- */
static createChatMessage(name, rollMode, chatOptions) {
switch (rollMode) {
case "blindroll": // GM only
if (!game.user.isGM) {
this.blindMessageToGM(chatOptions);
chatOptions.whisper = [game.user.id];
chatOptions.content = "Message only to the GM";
}
else {
chatOptions.whisper = this.getUsers(user => user.isGM);
}
break;
default:
chatOptions.whisper = this.getWhisperRecipients(rollMode, name);
break;
}
chatOptions.alias = chatOptions.alias || name;
ChatMessage.create(chatOptions);
}
/* -------------------------------------------- */
static createChatWithRollMode(name, chatOptions) {
this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions);
}
/* -------------------------------------------- */
static buildDifficultyOptions( ) {
let options = ""
options += `<option value="0">None</option>`
options += `<option value="8">Easy</option>`
options += `<option value="12">Moderate</option>`
options += `<option value="16">Difficult</option>`
options += `<option value="18">Very Difficult</option>`
return options;
}
/* -------------------------------------------- */
static async confirmDelete(actorSheet, li) {
let itemId = li.data("item-id");
let msgTxt = "<p>Are you sure to remove this Item ?";
let buttons = {
delete: {
icon: '<i class="fas fa-check"></i>',
label: "Yes, remove it",
callback: () => {
actorSheet.actor.deleteEmbeddedDocuments( "Item", [itemId] );
li.slideUp(200, () => actorSheet.render(false));
}
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Cancel"
}
}
msgTxt += "</p>";
let d = new Dialog({
title: "Confirm removal",
content: msgTxt,
buttons: buttons,
default: "cancel"
});
d.render(true);
}
}

0
packs/specialisations.db Normal file
View File

1221
styles/simple.css Normal file

File diff suppressed because it is too large Load Diff

48
system.json Normal file
View File

@ -0,0 +1,48 @@
{
"author": "Uberwald",
"compatibleCoreVersion": "0.8.9",
"description": "Pegasus RPG system for FoundryVTT",
"download": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg/fvtt-pegasus-rpg.zip",
"esmodules": [
"modules/pegasus-main.js"
],
"gridDistance": 5,
"gridUnits": "m",
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
}
],
"library": false,
"license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg/system.json",
"manifestPlusVersion": "1.0.0",
"media": [],
"minimumCoreVersion": "0.8.0",
"name": "fvtt-pegasus-rpg",
"packs": [
{
"entity": "Item",
"label": "Specialisations",
"name": "specialisations",
"path": "./packs/specialisations.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"skill"
]
}
],
"primaryTokenAttribute": "endurance.endurance",
"secondaryTokenAttribute": "fate.value",
"socket": true,
"styles": [
"styles/simple.css"
],
"templateVersion": 4,
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "0.0.4'",
"background" : ""
}

199
template.json Normal file
View File

@ -0,0 +1,199 @@
{
"Actor": {
"types": ["character", "npc"],
"templates": {
"biodata": {
"biodata": {
"name": "",
"age": 0,
"size": "",
"weight": "",
"hair": "",
"sex": "",
"eyes": "",
"description": "",
"worstfear": "",
"desires": "",
"preferredhand": "",
"catchphrase": "",
"catchphrase_trigger": "",
"character_value": 0,
"level": 0,
"cdp": 0,
"notes": "",
"gmnotes": ""
}
},
"core": {
"subactors": [],
"statistics": {
"agi":{
"label": "Agility",
"abbrev": "agi",
"level": 1,
"mod": 0
},
"mnd":{
"label": "Mind",
"abbrev": "mnd",
"level": 1,
"mod": 0
},
"soc":{
"label": "Sociability",
"abbrev": "soc",
"level": 1,
"mod": 0
},
"str":{
"label": "Strength",
"abbrev": "str",
"level": 1,
"mod": 0
},
"phy":{
"label": "Physical",
"abbrev": "phy",
"level": 1,
"mod": 0
},
"com":{
"label": "Communication",
"abbrev": "com",
"level": 1,
"mod": 0
},
"def":{
"label": "Defense",
"abbrev": "def",
"level": 1,
"mod": 0
},
"stl":{
"label": "Stealth",
"abbrev": "stl",
"level": 1,
"mod": 0
},
"per":{
"label": "Perception",
"abbrev": "per",
"level": 1,
"mod": 0
},
"foc":{
"label": "Focus",
"abbrev": "foc",
"level": 1,
"mod": 0
}
},
"secondary": {
"health": {
"label": "Health",
"value": 0,
"max": 0
},
"delirium": {
"label": "Delirium",
"value": 0,
"max": 0
},
"nrg": {
"label": "NRJ",
"value": 0,
"max": 0
},
"mr": {
"label": "MR",
"value": 0
}
}
},
"npccore": {
"npctype": "",
"description": ""
}
},
"character": {
"templates": [ "biodata", "core" ]
},
"npc": {
"templates": [ "npccore" ]
}
},
"Item": {
"types": [ "race", "role", "ability", "specialisation", "perk", "power" , "armor", "equipment", "weapon"],
"race": {
"description": "",
"environment": "",
"society_culture": "",
"outlook": "",
"abilities": "",
"statistics": ""
},
"role": {
"description": "",
"abilities": "",
"statistics": ""
},
"ability": {
"description": ""
},
"specialisation": {
"statistic": "",
"level": 0,
"description": ""
},
"perk": {
"description": "",
"upgrades": "",
"rules": ""
},
"power": {
"rollneeded": false,
"statistic": "",
"cost": 0,
"costtype": "",
"range": "",
"action": "",
"type": "",
"effects": ""
},
"armor": {
"statistic": "",
"resistance": "",
"weight": 0,
"cost": 0,
"idr": "",
"equipped": false,
"description":""
},
"shield": {
"deftype": "",
"level": "",
"weight": 0,
"cost": 0,
"idr": "",
"equipped": false,
"description":""
},
"equipment": {
"type": "",
"cost": 0,
"weight": 0,
"idr": "",
"equipped": false,
"description":""
},
"weapon": {
"statistic": "",
"damage": "",
"cost": 0,
"weight": 0,
"idr": "",
"equipped": false,
"description": ""
}
}
}

296
templates/actor-sheet.html Normal file
View File

@ -0,0 +1,296 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="header-fields">
<div class="flexrow">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="statistics">Statistics</a>
<a class="item" data-tab="specs">Specialisations</a>
<a class="item" data-tab="powers">Powers</a>
<a class="item" data-tab="fight">Fight</a>
<a class="item" data-tab="equipment">Equipment</a>
<a class="item" data-tab="biodata">Biography</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Carac Tab --}}
<div class="tab items" data-group="primary" data-tab="statistics">
<span><a class="lock-unlock-sheet"><img class="small-button-container"
src="systems/fvtt-weapons-of-the-gods/images/icons/{{#if editScore}}unlocked.svg{{else}}locked.svg{{/if}}" alt="Unlocked/Locked"
>{{#if editScore}}Unlocked{{else}}Locked{{/if}}</a>
</span>
<div class="grid grid-2col">
<div class="">
<ul>
{{#each data.statistics as |stat key|}}
<li class="item flexrow list-item" data-attr-key="{{key}}">
<span class="stat-label flexrow" name="{{key}}"><h4><a class="roll-stat" data-stat-id="{{key}}"">{{stat.label}}</a></h4></span>
<select class="carac-base flexrow" type="text" name="data.statistics.{{key}}.value" value="{{stat.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select stat.value}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-level.html}}
{{/select}}
</select>
<input type="text" class="input-numeric-short padd-right" name="stat.mod" value="{{stat.mod}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}/>
</li>
{{/each}}
</ul>
</div>
<div class="">
<ul>
{{#each data.secondary as |stat2 key|}}
<li class="item flexrow list-item" data-attr-key="{{key}}">
<span class="stat-label flexrow" name="{{key}}"><h4>{{stat2.label}}</h4></span>
<select class="carac-base flexrow" type="text" name="data.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select stat2.value}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-level.html}}
{{/select}}
</select>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Other Tab --}}
<div class="tab items" data-group="primary" data-tab="specs">
<div>
<span class="generic-label"><h3>Specialisations</h3></span>
<ul class="stat-list alternate-list">
{{#each specs as |spec key|}}
<li class="item stat flexrow list-item" data-item-id="{{spec._id}}">
<img class="sheet-competence-img" src="{{spec.img}}"/>
<span class="stat-label">{{spec.name}}</span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
{{!-- Combat Tab --}}
<div class="tab fight" data-group="primary" data-tab="fight">
<div class="flexcol">
<ul class="stat-list alternate-list">
<li class="item stat flexrow list-item">
<span class="generic-label"><h3>Health</h3></span>
<input type="text" class="" name="data.secondary.health.value" value="{{data.secondary.health.value}}" data-dtype="Number"/>
/ {{data.secondary.health.max}}
</li>
</ul>
<span class="generic-label"><h3>Weapons</h3></span>
<ul class="stat-list alternate-list">
{{#each weapons as |weapon key|}}
<li class="item stat flexrow list-item" data-arme-id="{{weapon.id}}" data-item-id="{{weapon._id}}">
<img class="sheet-competence-img" src="{{weapon.img}}"/>
<span class="generic-label"><a class="weapon-roll">{{weapon.name}}</a></span>
<span class="generic-label">{{weapon.data.typeText}}</span>
<span class="generic-label">Speed {{weapon.data.speed}}</span>
<span class="generic-label">Damage {{weapon.data.damage}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if weapon.data.equipped}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<span class="generic-label"><h3>Armor</h3></span>
<ul class="item-list alternate-list">
{{#each armors as |armor key|}}
<li class="item stat flexrow list-item" data-item-id="{{armor._id}}">
<img class="sheet-competence-img" src="{{armor.img}}"/>
<span class="stat-label outfit-label">{{armor.name}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if armor.data.equipped}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
{{!-- Powers Tab --}}
<div class="tab fight" data-group="primary" data-tab="powers">
<div class="flexcol">
<span class="generic-label"><h3>Powers</h3></span>
<ul class="stat-list alternate-list">
{{#each powers as |power key|}}
<li class="item stat flexrow list-item" data-item-id="{{power._id}}">
<img class="sheet-competence-img" src="{{power.img}}"/>
<span class="stat-label"><a class="power-roll">{{power.name}}</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
{{!-- Equipement Tab --}}
<div class="tab equipment" data-group="primary" data-tab="equipment">
<div><h4>Equipment</h4></div>
<ul class="item-list alternate-list">
<li class="item flexrow list-item">
<span class="equipement-label">Name</span>
<span class="equipement-label">Type</span>
<div class="item-controls">
<span class="equipement-label">&nbsp;</span>
<span class="equipement-label">&nbsp;</span>
<span class="equipement-label">&nbsp;</span>
</div>
</li>
{{#each equipments as |equip key|}}
<li class="item flexrow list-item" data-item-id="{{equip._id}}">
<img class="sheet-competence-img" src="{{equip.img}}"/>
<span class="equipement-label">{{equip.name}}</span>
<span class="equipement-label">{{equip.type}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if equip.data.equipped}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
{{!-- Biography Tab --}}
<div class="tab biodata" data-group="primary" data-tab="biodata">
<div class="grid grid-2col">
<div>
<ul>
<li class="flexrow">
<label class="generic-label">Origin</label>
<input type="text" class="" name="data.biodata.origin" value="{{data.biodata.origin}}" data-dtype="String"/>
</li>
<li class="flexrow">
<label class="generic-label">Age</label>
<input type="text" class="" name="data.biodata.age" value="{{data.biodata.age}}" data-dtype="String"/>
</li>
<li class="flexrow">
<label class="generic-label">Height</label>
<input type="text" class="" name="data.biodata.size" value="{{data.biodata.size}}" data-dtype="String"/>
</li>
<li class="flexrow">
<label class="generic-label">Eyes</label>
<input type="text" class="" name="data.biodata.eyes" value="{{data.biodata.eyes}}" data-dtype="String"/>
</li>
<li class="flexrow">
<label class="generic-label">Hair</label>
<input type="text" class="" name="data.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String"/>
</li>
</ul>
</div>
<div>
<ul>
<li class="flexrow">
<label class="generic-label">Rank</label>
<select class="competence-base flexrow" type="text" name="data.biodata.rank" value="{{data.biodata.rank}}" data-dtype="Number">
{{#select data.biodata.rank}}
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
{{/select}}
</select>
</li>
<li class="flexrow">
<label class="generic-label">Weight</label>
<input type="text" class="" name="data.biodata.weight" value="{{data.biodata.weight}}" data-dtype="String"/>
</li>
<li class="flexrow">
<label class="generic-label">Archetype</label>
<input type="text" class="" name="data.biodata.archetype" value="{{data.biodata.archetype}}" data-dtype="String"/>
</li>
<li class="flexrow">
<label class="generic-label">Sex</label>
<input type="text" class="" name="data.biodata.sex" value="{{data.biodata.sex}}" data-dtype="String"/>
</li>
</ul>
</div>
</div>
<hr>
<h3>Destiny : </h3>
<ul>
<li class="flexrow">
<label class="short-label">Achieved (Total) : </label>
<input type="text" class="" name="data.destiny.achieved" value="{{data.destiny.achieved}}" data-dtype="Number"/>
</li>
<li class="flexrow">
<label class="short-label">Avanced (Spent) : </label>
<input type="text" class="" name="data.destiny.advanced" value="{{data.destiny.advanced}}" data-dtype="Number"/>
</li>
<li class="flexrow">
<label class="short-label">Held back (available) : </label>
<input type="text" class="" name="data.destiny.available" value="{{data.destiny.available}}" data-dtype="Number"/>
</li>
</ul>
<hr>
<h3>Goals : </h3>
<ul>
<li class="flexrow">
<label class="short-label">Immediate : </label>
<input type="text" class="" name="data.biodata.goalimmediate" value="{{data.biodata.goalimmediate}}" data-dtype="String"/>
</li>
<li class="flexrow">
<label class="short-label">Futur : </label>
<input type="text" class="" name="data.biodata.goalfutur" value="{{data.biodata.goalfutur}}" data-dtype="String"/>
</li>
<li class="flexrow">
<label class="short-label">Passion : </label>
<input type="text" class="" name="data.biodata.passion" value="{{data.biodata.passion}}" data-dtype="String"/>
</li>
</ul>
<hr>
<h3>History : </h3>
<div class="form-group editor">
{{editor content=data.biodata.description target="data.biodata.description" button=true owner=owner editable=editable}}
</div>
<hr>
<h3>Notes : </h3>
<div class="form-group editor">
{{editor content=data.biodata.notes target="data.biodata.notes" button=true owner=owner editable=editable}}
</div>
<hr>
</article>
</div>
</section>
</form>

View File

@ -0,0 +1,61 @@
<div class="chat-message-header">
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
<h4 class=chat-actor-name>{{alias}}</h4>
</div>
<hr>
<div >
<img class="chat-icon" src="{{img}}" alt="{{name}}" />
<h4>
{{#if (eq mode "skill")}}
Skill : {{skill.name}}
{{else}}
{{#if (eq mode "technique")}}
Technique : {{technique.name}}
{{else}}
{{#if (eq mode "weapon")}}
Weapon attack : {{weapon.name}}
{{/if}}
{{/if}}
{{/if}}
</h4>
</div>
<div class="flexcol">
<div class="dice-total">
{{#each diceResults as |diceResult key|}}
<div class="dice">
{{#if (gt @root.nbDice 2)}}
<a class="dice-to-river" data-actor-id="{{@root.actorId}}" data-roll-id="{{@root.rollId}}" data-dice-index="{{key}}" data-dice-value="{{diceResult.result}}">
{{/if}}
<label>{{diceResult.result}}</label>
<img src="systems/fvtt-weapons-of-the-gods/images/dice/d10black.svg" />
{{#if (gt @root.nbDice 2)}}
</a>
{{/if}}
</div>
{{/each}}
</div>
<div>
<ul>
{{#if (eq mode "technique")}}
<li>{{technique.data.chicolor}} Chi cost : {{technique.data.chicost}} </li>
<li><button class="chat-card-button apply-technique-cost" data-actor-id="{{actorId}}" data-roll-id="{{@root.rollId}}" data-technique-id="{{technique._id}}">Apply Chi cost</button></li>
<li>Effect description : {{technique.data.effectdescription}}</li>
{{/if}}
{{#if (eq mode "weapon")}}
<li>Effect description : {{weapon.data.effectdescription}}</li>
{{/if}}
<li>Modifiers : {{negativeModifier}} / {{positiveModifier}} </li>
<li><strong>Total Roll : {{finalScore}}</strong>
{{#if linkedRollId}}
<li><button class="chat-card-button apply-defense-roll" data-roll-score="{{finalScore}}" data-roll-id="{{@root.rollId}}" data-actor-id="{{actorId}}" data-defender-id="{{defenseAttackerId}}">Use this Roll as defense</button></li>
{{/if}}
</ul>
</div>
</div>

View File

@ -0,0 +1,15 @@
<div class="chat-message-header">
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
<h4 class=chat-actor-name>{{defenderName}}</h4>
</div>
<hr>
<div>
<ul>
<li>{{defenderName}} suffer damages from {{attackerName}} !</li>
<li>Damages (inc. armor+weapon) : {{finalDamage}}</li>
<li><button class="chat-card-button reduce-damage-chi" data-actor-id="{{actorId}}" data-roll-id="{{rollId}}" >Oppose damage roll with Chi</button></li>
<li><button class="chat-card-button apply-damage" data-actor-id="{{actorId}}" data-roll-id="{{rollId}}" >Apply damage</button></li>
</ul>
</div>

View File

@ -0,0 +1,11 @@
<div class="chat-message-header">
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
<h4 class=chat-actor-name>{{defenderName}}</h4>
</div>
<hr>
<div >
{{defenderName}} wins the opposition against {{attackerName}} !
</div>
</div>

View File

@ -0,0 +1,6 @@
{{#if data.isGM}}
<h3>GM Notes : </h3>
<div class="form-group editor">
{{editor content=data.gmnotes target="data.gmnotes" button=true owner=owner editable=editable}}
</div>
{{/if}}

View File

@ -0,0 +1,20 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<label class="generic-label">Description</label>
<div class="small-editor item-text-long-line">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,46 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Related Statistic</label>
<select class="competence-base flexrow" type="text" name="data.statistic" value="{{data.statistic}}" data-dtype="String">
{{#select data.statistic}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Resistance</label>
<input type="text" class="padd-right" name="data.resistance" value="{{data.resistance}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.equipped" {{checked data.equipped}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Weight</label>
<input type="text" class="input-numeric-short padd-right" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">IDR</label>
<input type="text" class="padd-right" name="data.idr" value="{{data.idr}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Description</label>
<div class="small-editor item-text-long-line">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,42 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Type</label>
<select class="competence-base flexrow" type="text" name="data.type" value="{{data.type}}" data-dtype="String">
{{#select data.statistic}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-equipment-types.html}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.equipped" {{checked data.equipped}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Weight</label>
<input type="text" class="input-numeric-short padd-right" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">IDR</label>
<input type="text" class="padd-right" name="data.idr" value="{{data.idr}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Description</label>
<div class="small-editor item-text-long-line">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,28 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<label class="generic-label">Description</label>
<div class="small-editor item-text-long-line">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Upgrades</label>
<div class="small-editor item-text-long-line">
{{editor content=data.upgrades target="data.upgrades" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Rules</label>
<div class="small-editor item-text-long-line">
{{editor content=data.rules target="data.rules" button=true owner=owner editable=editable}}
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,66 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Roll Needed ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.rollneeded" {{checked data.rollneeded}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Related Statistic (only if roll is needed)</label>
<select class="competence-base flexrow" type="text" name="data.statistic" value="{{data.statistic}}" data-dtype="String">
{{#select data.statistic}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Cost Type</label>
<select class="competence-base flexrow" type="text" name="data.costtype" value="{{data.costtype}}" data-dtype="String">
{{#select data.family}}
<option value="once">Once</option>
<option value="perlevel">Per Level</option>
<option value="perround">Per Round</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Range</label>
<input type="text" class="input-numeric-short padd-right" name="data.range" value="{{data.range}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Action</label>
<select class="competence-base flexrow" type="text" name="data.action" value="{{data.action}}" data-dtype="String">
{{#select data.action}}
<option value="soft">Soft</option>
<option value="hard">Hard</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Type</label>
<select class="competence-base flexrow" type="text" name="data.type" value="{{data.type}}" data-dtype="String">
{{#select data.type}}
<option value="instant">Instant</option>
<option value="active">Active</option>
<option value="permanent">Permanent</option>
<option value="reactive">Reactive</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Effects</label>
<div class="small-editor item-text-long-line">
{{editor content=data.effects target="data.effects" button=true owner=owner editable=editable}}
</div>
</li>
<
</div>
</section>
</form>

View File

@ -0,0 +1,40 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<label class="generic-label">Description</label>
<div class="small-editor item-text-long-line">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Environment</label>
<div class="small-editor item-text-long-line">
{{editor content=data.environment target="data.environment" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Society/Culture</label>
<div class="small-editor item-text-long-line">
{{editor content=data.society_culture target="data.society_culture" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Outlook</label>
<div class="small-editor item-text-long-line">
{{editor content=data.outlook target="data.outlook" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Abilities</label>
<div class="small-editor item-text-long-line">
{{editor content=data.abilities target="data.abilities" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Statistics</label>
<div class="small-editor item-text-long-line">
{{editor content=data.statistics target="data.statistics" button=true owner=owner editable=editable}}
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,28 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<label class="generic-label">Description</label>
<div class="small-editor item-text-long-line">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Abilities</label>
<div class="small-editor item-text-long-line">
{{editor content=data.abilities target="data.abilities" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Statistics</label>
<div class="small-editor item-text-long-line">
{{editor content=data.statistics target="data.statistics" button=true owner=owner editable=editable}}
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,48 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Defense Type</label>
<select class="competence-base flexrow" type="text" name="data.deftype" value="{{data.deftype}}" data-dtype="String">
<option value="dodge">Dodge</option>
<option value="block">Block</option>
</select>
</li>
<li class="flexrow"><label class="generic-label">Dice Level</label>
<select class="competence-base flexrow" type="text" name="data.level" value="{{data.level}}" data-dtype="Number">
{{#select data.level}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-level.html}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.equipped" {{checked data.equipped}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Weight</label>
<input type="text" class="input-numeric-short padd-right" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">IDR</label>
<input type="text" class="input-numeric-short padd-right" name="data.idr" value="{{data.idr}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Description</label>
<div class="small-editor item-text-long-line">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,36 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Related Statistic</label>
<select class="competence-base flexrow" type="text" name="data.statistic" value="{{data.statistic}}" data-dtype="String">
{{#select data.statistic}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Level</label>
<select class="competence-base flexrow" type="text" name="data.level" value="{{data.level}}" data-dtype="Number">
{{#select data.level}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-level.html}}
{{/select}}
</select>
</li>
</ul>
<div class="small-editor item-text-long-line">
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</section>
</form>

View File

@ -0,0 +1,46 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Related Statistic</label>
<select class="competence-base flexrow" type="text" name="data.statistic" value="{{data.statistic}}" data-dtype="String">
{{#select data.statistic}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Damage</label>
<input type="text" class="padd-right" name="data.damage" value="{{data.damage}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Equipped ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.equipped" {{checked data.equipped}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Weight</label>
<input type="text" class="input-numeric-short padd-right" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Cost</label>
<input type="text" class="input-numeric-short padd-right" name="data.cost" value="{{data.cost}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">IDR</label>
<input type="text" class="padd-right" name="data.idr" value="{{data.idr}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Description</label>
<div class="small-editor item-text-long-line">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</li>
</ul>
</div>
</section>
</form>

184
templates/npc-sheet.html Normal file
View File

@ -0,0 +1,184 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="header-fields">
<div class="flexrow">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="attribute">Main</a>
<a class="item" data-tab="defence">Defence/Weapons</a>
<a class="item" data-tab="equipment">Equipment</a>
<a class="item" data-tab="notes">Notes</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Carac Tab --}}
<div class="tab items" data-group="primary" data-tab="attribute">
<span><a class="lock-unlock-sheet"><img class="small-button-container"
src="systems/fvtt-fragged-kingdom/images/icons/{{#if editScore}}unlocked.svg{{else}}locked.svg{{/if}}" alt="Unlocked/Locked"
>{{#if editScore}}Unlocked{{else}}Locked{{/if}}</a>
</span>
<div class="grid grid-2col">
<div class="">
<span class="generic-label"><h3>Type</h3>
<select class="competence-base flexrow" type="text" name="data.npctype" value="{{data.npctype}}" data-dtype="String" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.npctype}}
<option value="henchman">Henchman</option>
<option value="drone">Troop</option>
{{/select}}
</select> </span>
<button class="npc-skill-roll">Generic Skill roll</button>
<div>
<span class="generic-label"><h3>Traits List</h3></span>
<ul>
{{#each traits as |trait key|}}
<li class="item flexrow list-item" data-item-id="{{trait.id}}">
<img class="sheet-competence-img" src="{{trait.img}}"/>
<span class="competence-label">{{trait.name}}</span>
<span class="competence-label">{{trait.data.data.type}}</span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
<div class="">
<span class="generic-label"><h3>Stats & Numbers</h3></span>
<ul>
{{#each data.spec as |spec key|}}
<li class="item flexrow list-item stack-left" data-attr-key="{{key}}">
<span class="stat-label padd-right npc-stat-label" name="{{key}}">{{spec.label}}</span>
<input type="text" class="input-numeric-short padd-right" name="data.spec.{{key}}.value" value="{{spec.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}/>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Defence Tab --}}
<div class="tab defence" data-group="primary" data-tab="defence">
<div class="flexcol">
<div class="">
{{#each data.fight as |fight key|}}
<ul>
<li class="item flexrow list-item stack-left">
<span class="stat-label padd-right"><strong>{{fight.label}}</strong></span>
<input type="text" class="input-numeric-short padd-right" name="data.fight.{{key}}.value" value="{{fight.value}}" data-dtype="Number"/>
</li>
{{#each fight.derivated as |derivated keydev|}}
<li class="item flexrow list-item">
<span class="stat-label flexrow ">{{derivated.label}}</span>
<input type="text" class="input-numeric-short padd-right" name="data.fight.{{key}}.derivated.{{keydev}}.value" value="{{derivated.value}}" data-dtype="Number"/>
</li>
{{/each}}
</ul>
{{/each}}
</div>
<span class="generic-label"><h3>Weapons</h3></span>
<ul class="stat-list alternate-list">
{{#each weapons as |weapon key|}}
<li class="item stat flexrow list-item" data-arme-id="{{weapon.id}}" data-item-id="{{weapon.id}}">
<img class="sheet-competence-img" src="{{weapon.img}}"/>
<span class="stat-label">{{weapon.name}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if weapon.data.data.equipped}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
<li class="item stat flexrow list-item stats-table" data-armure-id="{{weapon.id}}" data-item-id="{{weapon.id}}">
{{#each weapon.data.data.weaponstats as |weaponstat statkey|}}
<ul>
<li class="item stat flexrow list-item" data-item-id="{{weapon.id}}" data-stat-id={{statkey}}><span class="stat-label weapon-label"><a name="{{weapon.name}}">Attack with {{weaponstat.name}}</a></span>
</li>
<li>{{> "systems/fvtt-fragged-kingdom/templates/weapon-stats-section.html" stats=weaponstat.data.statstotal isfinal=false header=true}}
</li>
</ul>
{{/each}}
</li>
{{/each}}
</ul>
</div>
</div>
{{!-- Traits Tab --}}
<div class="tab traits" data-group="primary" data-tab="traits">
</div>
{{!-- Features Tab --}}
<div class="tab equipment" data-group="primary" data-tab="equipment">
<div class="flexcol">
<div><h4>Equipment</h4></div>
<ul class="item-list alternate-list">
<li class="item flexrow list-item">
<span class="equipement-label">Name</span>
<span class="equipement-label">Type</span>
<div class="item-controls">
<span class="equipement-label">&nbsp;</span>
<span class="equipement-label">&nbsp;</span>
<span class="equipement-label">&nbsp;</span>
</div>
</li>
{{#each equipments as |equip key|}}
<li class="item flexrow list-item" data-item-id="{{equip.id}}">
<img class="sheet-competence-img" src="{{equip.img}}"/>
<span class="equipement-label">{{equip.name}}</span>
<span class="equipement-label">{{equip.type}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if equip.data.data.equipped}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
{{!-- Notes Tab --}}
<div class="tab notes" data-group="primary" data-tab="notes">
<article class="flexcol">
<h3>Description : </h3>
<div class="form-group editor">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
<hr>
<h3>Notes : </h3>
<div class="form-group editor">
{{editor content=data.notes target="data.notes" button=true owner=owner editable=editable}}
</div>
<hr>
{{>"systems/fvtt-fragged-kingdom/templates/editor-notes-gm.html"}}
</article>
</div>
</section>
</form>

View File

@ -0,0 +1,13 @@
<option value="camping">Camping & Survival</option>
<option value="communication">Communication & Information</option>
<option value="equestrian">Equestrian</option>
<option value="spy">Law/Security/Spy/Thief</option>
<option value="medical">Medical</option>
<option value="tools">Tools</option>
<option value="weaponaccess">Weapons accessories</option>
<option value="wizard">Wizards materials</option>
<option value="mount">Mounts</option>
<option value="vehicle">Vehicles</option>
<option value="clothing">Clothing</option>
<option value="ammo">Ammo</option>
<option value="misc">Misc</option>

View File

@ -0,0 +1,10 @@
<option value="1">d4</option>
<option value="2">d6</option>
<option value="3">d8</option>
<option value="4">d10</option>
<option value="5">d12</option>
<option value="6">d12 d4</option>
<option value="7">d12 d6</option>
<option value="8">d12 d8</option>
<option value="9">d12 d10</option>
<option value="10">d12 d12</option>

View File

@ -0,0 +1,10 @@
<option value="agi">AGI</option>
<option value="mnd">MND</option>
<option value="soc">SOC</option>
<option value="str">STR</option>
<option value="phy">PHY</option>
<option value="com">COM</option>
<option value="def">DEF</option>
<option value="stl">STL</option>
<option value="per">PER</option>
<option value="foc">FOC</option>

28
templates/post-item.html Normal file
View File

@ -0,0 +1,28 @@
<div class="post-item" data-transfer="{{transfer}}">
<h3><b>{{name}}</b></h3>
{{#if img}}
<img class="chat-img" src="{{img}}" title="{{name}}" />
{{/if}}
{{#if (eq type "weapon")}}
{{#each data.weaponstats as |weaponstat rootkey|}}
{{#if weaponstat.deleted}}
{{else}}
<h4>Stats for {{weaponstat.name}}</h4>
{{> "systems/fvtt-fragged-kingdom/templates/weapon-stats-section-tchat.html" stats=weaponstat.data.statstotal isfinal=false header=false}}
{{/if}}
{{/each}}
{{else}}
{{#if data.statstotal}}
{{> "systems/fvtt-fragged-kingdom/templates/weapon-stats-section-tchat.html" stats=data.statstotal isfinal=false title="" header=true}}
{{else}}
{{#if data.stats}}
{{> "systems/fvtt-fragged-kingdom/templates/weapon-stats-section-tchat.html" stats=data.stats isfinal=false title="" header=true}}
{{/if}}
{{/if}}
{{/if}}
<h4><b>Description : </b></h4>
<p class="card-content">{{{data.description}}}</p>
</div>

View File

@ -0,0 +1,22 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="floxrow">
<div class="flexrow">
<span class="roll-dialog-label" >Select Chi : </span>
<select class="roll-dialog-label" id="selectedChi" type="text" name="selectedChi" value="{{selectedChi}}" data-dtype="String">
{{#select selectedChi}}
{{#each chiList as |chi key|}}
<option value="{{chi.key}}">{{chi.chi}} ({{chi.chiscore}})</option>
{{/each}}
{{/select}}
</select>
</div>
</div>
</form>

View File

@ -0,0 +1,46 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="floxrow">
<div class="flexrow">
<span class="roll-dialog-label" >{{skillAttr.label}} : {{skillAttr.value}}</span>
<span class="roll-dialog-label" >Skill Level : {{skill.data.level}}</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label" >Specialties reminder : </span>
<span class="roll-dialog-label" >{{skill.data.specialties}}</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label" >Specialties Dices Bonus : </span>
<select class="competence-base" id="specialtiesBonus" type="text" name="specialtiesBonus" value="{{specialtiesBonus}}" data-dtype="Number">
{{#select specialtiesBonus}}
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label" >Negative Modifier :</span>
<select class="roll-dialog-label" id="negativeModifier" type="text" name="negativeModifier" value="{{negativeModifier}}" data-dtype="Number">
{{#select negativeModifier}}
{{{optionsNegative}}}
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label" >Positive Modifier :</span>
<select class="roll-dialog-label" id="positiveModifier" type="text" name="positiveModifier" value="{{positiveModifier}}" data-dtype="Number">
{{#select positiveModifier}}
{{{optionsPositive}}}
{{/select}}
</select>
</div>
</div>
</form>

View File

@ -0,0 +1,56 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="flexcol">
<div class="flexrow">
<span class="roll-dialog-label" >Select Skill : </span>
<select class="roll-dialog-label" id="skillKey" type="text" name="skillKey" value="{{skillKey}}" data-dtype="String">
{{#select skillKey}}
{{#each weapon.data.skills as |skill key|}}
<option value="{{key}}">{{skill.name}} ({{skill.data.level}}) - {{skill.data.attr.label}}</option>
{{/each}}
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label" >Specialties reminder : </span>
<span class="roll-dialog-label" >{{skill.data.specialties}}</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label" >Specialties Dices Bonus : </span>
<select class="roll-dialog-label" id="specialtiesBonus" type="text" name="specialtiesBonus" value="{{specialtiesBonus}}" data-dtype="Number">
{{#select specialtiesBonus}}
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label" >Negative Modifier :</span>
<select class="roll-dialog-label" id="negativeModifier" type="text" name="negativeModifier" value="{{negativeModifier}}" data-dtype="Number">
{{#select negativeModifier}}
{{{optionsNegative}}}
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label" >Positive Modifier :</span>
<select class="roll-dialog-label" id="positiveModifier" type="text" name="positiveModifier" value="{{positiveModifier}}" data-dtype="Number">
{{#select positiveModifier}}
{{{optionsPositive}}}
{{/select}}
</select>
</div>
</div>
</form>