7777
7878struct mutation_branch ;
7979
80- static const ammo_effect_str_id ammo_effect_id_APPLY_SAP ( " APPLY_SAP" );
81- static const ammo_effect_str_id ammo_effect_id_BEANBAG ( " BEANBAG" );
82- static const ammo_effect_str_id ammo_effect_id_BLINDS_EYES ( " BLINDS_EYES" );
83- static const ammo_effect_str_id ammo_effect_id_BOUNCE ( " BOUNCE" );
84- static const ammo_effect_str_id ammo_effect_id_FOAMCRETE ( " FOAMCRETE" );
85- static const ammo_effect_str_id ammo_effect_id_LARGE_BEANBAG ( " LARGE_BEANBAG" );
86- static const ammo_effect_str_id ammo_effect_id_MAGIC ( " MAGIC" );
87- static const ammo_effect_str_id ammo_effect_id_NO_DAMAGE_SCALING ( " NO_DAMAGE_SCALING" );
88- static const ammo_effect_str_id ammo_effect_id_NOGIB ( " NOGIB" );
89- static const ammo_effect_str_id ammo_effect_id_PARALYZEPOISON ( " PARALYZEPOISON" );
90- static const ammo_effect_str_id ammo_effect_id_ROBOT_DAZZLE ( " ROBOT_DAZZLE" );
91- static const ammo_effect_str_id ammo_effect_id_TANGLE ( " TANGLE" );
92- static const ammo_effect_str_id ammo_effect_id_IGNITE ( " IGNITE" );
93- static const ammo_effect_str_id ammo_effect_id_INCENDIARY ( " INCENDIARY" );
80+ static const ammo_effect_str_id ammo_effect_APPLY_SAP ( " APPLY_SAP" );
81+ static const ammo_effect_str_id ammo_effect_BEANBAG ( " BEANBAG" );
82+ static const ammo_effect_str_id ammo_effect_BLINDS_EYES ( " BLINDS_EYES" );
83+ static const ammo_effect_str_id ammo_effect_BOUNCE ( " BOUNCE" );
84+ static const ammo_effect_str_id ammo_effect_FOAMCRETE ( " FOAMCRETE" );
85+ static const ammo_effect_str_id ammo_effect_LARGE_BEANBAG ( " LARGE_BEANBAG" );
86+ static const ammo_effect_str_id ammo_effect_MAGIC ( " MAGIC" );
87+ static const ammo_effect_str_id ammo_effect_NO_DAMAGE_SCALING ( " NO_DAMAGE_SCALING" );
88+ static const ammo_effect_str_id ammo_effect_NOGIB ( " NOGIB" );
89+ static const ammo_effect_str_id ammo_effect_PARALYZEPOISON ( " PARALYZEPOISON" );
90+ static const ammo_effect_str_id ammo_effect_ROBOT_DAZZLE ( " ROBOT_DAZZLE" );
91+ static const ammo_effect_str_id ammo_effect_TANGLE ( " TANGLE" );
92+ static const ammo_effect_str_id ammo_effect_IGNITE ( " IGNITE" );
93+ static const ammo_effect_str_id ammo_effect_INCENDIARY ( " INCENDIARY" );
9494
9595static const anatomy_id anatomy_human_anatomy ( " human_anatomy" );
9696
@@ -955,7 +955,7 @@ double Creature::accuracy_projectile_attack( dealt_projectile_attack &attack ) c
955955
956956void projectile::apply_effects_nodamage ( Creature &target, Creature *source ) const
957957{
958- if ( proj_effects.count ( ammo_effect_id_BOUNCE ) ) {
958+ if ( proj_effects.count ( ammo_effect_BOUNCE ) ) {
959959 target.add_effect ( effect_source ( source ), effect_bounced, 1_turns );
960960 }
961961}
@@ -964,7 +964,7 @@ void projectile::apply_effects_damage( Creature &target, Creature *source,
964964 const dealt_damage_instance &dealt_dam, bool critical ) const
965965{
966966 // Apply ammo effects to target.
967- if ( proj_effects.count ( ammo_effect_id_TANGLE ) ) {
967+ if ( proj_effects.count ( ammo_effect_TANGLE ) ) {
968968 // if its a tameable animal, its a good way to catch them if they are running away, like them ranchers do!
969969 // we assume immediate success, then certain monster types immediately break free in monster.cpp move_effects()
970970 if ( target.is_monster () ) {
@@ -987,7 +987,7 @@ void projectile::apply_effects_damage( Creature &target, Creature *source,
987987 }
988988
989989 Character &player_character = get_player_character ();
990- if ( proj_effects.count ( ammo_effect_id_INCENDIARY ) ) {
990+ if ( proj_effects.count ( ammo_effect_INCENDIARY ) ) {
991991 if ( x_in_y ( 1 , 100 ) ) { // 1% chance
992992 if ( target.made_of ( material_veggy ) || target.made_of_any ( Creature::cmat_flammable ) ) {
993993 target.add_effect ( effect_source ( source ), effect_onfire, rng ( 2_turns, 6_turns ),
@@ -1005,7 +1005,7 @@ void projectile::apply_effects_damage( Creature &target, Creature *source,
10051005 player_character.rem_morale ( MORALE_PYROMANIA_NOFIRE );
10061006 }
10071007 }
1008- } else if ( proj_effects.count ( ammo_effect_id_IGNITE ) ) {
1008+ } else if ( proj_effects.count ( ammo_effect_IGNITE ) ) {
10091009 if ( x_in_y ( 1 , 2 ) ) { // 50% chance
10101010 if ( target.made_of ( material_veggy ) || target.made_of_any ( Creature::cmat_flammable ) ) {
10111011 target.add_effect ( effect_source ( source ), effect_onfire, 10_turns, dealt_dam.bp_hit );
@@ -1023,7 +1023,7 @@ void projectile::apply_effects_damage( Creature &target, Creature *source,
10231023 }
10241024 }
10251025
1026- if ( proj_effects.count ( ammo_effect_id_ROBOT_DAZZLE ) ) {
1026+ if ( proj_effects.count ( ammo_effect_ROBOT_DAZZLE ) ) {
10271027 if ( critical && target.in_species ( species_ROBOT ) ) {
10281028 time_duration duration = rng ( 6_turns, 8_turns );
10291029 target.add_effect ( effect_source ( source ), effect_stunned, duration );
@@ -1036,31 +1036,31 @@ void projectile::apply_effects_damage( Creature &target, Creature *source,
10361036 }
10371037
10381038 if ( dealt_dam.bp_hit ->has_type ( body_part_type::type::head ) &&
1039- proj_effects.count ( ammo_effect_id_BLINDS_EYES ) ) {
1039+ proj_effects.count ( ammo_effect_BLINDS_EYES ) ) {
10401040 // TODO: Change this to require bp_eyes
10411041 target.add_env_effect ( effect_blind,
10421042 target.get_random_body_part_of_type ( body_part_type::type::sensor ), 5 , rng ( 3_turns, 10_turns ) );
10431043 }
10441044
1045- if ( proj_effects.count ( ammo_effect_id_APPLY_SAP ) ) {
1045+ if ( proj_effects.count ( ammo_effect_APPLY_SAP ) ) {
10461046 target.add_effect ( effect_source ( source ), effect_sap, 1_turns * dealt_dam.total_damage () );
10471047 }
1048- if ( proj_effects.count ( ammo_effect_id_PARALYZEPOISON ) && dealt_dam.total_damage () > 0 &&
1048+ if ( proj_effects.count ( ammo_effect_PARALYZEPOISON ) && dealt_dam.total_damage () > 0 &&
10491049 !dealt_dam.bp_hit ->has_flag ( json_flag_BIONIC_LIMB ) ) {
10501050 target.add_msg_if_player ( m_bad, _ ( " You feel poison coursing through your body!" ) );
10511051 target.add_effect ( effect_source ( source ), effect_paralyzepoison, 5_minutes );
10521052 }
10531053
1054- if ( proj_effects.count ( ammo_effect_id_FOAMCRETE ) && effect_foamcrete_slow.is_valid () ) {
1054+ if ( proj_effects.count ( ammo_effect_FOAMCRETE ) && effect_foamcrete_slow.is_valid () ) {
10551055 target.add_msg_if_player ( m_bad, _ ( " The foamcrete stiffens around you!" ) );
10561056 target.add_effect ( effect_source ( source ), effect_foamcrete_slow, 5_minutes );
10571057 }
10581058
10591059 int stun_strength = 0 ;
1060- if ( proj_effects.count ( ammo_effect_id_BEANBAG ) ) {
1060+ if ( proj_effects.count ( ammo_effect_BEANBAG ) ) {
10611061 stun_strength = 4 ;
10621062 }
1063- if ( proj_effects.count ( ammo_effect_id_LARGE_BEANBAG ) ) {
1063+ if ( proj_effects.count ( ammo_effect_LARGE_BEANBAG ) ) {
10641064 stun_strength = 16 ;
10651065 }
10661066 if ( stun_strength > 0 ) {
@@ -1104,7 +1104,7 @@ projectile_attack_results Creature::select_body_part_projectile_attack(
11041104 const projectile &proj, const double goodhit, const double missed_by ) const
11051105{
11061106 projectile_attack_results ret ( proj );
1107- const bool magic = proj.proj_effects .count ( ammo_effect_id_MAGIC ) > 0 ;
1107+ const bool magic = proj.proj_effects .count ( ammo_effect_MAGIC ) > 0 ;
11081108 double hit_value = missed_by + rng_float ( -0.5 , 0.5 );
11091109 if ( magic ) {
11101110 // Best possible hit
@@ -1230,7 +1230,7 @@ void Creature::messaging_projectile_attack( const Creature *source,
12301230void Creature::deal_projectile_attack ( Creature *source, dealt_projectile_attack &attack,
12311231 bool print_messages, const weakpoint_attack &wp_attack )
12321232{
1233- const bool magic = attack.proj .proj_effects .count ( ammo_effect_id_MAGIC ) > 0 ;
1233+ const bool magic = attack.proj .proj_effects .count ( ammo_effect_MAGIC ) > 0 ;
12341234 const double missed_by = attack.missed_by ;
12351235 if ( missed_by >= 1.0 && !magic ) {
12361236 // Total miss
@@ -1297,13 +1297,13 @@ void Creature::deal_projectile_attack( Creature *source, dealt_projectile_attack
12971297
12981298 // copy it, since we're mutating.
12991299 damage_instance impact = proj.impact ;
1300- if ( hit_selection.damage_mult > 0 .0f && proj_effects.count ( ammo_effect_id_NO_DAMAGE_SCALING ) ) {
1300+ if ( hit_selection.damage_mult > 0 .0f && proj_effects.count ( ammo_effect_NO_DAMAGE_SCALING ) ) {
13011301 hit_selection.damage_mult = 1 .0f ;
13021302 }
13031303
13041304 impact.mult_damage ( hit_selection.damage_mult );
13051305
1306- if ( proj_effects.count ( ammo_effect_id_NOGIB ) > 0 ) {
1306+ if ( proj_effects.count ( ammo_effect_NOGIB ) > 0 ) {
13071307 float dmg_ratio = static_cast <float >( impact.total_damage () ) / get_hp_max ( hit_selection.bp_hit );
13081308 if ( dmg_ratio > 1 .25f ) {
13091309 impact.mult_damage ( 1 .0f / dmg_ratio );
0 commit comments