fun: yoink sound upon pickup
This commit is contained in:
parent
d59450f268
commit
cdaf1567c0
|
@ -159,6 +159,17 @@ export default (latus) => class Receptacle extends decorate(Trait) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
hooks() {
|
||||
return {
|
||||
sounds: () => ({
|
||||
yoink: {
|
||||
extends: '/yoink.sound.json',
|
||||
},
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
isSlotIndexInRange(slotIndex) {
|
||||
return slotIndex >= 0 && slotIndex < this.entity.slotCount;
|
||||
}
|
||||
|
@ -181,6 +192,9 @@ export default (latus) => class Receptacle extends decorate(Trait) {
|
|||
other.list.removeEntity(other);
|
||||
}
|
||||
this.entity.addItemToSlot(other);
|
||||
if (this.entity.is('Audible')) {
|
||||
this.entity.playSound('yoink');
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user