From 70bf8076c35a210ac294af03d785c412adb0ae26 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Sun, 11 Jun 2017 02:58:50 -0400 Subject: [PATCH 1/2] Spiderbot Rework --- .../simple_animal/friendly/spiderbot.dm | 249 +++++------------- 1 file changed, 68 insertions(+), 181 deletions(-) diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index bc75bd554e5..3201d95a51e 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -1,53 +1,52 @@ /mob/living/simple_animal/spiderbot - - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) - minbodytemp = 0 - maxbodytemp = 500 - - var/obj/item/device/radio/borg/radio = null - var/mob/living/silicon/ai/connected_ai = null - var/obj/item/weapon/stock_parts/cell/cell = null - var/obj/machinery/camera/camera = null - var/obj/item/device/mmi/mmi = null - var/list/req_access = list(access_robotics) //Access needed to pop out the brain. - name = "Spider-bot" - desc = "A skittering robotic friend!" + desc = "A skittering robotic friend!" //More like ultimate shitter icon = 'icons/mob/robots.dmi' icon_state = "spiderbot-chassis" icon_living = "spiderbot-chassis" icon_dead = "spiderbot-smashed" wander = 0 universal_speak = 1 - health = 10 - maxHealth = 10 + health = 40 + maxHealth = 40 + melee_damage_lower = 2 + melee_damage_upper = 2 + melee_damage_type = BURN attacktext = "shocks" - attacktext = "shocks" - melee_damage_lower = 1 - melee_damage_upper = 3 + attack_sound = "sparks" response_help = "pets" response_disarm = "shoos" response_harm = "stomps on" - - var/obj/item/held_item = null //Storage for single item they can hold. - var/emagged = 0 //IS WE EXPLODEN? - var/syndie = 0 //IS WE SYNDICAT? (currently unused) - speed = -1 //Spiderbots gotta go fast. - //pass_flags = PASSTABLE //Maybe griefy? + speed = 0 mob_size = MOB_SIZE_SMALL speak_emote = list("beeps","clicks","chirps") + + atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + minbodytemp = 0 + maxbodytemp = 500 + can_hide = 1 ventcrawler = 2 loot = list(/obj/effect/decal/cleanable/blood/gibs/robot) del_on_death = 1 -/mob/living/simple_animal/spiderbot/attackby(var/obj/item/O as obj, var/mob/user as mob, params) + var/emagged = 0 //is it getting ready to explode? + var/obj/item/device/mmi/mmi = null - if(istype(O, /obj/item/device/mmi) || istype(O, /obj/item/device/mmi/posibrain)) +/mob/living/simple_animal/spiderbot/Destroy() + if(emagged) + QDEL_NULL(mmi) + explosion(get_turf(src), -1, -1, 3, 5) + else + eject_brain() + return ..() + +/mob/living/simple_animal/spiderbot/attackby(obj/item/O, mob/living/user, params) + if(istype(O, /obj/item/device/mmi)) var/obj/item/device/mmi/B = O - if(src.mmi) //There's already a brain in it. + if(mmi) //There's already a brain in it. to_chat(user, "There's already a brain in [src]!") return if(!B.brainmob) @@ -65,47 +64,49 @@ ghost_can_reenter = 1 break if(!ghost_can_reenter) - to_chat(user, "[O] is completely unresponsive; there's no point.") + to_chat(user, "[B] is completely unresponsive; there's no point.") return if(B.brainmob.stat == DEAD) - to_chat(user, "[O] is dead. Sticking it into the frame would sort of defeat the purpose.") + to_chat(user, "[B] is dead. Sticking it into the frame would sort of defeat the purpose.") return - if(jobban_isbanned(B.brainmob, "Cyborg") || jobban_isbanned(B.brainmob,"nonhumandept")) - to_chat(user, "[O] does not seem to fit.") + if(jobban_isbanned(B.brainmob, "Cyborg") || jobban_isbanned(B.brainmob, "nonhumandept")) + to_chat(user, "[B] does not seem to fit.") return - to_chat(user, "You install [O] in [src]!") + to_chat(user, "You install [B] in [src]!") user.drop_item() - src.mmi = O - src.transfer_personality(O) + B.forceMove(src) + mmi = B + transfer_personality(B) - O.loc = src - src.update_icon() + update_icon() return 1 - if(istype(O, /obj/item/weapon/weldingtool)) + else if(iswelder(O) && user.a_intent == INTENT_HELP) var/obj/item/weapon/weldingtool/WT = O + user.changeNext_move(CLICK_CD_MELEE) if(WT.remove_fuel(0)) if(health < maxHealth) - health += pick(1,1,1,2,2,3) - if(health > maxHealth) - health = maxHealth + adjustHealth(-5) + playsound(loc, WT.usesound, 50, 1) add_fingerprint(user) - for(var/mob/W in viewers(user, null)) - W.show_message(text("[user] has spot-welded some of the damage to [src]!"), 1) + visible_message("[user] has spot-welded some of the damage to [src]!") else to_chat(user, "[src] is undamaged!") else to_chat(user, "Need more welding fuel!") - return - else if(istype(O, /obj/item/weapon/card/id)||istype(O, /obj/item/device/pda)) + else if(istype(O, /obj/item/weapon/card/id) || istype(O, /obj/item/device/pda)) if(!mmi) to_chat(user, "There's no reason to swipe your ID - the spiderbot has no brain to remove.") return 0 + if(emagged) + to_chat(user, "[src] doesn't seem to respond.") + return 0 + var/obj/item/weapon/card/id/id_card if(istype(O, /obj/item/weapon/card/id)) @@ -117,63 +118,38 @@ if(access_robotics in id_card.access) to_chat(user, "You swipe your access card and pop the brain out of [src].") eject_brain() - - if(held_item) - held_item.loc = src.loc - held_item = null - return 1 else to_chat(user, "You swipe your card, with no effect.") return 0 else - if(O.force) - var/damage = O.force - if(O.damtype == STAMINA) - damage = 0 - adjustBruteLoss(damage) - for(var/mob/M in viewers(src, null)) - if((M.client && !( M.blinded ))) - M.show_message("[src] has been attacked with the [O] by [user]. ") - else - to_chat(usr, "This weapon is ineffective, it does no damage.") - for(var/mob/M in viewers(src, null)) - if((M.client && !( M.blinded ))) - M.show_message("[user] gently taps [src] with the [O]. ") + ..() -/mob/living/simple_animal/spiderbot/emag_act(user as mob) +/mob/living/simple_animal/spiderbot/emag_act(mob/living/user) if(emagged) - to_chat(user, "[src] is already overloaded - better run.") + to_chat(user, "[src] doesn't seem to respond.") return 0 else emagged = 1 - to_chat(user, "You short out the security protocols and overload [src]'s cell, priming it to explode in a short time.") - spawn(100) - to_chat(src, "Your cell seems to be outputting a lot of power...") - spawn(200) - to_chat(src, "Internal heat sensors are spiking! Something is badly wrong with your cell!") - spawn(300) - src.explode() + to_chat(user, "You short out the security protocols and rewrite [src]'s internal memory.") + to_chat(src, "You have been emagged; you are now completely loyal to [user] and their every order!") + add_logs(user, src, "emagged") + maxHealth = 60 + health = 60 + melee_damage_lower = 15 + melee_damage_upper = 15 + attack_sound = 'sound/machines/defib_zap.ogg' -/mob/living/simple_animal/spiderbot/proc/transfer_personality(var/obj/item/device/mmi/M as obj) - - src.mind = M.brainmob.mind - src.mind.key = M.brainmob.key - src.ckey = M.brainmob.ckey - src.name = "Spider-bot ([M.brainmob.name])" - -/mob/living/simple_animal/spiderbot/proc/explode() //When emagged. - for(var/mob/M in viewers(src, null)) - if((M.client && !( M.blinded ))) - M.show_message("[src] makes an odd warbling noise, fizzles, and explodes.") - explosion(get_turf(loc), -1, -1, 3, 5) - eject_brain() - death() +/mob/living/simple_animal/spiderbot/proc/transfer_personality(obj/item/device/mmi/M) + mind = M.brainmob.mind + mind.key = M.brainmob.key + ckey = M.brainmob.ckey + name = "Spider-bot ([M.brainmob.name])" /mob/living/simple_animal/spiderbot/proc/update_icon() if(mmi) - if(istype(mmi,/obj/item/device/mmi)) + if(istype(mmi, /obj/item/device/mmi)) icon_state = "spiderbot-chassis-mmi" icon_living = "spiderbot-chassis-mmi" if(istype(mmi, /obj/item/device/mmi/posibrain)) @@ -186,99 +162,10 @@ /mob/living/simple_animal/spiderbot/proc/eject_brain() if(mmi) - var/turf/T = get_turf(loc) - if(T) - mmi.loc = T - if(mind) mind.transfer_to(mmi.brainmob) + var/turf/T = get_turf(src) + mmi.forceMove(T) + if(mind) + mind.transfer_to(mmi.brainmob) mmi = null - src.name = "Spider-bot" - update_icon() - -/mob/living/simple_animal/spiderbot/Destroy() - eject_brain() - return ..() - -/mob/living/simple_animal/spiderbot/New() - - radio = new /obj/item/device/radio/borg(src) - camera = new /obj/machinery/camera(src) - camera.c_tag = "Spiderbot-[real_name]" - camera.network = list("SS13") - - ..() - -/mob/living/simple_animal/spiderbot/death(gibbed) - if(camera) - camera.status = 0 - - if(held_item) - held_item.forceMove(src.loc) - held_item = null - ..() - -//Cannibalized from the parrot mob. ~Zuhayr - -/mob/living/simple_animal/spiderbot/verb/drop_held_item() - set name = "Drop held item" - set category = "Spiderbot" - set desc = "Drop the item you're holding." - - if(stat) - return - - if(!held_item) - to_chat(usr, "You have nothing to drop!") - return 0 - - if(istype(held_item, /obj/item/weapon/grenade)) - visible_message("[src] launches \the [held_item]!", "You launch \the [held_item]!", "You hear a skittering noise and a thump!") - var/obj/item/weapon/grenade/G = held_item - G.loc = src.loc - G.prime() - held_item = null - return 1 - - visible_message("[src] drops \the [held_item]!", "You drop \the [held_item]!", "You hear a skittering noise and a soft thump.") - - held_item.loc = src.loc - held_item = null - return 1 - - return - -/mob/living/simple_animal/spiderbot/verb/get_item() - set name = "Pick up item" - set category = "Spiderbot" - set desc = "Allows you to take a nearby small item." - - if(stat) - return -1 - - if(held_item) - to_chat(src, "You are already holding \the [held_item]") - return 1 - - var/list/items = list() - for(var/obj/item/I in view(1,src)) - if(I.loc != src && I.w_class <= WEIGHT_CLASS_SMALL) - items.Add(I) - - var/obj/selection = input("Select an item.", "Pickup") in items - - if(selection) - for(var/obj/item/I in view(1, src)) - if(selection == I) - held_item = selection - selection.loc = src - visible_message("[src] scoops up \the [held_item]!", "You grab \the [held_item]!", "You hear a skittering noise and a clink.") - return held_item - to_chat(src, "\The [selection] is too far away.") - return 0 - - to_chat(src, "There is nothing of interest to take.") - return 0 - -/mob/living/simple_animal/spiderbot/examine(mob/user) - ..(user) - if(src.held_item) - to_chat(user, "It is carrying \a [src.held_item] [bicon(src.held_item)].") + name = "Spider-bot" + update_icon() \ No newline at end of file From 4dd13f00749a43478ff246160e29db7ef2085a77 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Sun, 11 Jun 2017 03:12:44 -0400 Subject: [PATCH 2/2] tweak --- code/modules/mob/living/simple_animal/friendly/spiderbot.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index 3201d95a51e..bf648e537ab 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -34,6 +34,7 @@ var/emagged = 0 //is it getting ready to explode? var/obj/item/device/mmi/mmi = null + var/emagged_master = null //for administrative purposes, to see who emagged the spiderbot; also for a holder for if someone emags an empty frame first then inserts an MMI. /mob/living/simple_animal/spiderbot/Destroy() if(emagged) @@ -134,6 +135,7 @@ emagged = 1 to_chat(user, "You short out the security protocols and rewrite [src]'s internal memory.") to_chat(src, "You have been emagged; you are now completely loyal to [user] and their every order!") + emagged_master = user.name add_logs(user, src, "emagged") maxHealth = 60 health = 60 @@ -146,6 +148,8 @@ mind.key = M.brainmob.key ckey = M.brainmob.ckey name = "Spider-bot ([M.brainmob.name])" + if(emagged) + to_chat(src, "You have been emagged; you are now completely loyal to [emagged_master] and their every order!") /mob/living/simple_animal/spiderbot/proc/update_icon() if(mmi)