Index: code/ai/ai.h
===================================================================
--- code/ai/ai.h	(revision 5691)
+++ code/ai/ai.h	(working copy)
@@ -307,6 +307,10 @@
 // Goober5000 (based on the "you can only remember 7 things in short-term memory" assumption)
 #define MAX_IGNORE_NEW_OBJECTS	7
 
+//SUSHI: So that things don't break too badly when adding lots of AI classes 
+//(some of the autocalculated stuff based on AI class doesn't scale with the total number of AI classes)
+#define MAX_AUTOCALC_AI_CLASS 9
+
 typedef struct ai_info {
 	int		ai_flags;				//	Special flags for AI behavior.
 	int		shipnum;					// Ship using this slot, -1 means none.
Index: code/ai/aicode.cpp
===================================================================
--- code/ai/aicode.cpp	(revision 5691)
+++ code/ai/aicode.cpp	(working copy)
@@ -8804,8 +8804,9 @@
 										firing_range = MIN((swip->max_speed * swip->lifetime * 0.75f), swip->weapon_range);
 									else
 									{
+										int autocalc_ai_class = MIN(aip->ai_class, MAX_AUTOCALC_AI_CLASS);
 										float secondary_range_mult = (aip->ai_secondary_range_mult == FLT_MIN)
-											? (Game_skill_level + 1 + aip->ai_class/2)/NUM_SKILL_LEVELS
+											? (Game_skill_level + 1 + autocalc_ai_class/2)/NUM_SKILL_LEVELS
 											: aip->ai_secondary_range_mult;
 
 										firing_range = MIN((swip->max_speed * swip->lifetime * secondary_range_mult), swip->weapon_range);
@@ -13763,10 +13764,11 @@
 
 	//	Don't all react right away.
 	if (!(aip->ai_flags & AIF_AVOID_SHOCKWAVE_STARTED)) {
+		int autocalc_ai_class = MIN(aip->ai_class, MAX_AUTOCALC_AI_CLASS);
 		float evadeChance = (aip->ai_shockwave_evade_chance == FLT_MIN) 
-			? ((float) aip->ai_class/4.0f + 0.25f)
+			? ((float) autocalc_ai_class/4.0f + 0.25f) //	Chance to avoid in 1 second is 0.25 + ai_class/4
 			: aip->ai_shockwave_evade_chance;
-		if (!rand_chance(flFrametime, evadeChance))	//	Chance to avoid in 1 second is 0.25 + ai_class/4
+		if (!rand_chance(flFrametime, evadeChance))	
 			return 0;
 	}
 
