fix awful if chain

This commit is contained in:
alison wright 2019-09-18 16:36:49 -04:00
parent 5b34a34292
commit 47d74c39cd

View File

@ -101,44 +101,31 @@ void() HuntTarget = {
};
void() SightSound = {
float rsnd;
string snd;
if(self.classname == "monster_ogre") {
sound(self, CHAN_VOICE, "ogre/ogwake.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_knight") {
sound(self, CHAN_VOICE, "knight/ksight.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_shambler") {
sound(self, CHAN_VOICE, "shambler/ssight.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_demon1") {
sound(self, CHAN_VOICE, "demon/sight2.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_wizard") {
sound(self, CHAN_VOICE, "wizard/wsight.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_zombie") {
sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_dog") {
sound(self, CHAN_VOICE, "dog/dsight.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_hell_knight") {
sound(self, CHAN_VOICE, "hknight/sight1.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_tarbaby") {
sound(self, CHAN_VOICE, "blob/sight1.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_vomit") {
sound(self, CHAN_VOICE, "vomitus/v_sight1.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_enforcer") {
rsnd = rint(random() * 3);
if(rsnd == 1) {
sound(self, CHAN_VOICE, "enforcer/sight1.wav", 1, ATTN_NORM);
} else if(rsnd == 2) {
sound(self, CHAN_VOICE, "enforcer/sight2.wav", 1, ATTN_NORM);
} else if(rsnd == 0) {
sound(self, CHAN_VOICE, "enforcer/sight3.wav", 1, ATTN_NORM);
} else {
sound(self, CHAN_VOICE, "enforcer/sight4.wav", 1, ATTN_NORM);
switch(self.classname) {
case "monster_enforcer":
switch(rint(random() * 3)) {
case 0: snd = "enforcer/sight3.wav"; break;
case 1: snd = "enforcer/sight1.wav"; break;
case 2: snd = "enforcer/sight2.wav"; break;
case 3: snd = "enforcer/sight4.wav"; break;
}
} else if(self.classname == "monster_army") {
sound(self, CHAN_VOICE, "soldier/sight1.wav", 1, ATTN_NORM);
} else if(self.classname == "monster_shalrath") {
sound(self, CHAN_VOICE, "shalrath/sight.wav", 1, ATTN_NORM);
break;
case "monster_army": snd = "soldier/sight1.wav"; break;
case "monster_demon1": snd = "demon/sight2.wav"; break;
case "monster_dog": snd = "dog/dsight.wav"; break;
case "monster_hell_knight": snd = "hknight/sight1.wav"; break;
case "monster_knight": snd = "knight/ksight.wav"; break;
case "monster_ogre": snd = "ogre/ogwake.wav"; break;
case "monster_shalrath": snd = "shalrath/sight.wav"; break;
case "monster_shambler": snd = "shambler/ssight.wav"; break;
case "monster_tarbaby": snd = "blob/sight1.wav"; break;
case "monster_wizard": snd = "wizard/wsight.wav"; break;
case "monster_zombie": snd = "zombie/z_idle.wav"; break;
}
sound(self, CHAN_VOICE, snd, 1, ATTN_NORM);
};
void() FoundTarget = {