aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-01-07 05:59:10 -0500
committerB. Watson <yalhcru@gmail.com>2016-01-07 05:59:10 -0500
commit4fdd52d694a35ad9ef2db630739df15e1752a475 (patch)
tree7a49312cbe2bf6ea99e55314befc11cebde35820
parent3d7d8a9b549f1b6445858f78012b4c55609e1335 (diff)
downloadtaipan-4fdd52d694a35ad9ef2db630739df15e1752a475.tar.gz
some sounds in game now
-rw-r--r--sounds.h68
-rw-r--r--taipan.c31
2 files changed, 95 insertions, 4 deletions
diff --git a/sounds.h b/sounds.h
index 06f67ec..7b72734 100644
--- a/sounds.h
+++ b/sounds.h
@@ -1,5 +1,73 @@
+/* set volume 10, distortion 10 on audio channel 0 */
void init_sound(void);
+
+/* silence audio channel 0 */
void stop_sound(void);
+
+/* played when something bad happens */
void bad_joss_sound(void);
+
+/* played when something good happens */
void good_joss_sound(void);
+
+/* played before & during combat */
void under_attack_sound(void);
+
+/* rest of this file is a list of all the instances of each sound,
+ gathered by playing the Apple II version in an emulator, and by
+ reading the Applesoft source (the goggles, they do nothing!). It
+ may be incomplete.
+
+bad_joss_sound: CALL 2521
+li yuen has sent a lieutenant... *
+li yuen's pirates! (attacking) *
+killed a bad guy (?) *
+sunk X of 'em *
+X ran away *
+storm taipan! *
+we made it! (after a storm) *
+
+call 2521:
+wu_bailout (very well, good joss) *
+trying to enter an empty firm name
+we got 'em all! *
+let's hope we lose 'em! *
+X ran away *
+sunk X of the buggers *
+they let us be *
+
+good_joss_sound: CALL 2518
+captured some booty *
+we made it! (after combat) *
+got away in combat *
+you're already here! *
+price has risen (dropped) *
+
+call 2518:
+there's nothing there (throwing cargo)
+ship overloaded *
+you have only (trying to put too much in warehouse)
+you have only X in cash (paying Wu back, depositing in bank)
+you have only X in the bank
+warehouse will only hold an additional
+warehouse is full
+won't loan you so much
+you have no cargo (trying to put in warehouse)
+
+
+under_attack_sound: CALL 2512
+X hostile ships approaching *
+hit in combat
+
+call 2512:
+beaten & robbed
+bodyguards killed
+very well, the game is over (wu_bailout) *
+buggers hit a gun
+we've been hit
+what shall we do?
+we're going down (storm)
+X ships of li yuen's pirate fleet *
+X hostile ships approaching *
+
+*/
diff --git a/taipan.c b/taipan.c
index 744719a..201979f 100644
--- a/taipan.c
+++ b/taipan.c
@@ -290,6 +290,7 @@ void captains_report() {
void overload(void) {
compradores_report();
cputs("Your ship is overloaded, Taipan!!");
+ good_joss_sound();
timed_getch(TMOUT_5S);
return;
}
@@ -676,6 +677,7 @@ int sea_battle(int id, int num_ships) {
sk++;
ships_on_screen[targeted] = 0;
+ bad_joss_sound(); /* not sure this should be here */
sink_lorcha(targeted);
plus_or_space(num_ships > num_on_screen);
@@ -695,6 +697,7 @@ int sea_battle(int id, int num_ships) {
cputs("Sunk ");
cprintulong(sk);
cputs(" of the buggers, Taipan!");
+ bad_joss_sound();
} else {
cputs("Hit 'em, but didn't sink 'em, Taipan!");
}
@@ -711,6 +714,7 @@ int sea_battle(int id, int num_ships) {
clrtoeol();
cprintulong(ran);
cputs(" ran away, Taipan!");
+ bad_joss_sound();
if(num_ships <= 10) {
for(i = 9; i >= 0; i--) {
@@ -824,6 +828,7 @@ int sea_battle(int id, int num_ships) {
gotoxy(0, 3);
clrtoeol();
cputs("Let's hope we lose 'em, Taipan!");
+ bad_joss_sound();
if (choice < 4) {
hold_[choice] -= amount;
hold += amount;
@@ -865,6 +870,7 @@ int sea_battle(int id, int num_ships) {
gotoxy(0, 3);
clrtoeol();
cputs("We got away from 'em, Taipan!");
+ good_joss_sound();
timed_getch(TMOUT_3S);
num_ships = 0;
} else {
@@ -1028,6 +1034,7 @@ int sea_battle(int id, int num_ships) {
gotoxy(0, 3);
clrtoeol();
cputs("We got 'em all, Taipan!");
+ bad_joss_sound();
timed_getch(TMOUT_3S);
return 1;
@@ -1772,6 +1779,7 @@ void quit(void)
if (choice == port)
{
cputs("\r\n\nYou're already here, Taipan.");
+ good_joss_sound();
timed_getch(TMOUT_5S);
} else if ((choice >= 1) && (choice <= 7)) {
port = choice;
@@ -1796,6 +1804,7 @@ void quit(void)
}
cprintulong(num_ships);
cputs(" hostile ships approaching, Taipan!\r\n");
+ under_attack_sound();
timed_getch(TMOUT_3S);
@@ -1819,12 +1828,14 @@ void quit(void)
gotoxy(0, 18);
clrtobot();
cputs("Li Yuen's pirates, Taipan!!\r\n\n");
+ bad_joss_sound();
timed_getch(TMOUT_3S);
if (li > 0)
{
cputs("Good joss!! They let us be!!\r\n");
+ bad_joss_sound();
timed_getch(TMOUT_3S);
@@ -1836,7 +1847,7 @@ void quit(void)
cprintulong(num_ships);
cputs(" ships of Li Yuen's pirate\r\n");
cputs("fleet, Taipan!!\r\n");
-
+ under_attack_sound();
timed_getch(TMOUT_3S);
sea_battle(LI_YUEN, num_ships);
@@ -1858,8 +1869,10 @@ void quit(void)
cputs(fancy_num);
cputc('!');
cash += booty;
+ good_joss_sound();
} else if (result == 3) {
cputs("We made it!");
+ good_joss_sound();
} else {
cputs("The buggers got us, Taipan!!!\r\n");
cputs("It's all over, now!!!");
@@ -1878,6 +1891,7 @@ void quit(void)
gotoxy(0, 18);
clrtobot();
cputs("Storm, Taipan!!\r\n\n");
+ bad_joss_sound();
timed_getch(TMOUT_3S);
if (randi()%30 == 0)
@@ -1908,6 +1922,7 @@ void quit(void)
}
cputs(" We made it!!\r\n\n");
+ bad_joss_sound();
timed_getch(TMOUT_3S);
if (randi()%3 == 0)
@@ -2123,6 +2138,7 @@ void elder_brother_wu(void)
{
compradores_report();
cputs("Very well, Taipan, the game is over!\r\n");
+ under_attack_sound();
timed_getch(TMOUT_5S);
@@ -2134,6 +2150,7 @@ void elder_brother_wu(void)
compradores_report();
cputs("Very well, Taipan. Good joss!!\r\n");
+ bad_joss_sound();
timed_getch(TMOUT_5S);
@@ -2282,6 +2299,7 @@ void good_prices(void)
cprintulong(price[i]);
cputs("!!\r\n");
+ good_joss_sound();
timed_getch(TMOUT_3S);
}
@@ -2442,8 +2460,13 @@ void name_firm(void)
gotoxy(12, 13);
- while(((input = agetc()) != ENTER) && (count < 22)) {
- if(input == BKSP) {
+ while((input = agetc()) && (count < 22)) {
+ if(input == ENTER) {
+ if(count)
+ break;
+ else
+ bad_joss_sound();
+ } else if(input == BKSP) {
if(count) {
backspace();
firm[count--] = '\0';
@@ -2862,7 +2885,7 @@ int main(void) {
cputs("Li Yuen has sent a Lieutenant,\r\n");
cputs("Taipan. He says his admiral wishes\r\n");
cputs("to see you in Hong Kong, posthaste!\r\n");
-
+ bad_joss_sound();
timed_getch(TMOUT_3S);
}