From cccd01e8410e3e57b3371c1e26ceae2897891f46 Mon Sep 17 00:00:00 2001 From: lingdar77 Date: Tue, 20 Jan 2026 10:28:10 +0800 Subject: [PATCH] inject --- dist/bcm_tool.js | 145 ++++++++++++++++++++++---------------------- src/bcm_tool.ts | 152 +++++++++++++++++++++++++---------------------- src/global.d.ts | 3 +- 3 files changed, 157 insertions(+), 143 deletions(-) diff --git a/dist/bcm_tool.js b/dist/bcm_tool.js index ff3b6ab..5db00e4 100644 --- a/dist/bcm_tool.js +++ b/dist/bcm_tool.js @@ -1,74 +1,79 @@ "use strict"; -function queryPlayerInfo(playersToQuery) { - const attributes = [ - ['速度', 1], - ['力量', 2], - ['内攻', 3], - ['中投', 4], - ['三分', 5], - ['三分急停跳投倾向', 6], - ['内线防守能力', 7], - ['外线防守能力', 8], - ['突破能力', 9], - ['上篮能力', 10], - ['控球能力', 11], - ['传球能力', 12], - ['传球视野', 13], - ['干扰投篮', 14], - ['篮板能力', 15], - ['*出手时间', 16], - ['*进攻IQ', 17], - ['*防守IQ', 18], - ['体能', 19], - ['卡位能力', 20], - ['罚球能力', 21], - ['抢断能力', 22], - ['盖帽能力', 23], - ['*进攻犯规', 24], - ['*防守犯规', 25], - ['扣篮能力', 26], - ['勾手倾向', 27], - ['*后仰倾向', 28], - ['打板倾向', 29], - ['*反应时间', 30], - ['拉开空间', 31], - ['补防、协防', 32], - ['*造进攻犯规', 33], - ['快下', 34], - ['无球跑动', 35], - ['挡拆', 36], - ['*造防守犯规', 37], - ['无球掩护', 38], - ['进攻篮板', 39], - ['*假动作', 40], - ['攻转守', 41], - ['进攻技能', 44], - ['防守技能', 48], - ['身体素质', 50], - ]; - for (const playerId of playersToQuery) { - if (!checkInfo(playerId)) { - console.log('找不到id', playerId); - continue; - } - console.log(queryName(playerId)); - for (const info of attributes) { - const name = info[0]; - const id = info[1]; - const record = queryInfo(playerId, id); - console.log(name, record); +class BcmTool { + queryPlayerInfo(playersToQuery) { + const attributes = [ + ['速度', 1], + ['力量', 2], + ['内攻', 3], + ['中投', 4], + ['三分', 5], + ['三分急停跳投倾向', 6], + ['内线防守能力', 7], + ['外线防守能力', 8], + ['突破能力', 9], + ['上篮能力', 10], + ['控球能力', 11], + ['传球能力', 12], + ['传球视野', 13], + ['干扰投篮', 14], + ['篮板能力', 15], + ['*出手时间', 16], + ['*进攻IQ', 17], + ['*防守IQ', 18], + ['体能', 19], + ['卡位能力', 20], + ['罚球能力', 21], + ['抢断能力', 22], + ['盖帽能力', 23], + ['*进攻犯规', 24], + ['*防守犯规', 25], + ['扣篮能力', 26], + ['勾手倾向', 27], + ['*后仰倾向', 28], + ['打板倾向', 29], + ['*反应时间', 30], + ['拉开空间', 31], + ['补防、协防', 32], + ['*造进攻犯规', 33], + ['快下', 34], + ['无球跑动', 35], + ['挡拆', 36], + ['*造防守犯规', 37], + ['无球掩护', 38], + ['进攻篮板', 39], + ['*假动作', 40], + ['攻转守', 41], + ['进攻技能', 44], + ['防守技能', 48], + ['身体素质', 50], + ]; + for (const playerId of playersToQuery) { + if (!this.checkInfo(playerId)) { + console.log('找不到id', playerId); + continue; + } + console.log(this.queryName(playerId)); + for (const info of attributes) { + const name = info[0]; + const id = info[1]; + const record = this.queryInfo(playerId, id); + console.log(name, record); + } } } + checkInfo(playerId) { + const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); + return data != null; + } + queryName(playerId) { + const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); + return data.playerName; + } + queryInfo(playerId, attri) { + const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); + return data.GetSingleAttribute(attri); + } } -function checkInfo(playerId) { - const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); - return data != null; -} -function queryName(playerId) { - const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); - return data.playerName; -} -function queryInfo(playerId, attri) { - const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); - return data.GetSingleAttribute(attri); -} +(() => { + g_game.bcm_tool = new BcmTool(); +})(); diff --git a/src/bcm_tool.ts b/src/bcm_tool.ts index 9ca2e62..cf6ddd6 100644 --- a/src/bcm_tool.ts +++ b/src/bcm_tool.ts @@ -1,78 +1,86 @@ -function queryPlayerInfo(playersToQuery:string[]) { - const attributes = [ - ['速度', 1], - ['力量', 2], - ['内攻', 3], - ['中投', 4], - ['三分', 5], - ['三分急停跳投倾向', 6], - ['内线防守能力', 7], - ['外线防守能力', 8], - ['突破能力', 9], - ['上篮能力', 10], - ['控球能力', 11], - ['传球能力', 12], - ['传球视野', 13], - ['干扰投篮', 14], - ['篮板能力', 15], - ['*出手时间', 16], - ['*进攻IQ', 17], - ['*防守IQ', 18], - ['体能', 19], - ['卡位能力', 20], - ['罚球能力', 21], - ['抢断能力', 22], - ['盖帽能力', 23], - ['*进攻犯规', 24], - ['*防守犯规', 25], - ['扣篮能力', 26], - ['勾手倾向', 27], - ['*后仰倾向', 28], - ['打板倾向', 29], - ['*反应时间', 30], - ['拉开空间', 31], - ['补防、协防', 32], - ['*造进攻犯规', 33], - ['快下', 34], - ['无球跑动', 35], - ['挡拆', 36], - ['*造防守犯规', 37], - ['无球掩护', 38], - ['进攻篮板', 39], - ['*假动作', 40], - ['攻转守', 41], - ['进攻技能', 44], - ['防守技能', 48], - ['身体素质', 50], - ]; +class BcmTool { - for (const playerId of playersToQuery) { - if (!checkInfo(playerId)) { - console.log('找不到id', playerId); - continue; - } - console.log(queryName(playerId)); - for (const info of attributes) { - const name = info[0]; - const id = info[1]; - const record = queryInfo(playerId, id as number); - console.log(name, record); + public queryPlayerInfo(playersToQuery:string[]) { + const attributes = [ + ['速度', 1], + ['力量', 2], + ['内攻', 3], + ['中投', 4], + ['三分', 5], + ['三分急停跳投倾向', 6], + ['内线防守能力', 7], + ['外线防守能力', 8], + ['突破能力', 9], + ['上篮能力', 10], + ['控球能力', 11], + ['传球能力', 12], + ['传球视野', 13], + ['干扰投篮', 14], + ['篮板能力', 15], + ['*出手时间', 16], + ['*进攻IQ', 17], + ['*防守IQ', 18], + ['体能', 19], + ['卡位能力', 20], + ['罚球能力', 21], + ['抢断能力', 22], + ['盖帽能力', 23], + ['*进攻犯规', 24], + ['*防守犯规', 25], + ['扣篮能力', 26], + ['勾手倾向', 27], + ['*后仰倾向', 28], + ['打板倾向', 29], + ['*反应时间', 30], + ['拉开空间', 31], + ['补防、协防', 32], + ['*造进攻犯规', 33], + ['快下', 34], + ['无球跑动', 35], + ['挡拆', 36], + ['*造防守犯规', 37], + ['无球掩护', 38], + ['进攻篮板', 39], + ['*假动作', 40], + ['攻转守', 41], + ['进攻技能', 44], + ['防守技能', 48], + ['身体素质', 50], + ]; + + for (const playerId of playersToQuery) { + if (!this.checkInfo(playerId)) { + console.log('找不到id', playerId); + continue; + } + console.log(this.queryName(playerId)); + for (const info of attributes) { + const name = info[0]; + const id = info[1]; + const record = this.queryInfo(playerId, id as number); + console.log(name, record); + } } } + + public checkInfo(playerId:string) { + const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); + return data != null; + } + + public queryName(playerId:string) { + const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); + return data.playerName; + } + + public queryInfo(playerId:string, attri:number) { + const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); + return data.GetSingleAttribute(attri); + } + } -function checkInfo(playerId:string) { - const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); - return data != null; -} - -function queryName(playerId:string) { - const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); - return data.playerName; -} - -function queryInfo(playerId:string, attri:number) { - const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId); - return data.GetSingleAttribute(attri); -} \ No newline at end of file +(()=>{ + g_game.bcm_tool = new BcmTool(); +})(); \ No newline at end of file diff --git a/src/global.d.ts b/src/global.d.ts index 913541b..4070be6 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -12,11 +12,12 @@ declare global interface CPlayerData { public playerName: string; - + public GetSingleAttribute(PlayerAttribute:number,is_floor?:boolean):number; } var g_game: { mgr: BGameMgr; + bcm_tool: BcmTool; }; } \ No newline at end of file