Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
PlayerEntity(Sound) Category Reference

#include <PlayerEntitySound.h>

Instance Methods

(void) - setUpSound
 
(void) - setUpWeaponSounds
 
(void) - destroySound
 
(BOOL) - isBeeping
 
(void) - playIdentOn
 
(void) - playIdentOff
 
(void) - playIdentLockedOn
 
(void) - playMissileArmed
 
(void) - playMineArmed
 
(void) - playMissileSafe
 
(void) - playMissileLockedOn
 
(void) - playWeaponsOnline
 
(void) - playWeaponsOffline
 
(void) - playNextEquipmentSelected
 
(void) - playNextMissileSelected
 
(void) - playCargoJettisioned
 
(void) - playAutopilotOn
 
(void) - playAutopilotOff
 
(void) - playAutopilotOutOfRange
 
(void) - playAutopilotCannotDockWithTarget
 
(void) - playSaveOverwriteYes
 
(void) - playSaveOverwriteNo
 
(void) - playHoldFull
 
(void) - playJumpMassLocked
 
(void) - playTargetLost
 
(void) - playNoTargetInMemory
 
(void) - playTargetSwitched
 
(void) - playCloakingDeviceOn
 
(void) - playCloakingDeviceOff
 
(void) - playCloakingDeviceInsufficientEnergy
 
(void) - playMenuNavigationUp
 
(void) - playMenuNavigationDown
 
(void) - playMenuNavigationNot
 
(void) - playMenuPagePrevious
 
(void) - playMenuPageNext
 
(void) - playDismissedReportScreen
 
(void) - playDismissedMissionScreen
 
(void) - playChangedOption
 
(void) - updateFuelScoopSoundWithInterval:
 
(void) - startAfterburnerSound
 
(void) - stopAfterburnerSound
 
(void) - playBuyCommodity
 
(void) - playBuyShip
 
(void) - playSellCommodity
 
(void) - playCantBuyCommodity
 
(void) - playCantSellCommodity
 
(void) - playCantBuyShip
 
(void) - playHyperspaceNoTarget
 
(void) - playHyperspaceNoFuel
 
(void) - playHyperspaceBlocked
 
(void) - playHyperspaceDistanceTooGreat
 
(void) - playStandardHyperspace
 
(void) - playGalacticHyperspace
 
(void) - playHyperspaceAborted
 
(void) - playHitByECMSound
 
(void) - playFiredECMSound
 
(void) - playLaunchFromStation
 
(void) - playDockWithStation
 
(void) - playExitWitchspace
 
(void) - playHostileWarning
 
(void) - playAlertConditionRed
 
(void) - playIncomingMissile:
 
(void) - playEnergyLow
 
(void) - playDockingDenied
 
(void) - playWitchjumpFailure
 
(void) - playWitchjumpMisjump
 
(void) - playWitchjumpBlocked
 
(void) - playWitchjumpDistanceTooGreat
 
(void) - playWitchjumpInsufficientFuel
 
(void) - playFuelLeak
 
(void) - playShieldHit:weaponIdentifier:
 
(void) - playDirectHit:weaponIdentifier:
 
(void) - playScrapeDamage:
 
(void) - playLaserHit:offset:weaponIdentifier:
 
(void) - playWeaponOverheated:
 
(void) - playMissileLaunched:weaponIdentifier:
 
(void) - playMineLaunched:weaponIdentifier:
 
(void) - playEscapePodScooped
 
(void) - playAegisCloseToPlanet
 
(void) - playAegisCloseToStation
 
(void) - playGameOver
 
(void) - playLegacyScriptSound:
 
(void) - playInterfaceBeep: [implementation]
 
(void) - boop [implementation]
 
(void) - updateAfterburnerSound [implementation]
 

Detailed Description

Definition at line 27 of file PlayerEntitySound.h.

Method Documentation

◆ boop

- (void) boop
implementation

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

200{
201 [self playInterfaceBeep:@"[general-boop]"];
202}

◆ destroySound

- (void) destroySound

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

161{
166
169
175
181}
#define DESTROY(x)
Definition OOCocoa.h:77
static OOSoundSourcePool * sDamageSoundPool
static OOSoundSource * sEcmSource
static NSDictionary * weaponUnshieldedHit
static OOSoundSourcePool * sWeaponSoundPool
static OOSoundSource * sHyperspaceSoundSource
static OOSoundSourcePool * sBuySellSourcePool
static NSDictionary * weaponShotHit
static OOSoundSource * sBreakPatternSource
static OOSoundSource * sAfterburnerSources[2]
static NSDictionary * weaponLaunched
static OOSoundSource * sInterfaceBeepSource
static OOSoundSourcePool * sMiscSoundPool
static OOSoundSourcePool * sWarningSoundPool
static NSDictionary * weaponShieldHit
static NSDictionary * weaponShotMiss

◆ isBeeping

- (BOOL) isBeeping

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

194{
195 return [sInterfaceBeepSource isPlaying];
196}

◆ playAegisCloseToPlanet

- (void) playAegisCloseToPlanet

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

717{
718 [sMiscSoundPool playSoundWithKey:@"[aegis-planet]" position:kInterfaceBeepPosition];
719}

◆ playAegisCloseToStation

- (void) playAegisCloseToStation

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

723{
724 [sMiscSoundPool playSoundWithKey:@"[aegis-station]" position:kInterfaceBeepPosition];
725}

◆ playAlertConditionRed

- (void) playAlertConditionRed

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

588{
589 [sWarningSoundPool playSoundWithKey:@"[alert-condition-red]" priority:2 position:kInterfaceWarningPosition];
590}

◆ playAutopilotCannotDockWithTarget

- (void) playAutopilotCannotDockWithTarget

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

300{
301 [self playInterfaceBeep:@"[autopilot-cannot-dock-with-target]"];
302}

◆ playAutopilotOff

- (void) playAutopilotOff

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

284{
285 // only if still alive
286 if (energy > 0.0)
287 {
288 [self playInterfaceBeep:@"[autopilot-off]"];
289 }
290}

◆ playAutopilotOn

- (void) playAutopilotOn

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

278{
279 [self playInterfaceBeep:@"[autopilot-on]"];
280}

◆ playAutopilotOutOfRange

- (void) playAutopilotOutOfRange

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

294{
295 [self playInterfaceBeep:@"[autopilot-out-of-range]"];
296}

◆ playBuyCommodity

- (void) playBuyCommodity

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

498{
499 [sBuySellSourcePool playSoundWithKey:@"[buy-commodity]"];
500}

◆ playBuyShip

- (void) playBuyShip

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

504{
505 [sBuySellSourcePool playSoundWithKey:@"[buy-ship]"];
506}

◆ playCantBuyCommodity

- (void) playCantBuyCommodity

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

516{
517 [sBuySellSourcePool playSoundWithKey:@"[could-not-buy-commodity]"];
518}

◆ playCantBuyShip

- (void) playCantBuyShip

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

528{
529 [sBuySellSourcePool playSoundWithKey:@"[could-not-buy-ship]"];
530}

◆ playCantSellCommodity

- (void) playCantSellCommodity

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

522{
523 [sBuySellSourcePool playSoundWithKey:@"[could-not-sell-commodity]"];
524}

◆ playCargoJettisioned

- (void) playCargoJettisioned

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

272{
273 [self playInterfaceBeep:@"[cargo-jettisoned]"];
274}

◆ playChangedOption

- (void) playChangedOption

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

424{
425 [self playInterfaceBeep:@"[changed-option]"];
426}

◆ playCloakingDeviceInsufficientEnergy

- (void) playCloakingDeviceInsufficientEnergy

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

492{
493 [self playInterfaceBeep:@"[cloaking-device-insufficent-energy]"];
494}

◆ playCloakingDeviceOff

- (void) playCloakingDeviceOff

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

376{
377 [self playInterfaceBeep:@"[cloaking-device-off]"];
378}

◆ playCloakingDeviceOn

- (void) playCloakingDeviceOn

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

370{
371 [self playInterfaceBeep:@"[cloaking-device-on]"];
372}

◆ playDirectHit:weaponIdentifier:

- (void) playDirectHit: (Vector) attackVector
weaponIdentifier: (NSString *) weaponIdentifier 

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

655 :(Vector)attackVector weaponIdentifier:(NSString *) weaponIdentifier
656{
657 NSString *identifier = [weaponUnshieldedHit objectForKey:weaponIdentifier];
658 if (!identifier) identifier = @"[player-direct-hit]";
659 [sDamageSoundPool playSoundWithKey:identifier position:attackVector];
660}

◆ playDismissedMissionScreen

- (void) playDismissedMissionScreen

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

418{
419 [self playInterfaceBeep:@"[dismissed-mission-screen]"];
420}

◆ playDismissedReportScreen

- (void) playDismissedReportScreen

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

412{
413 [self playInterfaceBeep:@"[dismissed-report-screen]"];
414}

◆ playDockingDenied

- (void) playDockingDenied

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

606{
607 [sWarningSoundPool playSoundWithKey:@"[autopilot-denied]" priority:1 position:kInterfaceWarningPosition];
608}

◆ playDockWithStation

- (void) playDockWithStation

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

570{
571 [sBreakPatternSource playCustomSoundWithKey:@"[player-dock-with-station]"];
572}

◆ playEnergyLow

- (void) playEnergyLow

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

600{
601 [sWarningSoundPool playSoundWithKey:@"[energy-low]" priority:0.5 position:kInterfaceWarningPosition];
602}

◆ playEscapePodScooped

- (void) playEscapePodScooped

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

711{
712 [sMiscSoundPool playSoundWithKey:@"[escape-pod-scooped]" position:kInterfaceBeepPosition];
713}

◆ playExitWitchspace

- (void) playExitWitchspace

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

576{
577 [sBreakPatternSource playCustomSoundWithKey:@"[player-exit-witchspace]"];
578}

◆ playFiredECMSound

- (void) playFiredECMSound

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

558{
559 if (![sEcmSource isPlaying]) [sEcmSource playCustomSoundWithKey:@"[player-fired-ecm]"];
560}

◆ playFuelLeak

- (void) playFuelLeak

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

642{
643 [sWarningSoundPool playSoundWithKey:@"[fuel-leak]" priority:0.5 position:kWitchspacePosition];
644}

◆ playGalacticHyperspace

- (void) playGalacticHyperspace

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

540{
541 [sHyperspaceSoundSource playCustomSoundWithKey:@"[galactic-hyperspace-countdown-begun]"];
542}

◆ playGameOver

- (void) playGameOver

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

729{
730 [sMiscSoundPool playSoundWithKey:@"[game-over]"];
731}

◆ playHitByECMSound

- (void) playHitByECMSound

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

552{
553 if (![sEcmSource isPlaying]) [sEcmSource playCustomSoundWithKey:@"[player-hit-by-ecm]"];
554}

◆ playHoldFull

- (void) playHoldFull

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

318{
319 [self playInterfaceBeep:@"[hold-full]"];
320}

◆ playHostileWarning

- (void) playHostileWarning

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

582{
583 [sWarningSoundPool playSoundWithKey:@"[hostile-warning]" priority:1 position:kInterfaceWarningPosition];
584}

◆ playHyperspaceAborted

- (void) playHyperspaceAborted

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

546{
547 [sHyperspaceSoundSource playCustomSoundWithKey:@"[hyperspace-countdown-aborted]"];
548}

◆ playHyperspaceBlocked

- (void) playHyperspaceBlocked

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

360{
361 [self playInterfaceBeep:@"[hyperspace-blocked]"];
362}

◆ playHyperspaceDistanceTooGreat

- (void) playHyperspaceDistanceTooGreat

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

365{
366 [self playInterfaceBeep:@"[witch-too-far]"];
367}

◆ playHyperspaceNoFuel

- (void) playHyperspaceNoFuel

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

354{
355 [self playInterfaceBeep:@"[witch-no-fuel]"];
356}

◆ playHyperspaceNoTarget

- (void) playHyperspaceNoTarget

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

348{
349 [self playInterfaceBeep:@"[witch-no-target]"];
350}

◆ playIdentLockedOn

- (void) playIdentLockedOn

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

218{
219 [self playInterfaceBeep:@"[ident-locked-on]"];
220}

◆ playIdentOff

- (void) playIdentOff

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

212{
213 [self playInterfaceBeep:@"[ident-off]"];
214}

◆ playIdentOn

- (void) playIdentOn

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

206{
207 [self playInterfaceBeep:@"[ident-on]"];
208}

◆ playIncomingMissile:

- (void) playIncomingMissile: (Vector) missileVector

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

593 :(Vector)missileVector
594{
595 [sWarningSoundPool playSoundWithKey:@"[incoming-missile]" priority:3 position:missileVector];
596}

◆ playInterfaceBeep:

- (void) playInterfaceBeep: (NSString *) beepKey
implementation

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

184 :(NSString *)beepKey
185{
186#if OOLITE_WINDOWS
187 if ([self status] == STATUS_START_GAME) { return; }
188#endif
189 [sInterfaceBeepSource playSound:[OOSound soundWithCustomSoundKey:beepKey]];
190}
id soundWithCustomSoundKey:(NSString *key)
Definition Universe.m:11032

◆ playJumpMassLocked

- (void) playJumpMassLocked

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

324{
325 [self playInterfaceBeep:@"[jump-mass-locked]"];
326}

◆ playLaserHit:offset:weaponIdentifier:

- (void) playLaserHit: (BOOL) hit
offset: (Vector) weaponOffset
weaponIdentifier: (NSString *) weaponIdentifier 

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

669 :(BOOL)hit offset:(Vector)weaponOffset weaponIdentifier:(NSString *)weaponIdentifier
670{
671 NSString *identifier = nil;
672 if (hit)
673 {
674 identifier = [weaponShotHit objectForKey:weaponIdentifier];
675 if (!identifier) identifier = @"[player-laser-hit]";
676 [sWeaponSoundPool playSoundWithKey:identifier priority:1.0 expiryTime:0.05 overlap:YES position:weaponOffset];
677 }
678 else
679 {
680 identifier = [weaponShotMiss objectForKey:weaponIdentifier];
681 if (!identifier) identifier = @"[player-laser-miss]";
682 [sWeaponSoundPool playSoundWithKey:identifier priority:1.0 expiryTime:0.05 overlap:YES position:weaponOffset];
683
684 }
685}
return nil
voidpf uLong offset
Definition ioapi.h:140

◆ playLaunchFromStation

- (void) playLaunchFromStation

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

564{
565 [sBreakPatternSource playCustomSoundWithKey:@"[player-launch-from-station]"];
566}

◆ playLegacyScriptSound:

- (void) playLegacyScriptSound: (NSString *) key

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

734 :(NSString *)key
735{
736 [sMiscSoundPool playSoundWithKey:key priority:1.1];
737}

◆ playMenuNavigationDown

- (void) playMenuNavigationDown

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

388{
389 [self playInterfaceBeep:@"[menu-navigation-down]"];
390}

◆ playMenuNavigationNot

- (void) playMenuNavigationNot

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

394{
395 [self playInterfaceBeep:@"[menu-navigation-not]"];
396}

◆ playMenuNavigationUp

- (void) playMenuNavigationUp

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

382{
383 [self playInterfaceBeep:@"[menu-navigation-up]"];
384}

◆ playMenuPageNext

- (void) playMenuPageNext

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

406{
407 [self playInterfaceBeep:@"[menu-previous-page]"];
408}

◆ playMenuPagePrevious

- (void) playMenuPagePrevious

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

400{
401 [self playInterfaceBeep:@"[menu-next-page]"];
402}

◆ playMineArmed

- (void) playMineArmed

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

230{
231 [self playInterfaceBeep:@"[mine-armed]"];
232}

◆ playMineLaunched:weaponIdentifier:

- (void) playMineLaunched: (Vector) weaponOffset
weaponIdentifier: (NSString *) weaponIdentifier 

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

702 :(Vector)weaponOffset weaponIdentifier:(NSString *)weaponIdentifier
703{
704 NSString *identifier = [weaponLaunched objectForKey:weaponIdentifier];
705 if (!identifier) identifier = @"[mine_launched]";
706 [sWeaponSoundPool playSoundWithKey:identifier position:weaponOffset];
707}

◆ playMissileArmed

- (void) playMissileArmed

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

224{
225 [self playInterfaceBeep:@"[missile-armed]"];
226}

◆ playMissileLaunched:weaponIdentifier:

- (void) playMissileLaunched: (Vector) weaponOffset
weaponIdentifier: (NSString *) weaponIdentifier 

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

694 :(Vector)weaponOffset weaponIdentifier:(NSString *)weaponIdentifier
695{
696 NSString *identifier = [weaponLaunched objectForKey:weaponIdentifier];
697 if (!identifier) identifier = @"[missile_launched]";
698 [sWeaponSoundPool playSoundWithKey:identifier position:weaponOffset];
699}

◆ playMissileLockedOn

- (void) playMissileLockedOn

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

242{
243 [self playInterfaceBeep:@"[missile-locked-on]"];
244}

◆ playMissileSafe

- (void) playMissileSafe

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

236{
237 [self playInterfaceBeep:@"[missile-safe]"];
238}

◆ playNextEquipmentSelected

- (void) playNextEquipmentSelected

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

248{
249 [self playInterfaceBeep:@"[next-equipment-selected]"];
250}

◆ playNextMissileSelected

- (void) playNextMissileSelected

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

254{
255 [self playInterfaceBeep:@"[next-missile-selected]"];
256}

◆ playNoTargetInMemory

- (void) playNoTargetInMemory

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

336{
337 [self playInterfaceBeep:@"[no-target-in-memory]"];
338}

◆ playSaveOverwriteNo

- (void) playSaveOverwriteNo

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

312{
313 [self playInterfaceBeep:@"[save-overwrite-no]"];
314}

◆ playSaveOverwriteYes

- (void) playSaveOverwriteYes

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

306{
307 [self playInterfaceBeep:@"[save-overwrite-yes]"];
308}

◆ playScrapeDamage:

- (void) playScrapeDamage: (Vector) attackVector

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

663 :(Vector)attackVector
664{
665 [sDamageSoundPool playSoundWithKey:@"[player-scrape-damage]" position:attackVector];
666}

◆ playSellCommodity

- (void) playSellCommodity

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

510{
511 [sBuySellSourcePool playSoundWithKey:@"[sell-commodity]"];
512}

◆ playShieldHit:weaponIdentifier:

- (void) playShieldHit: (Vector) attackVector
weaponIdentifier: (NSString *) weaponIdentifier 

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

647 :(Vector)attackVector weaponIdentifier:(NSString *)weaponIdentifier
648{
649 NSString *identifier = [weaponShieldHit objectForKey:weaponIdentifier];
650 if (!identifier) identifier = @"[player-hit-by-weapon]";
651 [sDamageSoundPool playSoundWithKey:identifier position:attackVector];
652}

◆ playStandardHyperspace

- (void) playStandardHyperspace

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

534{
535 [sHyperspaceSoundSource playCustomSoundWithKey:@"[hyperspace-countdown-begun]"];
536}

◆ playTargetLost

- (void) playTargetLost

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

330{
331 [self playInterfaceBeep:@"[target-lost]"];
332}

◆ playTargetSwitched

- (void) playTargetSwitched

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

342{
343 [self playInterfaceBeep:@"[target-switched]"];
344}

◆ playWeaponOverheated:

- (void) playWeaponOverheated: (Vector) weaponOffset

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

688 :(Vector)weaponOffset
689{
690 [sWeaponSoundPool playSoundWithKey:@"[weapon-overheat]" overlap:NO position:weaponOffset];
691}

◆ playWeaponsOffline

- (void) playWeaponsOffline

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

266{
267 [self playInterfaceBeep:@"[weapons-offline]"];
268}

◆ playWeaponsOnline

- (void) playWeaponsOnline

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

260{
261 [self playInterfaceBeep:@"[weapons-online]"];
262}

◆ playWitchjumpBlocked

- (void) playWitchjumpBlocked

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

624{
625 [sWarningSoundPool playSoundWithKey:@"[witch-blocked-by-@]" priority:1.3 position:kWitchspacePosition];
626}

◆ playWitchjumpDistanceTooGreat

- (void) playWitchjumpDistanceTooGreat

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

630{
631 [sWarningSoundPool playSoundWithKey:@"[witch-too-far]" priority:1.3 position:kWitchspacePosition];
632}

◆ playWitchjumpFailure

- (void) playWitchjumpFailure

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

612{
613 [sWarningSoundPool playSoundWithKey:@"[witchdrive-failure]" priority:1.5 position:kWitchspacePosition];
614}

◆ playWitchjumpInsufficientFuel

- (void) playWitchjumpInsufficientFuel

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

636{
637 [sWarningSoundPool playSoundWithKey:@"[witch-no-fuel]" priority:1.3 position:kWitchspacePosition];
638}

◆ playWitchjumpMisjump

- (void) playWitchjumpMisjump

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

618{
619 [sWarningSoundPool playSoundWithKey:@"[witchdrive-malfunction]" priority:1.5 position:kWitchspacePosition];
620}

◆ setUpSound

- (void) setUpSound

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

74{
75 [self destroySound];
76
77 sInterfaceBeepSource = [[OOSoundSource alloc] init];
78 [sInterfaceBeepSource setPosition:kInterfaceBeepPosition];
79
80 sBreakPatternSource = [[OOSoundSource alloc] init];
81 [sBreakPatternSource setPosition:kBreakPatternPosition];
82
83 sEcmSource = [[OOSoundSource alloc] init];
84 [sEcmSource setPosition:kEcmPosition];
85
87 [sHyperspaceSoundSource setPosition:kWitchspacePosition];
88
89 sBuySellSourcePool = [[OOSoundSourcePool alloc] initWithCount:kBuySellSourcePoolSize minRepeatTime:0.0];
90 sWarningSoundPool = [[OOSoundSourcePool alloc] initWithCount:kWarningPoolSize minRepeatTime:0.0];
91 sWeaponSoundPool = [[OOSoundSourcePool alloc] initWithCount:kWeaponPoolSize minRepeatTime:0.0];
92 sDamageSoundPool = [[OOSoundSourcePool alloc] initWithCount:kDamagePoolSize minRepeatTime:0.1]; // Repeat time limit is to avoid playing a scrape sound every frame on glancing scrapes. This does limit the number of laser hits that can be played in a furrball, though; maybe lasers and scrapes should use different pools.
93 sMiscSoundPool = [[OOSoundSourcePool alloc] initWithCount:kMiscPoolSize minRepeatTime:0.0];
94
95 // Two sources with the same sound are used to simulate looping.
96 OOSound *afterburnerSound = [ResourceManager ooSoundNamed:@"afterburner1.ogg" inFolder:@"Sounds"];
97 sAfterburnerSources[0] = [[OOSoundSource alloc] initWithSound:afterburnerSound];
98 [sAfterburnerSources[0] setPosition:kAfterburner1Position];
99 sAfterburnerSources[1] = [[OOSoundSource alloc] initWithSound:afterburnerSound];
100 [sAfterburnerSources[1] setPosition:kAfterburner2Position];
101}
OOSound * ooSoundNamed:inFolder:(NSString *fileName,[inFolder] NSString *folderName)

◆ setUpWeaponSounds

- (void) setUpWeaponSounds

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

106{
107 NSArray *eqTypes = [OOEquipmentType allEquipmentTypes];
108 NSMutableDictionary *shotMissSounds = [NSMutableDictionary dictionary];
109 NSMutableDictionary *shotHitSounds = [NSMutableDictionary dictionary];
110 NSMutableDictionary *shieldHitSounds = [NSMutableDictionary dictionary];
111 NSMutableDictionary *unshieldedHitSounds = [NSMutableDictionary dictionary];
112 NSMutableDictionary *weaponLaunchedSounds = [NSMutableDictionary dictionary];
113 NSEnumerator *eqTypeEnum = nil;
114 OOEquipmentType *eqType = nil;
115
116 // special case: turrets aren't defined with a "EQ_WEAPON" prefix, and plasma shots don't have a matching equipment item,
117 // so add a unique entry here. this could be overridden if an OXP creates an equipment item with this key.
118 // plasma shots don't make a sound when fired, so we only need to provide for the hit player sound keys.
119 [shieldHitSounds setObject:@"[player-hit-by-weapon]" forKey:@"EQ_WEAPON_PLASMA_SHOT"];
120 [unshieldedHitSounds setObject:@"[player-direct-hit]" forKey:@"EQ_WEAPON_PLASMA_SHOT"];
121 // grab a local copy of the sound identifiers for weapons to make the process of looking up a sound ref as fast as possible
122 // but we must ensure that no nil values are used for setObject
123 #define OO_ASSIGN_SOUNDSTR_TO_SOUNDS(soundStr, sounds) do { \
124 fxString = [eqType soundStr]; \
125 if (!fxString) fxString = @""; \
126 [sounds setObject:fxString forKey:[eqType identifier]]; \
127 } while(0)
128
129 for (eqTypeEnum = [eqTypes objectEnumerator]; (eqType = [eqTypeEnum nextObject]); )
130 {
131 NSString *fxString = nil;
132 if ([[eqType identifier] hasPrefix:@"EQ_WEAPON"])
133 {
134 OO_ASSIGN_SOUNDSTR_TO_SOUNDS(fxShotMissName, shotMissSounds);
135 OO_ASSIGN_SOUNDSTR_TO_SOUNDS(fxShotHitName, shotHitSounds);
136 OO_ASSIGN_SOUNDSTR_TO_SOUNDS(fxShieldHitName, shieldHitSounds);
137 OO_ASSIGN_SOUNDSTR_TO_SOUNDS(fxUnshieldedHitName, unshieldedHitSounds);
138 }
139 if ([eqType isMissileOrMine])
140 {
141 OO_ASSIGN_SOUNDSTR_TO_SOUNDS(fxWeaponLaunchedName, weaponLaunchedSounds);
142 OO_ASSIGN_SOUNDSTR_TO_SOUNDS(fxShieldHitName, shieldHitSounds);
143 OO_ASSIGN_SOUNDSTR_TO_SOUNDS(fxUnshieldedHitName, unshieldedHitSounds);
144 }
145 }
146
152
153 weaponShotMiss = [[NSDictionary alloc] initWithDictionary:shotMissSounds];
154 weaponShotHit = [[NSDictionary alloc] initWithDictionary:shotHitSounds];
155 weaponShieldHit = [[NSDictionary alloc] initWithDictionary:shieldHitSounds];
156 weaponUnshieldedHit = [[NSDictionary alloc] initWithDictionary:unshieldedHitSounds];
157 weaponLaunched = [[NSDictionary alloc] initWithDictionary:weaponLaunchedSounds];
158}
#define OO_ASSIGN_SOUNDSTR_TO_SOUNDS(soundStr, sounds)
NSArray * allEquipmentTypes()

◆ startAfterburnerSound

- (void) startAfterburnerSound

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

476{
477 if (!afterburnerSoundLooping)
478 {
479 afterburnerSoundLooping = YES;
480 [self updateAfterburnerSound];
481 }
482}

◆ stopAfterburnerSound

- (void) stopAfterburnerSound

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

486{
487 // Do nothing, stop is detected in updateAfterburnerSound
488}

◆ updateAfterburnerSound

- (void) updateAfterburnerSound
implementation

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

455{
456 static uint8_t which = 0;
457
458 if (!afterburner_engaged) // end the loop cycle
459 {
460 afterburnerSoundLooping = NO;
461 }
462
463 if (afterburnerSoundLooping)
464 {
465 [sAfterburnerSources[which] play];
466 which = !which;
467
468 [self performSelector:@selector(updateAfterburnerSound)
469 withObject:NULL
470 afterDelay:1.25]; // and swap sounds in 1.25s time
471 }
472}

◆ updateFuelScoopSoundWithInterval:

- (void) updateFuelScoopSoundWithInterval: (OOTimeDelta) delta_t

Extends class PlayerEntity.

Definition at line 69 of file PlayerEntitySound.m.

429 :(OOTimeDelta)delta_t
430{
431 static double scoopSoundPlayTime = 0.0;
432 scoopSoundPlayTime -= delta_t;
433 if (scoopSoundPlayTime < 0.0)
434 {
435 if(![sInterfaceBeepSource isPlaying])
436 {
437 /* TODO: this should use the scoop position, not the standard
438 * interface beep position */
439 [self playInterfaceBeep:@"[scoop]"];
440 scoopSoundPlayTime = 0.5;
441 }
442 else scoopSoundPlayTime = 0.0;
443 }
444 if (![self scoopOverride])
445 {
446 scoopSoundPlayTime = 0.0;
447 }
448}
double OOTimeDelta
Definition OOTypes.h:224

The documentation for this category was generated from the following files: