improved explosives v2

This commit is contained in:
AKALegman 2015-06-06 18:58:42 +01:00
parent f9a7ab5ae0
commit 46ed9416ed
6 changed files with 18 additions and 19 deletions

View File

@ -7,8 +7,8 @@ class ACE_Settings {
value = 1;
typeName = "BOOL";
};
class GVAR(ExplodeOnDefuseChance) {
value = 0.02;
typeName = "SCALAR";
class GVAR(ExplodeOnDefuse) {
value = 1;
typeName = "BOOL";
};
};

View File

@ -72,7 +72,7 @@ class CfgAmmo {
class IEDUrbanBig_Remote_Ammo: PipeBombBase {
triggerWhenDestroyed = 1;
ACE_ExplodeOnDefuse = 1;
ACE_explodeOnDefuse = 0.02;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class IEDUrbanBig_Command_Ammo: IEDUrbanBig_Remote_Ammo {
@ -84,7 +84,7 @@ class CfgAmmo {
class IEDUrbanSmall_Remote_Ammo: PipeBombBase {
triggerWhenDestroyed = 1;
ACE_ExplodeOnDefuse = 1;
ACE_explodeOnDefuse = 0.02;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class IEDUrbanSmall_Command_Ammo: IEDUrbanSmall_Remote_Ammo {
@ -96,7 +96,7 @@ class CfgAmmo {
class IEDLandBig_Remote_Ammo: PipeBombBase {
triggerWhenDestroyed = 1;
ACE_ExplodeOnDefuse = 1;
ACE_explodeOnDefuse = 0.02;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class IEDLandBig_Command_Ammo: IEDLandBig_Remote_Ammo {
@ -108,7 +108,7 @@ class CfgAmmo {
class IEDLandSmall_Remote_Ammo: PipeBombBase {
triggerWhenDestroyed = 1;
ACE_ExplodeOnDefuse = 1;
ACE_explodeOnDefuse = 0.02;
soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40};
};
class IEDLandSmall_Command_Ammo: IEDLandSmall_Remote_Ammo {

View File

@ -23,11 +23,11 @@ class ACE_ModuleExplosive: Module_F {
typeName = "BOOL";
defaultValue = 1;
};
class ExplodeOnDefuseChance {
displayName = "$STR_ACE_Explosive_ExplodeOnDefuseChance_DisplayName";
description = "$STR_ACE_Explosive_ExplodeOnDefuseChance_Description";
typeName = "NUMBER";
defaultValue = 0.02;
class ExplodeOnDefuse {
displayName = "$STR_ACE_Explosive_ExplodeOnDefuse_DisplayName";
description = "$STR_ACE_Explosive_ExplodeOnDefuse_Description";
typeName = "BOOL";
defaultValue = 1;
};
};
class ModuleDescription: ModuleDescription {

View File

@ -18,8 +18,7 @@
EXPLODE_2_PVT(_this,_unit,_explosive);
_explode = random 1.0;
if (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse") == 1 &&
_explode < GVAR(ExplodeOnDefuseChance)) exitWith {
if (GVAR(ExplodeOnDefuse) && _explode < getNumber(ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse")) exitWith {
[_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive);
};

View File

@ -27,7 +27,7 @@ if !(_activated) exitWith {};
call EFUNC(Common,readSettingFromModule);
[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"]
call EFUNC(Common,readSettingFromModule);
[_logic, QGVAR(ExplodeOnDefuseChance),"ExplodeOnDefuseChance"]
[_logic, QGVAR(ExplodeOnDefuse),"ExplodeOnDefuse"]
call EFUNC(Common,readSettingFromModule);
diag_log text "[ACE]: Explosive Module Initialized.";

View File

@ -525,11 +525,11 @@
<English>Increase the time it takes to complete actions for non-specialists? Default: Yes</English>
<Polish>Zwiększyć ilość wymaganego czasu do ukończenia akcji dla nie-specjalistów? Domyślnie: Tak</Polish>
</Key>
<Key ID="STR_ACE_Explosive_ExplodeOnDefuseChance_DisplayName">
<English>Explode chance?</English>
<Key ID="STR_ACE_Explosive_ExplodeOnDefuse_DisplayName">
<English>Explode on defusal?</English>
</Key>
<Key ID="STR_ACE_Explosive_ExplodeOnDefuseChance_Description">
<English>Chance for special explosives to explode on defuse? Default: 0.02 (2%)</English>
<Key ID="STR_ACE_Explosive_ExplodeOnDefuse_Description">
<English>Enable certain explosives to explode on defusal? Default: Yes</English>
</Key>
<Key ID="STR_ACE_Explosive_Module_Description">
<English></English>