Merge remote-tracking branch 'upstream/PR-Branch' into PR-Branch

This commit is contained in:
nonameShijian 2024-04-11 21:22:57 +08:00
commit 30ff129587
3 changed files with 27 additions and 8 deletions

View File

@ -4657,8 +4657,14 @@ export class Game {
}
/**
* @param { string } skill
* @param { lib.element.Player } player
*/
removeGlobalSkill(skill) {
removeGlobalSkill(skill, player) {
const players = lib.skill.globalmap[skill];
if(player && Array.isArray(players)) {
lib.skill.globalmap[skill].remove(player);
if(players.length) return;
}
lib.skill.global.remove(skill);
delete lib.skill.globalmap[skill];
for (let i in lib.hook.globalskill) {

View File

@ -2010,8 +2010,8 @@ export class Get {
if (info.globalTo) {
n += info.globalTo;
}
if (info.attaclTo) {
m += info.attaclTo;
if (info.attackTo) {
m += info.attackTo;
}
}
if (method == 'attack') {
@ -2024,8 +2024,8 @@ export class Get {
// for(let i=0;i<equips2.length;i++){
// let info=get.info(equips2[i]).distance;
// if(!info) continue;
// if(info.attaclTo){
// m+=info.attaclTo;
// if(info.attackTo){
// m+=info.attackTo;
// }
// }
// return n;

View File

@ -1970,8 +1970,8 @@ export class Player extends HTMLDivElement {
m += info.globalTo;
n += info.globalTo;
}
if (info.attaclTo) {
m += info.attaclTo;
if (info.attackTo) {
m += info.attackTo;
}
}
return m <= range;
@ -5939,6 +5939,19 @@ export class Player extends HTMLDivElement {
next.setContent('recover');
return next;
}
recoverTo() {
const newArguments = [];
let num = 1;
for (let i = 0; i < arguments.length; i++) {
if (typeof arguments[i] === 'number') {
num = arguments[i] - this.getHp(true);
newArguments.push(num);
} else {
newArguments.push(arguments[i]);
}
}
return this.recover(...newArguments);
}
doubleDraw() {
var next = game.createEvent('doubleDraw');
if (get.is.changban()) {
@ -10661,4 +10674,4 @@ export class Player extends HTMLDivElement {
}
CacheContext.inject(Player.prototype,
['hasCard','hasValueTarget','getModableSkills','getCardIndex','countCards','getSkills','getUseValue','canUse']);
['hasCard','hasValueTarget','getModableSkills','getCardIndex','countCards','getSkills','getUseValue','canUse']);