add `Player#setMark`.

This commit is contained in:
Rintim 2023-10-04 17:24:39 +08:00
parent eb0af0d3fc
commit 1f15c83685
No known key found for this signature in database
GPG Key ID: BE9E1EA615BACFCF
1 changed files with 5 additions and 0 deletions

View File

@ -22238,6 +22238,11 @@
this.syncStorage(i);
this.markSkill(i);
},
setMark:function(name,num,log){
const count=this.countMark(name);
if(count>num)player.removeMark(name,count-num,log);
else if(count<num)player.addMark(name,num-count,log);
},
countMark:function(i){
if(this.storage[i]==undefined) return 0;
if(typeof this.storage[i]=='number') return this.storage[i];