mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 07:03:30 +01:00
if baton would stun cyborgs, it would stun bots too (#21062)
* if baton would stun cyborgs, it would stun bots too * added visible message when stunning bots * cleanup
This commit is contained in:
@@ -54,10 +54,9 @@
|
||||
return ..()
|
||||
if(on_cooldown)
|
||||
return
|
||||
if(issilicon(target) && !affect_silicon)
|
||||
if((issilicon(target) || isbot(target)) && !affect_silicon)
|
||||
return ..()
|
||||
else
|
||||
baton_knockdown(target, user)
|
||||
baton_knockdown(target, user)
|
||||
|
||||
/**
|
||||
* Called when a target is about to be hit non-lethally.
|
||||
@@ -71,15 +70,21 @@
|
||||
user.visible_message("<span class='danger'>[user] pulses [target]'s sensors with [src]!</span>",\
|
||||
"<span class='danger'>You pulse [target]'s sensors with [src]!</span>")
|
||||
on_silicon_stun(target, user)
|
||||
else
|
||||
// Check for shield/countering
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK))
|
||||
return FALSE
|
||||
|
||||
// Check for shield/countering
|
||||
else if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK))
|
||||
return FALSE
|
||||
user.visible_message("<span class='danger'>[user] knocks down [target] with [src]!</span>",\
|
||||
"<span class='danger'>You knock down [target] with [src]!</span>")
|
||||
on_non_silicon_stun(target, user)
|
||||
|
||||
else if(isbot(target))
|
||||
user.visible_message("<span class='danger'>[user] pulses [target]'s sensors with [src]!</span>",\
|
||||
"<span class='danger'>You pulse [target]'s sensors with [src]!</span>")
|
||||
var/mob/living/simple_animal/bot/H = target
|
||||
H.disable(stun_time_silicon)
|
||||
// Visuals and sound
|
||||
user.do_attack_animation(target)
|
||||
playsound(target, stun_sound, 75, TRUE, -1)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
var/allow_pai = TRUE // Are we even allowed to insert a pai card.
|
||||
var/bot_name
|
||||
|
||||
var/disabling_timer_id = null
|
||||
var/list/player_access = list()
|
||||
var/emagged = 0
|
||||
var/obj/item/card/id/access_card // the ID card that the bot "holds"
|
||||
@@ -121,6 +122,8 @@
|
||||
return "<span class='average'>[mode_name[mode]]</span>"
|
||||
|
||||
/mob/living/simple_animal/bot/proc/turn_on()
|
||||
if(disabling_timer_id)
|
||||
return FALSE
|
||||
if(stat)
|
||||
return 0
|
||||
on = TRUE
|
||||
@@ -417,6 +420,20 @@
|
||||
if(was_on)
|
||||
turn_on()
|
||||
|
||||
/mob/living/simple_animal/bot/proc/disable(time)
|
||||
if(disabling_timer_id)
|
||||
deltimer(disabling_timer_id) // if we already have disabling timer, lets replace it with new one
|
||||
if(on)
|
||||
turn_off()
|
||||
disabling_timer_id = addtimer(CALLBACK(src, PROC_REF(enable)), time, TIMER_STOPPABLE)
|
||||
|
||||
/mob/living/simple_animal/bot/proc/enable()
|
||||
if(disabling_timer_id)
|
||||
deltimer(disabling_timer_id)
|
||||
disabling_timer_id = null
|
||||
if(!on)
|
||||
turn_on()
|
||||
|
||||
/mob/living/simple_animal/bot/rename_character(oldname, newname)
|
||||
if(!..(oldname, newname))
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user