Skip to content

OneStar mobs small changes #8550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 41 additions & 4 deletions code/modules/mob/living/carbon/superior_animal/stalker/stalker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

mob_size = MOB_MEDIUM

maxHealth = 100
health = 100
maxHealth = 200
health = 200

//spawn_values
rarity_value = 37.5
Expand Down Expand Up @@ -61,21 +61,29 @@
fire_verb = "fires"
acceptableTargetDistance = 6
kept_distance = 3

var/already_shooting = 0

/mob/living/carbon/superior_animal/stalker/Move()
..()
if(!isinspace())
playsound(src, 'sound/mechs/Mech_Step.ogg', 50, 1)

/mob/living/carbon/superior_animal/stalker/death()
. = ..()
visible_message("Critical components of \the [src] blow apart!")
new /obj/effect/decal/cleanable/blood/gibs/robot(loc)
do_sparks(3, TRUE, src)
playsound(src, 'sound/machines/triple_beep.ogg', 50, 1)

/mob/living/carbon/superior_animal/stalker/dual
name = "OneStar Stalker Mk2"
desc = "A ruthless patrol borg that defends OneStar facilities. This one is an upgraded version with a dual minigun, don\'t stand in front of it for too long."
icon_state = "stalker_mk2"
icon_living = "stalker_mk2"

maxHealth = 200
health = 200
maxHealth = 400
health = 400
rapid = 1

/mob/living/carbon/superior_animal/stalker/New()
Expand Down Expand Up @@ -108,3 +116,32 @@
qdel(src)
else
O.attack(src, user, user.targeted_organ)

///////////////////Shooting Sequence/////////////////////
/mob/living/carbon/superior_animal/stalker/OpenFire(target_mob)
if(already_shooting)
return
visible_message(SPAN_DANGER("<b>[src]</b> [fire_verb] at [target]!"), 1)

Check failure on line 124 in code/modules/mob/living/carbon/superior_animal/stalker/stalker.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "target"
already_shooting++
walk(src, 0)
var/i = rapid ? 20 : 5
while(i > 0)
i--
Shoot(get_turf(target_mob), loc, src)
if(casingtype)
new casingtype(get_turf(src))
sleep(1)
already_shooting--

stance = HOSTILE_STANCE_IDLE
target_mob = null
if(!rapid && src.stat != DEAD)
evasive_maneuvers()
return

/mob/living/carbon/superior_animal/stalker/proc/evasive_maneuvers()
var/turf/destination = pick(RANGE_TURFS(6, src))
walk_to(src, destination, 1, move_to_delay)
spawn(5 SECONDS)
Life()

135 changes: 26 additions & 109 deletions code/modules/mob/living/simple_animal/hostile/megafauna/onestarboss.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
/* DEAL notes:
If you want to figure out this shitcode and actually add this in for some reason, I will leave this here before I leave. If I won't finish it, here you go:

AttackingTarget() has nothing except OpenFire() cuz otherwise Mech would melee target_mob standing nearby, and I wanted to make a attack-pattern-based mob
Minigun Behaviors: 1 is one target, that means mech can't choose two targets and shoot in completely different directions with its 2 miniguns, trying to get both mobs.

Behavior one was supposed to be like closing scissors, coming together on a target, cutting (get it?) away ways to dodge with bullets.
Behavior two - shoot two completely different targets, locking on with precision.

Effects demand parent code, so ..()

*/
#define OS_BOSS_SHOTGUN 1
#define OS_BOSS_SNIPER 2
#define OS_BOSS_ROCKET 3
Expand All @@ -33,6 +22,7 @@ Effects demand parent code, so ..()
var/is_jittery = 0
var/jitteriness
var/doing_something = FALSE // mech should not multitask like I do
var/hologram_exists = FALSE
var/mobstospawn = list(
/mob/living/simple_animal/hostile/onestar_custodian/engineer,
/mob/living/simple_animal/hostile/onestar_custodian,
Expand All @@ -44,7 +34,7 @@ Effects demand parent code, so ..()
/mob/living/carbon/superior_animal/stalker/,
)
var/static/list/move_list = list(OS_BOSS_SHOTGUN, OS_BOSS_SNIPER, OS_BOSS_ROCKET, OS_BOSS_MINIGUN, OS_BOSS_SPAWN_BOTS) // Shotgun, sniper, rockets, you get the drill
var/action = OS_BOSS_SHOTGUN //action has to be some kind of default before it will be changed at the start of first attack
var/action = OS_BOSS_SHOTGUN

health = 1700
maxHealth = 1700
Expand All @@ -60,29 +50,6 @@ Effects demand parent code, so ..()

wander = FALSE //No more sleepwalking

/*/particles/mecha_smoke/
icon = 'icons/effects/smoke.dmi'
icon_state = list("smoke_1" = 1, "smoke_2" = 1, "smoke_3" = 2)
width = 100
height = 200
count = 1000
spawning = 3
lifespan = 1.5 SECONDS
fade = 1 SECONDS
velocity = list(0, 0.3, 0)
position = list(5, 32, 0)
drift = generator("sphere", 0, 1, NORMAL_RAND)
friction = 0.2
gravity = list(0, 0.95)
grow = 0.05

/mob/living/simple_animal/hostile/megafauna/one_star/Initialize()
//holder_left = new(src, /particles/mecha_smoke)
//holder_left.layer = layer+0.001
var/particles/mecha_smoke/smok = new /particles/mecha_smoke(src)
. = ..()
!!!!!!!!!!!!!!FUCKING PAIN IN THE ASS!!!!!!!!!!!!!!!!! WILL SURELY DO LATER - Deal
*/
/mob/living/simple_animal/hostile/megafauna/one_star/Move()
..()
if(!isinspace())
Expand All @@ -92,7 +59,7 @@ Effects demand parent code, so ..()

if(ismob(target))
var/kick_dir = get_dir(src, target)
UnarmedAttack(target, rand(50,100)) // DEAL LOOK
UnarmedAttack(target, rand(50,100))
target.throw_at(get_edge_target_turf(target, kick_dir), 3, 1)

/mob/living/simple_animal/hostile/megafauna/one_star/UnarmedAttack(atom/A, proximity)
Expand Down Expand Up @@ -124,8 +91,6 @@ Effects demand parent code, so ..()
/obj/effect/effect/minigun_aim
icon = 'icons/effects/alerts.dmi'
icon_state = "spin"
//flick("stupid_circle.dmi", src)
//mouse_opacity = 0
anchored = TRUE
alpha = 200
layer = FLY_LAYER
Expand All @@ -136,7 +101,6 @@ Effects demand parent code, so ..()
flick("wind_up", src)

/obj/effect/effect/minigun_aim/proc/StayOn(mob/living/target)
loc = target.loc
var/prev_position = get_turf(target)
var/timer = 50
var/walk_direction
Expand All @@ -157,7 +121,7 @@ Effects demand parent code, so ..()
return
var/turf/startloc = get_turf(src)
var/obj/item/projectile/P = new /obj/item/projectile/bullet/rocket/one_star(startloc)
playsound(src, 'sound/effects/bang.ogg', 100, 1) // this is a fucking tile fall sound
playsound(src, 'sound/effects/bang.ogg', 100, 1)
P.firer = src
if(target)
P.original = target
Expand Down Expand Up @@ -201,8 +165,6 @@ Effects demand parent code, so ..()
/obj/effect/effect/mech_aiming/New()
..()
icon = 'icons/effects/alerts64x64.dmi'
//icon_state = "aiming_flick"
//flick("mech_aiming", src)
icon_state = "aiming_flick"
flick("mech_aiming", src)

Expand All @@ -222,8 +184,6 @@ Effects demand parent code, so ..()
organ_rel_size[BP_R_LEG]; BP_R_LEG,
)

//if(QDELETED(target))
// return
set_dir(get_dir(src, target))
var/obj/item/projectile/P = new /obj/item/projectile/beam/sniper(loc)
P.launch(target, def_zone)
Expand All @@ -232,14 +192,11 @@ Effects demand parent code, so ..()
/obj/effect/effect/crosshair
icon = 'icons/effects/alerts.dmi'
icon_state = "aiming_crosshair"
//var/atom/target = null
anchored = 1
alpha = 200
layer = 5
unacidable = 1

///obj/effect/effect/crosshair/New(var/mob/living/M)

/obj/effect/effect/crosshair/proc/StayOn(mob/living/M)
loc = M.loc
anchored = TRUE
Expand All @@ -266,13 +223,11 @@ Effects demand parent code, so ..()
organ_rel_size[BP_R_LEG]; BP_R_LEG,
)

//if(QDELETED(target))
// return
set_dir(get_dir(src, target))
set_dir(get_dir(src, get_cardinal_dir(src, target)))
var/pellets = 2
for(pellets, pellets > 0, pellets--)
var/obj/item/projectile/P = new /obj/item/projectile/bullet/pellet/shotgun(loc)
P.launch(target, def_zone)
P.launch(get_step(src, src.dir), def_zone)
playsound(src, "sound/weapons/guns/fire/shotgunp_fire.ogg", 100, 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
P.launch(get_step(src, src.dir), def_zone)
P.launch(get_step(src, dir))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wont it make mob shoot at cardinal directions instead of target_mob?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bro, what? Shooting in a cardinal direction instead of a specific mob is your change - I'm just saying that change you've made could be written better.
def_zone is always null, you never specify it, and src. is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh crap I thought that was a rocket launch for some reason. Err... Sorry for misunderstanding.



Expand All @@ -281,13 +236,15 @@ Effects demand parent code, so ..()
icon = 'icons/effects/alerts.dmi'
icon_state = "telegraph"
flick("telegraph_flick", src)
spawn(100) qdel(src)
spawn(10 SECONDS)
qdel(src)

/obj/effect/effect/telegraph/Crossed(mob/living/simple_animal/hostile/megafauna/one_star/boss)
if(istype(boss) && boss.target_mob)
boss.shoot_shotgun(boss.target_mob)
boss.doing_something = FALSE
boss.move_lock = FALSE
boss.hologram_exists = FALSE
qdel(src)


Expand Down Expand Up @@ -352,16 +309,16 @@ Effects demand parent code, so ..()
stop_automated_movement = 1
walk(src, 0)
LoseTarget()
stance = initial(stance) // he is standing
stance = initial(stance)
icon_state = initial(icon_state)
make_jittery(500)
target_mob = null
playsound(src, "sound/machines/onestar/boss/Boss_Death.ogg", 100) // "YOU THINK YOU CAN KILL ME?"
playsound(src, "sound/machines/onestar/boss/Boss_Death.ogg", 100)
spawn(60) dying()

/mob/living/simple_animal/hostile/megafauna/one_star/proc/dying() // part 2
icon_state = icon_dead // he falls with epic sounds
playsound(src, "sound/effects/Explosion1.ogg", 100, 1) // OHHH FUCK YOU CAN *dead*
/mob/living/simple_animal/hostile/megafauna/one_star/proc/dying()
icon_state = icon_dead
playsound(src, "sound/effects/Explosion1.ogg", 100, 1)
explosion(src, 350, 75, 0)
stasis = TRUE
layer = LYING_MOB_LAYER
Expand All @@ -375,31 +332,7 @@ Effects demand parent code, so ..()
stance = HOSTILE_STANCE_IDLE
if(target_mob in ListTargets(10))
OpenFire(target_mob)
// Is this just a complicated fucking D6 throw? All this to get a mob to fucking shoot.
// if(get_dist(src, target_mob) <= 6)
// OpenFire(target_mob)
// else
// set_glide_size(DELAY2GLIDESIZE(move_to_delay))
// walk_to(src, target_mob, 1, move_to_delay)
// if(ranged)
// if(prob(rand(15,25)))
// stance = HOSTILE_STANCE_ATTACKING
// set_glide_size(DELAY2GLIDESIZE(move_to_delay))
// walk_to(src, target_mob, 1, move_to_delay)
// else
// OpenFire(target_mob)
// else
// if(prob(45))
// stance = HOSTILE_STANCE_ATTACKING
// set_glide_size(DELAY2GLIDESIZE(move_to_delay))
// walk_to(src, target_mob, 1, move_to_delay)
// else
// OpenFire(target_mob)
// else
// stance = HOSTILE_STANCE_ATTACKING
// set_glide_size(DELAY2GLIDESIZE(move_to_delay))
// walk_to(src, target_mob, 1, move_to_delay)
// return 0


/mob/living/simple_animal/hostile/megafauna/one_star/LoseTarget()
..()
Expand All @@ -425,20 +358,6 @@ Effects demand parent code, so ..()

/mob/living/simple_animal/hostile/megafauna/one_star/AttackingTarget() // overwriting the thing because mech loves to bite people like roaches do. Erased for the pattern-based combat.
OpenFire()
// if(!Adjacent(target_mob))
// return
//if(isliving(target_mob))
// var/mob/living/L = target_mob
// L.attack_generic(src,rand(melee_damage_lower,melee_damage_upper),attacktext)
// return L
//if(istype(target_mob, /mob/living/exosuit))
// var/mob/living/exosuit/M = target_mob
// M.attack_generic(src,rand(melee_damage_lower,melee_damage_upper),attacktext)
// return M
// if(istype(target_mob,/obj/machinery/bot))
// var/obj/machinery/bot/B = target_mob
// B.attack_generic(src,rand(melee_damage_lower,melee_damage_upper),attacktext)
// return B

/mob/living/simple_animal/hostile/megafauna/one_star/OpenFire()
if(!doing_something)
Expand All @@ -447,16 +366,19 @@ Effects demand parent code, so ..()
action = pick(move_list)
switch(action)
if(OS_BOSS_SHOTGUN)
var/obj/effect/effect/telegraph/F = new /obj/effect/effect/telegraph(target_mob.loc)
var/obj/effect/effect/telegraph/F
if(hologram_exists == FALSE)
F = new /obj/effect/effect/telegraph(target_mob.loc)
hologram_exists = TRUE
spawn(10 SECONDS)
hologram_exists = FALSE
move_lock = TRUE
for(F in orange(src, 30))
if(F in orange(1, src)) // this is fucking stupid, but if you remove this and stand on the hologram it will not be able to kick you for some reason, see Bump()
for(var/mob/living/targ in orange(1, src))
if(F.loc == targ.loc)
qdel(F)
//targ.gib() // I havent come for a better solution due to laziness and inability to fix.
targ.Weaken(3)
//playsound(targ.loc, 'sound/mechs/obliteration.ogg', 100) DEAL LOOK
var/kick_dir = get_dir(src, targ)
UnarmedAttack(targ, rand(50,100))
targ.throw_at(get_edge_target_turf(targ, kick_dir), 3, 1)
Expand All @@ -478,12 +400,6 @@ Effects demand parent code, so ..()
shoot_sniper(target_mob)
qdel(C)
doing_something = FALSE
//var/obj/effect/effect/crosshair/C = new /obj/effect/effect/crosshair(target_mob.loc)
//C.target = target_mob
//C.StayOn(target_mob)
//for(C in orange(src, 30))
// spawn(20) shoot_sniper()
//insert sniper roifle sound here boy
if(OS_BOSS_ROCKET)
doing_something = TRUE
var/obj/effect/effect/mech_aiming/S = new /obj/effect/effect/mech_aiming(target_mob.loc)
Expand Down Expand Up @@ -541,13 +457,13 @@ Effects demand parent code, so ..()
step(B, SOUTH)
step(A, NORTH)
step(B, SOUTH)
spawn(80 MILLISECONDS)
spawn(6 SECONDS)
step_towards(A, target_location)
step_towards(B, target_location)
spawn(120 MILLISECONDS)
spawn(10 SECONDS)
step_towards(A, target_location)
step_towards(B, target_location)
spawn(160 MILLISECONDS)
spawn(1400 MILLISECONDS)
step_towards(A, target_location)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
spawn(1400 MILLISECONDS)
spawn(14 SECONDS)

step_towards(B, target_location)
var/i = 15
Expand All @@ -557,7 +473,7 @@ Effects demand parent code, so ..()
i--
shoot_minigun(A)
shoot_minigun(B)
sleep(500 MILLISECONDS)
sleep(100 MILLISECONDS)
qdel(A)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sleep(100 MILLISECONDS)
sleep(1 SECOND)

qdel(B)
doing_something = FALSE
Expand Down Expand Up @@ -600,6 +516,7 @@ Effects demand parent code, so ..()
sparks.set_up(3, 0, get_turf(newmob.loc))
sparks.start()
mobs_to_spawn--
playsound(src.loc, 'sound/effects/EMPulse.ogg', 50, 1)
if(!move_lock && stat != DEAD) // I fucking hate what I am doing with this code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
playsound(src.loc, 'sound/effects/EMPulse.ogg', 50, 1)
playsound(loc, 'sound/effects/EMPulse.ogg', 50, 1)

target_mob = FindTarget()

Loading
Loading