diff --git a/code/datums/stat_modifiers/modifiers/mob/superior/ranged/ranged_modifiers.dm b/code/datums/stat_modifiers/modifiers/mob/superior/ranged/ranged_modifiers.dm index 37c63363d0a..f75ab8ba9fd 100644 --- a/code/datums/stat_modifiers/modifiers/mob/superior/ranged/ranged_modifiers.dm +++ b/code/datums/stat_modifiers/modifiers/mob/superior/ranged/ranged_modifiers.dm @@ -11,9 +11,10 @@ prefix = "Deadeye" - description = "This one seems to be very accurate and precise with its shots. It'll likely shoot slower, but with more precision, giving it extra damage and AP." + description = "This one seems to be very accurate and precise with its shots. It'll likely shoot slower, but with more precision, giving it extra damage and AP as well as alining its aim to be for headshots, and arms!." stattags = RANGED_STATTAG + zone_hit_rates_setter = list(BP_HEAD = 30, BP_CHEST = 10, BP_GROIN = 10, BP_R_ARM = 50, BP_L_ARM = 50, BP_R_LEG = 20, BP_L_LEG = 20) /datum/stat_modifier/mob/living/carbon/superior_animal/slowaimed @@ -43,6 +44,8 @@ description = "This one seems overeager to shoot. It's likely they'll fire more often than others, although with less precision, thus less armor penetration and damage." stattags = RANGED_STATTAG + zone_hit_rates_setter = list(BP_HEAD = 5, BP_CHEST = 80, BP_GROIN = 60, BP_R_ARM = 10, BP_L_ARM = 10, BP_R_LEG = 30, BP_L_LEG = 30) + /datum/stat_modifier/mob/living/carbon/superior_animal/quickdraw @@ -53,6 +56,9 @@ description = "This one seems vigilant, especially when it comes to keeping whatever they use as a weapon at the ready. It's likely they'll react faster than others." stattags = RANGED_STATTAG + zone_hit_rates_setter = list(BP_HEAD = 25, BP_CHEST = 25, BP_GROIN = 25, BP_R_ARM = 60, BP_L_ARM = 60, BP_R_LEG = 15, BP_L_LEG = 15) + + /datum/stat_modifier/mob/living/carbon/superior_animal/slowdraw @@ -63,3 +69,12 @@ description = "This one seems to take a bit longer to fire than others." stattags = RANGED_STATTAG + +/datum/stat_modifier/mob/living/carbon/superior_animal/headhunter + prefix = "Head Hunter" + + description = "This one is trainned to aim for targets heads rather then center of mass." + + stattags = RANGED_STATTAG + zone_hit_rates_setter = list(BP_HEAD = 55, BP_CHEST = 35, BP_GROIN = 35, BP_R_ARM = 15, BP_L_ARM = 15, BP_R_LEG = 5, BP_L_LEG = 5) + diff --git a/code/datums/stat_modifiers/stat_modifier.dm b/code/datums/stat_modifiers/stat_modifier.dm index 544682ed727..ed4bc7c9e7b 100644 --- a/code/datums/stat_modifiers/stat_modifier.dm +++ b/code/datums/stat_modifiers/stat_modifier.dm @@ -55,6 +55,9 @@ /// Any modifier typepaths in this will have their prob on our holder set to 0 if we're added, and their original prob stored as the value of the typepath, for use in remove(). var/list/mutually_exclusive_with = list() + var/list/zone_hit_rates_setter = null + + //todo: store the vars we change for more accurate removal /// Inverts all effects the modifier provided, and optionally qdeletes it. Needs to have effects manually added. @@ -98,6 +101,14 @@ holder = null //we no longer have a holder + if(zone_hit_rates_setter) + if(istype(holder, /mob/living/simple_animal/hostile)) + var/mob/living/simple_animal/hostile/H = holder + H.zone_hit_rates = initial(H.zone_hit_rates) + if(issuperioranimal(holder)) + var/mob/living/carbon/superior_animal/SA + SA.zone_hit_rates = initial(SA.zone_hit_rates) + if (qdel_src) qdel(src) @@ -179,6 +190,16 @@ LAZYADD(target.name_prefixes, prefix) // if so, lets add ours to their prefix list... target.update_prefixes() // ...and regenerate their prefixes + if(zone_hit_rates_setter) + if(istype(holder, /mob/living/simple_animal/hostile)) + var/mob/living/simple_animal/hostile/H = target + H.zone_hit_rates = zone_hit_rates_setter + if(issuperioranimal(holder)) + var/mob/living/carbon/superior_animal/SA = target + SA.zone_hit_rates = zone_hit_rates_setter + + + return TRUE /datum/stat_modifier/proc/consider_custom_effect(atom/movable/target, list/arguments, arguments_to_pass, status) diff --git a/code/modules/mob/living/carbon/superior_animal/attack.dm b/code/modules/mob/living/carbon/superior_animal/attack.dm index f56dc3c2e34..bcb00113cfd 100755 --- a/code/modules/mob/living/carbon/superior_animal/attack.dm +++ b/code/modules/mob/living/carbon/superior_animal/attack.dm @@ -132,7 +132,9 @@ if(!A) return - var/def_zone = get_exposed_defense_zone(target) + var/def_zone = pickweight(zone_hit_rates) + + //message_admins("pre-fire def_zone = [def_zone]") var/datum/penetration_holder/trace_penetration @@ -177,6 +179,7 @@ A.original_firer = src if(friendly_to_colony) A.friendly_to_colony = TRUE + A.predetermed = def_zone A.launch(target, def_zone, firer_arg = src, angle_offset = offset_temp) //this is where we actually shoot the projectile right_after_firing() SEND_SIGNAL(src, COMSIG_SUPERIOR_FIRED_PROJECTILE, A) diff --git a/code/modules/mob/living/carbon/superior_animal/robots/subtype/greyson/types/turrets.dm b/code/modules/mob/living/carbon/superior_animal/robots/subtype/greyson/types/turrets.dm index bbb019f8ffe..19fd9771a34 100644 --- a/code/modules/mob/living/carbon/superior_animal/robots/subtype/greyson/types/turrets.dm +++ b/code/modules/mob/living/carbon/superior_animal/robots/subtype/greyson/types/turrets.dm @@ -50,6 +50,7 @@ /datum/stat_modifier/mob/living/carbon/superior_animal/slowaimed = 5, /datum/stat_modifier/mob/living/carbon/superior_animal/triggerfinger/robotic = 5, /datum/stat_modifier/mob/living/carbon/superior_animal/quickdraw = 5, + /datum/stat_modifier/mob/living/carbon/superior_animal/headhunter = 1 ) contaminant_immunity = TRUE diff --git a/code/modules/mob/living/carbon/superior_animal/superior_defines.dm b/code/modules/mob/living/carbon/superior_animal/superior_defines.dm index a9f82aacd31..0f1b9c98244 100644 --- a/code/modules/mob/living/carbon/superior_animal/superior_defines.dm +++ b/code/modules/mob/living/carbon/superior_animal/superior_defines.dm @@ -313,3 +313,6 @@ /// Used to dictate if the critter is poisonous or not var/poison_per_bite = 0 var/poison_type + + var/list/zone_hit_rates = list(BP_HEAD = 10, BP_CHEST = 50, BP_GROIN = 35, BP_R_ARM = 30, BP_L_ARM = 30, BP_R_LEG = 20, BP_L_LEG = 20) + diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 398506ba9a4..9fc3e089b55 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -37,6 +37,8 @@ var/list/mydirs = list(NORTH, SOUTH, EAST, WEST, SOUTHWEST, NORTHWEST, NORTHEAST var/poison_per_bite = 0 //To handle poisonous bigguns var/poison_type + var/list/zone_hit_rates = list(BP_HEAD = 10, BP_CHEST = 50, BP_GROIN = 35, BP_R_ARM = 30, BP_L_ARM = 30, BP_R_LEG = 20, BP_L_LEG = 20) + /mob/living/simple_animal/hostile/Destroy() target_mob = null @@ -301,8 +303,9 @@ var/list/mydirs = list(NORTH, SOUTH, EAST, WEST, SOUTHWEST, NORTHWEST, NORTHEAST var/obj/item/projectile/A = new projectiletype(src.loc) playsound(user, projectilesound, 100, 1) if(!A) return - var/def_zone = get_exposed_defense_zone(target) + var/def_zone = pickweight(zone_hit_rates) A.original_firer = src + A.predetermed = def_zone A.launch(target, def_zone) /mob/living/simple_animal/hostile/MiddleClickOn(mob/targetDD as mob) //Letting Mobs Fire when middle clicking as someone controlling it. diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 6c76fe54edf..0999c61915c 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -128,6 +128,8 @@ var/wounding_mult = 1 // A multiplier on damage inflicted to and damage blocked by mobs var/ignition_source = TRUE //Used for deciding if a projectile should blow up a benzin. + var/predetermed = null //Used for NPCs to sudo rng, uses define zones directly + /obj/item/projectile/New() @@ -391,7 +393,6 @@ //roll to-hit miss_modifier = 0 var/hit_zone = check_zone(def_zone) - var/result = PROJECTILE_FORCE_MISS if(hit_zone) def_zone = hit_zone //set def_zone, so if the projectile ends up hitting someone else later (to be implemented), it is more likely to hit the same part @@ -715,12 +716,12 @@ if(istargetloc(target_mob) == 0) def_zone = pick(BP_R_ARM, BP_L_ARM, BP_CHEST, BP_HEAD) //head - - + //message_admins("predetermed = [predetermed] def_zone = [def_zone]") + if(predetermed) + def_zone = predetermed result = target_mob.bullet_act(src, def_zone)//this returns mob's armor_check and another - see modules/mob/living/living_defense.dm - if(result == PROJECTILE_FORCE_MISS) if (!testing) //doesnt matter, we collided with something, NIKO COME BACK HERE AND REVIEW THIS if(!silenced)