Skip to content

Commit 5a54fdb

Browse files
committed
Fix flask sound problems. Add "Flask Ready" sound on refill and CD end.
1 parent 5181640 commit 5a54fdb

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

SNDINFO

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
BFG2704/Charge BBETACHR
22
BetaBall/Fire BETAFIRE
3-
Flasks/Quaff FLASKUSE
3+
Flasks/Quaff FLASKUSE
4+
Flasks/Ready FLASKRDY

sounds/flasks/FLASKRDY.lmp

5.88 KB
Binary file not shown.

sounds/flasks/FLASKUSE.lmp

3.24 KB
Binary file not shown.

zscript/rflasks/base_rw_flask.zs

+8-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ class RwFlask : Inventory {
6565

6666
if (cooldownTicksRemaining > 0) {
6767
cooldownTicksRemaining--;
68+
if (owner && cooldownTicksRemaining == 0 && (currentCharges >= stats.chargeConsumption)) {
69+
owner.A_StartSound("Flasks/Ready", CHAN_AUTO);
70+
}
6871
}
6972

7073
Affix aff;
@@ -113,8 +116,12 @@ class RwFlask : Inventory {
113116
}
114117

115118
void Refill(int amount) {
119+
bool enoughBefore = currentCharges >= stats.chargeConsumption;
116120
currentCharges += amount;
117121
currentCharges = min(currentCharges, stats.maxCharges);
122+
if (owner && !enoughBefore && currentCharges >= stats.chargeConsumption && cooldownTicksRemaining == 0) {
123+
owner.A_StartSound("Flasks/Ready", CHAN_AUTO);
124+
}
118125
}
119126

120127
action void RwUse() {
@@ -129,7 +136,7 @@ class RwFlask : Inventory {
129136
invoker.cooldownTicksRemaining = invoker.stats.usageCooldownTicks;
130137
RWHealingToken.ApplyToActor(invoker.owner, invoker.stats.healAmount, invoker.stats.healsUntilPercentage, invoker.stats.healDurationTicks);
131138

132-
A_StartSound("Flasks/Quaff", CHAN_ITEM, volume: 1.25);
139+
invoker.owner.A_StartSound("Flasks/Quaff", CHAN_AUTO);
133140
invoker.owner.Player.bonusCount += 1;
134141
}
135142
}

0 commit comments

Comments
 (0)