diff --git a/code/datums/components/fullauto.dm b/code/datums/components/fullauto.dm index d5c479bd945..0c2c1a20a8f 100644 --- a/code/datums/components/fullauto.dm +++ b/code/datums/components/fullauto.dm @@ -262,7 +262,7 @@ current_windup_reduction = (current_windup_reduction + round(autofire_shot_delay * windup_autofire_reduction_multiplier)) timerid = addtimer(CALLBACK(src, PROC_REF(windup_reset), FALSE), windup_spindown, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_STOPPABLE) - if(shooter.next_move_modifier) //DNA vault, mephemdrone, bluespace slowness debuff. + if(shooter.next_move_modifier != 1) //DNA vault, mephemdrone, bluespace slowness debuff. next_delay = round(next_delay * shooter.next_move_modifier, SSprojectiles.wait) COOLDOWN_START(src, next_shot_cd, next_delay) diff --git a/code/modules/mob/living/carbon/human/human_mob.dm b/code/modules/mob/living/carbon/human/human_mob.dm index 0f6756ce712..3ff6f740e69 100644 --- a/code/modules/mob/living/carbon/human/human_mob.dm +++ b/code/modules/mob/living/carbon/human/human_mob.dm @@ -73,10 +73,73 @@ GLOB.human_list -= src UnregisterSignal(src, COMSIG_BODY_TRANSFER_TO) +/datum/hit_feedback + var/timeof + var/damage + var/damage_type + var/projectile_type + var/target_zone + +/datum/hit_feedback/New(timeof, damage, damage_type, projectile_type, target_zone) + src.timeof = timeof + src.damage = damage + src.damage_type = damage_type + src.projectile_type = projectile_type + src.target_zone = target_zone + /mob/living/carbon/human/dummy real_name = "Test Dummy" status_flags = GODMODE|CANPUSH + var/list/hits = list() + var/first_hit = 0 + var/last_hit = 0 + var/timer_id = TIMER_ID_NULL +/mob/living/carbon/human/dummy/bullet_act(obj/item/projectile/P, def_zone) + if(!first_hit) + first_hit = world.time + visible_message("Started tracking hit at time [first_hit]!") + last_hit = world.time + var/datum/hit_feedback/packet = new(last_hit, P.damage, P.damage_type, P.type, def_zone) + hits.Add(packet) + timer_id = addtimer(CALLBACK(src, PROC_REF(check_done)), 3 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_STOPPABLE) + visible_message("Hit [length(hits)]: [P.damage] dmg from [P.type] at time [last_hit]") + return ..() + +/mob/living/carbon/human/dummy/proc/check_done() + if(!first_hit) + return + var/delta_now = world.time - last_hit + // Tracking window is still open + if(delta_now < 3 SECONDS) + return + // Stop counting, print, and reset + if(timer_id != TIMER_ID_NULL) + deltimer(timer_id) + timer_id = TIMER_ID_NULL + print_summary() + first_hit = 0 + last_hit = 0 + hits.Cut() + +/mob/living/carbon/human/dummy/proc/print_summary() + if(!length(hits) || !first_hit || !last_hit) + CRASH("Tried to print a summary with no hits/first_hit/last_hit: [hits], [first_hit], [last_hit]") + var/N = length(hits) + var/delta = 1 + if(length(hits) > 1) + delta = (last_hit - first_hit)/10 // deciseconds -> seconds + var/hits_per_sec = N/delta + var/total_damage = 0 + for(var/hit in hits) + var/datum/hit_feedback/h = hit + total_damage += h.damage + var/damage_per_sec = total_damage/delta + log_debug("############# Starting hit report #############") + log_debug("Counted [N] hits in [delta] sec, start/stop time = [first_hit] - [last_hit] dsec") + log_debug("Fire rate = [hits_per_sec] hits/sec") + log_debug("Total damage = [total_damage], DPS = [damage_per_sec]") + log_debug("############### End hit report ################") /mob/living/carbon/human/skrell/Initialize(mapload) . = ..(mapload, /datum/species/skrell) diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm index 4c581ade808..3387a122912 100644 --- a/code/modules/projectiles/guns/energy/stun.dm +++ b/code/modules/projectiles/guns/energy/stun.dm @@ -145,7 +145,7 @@ /obj/item/gun/energy/disabler/smg/Initialize(mapload) . = ..() - AddComponent(/datum/component/automatic_fire, 0.15 SECONDS, allow_akimbo = FALSE) + AddComponent(/datum/component/automatic_fire, 0.20 SECONDS, allow_akimbo = FALSE) /obj/item/gun/energy/disabler/cyborg name = "cyborg disabler" diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index e2d84256a7e..4685fdded2d 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -387,7 +387,7 @@ /obj/item/gun/projectile/automatic/lasercarbine/Initialize(mapload) . = ..() - AddComponent(/datum/component/automatic_fire, 0.15 SECONDS, allow_akimbo = FALSE) + AddComponent(/datum/component/automatic_fire, 0.30 SECONDS, allow_akimbo = FALSE) /obj/item/gun/projectile/automatic/lasercarbine/update_icon_state() icon_state = "lasercarbine[magazine ? "-[CEILING(get_ammo(0)/5, 1)*5]" : ""]"