Skip to content

Commit

Permalink
Merge pull request #77824 from Kamejeir/emp-armor-protection
Browse files Browse the repository at this point in the history
faraday CBM now protects your bionic power
  • Loading branch information
Anton Burmistrov authored Nov 24, 2024
2 parents dcfb467 + 6919332 commit 14f7f1d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/json/bionics.json
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@
[ "foot_r", 1 ]
],
"flags": [ "BIONIC_TOGGLED", "BIONIC_NPC_USABLE", "BIONIC_SHOCKPROOF" ],
"active_flags": [ "ELECTRIC_IMMUNE" ],
"active_flags": [ "ELECTRIC_IMMUNE", "EMP_ENERGYDRAIN_IMMUNE" ],
"act_cost": "5 J",
"react_cost": "5 J",
"time": "1 s"
Expand Down
1 change: 1 addition & 0 deletions doc/JSON_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ Character flags can be `trait_id`, `json_flag_id` or `flag_id`. Some of these a
- ```ECTOTHERM``` For ectothermic mutations, like `COLDBLOOD4` and `DRAGONBLOOD3` (Black Dragon from Magiclysm).
- ```ETHEREAL``` You will not drop your items if you gain the `incorporeal` effect.
- ```ELECTRIC_IMMUNE``` You are immune to electric damage.
- ```EMP_ENERGYDRAIN_IMMUNE``` Your bionic power cannot be drained during an EMP blast.
- ```EMP_IMMUNE``` You bionic power cannot be drained and your vulnerable electronics cannot be broken during an EMP blast.
- ```ENHANCED_VISION``` Increases the scouting range, similarly to `ZOOM` item flag.
- ```EYE_MEMBRANE``` Lets you see underwater.
Expand Down
4 changes: 3 additions & 1 deletion src/explosion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ static const itype_id fuel_type_none( "null" );
static const itype_id itype_e_handcuffs( "e_handcuffs" );
static const itype_id itype_rm13_armor_on( "rm13_armor_on" );

static const json_character_flag json_flag_EMP_ENERGYDRAIN_IMMUNE( "EMP_ENERGYDRAIN_IMMUNE" );
static const json_character_flag json_flag_EMP_IMMUNE( "EMP_IMMUNE" );
static const json_character_flag json_flag_GLARE_RESIST( "GLARE_RESIST" );

Expand Down Expand Up @@ -796,7 +797,8 @@ void emp_blast( const tripoint &p )
if( player_character.posx() == p.x && player_character.posy() == p.y &&
player_character.posz() == p.z ) {
if( player_character.get_power_level() > 0_kJ &&
!player_character.has_flag( json_flag_EMP_IMMUNE ) ) {
!player_character.has_flag( json_flag_EMP_IMMUNE ) &&
!player_character.has_flag( json_flag_EMP_ENERGYDRAIN_IMMUNE ) ) {
add_msg( m_bad, _( "The EMP blast drains your power." ) );
int max_drain = ( player_character.get_power_level() > 1000_kJ ? 1000 : units::to_kilojoule(
player_character.get_power_level() ) );
Expand Down

0 comments on commit 14f7f1d

Please sign in to comment.