More automatism
This commit is contained in:
parent
de4a9024fe
commit
15342a65fc
16
RdD.geany
16
RdD.geany
@ -28,19 +28,17 @@ long_line_column=72
|
|||||||
|
|
||||||
[files]
|
[files]
|
||||||
current_page=4
|
current_page=4
|
||||||
FILE_NAME_0=5110;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2
|
FILE_NAME_0=6135;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2
|
||||||
FILE_NAME_1=332;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2
|
FILE_NAME_1=1602;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2
|
||||||
FILE_NAME_2=1730;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fdialog-competence.html;0;2
|
FILE_NAME_2=1792;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fdialog-competence.html;0;2
|
||||||
FILE_NAME_3=1479;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2
|
FILE_NAME_3=4217;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2
|
||||||
FILE_NAME_4=2451;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2
|
FILE_NAME_4=405;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2
|
||||||
FILE_NAME_5=6844;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-utility.js;0;2
|
FILE_NAME_5=12392;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-utility.js;0;2
|
||||||
FILE_NAME_6=335;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-competence-sheet.html;0;2
|
FILE_NAME_6=335;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Fitem-competence-sheet.html;0;2
|
||||||
FILE_NAME_7=985;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Fsimple.js;0;2
|
FILE_NAME_7=985;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Fsimple.js;0;2
|
||||||
FILE_NAME_8=28185;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Fscripts%2Fdice-wfrp4e.js;0;2
|
FILE_NAME_8=28185;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Fscripts%2Fdice-wfrp4e.js;0;2
|
||||||
FILE_NAME_9=674;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Ftemplates%2Fchat%2Fskill-dialog.html;0;2
|
FILE_NAME_9=674;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Ftemplates%2Fchat%2Fskill-dialog.html;0;2
|
||||||
FILE_NAME_10=5952;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2
|
FILE_NAME_10=6826;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2
|
||||||
FILE_NAME_11=2003;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Fscripts%2Factor%2Factor-wfrp4e.js;0;2
|
|
||||||
FILE_NAME_12=105669;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fsigmar%2Fwork%2Ffoundryvtt%2FWFRP-4th-Edition-FoundryVTT_SLADECRAVEN%2Fcss%2Fwfrp4e.css;0;2
|
|
||||||
|
|
||||||
[VTE]
|
[VTE]
|
||||||
last_dir=/home/sigmar
|
last_dir=/home/sigmar
|
||||||
|
@ -54,7 +54,7 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
list.push(item);
|
list.push(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.data.fatigueHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix( data.data.sante.fatigue.value, data.data.sante.fatigue.max ).html() +"</table>";
|
data.data.fatigueHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix( data.data.sante.fatigue.value, data.data.sante.fatigue.max ).html() + "</table>";
|
||||||
data.data.materiel = this._checkNull(data.itemsByType['objet']);
|
data.data.materiel = this._checkNull(data.itemsByType['objet']);
|
||||||
data.data.armes = this._checkNull(data.itemsByType['arme']);
|
data.data.armes = this._checkNull(data.itemsByType['arme']);
|
||||||
data.data.armures = this._checkNull(data.itemsByType['armure']);
|
data.data.armures = this._checkNull(data.itemsByType['armure']);
|
||||||
@ -62,7 +62,7 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
data.data.potions = this._checkNull(data.itemsByType['potions']);
|
data.data.potions = this._checkNull(data.itemsByType['potions']);
|
||||||
data.data.competenceByCategory = data.competenceByCategory;
|
data.data.competenceByCategory = data.competenceByCategory;
|
||||||
|
|
||||||
console.log("HTML", data.data.fatigueHTML);
|
//console.log(">>>>> data update");
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -102,8 +102,34 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
console.log("Value changed :", event, caracName);
|
console.log("Value changed :", event, caracName);
|
||||||
this.actor.updateCarac( caracName, parseInt(event.target.value) );
|
this.actor.updateCarac( caracName, parseInt(event.target.value) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
$("#vie-plus").click((event) => {
|
||||||
|
this.actor.santeIncDec("vie", 1);
|
||||||
|
this.render(true);
|
||||||
|
});
|
||||||
|
$("#vie-moins").click((event) => {
|
||||||
|
this.actor.santeIncDec("vie", -1);
|
||||||
|
this.render(true);
|
||||||
|
});
|
||||||
|
$("#endurance-plus").click((event) => {
|
||||||
|
this.actor.santeIncDec("endurance", 1);
|
||||||
|
this.render(true);
|
||||||
|
});
|
||||||
|
$("#endurance-moins").click((event) => {
|
||||||
|
this.actor.santeIncDec("endurance", -1);
|
||||||
|
this.render(true);
|
||||||
|
});
|
||||||
|
$("#fatigue-plus").click((event) => {
|
||||||
|
this.actor.santeIncDec("fatigue", 1);
|
||||||
|
this.render(true);
|
||||||
|
});
|
||||||
|
$("#fatigue-moins").click((event) => {
|
||||||
|
this.actor.santeIncDec("fatigue", -1);
|
||||||
|
this.render(true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
@ -120,7 +146,6 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
_updateObject(event, formData) {
|
_updateObject(event, formData) {
|
||||||
|
|
||||||
// Update the Actor
|
// Update the Actor
|
||||||
return this.object.update(formData);
|
return this.object.update(formData);
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,15 @@ export class RdDActor extends Actor {
|
|||||||
RdDUtility.computeCarac( data );
|
RdDUtility.computeCarac( data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
santeIncDec(name, inc ) {
|
||||||
|
let data = this.data.data.sante[name];
|
||||||
|
data.value = data.value + inc;
|
||||||
|
if ( data.value > data.max ) data.value = data.max;
|
||||||
|
if ( data.value < 0 ) data.value = 0;
|
||||||
|
console.log(">>>> NEW VI", name, data.value);
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
rollCompetence( compName ) {
|
rollCompetence( compName ) {
|
||||||
|
|
||||||
|
@ -58,7 +58,8 @@ const fatigueMatrix = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, //
|
|||||||
[4, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5 ],
|
[4, 5, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5 ],
|
||||||
[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ] ];
|
[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ] ];
|
||||||
const fatigueMalus = [ 0, 0, 0, -1, -1, -1, -2, -3, -4, -5, -6, -7 ]; // Provides the malus for each segment of fatigue
|
const fatigueMalus = [ 0, 0, 0, -1, -1, -1, -2, -3, -4, -5, -6, -7 ]; // Provides the malus for each segment of fatigue
|
||||||
const fatigueLineSize = [ 3, 6, 7, 8, 9, 10, 11, 12];
|
const fatigueLineSize = [ 3, 6, 7, 8, 9, 10, 11, 12];
|
||||||
|
const fatigueLineMalus = [ 0, -1, -2, -3, -4, -5, -6, -7 ];
|
||||||
const fatigueTemplate = "<table>\
|
const fatigueTemplate = "<table>\
|
||||||
<th><tdid=1><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/></tr>\
|
<th><tdid=1><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/></tr>\
|
||||||
<th><td/><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/></tr>\
|
<th><td/><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/> <td/> <td/><td/><td/><td/><td/></tr>\
|
||||||
@ -247,6 +248,8 @@ export class RdDUtility {
|
|||||||
max = (max < 16) ? 16 : max;
|
max = (max < 16) ? 16 : max;
|
||||||
max = (max > 30) ? 30 : max;
|
max = (max > 30) ? 30 : max;
|
||||||
value = (value > max) ? max : value;
|
value = (value > max) ? max : value;
|
||||||
|
value = (value < 0) ? 0 : value;
|
||||||
|
|
||||||
let fatigueTab = fatigueMatrix[max];
|
let fatigueTab = fatigueMatrix[max];
|
||||||
let idx = 0; // Current fatigue slot
|
let idx = 0; // Current fatigue slot
|
||||||
let remFatigue = value;
|
let remFatigue = value;
|
||||||
@ -257,23 +260,30 @@ export class RdDUtility {
|
|||||||
// At this point, we have the segment id in idx and the remaing fatigue points for the next segment in remFatigue
|
// At this point, we have the segment id in idx and the remaing fatigue points for the next segment in remFatigue
|
||||||
let table = $("<table/>").addClass('table-fatigue');
|
let table = $("<table/>").addClass('table-fatigue');
|
||||||
let segmentIdx = 0;
|
let segmentIdx = 0;
|
||||||
|
let fatigueCount = 0;
|
||||||
for (var line=0; line < fatigueLineSize.length; line++) {
|
for (var line=0; line < fatigueLineSize.length; line++) {
|
||||||
let row = $("<tr/>");
|
let row = $("<tr/>");
|
||||||
let segmentsPerLine = fatigueLineSize[line];
|
let segmentsPerLine = fatigueLineSize[line];
|
||||||
|
row.append("<td class='fatigue-malus'>" + fatigueLineMalus[line] + "</td>");
|
||||||
while (segmentIdx < segmentsPerLine) {
|
while (segmentIdx < segmentsPerLine) {
|
||||||
let freeSize = fatigueTab[segmentIdx];
|
let freeSize = fatigueTab[segmentIdx];
|
||||||
for (let col=0; col <5; col++) {
|
for (let col=0; col <5; col++) {
|
||||||
if ( col < freeSize )
|
if ( col < freeSize ) {
|
||||||
row.append("<td class='fatigue-free'/>");
|
if (fatigueCount < value )
|
||||||
else
|
row.append("<td class='fatigue-used'/>");
|
||||||
|
else
|
||||||
|
row.append("<td class='fatigue-free'/>");
|
||||||
|
fatigueCount++;
|
||||||
|
} else {
|
||||||
row.append("<td class='fatigue-none'/>");
|
row.append("<td class='fatigue-none'/>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
row.append("<td class='fatigue-separator'/>");
|
row.append("<td class='fatigue-separator'/>");
|
||||||
segmentIdx = segmentIdx + 1;
|
segmentIdx = segmentIdx + 1;
|
||||||
}
|
}
|
||||||
table.append(row);
|
table.append(row);
|
||||||
}
|
}
|
||||||
console.log("fatigue", table);
|
//console.log("fatigue", table);
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,8 +321,12 @@ button {
|
|||||||
}
|
}
|
||||||
.table-fatigue td {
|
.table-fatigue td {
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
width: 8px;
|
width: 4px;
|
||||||
height: 8px;
|
height: 4px;
|
||||||
|
}
|
||||||
|
.table-fatigue .fatigue-used {
|
||||||
|
background-color: DarkRed;
|
||||||
|
border: 1px solid #999;
|
||||||
}
|
}
|
||||||
.table-fatigue .fatigue-none {
|
.table-fatigue .fatigue-none {
|
||||||
background-color: black;
|
background-color: black;
|
||||||
@ -331,4 +335,9 @@ button {
|
|||||||
.table-fatigue .fatigue-free {
|
.table-fatigue .fatigue-free {
|
||||||
border: 1px solid #999;
|
border: 1px solid #999;
|
||||||
}
|
}
|
||||||
|
.table-fatigue .fatigue-malus {
|
||||||
|
font-size:8px;
|
||||||
|
}
|
||||||
|
.flex-fatigue {
|
||||||
|
flex-grow: 2;
|
||||||
|
}
|
||||||
|
@ -163,7 +163,9 @@
|
|||||||
"value": 0,
|
"value": 0,
|
||||||
"label": "Fatigue",
|
"label": "Fatigue",
|
||||||
"derivee": true
|
"derivee": true
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
"blessures":
|
||||||
"legeres": {
|
"legeres": {
|
||||||
"nombre": 0,
|
"nombre": 0,
|
||||||
"liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
"liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
||||||
@ -180,10 +182,6 @@
|
|||||||
"critiques": {
|
"critiques": {
|
||||||
"nombre": 0,
|
"nombre": 0,
|
||||||
"liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
|
"liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
|
||||||
},
|
|
||||||
"ethylisme": {
|
|
||||||
"value": 0,
|
|
||||||
"label": ""
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"attributs": {
|
"attributs": {
|
||||||
@ -221,29 +219,48 @@
|
|||||||
"compteurs": {
|
"compteurs": {
|
||||||
"reve": {
|
"reve": {
|
||||||
"max": 0,
|
"max": 0,
|
||||||
"value": 0
|
"value": 0,
|
||||||
|
"label": "Points de Rêve"
|
||||||
},
|
},
|
||||||
"sust": {
|
"sust": {
|
||||||
"value": 0
|
"value": 0,
|
||||||
|
"label": "Sust."
|
||||||
},
|
},
|
||||||
"eau": {
|
"eau": {
|
||||||
"value": 0
|
"value": 0,
|
||||||
|
"label": "Eau"
|
||||||
},
|
},
|
||||||
"moral": {
|
"moral": {
|
||||||
"value": 0,
|
"value": 0,
|
||||||
"exaltation": 0,
|
"label": "Moral"
|
||||||
"dissolution": 0
|
},
|
||||||
|
"exaltation": {
|
||||||
|
"value": 0,
|
||||||
|
"label": "Exaltation"
|
||||||
|
},
|
||||||
|
"dissolution": {
|
||||||
|
"value": 0,
|
||||||
|
"label": "Dissolution"
|
||||||
},
|
},
|
||||||
"chance": {
|
"chance": {
|
||||||
"value": 0,
|
"value": 0,
|
||||||
"destinee": 0
|
"label": "Chance"
|
||||||
|
},
|
||||||
|
"destinee": {
|
||||||
|
"value": 0,
|
||||||
|
"label": "Destinée"
|
||||||
},
|
},
|
||||||
"stress": {
|
"stress": {
|
||||||
"value": 0
|
"value": 0,
|
||||||
|
"label": "Stress"
|
||||||
},
|
},
|
||||||
"etat": {
|
"etat": {
|
||||||
"value": 0,
|
"value": 0,
|
||||||
"label": ""
|
"label": "Etat général"
|
||||||
|
},
|
||||||
|
"ethylisme": {
|
||||||
|
"value": 0,
|
||||||
|
"label": "Ethylisme"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"argent": {
|
"argent": {
|
||||||
|
@ -5,17 +5,17 @@
|
|||||||
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="100" width="100"/>
|
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="100" width="100"/>
|
||||||
<div class="header-fields">
|
<div class="header-fields">
|
||||||
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1>
|
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1>
|
||||||
<div class="grid grid-3col">
|
<div class="flexrow">
|
||||||
<div class="flex-group-center">
|
<div class="flex-group-center">
|
||||||
Vie
|
Vie <a id="vie-plus">+</a> / <a id="vie-moins">-</a>
|
||||||
<input class="resource-content flexrow flex-center flex-between" type="text" name="data.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number"/>/{{data.sante.vie.max}}
|
<input class="resource-content" type="text" name="data.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number"/>/{{data.sante.vie.max}}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-group-center">
|
<div class="flex-group-center">
|
||||||
Endurance
|
Endurance <a id="endurance-plus">+</a> / <a id="endurance-moins">-</a>
|
||||||
<input class="resource-content flexrow flex-center flex-between" type="text" name="data.sante.fatigue.value" value="{{data.sante.fatigue.value}}" data-dtype="Number"/>/{{data.sante.fatigue.max}}
|
<input class="resource-content" type="text" name="data.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number"/>/{{data.sante.endurance.max}}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-group-center">
|
<div class="flex-group-center flex-fatigue">
|
||||||
Fatigue
|
Fatigue <a id="fatigue-plus">+</a> / <a id="fatigue-moins">-</a>
|
||||||
<span>{{{data.fatigueHTML}}}</span>
|
<span>{{{data.fatigueHTML}}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -61,7 +61,7 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
{{#each data.sante as |point key|}}
|
{{#each data.sante as |point key|}}
|
||||||
<li class="competence flexrow" data-attribute="{{key}}">
|
<li class="competence flexrow" data-attribute="{{key}}">
|
||||||
<span class="competence-label flexrow" name="data.attributs.{{key}}.label">{{point.label}} : {{point.value}}</span>
|
<span class="competence-label flexrow" name="data.attributs.{{key}}.label">{{point.label}} : {{point.value}} / {{point.max}}</span>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ol>
|
</ol>
|
||||||
|
Loading…
Reference in New Issue
Block a user