improved explosives

This commit is contained in:
AKALegman 2015-06-06 10:11:00 +01:00
parent 3b01da6962
commit f9a7ab5ae0
7 changed files with 28 additions and 4 deletions

View File

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

View File

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

View File

@ -106,7 +106,7 @@ class CfgMagazines {
class DeadmanSwitch: Command{};
class Cellphone: Command{};
class PressurePlate{
displayName = $STR_ACE_Explosives_SLAME_Magnetic;
displayName = $STR_ACE_Explosives_PressurePlate;
digDistance = 0;
ammo = "IEDUrbanBig_Range_Ammo";
pitch = 0;
@ -136,7 +136,7 @@ class CfgMagazines {
class DeadmanSwitch: Command {};
class Cellphone: Command {};
class PressurePlate {
displayName = $STR_ACE_Explosives_SLAME_Magnetic;
displayName = $STR_ACE_Explosives_PressurePlate;
digDistance = 0;
ammo = "IEDUrbanSmall_Range_Ammo";
pitch = 0;

View File

@ -22,6 +22,12 @@ class ACE_ModuleExplosive: Module_F {
description = "$STR_ACE_Explosive_PunishNonSpecialists_Description";
typeName = "BOOL";
defaultValue = 1;
};
class ExplodeOnDefuseChance {
displayName = "$STR_ACE_Explosive_ExplodeOnDefuseChance_DisplayName";
description = "$STR_ACE_Explosive_ExplodeOnDefuseChance_Description";
typeName = "NUMBER";
defaultValue = 0.02;
};
};
class ModuleDescription: ModuleDescription {

View File

@ -17,7 +17,9 @@
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_explosive);
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof _explosive >> "ACE_explodeOnDefuse") == 1) exitWith {
_explode = random 1.0;
if (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse") == 1 &&
_explode < GVAR(ExplodeOnDefuseChance)) exitWith {
[_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive);
};

View File

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

View File

@ -524,6 +524,12 @@
<Key ID="STR_ACE_Explosive_PunishNonSpecialists_Description">
<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>
<Key ID="STR_ACE_Explosive_ExplodeOnDefuseChance_Description">
<English>Chance for special explosives to explode on defuse? Default: 0.02 (2%)</English>
</Key>
<Key ID="STR_ACE_Explosive_Module_Description">
<English></English>