Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ma44 committed Oct 29, 2023
1 parent afd9f4c commit 59e1635
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 60 deletions.
2 changes: 1 addition & 1 deletion code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -697,4 +697,4 @@
return

#undef FIRING_PIN_REMOVAL_DELAY
#undef DUALWIELD_PENALTY_EXTRA_MULTIPLIER
#undef DUALWIELD_PENALTY_EXTRA_MULTIPLIER
77 changes: 18 additions & 59 deletions mojave/code/modules/mob/living/simple_animal/hostile/sentrybot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -493,49 +493,12 @@ GLOBAL_LIST_INIT(sentrybot_dying_sound, list(
P.preparePixelProjectile(target_turf, owner)
P.fire()

//All hail the ballistic sentrybot, now with smoke particles and ejected casings!
/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic
casingtype = /obj/item/ammo_casing/ms13/a308/sentrybot

//Wind down is combined with windup sound
/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic/wind_down_gun()
already_firing = FALSE

/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic/gunfire_sound()
playsound(src, 'mojave/sound/ms13npc/sentrybot/ballistic_minigun_fire.ogg', 50, FALSE)

/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic/spinup_sound()
playsound(src, 'mojave/sound/ms13npc/sentrybot/ballistic_minigun_spinup_down.ogg', 50, FALSE)


//randomspread prerequisite
/obj/item/ammo_casing/ms13/a308/sentrybot
projectile_type = /obj/projectile/bullet/ms13/a308/sentrybot
variance = 30
pellets = 1
fire_sound = 'mojave/sound/ms13weapons/gunsounds/sniper/sniper1.ogg'
randomspread = TRUE

/obj/projectile/bullet/ms13/a308/sentrybot
damage = 8
subtractible_armour_penetration = 35
wound_bonus = 18
bare_wound_bonus = 10

/obj/item/ammo_casing/ms13/a308/sentrybot/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread, atom/fired_from, extra_damage, extra_penetration)
. = ..()
pixel_z = 8 //bounce time
var/rand_spin = (rand(1, 3) * 10 ) //* SECONDS
SpinAnimation(speed = rand_spin, loops = 1)
var/angle_of_movement = !isnull(user) ? (rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180)) : rand(-3000, 3000) / 100
AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(450, 550) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = 9.80665, _z_floor = 0, _angle_of_movement = angle_of_movement)

/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic
icon_state = "ballisentry"
casingtype = /obj/item/ammo_casing/ms13/sentry
ranged_cooldown = 5 SECONDS
rapid = 50
rapid_fire_delay = 0.025 SECONDS //50 shots over 1.25 seconds
rapid = 40
rapid_fire_delay = 0.025 SECONDS //40 shots over 1 seconds

/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic/Initialize()
. = ..()
Expand All @@ -546,28 +509,16 @@ GLOBAL_LIST_INIT(sentrybot_dying_sound, list(
RegisterSignal(src, COMSIG_MOVABLE_MOVED, .proc/play_move_sound, override = TRUE)
soundloop = new(src, FALSE)

/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic/OpenFire(atom/A, actually_fire = FALSE)
//Main gun time
//If we don't have LoS on our target, we should see if there's any other targets we could be killing
//Otherwise, we'll go chase the target by setting a lowered minimum distance
if(!can_see(src, target, length = 10))
FindTarget(possible_targets = null, HasTargetsList = FALSE)
if(actually_fire)
. = ..()
playsound(src, 'mojave/sound/ms13weapons/WPN_Minigun_Fire.ogg', 50, FALSE)
addtimer(CALLBACK(src, .proc/wind_down_minigun), 1 SECONDS)
else
if(!already_firing)
addtimer(CALLBACK(src, .proc/trigger_abilities, A), rand(1.5 SECONDS, 3 SECONDS))
addtimer(CALLBACK(src, .proc/OpenFire, A, TRUE), 1 SECONDS)
playsound(src, 'mojave/sound/ms13weapons/WPN_Minigun_FireSpin_Up.wav', 75, FALSE)
already_firing = TRUE
return

/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic/proc/wind_down_minigun()
playsound(src, 'mojave/sound/ms13weapons/WPN_Minigun_FireSpin_Down.wav', 50, FALSE)
//Wind down is combined with windup sound
/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic/wind_down_gun()
already_firing = FALSE

/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic/gunfire_sound()
playsound(src, 'mojave/sound/ms13npc/sentrybot/ballistic_minigun_fire.ogg', 50, FALSE)

/mob/living/simple_animal/hostile/ms13/robot/sentrybot/ballistic/spinup_sound()
playsound(src, 'mojave/sound/ms13npc/sentrybot/ballistic_minigun_spinup_down.ogg', 50, FALSE)

/obj/item/ammo_casing/ms13/sentry
name = "5mm bullet casing"
projectile_type = /obj/projectile/bullet/ms13/sentry
Expand All @@ -577,6 +528,14 @@ GLOBAL_LIST_INIT(sentrybot_dying_sound, list(
fire_sound = 'mojave/sound/ms13weapons/arfire.ogg'
randomspread = TRUE

/obj/item/ammo_casing/ms13/sentry/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread, atom/fired_from, extra_damage, extra_penetration)
. = ..()
pixel_z = 8 //bounce time
var/rand_spin = (rand(1, 3) * 10 ) //* SECONDS
SpinAnimation(speed = rand_spin, loops = 1)
var/angle_of_movement = !isnull(user) ? (rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180)) : rand(-3000, 3000) / 100
AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(450, 550) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = 9.80665, _z_floor = 0, _angle_of_movement = angle_of_movement)

/obj/projectile/bullet/ms13/sentry
name = "5mm bullet"
icon_state = "medium_bullet"
Expand Down

0 comments on commit 59e1635

Please sign in to comment.