diff --git a/lib/GMLIB_API-JS.js b/lib/GMLIB_API-JS.js index 9f5b5ca..585cac7 100644 --- a/lib/GMLIB_API-JS.js +++ b/lib/GMLIB_API-JS.js @@ -354,12 +354,14 @@ const GMLIB_API = { getEntityEffectDurationHard: ll.import("GMLIB_API", "getEntityEffectDurationHard"), /** 获取实体的buff普通模式下的持续时间 @type {function(Player,number):number} */ getEntityEffectDurationNormal: ll.import("GMLIB_API", "getEntityEffectDurationNormal"), - /** 获取实体的buff效果等级 @type {function(Player,number):number} */ + /** 获取实体的buff效果等级 @type {function(Entity,number):number} */ getEntityEffectAmplifier: ll.import("GMLIB_API", "getEntityEffectAmplifier"), - /** 获取实体的buff是否为信标给予 @type {function(Player,number):boolean} */ + /** 获取实体的buff是否为信标给予 @type {function(Entity,number):boolean} */ getEntityEffectAmbient: ll.import("GMLIB_API", "getEntityEffectAmbient"), - /** 实体是否拥有buff效果 @type {function(Player,number):boolean} */ + /** 实体是否拥有buff效果 @type {function(Entity,number):boolean} */ entityHasEffect: ll.import("GMLIB_API", "entityHasEffect"), + /** 获取实体所有buff效果 @type {function(Entity):Array.} */ + getEntityAllEffects: ll.import("GMLIB_API", "getEntityAllEffects"), /** 获取游戏难度 @type {function():number} */ getGameDifficulty: ll.import("GMLIB_API", "getGameDifficulty"), /** 设置游戏难度 @type {function(difficulty):void} */ @@ -2590,7 +2592,7 @@ LLSE_Entity.prototype.hasEffect = * @returns {boolean} */ function (effectId) { - return GMLIB_API.playerHasEffect(this, effectId); + return GMLIB_API.entityHasEffect(this, effectId); } LLSE_Entity.prototype.getEffectInfo = @@ -2602,7 +2604,7 @@ LLSE_Entity.prototype.getEffectInfo = function (effectId) { if (!this.hasEffect(effectId)) return null; return { - Id: id, + Id: effectId, Amplifier: GMLIB_API.getEntityEffectAmbient(this, effectId), Duration: GMLIB_API.getEntityEffectDuration(this, effectId), DurationEasy: GMLIB_API.getEntityEffectDurationEasy(this, effectId), @@ -2619,7 +2621,7 @@ LLSE_Entity.prototype.getAllEffectsInfo = * @returns {{Id: number, Amplifier: number, Duration: number, DurationEasy: number, DurationNormal: number, DurationHard: number, Ambient: boolean, ShowParticles: boolean}[]} */ function () { - this.getAllEffects().map(this.getEffectInfo); + return this.getAllEffects().map(effectId => this.getEffectInfo(effectId)); } module.exports = {