Skip to content

Commit

Permalink
Improved Dazzle Effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew4484 committed Nov 22, 2023
1 parent 0d45f4d commit 239764b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/json/ammo_effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@
"type": "ammo_effect",
"//": "Applies sensor-stunning effect to robots. Hardcoded"
},
{
"id": "ROBOT_DAZZLE_IMPROVED",
"type": "ammo_effect",
"//": "Applies sensor-stunning effect to robots. Improved for use in Aftershock. Hardcoded"
},
{
"id": "RECOVER_X",
"type": "ammo_effect",
Expand Down
12 changes: 12 additions & 0 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,18 @@ void projectile::apply_effects_damage( Creature &target, Creature *source,
}
}

if( proj_effects.count( "ROBOT_DAZZLE_IMPROVED" ) ) {
if( critical && target.in_species( species_ROBOT ) ) {
time_duration duration = rng( 8_turns, 12_turns );
target.add_effect( effect_source( source ), effect_stunned, duration );
target.add_effect( effect_source( source ), effect_sensor_stun, duration );
add_msg( source->is_avatar() ?
_( "The %1$s seems to stagger as the array fires." ) :
_( "The %1$s is stunned!" ),
target.disp_name( true ) );
}
}

if( dealt_dam.bp_hit->has_type( body_part_type::type::head ) &&
proj_effects.count( "BLINDS_EYES" ) ) {
// TODO: Change this to require bp_eyes
Expand Down

0 comments on commit 239764b

Please sign in to comment.