diff --git a/TheForceEngine/TFE_DarkForces/Actor/enemies.cpp b/TheForceEngine/TFE_DarkForces/Actor/enemies.cpp index 6d15114d1..4b99458c0 100644 --- a/TheForceEngine/TFE_DarkForces/Actor/enemies.cpp +++ b/TheForceEngine/TFE_DarkForces/Actor/enemies.cpp @@ -195,6 +195,7 @@ namespace TFE_DarkForces DamageModule* damageMod = actor_createDamageModule(dispatch); damageMod->hp = FIXED(cust->hitPoints); damageMod->itemDropId = (ItemId)cust->dropItem; + damageMod->dieEffect = (HitEffectID)cust->dieEffect; damageMod->hurtSndSrc = sound_load(cust->painSound, SOUND_PRIORITY_MED5); damageMod->dieSndSrc = sound_load(cust->dieSound, SOUND_PRIORITY_MED5); actor_addModule(dispatch, (ActorModule*)damageMod); diff --git a/TheForceEngine/TFE_Settings/logics.cpp b/TheForceEngine/TFE_Settings/logics.cpp index a3b2aac5e..60b78c15b 100644 --- a/TheForceEngine/TFE_Settings/logics.cpp +++ b/TheForceEngine/TFE_Settings/logics.cpp @@ -78,6 +78,28 @@ namespace TFE_Settings "PILE", // 44 }; + const char* s_dieEffectTable[] = + { + "SMALL_EXP", // 0 // small "puff" - blaster weapons. + "THERMDET_EXP", // 1 // thermal detonator explosion. + "PLASMA_EXP", // 2 // plasma "puff". + "MORTAR_EXP", // 3 // mortar explosion + "CONCUSSION", // 4 // concussion - first stage. + "CONCUSSION2", // 5 // concussion - second stage. + "MISSILE_EXP", // 6 // missile explosion. + "MISSILE_WEAK", // 7 // weaker version of the missle explosion. + "PUNCH", // 8 // punch + "CANNON_EXP", // 9 // cannon "puff". + "REPEATER_EXP", // 10 // repeater "puff". + "LARGE_EXP", // 11 // large explosion such as land mine. + "EXP_BARREL", // 12 // exploding barrel. + "EXP_INVIS", // 13 // an explosion that makes no sound and has no visual effect. + "SPLASH", // 14 // water splash + "EXP_35", // 15 // medium explosion, 35 damage. + "EXP_NO_DMG", // 16 // medium explosion, no damage. + "EXP_25", // 17 // medium explosion, 25 damage. + }; + /////////////////////////// /// Forward declarations @@ -215,6 +237,28 @@ namespace TFE_Settings return false; } + // Die effect as a number + if (cJSON_IsNumber(data) && strcasecmp(data->string, "dieEffect") == 0) + { + customLogic.dieEffect = data->valueint; + return true; + } + + // Die effect as a string + if (cJSON_IsString(data) && strcasecmp(data->string, "dieEffect") == 0) + { + for (int i = 0; i <= 17; i++) + { + if (strcasecmp(data->valuestring, s_dieEffectTable[i]) == 0) + { + customLogic.dieEffect = i; + return true; + } + } + + return false; + } + if (cJSON_IsBool(data) && strcasecmp(data->string, "hasMeleeAttack") == 0) { customLogic.hasMeleeAttack = cJSON_IsTrue(data); diff --git a/TheForceEngine/TFE_Settings/logics.h b/TheForceEngine/TFE_Settings/logics.h index e83f322a1..82abfdb89 100644 --- a/TheForceEngine/TFE_Settings/logics.h +++ b/TheForceEngine/TFE_Settings/logics.h @@ -20,6 +20,7 @@ struct CustomActorLogic // Defaults are based on what is set by default in the original code u32 hitPoints = 4; s32 dropItem = -1; + s32 dieEffect = -1; bool hasMeleeAttack = false; bool hasRangedAttack = true;