Skip to content

Commit

Permalink
Ballistic sentrybot but fixed sound (#2470)
Browse files Browse the repository at this point in the history
* coolio particles

* nice

* Mild sound refactor, experimental ballistic bot, sounds

* atomize particles out

* atomize 2

* atomize 3

* fix
  • Loading branch information
ma44 authored Nov 1, 2023
1 parent 6b00093 commit 51b56d5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions mojave/code/modules/mob/living/simple_animal/hostile/sentrybot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,22 @@ GLOBAL_LIST_INIT(sentrybot_dying_sound, list(
FindTarget(possible_targets = null, HasTargetsList = FALSE)
if(actually_fire)
. = ..()
playsound(src, 'mojave/sound/ms13npc/sentrybot/laser_gatling.ogg', 50, FALSE)
gunfire_sound()
addtimer(CALLBACK(src, .proc/wind_down_gun), 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/ms13npc/sentrybot/gatling_windup.ogg', 75, FALSE)
spinup_sound()
already_firing = TRUE
return

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

/mob/living/simple_animal/hostile/ms13/robot/sentrybot/proc/spinup_sound()
playsound(src, 'mojave/sound/ms13npc/sentrybot/gatling_windup.ogg', 75, FALSE)

//Don't bother kiting if we lose sight of the target, we gotta rush them
/mob/living/simple_animal/hostile/ms13/robot/sentrybot/proc/checkLoS()
if(!can_see(src, target, length = 10))
Expand Down Expand Up @@ -491,8 +497,8 @@ GLOBAL_LIST_INIT(sentrybot_dying_sound, list(
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 @@ -503,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 @@ -534,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
Binary file not shown.
Binary file not shown.

0 comments on commit 51b56d5

Please sign in to comment.