Re-tool and clean up attack type model loading.
@@ -9273,12 +9273,15 @@ s_model *load_cached_model(char *name, char *owner, char unload)
tempdef(else if, BURN)
tempdef(else if, SHOCK)
tempdef(else if, FREEZE)
+
+ tempdef(else if, BOSS)
tempdef(else if, ITEM)
tempdef(else if, LAND)
- tempdef(else if, PIT)
tempdef(else if, LIFESPAN)
tempdef(else if, LOSE)
+ tempdef(else if, PIT)
tempdef(else if, TIMEOVER)
+
else if(starts_with(value, "normal"))
{
get_tail_number(tempInt, value, "normal");
@@ -9286,15 +9289,24 @@ s_model *load_cached_model(char *name, char *owner, char unload)
}
else if(stricmp(value, "ALL") == 0)
{
+ // Loop over all attack types and apply
+ // the value setting.
for(i = 0; i < max_attack_types; i++)
{
- /*
- Skip the pit, lifespan, and time over attack types as these are for engine use. Nothing stops an author from defining defense settings for them individually.
- */
- if(i != ATK_PIT && i != ATK_TIMEOVER && i != ATK_LIFESPAN && i != ATK_LOSE)
+ // Skip types that we only intend for
+ // engine or script logic use.
+ if(i == ATK_BOSS
+ || i == ATK_ITEM
+ || i == ATK_LIFESPAN
+ || i == ATK_LOSE
+ || i == ATK_TIMEOVER
+ || i == ATK_PIT)
{
- newchar->defense[i] = defense;
+ continue;
}
+
+ newchar->defense[i] = defense;
+
}
}
}
@@ -9324,12 +9336,15 @@ s_model *load_cached_model(char *name, char *owner, char unload)
tempoff(else if, BURN, offense_factors)
tempoff(else if, SHOCK, offense_factors)
tempoff(else if, FREEZE, offense_factors)
+
+ tempoff(else if, BOSS, offense_factors)
tempoff(else if, ITEM, offense_factors)
tempoff(else if, LAND, offense_factors)
- tempoff(else if, PIT, offense_factors)
tempoff(else if, LIFESPAN, offense_factors)
tempoff(else if, LOSE, offense_factors)
+ tempoff(else if, PIT, offense_factors)
tempoff(else if, TIMEOVER, offense_factors)
+
else if(starts_with(value, "normal"))
{
get_tail_number(tempInt, value, "normal");
@@ -9338,13 +9353,24 @@ s_model *load_cached_model(char *name, char *owner, char unload)
else if(stricmp(value, "ALL") == 0)
{
tempFloat = GET_FLOAT_ARG(2);
+
+ // Loop over all attack types and apply
+ // the value setting.
for(i = 0; i < max_attack_types; i++)
{
- //offense hardly need those, just in case
- if(i != ATK_PIT && i != ATK_TIMEOVER && i != ATK_LIFESPAN && i != ATK_LOSE)
+ // Skip types that we only intend for
+ // engine or script logic use.
+ if(i == ATK_BOSS
+ || i == ATK_ITEM
+ || i == ATK_LIFESPAN
+ || i == ATK_LOSE
+ || i == ATK_TIMEOVER
+ || i == ATK_PIT)
{
- newchar->offense_factors[i] = tempFloat;
+ continue;
}
+
+ newchar->offense_factors[i] = tempFloat;
}
}
}
