Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faraday CBM now protects your bionic power #77824

Merged
merged 7 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading