agrip/se.mqc

Go to the documentation of this file.
00001 /*  Copyright 2004 Matthew Tylee Atkinson
00002 
00003     This program is free software; you can redistribute it and/or modify
00004     it under the terms of the GNU General Public License as published by
00005     the Free Software Foundation; either version 2 of the License, or
00006     (at your option) any later version.
00007 
00008     This program is distributed in the hope that it will be useful,
00009     but WITHOUT ANY WARRANTY; without even the implied warranty of
00010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011     GNU General Public License for more details.
00012 
00013     You should have received a copy of the GNU General Public License
00014     along with this program; if not, write to the Free Software
00015     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00016 
00017     See file, 'COPYING', for details.
00018 */
00019 
00020 /* $AGRIP-START */
00021 /* AGRIP Sound Entities */
00022 
00031 // PROTOTYPES
00032 
00033 void snap_se_singlesound();
00034 void snap_se_stickysound();
00035 void snap_se_cornersound();
00036 void snap_se_loopedsound();
00037 void snap_se_loopedsound_public();
00038 
00039 
00040 // IMPLEMENTATIONS
00041 
00049 void snap_se_singlesound()
00050 {
00051     safe_soundtoclient(self.owner, self, CHAN_AUTO, self.message, self.frags, ATTN_NORM);
00052     remove(self);
00053 };
00054 
00065 void snap_se_stickysound()
00066 {
00067     safe_soundtoclient(self.owner, self, CHAN_AUTO, self.message, self.frags, ATTN_NORM);
00068 };
00069 
00080 void snap_se_cornersound()
00081 {
00082     // Check if we've made the first sound yet or not...
00083     if( ! self.items )
00084     {
00085         // No, we haven't...
00086         setorigin(self, self.dest1);
00087         safe_soundtoclient(self.owner, self, CHAN_AUTO, self.message, self.frags, ATTN_NORM);
00088         self.nextthink = time + 0.2;
00089         self.items = true;
00090     }
00091     else
00092     {
00093         // Yes, we have; do the corner sound now...
00094         setorigin(self, self.dest2);
00095         safe_soundtoclient(self.owner, self, CHAN_AUTO, self.message, self.health, ATTN_NORM);
00096         remove(self);
00097     }
00098 };
00099 
00104 void snap_se_loopedsound()
00105 {
00106     safe_soundtoclient(self.owner, self, CHAN_AUTO, self.message, self.frags, ATTN_NORM);
00107     self.nextthink = time + self.health;
00108 };
00109 
00110 /*
00111     Make a looped sound (not ambient, as we might want to delete it
00112     at some point later on).
00113 */
00114 void snap_se_loopedsound_public()
00115 {
00116     // for debugging...
00117     if( self.frags < 0 )
00118         error("PLEASE REPORT THIS BUG TO THE DEVELOPERS INCLUDING ALL TEXT MESSAGES!\n");
00119     else if( self.frags > 1 )
00120         error("PLEASE REPORT THIS BUG TO THE DEVELOPERS INCLUDING ALL TEXT MESSAGES!\n");
00121 
00122     sound(self, CHAN_AUTO, self.message, self.frags, ATTN_NORM);
00123     self.nextthink = time + self.health;
00124 };
00125 
00126 /* $AGRIP-END */

Generated on Tue Jan 1 17:55:54 2008 for AudioQuake QuakeC by  doxygen 1.5.4