mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Makes nanite sting actually work and nanite defib now starts your heart (#3789)
## About The Pull Request Makes nanite sting actually work and nanite defib now starts your heart ## Why It's Good For The Game Programs that do what you expect is good. ## Proof Of Testing Tested indeed <details> <summary>Screenshots/Videos</summary> </details> ## Changelog 🆑 fix: Nanites sting now actually works and has better feedback fix: Nanite defib now restarts your heart, or gives you a heart attack if you're alive. /🆑 --------- Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
This commit is contained in:
@@ -313,6 +313,9 @@
|
||||
host_mob.investigate_log("'s [name] nanite program was deleted by [source] with code [code].", INVESTIGATE_NANITES)
|
||||
qdel(src)
|
||||
|
||||
/datum/nanite_program/proc/send_user_message(message)
|
||||
to_chat(host_mob, "<i>You hear a strange, robotic voice in your head...</i> \"[span_robot("[message]")]\"")
|
||||
|
||||
///A nanite program containing a behaviour protocol. Only one protocol of each class can be active at once.
|
||||
/datum/nanite_program/protocol
|
||||
name = "Nanite Protocol"
|
||||
|
||||
@@ -158,7 +158,9 @@
|
||||
/datum/nanite_program/defib/on_trigger(comm_message)
|
||||
host_mob.notify_revival("Your heart is being defibrillated by nanites. Re-enter your corpse if you want to be revived!")
|
||||
host_mob.grab_ghost()
|
||||
addtimer(CALLBACK(src, .proc/zap), 50)
|
||||
playsound(host_mob, 'sound/machines/defib/defib_charge.ogg', 50, FALSE)
|
||||
send_user_message("Starting user revival sequence.")
|
||||
addtimer(CALLBACK(src, PROC_REF(zap)), 5 SECONDS)
|
||||
|
||||
/datum/nanite_program/defib/proc/check_revivable()
|
||||
if(!iscarbon(host_mob)) //nonstandard biology
|
||||
@@ -170,21 +172,30 @@
|
||||
|
||||
/datum/nanite_program/defib/proc/zap()
|
||||
var/mob/living/carbon/C = host_mob
|
||||
playsound(C, 'sound/machines/defib/defib_charge.ogg', 50, FALSE)
|
||||
sleep(30)
|
||||
playsound(C, 'sound/machines/defib/defib_zap.ogg', 50, FALSE)
|
||||
C.balloon_alert_to_viewers("twitches violently")
|
||||
if(check_revivable())
|
||||
if(C.stat == DEAD)
|
||||
var/original_oxyloss = C.getOxyLoss()
|
||||
C.setOxyLoss(OXYLOSS_PASSOUT_THRESHOLD - 5)
|
||||
C.SetSleeping(5 SECONDS)
|
||||
C.set_heartattack(FALSE)
|
||||
if(C.revive())
|
||||
playsound(C, 'sound/machines/defib/defib_success.ogg', 50, FALSE)
|
||||
C.emote("gasp")
|
||||
C.adjust_jitter_up_to(10 SECONDS, 1 MINUTES)
|
||||
SEND_SIGNAL(C, COMSIG_LIVING_MINOR_SHOCK)
|
||||
log_game("[C] has been successfully defibrillated by nanites.")
|
||||
send_user_message("User revival sequence success.")
|
||||
return
|
||||
else
|
||||
C.setOxyLoss(original_oxyloss)
|
||||
if(C.undergoing_cardiac_arrest() || C.has_status_effect(/datum/status_effect/heart_attack))
|
||||
SEND_SIGNAL(C, COMSIG_HEARTATTACK_DEFIB)
|
||||
send_user_message("User cardiac arrest prevention attempted.")
|
||||
return
|
||||
else
|
||||
C.apply_status_effect(/datum/status_effect/heart_attack)
|
||||
send_user_message("User revival sequence failure.")
|
||||
playsound(C, 'sound/machines/defib/defib_failed.ogg', 50, FALSE)
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
sent_message = message_setting.get_value()
|
||||
if(host_mob.stat == DEAD)
|
||||
return
|
||||
to_chat(host_mob, "<i>You hear a strange, robotic voice in your head...</i> \"[span_robot("[sent_message]")]\"")
|
||||
send_user_message(sent_message)
|
||||
|
||||
/datum/nanite_program/comm/hallucination
|
||||
name = "Hallucination"
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
that is unlinked from the cloud. \
|
||||
Will not work on hosts or those already infected."
|
||||
can_trigger = TRUE
|
||||
trigger_cost = 5
|
||||
trigger_cost = 15
|
||||
trigger_cooldown = 100
|
||||
rogue_types = list(/datum/nanite_program/glitch, /datum/nanite_program/toxic)
|
||||
var/decay_timer
|
||||
@@ -232,23 +232,33 @@
|
||||
. = ..()
|
||||
|
||||
/datum/nanite_program/nanite_sting/on_trigger(comm_message)
|
||||
consume_nanites(-15)
|
||||
to_chat(host_mob, span_warning("Your hands becomes sharp and prickly."))
|
||||
RegisterSignal(host_mob, COMSIG_LIVING_EARLY_UNARMED_ATTACK, PROC_REF(on_attack_hand))
|
||||
decay_timer = addtimer(CALLBACK(src, PROC_REF(decay_sting)), 30 SECONDS, TIMER_STOPPABLE)
|
||||
|
||||
/datum/nanite_program/nanite_sting/proc/on_attack_hand(atom/source, mob/user, modifiers)
|
||||
/datum/nanite_program/nanite_sting/proc/on_attack_hand(atom/attacker, mob/attack_target, proximity_flag, list/modifiers)
|
||||
SIGNAL_HANDLER
|
||||
var/mob/living/living = source
|
||||
if(!istype(living)) return
|
||||
if(!CAN_HAVE_NANITES(living) || SEND_SIGNAL(living, COMSIG_HAS_NANITES) || !living.Adjacent(host_mob)) return
|
||||
|
||||
if(prob(100 - living.getarmor(null, BIO)))
|
||||
var/mob/living/living = attack_target
|
||||
if(!isliving(living))
|
||||
return
|
||||
if(!CAN_HAVE_NANITES(living))
|
||||
host_mob.balloon_alert(host_mob, "can't be infected!")
|
||||
return
|
||||
if(SEND_SIGNAL(living, COMSIG_HAS_NANITES))
|
||||
host_mob.balloon_alert(host_mob, "already infected!")
|
||||
return
|
||||
if(!living.Adjacent(host_mob))
|
||||
host_mob.balloon_alert(host_mob, "can't reach!")
|
||||
return
|
||||
var/chances = 100 - living.run_armor_check(host_mob.zone_selected, BIO, silent = TRUE)
|
||||
var/success = prob(chances)
|
||||
host_mob.balloon_alert(host_mob, "[chances]% chance [success ? "success" : "failed!"]")
|
||||
if(success)
|
||||
//unlike with Infective Exo-Locomotion, this can't take over existing nanites, because Nanite Sting only targets non-hosts.
|
||||
living.AddComponent(/datum/component/nanites, 5)
|
||||
SEND_SIGNAL(living, COMSIG_NANITE_SYNC, nanites)
|
||||
// SEND_SIGNAL(living, COMSIG_NANITE_SET_CLOUD, nanites.cloud_id) won't set the cloud
|
||||
// SEND_SIGNAL(living, COMSIG_NANITE_SET_CLOUD_SYNC, NANITE_CLOUD_DISABLE)
|
||||
SEND_SIGNAL(living, COMSIG_NANITE_SET_CLOUD_SYNC, NANITE_CLOUD_DISABLE)
|
||||
living.investigate_log("was infected by a nanite cluster with cloud ID [nanites.cloud_id] by [key_name(host_mob)] at [AREACOORD(living)].", INVESTIGATE_NANITES)
|
||||
to_chat(living, span_warning("You feel a tiny prick."))
|
||||
decay_sting()
|
||||
|
||||
Reference in New Issue
Block a user