Merge pull request #1182 from IceCola97/PR-Branch

修复globalskill移除问题、attaclTo拼写错误
This commit is contained in:
Spmario233 2024-04-11 20:47:30 +08:00 committed by GitHub
commit 027fee2ca9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 8 deletions

View File

@ -4653,8 +4653,14 @@ export class Game extends Uninstantable {
}
/**
* @param { string } skill
* @param { lib.element.Player } player
*/
static removeGlobalSkill(skill) {
static 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

@ -2012,8 +2012,8 @@ export class Get extends Uninstantable {
if (info.globalTo) {
n += info.globalTo;
}
if (info.attaclTo) {
m += info.attaclTo;
if (info.attackTo) {
m += info.attackTo;
}
}
if (method == 'attack') {
@ -2026,8 +2026,8 @@ export class Get extends Uninstantable {
// 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;
@ -10661,4 +10661,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']);