Opposite tests

This commit is contained in:
LeRatierBretonnien 2020-06-11 00:29:32 +02:00
parent 89f31a590a
commit b16e977b19
79 changed files with 184 additions and 35 deletions

View File

@ -27,9 +27,9 @@ long_line_behaviour=1
long_line_column=72
[files]
current_page=11
current_page=1
FILE_NAME_0=8132;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2
FILE_NAME_1=2638;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2
FILE_NAME_1=0;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2
FILE_NAME_2=10137;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2
FILE_NAME_3=1756;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-roll-dialog.js;0;2
FILE_NAME_4=2092;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2
@ -39,7 +39,7 @@ FILE_NAME_7=543;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2
FILE_NAME_8=1639;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-competence-sheet.html;0;2
FILE_NAME_9=752;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-arme-sheet.html;0;2
FILE_NAME_10=401;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fsystem.json;0;2
FILE_NAME_11=146;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2
FILE_NAME_11=10349;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2
[VTE]
last_dir=/home/sigmar

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
icons/armes/icon_baton.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
icons/armes/icon_dague.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
icons/armes/icon_fleau.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
icons/armes/icon_fouet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
icons/armes/icon_lance.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
icons/armes/icon_masse.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
icons/armes/token_10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
icons/armes/token_12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
icons/armes/token_13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
icons/armes/token_14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
icons/competence_arc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
icons/competence_fleau.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
icons/competence_fouet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
icons/competence_fronde.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
icons/competence_lance.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -96,23 +96,33 @@ export class RdDActor extends Actor {
// Fight management !
let defenseMsg;
let encaisser = false;
let specialStr = "<br>Points de taches : " + rollData.pointsDeTache; // Per default
if ( rollData.arme ) { // In case of fight, replace the "tache" per dommages + localization. "tache" indicates if result is OK or not
if ( rollData.pointsDeTache > 0 ) {
let myroll = new Roll("2d10");
myroll.roll();
rollData.degats = parseInt(myroll.result) + parseInt(rollData.arme.data.dommages) + parseInt(this.data.data.attributs.plusdom.value);
rollData.loc = RdDUtility.getLocalisation();
for (let target of game.user.targets) {
defenseMsg = RdDutility.buildDefenseChatCard(this, target, rollData );
specialStr = "<br><strong>Cible</strong> : " + target.actor.data.name;
if ( rollData.attackerRoll) {
if ( rollData.pointsDeTache > 0 ) { // Réussite !
specialStr = "<br><strong>Attaque parée/esquivée !</strong>";
} else {
specialStr = "<br><strong>Esquive/Parade échouée, encaissement !</strong>";
encaisser = true;
}
} else {
if ( rollData.pointsDeTache > 0 ) {
let myroll = new Roll("2d10");
myroll.roll();
rollData.degats = parseInt(myroll.result) + parseInt(rollData.arme.data.dommages) + parseInt(this.data.data.attributs.plusdom.value);
rollData.loc = RdDUtility.getLocalisation();
for (let target of game.user.targets) {
defenseMsg = RdDUtility.buildDefenseChatCard(this, target, rollData );
specialStr = "<br><strong>Cible</strong> : " + target.actor.data.name;
}
specialStr += "<br>Dommages : " + rollData.degats + "<br>Localisation : " + rollData.loc.label;
} else {
specialStr = "<br>Echec ! Pas de dommages";
}
specialStr += "<br>Dommages : " + rollData.degats + "<br>Localisation : " + rollData.loc.label;
} else {
specialStr = "<br>Echec ! Pas de dommages";
}
}
// Save it for fight
await this.setFlag( "foundryvtt-reve-de-dragon", "rollData", undefined );
await this.setFlag( "foundryvtt-reve-de-dragon", "rollData", rollData );
@ -125,9 +135,14 @@ export class RdDActor extends Actor {
}
ChatMessage.create( chatOptions );
// This an attack, generate the defense message
if ( defenseMsg ) { // target hit !
ChatMessage.create( defenseMsg );
}
}
// Get damages!
if ( encaisser ) {
this.encaisserDommages( rollData );
}
}
/* -------------------------------------------- */
@ -265,7 +280,7 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
async rollCompetence( compName, armeItem )
async rollCompetence( compName, armeItem=undefined, attackerRoll=undefined )
{
console.log("!!!!!!", compName, armeItem);
let compItem = RdDUtility.findCompetence( this.data.items, compName);
@ -276,6 +291,7 @@ export class RdDActor extends Actor {
"bonusmalusTable": CONFIG.RDD.bonusmalus,
"etat": this.data.data.compteurs.etat.value,
"bmValue": 0,
"attackerRoll": attackerRoll,
"finalLevel": 0
}
@ -295,10 +311,10 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
encaisserDommages( attackerActor )
{
let attackerRoll = attackerActor.getFlag("foundryvtt-reve-de-dragon", "rollData");
console.log("RollData!", attackerActor, attackerRoll);
encaisserDommages( rollData )
{
let attackerRoll = rollData.attackerRoll;
console.log("RollData from attacker!", rollData);
let degatsReel = attackerRoll.degats - this.computeArmure(attackerRoll.loc);
let result = RdDUtility.computeBlessuresSante(degatsReel);
this.santeIncDec("vie", result.vie);
@ -317,9 +333,11 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
parerAttaque( attackerActor, armeId )
parerAttaque( attackerRoll, armeId )
{
console.log("Going to PARY !!!!!!!!!");
let armeItem = this.getOwnedItem(armeId); // Item.data.data !
console.log("Going to PARY !!!!!!!!!", armeItem, attackerRoll.bmValue);
this.rollCompetence( armeItem.data.data.competence, armeItem.data, attackerRoll );
}
/* -------------------------------------------- */

View File

@ -75,12 +75,7 @@ export class RdDRollDialog extends Dialog {
$("#bonusmalus").val( rollData.bmValue );
updateRollResult(rollData);
});
// Replace again the button action, as i overwritten it
//$('button').click((event) => {
//mydialog.data.actor.performRoll(rollData);
//});
// Update !
$('#bonusmalus').click((event) => {
rollData.bmValue = event.currentTarget.value; // Update the selected bonus/malus

View File

@ -1,5 +1,7 @@
/* Common useful functions shared between objects */
import { RdDActor } from "./actor.js";
const level_category = {
"generale": "-4",
"particuliere": "-8",
@ -370,7 +372,7 @@ export class RdDUtility {
{
for (const item of compList) {
if (item.name == compName) {
console.log("Found item !", item);
//console.log("Found item !", item);
return item;
}
}
@ -397,9 +399,9 @@ export class RdDUtility {
if ( rollData.competence.data.categorie == "melee" ) { // Melee attack
let defenderArmes = [];
for (const arme of target.actor.data.items) {
if (arme.type == "arme" && isArmeMelee(arme.data.competence)) {
if (arme.type == "arme" && this.isArmeMelee(arme.data.competence)) {
defenderArmes.push( arme );
defenseMsg.content += "<a class='chat-card-button' id='parer-button' data-attackerid='"+attacker.data._id + "' data-defenderid='" + target.actor.data._id + " data-armeid='"+arme._id+"'>Parer avec " + arme.name + "</a></span>";
defenseMsg.content += "<br><a class='chat-card-button' id='parer-button' data-attackerid='"+attacker.data._id + "' data-defenderid='" + target.actor.data._id + "' data-armeid='"+arme._id+"'>Parer avec " + arme.name + "</a></span>";
}
}
}
@ -416,16 +418,17 @@ export class RdDUtility {
console.log("Encaisser button", event);
let attackerActor = game.actors.get(event.currentTarget.attributes['data-attackerid'].value );
let defenderActor = game.actors.get(event.currentTarget.attributes['data-defenderid'].value );
defenderActor.encaisserDommages( attackerActor);
let rollData = attackerActor.getFlag("foundryvtt-reve-de-dragon", "rollData");
defenderActor.encaisserDommages( rollData );
});
html.on("click", '#parer-button', event => {
event.preventDefault();
console.log("Parer button", event);
let attackerActor = game.actors.get(event.currentTarget.attributes['data-attackerid'].value );
let defenderActor = game.actors.get(event.currentTarget.attributes['data-defenderid'].value );
let armeId = event.currentTarget.attributes['data-armeid'].value;
defenderActor.parerAttaque( attackerActor, armeId);
let rollData = attackerActor.getFlag("foundryvtt-reve-de-dragon", "rollData");
defenderActor.parerAttaque( rollData, armeId);
});
}

BIN
pic/haut_reve_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
pic/nitouche_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
pic/terres_medianes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
pic/voyageurs_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

View File

@ -341,3 +341,131 @@ button {
.flex-fatigue {
flex-grow: 2;
}
/* ======================================== */
/* Sidebar CSS */
#sidebar-tabs > .item.active {
color: #FFF;
border: 1px solid red;
box-shadow: 0 0 6px inset #ff6400;
}
#sidebar #sidebar-tabs i.fa-comments::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-comments {
content: "";
background-image: url("ui/icon_sidebar_chat.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}
#sidebar #sidebar-tabs i.fa-fist-raised::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-fist-raised {
content: "";
background-image: url("ui/icon_sidebar_fight.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}
#sidebar #sidebar-tabs i.fa-users::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-users {
content: "";
background-image: url("ui/icon_sidebar_actor.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}
#sidebar #sidebar-tabs i.fa-map::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-map {
content: "";
background-image: url("ui/icon_sidebar_scene.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}
#sidebar #sidebar-tabs i.fa-suitcase::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-suitcase {
content: "";
background-image: url("ui/icon_sidebar_item.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}
#sidebar #sidebar-tabs i.fa-book-open::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-book-open {
content: "";
background-image: url("ui/icon_sidebar_journal.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}
#sidebar #sidebar-tabs i.fa-th-list::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-th-list {
content: "";
background-image: url("ui/icon_sidebar_rolltable.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}
#sidebar #sidebar-tabs i.fa-music::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-music {
content: "";
background-image: url("ui/icon_sidebar_music.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}
#sidebar #sidebar-tabs i.fa-atlas::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-atlas {
content: "";
background-image: url("ui/icon_sidebar_compendium.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}
#sidebar #sidebar-tabs i.fa-cogs::before {
content: "";
}
#sidebar #sidebar-tabs i.fa-cogs {
content: "";
background-image: url("ui/icon_sidebar_settings.png") !important;
width: 25px !important;
height: 25px !important;
display: inline-block !important;
background-position:center !important;
background-size:cover !important;
}

5
styles/ui/.directory Normal file
View File

@ -0,0 +1,5 @@
[Dolphin]
HeaderColumnWidths=634,87,118
Timestamp=2020,6,10,17,19,0
Version=4
ViewMode=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB