Gestion armures

This commit is contained in:
2020-06-23 23:34:12 +02:00
parent 30a9f08f73
commit d24be22c5e
14 changed files with 101 additions and 22 deletions

View File

@ -394,11 +394,25 @@ export class RdDActor extends Actor {
}
}
/* -------------------------------------------- */
equiperObjet( itemID )
{
let item = this.getOwnedItem(itemID);
if ( item && item.data.data )
item.data.data.equipe = !item.data.data.equipe;
}
/* -------------------------------------------- */
computeArmure( locData )
{
/* TODO */
return 0;
let protection = 0;
for (const item of this.data.items) {
if (item.type == "armure" && item.data.equipe) {
protection += item.data.protection;
}
}
console.log("Final protect", protection);
return protection;
}
/* -------------------------------------------- */