Skip to content

Commit

Permalink
can man nerf/rework part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
BurgerLUA committed Oct 12, 2024
1 parent 8d7e6a0 commit 8c49534
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 113 deletions.
4 changes: 0 additions & 4 deletions code/_core/datum/ai/boss/bubblegum.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/ai/boss/bubblegum/

var/mob/living/simple/bubblegum/owner_as_bubblegum


night_vision = 0

/ai/boss/bubblegum/New(var/desired_loc,var/mob/living/desired_owner)
owner_as_bubblegum = desired_owner
return ..()
Expand Down
141 changes: 107 additions & 34 deletions code/_core/datum/ai/boss/can_man.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,55 @@
distance_target_max = VIEW_RANGE*1.5

var/mob/living/simple/can_man/owner_as_can_man
var/next_minigun_sweep = 0
var/strafe_count = 0
var/strafe_latch = -1 //-1 or 1

//0 = normal
//1 = revving up
//2 = shooting
//3 = revving down
var/minigun_state = 0
var/strafe_latch = 0

/ai/boss/can_man/handle_attacking()

if(minigun_state > 0)
if(objective_attack && minigun_state == 2)
owner_as_can_man.shoot_minigun(objective_attack)
return TRUE
return TRUE

if(objective_attack && get_dist(owner,objective_attack) > 4 && prob(10))
rev_minigun()
return TRUE

. = ..()


/ai/boss/can_man/handle_movement()

//Minigun attack.
if(owner_as_can_man && owner_as_can_man.health && minigun_state != 0)
var/health_percent = owner_as_can_man.health.health_current / owner_as_can_man.health.health_max
if(health_percent >= 0.5 || minigun_state != 2)
//Hold still.
owner.move_dir = 0x0
last_movement_proc = "canman_minigun"
return TRUE
if(health_percent >= 0.25)
//Stafe
if(!strafe_latch)
strafe_latch = pick(-90,90)
var/desired_dir = get_dir(owner,objective_attack)
desired_dir = turn(desired_dir,strafe_latch)
owner.move_dir = 0x0
last_movement_proc = "canman_minigun"
return TRUE
//Free movement otherwise.

. = ..()

if(owner.move_dir)
owner.move_dir = get_true_4dir(owner.move_dir)


/ai/boss/can_man/New(var/desired_loc,var/mob/living/desired_owner)
owner_as_can_man = desired_owner
Expand All @@ -24,42 +70,69 @@
owner_as_can_man = null
return ..()

/ai/boss/can_man/proc/rev_minigun()

/ai/boss/can_man/set_objective(var/atom/A)
var/had_previous_objective = objective_attack
. = ..()
if(. && objective_attack && !had_previous_objective)
next_minigun_sweep = max(next_minigun_sweep,world.time + SECONDS_TO_DECISECONDS(30))
if(minigun_state != 0)
return

/ai/boss/can_man/handle_movement()
if(!owner_as_can_man || owner_as_can_man.dead || owner_as_can_man.qdeleting)
return

//Strafing (At a distance).
if(objective_attack && get_dist(objective_attack,owner) >= 4)
if(strafe_count > 0)
var/desired_dir = get_dir(owner,objective_attack)
desired_dir = turn(desired_dir,90*strafe_latch)
owner.movement_flags = MOVEMENT_RUNNING
owner.move_dir = desired_dir
strafe_count -= 1
return TRUE
else if(prob(3))
strafe_count = 5
strafe_latch = pick(-1,1)
if(!objective_attack)
return

. = ..()
var/turf/T = get_turf(objective_attack)
if(!T)
return

minigun_state = 1
play_sound('sound/mob/can_man/rev_start.ogg',get_turf(owner_as_can_man))
CALLBACK("\ref[src]_minigun_start",15,src,src::start_minigun())

/ai/boss/can_man/handle_attacking()
owner_as_can_man.set_dir(get_dir(owner_as_can_man,T))

if(objective_attack)
//Charged minigun attack
if(next_minigun_sweep <= world.time)
owner_as_can_man.telegraph_special_minigun_sweep(objective_attack)
next_minigun_sweep = world.time + SECONDS_TO_DECISECONDS(30)
return TRUE
//Basic minigun attack.
if(owner_as_can_man.minigun_delay <= world.time && get_dist(owner,objective_attack) >= 2)
owner_as_can_man.shoot_minigun(objective_attack)
return TRUE
return TRUE

/ai/boss/can_man/proc/start_minigun()

if(minigun_state != 1)
return

if(!owner_as_can_man || owner_as_can_man.dead || owner_as_can_man.qdeleting)
return

minigun_state = 2

CALLBACK("\ref[src]_minigun_finish",30,src,src::finish_minigun())

return TRUE



/ai/boss/can_man/proc/finish_minigun()

if(minigun_state != 2)
return

if(!owner_as_can_man || owner_as_can_man.dead || owner_as_can_man.qdeleting)
return

minigun_state = 3
play_sound('sound/mob/can_man/rev_stop.ogg',get_turf(owner_as_can_man))
CALLBACK("\ref[src]_minigun_reset",15,src,src::reset_minigun())

return TRUE


/ai/boss/can_man/proc/reset_minigun()

if(minigun_state != 3)
return

if(!owner_as_can_man || owner_as_can_man.dead || owner_as_can_man.qdeleting)
return

minigun_state = 0
strafe_latch = 0x0

. = ..()
return TRUE
6 changes: 3 additions & 3 deletions code/_core/datum/damagetype/unarmed/powerfist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
/damagetype/unarmed/powerfist/can_man

attack_damage_base = list(
BLUNT = 80
BLUNT = 60
)

attack_delay = 10
attack_delay_max = 15
attack_delay = 20
attack_delay_max = 20

crit_multiplier = 4
crit_chance = 0
Expand Down
93 changes: 21 additions & 72 deletions code/_core/mob/living/simple/can_man.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/mob/living/simple/can_man

name = "Can Man"
boss_icon_state = "can_man"
desc = "The man with the can."


icon = 'icons/mob/living/simple/canman.dmi'
icon_state = "living"
boss_icon_state = "can_man"
damage_type = /damagetype/unarmed/powerfist/can_man

value = 20000
Expand All @@ -23,8 +27,10 @@

force_spawn = TRUE
boss = TRUE
respawn_time = SECONDS_TO_DECISECONDS(300)

armor = /armor/borg/military

fatigue_mul = 0

status_immune = list(
Expand All @@ -48,95 +54,46 @@
loyalty_tag = "Syndicate"
iff_tag = "Syndicate"

var/charge_steps = 0
var/charge_dir = 0

blood_type = /reagent/blood/robot
blood_volume = 5000

change_dir_on_move = FALSE

movement_delay = DECISECONDS_TO_TICKS(4)
movement_delay = DECISECONDS_TO_TICKS(10)

soul_size = SOUL_SIZE_RARE

object_size = 1

respawn_time = SECONDS_TO_DECISECONDS(300)

level = 90

stun_angle = 0

var/minigun_spread = 100 //Chance to hit an adjacent turf instead.
use_momentum = FALSE

var/minigun_delay = 0 //delay between each shot
/mob/living/simple/can_man/proc/shoot_minigun(var/atom/target)

/mob/living/simple/can_man/post_death()
. = ..()
charge_steps = 0
charge_dir = 0x0
update_sprite()

/mob/living/simple/can_man/update_icon()
. = ..()
icon = initial(icon)
icon_state = initial(icon_state)
if(dead)
icon_state = "dead"

/mob/living/simple/can_man/is_busy()
if(CALLBACK_EXISTS("\ref[src]_minigun_sweep"))
return TRUE
. = ..()
var/turf/T

/mob/living/simple/can_man/proc/telegraph_special_minigun_sweep(var/atom/target)
play_sound('sound/mob/can_man/rev_start.ogg',get_turf(src))
CALLBACK("\ref[src]_minigun_sweep",10,src,src::do_special_minigun_sweep(),target,30,30)
var/target_dir = get_dir(src,target)

/mob/living/simple/can_man/proc/do_special_minigun_sweep(var/atom/target,var/shots_current,var/shots_max)

if(dead || horizontal)
return FALSE

shoot_minigun(target,TRUE)

shots_current--

if(shots_current <= 0)
minigun_spread = initial(minigun_spread)
if(ai) ai.queue_find_new_objectives = TRUE
add_status_effect(PARALYZE,duration=30,magnitude=-1,stealthy=TRUE)
play_sound('sound/mob/can_man/rev_stop.ogg',get_turf(src))
return TRUE

CALLBACK("\ref[src]_minigun_sweep",0.25 + max(0,shots_current/shots_max - 0.5),src,src::do_special_minigun_sweep(),target,shots_current,shots_max)

/mob/living/simple/can_man/proc/shoot_minigun(var/atom/target,var/use_spread=FALSE)

var/turf/T = get_turf(src)
if(src.dir & target_dir) //Facing.
T = get_turf(target)
else //Not facing.
var/desired_dir = turn(dir,pick(-45,0,45))
T = get_step(src,desired_dir)

if(!T)
return FALSE

if(use_spread && prob(minigun_spread-50))
var/found_direction = get_dir(src,target)
var/offset_01 = turn(found_direction,90)
var/offset_02 = turn(found_direction,-90)
var/turf/new_target = get_step(target,pick(offset_01,offset_02))
if(new_target)
target = new_target

src.shoot_projectile(
src,
target,
T,
null,
null,
/obj/projectile/bullet/firearm/pistol,
/damagetype/ranged/bullet/pistol_45/hp,
16,
16,
use_spread ? 0.1*(minigun_spread/100) : 0.03,
0.01,
TILE_SIZE*0.5,
1,
"#FF4A00",
Expand All @@ -145,13 +102,8 @@
src.iff_tag,
src.loyalty_tag
)
src.set_dir(get_dir(src,target))
play_sound('sound/weapons/ranged/misc/canman_shot.ogg',T)

if(use_spread)
minigun_spread -= 5

minigun_delay = world.time + 0.5 + (health.health_current/health.health_max)*1.5
play_sound('sound/weapons/ranged/misc/canman_shot.ogg',T)

/mob/living/simple/can_man/post_move(var/atom/old_loc)
. = ..()
Expand Down Expand Up @@ -184,7 +136,4 @@
if(!M.can_be_attacked(src,src,params,DT))
continue
var/atom/object_to_damage = M.get_object_to_damage(src,src,damage_type,params,TRUE,TRUE)
DT.process_damage(src,M,src,object_to_damage,src,1)



DT.process_damage(src,M,src,object_to_damage,src,1)
Binary file modified sound/mob/can_man/rev_start.ogg
Binary file not shown.
Binary file modified sound/mob/can_man/rev_stop.ogg
Binary file not shown.

0 comments on commit 8c49534

Please sign in to comment.