feat:即捡即用事件块-音效
This commit is contained in:
parent
d53e72513b
commit
eaae6884ce
@ -496,12 +496,13 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
// 获得一个道具后触发的事件
|
// 获得一个道具后触发的事件
|
||||||
// itemId:获得的道具ID;x和y是该道具所在的坐标
|
// itemId:获得的道具ID;x和y是该道具所在的坐标
|
||||||
// isGentleClick:是否是轻按触发的
|
// isGentleClick:是否是轻按触发的
|
||||||
if (itemId.endsWith('Potion') && core.material.items[itemId].cls == 'items')
|
|
||||||
core.playSound('回血');
|
let sound = '获得道具';
|
||||||
else if (itemId.endsWith('Gem') && core.material.items[itemId].cls == 'items')
|
const itemInfo = core.material.items[itemId];
|
||||||
core.playSound('宝石')
|
if (itemInfo.itemEffectEvent && itemInfo.itemEffectEvent.hasOwnProperty('sound')) {
|
||||||
else
|
sound = itemInfo.itemEffectEvent.sound;
|
||||||
core.playSound('获得道具');
|
}
|
||||||
|
core.playSound(sound);
|
||||||
|
|
||||||
var todo = [];
|
var todo = [];
|
||||||
// 检查该点的获得道具后事件。
|
// 检查该点的获得道具后事件。
|
||||||
@ -512,7 +513,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (todo.length > 0) core.insertAction(todo, x, y);
|
if (todo.length > 0) core.insertAction(todo, x, y);
|
||||||
},
|
},
|
||||||
"afterPushBox": function () {
|
"afterPushBox": function () {
|
||||||
// 推箱子后的事件
|
// 推箱子后的事件
|
||||||
if (core.searchBlock('box').length == 0) {
|
if (core.searchBlock('box').length == 0) {
|
||||||
|
|||||||
@ -27,6 +27,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
|||||||
"useItemEffect": "core.status.hero.atk += core.values.redGem",
|
"useItemEffect": "core.status.hero.atk += core.values.redGem",
|
||||||
"canUseItemEffect": "true",
|
"canUseItemEffect": "true",
|
||||||
"itemEffectEvent": {
|
"itemEffectEvent": {
|
||||||
|
"sound": "item.mp3",
|
||||||
"value": {
|
"value": {
|
||||||
"atk:o": "core.values.redGem"
|
"atk:o": "core.values.redGem"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user