Skip to content

Commit

Permalink
为示例模组提供鸭子语音
Browse files Browse the repository at this point in the history
  • Loading branch information
iamapig120 committed Jan 19, 2019
1 parent 805095c commit ed15332
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 48 deletions.
Binary file modified mod/mallard/files/0/audio/sound/mallard/quack.mp3
Binary file not shown.
101 changes: 54 additions & 47 deletions mod/mallard/script.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,60 @@
// 修改千织语音台词
console.log('已Hack语音')
const funcBackup = cfg.voice.sound.getGroup
cfg.voice.sound.getGroup = function(soundID) {
const soundGroup = funcBackup.call(this, soundID)
if (soundID === 4) {
const changeMap = {
大厅交互语音1: {
words: '呱!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音2: {
words: '呱!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音3: {
words: '呱!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音4: {
words: '呱!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音5: {
words: '呱!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音6: {
words: '呱!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音7: {
words: '呱!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音8: {
words: '呱!',
path: 'audio/sound/mallard/quack'
}
let raf = requestAnimationFrame(function autoRun() {
try {
const arrBackup = cfg.voice.sound.groups_
if (!arrBackup || arrBackup.length === 0) {
throw new Error()
}
const keyArray = Object.keys(changeMap)
Object.entries(soundGroup).forEach(([soundKey, soundObject]) => {
// soundObject.level_limit = 0
if (keyArray.includes(soundObject.name)) {
soundGroup[soundKey] = {
...soundObject,
...changeMap.soundObject.name
console.log('Hacked语音')
Object.entries(cfg.voice.sound.groups_).forEach(([soundID, soundGroup]) => {
if (soundID == 4) {
const changeMap = {
大厅交互语音1: {
words: '嘎!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音2: {
words: '嘎!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音3: {
words: '嘎!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音4: {
words: '嘎!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音5: {
words: '嘎!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音6: {
words: '嘎!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音7: {
words: '嘎!',
path: 'audio/sound/mallard/quack'
},
大厅交互语音8: {
words: '嘎!',
path: 'audio/sound/mallard/quack'
}
}
const keyArray = Object.keys(changeMap)
soundGroup.forEach((soundObject, index) => {
// soundObject.level_limit = 0
if (keyArray.includes(soundObject.name)) {
soundGroup[index] = {
...soundObject,
...changeMap[soundObject.name]
}
}
})
}
})
} catch (error) {
raf = requestAnimationFrame(autoRun)
}
return soundGroup
}
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "majsoul-plus-client",
"version": "1.6.2-alpha.3",
"version": "1.6.2-beta.1",
"productName": "Majsoul Plus",
"author": "MajsoulPlus Team",
"description": "Majsoul Plus",
Expand Down

0 comments on commit ed15332

Please sign in to comment.