Merge branch 'dev' into ofChemistryAndStuff

Conflicts:
	code/datums/recipe.dm
	code/game/machinery/bots/farmbot.dm
	code/game/machinery/bots/medbot.dm
	code/game/mecha/equipment/tools/tools.dm
	code/game/objects/effects/chem/chemsmoke.dm
	code/game/objects/effects/effect_system.dm
	code/game/objects/items/toys.dm
	code/game/objects/items/weapons/extinguisher.dm
	code/game/objects/items/weapons/mop.dm
	code/modules/mob/living/carbon/human/human.dm
	code/modules/organs/organ_internal.dm
	code/modules/reagents/Chemistry-Holder.dm
	code/modules/reagents/Chemistry-Reagents.dm
	code/modules/reagents/Chemistry-Recipes.dm
	code/modules/reagents/reagent_containers/food/snacks.dm
	code/modules/reagents/reagent_containers/pill.dm
	code/modules/reagents/reagent_containers/spray.dm
	maps/exodus-1.dmm
This commit is contained in:
Kelenius
2015-04-28 10:49:26 +03:00
999 changed files with 26502 additions and 23206 deletions

View File

@@ -2,4 +2,4 @@
..()
spawn(0)
if(src && !key) //we've transferred to another mob. This ghost should be deleted.
del(src)
qdel(src)

View File

@@ -29,6 +29,7 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
var/ghostvision = 1 //is the ghost able to see things humans can't?
var/seedarkness = 1
incorporeal_move = 1
/mob/dead/observer/New(mob/body)
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
@@ -80,10 +81,10 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
real_name = name
..()
/mob/dead/observer/Del()
/mob/dead/observer/Destroy()
if (ghostimage)
ghost_darkness_images -= ghostimage
del(ghostimage)
qdel(ghostimage)
ghostimage = null
updateallghostimages()
..()
@@ -193,29 +194,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
ghost.timeofdeath = world.time // Because the living mob won't have a time of death and we want the respawn timer to work properly.
announce_ghost_joinleave(ghost)
/mob/dead/observer/Move(NewLoc, direct)
following = null
set_dir(direct)
if(NewLoc)
loc = NewLoc
for(var/obj/effect/step_trigger/S in NewLoc)
S.Crossed(src)
return
loc = get_turf(src) //Get out of closets and such as a ghost
if((direct & NORTH) && y < world.maxy)
y++
else if((direct & SOUTH) && y > 1)
y--
if((direct & EAST) && x < world.maxx)
x++
else if((direct & WEST) && x > 1)
x--
for(var/obj/effect/step_trigger/S in locate(x, y, z)) //<-- this is dumb
S.Crossed(src)
/mob/dead/observer/can_use_hands() return 0
/mob/dead/observer/is_active() return 0
@@ -316,11 +294,23 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!thearea) return
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
L+=T
var/holyblock = 0
if(usr.invisibility <= SEE_INVISIBLE_LIVING || (usr.mind in cult.current_antagonists))
for(var/turf/T in get_area_turfs(thearea.type))
if(!T.holy)
L+=T
else
holyblock = 1
else
for(var/turf/T in get_area_turfs(thearea.type))
L+=T
if(!L || !L.len)
usr << "No area available."
if(holyblock)
usr << "<span class='warning'>This area has been entirely made into sacred grounds, you cannot enter it while you are in this plane of existence!</span>"
else
usr << "No area available."
usr.loc = pick(L)
following = null
@@ -336,7 +326,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
// This is the ghost's follow verb with an argument
/mob/dead/observer/proc/ManualFollow(var/atom/movable/target)
if(target && target != src)
if(!target)
return
var/turf/targetloc = get_turf(target)
if(check_holy(targetloc))
usr << "<span class='warning'>You cannot follow a mob standing on holy grounds!</span>"
return
if(target != src)
if(following && following == target)
return
following = target
@@ -351,6 +348,15 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
loc = T
sleep(15)
/mob/proc/check_holy(var/turf/T)
return 0
/mob/dead/observer/check_holy(var/turf/T)
if(check_rights(R_ADMIN|R_FUN, 0, src))
return 0
return (T && T.holy) && (invisibility <= SEE_INVISIBLE_LIVING || (mind in cult.current_antagonists))
/mob/dead/observer/verb/jumptomob(target in getmobs()) //Moves the ghost instead of just changing the ghosts's eye -Nodrak
set category = "Ghost"
set name = "Jump to Mob"
@@ -393,6 +399,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set hidden = 1
src << "\red You are dead! You have no mind to store memory!"
/mob/dead/observer/Post_Incorpmove()
following = null
/mob/dead/observer/verb/analyze_air()
set name = "Analyze Air"
set category = "Ghost"
@@ -473,6 +482,15 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
src << browse(dat, "window=manifest;size=370x420;can_close=1")
//This is called when a ghost is drag clicked to something.
/mob/dead/observer/MouseDrop(atom/over)
if(!usr || !over) return
if (isobserver(usr) && usr.client && usr.client.holder && isliving(over))
if (usr.client.holder.cmd_ghost_drag(src,over))
return
return ..()
//Used for drawing on walls with blood puddles as a spooky ghost.
/mob/dead/verb/bloody_doodle()
@@ -580,7 +598,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
for(var/image/I in client.images)
if(I.icon_state == icon)
iconRemoved = 1
del(I)
qdel(I)
if(!iconRemoved)
var/image/J = image('icons/mob/mob.dmi', loc = src, icon_state = icon)

View File

@@ -18,7 +18,7 @@
/mob/dead/observer/emote(var/act, var/type, var/message)
message = sanitize(message)
//message = sanitize(message) - already sanitized in verb/me_verb()
if(!message)
return

View File

@@ -19,8 +19,8 @@
if(do_gibs) gibs(loc, viruses, dna)
spawn(15)
if(animation) del(animation)
if(src) del(src)
if(animation) qdel(animation)
if(src) qdel(src)
//This is the proc for turning a mob into ash. Mostly a copy of gib code (above).
//Originally created for wizard disintegrate. I've removed the virus code since it's irrelevant here.
@@ -43,8 +43,8 @@
dead_mob_list -= src
spawn(15)
if(animation) del(animation)
if(src) del(src)
if(animation) qdel(animation)
if(src) qdel(src)
/mob/proc/death(gibbed,deathmessage="seizes up and falls limp...")

View File

@@ -2,10 +2,8 @@
//
// The datum containing all the chunks.
var/datum/visualnet/camera/cameranet = new()
/datum/visualnet/camera
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Destroy().
var/list/cameras = list()
var/cameras_unsorted = 1
chunk_type = /datum/chunk/camera

View File

@@ -36,11 +36,14 @@
eyeobj.owner = src
eyeobj.name = "[src.name] (AI Eye)" // Give it a name
spawn(5)
eyeobj.loc = src.loc
if(eyeobj)
eyeobj.loc = src.loc
/mob/living/silicon/ai/Del()
eyeobj.owner = null
del(eyeobj) // No AI, no Eye
/mob/living/silicon/ai/Destroy()
if(eyeobj)
eyeobj.owner = null
qdel(eyeobj) // No AI, no Eye
eyeobj = null
..()
/atom/proc/move_camera_by_click()

View File

@@ -41,7 +41,7 @@
dd_insertObjectList(cameranet.cameras, src)
update_coverage(1)
/obj/machinery/camera/Del()
/obj/machinery/camera/Destroy()
cameranet.cameras -= src
clear_all_networks()
..()

View File

@@ -101,7 +101,7 @@
var/turf/t = turf
if(obscuredTurfs[t])
if(!t.obfuscations[obfuscation.type])
t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, 15)
t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, OBFUSCATION_LAYER)
obscured += t.obfuscations[obfuscation.type]
for(var/eye in seenby)
@@ -140,7 +140,7 @@
for(var/turf in obscuredTurfs)
var/turf/t = turf
if(!t.obfuscations[obfuscation.type])
t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, 15)
t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, OBFUSCATION_LAYER)
obscured += t.obfuscations[obfuscation.type]
#undef UPDATE_BUFFER

View File

@@ -12,6 +12,7 @@
var/sprint = 10
var/cooldown = 0
var/acceleration = 1
var/owner_follows_eye = 0
see_in_dark = 7
status_flags = GODMODE
@@ -30,17 +31,19 @@
updateallghostimages()
..()
mob/eye/Del()
mob/eye/Destroy()
if (ghostimage)
ghost_darkness_images -= ghostimage
ghost_sightless_images -= ghostimage
del(ghostimage)
ghostimage = null;
qdel(ghostimage)
ghostimage = null
updateallghostimages()
..()
// Movement code. Returns 0 to stop air movement from moving it.
/mob/eye/Move()
/mob/eye/Move(n, direct)
if(owner == src)
EyeMove(n, direct)
return 0
/mob/eye/examinate()
@@ -60,15 +63,35 @@ mob/eye/Del()
/mob/eye/proc/setLoc(var/T)
if(owner)
T = get_turf(T)
loc = T
if(T != loc)
loc = T
if(owner.client)
owner.client.eye = src
if(owner.client)
owner.client.eye = src
visualnet.visibility(src)
return 1
if(owner_follows_eye)
visualnet.updateVisibility(owner, 0)
owner.loc = loc
visualnet.updateVisibility(owner, 0)
visualnet.visibility(src)
return 1
return 0
/mob/eye/proc/getLoc()
if(owner)
if(!isturf(owner.loc) || !owner.client)
return
return loc
/mob
var/mob/eye/eyeobj
/mob/proc/EyeMove(n, direct)
if(!eyeobj)
return
return eyeobj.EyeMove(n, direct)
/mob/eye/EyeMove(n, direct)
var/initial = initial(sprint)
var/max_sprint = 50
@@ -86,18 +109,3 @@ mob/eye/Del()
sprint = min(sprint + 0.5, max_sprint)
else
sprint = initial
/mob/eye/proc/getLoc()
if(owner)
if(!isturf(owner.loc) || !owner.client)
return
return loc
/mob
var/mob/eye/eyeobj
/mob/proc/EyeMove(n, direct)
if(!eyeobj)
return
return eyeobj.EyeMove(n, direct)

View File

@@ -0,0 +1,7 @@
/mob/eye/Life()
..()
// If we lost our client, reset the list of visible chunks so they update properly on return
if(owner == src && !client)
visibleChunks.Cut()
/*else if(owner && !owner.client)
visibleChunks.Cut()*/

View File

@@ -0,0 +1,39 @@
// CULT CHUNK
//
// A 16x16 grid of the map with a list of turfs that can be seen, are visible and are dimmed.
// Allows the Eye to stream these chunks and know what it can and cannot see.
/datum/obfuscation/cult
icon_state = "white"
/datum/chunk/cult
obfuscation = new /datum/obfuscation/cult()
/datum/chunk/cult/acquireVisibleTurfs(var/list/visible)
for(var/mob/living/L in living_mob_list)
for(var/turf/t in L.seen_turfs())
visible[t] = t
/mob/living/proc/seen_turfs()
return seen_turfs_in_range(src, 3)
/mob/living/carbon/human/seen_turfs()
/*if(src.isSynthetic())
return list()*/
if(mind in cult.current_antagonists)
return seen_turfs_in_range(src, client ? client.view : 7)
return ..()
/mob/living/silicon/seen_turfs()
return list()
/mob/living/simple_animal/seen_turfs()
return seen_turfs_in_range(src, 1)
/mob/living/simple_animal/shade/narsie/seen_turfs()
return view(2, src)
/proc/seen_turfs_in_range(var/source, var/range)
var/turf/pos = get_turf(source)
return hear(range, pos)

View File

@@ -0,0 +1,15 @@
// CULT NET
//
// The datum containing all the chunks.
/datum/visualnet/cult
chunk_type = /datum/chunk/cult
/datum/visualnet/cult/proc/provides_vision(var/mob/living/L)
return L.provides_cult_vision()
/mob/living/proc/provides_cult_vision()
return 1
/mob/living/silicon/provides_cult_vision()
return 0

View File

@@ -0,0 +1,13 @@
// MASK EYE
//
// A mob that a cultists controls to look around the station with.
// It streams chunks as it moves around, which will show it what the cultist can and cannot see.
/mob/eye/maskEye
name = "Eye of Nar-Sie"
acceleration = 0
owner_follows_eye = 1
/mob/eye/maskEye/New()
..()
visualnet = cultnet

View File

@@ -0,0 +1,50 @@
//UPDATE TRIGGERS, when the chunk (and the surrounding chunks) should update.
#define CULT_UPDATE_BUFFER 30
/mob/living/var/updating_cult_vision = 0
/mob/living/Move()
var/oldLoc = src.loc
. = ..()
if(.)
if(cultnet.provides_vision(src))
if(!updating_cult_vision)
updating_cult_vision = 1
spawn(CULT_UPDATE_BUFFER)
if(oldLoc != src.loc)
cultnet.updateVisibility(oldLoc, 0)
cultnet.updateVisibility(loc, 0)
updating_cult_vision = 0
#undef CULT_UPDATE_BUFFER
/mob/living/New()
..()
cultnet.updateVisibility(src, 0)
/mob/living/Destroy()
cultnet.updateVisibility(src, 0)
..()
/mob/living/rejuvenate()
var/was_dead = stat == DEAD
..()
if(was_dead && stat != DEAD)
// Arise!
cultnet.updateVisibility(src, 0)
/mob/living/death(gibbed, deathmessage="seizes up and falls limp...")
if(..())
// If true, the mob went from living to dead (assuming everyone has been overriding as they should...)
cultnet.updateVisibility(src)
/datum/antagonist/add_antagonist(var/datum/mind/player)
..()
if(src == cult)
cultnet.updateVisibility(player.current, 0)
/datum/antagonist/remove_antagonist(var/datum/mind/player, var/show_message, var/implanted)
..()
if(src == cult)
cultnet.updateVisibility(player.current, 0)

View File

@@ -20,7 +20,7 @@
HOW IT WORKS
It works by first creating a camera network datum. Inside of this camera network are "chunks" (which will be
explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Del().
explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Destroy().
Next the camera network has chunks. These chunks are a 16x16 tile block of turfs and cameras contained inside the chunk.
These turfs are then sorted out based on what the cameras can and cannot see. If none of the cameras can see the turf, inside

View File

@@ -13,7 +13,7 @@
/turf/drain_power()
return -1
/turf/simulated/Del()
/turf/simulated/Destroy()
updateVisibility(src)
..()
@@ -24,7 +24,7 @@
// STRUCTURES
/obj/structure/Del()
/obj/structure/Destroy()
updateVisibility(src)
..()
@@ -34,9 +34,9 @@
// EFFECTS
/obj/effect/Del()
/obj/effect/Destroy()
updateVisibility(src)
..()
return ..()
/obj/effect/New()
..()

View File

@@ -2,8 +2,6 @@
//
// The datum containing all the chunks.
var/global/list/visual_nets = new()
/datum/visualnet
// The chunks of the map, mapping the areas that an object can see.
var/list/chunks = list()
@@ -14,7 +12,7 @@ var/global/list/visual_nets = new()
..()
visual_nets += src
/datum/visualnet/Del()
/datum/visualnet/Destroy()
visual_nets -= src
..()

View File

@@ -11,7 +11,7 @@
..()
processing_objects.Add(src)
/obj/item/weapon/holder/Del()
/obj/item/weapon/holder/Destroy()
processing_objects.Remove(src)
..()
@@ -26,7 +26,7 @@
mob_container.forceMove(get_turf(src))
M.reset_view()
del(src)
qdel(src)
/obj/item/weapon/holder/attackby(obj/item/weapon/W as obj, mob/user as mob)
for(var/mob/M in src.contents)

View File

@@ -20,7 +20,7 @@
if(!W.mob_can_equip(src, slot))
if(del_on_fail)
del(W)
qdel(W)
else
if(!disable_warning)
src << "\red You are unable to equip that." //Only print if del_on_fail is false
@@ -58,6 +58,10 @@ var/list/slot_equipment_priority = list( \
slot_r_store\
)
//Checks if a given slot can be accessed at this time, either to equip or unequip I
/mob/proc/slot_is_accessible(var/slot, var/obj/item/I, mob/user=null)
return 1
//puts the item "W" into an appropriate slot in a human's inventory
//returns 0 if it cannot, 1 if successful
/mob/proc/equip_to_appropriate_slot(obj/item/W)
@@ -143,7 +147,8 @@ var/list/slot_equipment_priority = list( \
W.dropped()
return 0
// Removes an item from inventory and places it in the target atom
// Removes an item from inventory and places it in the target atom.
// If canremove or other conditions need to be checked then use unEquip instead.
/mob/proc/drop_from_inventory(var/obj/item/W, var/atom/Target = null)
if(W)
if(!Target)
@@ -151,7 +156,7 @@ var/list/slot_equipment_priority = list( \
remove_from_mob(W)
if(!W) return 1 // self destroying objects (tk, grabs)
W.forceMove(Target)
update_icons()
return 1
@@ -165,7 +170,7 @@ var/list/slot_equipment_priority = list( \
/mob/proc/drop_r_hand(var/atom/Target)
return drop_from_inventory(r_hand, Target)
//Drops the item in our active hand.
//Drops the item in our active hand. TODO: rename this to drop_active_hand or something
/mob/proc/drop_item(var/atom/Target)
if(hand) return drop_l_hand(Target)
else return drop_r_hand(Target)
@@ -173,11 +178,11 @@ var/list/slot_equipment_priority = list( \
/*
Removes the object from any slots the mob might have, calling the appropriate icon update proc.
Does nothing else.
DO NOT CALL THIS PROC DIRECTLY. It is meant to be called only by other inventory procs.
It's probably okay to use it if you are transferring the item between slots on the same mob,
but chances are you're safer calling remove_from_mob() or drop_from_inventory() anyways.
As far as I can tell the proc exists so that mobs with different inventory slots can override
the search through all the slots, without having to duplicate the rest of the item dropping.
*/
@@ -196,15 +201,21 @@ var/list/slot_equipment_priority = list( \
update_inv_wear_mask(0)
return
//This differs from remove_from_mob() in that it checks canremove first.
//This differs from remove_from_mob() in that it checks if the item can be unequipped first.
/mob/proc/unEquip(obj/item/I, force = 0) //Force overrides NODROP for things like wizarditis and admin undress.
if(!I) //If there's nothing to drop, the drop is automatically successful.
return 1
if(!I.canremove && !force)
var/slot
for(var/s in slot_back to slot_tie) //kind of worries me
if(get_equipped_item(s) == I)
slot = s
break
if(slot && !I.mob_can_unequip(src, slot))
return 0
remove_from_mob(I)
drop_from_inventory(I)
return 1
//Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob.
@@ -216,10 +227,19 @@ var/list/slot_equipment_priority = list( \
O.screen_loc = null
if(istype(O, /obj/item))
var/obj/item/I = O
I.dropped()
I.dropped(src)
return 1
//Returns the item equipped to the specified slot, if any.
/mob/proc/get_equipped_item(var/slot)
switch(slot)
if(slot_l_hand) return l_hand
if(slot_r_hand) return r_hand
if(slot_back) return back
if(slot_wear_mask) return wear_mask
return null
//Outdated but still in use apparently. This should at least be a human proc.
/mob/proc/get_equipped_items()
var/list/items = new/list()

View File

@@ -134,6 +134,12 @@
. = (L in languages)
languages.Remove(L)
/mob/living/remove_language(rem_language)
var/datum/language/L = all_languages[rem_language]
if(default_language == L)
default_language = null
return ..()
// Can we speak this language, as opposed to just understanding it?
/mob/proc/can_speak(datum/language/speaking)
@@ -154,4 +160,32 @@
src << browse(dat, "window=checklanguage")
return
/mob/living/check_languages()
var/dat = "<b><font size = 5>Known Languages</font></b><br/><br/>"
if(default_language)
dat += "Current default language: [default_language] - <a href='byond://?src=\ref[src];default_lang=reset'>reset</a><br/><br/>"
for(var/datum/language/L in languages)
if(!(L.flags & NONGLOBAL))
if(L == default_language)
dat += "<b>[L.name] (:[L.key])</b> - default - <a href='byond://?src=\ref[src];default_lang=reset'>reset</a><br/>[L.desc]<br/><br/>"
else
dat += "<b>[L.name] (:[L.key])</b> - <a href='byond://?src=\ref[src];default_lang=[L]'>set default</a><br/>[L.desc]<br/><br/>"
src << browse(dat, "window=checklanguage")
/mob/living/Topic(href, href_list)
if(href_list["default_lang"])
if(href_list["default_lang"] == "reset")
set_default_language(null)
else
var/datum/language/L = all_languages[href_list["default_lang"]]
if(L)
set_default_language(L)
check_languages()
return 1
else
return ..()
#undef SCRAMBLE_CACHE_LEN

View File

@@ -246,7 +246,7 @@
B << "To create this node you will have to be on a normal blob tile and far enough away from any other node."
B << "Check your Blob verbs and hit Create Node to build a node."
spawn(10)
del(G_found)
qdel(G_found)

View File

@@ -0,0 +1,123 @@
/mob/living/bot
name = "Bot"
health = 20
maxHealth = 20
icon = 'icons/obj/aibots.dmi'
layer = MOB_LAYER
universal_speak = 1
density = 0
var/obj/item/weapon/card/id/botcard = null
var/list/botcard_access = list()
var/on = 1
var/open = 0
var/locked = 1
var/emagged = 0
var/light_strength = 3
var/obj/access_scanner = null
var/list/req_access = list()
/mob/living/bot/New()
..()
update_icons()
botcard = new /obj/item/weapon/card/id(src)
botcard.access = botcard_access.Copy()
access_scanner = new /obj(src)
access_scanner.req_access = req_access.Copy()
/mob/living/bot/Life()
..()
weakened = 0
stunned = 0
paralysis = 0
if(health <= 0)
death()
/mob/living/bot/updatehealth()
if(status_flags & GODMODE)
health = maxHealth
stat = CONSCIOUS
else
health = maxHealth - getFireLoss() - getBruteLoss()
oxyloss = 0
toxloss = 0
cloneloss = 0
halloss = 0
/mob/living/bot/death()
explode()
/mob/living/bot/attackby(var/obj/item/O, var/mob/user)
if(O.GetID())
if(access_scanner.allowed(user) && !open && !emagged)
locked = !locked
user << "<span class='notice'>Controls are now [locked ? "locked." : "unlocked."]</span>"
attack_hand(user)
else
if(emagged)
user << "<span class='warning'>ERROR</span>"
if(open)
user << "<span class='warning'>Please close the access panel before locking it.</span>"
else
user << "<span class='warning'>Access denied.</span>"
return
else if(istype(O, /obj/item/weapon/screwdriver))
if(!locked)
open = !open
user << "<span class='notice'>Maintenance panel is now [open ? "opened" : "closed"].</span>"
else
user << "<span class='notice'>You need to unlock the controls first.</span>"
return
else if(istype(O, /obj/item/weapon/weldingtool))
if(health < maxHealth)
if(open)
health = min(maxHealth, health + 10)
user.visible_message("<span class='notice'>[user] repairs [src].</span>","<span class='notice'>You repair [src].</span>")
else
user << "<span class='notice'>Unable to repair with the maintenance panel closed.</span>"
else
user << "<span class='notice'>[src] does not need a repair.</span>"
return
else if (istype(O, /obj/item/weapon/card/emag) && !emagged)
Emag(user)
return
else
..()
/mob/living/bot/attack_ai(var/mob/user)
return attack_hand(user)
/mob/living/bot/say(var/message)
var/verb = "beeps"
message = sanitize(message)
..(message, null, verb)
/mob/living/bot/Bump(var/atom/A)
if(istype(A, /obj/machinery/door) && botcard)
var/obj/machinery/door/D = A
if(!istype(D, /obj/machinery/door/firedoor) && !istype(D, /obj/machinery/door/blast) && D.check_access(botcard))
D.open()
/mob/living/bot/proc/Emag(var/mob/user)
log_and_message_admins("emagged [src]")
return
/mob/living/bot/proc/turn_on()
if(stat)
return 0
on = 1
SetLuminosity(light_strength)
update_icons()
return 1
/mob/living/bot/proc/turn_off()
on = 0
SetLuminosity(0)
update_icons()
/mob/living/bot/proc/explode()
qdel(src)

View File

@@ -0,0 +1,306 @@
/mob/living/bot/cleanbot
name = "Cleanbot"
desc = "A little cleaning robot, he looks so excited!"
icon_state = "cleanbot0"
req_access = list(access_janitor)
botcard_access = list(access_janitor, access_maint_tunnels)
locked = 0 // Start unlocked so roboticist can set them to patrol.
var/obj/effect/decal/cleanable/target
var/list/path = list()
var/list/patrol_path = list()
var/list/ignorelist = list()
var/obj/cleanbot_listener/listener = null
var/beacon_freq = 1445 // navigation beacon frequency
var/signal_sent = 0
var/closest_dist
var/next_dest
var/next_dest_loc
var/cleaning = 0
var/screwloose = 0
var/oddbutton = 0
var/should_patrol = 0
var/blood = 1
var/list/target_types = list()
/mob/living/bot/cleanbot/New()
..()
get_targets()
listener = new /obj/cleanbot_listener(src)
listener.cleanbot = src
if(radio_controller)
radio_controller.add_object(listener, beacon_freq, filter = RADIO_NAVBEACONS)
/mob/living/bot/cleanbot/Life()
..()
if(!on)
return
if(client)
return
if(cleaning)
return
if(!screwloose && !oddbutton && prob(5))
custom_emote(2, "makes an excited beeping booping sound!")
if(screwloose && prob(5)) // Make a mess
if(istype(loc, /turf/simulated))
var/turf/simulated/T = loc
if(T.wet < 1)
T.wet = 1
if(T.wet_overlay)
T.overlays -= T.wet_overlay
T.wet_overlay = null
T.wet_overlay = image('icons/effects/water.dmi', T, "wet_floor")
T.overlays += T.wet_overlay
spawn(800)
if(istype(T) && T.wet < 2)
T.wet = 0
if(T.wet_overlay)
T.overlays -= T.wet_overlay
T.wet_overlay = null
if(oddbutton && prob(5)) // Make a big mess
visible_message("Something flies out of [src]. He seems to be acting oddly.")
var/obj/effect/decal/cleanable/blood/gibs/gib = new /obj/effect/decal/cleanable/blood/gibs(loc)
ignorelist += gib
spawn(600)
ignorelist -= gib
if(!target) // Find a target
for(var/obj/effect/decal/cleanable/D in view(7, src))
if(D in ignorelist)
continue
for(var/T in target_types)
if(istype(D, T))
target = D
patrol_path = list()
if(!target) // No targets in range
if(!should_patrol)
return
if(!patrol_path || !patrol_path.len)
if(!signal_sent || signal_sent > world.time + 200) // Waited enough or didn't send yet
var/datum/radio_frequency/frequency = radio_controller.return_frequency(beacon_freq)
if(!frequency)
return
closest_dist = 9999
next_dest = null
next_dest_loc = null
var/datum/signal/signal = new()
signal.source = src
signal.transmission_method = 1
signal.data = list("findbeakon" = "patrol")
frequency.post_signal(src, signal, filter = RADIO_NAVBEACONS)
signal_sent = world.time
else
if(next_dest)
next_dest_loc = listener.memorized[next_dest]
if(next_dest_loc)
patrol_path = AStar(loc, next_dest_loc, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id = botcard, exclude = null)
signal_sent = 0
else
if(pulledby) // Don't wiggle if someone pulls you
patrol_path = list()
return
if(patrol_path[1] == loc)
patrol_path -= patrol_path[1]
var/moved = step_towards(src, patrol_path[1])
if(moved)
patrol_path -= patrol_path[1]
if(target)
if(loc == target.loc)
if(!cleaning)
UnarmedAttack(target)
return
if(!path.len)
spawn(0)
path = AStar(loc, target.loc, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30, id = botcard)
if(!path)
path = list()
return
if(path.len)
step_to(src, path[1])
path -= path[1]
return
/mob/living/bot/cleanbot/UnarmedAttack(var/obj/effect/decal/cleanable/D, var/proximity)
if(!..())
return
if(!istype(D))
return
if(D.loc != loc)
return
cleaning = 1
custom_emote(2, "begins to clean up the [D]")
update_icons()
var/cleantime = istype(D, /obj/effect/decal/cleanable/dirt) ? 10 : 50
if(do_after(src, cleantime))
if(istype(loc, /turf/simulated))
var/turf/simulated/f = loc
f.dirt = 0
if(!D)
return
qdel(D)
cleaning = 0
update_icons()
/mob/living/bot/cleanbot/explode()
on = 0
visible_message("<span class='danger'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
new /obj/item/weapon/reagent_containers/glass/bucket(Tsec)
new /obj/item/device/assembly/prox_sensor(Tsec)
if(prob(50))
new /obj/item/robot_parts/l_arm(Tsec)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
qdel(src)
return
/mob/living/bot/cleanbot/update_icons()
if(cleaning)
icon_state = "cleanbot-c"
else
icon_state = "cleanbot[on]"
/mob/living/bot/cleanbot/turn_off()
..()
target = null
path = list()
patrol_path = list()
/mob/living/bot/cleanbot/attack_hand(var/mob/user)
var/dat
dat += "<TT><B>Automatic Station Cleaner v1.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];operation=start'>[on ? "On" : "Off"]</A><BR>"
dat += "Behaviour controls are [locked ? "locked" : "unlocked"]<BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]"
if(!locked || issilicon(user))
dat += "<BR>Cleans Blood: <A href='?src=\ref[src];operation=blood'>[blood ? "Yes" : "No"]</A><BR>"
dat += "<BR>Patrol station: <A href='?src=\ref[src];operation=patrol'>[should_patrol ? "Yes" : "No"]</A><BR>"
if(open && !locked)
dat += "Odd looking screw twiddled: <A href='?src=\ref[src];operation=screw'>[screwloose ? "Yes" : "No"]</A><BR>"
dat += "Weird button pressed: <A href='?src=\ref[src];operation=oddbutton'>[oddbutton ? "Yes" : "No"]</A>"
user << browse("<HEAD><TITLE>Cleaner v1.0 controls</TITLE></HEAD>[dat]", "window=autocleaner")
onclose(user, "autocleaner")
return
/mob/living/bot/cleanbot/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
add_fingerprint(usr)
switch(href_list["operation"])
if("start")
if(on)
turn_off()
else
turn_on()
if("blood")
blood = !blood
get_targets()
if("patrol")
should_patrol = !should_patrol
patrol_path = null
if("freq")
var/freq = text2num(input("Select frequency for navigation beacons", "Frequnecy", num2text(beacon_freq / 10))) * 10
if (freq > 0)
beacon_freq = freq
if("screw")
screwloose = !screwloose
usr << "<span class='notice>You twiddle the screw.</span>"
if("oddbutton")
oddbutton = !oddbutton
usr << "<span class='notice'>You press the weird button.</span>"
attack_hand(usr)
/mob/living/bot/cleanbot/Emag(var/mob/user)
..()
if(user)
user << "<span class='notice'>The [src] buzzes and beeps.</span>"
oddbutton = 1
screwloose = 1
/mob/living/bot/cleanbot/proc/get_targets()
target_types = list()
target_types += /obj/effect/decal/cleanable/blood/oil
target_types += /obj/effect/decal/cleanable/vomit
target_types += /obj/effect/decal/cleanable/crayon
target_types += /obj/effect/decal/cleanable/liquid_fuel
target_types += /obj/effect/decal/cleanable/mucus
target_types += /obj/effect/decal/cleanable/dirt
if(blood)
target_types += /obj/effect/decal/cleanable/blood
/* Radio object that listens to signals */
/obj/cleanbot_listener
var/mob/living/bot/cleanbot/cleanbot = null
var/list/memorized = list()
/obj/cleanbot_listener/receive_signal(var/datum/signal/signal)
var/recv = signal.data["beacon"]
var/valid = signal.data["patrol"]
if(!recv || !valid || !cleanbot)
return
var/dist = get_dist(cleanbot, signal.source.loc)
memorized[recv] = signal.source.loc
if(dist < cleanbot.closest_dist) // We check all signals, choosing the closest beakon; then we move to the NEXT one after the closest one
cleanbot.closest_dist = dist
cleanbot.next_dest = signal.data["next_patrol"]
/* Assembly */
/obj/item/weapon/bucket_sensor
desc = "It's a bucket. With a sensor attached."
name = "proxy bucket"
icon = 'icons/obj/aibots.dmi'
icon_state = "bucket_proxy"
force = 3.0
throwforce = 10.0
throw_speed = 2
throw_range = 5
w_class = 3.0
var/created_name = "Cleanbot"
/obj/item/weapon/bucket_sensor/attackby(var/obj/item/O, var/mob/user)
..()
if(istype(O, /obj/item/robot_parts/l_arm) || istype(O, /obj/item/robot_parts/r_arm))
user.drop_item()
qdel(O)
var/turf/T = get_turf(loc)
var/mob/living/bot/cleanbot/A = new /mob/living/bot/cleanbot(T)
A.name = created_name
user << "<span class='notice'>You add the robot arm to the bucket and sensor assembly. Beep boop!</span>"
user.drop_from_inventory(src)
qdel(src)
else if(istype(O, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)
return
created_name = t

View File

@@ -0,0 +1,192 @@
/mob/living/bot/secbot/ed209
name = "ED-209 Security Robot"
desc = "A security robot. He looks less than thrilled."
icon = 'icons/obj/aibots.dmi'
icon_state = "ed2090"
density = 1
health = 100
maxHealth = 100
bot_version = "2.5"
is_ranged = 1
preparing_arrest_sounds = new()
var/shot_delay = 4
var/last_shot = 0
/mob/living/bot/secbot/ed209/update_icons()
if(on && is_attacking)
icon_state = "ed209-c"
else
icon_state = "ed209[on]"
/mob/living/bot/secbot/ed209/explode()
visible_message("<span class='warning'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
new /obj/item/weapon/secbot_assembly/ed209_assembly(Tsec)
var/obj/item/weapon/gun/energy/taser/G = new /obj/item/weapon/gun/energy/taser(Tsec)
G.power_supply.charge = 0
if(prob(50))
new /obj/item/robot_parts/l_leg(Tsec)
if(prob(50))
new /obj/item/robot_parts/r_leg(Tsec)
if(prob(50))
if(prob(50))
new /obj/item/clothing/head/helmet(Tsec)
else
new /obj/item/clothing/suit/armor/vest(Tsec)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
new /obj/effect/decal/cleanable/blood/oil(Tsec)
qdel(src)
/mob/living/bot/secbot/ed209/RangedAttack(var/atom/A)
if(last_shot + shot_delay > world.time)
src << "You are not ready to fire yet!"
return
last_shot = world.time
var/turf/T = get_turf(src)
var/turf/U = get_turf(A)
var/projectile = /obj/item/projectile/beam/stun
if(emagged)
projectile = /obj/item/projectile/beam
playsound(loc, emagged ? 'sound/weapons/Laser.ogg' : 'sound/weapons/Taser.ogg', 50, 1)
var/obj/item/projectile/P = new projectile(loc)
P.original = A
P.starting = T
P.current = T
P.yo = U.y - T.y
P.xo = U.x - T.x
spawn()
P.process()
return
// Assembly
/obj/item/weapon/secbot_assembly/ed209_assembly
name = "ED-209 assembly"
desc = "Some sort of bizarre assembly."
icon = 'icons/obj/aibots.dmi'
icon_state = "ed209_frame"
item_state = "ed209_frame"
created_name = "ED-209 Security Robot"
var/lasercolor = ""
/obj/item/weapon/secbot_assembly/ed209_assembly/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
..()
if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)
return
created_name = t
return
switch(build_step)
if(0, 1)
if(istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg))
user.drop_item()
qdel(W)
build_step++
user << "<span class='notice'>You add the robot leg to [src].</span>"
name = "legs/frame assembly"
if(build_step == 1)
item_state = "ed209_leg"
icon_state = "ed209_leg"
else
item_state = "ed209_legs"
icon_state = "ed209_legs"
if(2)
if(istype(W, /obj/item/clothing/suit/storage/vest))
user.drop_item()
qdel(W)
build_step++
user << "<span class='notice'>You add the armor to [src].</span>"
name = "vest/legs/frame assembly"
item_state = "ed209_shell"
icon_state = "ed209_shell"
if(3)
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user))
build_step++
name = "shielded frame assembly"
user << "<span class='notice'>You welded the vest to [src].</span>"
if(4)
if(istype(W, /obj/item/clothing/head/helmet))
user.drop_item()
qdel(W)
build_step++
user << "<span class='notice'>You add the helmet to [src].</span>"
name = "covered and shielded frame assembly"
item_state = "ed209_hat"
icon_state = "ed209_hat"
if(5)
if(isprox(W))
user.drop_item()
qdel(W)
build_step++
user << "<span class='notice'>You add the prox sensor to [src].</span>"
name = "covered, shielded and sensored frame assembly"
item_state = "ed209_prox"
icon_state = "ed209_prox"
if(6)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if (C.get_amount() < 1)
user << "<span class='warning'>You need one coil of wire to wire [src].</span>"
return
user << "<span class='notice'>You start to wire [src].</span>"
if(do_after(user, 40) && build_step == 6)
if(C.use(1))
build_step++
user << "<span class='notice'>You wire the ED-209 assembly.</span>"
name = "wired ED-209 assembly"
return
if(7)
if(istype(W, /obj/item/weapon/gun/energy/taser))
name = "taser ED-209 assembly"
build_step++
user << "<span class='notice'>You add [W] to [src].</span>"
item_state = "ed209_taser"
icon_state = "ed209_taser"
user.drop_item()
qdel(W)
if(8)
if(istype(W, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
var/turf/T = get_turf(user)
user << "<span class='notice'>Now attaching the gun to the frame...</span>"
sleep(40)
if(get_turf(user) == T && build_step == 8)
build_step++
name = "armed [name]"
user << "<span class='notice'>Taser gun attached.</span>"
if(9)
if(istype(W, /obj/item/weapon/cell))
build_step++
user << "<span class='notice'>You complete the ED-209.</span>"
var/turf/T = get_turf(src)
new /mob/living/bot/secbot/ed209(T,created_name,lasercolor)
user.drop_item()
qdel(W)
user.drop_from_inventory(src)
qdel(src)

View File

@@ -0,0 +1,359 @@
#define FARMBOT_COLLECT 1
#define FARMBOT_WATER 2
#define FARMBOT_UPROOT 3
#define FARMBOT_NUTRIMENT 4
/mob/living/bot/farmbot
name = "Farmbot"
desc = "The botanist's best friend."
icon = 'icons/obj/aibots.dmi'
icon_state = "farmbot0"
health = 50
maxHealth = 50
req_access = list(access_hydroponics)
var/action = "" // Used to update icon
var/waters_trays = 1
var/refills_water = 1
var/uproots_weeds = 1
var/replaces_nutriment = 0
var/collects_produce = 0
var/removes_dead = 0
var/obj/structure/reagent_dispensers/watertank/tank
var/attacking = 0
var/list/path = list()
var/atom/target
var/frustration = 0
/mob/living/bot/farmbot/New()
..()
spawn(5)
tank = locate() in contents
if(!tank)
tank = new /obj/structure/reagent_dispensers/watertank(src)
/mob/living/bot/farmbot/attack_hand(var/mob/user as mob)
. = ..()
if(.)
return
var/dat = ""
dat += "<TT><B>Automatic Hyrdoponic Assisting Unit v1.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A><BR>"
dat += "Water Tank: "
if (tank)
dat += "[tank.reagents.total_volume]/[tank.reagents.maximum_volume]"
else
dat += "Error: Watertank not found"
dat += "<br>Behaviour controls are [locked ? "locked" : "unlocked"]<hr>"
if(!locked)
dat += "<TT>Watering controls:<br>"
dat += "Water plants : <A href='?src=\ref[src];water=1'>[waters_trays ? "Yes" : "No"]</A><BR>"
dat += "Refill watertank : <A href='?src=\ref[src];refill=1'>[refills_water ? "Yes" : "No"]</A><BR>"
dat += "<br>Weeding controls:<br>"
dat += "Weed plants: <A href='?src=\ref[src];weed=1'>[uproots_weeds ? "Yes" : "No"]</A><BR>"
dat += "<br>Nutriment controls:<br>"
dat += "Replace fertilizer: <A href='?src=\ref[src];replacenutri=1'>[replaces_nutriment ? "Yes" : "No"]</A><BR>"
dat += "<br>Plant controls:<br>"
dat += "Collect produce: <A href='?src=\ref[src];collect=1'>[collects_produce ? "Yes" : "No"]</A><BR>"
dat += "Remove dead plants: <A href='?src=\ref[src];removedead=1'>[removes_dead ? "Yes" : "No"]</A><BR>"
dat += "</TT>"
user << browse("<HEAD><TITLE>Farmbot v1.0 controls</TITLE></HEAD>[dat]", "window=autofarm")
onclose(user, "autofarm")
return
/mob/living/bot/farmbot/Emag(var/mob/user)
..()
if(user)
user << "<span class='notice'>You short out [src]'s plant identifier circuits.</span>"
spawn(rand(30, 50))
visible_message("<span class='warning'>[src] buzzes oddly.</span>")
emagged = 1
/mob/living/bot/farmbot/Topic(href, href_list)
if(..())
return
usr.machine = src
add_fingerprint(usr)
if((href_list["power"]) && (access_scanner.allowed(usr)))
if(on)
turn_off()
else
turn_on()
if(locked)
return
if(href_list["water"])
waters_trays = !waters_trays
else if(href_list["refill"])
refills_water = !refills_water
else if(href_list["weed"])
uproots_weeds = !uproots_weeds
else if(href_list["replacenutri"])
replaces_nutriment = !replaces_nutriment
else if(href_list["collect"])
collects_produce = !collects_produce
else if(href_list["removedead"])
removes_dead = !removes_dead
attack_hand(usr)
return
/mob/living/bot/farmbot/update_icons()
if(on && action)
icon_state = "farmbot_[action]"
else
icon_state = "farmbot[on]"
/mob/living/bot/farmbot/Life()
..()
if(!on)
return
if(emagged && prob(1))
flick("farmbot_broke", src)
if(client)
return
if(target)
if(Adjacent(target))
UnarmedAttack(target)
path = list()
target = null
else
if(path.len && frustration < 5)
if(path[1] == loc)
path -= path[1]
var/t = step_towards(src, path[1])
if(t)
path -= path[1]
else
++frustration
else
path = list()
target = null
else
if(emagged)
for(var/mob/living/carbon/human/H in view(7, src))
target = H
break
else
for(var/obj/machinery/portable_atmospherics/hydroponics/tray in view(7, src))
if(process_tray(tray))
target = tray
frustration = 0
break
if(!target && refills_water && tank && tank.reagents.total_volume < tank.reagents.maximum_volume)
for(var/obj/structure/sink/source in view(7, src))
target = source
frustration = 0
break
if(target)
var/t = get_dir(target, src) // Turf with the tray is impassable, so a* can't navigate directly to it
path = AStar(loc, get_step(target, t), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30, id = botcard)
if(!path)
path = list()
/mob/living/bot/farmbot/UnarmedAttack(var/atom/A, var/proximity)
if(!..())
return
if(attacking)
return
if(istype(A, /obj/machinery/portable_atmospherics/hydroponics))
var/obj/machinery/portable_atmospherics/hydroponics/T = A
var/t = process_tray(T)
switch(t)
if(0)
return
if(FARMBOT_COLLECT)
action = "water" // Needs a better one
update_icons()
visible_message("<span class='notice'>[src] starts [T.dead? "removing the plant from" : "harvesting"] \the [A].</span>")
attacking = 1
if(do_after(src, 30))
visible_message("<span class='notice'>[src] [T.dead? "removes the plant from" : "harvests"] \the [A].</span>")
T.attack_hand(src)
if(FARMBOT_WATER)
action = "water"
update_icons()
visible_message("<span class='notice'>[src] starts watering \the [A].</span>")
attacking = 1
if(do_after(src, 30))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
visible_message("<span class='notice'>[src] waters \the [A].</span>")
tank.reagents.trans_to(T, 100 - T.waterlevel)
if(FARMBOT_UPROOT)
action = "hoe"
update_icons()
visible_message("<span class='notice'>[src] starts uprooting the weeds in \the [A].</span>")
attacking = 1
if(do_after(src, 30))
visible_message("<span class='notice'>[src] uproots the weeds in \the [A].</span>")
T.weedlevel = 0
if(FARMBOT_NUTRIMENT)
action = "fertile"
update_icons()
visible_message("<span class='notice'>[src] starts fertilizing \the [A].</span>")
attacking = 1
if(do_after(src, 30))
visible_message("<span class='notice'>[src] waters \the [A].</span>")
T.reagents.add_reagent("ammonia", 10)
attacking = 0
action = ""
update_icons()
T.update_icon()
else if(istype(A, /obj/structure/sink))
if(!tank || tank.reagents.total_volume >= tank.reagents.maximum_volume)
return
action = "water"
update_icons()
visible_message("<span class='notice'>[src] starts refilling its tank from \the [A].</span>")
attacking = 1
while(do_after(src, 10) && tank.reagents.total_volume < tank.reagents.maximum_volume)
tank.reagents.add_reagent("water", 10)
if(prob(5))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
attacking = 0
action = ""
update_icons()
visible_message("<span class='notice'>[src] finishes refilling its tank.</span>")
else if(emagged && ishuman(A))
var/action = pick("weed", "water")
attacking = 1
spawn(50) // Some delay
attacking = 0
switch(action)
if("weed")
flick("farmbot_hoe", src)
if(prob(50))
visible_message("<span class='danger'>[src] swings wildly at [A] with a minihoe, missing completely!</span>")
return
var/t = pick("slashed", "sliced", "cut", "clawed")
A.attack_generic(src, 5, t)
if("water")
flick("farmbot_water", src)
visible_message("<span class='danger'>[src] splashes [A] with water!</span>") // That's it. RP effect.
/mob/living/bot/farmbot/explode()
visible_message("<span class='danger'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
new /obj/item/weapon/minihoe(Tsec)
new /obj/item/weapon/reagent_containers/glass/bucket(Tsec)
new /obj/item/device/assembly/prox_sensor(Tsec)
new /obj/item/device/analyzer/plant_analyzer(Tsec)
if(tank)
tank.loc = Tsec
if(prob(50))
new /obj/item/robot_parts/l_arm(Tsec)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
qdel(src)
return
/mob/living/bot/farmbot/proc/process_tray(var/obj/machinery/portable_atmospherics/hydroponics/tray)
if(!tray || !istype(tray))
return 0
if(tray.closed_system || !tray.seed)
return 0
if(tray.dead && removes_dead || tray.harvest && collects_produce)
return FARMBOT_COLLECT
else if(refills_water && tray.waterlevel < 40 && !tray.reagents.has_reagent("water"))
return FARMBOT_WATER
else if(uproots_weeds && tray.weedlevel > 3)
return FARMBOT_UPROOT
else if(replaces_nutriment && tray.nutrilevel < 1 && tray.reagents.total_volume < 1)
return FARMBOT_NUTRIMENT
return 0
// Assembly
/obj/item/weapon/farmbot_arm_assembly
name = "water tank/robot arm assembly"
desc = "A water tank with a robot arm permanently grafted to it."
icon = 'icons/obj/aibots.dmi'
icon_state = "water_arm"
var/build_step = 0
var/created_name = "Farmbot"
w_class = 3.0
New()
..()
spawn(4) // If an admin spawned it, it won't have a watertank it, so lets make one for em!
var tank = locate(/obj/structure/reagent_dispensers/watertank) in contents
if(!tank)
new /obj/structure/reagent_dispensers/watertank(src)
/obj/structure/reagent_dispensers/watertank/attackby(var/obj/item/robot_parts/S, mob/user as mob)
if ((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm)))
..()
return
var/obj/item/weapon/farmbot_arm_assembly/A = new /obj/item/weapon/farmbot_arm_assembly(loc)
user << "You add the robot arm to [src]."
loc = A //Place the water tank into the assembly, it will be needed for the finished bot
user.drop_from_inventory(S)
qdel(S)
/obj/item/weapon/farmbot_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if((istype(W, /obj/item/device/analyzer/plant_analyzer)) && (build_step == 0))
build_step++
user << "You add the plant analyzer to [src]."
name = "farmbot assembly"
user.remove_from_mob(W)
qdel(W)
else if((istype(W, /obj/item/weapon/reagent_containers/glass/bucket)) && (build_step == 1))
build_step++
user << "You add a bucket to [src]."
name = "farmbot assembly with bucket"
user.remove_from_mob(W)
qdel(W)
else if((istype(W, /obj/item/weapon/minihoe)) && (build_step == 2))
build_step++
user << "You add a minihoe to [src]."
name = "farmbot assembly with bucket and minihoe"
user.remove_from_mob(W)
qdel(W)
else if((isprox(W)) && (build_step == 3))
build_step++
user << "You complete the Farmbot! Beep boop."
var/mob/living/bot/farmbot/S = new /mob/living/bot/farmbot(get_turf(src))
for(var/obj/structure/reagent_dispensers/watertank/wTank in contents)
wTank.loc = S
S.tank = wTank
S.name = created_name
user.remove_from_mob(W)
qdel(W)
qdel(src)
else if(istype(W, /obj/item/weapon/pen))
var/t = input(user, "Enter new robot name", name, created_name) as text
t = sanitize(t, MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && loc != usr)
return
created_name = t
/obj/item/weapon/farmbot_arm_assembly/attack_hand(mob/user as mob)
return //it's a converted watertank, no you cannot pick it up and put it in your backpack

View File

@@ -0,0 +1,365 @@
/mob/living/bot/floorbot
name = "Floorbot"
desc = "A little floor repairing robot, he looks so excited!"
icon_state = "floorbot0"
req_access = list(access_construction)
var/amount = 10 // 1 for tile, 2 for lattice
var/maxAmount = 60
var/tilemake = 0 // When it reaches 100, bot makes a tile
var/repairing = 0
var/improvefloors = 0
var/eattiles = 0
var/maketiles = 0
var/targetdirection = null
var/list/path = list()
var/list/ignorelist = list()
var/turf/target
/mob/living/bot/floorbot/update_icons()
if(repairing)
icon_state = "floorbot-c"
else if(amount > 0)
icon_state = "floorbot[on]"
else
icon_state = "floorbot[on]e"
/mob/living/bot/floorbot/attack_hand(var/mob/user)
user.set_machine(src)
var/dat
dat += "<TT><B>Automatic Station Floor Repairer v1.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];operation=start'>[src.on ? "On" : "Off"]</A><BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]<BR>"
//dat += "Tiles left: [amount]<BR>"
dat += "Behvaiour controls are [locked ? "locked" : "unlocked"]<BR>"
if(!locked || issilicon(user))
dat += "Improves floors: <A href='?src=\ref[src];operation=improve'>[improvefloors ? "Yes" : "No"]</A><BR>"
dat += "Finds tiles: <A href='?src=\ref[src];operation=tiles'>[eattiles ? "Yes" : "No"]</A><BR>"
dat += "Make singles pieces of metal into tiles when empty: <A href='?src=\ref[src];operation=make'>[maketiles ? "Yes" : "No"]</A><BR>"
var/bmode
if(targetdirection)
bmode = dir2text(targetdirection)
else
bmode = "Disabled"
dat += "<BR><BR>Bridge Mode : <A href='?src=\ref[src];operation=bridgemode'>[bmode]</A><BR>"
user << browse("<HEAD><TITLE>Repairbot v1.0 controls</TITLE></HEAD>[dat]", "window=autorepair")
onclose(user, "autorepair")
return
/mob/living/bot/floorbot/Emag(var/mob/user)
..()
emagged = 1
if(user)
user << "<span class='notice'>The [src] buzzes and beeps.</span>"
/mob/living/bot/floorbot/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
add_fingerprint(usr)
switch(href_list["operation"])
if("start")
if (on)
turn_off()
else
turn_on()
if("improve")
improvefloors = !improvefloors
if("tiles")
eattiles = !eattiles
if("make")
maketiles = !maketiles
if("bridgemode")
switch(targetdirection)
if(null)
targetdirection = 1
if(1)
targetdirection = 2
if(2)
targetdirection = 4
if(4)
targetdirection = 8
if(8)
targetdirection = null
else
targetdirection = null
attack_hand(usr)
/mob/living/bot/floorbot/turn_off()
..()
target = null
path = list()
ignorelist = list()
/mob/living/bot/floorbot/Life()
..()
if(!on)
return
++tilemake
if(tilemake >= 100)
tilemake = 0
addTiles(1)
if(client)
return
if(prob(5))
custom_emote(2, "makes an excited booping beeping sound!")
if(ignorelist.len) // Don't stick forever
for(var/T in ignorelist)
if(prob(1))
ignorelist -= T
if(amount && !emagged)
if(!target && targetdirection) // Building a bridge
var/turf/T = get_step(src, targetdirection)
while(T in range(src))
if(istype(T, /turf/space))
target = T
break
T = get_step(T, targetdirection)
if(!target) // Fixing floors
for(var/turf/T in view(src))
if(T.loc.name == "Space")
continue
if(T in ignorelist)
continue
if(istype(T, /turf/space))
if(get_turf(T) == loc || prob(40)) // So they target the same tile all the time
target = T
if(improvefloors && istype(T, /turf/simulated/floor))
var/turf/simulated/floor/F = T
if(!F.floor_type && (get_turf(T) == loc || prob(40)))
target = T
if(emagged) // Time to griff
for(var/turf/simulated/floor/D in view(src))
if(D.loc.name == "Space")
continue
if(D in ignorelist)
continue
target = D
break
if(!target && amount < maxAmount && eattiles || maketiles) // Eat tiles
if(eattiles)
for(var/obj/item/stack/tile/plasteel/T in view(src))
if(T in ignorelist)
continue
target = T
break
if(maketiles && !target)
for(var/obj/item/stack/sheet/metal/T in view(src))
if(T in ignorelist)
continue
target = T
break
if(target && get_turf(target) == loc)
UnarmedAttack(target)
if(target && get_turf(target) != loc && !path.len)
spawn(0)
path = AStar(loc, get_turf(target), /turf/proc/AdjacentTurfsSpace, /turf/proc/Distance, 0, 30, id = botcard)
if(!path)
path = list()
ignorelist += target
target = null
if(path.len)
step_to(src, path[1])
path -= path[1]
/mob/living/bot/floorbot/UnarmedAttack(var/atom/A, var/proximity)
if(!..())
return
if(repairing)
return
if(get_turf(A) != loc)
return
if(emagged && istype(A, /turf/simulated/floor))
var/turf/simulated/floor/F = A
repairing = 1
update_icons()
if(F.is_plating())
visible_message("<span class='warning'>[src] begins to tear the floor tile from the floor!</span>")
if(do_after(src, 50))
F.break_tile_to_plating()
addTiles(1)
else
visible_message("<span class='danger'>[src] begins to tear through the floor!</span>")
if(do_after(src, 150)) // Extra time because this can and will kill.
F.ReplaceWithLattice()
addTiles(1)
target = null
repairing = 0
update_icons()
else if(istype(A, /turf/space))
var/building = 2
if(locate(/obj/structure/lattice, A))
building = 1
if(amount < building)
return
repairing = 1
update_icons()
visible_message("<span class='notice'>[src] begins to repair the hole.</span>")
if(do_after(src, 50))
if(A && (locate(/obj/structure/lattice, A) && building == 1 || !locate(/obj/structure/lattice, A) && building == 2)) // Make sure that it still needs repairs
var/obj/item/I
if(building == 1)
I = new /obj/item/stack/tile/plasteel(src)
else
I = new /obj/item/stack/rods(src)
A.attackby(I, src)
target = null
repairing = 0
update_icons()
else if(istype(A, /turf/simulated/floor))
var/turf/simulated/floor/F = A
if(!F.floor_type && amount)
repairing = 1
update_icons()
visible_message("<span class='notice'>[src] begins to improve the floor.</span>")
if(do_after(src, 50))
if(!F.floor_type)
var/obj/item/stack/tile/plasteel/T = new /obj/item/stack/tile/plasteel(src)
F.attackby(T, src)
addTiles(-1)
target = null
repairing = 0
update_icons()
else if(istype(A, /obj/item/stack/tile/plasteel) && amount < maxAmount)
var/obj/item/stack/tile/plasteel/T = A
visible_message("<span class='notice'>[src] begins to collect tiles.</span>")
repairing = 1
update_icons()
if(do_after(src, 20))
if(T)
var/eaten = min(maxAmount - amount, T.get_amount())
T.use(eaten)
addTiles(eaten)
target = null
repairing = 0
update_icons()
else if(istype(A, /obj/item/stack/sheet/metal) && amount + 3 < maxAmount)
var/obj/item/stack/sheet/metal/M = A
visible_message("<span class='notice'>[src] begins to make tiles.</span>")
repairing = 1
update_icons()
if(do_after(50))
if(M)
M.use(1)
addTiles(4)
/mob/living/bot/floorbot/explode()
turn_off()
visible_message("<span class='danger'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
var/obj/item/weapon/storage/toolbox/mechanical/N = new /obj/item/weapon/storage/toolbox/mechanical(Tsec)
N.contents = list()
new /obj/item/device/assembly/prox_sensor(Tsec)
if(prob(50))
new /obj/item/robot_parts/l_arm(Tsec)
var/obj/item/stack/tile/plasteel/T = new /obj/item/stack/tile/plasteel(Tsec)
T.amount = amount
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
qdel(src)
/mob/living/bot/floorbot/proc/addTiles(var/am)
amount += am
if(amount < 0)
amount = 0
else if(amount > maxAmount)
amount = maxAmount
/* Assembly */
/obj/item/weapon/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/plasteel/T, mob/user as mob)
if(!istype(T, /obj/item/stack/tile/plasteel))
..()
return
if(contents.len >= 1)
user << "<span class='notice'>They wont fit in as there is already stuff inside.</span>"
return
if(user.s_active)
user.s_active.close(user)
if(T.use(10))
var/obj/item/weapon/toolbox_tiles/B = new /obj/item/weapon/toolbox_tiles
user.put_in_hands(B)
user << "<span class='notice'>You add the tiles into the empty toolbox. They protrude from the top.</span>"
user.drop_from_inventory(src)
qdel(src)
else
user << "<span class='warning'>You need 10 floor tiles for a floorbot.</span>"
return
/obj/item/weapon/toolbox_tiles
desc = "It's a toolbox with tiles sticking out the top"
name = "tiles and toolbox"
icon = 'icons/obj/aibots.dmi'
icon_state = "toolbox_tiles"
force = 3.0
throwforce = 10.0
throw_speed = 2
throw_range = 5
w_class = 3.0
var/created_name = "Floorbot"
/obj/item/weapon/toolbox_tiles/attackby(var/obj/item/W, mob/user as mob)
..()
if(isprox(W))
qdel(W)
var/obj/item/weapon/toolbox_tiles_sensor/B = new /obj/item/weapon/toolbox_tiles_sensor()
B.created_name = created_name
user.put_in_hands(B)
user << "<span class='notice'>You add the sensor to the toolbox and tiles!</span>"
user.drop_from_inventory(src)
qdel(src)
else if (istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, user) && loc != user)
return
created_name = t
/obj/item/weapon/toolbox_tiles_sensor
desc = "It's a toolbox with tiles sticking out the top and a sensor attached"
name = "tiles, toolbox and sensor arrangement"
icon = 'icons/obj/aibots.dmi'
icon_state = "toolbox_tiles_sensor"
force = 3.0
throwforce = 10.0
throw_speed = 2
throw_range = 5
w_class = 3.0
var/created_name = "Floorbot"
/obj/item/weapon/toolbox_tiles_sensor/attackby(var/obj/item/W, mob/user as mob)
..()
if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
qdel(W)
var/turf/T = get_turf(user.loc)
var/mob/living/bot/floorbot/A = new /mob/living/bot/floorbot(T)
A.name = created_name
user << "<span class='notice'>You add the robot arm to the odd looking toolbox assembly! Boop beep!</span>"
user.drop_from_inventory(src)
qdel(src)
else if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, user) && loc != user)
return
created_name = t

View File

@@ -0,0 +1,364 @@
/mob/living/bot/medbot
name = "Medbot"
desc = "A little medical robot. He looks somewhat underwhelmed."
icon_state = "medibot0"
req_access = list(access_medical)
var/skin = null //Set to "tox", "ointment" or "o2" for the other two firstaid kits.
botcard_access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics)
//AI vars
var/frustration = 0
var/list/path = list()
var/mob/living/carbon/human/patient = null
var/mob/ignored = list() // Used by emag
var/last_newpatient_speak = 0
var/vocal = 1
//Healing vars
var/obj/item/weapon/reagent_containers/glass/reagent_glass = null //Can be set to draw from this for reagents.
var/currently_healing = 0
var/injection_amount = 15 //How much reagent do we inject at a time?
var/heal_threshold = 10 //Start healing when they have this much damage in a category
var/use_beaker = 0 //Use reagents in beaker instead of default treatment agents.
var/treatment_brute = "tricordrazine"
var/treatment_oxy = "tricordrazine"
var/treatment_fire = "tricordrazine"
var/treatment_tox = "tricordrazine"
var/treatment_virus = "spaceacillin"
var/treatment_emag = "toxin"
var/declare_treatment = 0 //When attempting to treat a patient, should it notify everyone wearing medhuds?
/mob/living/bot/medbot/Life()
..()
if(!on)
return
if(!client)
if(vocal && prob(1))
var/message = pick("Radar, put a mask on!", "There's always a catch, and it's the best there is.", "I knew it, I should've been a plastic surgeon.", "What kind of medbay is this? Everyone's dropping like dead flies.", "Delicious!")
say(message)
if(patient)
if(Adjacent(patient))
if(!currently_healing)
UnarmedAttack(patient)
else
if(path.len && (get_dist(patient, path[path.len]) > 2)) // We have a path, but it's off
path = list()
if(!path.len && (get_dist(src, patient) > 1))
spawn(0)
path = AStar(loc, get_turf(patient), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30, id = botcard)
if(!path)
path = list()
if(path.len)
step_to(src, path[1])
path -= path[1]
++frustration
if(get_dist(src, patient) > 7 || frustration > 8)
patient = null
else
for(var/mob/living/carbon/human/H in view(7, src)) // Time to find a patient!
if(valid_healing_target(H))
patient = H
frustration = 0
if(last_newpatient_speak + 300 < world.time)
var/message = pick("Hey, [H.name]! Hold on, I'm coming.", "Wait [H.name]! I want to help!", "[H.name], you appear to be injured!")
say(message)
custom_emote(1, "points at [H.name].")
last_newpatient_speak = world.time
break
/mob/living/bot/medbot/UnarmedAttack(var/mob/living/carbon/human/H, var/proximity)
if(!..())
return
if(!on)
return
if(!istype(H))
return
if(H.stat == DEAD)
var/death_message = pick("No! NO!", "Live, damnit! LIVE!", "I... I've never lost a patient before. Not today, I mean.")
say(death_message)
patient = null
return
var/t = valid_healing_target(H)
if(!t)
var/message = pick("All patched up!", "An apple a day keeps me away.", "Feel better soon!")
say(message)
patient = null
return
icon_state = "medibots"
visible_message("<span class='warning'>[src] is trying to inject [H]!</span>")
if(declare_treatment)
var/area/location = get_area(src)
broadcast_medical_hud_message("[src] is treating <b>[H]</b> in <b>[location]</b>", src)
currently_healing = 1
update_icons()
if(do_mob(src, H, 30))
if(t == 1)
reagent_glass.reagents.trans_to_mob(H, injection_amount, CHEM_BLOOD)
else
H.reagents.add_reagent(t, injection_amount)
visible_message("<span class='warning'>[src] injects [H] with the syringe!</span>")
currently_healing = 0
update_icons()
/mob/living/bot/medbot/update_icons()
overlays.Cut()
if(skin)
overlays += image('icons/obj/aibots.dmi', "medskin_[skin]")
if(currently_healing)
icon_state = "medibots"
else
icon_state = "medibot[on]"
/mob/living/bot/medbot/attack_hand(var/mob/user)
var/dat
dat += "<TT><B>Automatic Medical Unit v1.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A><BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]<BR>"
dat += "Beaker: "
if (reagent_glass)
dat += "<A href='?src=\ref[src];eject=1'>Loaded \[[reagent_glass.reagents.total_volume]/[reagent_glass.reagents.maximum_volume]\]</a>"
else
dat += "None Loaded"
dat += "<br>Behaviour controls are [locked ? "locked" : "unlocked"]<hr>"
if(!locked || issilicon(user))
dat += "<TT>Healing Threshold: "
dat += "<a href='?src=\ref[src];adj_threshold=-10'>--</a> "
dat += "<a href='?src=\ref[src];adj_threshold=-5'>-</a> "
dat += "[heal_threshold] "
dat += "<a href='?src=\ref[src];adj_threshold=5'>+</a> "
dat += "<a href='?src=\ref[src];adj_threshold=10'>++</a>"
dat += "</TT><br>"
dat += "<TT>Injection Level: "
dat += "<a href='?src=\ref[src];adj_inject=-5'>-</a> "
dat += "[injection_amount] "
dat += "<a href='?src=\ref[src];adj_inject=5'>+</a> "
dat += "</TT><br>"
dat += "Reagent Source: "
dat += "<a href='?src=\ref[src];use_beaker=1'>[use_beaker ? "Loaded Beaker (When available)" : "Internal Synthesizer"]</a><br>"
dat += "Treatment report is [declare_treatment ? "on" : "off"]. <a href='?src=\ref[src];declaretreatment=[1]'>Toggle</a><br>"
dat += "The speaker switch is [vocal ? "on" : "off"]. <a href='?src=\ref[src];togglevoice=[1]'>Toggle</a><br>"
user << browse("<HEAD><TITLE>Medibot v1.0 controls</TITLE></HEAD>[dat]", "window=automed")
onclose(user, "automed")
return
/mob/living/bot/medbot/attackby(var/obj/item/O, var/mob/user)
if(istype(O, /obj/item/weapon/reagent_containers/glass))
if(locked)
user << "<span class='notice'>You cannot insert a beaker because the panel is locked.</span>"
return
if(!isnull(reagent_glass))
user << "<span class='notice'>There is already a beaker loaded.</span>"
return
user.drop_item()
O.loc = src
reagent_glass = O
user << "<span class='notice'>You insert [O].</span>"
return
else
..()
/mob/living/bot/medbot/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
add_fingerprint(usr)
if ((href_list["power"]) && access_scanner.allowed(usr))
if (on)
turn_off()
else
turn_on()
else if((href_list["adj_threshold"]) && (!locked || issilicon(usr)))
var/adjust_num = text2num(href_list["adj_threshold"])
heal_threshold += adjust_num
if(heal_threshold < 5)
heal_threshold = 5
if(heal_threshold > 75)
heal_threshold = 75
else if((href_list["adj_inject"]) && (!locked || issilicon(usr)))
var/adjust_num = text2num(href_list["adj_inject"])
injection_amount += adjust_num
if(injection_amount < 5)
injection_amount = 5
if(injection_amount > 15)
injection_amount = 15
else if((href_list["use_beaker"]) && (!locked || issilicon(usr)))
use_beaker = !use_beaker
else if (href_list["eject"] && (!isnull(reagent_glass)))
if(!locked)
reagent_glass.loc = get_turf(src)
reagent_glass = null
else
usr << "<span class='notice'>You cannot eject the beaker because the panel is locked.</span>"
else if ((href_list["togglevoice"]) && (!locked || issilicon(usr)))
vocal = !vocal
else if ((href_list["declaretreatment"]) && (!locked || issilicon(usr)))
declare_treatment = !declare_treatment
attack_hand(usr)
return
/mob/living/bot/medbot/Emag(var/mob/user)
..()
if(!emagged)
if(user)
user << "<span class='warning'>You short out [src]'s reagent synthesis circuits.</span>"
visible_message("<span class='warning'>[src] buzzes oddly!</span>")
flick("medibot_spark", src)
patient = null
currently_healing = 0
emagged = 1
on = 1
update_icons()
ignored |= user
/mob/living/bot/medbot/explode()
on = 0
visible_message("<span class='danger'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
new /obj/item/weapon/storage/firstaid(Tsec)
new /obj/item/device/assembly/prox_sensor(Tsec)
new /obj/item/device/healthanalyzer(Tsec)
if (prob(50))
new /obj/item/robot_parts/l_arm(Tsec)
if(reagent_glass)
reagent_glass.loc = Tsec
reagent_glass = null
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
qdel(src)
return
/mob/living/bot/medbot/proc/valid_healing_target(var/mob/living/carbon/human/H)
if(H.stat == DEAD) // He's dead, Jim
return null
if(H.suiciding)
return null
if(H in ignored)
return null
if(emagged)
return treatment_emag
// If they're injured, we're using a beaker, and they don't have on of the chems in the beaker
if(reagent_glass && use_beaker && ((H.getBruteLoss() >= heal_threshold) || (H.getToxLoss() >= heal_threshold) || (H.getToxLoss() >= heal_threshold) || (H.getOxyLoss() >= (heal_threshold + 15))))
for(var/datum/reagent/R in reagent_glass.reagents.reagent_list)
if(!H.reagents.has_reagent(R))
return 1
continue
if((H.getBruteLoss() >= heal_threshold) && (!H.reagents.has_reagent(treatment_brute)))
return treatment_brute //If they're already medicated don't bother!
if((H.getOxyLoss() >= (15 + heal_threshold)) && (!H.reagents.has_reagent(treatment_oxy)))
return treatment_oxy
if((H.getFireLoss() >= heal_threshold) && (!H.reagents.has_reagent(treatment_fire)))
return treatment_fire
if((H.getToxLoss() >= heal_threshold) && (!H.reagents.has_reagent(treatment_tox)))
return treatment_tox
for(var/datum/disease/D in H.viruses)
if (!H.reagents.has_reagent(treatment_virus))
return treatment_virus // STOP DISEASE FOREVER
/* Construction */
/obj/item/weapon/storage/firstaid/attackby(var/obj/item/robot_parts/S, mob/user as mob)
if ((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm)))
..()
return
if(contents.len >= 1)
user << "<span class='notice'>You need to empty [src] out first.</span>"
return
var/obj/item/weapon/firstaid_arm_assembly/A = new /obj/item/weapon/firstaid_arm_assembly
if(istype(src, /obj/item/weapon/storage/firstaid/fire))
A.skin = "ointment"
else if(istype(src, /obj/item/weapon/storage/firstaid/toxin))
A.skin = "tox"
else if(istype(src, /obj/item/weapon/storage/firstaid/o2))
A.skin = "o2"
qdel(S)
user.put_in_hands(A)
user << "<span class='notice'>You add the robot arm to the first aid kit.</span>"
user.drop_from_inventory(src)
qdel(src)
/obj/item/weapon/firstaid_arm_assembly
name = "first aid/robot arm assembly"
desc = "A first aid kit with a robot arm permanently grafted to it."
icon = 'icons/obj/aibots.dmi'
icon_state = "firstaid_arm"
var/build_step = 0
var/created_name = "Medibot" //To preserve the name if it's a unique medbot I guess
var/skin = null //Same as medbot, set to tox or ointment for the respective kits.
w_class = 3.0
/obj/item/weapon/firstaid_arm_assembly/New()
..()
spawn(5) // Terrible. TODO: fix
if(skin)
overlays += image('icons/obj/aibots.dmi', "kit_skin_[src.skin]")
/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && loc != usr)
return
created_name = t
else
switch(build_step)
if(0)
if(istype(W, /obj/item/device/healthanalyzer))
user.drop_item()
qdel(W)
build_step++
user << "<span class='notice'>You add the health sensor to [src].</span>"
name = "First aid/robot arm/health analyzer assembly"
overlays += image('icons/obj/aibots.dmi', "na_scanner")
if(1)
if(isprox(W))
user.drop_item()
qdel(W)
user << "<span class='notice'>You complete the Medibot! Beep boop.</span>"
var/turf/T = get_turf(src)
var/mob/living/bot/medbot/S = new /mob/living/bot/medbot(T)
S.skin = skin
S.name = created_name
user.drop_from_inventory(src)
qdel(src)

View File

@@ -0,0 +1,579 @@
/mob/living/bot/secbot
name = "Securitron"
desc = "A little security robot. He looks less than thrilled."
icon_state = "secbot0"
maxHealth = 50
health = 50
req_access = list(access_security, access_forensics_lockers)
botcard_access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
var/mob/target
var/idcheck = 0 // If true, arrests for having weapons without authorization.
var/check_records = 0 // If true, arrests people without a record.
var/check_arrest = 1 // If true, arrests people who are set to arrest.
var/arrest_type = 0 // If true, doesn't handcuff. You monster.
var/declare_arrests = 0 // If true, announces arrests over sechuds.
var/auto_patrol = 0 // If true, patrols on its own
var/mode = 0
#define SECBOT_IDLE 0 // idle
#define SECBOT_HUNT 1 // found target, hunting
#define SECBOT_ARREST 2 // arresting target
#define SECBOT_START_PATROL 3 // start patrol
#define SECBOT_WAIT_PATROL 4 // waiting for signals
#define SECBOT_PATROL 5 // patrolling
#define SECBOT_SUMMON 6 // summoned by PDA
var/is_attacking = 0
var/is_ranged = 0
var/awaiting_surrender = 0
var/obj/secbot_listener/listener = null
var/beacon_freq = 1445 // Navigation beacon frequency
var/control_freq = AI_FREQ // Bot control frequency
var/list/path = list()
var/frustration = 0
var/turf/patrol_target = null // This is where we are headed
var/closest_dist // Used to find the closest beakon
var/destination = "__nearest__" // This is the current beacon's ID
var/next_destination = "__nearest__" // This is the next beacon's ID
var/nearest_beacon // Tag of the beakon that we assume to be the closest one
var/bot_version = 1.3
var/list/threat_found_sounds = new('sound/voice/bcriminal.ogg', 'sound/voice/bjustice.ogg', 'sound/voice/bfreeze.ogg')
var/list/preparing_arrest_sounds = new('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg')
/mob/living/bot/secbot/beepsky
name = "Officer Beepsky"
desc = "It's Officer Beep O'sky! Powered by a potato and a shot of whiskey."
auto_patrol = 1
/mob/living/bot/secbot/New()
..()
listener = new /obj/secbot_listener(src)
listener.secbot = src
spawn(5) // Since beepsky is made on the start... this delay is necessary
if(radio_controller)
radio_controller.add_object(listener, control_freq, filter = RADIO_SECBOT)
radio_controller.add_object(listener, beacon_freq, filter = RADIO_NAVBEACONS)
/mob/living/bot/secbot/turn_off()
..()
target = null
frustration = 0
mode = SECBOT_IDLE
/mob/living/bot/secbot/update_icons()
if(on && is_attacking)
icon_state = "secbot-c"
else
icon_state = "secbot[on]"
/mob/living/bot/secbot/attack_hand(var/mob/user)
user.set_machine(src)
var/dat
dat += "<TT><B>Automatic Security Unit v[bot_version]</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A><BR>"
dat += "Behaviour controls are [locked ? "locked" : "unlocked"]<BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]"
if(!locked || issilicon(user))
dat += "<BR>Check for Weapon Authorization: <A href='?src=\ref[src];operation=idcheck'>[idcheck ? "Yes" : "No"]</A><BR>"
dat += "Check Security Records: <A href='?src=\ref[src];operation=ignorerec'>[check_records ? "Yes" : "No"]</A><BR>"
dat += "Check Arrest Status: <A href='?src=\ref[src];operation=ignorearr'>[check_arrest ? "Yes" : "No"]</A><BR>"
dat += "Operating Mode: <A href='?src=\ref[src];operation=switchmode'>[arrest_type ? "Detain" : "Arrest"]</A><BR>"
dat += "Report Arrests: <A href='?src=\ref[src];operation=declarearrests'>[declare_arrests ? "Yes" : "No"]</A><BR>"
dat += "Auto Patrol: <A href='?src=\ref[src];operation=patrol'>[auto_patrol ? "On" : "Off"]</A>"
user << browse("<HEAD><TITLE>Securitron v[bot_version] controls</TITLE></HEAD>[dat]", "window=autosec")
onclose(user, "autosec")
return
/mob/living/bot/secbot/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
add_fingerprint(usr)
if((href_list["power"]) && (access_scanner.allowed(usr)))
if(on)
turn_off()
else
turn_on()
return
switch(href_list["operation"])
if("idcheck")
idcheck = !idcheck
if("ignorerec")
check_records = !check_records
if("ignorearr")
check_arrest = !check_arrest
if("switchmode")
arrest_type = !arrest_type
if("patrol")
auto_patrol = !auto_patrol
mode = SECBOT_IDLE
if("declarearrests")
declare_arrests = !declare_arrests
attack_hand(usr)
/mob/living/bot/secbot/attackby(var/obj/item/O, var/mob/user)
var/curhealth = health
..()
if(health < curhealth)
target = user
awaiting_surrender = 5
mode = SECBOT_HUNT
/mob/living/bot/secbot/Life()
..()
if(!on)
return
if(client)
return
if(!target)
scan_view()
if(!locked && (mode == SECBOT_START_PATROL || mode == SECBOT_PATROL)) // Stop running away when we set you up
mode = SECBOT_IDLE
switch(mode)
if(SECBOT_IDLE)
if(auto_patrol && locked)
mode = SECBOT_START_PATROL
return
if(SECBOT_HUNT) // Target is in the view or has been recently - chase it
if(frustration > 7)
target = null
frustration = 0
awaiting_surrender = 0
mode = SECBOT_IDLE
return
if(target)
var/threat = check_threat(target)
if(threat < 4) // Re-evaluate in case they dropped the weapon or something
target = null
frustration = 0
awaiting_surrender = 0
mode = SECBOT_IDLE
return
if(!(target in view(7, src)))
++frustration
if(Adjacent(target))
mode = SECBOT_ARREST
return
else
if(is_ranged)
RangedAttack(target)
else
step_towards(src, target) // Melee bots chase a bit faster
spawn(8)
if(!Adjacent(target))
step_towards(src, target)
spawn(16)
if(!Adjacent(target))
step_towards(src, target)
if(SECBOT_ARREST) // Target is next to us - attack it
if(!target)
mode = SECBOT_IDLE
if(!Adjacent(target))
awaiting_surrender = 5 // I'm done playing nice
mode = SECBOT_HUNT
var/threat = check_threat(target)
if(threat < 4)
target = null
awaiting_surrender = 0
frustration = 0
mode = SECBOT_IDLE
return
if(awaiting_surrender < 5 && ishuman(target) && !target.lying)
if(awaiting_surrender == 0)
say("Down on the floor, [target]! You have five seconds to comply.")
++awaiting_surrender
else
UnarmedAttack(target)
if(ishuman(target) && declare_arrests)
var/area/location = get_area(src)
broadcast_security_hud_message("[src] is [arrest_type ? "detaining" : "arresting"] a level [check_threat(target)] suspect <b>[target]</b> in <b>[location]</b>.", src)
return
if(SECBOT_START_PATROL)
if(path.len && patrol_target)
mode = SECBOT_PATROL
return
else if(patrol_target)
spawn(0)
calc_path()
if(!path.len)
patrol_target = null
mode = SECBOT_IDLE
else
mode = SECBOT_PATROL
if(!patrol_target)
if(next_destination)
find_next_target()
else
find_patrol_target()
say("Engaging patrol mode.")
mode = SECBOT_WAIT_PATROL
return
if(SECBOT_WAIT_PATROL)
if(patrol_target)
mode = SECBOT_START_PATROL
else
++frustration
if(frustration > 120)
frustration = 0
mode = SECBOT_IDLE
if(SECBOT_PATROL)
patrol_step()
spawn(10)
patrol_step()
return
if(SECBOT_SUMMON)
patrol_step()
spawn(8)
patrol_step()
spawn(16)
patrol_step()
return
/mob/living/bot/secbot/UnarmedAttack(var/mob/M, var/proximity)
if(!..())
return
if(!istype(M))
return
if(istype(M, /mob/living/carbon))
var/mob/living/carbon/C = M
var/cuff = 1
if(istype(C, /mob/living/carbon/human))
var/mob/living/carbon/human/H = C
if(istype(H.back, /obj/item/weapon/rig) && istype(H.gloves,/obj/item/clothing/gloves/rig))
cuff = 0
if(!C.lying || C.handcuffed || arrest_type)
cuff = 0
if(!cuff)
C.stun_effect_act(0, 60, null)
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
is_attacking = 1
update_icons()
spawn(2)
is_attacking = 0
update_icons()
visible_message("<span class='warning'>[C] was prodded by [src] with a stun baton!</span>")
else
playsound(loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
visible_message("<span class='warning'>[src] is trying to put handcuffs on [C]!</span>")
if(do_mob(src, C, 60))
if(!C.handcuffed)
C.handcuffed = new /obj/item/weapon/handcuffs(C)
C.update_inv_handcuffed()
if(preparing_arrest_sounds.len)
playsound(loc, pick(preparing_arrest_sounds), 50, 0)
else if(istype(M, /mob/living/simple_animal))
var/mob/living/simple_animal/S = M
S.AdjustStunned(10)
S.adjustBruteLoss(15)
playsound(loc, "swing_hit", 50, 1, -1)
is_attacking = 1
update_icons()
spawn(2)
is_attacking = 0
update_icons()
visible_message("<span class='warning'>[M] was beaten by [src] with a stun baton!</span>")
/mob/living/bot/secbot/explode()
visible_message("<span class='warning'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
var/obj/item/weapon/secbot_assembly/Sa = new /obj/item/weapon/secbot_assembly(Tsec)
Sa.build_step = 1
Sa.overlays += image('icons/obj/aibots.dmi', "hs_hole")
Sa.created_name = name
new /obj/item/device/assembly/prox_sensor(Tsec)
new /obj/item/weapon/melee/baton(Tsec)
if(prob(50))
new /obj/item/robot_parts/l_arm(Tsec)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
new /obj/effect/decal/cleanable/blood/oil(Tsec)
qdel(src)
/mob/living/bot/secbot/proc/scan_view()
for(var/mob/living/M in view(7, src))
if(M.invisibility >= INVISIBILITY_LEVEL_ONE)
continue
if(M.stat)
continue
var/threat = check_threat(M)
if(threat >= 4)
target = M
say("Level [threat] infraction alert!")
custom_emote(1, "points at [M.name]!")
mode = SECBOT_HUNT
break
return
/mob/living/bot/secbot/proc/calc_path(var/turf/avoid = null)
path = AStar(loc, patrol_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=avoid)
if(!path)
path = list()
/mob/living/bot/secbot/proc/check_threat(var/mob/living/M)
if(M.stat == DEAD)
return 0
if(emagged)
return 10
var/threatcount = 0
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.handcuffed)
return 0
var/obj/item/weapon/card/id/id = GetIdCard(H) //Agent cards lower threatlevel.
if(id && istype(id, /obj/item/weapon/card/id/syndicate))
threatcount -= 2
if(idcheck && !access_scanner.allowed(H))
if(istype(H.l_hand, /obj/item/weapon/gun) || istype(H.l_hand, /obj/item/weapon/melee))
threatcount += 4
if(istype(H.r_hand, /obj/item/weapon/gun) || istype(H.r_hand, /obj/item/weapon/melee))
threatcount += 4
if(istype(H.belt, /obj/item/weapon/gun) || istype(H.belt, /obj/item/weapon/melee))
threatcount += 2
if(H.species.name != "Human") //beepsky so racist.
threatcount += 2
if(check_records || check_arrest)
var/perpname = H.name
if(id)
perpname = id.registered_name
var/datum/data/record/R = find_security_record("name", perpname)
if(check_records && !R)
threatcount += 4
if(check_arrest && R && (R.fields["criminal"] == "*Arrest*"))
threatcount += 4
else if(isanimal(M))
if(istype(M, /mob/living/simple_animal/hostile) && !istype(M, /mob/living/simple_animal/hostile/retaliate/goat))
threatcount += 4
return threatcount
/mob/living/bot/secbot/proc/patrol_step()
if(loc == patrol_target)
patrol_target = null
path = list()
mode = SECBOT_IDLE
return
if(path.len && patrol_target)
var/turf/next = path[1]
if(loc == next)
path -= next
return
var/moved = step_towards(src, next)
if(moved)
path -= next
frustration = 0
else
++frustration
if(frustration > 5) // Make a new path
mode = SECBOT_START_PATROL
return
else
mode = SECBOT_START_PATROL
/mob/living/bot/secbot/proc/find_patrol_target()
send_status()
nearest_beacon = null
next_destination = "__nearest__"
listener.post_signal(beacon_freq, "findbeacon", "patrol")
/mob/living/bot/secbot/proc/find_next_target()
send_status()
nearest_beacon = null
listener.post_signal(beacon_freq, "findbeacon", "patrol")
/mob/living/bot/secbot/proc/send_status()
var/list/kv = list(
"type" = "secbot",
"name" = name,
"loca" = get_area(loc),
"mode" = mode
)
listener.post_signal_multiple(control_freq, kv)
/obj/secbot_listener
var/mob/living/bot/secbot/secbot = null
/obj/secbot_listener/proc/post_signal(var/freq, var/key, var/value) // send a radio signal with a single data key/value pair
post_signal_multiple(freq, list("[key]" = value))
/obj/secbot_listener/proc/post_signal_multiple(var/freq, var/list/keyval) // send a radio signal with multiple data key/values
var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq)
if(!frequency)
return
var/datum/signal/signal = new()
signal.source = secbot
signal.transmission_method = 1
signal.data = keyval.Copy()
if(signal.data["findbeacon"])
frequency.post_signal(secbot, signal, filter = RADIO_NAVBEACONS)
else if(signal.data["type"] == "secbot")
frequency.post_signal(secbot, signal, filter = RADIO_SECBOT)
else
frequency.post_signal(secbot, signal)
/obj/secbot_listener/receive_signal(datum/signal/signal)
if(!secbot || !secbot.on)
return
var/recv = signal.data["command"]
if(recv == "bot_status")
secbot.send_status()
return
if(signal.data["active"] == secbot)
switch(recv)
if("stop")
secbot.mode = SECBOT_IDLE
secbot.auto_patrol = 0
return
if("go")
secbot.mode = SECBOT_IDLE
secbot.auto_patrol = 1
return
if("summon")
secbot.patrol_target = signal.data["target"]
secbot.next_destination = secbot.destination
secbot.destination = null
//secbot.awaiting_beacon = 0
secbot.mode = SECBOT_SUMMON
secbot.calc_path()
secbot.say("Responding.")
return
recv = signal.data["beacon"]
var/valid = signal.data["patrol"]
if(!recv || !valid)
return
if(recv == secbot.next_destination) // This beacon is our target
secbot.destination = secbot.next_destination
secbot.patrol_target = signal.source.loc
secbot.next_destination = signal.data["next_patrol"]
else if(secbot.next_destination == "__nearest__")
var/dist = get_dist(secbot, signal.source.loc)
if(dist <= 1)
return
if(secbot.nearest_beacon)
if(dist < secbot.closest_dist)
secbot.nearest_beacon = recv
secbot.patrol_target = secbot.nearest_beacon
secbot.next_destination = signal.data["next_patrol"]
secbot.closest_dist = dist
return
else
secbot.nearest_beacon = recv
secbot.patrol_target = secbot.nearest_beacon
secbot.next_destination = signal.data["next_patrol"]
secbot.closest_dist = dist
//Secbot Construction
/obj/item/clothing/head/helmet/attackby(var/obj/item/device/assembly/signaler/S, mob/user as mob)
..()
if(!issignaler(S))
..()
return
if(type != /obj/item/clothing/head/helmet) //Eh, but we don't want people making secbots out of space helmets.
return
if(S.secured)
qdel(S)
var/obj/item/weapon/secbot_assembly/A = new /obj/item/weapon/secbot_assembly
user.put_in_hands(A)
user << "You add the signaler to the helmet."
user.drop_from_inventory(src)
qdel(src)
else
return
/obj/item/weapon/secbot_assembly
name = "helmet/signaler assembly"
desc = "Some sort of bizarre assembly."
icon = 'icons/obj/aibots.dmi'
icon_state = "helmet_signaler"
item_state = "helmet"
var/build_step = 0
var/created_name = "Securitron"
/obj/item/weapon/secbot_assembly/attackby(var/obj/item/O, var/mob/user)
..()
if(istype(O, /obj/item/weapon/weldingtool) && !build_step)
var/obj/item/weapon/weldingtool/WT = O
if(WT.remove_fuel(0, user))
build_step = 1
overlays += image('icons/obj/aibots.dmi', "hs_hole")
user << "You weld a hole in \the [src]."
else if(isprox(O) && (build_step == 1))
user.drop_item()
build_step = 2
user << "You add \the [O] to [src]."
overlays += image('icons/obj/aibots.dmi', "hs_eye")
name = "helmet/signaler/prox sensor assembly"
qdel(O)
else if((istype(O, /obj/item/robot_parts/l_arm) || istype(O, /obj/item/robot_parts/r_arm)) && build_step == 2)
user.drop_item()
build_step = 3
user << "You add \the [O] to [src]."
name = "helmet/signaler/prox sensor/robot arm assembly"
overlays += image('icons/obj/aibots.dmi', "hs_arm")
qdel(O)
else if(istype(O, /obj/item/weapon/melee/baton) && build_step == 3)
user.drop_item()
user << "You complete the Securitron! Beep boop."
var/mob/living/bot/secbot/S = new /mob/living/bot/secbot(get_turf(src))
S.name = created_name
qdel(O)
qdel(src)
else if(istype(O, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && loc != usr)
return
created_name = t

View File

@@ -13,7 +13,7 @@
if(istype(loc,/obj/item/weapon/holder/diona))
var/obj/item/weapon/holder/diona/L = loc
src.loc = L.loc
del(L)
qdel(L)
src.visible_message("\red [src] begins to shift and quiver, and erupts in a shower of shed bark as it splits into a tangle of nearly a dozen new dionaea.","\red You begin to shift and quiver, feeling your awareness splinter. All at once, we consume our stored nutrients to surge with growth, splitting into a tangle of at least a dozen new dionaea. We have attained our gestalt form.")
return "Diona"

View File

@@ -38,7 +38,7 @@
for(var/datum/language/L in languages)
adult.add_language(L.name)
del(src)
qdel(src)
/mob/living/carbon/alien/proc/update_progression()
if(amount_grown < max_grown)

View File

@@ -35,7 +35,6 @@
var/locked = 0
var/mob/living/carbon/brain/brainmob = null//The current occupant.
var/mob/living/silicon/robot = null//Appears unused.
var/obj/mecha = null//This does not appear to be used outside of reference in mecha.dm.
attackby(var/obj/item/O as obj, var/mob/user as mob)
@@ -61,7 +60,7 @@
living_mob_list += brainmob
user.drop_item()
del(O)
qdel(O)
name = "Man-Machine Interface: [brainmob.real_name]"
icon_state = "mmi_full"
@@ -115,6 +114,15 @@
locked = 1
return
/obj/item/device/mmi/Destroy()
if(isrobot(loc))
var/mob/living/silicon/robot/borg = loc
borg.mmi = null
if(brainmob)
qdel(brainmob)
brainmob = null
..()
/obj/item/device/mmi/radio_enabled
name = "radio-enabled man-machine interface"
desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity. This one comes with a built-in radio."

View File

@@ -15,7 +15,7 @@
R.my_atom = src
..()
Del()
Destroy()
if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting.
if(stat!=DEAD) //If not dead.
death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA

View File

@@ -2,6 +2,9 @@
name = "brain"
health = 400 //They need to live awhile longer than other organs.
desc = "A piece of juicy meat found in a person's head."
organ_tag = "brain"
parent_organ = "head"
vital = 1
icon_state = "brain2"
force = 1.0
w_class = 2.0
@@ -24,6 +27,12 @@
if(brainmob && brainmob.client)
brainmob.client.screen.len = null //clear the hud
/obj/item/organ/brain/Destroy()
if(brainmob)
qdel(brainmob)
brainmob = null
..()
/obj/item/organ/brain/proc/transfer_identity(var/mob/living/carbon/H)
name = "\the [H]'s [initial(src.name)]"
brainmob = new(src)
@@ -46,7 +55,7 @@
/obj/item/organ/brain/removed(var/mob/living/user)
..()
name = "[owner.real_name]'s brain"
var/mob/living/simple_animal/borer/borer = owner.has_brain_worms()
@@ -57,6 +66,8 @@
if(istype(B) && istype(owner))
B.transfer_identity(owner)
..()
/obj/item/organ/brain/replaced(var/mob/living/target)
if(target.key)

View File

@@ -7,8 +7,8 @@
/mob/living/carbon/brain/gib()
if(istype(container, /obj/item/device/mmi))
del(container)//Gets rid of the MMI if there is one
qdel(container)//Gets rid of the MMI if there is one
if(loc)
if(istype(loc,/obj/item/organ/brain))
del(loc)//Gets rid of the brain item
qdel(loc)//Gets rid of the brain item
..(null,1)

View File

@@ -3,6 +3,8 @@
if (silent)
return
message = sanitize(message)
if(!(container && istype(container, /obj/item/device/mmi)))
return //No MMI, can't speak, bucko./N
else

View File

@@ -17,6 +17,13 @@
if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level
germ_level++
/mob/living/carbon/Destroy()
for(var/guts in internal_organs)
qdel(guts)
for(var/food in stomach_contents)
qdel(food)
return ..()
/mob/living/carbon/Move(NewLoc, direct)
. = ..()
if(.)
@@ -41,10 +48,9 @@
var/d = rand(round(I.force / 4), I.force)
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
var/organ = H.get_organ("chest")
if (istype(organ, /obj/item/organ/external))
var/obj/item/organ/external/temp = organ
if(temp.take_damage(d, 0))
var/obj/item/organ/external/organ = H.get_organ("chest")
if (istype(organ))
if(organ.take_damage(d, 0))
H.UpdateDamageIcon()
H.updatehealth()
else
@@ -338,7 +344,7 @@
if(!item) return //Grab processing has a chance of returning null
src.remove_from_mob(item)
item.loc = src.loc
@@ -473,6 +479,9 @@
chem_effects[effect] = magnitude
/mob/living/carbon/get_default_language()
if(default_language)
return default_language
if(!species)
return null
return species.default_language ? all_languages[species.default_language] : null

View File

@@ -1,7 +1,7 @@
/mob/living/carbon/human/proc/change_appearance(var/flags = APPEARANCE_ALL_HAIR, var/location = src, var/mob/user = src, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list())
/mob/living/carbon/human/proc/change_appearance(var/flags = APPEARANCE_ALL_HAIR, var/location = src, var/mob/user = src, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/datum/topic_state/state = default_state)
var/obj/nano_module/appearance_changer/AC = new(location, src, check_species_whitelist, species_whitelist, species_blacklist)
AC.flags = flags
AC.ui_interact(user)
AC.ui_interact(user, state = state)
/mob/living/carbon/human/proc/change_species(var/new_species)
if(!new_species)
@@ -117,7 +117,7 @@
g_skin = green
b_skin = blue
update_body()
force_update_limbs()
return 1
/mob/living/carbon/human/proc/change_skin_tone(var/tone)
@@ -126,7 +126,7 @@
s_tone = tone
update_body()
force_update_limbs()
return 1
/mob/living/carbon/human/proc/update_dna()
@@ -186,3 +186,8 @@
/proc/q()
var/mob/living/carbon/human/H = usr
H.change_appearance(APPEARANCE_ALL)
/mob/living/carbon/human/proc/force_update_limbs()
for(var/obj/item/organ/external/O in organs)
O.sync_colour_to_human(src)
update_body(0)

View File

@@ -74,7 +74,7 @@
mutations.Add(HUSK)
status_flags |= DISFIGURED //makes them unknown without fucking up other stuff like admintools
update_body(0)
update_body(1)
return
/mob/living/carbon/human/proc/Drain()

View File

@@ -119,14 +119,14 @@
m_type = 1
if ("flap")
if (!src.restrained())
message = "<B>[src]</B> flaps his wings."
message = "<B>[src]</B> flaps \his wings."
m_type = 2
if(miming)
m_type = 1
if ("aflap")
if (!src.restrained())
message = "<B>[src]</B> flaps his wings ANGRILY!"
message = "<B>[src]</B> flaps \his wings ANGRILY!"
m_type = 2
if(miming)
m_type = 1
@@ -618,4 +618,4 @@
HTML += "<hr />"
HTML +="<a href='?src=\ref[src];flavor_change=done'>\[Done\]</a>"
HTML += "<tt>"
src << browse(HTML, "window=flavor_changes;size=430x300")
src << browse(HTML, "window=flavor_changes;size=430x300")

View File

@@ -19,7 +19,13 @@
set_species(new_species,1)
else
set_species()
if(species)
real_name = species.get_random_name(gender)
name = real_name
if(mind)
mind.name = real_name
hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100")
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy")
hud_list[LIFE_HUD] = image('icons/mob/hud.dmi', src, "hudhealthy")
@@ -37,6 +43,11 @@
dna.real_name = real_name
make_blood()
/mob/living/carbon/human/Destroy()
for(var/organ in organs)
qdel(organ)
return ..()
/mob/living/carbon/human/Stat()
..()
statpanel("Status")
@@ -55,7 +66,7 @@
if (internal)
if (!internal.air_contents)
del(internal)
qdel(internal)
else
stat("Internal Atmosphere Info", internal.name)
stat("Tank Pressure", internal.air_contents.return_pressure())
@@ -322,8 +333,8 @@
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
/mob/living/carbon/human/proc/get_face_name()
var/obj/item/organ/external/head/head = get_organ("head")
if( !head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible
var/obj/item/organ/external/head = get_organ("head")
if(!head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible
return "Unknown"
return real_name
@@ -808,7 +819,7 @@
for(var/x in all_hairs)
var/datum/sprite_accessory/hair/H = new x // create new hair datum based on type x
hairs.Add(H.name) // add hair name to hairs
del(H) // delete the hair after it's all done
qdel(H) // delete the hair after it's all done
var/new_style = input("Please select hair style", "Character Generation",h_style) as null|anything in hairs
@@ -823,7 +834,7 @@
for(var/x in all_fhairs)
var/datum/sprite_accessory/facial_hair/H = new x
fhairs.Add(H.name)
del(H)
qdel(H)
new_style = input("Please select facial style", "Character Generation",f_style) as null|anything in fhairs
@@ -856,11 +867,11 @@
var/list/creatures = list()
for(var/mob/living/carbon/h in world)
creatures += h
var/mob/target = input ("Who do you want to project your mind to ?") as null|anything in creatures
var/mob/target = input("Who do you want to project your mind to ?") as null|anything in creatures
if (isnull(target))
return
var/say = input ("What do you wish to say")
var/say = sanitize(input("What do you wish to say"))
if(mRemotetalk in target.mutations)
target.show_message("\blue You hear [src.real_name]'s voice: [say]")
else
@@ -919,23 +930,12 @@
germ_level += n
/mob/living/carbon/human/revive()
for (var/obj/item/organ/external/O in organs)
O.status &= ~ORGAN_BROKEN
O.status &= ~ORGAN_BLEEDING
O.status &= ~ORGAN_SPLINTED
O.status &= ~ORGAN_CUT_AWAY
O.status &= ~ORGAN_ATTACHABLE
O.wounds.Cut()
O.heal_damage(1000,1000,1,1)
var/obj/item/organ/external/head/h = organs_by_name["head"]
h.disfigured = 0
if(species && !(species.flags & NO_BLOOD))
vessel.add_reagent("blood",560-vessel.total_volume)
fixblood()
// Fix up any missing organs.
// Fix up all organs.
// This will ignore any prosthetics in the prefs currently.
species.create_organs(src)
@@ -945,13 +945,11 @@
if(H.brainmob.real_name == src.real_name)
if(H.brainmob.mind)
H.brainmob.mind.transfer_to(src)
del(H)
for(var/obj/item/organ/I in internal_organs)
I.damage = 0
qdel(H)
for (var/datum/disease/virus in viruses)
virus.cure()
for (var/ID in virus2)
var/datum/disease2/disease/V = virus2[ID]
V.cure(src)
@@ -1020,7 +1018,7 @@
.=..()
if(clean_feet && !shoes && istype(feet_blood_DNA, /list) && feet_blood_DNA.len)
feet_blood_color = null
del(feet_blood_DNA)
qdel(feet_blood_DNA)
update_inv_shoes(1)
return 1
@@ -1115,8 +1113,6 @@
species = all_species[new_species]
species.create_organs(src)
if(species.language)
add_language(species.language)
@@ -1133,6 +1129,8 @@
g_skin = 0
b_skin = 0
species.create_organs(src)
species.handle_post_spawn(src)
maxHealth = species.total_health
@@ -1146,7 +1144,7 @@
if(client && client.screen)
client.screen.len = null
if(hud_used)
del(hud_used)
qdel(hud_used)
hud_used = new /datum/hud(src)
if(species)
@@ -1357,3 +1355,8 @@
U << "<span class='danger'>You pop [S]'s [current_limb.joint] back in!</span>"
S << "<span class='danger'>[U] pops your [current_limb.joint] back in!</span>"
current_limb.undislocate()
/mob/living/carbon/human/drop_from_inventory(var/obj/item/W, var/atom/Target = null)
if(W in organs)
return
..()

View File

@@ -100,9 +100,9 @@
var/hit_zone = H.zone_sel.selecting
var/obj/item/organ/external/affecting = get_organ(hit_zone)
if(!affecting || affecting.status & ORGAN_DESTROYED)
if(!affecting || affecting.is_stump() || (affecting.status & ORGAN_DESTROYED))
M << "<span class='danger'>They are missing that limb!</span>"
return
return 1
switch(src.a_intent)
if(I_HELP)
@@ -214,25 +214,18 @@
w_uniform.add_fingerprint(M)
var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
if(istype(r_hand,/obj/item/weapon/gun) || istype(l_hand,/obj/item/weapon/gun))
var/obj/item/weapon/gun/W = null
var/chance = 0
var/list/holding = list(get_active_hand() = 40, get_inactive_hand = 20)
if (istype(l_hand,/obj/item/weapon/gun))
W = l_hand
chance = hand ? 40 : 20
if (istype(r_hand,/obj/item/weapon/gun))
W = r_hand
chance = !hand ? 40 : 20
if (prob(chance))
visible_message("<spawn class=danger>[src]'s [W] goes off during struggle!")
//See if they have any guns that might go off
for(var/obj/item/weapon/gun/W in holding)
if(W && prob(holding[W]))
var/list/turfs = list()
for(var/turf/T in view())
turfs += T
var/turf/target = pick(turfs)
return W.afterattack(target,src)
if(turfs.len)
var/turf/target = pick(turfs)
visible_message("<span class='danger'>[src]'s [W] goes off during the struggle!</span>")
return W.afterattack(target,src)
var/randn = rand(1, 100)
if(!(species.flags & NO_SLIP) && randn <= 25)
@@ -245,39 +238,25 @@
visible_message("<span class='warning'>[M] attempted to push [src]!</span>")
return
var/talked = 0 // BubbleWrap
if(randn <= 60)
//BubbleWrap: Disarming breaks a pull
if(pulling)
visible_message("\red <b>[M] has broken [src]'s grip on [pulling]!</B>")
talked = 1
stop_pulling()
//See about breaking grips or pulls
if(break_all_grabs(M))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
//BubbleWrap: Disarming also breaks a grab - this will also stop someone being choked, won't it?
if(istype(l_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/lgrab = l_hand
if(lgrab.affecting)
visible_message("\red <b>[M] has broken [src]'s grip on [lgrab.affecting]!</B>")
talked = 1
spawn(1)
del(lgrab)
if(istype(r_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/rgrab = r_hand
if(rgrab.affecting)
visible_message("\red <b>[M] has broken [src]'s grip on [rgrab.affecting]!</B>")
talked = 1
spawn(1)
del(rgrab)
//End BubbleWrap
if(!talked) //BubbleWrap
drop_item()
visible_message("\red <B>[M] has disarmed [src]!</B>")
//Actually disarm them
for(var/obj/item/I in holding)
if(I)
drop_from_inventory(I)
visible_message("<span class='danger'>[M] has disarmed [src]!</span>")
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
//if M (and only M) has a grab on src, start dislocating limbs
if(grab_joint(M))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("\red <B>[M] attempted to disarm [src]!</B>")
return
@@ -302,16 +281,68 @@
return 1
/mob/living/carbon/human/proc/attack_joint(var/obj/item/W, var/mob/living/user, var/def_zone)
var/target_zone = def_zone? check_zone(def_zone) : get_zone_with_miss_chance(user.zone_sel.selecting, src)
if(!def_zone) def_zone = user.zone_sel.selecting
var/target_zone = get_zone_with_miss_chance(check_zone(def_zone), src)
if(user == src) // Attacking yourself can't miss
target_zone = user.zone_sel.selecting
if(!target_zone)
return null
var/obj/item/organ/external/organ = get_organ(check_zone(target_zone))
if(!organ || organ.is_dislocated() || organ.dislocated == -1)
if(!organ || (organ.dislocated == 2) || (organ.dislocated == -1))
return null
var/dislocation_str
if(prob(W.force))
dislocation_str = "[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")] with a grisly crunch!"
dislocation_str = "[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")]!"
organ.dislocate()
return dislocation_str
//Used to attack a joint through grabbing
/mob/living/carbon/human/proc/grab_joint(var/mob/living/user, var/def_zone)
var/has_grab = 0
for(var/obj/item/weapon/grab/G in list(user.l_hand, user.r_hand))
if(G.affecting == src && G.state == GRAB_NECK)
has_grab = 1
break
if(!has_grab)
return 0
if(!def_zone) def_zone = user.zone_sel.selecting
var/target_zone = check_zone(def_zone)
if(!target_zone)
return 0
var/obj/item/organ/external/organ = get_organ(check_zone(target_zone))
if(!organ || organ.is_dislocated() || organ.dislocated == -1)
return 0
user.visible_message("<span class='warning'>[user] begins to dislocate [src]'s [organ.joint]!</span>")
if(do_after(user, 100))
organ.dislocate()
src.visible_message("<span class='danger'>[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")]!</span>")
return 1
return 0
//Breaks all grips and pulls that the mob currently has.
/mob/living/carbon/human/proc/break_all_grabs(mob/living/carbon/user)
var/success = 0
if(pulling)
visible_message("<span class='danger'>[user] has broken [src]'s grip on [pulling]!</span>")
success = 1
stop_pulling()
if(istype(l_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/lgrab = l_hand
if(lgrab.affecting)
visible_message("<span class='danger'>[user] has broken [src]'s grip on [lgrab.affecting]!</span>")
success = 1
spawn(1)
qdel(lgrab)
if(istype(r_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/rgrab = r_hand
if(rgrab.affecting)
visible_message("<span class='danger'>[user] has broken [src]'s grip on [rgrab.affecting]!</span>")
success = 1
spawn(1)
qdel(rgrab)
return success

View File

@@ -319,7 +319,7 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t
This function restores the subjects blood to max.
*/
/mob/living/carbon/human/proc/restore_blood()
if(!species.flags & NO_BLOOD)
if(!(species.flags & NO_BLOOD))
var/blood_volume = vessel.get_reagent_amount("blood")
vessel.add_reagent("blood",560.0-blood_volume)

View File

@@ -1,7 +1,7 @@
/mob/living/carbon/human/proc/update_eyes()
if(internal_organs_by_name["eyes"])
var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"]
eyes.eye_colour = list(r_eyes,g_eyes,b_eyes)
var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"]
if(eyes)
eyes.update_colour()
regenerate_icons()
/mob/living/carbon/var/list/internal_organs = list()
@@ -70,12 +70,12 @@
for(var/limb_tag in list("l_leg","r_leg","l_foot","r_foot"))
var/obj/item/organ/external/E = organs_by_name[limb_tag]
if(!E)
stance_damage += 2
else if (E.status & ORGAN_DESTROYED)
if(!E || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD)))
stance_damage += 2 // let it fail even if just foot&leg
else if (E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || !E.is_usable())
else if (E.is_malfunctioning() || E.is_broken() || !E.is_usable())
stance_damage += 1
else if (E.is_dislocated())
stance_damage += 0.5
// Canes and crutches help you stand (if the latter is ever added)
// One cane mitigates a broken leg+foot, or a missing foot.
@@ -102,10 +102,14 @@
if(!E || !E.can_grasp || (E.status & ORGAN_SPLINTED))
continue
if(E.is_broken())
if(E.is_broken() || E.is_dislocated())
if(E.body_part == HAND_LEFT)
if(!l_hand)
continue
drop_from_inventory(l_hand)
else
if(!r_hand)
continue
drop_from_inventory(r_hand)
var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ")
@@ -125,7 +129,7 @@
spark_system.attach(src)
spark_system.start()
spawn(10)
del(spark_system)
qdel(spark_system)
//Handles chem traces
/mob/living/carbon/human/proc/handle_trace_chems()

View File

@@ -218,4 +218,41 @@
log_say("PsychicWhisper: [key_name(src)]->[M.key] : [msg]")
M << "\green You hear a strange, alien voice in your head... \italic [msg]"
src << "\green You said: \"[msg]\" to [M]"
return
return
/mob/living/carbon/human/proc/diona_split_nymph()
set name = "Split"
set desc = "Split your humanoid form into its constituent nymphs."
set category = "Abilities"
var/turf/T = get_turf(src)
var/mob/living/carbon/alien/diona/S = new(T)
S.set_dir(dir)
if(mind)
mind.transfer_to(S)
message_admins("\The [src] has split into nymphs; player now controls [key_name_admin(S)]")
log_admin("\The [src] has split into nymphs; player now controls [key_name(S)]")
var/nymphs = 1
for(var/mob/living/carbon/alien/diona/D in src)
nymphs++
D.loc = T
D.set_dir(pick(NORTH, SOUTH, EAST, WEST))
if(nymphs < 5)
for(var/i in nymphs to 4)
var/mob/M = new /mob/living/carbon/alien/diona(T)
M.set_dir(pick(NORTH, SOUTH, EAST, WEST))
for(var/obj/item/W in src)
drop_from_inventory(W)
visible_message("<span class='warning'>\The [src] quivers slightly, then splits apart with a wet slithering noise.</span>")
del(src)

View File

@@ -34,7 +34,7 @@ This saves us from having to call add_fingerprint() any time something is put in
if (equip_to_slot_if_possible(W, slots[slot], del_on_fail = 0))
return slot
if (del_on_fail)
del(W)
qdel(W)
return null
@@ -192,10 +192,11 @@ This saves us from having to call add_fingerprint() any time something is put in
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
/mob/living/carbon/human/equip_to_slot(obj/item/W as obj, slot, redraw_mob = 1)
if(!slot) return
if(!istype(W)) return
if(!has_organ_for_slot(slot)) return
if(!species || !species.hud || !(slot in species.hud.equip_slots)) return
W.loc = src
switch(slot)
if(slot_back)
@@ -314,7 +315,49 @@ This saves us from having to call add_fingerprint() any time something is put in
W.layer = 20
return
return 1
//Checks if a given slot can be accessed at this time, either to equip or unequip I
/mob/living/carbon/human/slot_is_accessible(var/slot, var/obj/item/I, mob/user=null)
var/obj/item/covering = null
var/check_flags = 0
switch(slot)
if(slot_wear_mask)
covering = src.head
check_flags = HEADCOVERSMOUTH
if(slot_glasses)
covering = src.head
check_flags = HEADCOVERSEYES
if(slot_gloves, slot_w_uniform)
covering = src.wear_suit
if(covering)
if((covering.body_parts_covered & I.body_parts_covered) || (covering.flags & check_flags))
user << "<span class='warning'>\The [covering] is in the way.</span>"
return 0
return 1
/mob/living/carbon/human/get_equipped_item(var/slot)
switch(slot)
if(slot_wear_suit) return wear_suit
if(slot_gloves) return gloves
if(slot_shoes) return shoes
if(slot_belt) return belt
if(slot_glasses) return glasses
if(slot_head) return head
if(slot_l_ear) return l_ear
if(slot_r_ear) return r_ear
if(slot_w_uniform) return w_uniform
if(slot_wear_id) return wear_id
if(slot_l_store) return l_store
if(slot_r_store) return r_store
if(slot_s_store) return s_store
if(slot_handcuffed) return handcuffed
if(slot_legcuffed) return legcuffed
return ..()
///Bizarre equip effect system below
/*
MouseDrop human inventory menu
@@ -340,9 +383,9 @@ This saves us from having to call add_fingerprint() any time something is put in
/obj/effect/equip_e/New()
if (!ticker)
del(src)
qdel(src)
spawn(100)
del(src)
qdel(src)
..()
return
@@ -353,22 +396,22 @@ This saves us from having to call add_fingerprint() any time something is put in
switch(place)
if("mask")
if (!( target.wear_mask ))
del(src)
qdel(src)
if("l_hand")
if (!( target.l_hand ))
del(src)
qdel(src)
if("r_hand")
if (!( target.r_hand ))
del(src)
qdel(src)
if("suit")
if (!( target.wear_suit ))
del(src)
qdel(src)
if("uniform")
if (!( target.w_uniform ))
del(src)
qdel(src)
if("back")
if (!( target.back ))
del(src)
qdel(src)
if("syringe")
return
if("pill")
@@ -381,10 +424,10 @@ This saves us from having to call add_fingerprint() any time something is put in
return
if("handcuff")
if (!( target.handcuffed ))
del(src)
qdel(src)
if("id")
if ((!( target.wear_id ) || !( target.w_uniform )))
del(src)
qdel(src)
if("splints")
var/count = 0
for(var/organ in list("l_leg","r_leg","l_arm","r_arm"))
@@ -393,19 +436,19 @@ This saves us from having to call add_fingerprint() any time something is put in
count = 1
break
if(count == 0)
del(src)
qdel(src)
return
if("sensor")
if (! target.w_uniform )
del(src)
qdel(src)
if("internal")
if ((!( (istype(target.wear_mask, /obj/item/clothing/mask) && (istype(target.back, /obj/item/weapon/tank) || istype(target.belt, /obj/item/weapon/tank) || istype(target.s_store, /obj/item/weapon/tank)) && !( target.internal )) ) && !( target.internal )))
del(src)
qdel(src)
var/list/L = list( "syringe", "pill", "drink", "dnainjector", "fuel", "sensor", "internal", "tie")
if ((item && !( L.Find(place) )))
if(isrobot(source) && place != "handcuff")
del(src)
qdel(src)
for(var/mob/O in viewers(target, null))
O.show_message("\red <B>[source] is trying to put \a [item] on [target]</B>", 1)
else
@@ -507,7 +550,7 @@ This saves us from having to call add_fingerprint() any time something is put in
message = "\red <B>[source] is trying to empty [target]'s pockets.</B>"
if("CPR")
if (!target.cpr_time)
del(src)
qdel(src)
target.cpr_time = 0
message = "\red <B>[source] is trying perform CPR on [target]!</B>"
if("internal")
@@ -565,7 +608,7 @@ It can still be worn/put on as normal.
if ((source.restrained() || source.stat)) return //Source restrained or unconscious / dead
var/slot_to_process
var/strip_item //this will tell us which item we will be stripping - if any.
var/obj/item/strip_item //this will tell us which item we will be stripping - if any.
switch(place) //here we go again...
if("mask")
@@ -606,13 +649,13 @@ It can still be worn/put on as normal.
strip_item = target.shoes
if("l_hand")
if (istype(target, /obj/item/clothing/suit/straight_jacket))
del(src)
qdel(src)
slot_to_process = slot_l_hand
if (target.l_hand)
strip_item = target.l_hand
if("r_hand")
if (istype(target, /obj/item/clothing/suit/straight_jacket))
del(src)
qdel(src)
slot_to_process = slot_r_hand
if (target.r_hand)
strip_item = target.r_hand
@@ -699,11 +742,11 @@ It can still be worn/put on as normal.
S.add_fingerprint(source)
if (!( istype(S, /obj/item/weapon/dnainjector) ))
S.inuse = 0
del(src)
qdel(src)
S.inject(target, source)
if (S.s_time >= world.time + 30)
S.inuse = 0
del(src)
qdel(src)
S.s_time = world.time
for(var/mob/O in viewers(source, null))
O.show_message("\red [source] injects [target] with the DNA Injector!", 1)
@@ -747,19 +790,23 @@ It can still be worn/put on as normal.
target.internals.icon_state = "internal1"
if(slot_to_process)
if(strip_item) //Stripping an item from the mob
var/obj/item/W = strip_item
target.remove_from_mob(W)
W.add_fingerprint(source)
if(slot_to_process == slot_l_store) //pockets! Needs to process the other one too. Snowflake code, wooo! It's not like anyone will rewrite this anytime soon. If I'm wrong then... CONGRATULATIONS! ;)
if(target.r_store)
target.remove_from_mob(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store.
else
if(item && target.has_organ_for_slot(slot_to_process)) //Placing an item on the mob
if(item.mob_can_equip(target, slot_to_process, 0))
source.remove_from_mob(item)
target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1)
if(strip_item.mob_can_unequip(target, slot_to_process, 0))
target.drop_from_inventory(strip_item)
source.put_in_hands(strip_item)
strip_item.add_fingerprint(source)
if(slot_to_process == slot_l_store) //pockets! Needs to process the other one too. Snowflake code, wooo! It's not like anyone will rewrite this anytime soon. If I'm wrong then... CONGRATULATIONS! ;)
if(target.r_store)
target.drop_from_inventory(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store.
else
source << "<span class='warning'>You fail to remove \the [strip_item] from [target]!</span>"
else if(item)
if(target.has_organ_for_slot(slot_to_process) && item.mob_can_equip(target, slot_to_process, 0)) //Placing an item on the mob
source.drop_from_inventory(item)
target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1)
else
source << "<span class='warning'>You fail to place \the [item] on [target]!</span>"
if(source && target)
if(source.machine == target)
target.show_inv(source)
del(src)
qdel(src)

View File

@@ -2,7 +2,7 @@
//NOTE: Breathing happens once per FOUR TICKS, unless the last breath fails. In which case it happens once per ONE TICK! So oxyloss healing is done once per 4 ticks while oxyloss damage is applied once per tick!
#define HUMAN_MAX_OXYLOSS 1 //Defines how much oxyloss humans can get per tick. A tile with no air at all (such as space) applies this value, otherwise it's a percentage of it.
#define HUMAN_CRIT_MAX_OXYLOSS ( (tickerProcess.getLastTickerTimeDuration()) / 6) //The amount of damage you'll get when in critical condition. We want this to be a 5 minute deal = 300s. There are 50HP to get through, so (1/6)*last_tick_duration per second. Breaths however only happen every 4 ticks.
#define HUMAN_CRIT_MAX_OXYLOSS ( 2.0 / 6) //The amount of damage you'll get when in critical condition. We want this to be a 5 minute deal = 300s. There are 50HP to get through, so (1/6)*last_tick_duration per second. Breaths however only happen every 4 ticks. last_tick_duration = ~2.0 on average
#define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point
#define HEAT_DAMAGE_LEVEL_2 4 //Amount of damage applied when your body temperature passes the 400K point
@@ -389,7 +389,7 @@
// Lung damage increases the minimum safe pressure.
if(species.has_organ["lungs"])
var/obj/item/organ/lungs/L = internal_organs_by_name["lungs"]
if(!L)
if(isnull(L))
safe_pressure_min = INFINITY //No lungs, how are you breathing?
else if(L.is_broken())
safe_pressure_min *= 1.5
@@ -977,7 +977,7 @@
else
for(var/atom/a in hallucinations)
del a
qdel(a)
if(halloss > 100)
src << "<span class='notice'>You're in too much pain to keep going...</span>"
@@ -1407,7 +1407,7 @@
if(M.stat == 2)
M.death(1)
stomach_contents.Remove(M)
del(M)
qdel(M)
continue
if(air_master.current_cycle%3==1)
if(!(M.status_flags & GODMODE))

View File

@@ -2,7 +2,7 @@
name = "fancy uniform"
desc = "It looks like it was tailored for a monkey."
icon_state = "punpun"
item_color = "punpun"
worn_state = "punpun"
species_restricted = list("Monkey")
/mob/living/carbon/human/monkey/punpun/New()

View File

@@ -3,12 +3,11 @@
if(name != GetVoice())
alt_name = "(as [get_id_name("Unknown")])"
if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
src << "<span class='danger'>You're muzzled and cannot speak!</span>"
return
message = sanitize(message)
..(message, alt_name = alt_name) //ohgod we should really be passing a datum here.
..(message, alt_name = alt_name)
/mob/living/carbon/human/is_muzzled()
return istype(src.wear_mask, /obj/item/clothing/mask/muzzle)
/mob/living/carbon/human/proc/forcesay(list/append)
if(stat == CONSCIOUS)

View File

@@ -23,4 +23,4 @@
/datum/species/shadow/handle_death(var/mob/living/carbon/human/H)
spawn(1)
new /obj/effect/decal/cleanable/ash(H.loc)
del(H)
qdel(H)

View File

@@ -30,7 +30,7 @@
poison_type = "oxygen"
siemens_coefficient = 0.2
flags = IS_WHITELISTED | NO_SCAN | HAS_EYE_COLOR
flags = CAN_JOIN | IS_WHITELISTED | NO_SCAN | HAS_EYE_COLOR
blood_color = "#2299FC"
flesh_color = "#808D11"
@@ -45,12 +45,16 @@
"heart" = /obj/item/organ/heart,
"lungs" = /obj/item/organ/lungs,
"liver" = /obj/item/organ/liver,
"kidneys" = /obj/item/organ/kidney,
"kidneys" = /obj/item/organ/kidneys,
"brain" = /obj/item/organ/brain,
"eyes" = /obj/item/organ/eyes,
"stack" = /obj/item/organ/stack/vox
"eyes" = /obj/item/organ/eyes
)
/datum/species/vox/get_random_name(var/gender)
var/datum/language/species_language = all_languages[default_language]
return species_language.get_random_name(gender)
/datum/species/vox/can_shred(var/mob/living/carbon/human/H, var/ignore_intent)
if(!H.mind || !H.mind.special_role) // Pariah check.
return 0
return ..()

View File

@@ -110,7 +110,7 @@
"heart" = /obj/item/organ/heart,
"lungs" = /obj/item/organ/lungs,
"liver" = /obj/item/organ/liver,
"kidneys" = /obj/item/organ/kidney,
"kidneys" = /obj/item/organ/kidneys,
"brain" = /obj/item/organ/brain,
"appendix" = /obj/item/organ/appendix,
"eyes" = /obj/item/organ/eyes
@@ -168,13 +168,17 @@
/datum/species/proc/get_random_name(var/gender)
var/datum/language/species_language = all_languages[language]
if(!species_language)
species_language = all_languages[default_language]
if(!species_language)
return "unknown"
return species_language.get_random_name(gender)
/datum/species/proc/create_organs(var/mob/living/carbon/human/H) //Handles creation of mob organs.
for(var/obj/item/organ/organ in H.contents)
if((organ in H.organs) || (organ in H.internal_organs))
del(organ)
qdel(organ)
if(H.organs) H.organs.Cut()
if(H.internal_organs) H.internal_organs.Cut()

View File

@@ -45,11 +45,8 @@
if(prob(1))
H.emote(pick("scratch","jump","roll","tail"))
/datum/species/monkey/handle_post_spawn(var/mob/living/carbon/human/H)
H.real_name = "[lowertext(name)] ([rand(100,999)])"
H.name = H.real_name
..()
/datum/species/monkey/get_random_name()
return "[lowertext(name)] ([rand(100,999)])"
/datum/species/monkey/tajaran
name = "Farwa"

View File

@@ -168,6 +168,10 @@
"r_foot" = list("path" = /obj/item/organ/external/diona/foot/right)
)
inherent_verbs = list(
/mob/living/carbon/human/proc/diona_split_nymph
)
warning_low_pressure = 50
hazard_low_pressure = -1
@@ -209,7 +213,7 @@
if(D.client)
D.loc = H.loc
else
del(D)
qdel(D)
H.visible_message("\red[H] splits apart with a wet slithering noise!")

View File

@@ -16,9 +16,9 @@
spawn(0)
AddInfectionImages(affected_mob)
else
del(src)
qdel(src)
/obj/item/alien_embryo/Del()
/obj/item/alien_embryo/Destroy()
if(affected_mob)
affected_mob.status_flags &= ~(XENO_HOST)
spawn(0)
@@ -98,7 +98,7 @@
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100) //To get the player's attention
if(gib_on_success)
affected_mob.gib()
del(src)
qdel(src)
/*----------------------------------------
Proc: RefreshInfectionImage()
@@ -114,7 +114,7 @@ Des: Removes all infection images from aliens and places an infection image on a
if(alien.client)
for(var/image/I in alien.client.images)
if(dd_hasprefix_case(I.icon_state, "infected"))
del(I)
qdel(I)
for(var/mob/living/L in mob_list)
if(iscorgi(L) || iscarbon(L))
if(L.status_flags & XENO_HOST)
@@ -156,4 +156,4 @@ Des: Removes the alien infection image from all aliens in the world located in p
for(var/image/I in alien.client.images)
if(I.loc == C)
if(dd_hasprefix_case(I.icon_state, "infected"))
del(I)
qdel(I)

View File

@@ -41,7 +41,7 @@ var/const/MAX_ACTIVE_TIME = 400
if(config.aliens_allowed)
..()
else
del(src)
qdel(src)
/obj/item/clothing/mask/facehugger/examine(mob/user)
..(user)

View File

@@ -61,6 +61,9 @@
var/weeds_heal_rate = 1 // Health regen on weeds.
var/weeds_plasma_rate = 5 // Plasma regen on weeds.
/datum/species/xenos/get_random_name()
return "alien [caste_name] ([alien_number])"
/datum/species/xenos/can_understand(var/mob/other)
if(istype(other,/mob/living/carbon/alien/larva))

View File

@@ -45,7 +45,7 @@ Des: Removes all infected images from the alien.
if (client)
for(var/image/I in client.images)
if(dd_hasprefix_case(I.icon_state, "infected"))
del(I)
qdel(I)
return
/* TODO: Convert this over.

View File

@@ -41,12 +41,12 @@
if (target.l_hand)
// Disarm left hand
//Urist McAssistant dropped the macguffin with a scream just sounds odd. Plus it doesn't work with NO_PAIN
target.visible_message("<span class='danger'>\The [target.l_hand] was knocked right out of [src]'s grasp!</span>")
target.visible_message("<span class='danger'>\The [target.l_hand] was knocked right out of [target]'s grasp!</span>")
target.drop_l_hand()
if("r_arm", "r_hand")
if (target.r_hand)
// Disarm right hand
target.visible_message("<span class='danger'>\The [target.r_hand] was knocked right out of [src]'s grasp!</span>")
target.visible_message("<span class='danger'>\The [target.r_hand] was knocked right out of [target]'s grasp!</span>")
target.drop_r_hand()
if("chest")
if(!target.lying)

View File

@@ -237,24 +237,30 @@ var/global/list/damage_icon_parts = list()
//CACHING: Generate an index key from visible bodyparts.
//0 = destroyed, 1 = normal, 2 = robotic, 3 = necrotic.
//Create a new, blank icon for our mob to use.
if(stand_icon)
del(stand_icon)
qdel(stand_icon)
stand_icon = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi',"blank")
var/icon_key = "[species.race_key][g][s_tone][r_skin][g_skin][b_skin]"
var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"]
var/icon_key = "[species.race_key][g][s_tone]"
for(var/obj/item/organ/external/part in organs)
if(part.is_stump() || (part.status & ORGAN_DESTROYED))
icon_key = "[icon_key]0"
if(eyes)
icon_key += "[rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3])]"
else
icon_key += "#000000"
for(var/organ_tag in species.has_limbs)
var/obj/item/organ/external/part = organs_by_name[organ_tag]
if(isnull(part) || part.is_stump() || (part.status & ORGAN_DESTROYED))
icon_key += "0"
else if(part.status & ORGAN_ROBOT)
icon_key = "[icon_key]2[part.model ? "-[part.model]": ""]"
icon_key += "2[part.model ? "-[part.model]": ""]"
else if(part.status & ORGAN_DEAD)
icon_key = "[icon_key]3"
icon_key += "3"
else
icon_key = "[icon_key]1"
icon_key += "1"
icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0][s_tone]"
icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0]"
var/icon/base_icon
if(human_icon_cache[icon_key])
@@ -406,7 +412,7 @@ var/global/list/damage_icon_parts = list()
if (targeted_by && target_locked)
overlays_standing[TARGETED_LAYER] = target_locked
else if (!targeted_by && target_locked)
del(target_locked)
qdel(target_locked)
if (!targeted_by)
overlays_standing[TARGETED_LAYER] = null
if(update_icons) update_icons()
@@ -451,37 +457,49 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/update_inv_w_uniform(var/update_icons=1)
if(w_uniform && istype(w_uniform, /obj/item/clothing/under) )
w_uniform.screen_loc = ui_iclothing
var/t_color = w_uniform.item_color
if(!t_color) t_color = icon_state
var/image/standing = image("icon_state" = "[t_color]_s")
//determine the icon to use
var/icon/under_icon
if(w_uniform.icon_override)
standing.icon = w_uniform.icon_override
under_icon = w_uniform.icon_override
else if(w_uniform.sprite_sheets && w_uniform.sprite_sheets[species.name])
standing.icon = w_uniform.sprite_sheets[species.name]
under_icon = w_uniform.sprite_sheets[species.name]
else if(w_uniform.item_icons && w_uniform.item_icons[slot_w_uniform_str])
under_icon = w_uniform.item_icons[slot_w_uniform_str]
else
standing.icon = 'icons/mob/uniform.dmi'
under_icon = INV_W_UNIFORM_DEF_ICON
//determine state to use
var/under_state
if(w_uniform.item_state_slots && w_uniform.item_state_slots[slot_w_uniform_str])
under_state = w_uniform.item_state_slots[slot_w_uniform_str]
else if(w_uniform.item_state)
under_state = w_uniform.item_state
else
under_state = w_uniform.icon_state
//need to append _s to the icon state for legacy compatibility
var/image/standing = image(icon = under_icon, icon_state = "[under_state]_s")
//apply blood overlay
if(w_uniform.blood_DNA)
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "uniformblood")
var/image/bloodsies = image(icon = species.blood_mask, icon_state = "uniformblood")
bloodsies.color = w_uniform.blood_color
standing.overlays += bloodsies
if(w_uniform:accessories.len) //WE CHECKED THE TYPE ABOVE. THIS REALLY SHOULD BE FINE.
for(var/obj/item/clothing/accessory/A in w_uniform:accessories)
var/tie_color = A.item_color
if(!tie_color) tie_color = A.icon_state
standing.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[tie_color]")
//accessories
var/obj/item/clothing/under/under = w_uniform
if(under.accessories.len)
for(var/obj/item/clothing/accessory/A in under.accessories)
var/accessory_state = A.overlay_state? A.overlay_state : A.icon_state
standing.overlays += image(icon = INV_ACCESSORIES_DEF_ICON, icon_state = accessory_state)
overlays_standing[UNIFORM_LAYER] = standing
else
overlays_standing[UNIFORM_LAYER] = null
// This really, really seems like it should not be mixed in the middle of display code...
// Automatically drop anything in store / id / belt if you're not wearing a uniform. //CHECK IF NECESARRY
for( var/obj/item/thing in list(r_store, l_store, wear_id, belt) )
if(thing)
remove_from_mob(thing)
if(update_icons) update_icons()
if(update_icons)
update_icons()
/mob/living/carbon/human/update_inv_wear_id(var/update_icons=1)
if(wear_id)
@@ -736,19 +754,38 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/update_inv_back(var/update_icons=1)
if(back)
back.screen_loc = ui_back //TODO
var/obj/item/weapon/rig/rig = back
//determine the icon to use
var/icon/overlay_icon
if(back.icon_override)
overlays_standing[BACK_LAYER] = image("icon" = back.icon_override, "icon_state" = "[back.icon_state]")
//If this is a rig and a mob_icon is set, it will take species into account in the rig update_icon() proc.
else if(istype(rig) && rig.mob_icon)
overlays_standing[BACK_LAYER] = rig.mob_icon
overlay_icon = back.icon_override
else if(istype(back, /obj/item/weapon/rig))
//If this is a rig and a mob_icon is set, it will take species into account in the rig update_icon() proc.
var/obj/item/weapon/rig/rig = back
overlay_icon = rig.mob_icon
else if(back.sprite_sheets && back.sprite_sheets[species.name])
overlays_standing[BACK_LAYER] = image("icon" = back.sprite_sheets[species.name], "icon_state" = "[back.icon_state]")
overlay_icon = back.sprite_sheets[species.name]
else if(back.item_icons && (slot_l_hand_str in back.item_icons))
overlay_icon = back.item_icons[slot_l_hand_str]
else
overlays_standing[BACK_LAYER] = image("icon" = 'icons/mob/back.dmi', "icon_state" = "[back.icon_state]")
overlay_icon = INV_BACK_DEF_ICON
//determine state to use
var/overlay_state
if(back.item_state_slots && back.item_state_slots[slot_back_str])
overlay_state = back.item_state_slots[slot_back_str]
else if(back.item_state)
overlay_state = back.item_state
else
overlay_state = back.icon_state
//create the image
overlays_standing[BACK_LAYER] = image(icon = overlay_icon, icon_state = overlay_state)
else
overlays_standing[BACK_LAYER] = null
if(update_icons) update_icons()
overlays_standing[BACK_LAYER] = null
if(update_icons)
update_icons()
/mob/living/carbon/human/update_hud() //TODO: do away with this if possible
@@ -784,46 +821,62 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/update_inv_r_hand(var/update_icons=1)
if(r_hand)
r_hand.screen_loc = ui_rhand //TODO
var/t_icon = INV_R_HAND_DEF_ICON
if(r_hand.item_icons && (icon_r_hand in r_hand.item_icons))
t_icon = r_hand.item_icons[icon_r_hand]
var/t_state = r_hand.item_state //useful for clothing that changes icon_state but retains the same sprite on the mob when held in hand
if(!t_state) t_state = r_hand.icon_state
if(r_hand.icon_override)
t_state = "[t_state]_r"
overlays_standing[R_HAND_LAYER] = image("icon" = r_hand.icon_override, "icon_state" = "[t_state]")
else
overlays_standing[R_HAND_LAYER] = image("icon" = t_icon, "icon_state" = "[t_state]")
if (handcuffed) drop_r_hand()
//determine icon to use
var/icon/t_icon
if(r_hand.icon_override)
t_icon = r_hand.icon_override
else if(r_hand.item_icons && (slot_r_hand_str in r_hand.item_icons))
t_icon = r_hand.item_icons[slot_r_hand_str]
else
t_icon = INV_R_HAND_DEF_ICON
//determine icon state to use
var/t_state
if(r_hand.item_state_slots && r_hand.item_state_slots[slot_r_hand_str])
t_state = r_hand.item_state_slots[slot_r_hand_str]
else if(r_hand.item_state)
t_state = r_hand.item_state
else
t_state = r_hand.icon_state
overlays_standing[R_HAND_LAYER] = image(icon = t_icon, icon_state = t_state)
if (handcuffed) drop_r_hand() //this should be moved out of icon code
else
overlays_standing[R_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_l_hand(var/update_icons=1)
if(l_hand)
l_hand.screen_loc = ui_lhand //TODO
var/t_icon = INV_L_HAND_DEF_ICON
if(l_hand.item_icons && (icon_l_hand in l_hand.item_icons))
t_icon = l_hand.item_icons[icon_l_hand]
var/t_state = l_hand.item_state //useful for clothing that changes icon_state but retains the same sprite on the mob when held in hand
if(!t_state) t_state = l_hand.icon_state
if(l_hand.icon_override)
t_state = "[t_state]_l"
overlays_standing[L_HAND_LAYER] = image("icon" = l_hand.icon_override, "icon_state" = "[t_state]")
else
overlays_standing[L_HAND_LAYER] = image("icon" = t_icon, "icon_state" = "[t_state]")
if (handcuffed) drop_l_hand()
//determine icon to use
var/icon/t_icon
if(l_hand.icon_override)
t_icon = l_hand.icon_override
else if(l_hand.item_icons && (slot_l_hand_str in l_hand.item_icons))
t_icon = l_hand.item_icons[slot_l_hand_str]
else
t_icon = INV_L_HAND_DEF_ICON
//determine icon state to use
var/t_state
if(l_hand.item_state_slots && l_hand.item_state_slots[slot_l_hand_str])
t_state = l_hand.item_state_slots[slot_l_hand_str]
else if(l_hand.item_state)
t_state = l_hand.item_state
else
t_state = l_hand.icon_state
overlays_standing[L_HAND_LAYER] = image(icon = t_icon, icon_state = t_state)
if (handcuffed) drop_l_hand() //This probably should not be here
else
overlays_standing[L_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1)

View File

@@ -143,7 +143,7 @@
//now mobs
var/speech_bubble_test = say_test(message)
var/image/speech_bubble = image('icons/mob/talk.dmi',src,"h[speech_bubble_test]")
spawn(30) del(speech_bubble)
spawn(30) qdel(speech_bubble)
for(var/mob/M in listening)
M << speech_bubble

View File

@@ -10,14 +10,13 @@
is_adult = 0
maxHealth = 150
revive()
regenerate_icons()
if (!client) rabid = 1
number = rand(1, 1000)
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
return
. = ..(gibbed, "seizes up and falls limp...")
mood = null
regenerate_icons()
return

View File

@@ -23,7 +23,7 @@
user <<"You apply the enhancer. It now has triple the amount of uses."
Uses = 3
enhanced = 1
del(O)
qdel(O)
/obj/item/slime_extract/New()
..()
@@ -145,14 +145,14 @@
pet.icon_dead = "[M.colour] baby slime dead"
pet.colour = "[M.colour]"
user <<"You feed the slime the potion, removing it's powers and calming it."
del(M)
qdel(M)
var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN)
if (!newname)
newname = "pet slime"
pet.name = newname
pet.real_name = newname
del(src)
qdel(src)
/obj/item/weapon/slimepotion2
name = "advanced docility potion"
@@ -176,14 +176,14 @@
pet.icon_dead = "[M.colour] baby slime dead"
pet.colour = "[M.colour]"
user <<"You feed the slime the potion, removing it's powers and calming it."
del(M)
qdel(M)
var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN)
if (!newname)
newname = "pet slime"
pet.name = newname
pet.real_name = newname
del(src)
qdel(src)
/obj/item/weapon/slimesteroid
@@ -208,7 +208,7 @@
user <<"You feed the slime the steroid. It now has triple the amount of extract."
M.cores = 3
del(src)
qdel(src)
/obj/item/weapon/slimesteroid2
name = "extract enhancer"
@@ -227,7 +227,7 @@
user <<"You apply the enhancer. It now has triple the amount of uses."
target.Uses = 3
target.enahnced = 1
del(src)*/
qdel(src)*/
/obj/effect/golemrune
anchored = 1
@@ -268,7 +268,7 @@
G.set_species("Golem")
G.key = ghost.key
G << "You are an adamantine golem. You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. Serve [user], and assist them in completing their goals at any cost."
del (src)
qdel(src)
proc/announce_to_ghosts()
@@ -350,7 +350,7 @@
spawn(rand(50,100))
src.visible_message("<span class='warning'> The [name] bursts open!</span>")
new/mob/living/carbon/slime(T)
del(src)
qdel(src)
/obj/item/weapon/reagent_containers/food/snacks/egg/slime/process()

View File

@@ -69,6 +69,7 @@
mutation_chance = rand(25, 35)
var/sanitizedcolour = replacetext(colour, " ", "")
coretype = text2path("/obj/item/slime_extract/[sanitizedcolour]")
regenerate_icons()
..(location)
/mob/living/carbon/slime/movement_delay()
@@ -175,7 +176,7 @@
var/f_loss = null
switch (severity)
if (1.0)
del(src)
qdel(src)
return
if (2.0)

View File

@@ -161,7 +161,7 @@
src.mind.transfer_to(new_slime)
else
new_slime.key = src.key
del(src)
qdel(src)
else
src << "<span class='notice'>I am not ready to reproduce yet...</span>"
else

View File

@@ -1,4 +1,7 @@
/mob/living/carbon/slime/say(var/message)
message = sanitize(message)
var/verb = say_quote(message)
if(copytext(message,1,2) == "*")

View File

@@ -1,141 +0,0 @@
//Monkey Overlays Indexes////////
#define M_MASK_LAYER 1
#define M_BACK_LAYER 2
#define M_HANDCUFF_LAYER 3
#define M_L_HAND_LAYER 4
#define M_R_HAND_LAYER 5
#define TARGETED_LAYER 6
#define M_FIRE_LAYER 6
#define M_TOTAL_LAYERS 7
/////////////////////////////////
/mob/living/carbon/monkey
var/list/overlays_lying[M_TOTAL_LAYERS]
var/list/overlays_standing[M_TOTAL_LAYERS]
/mob/living/carbon/monkey/regenerate_icons()
..()
update_inv_wear_mask(0)
update_inv_back(0)
update_inv_r_hand(0)
update_inv_l_hand(0)
update_inv_handcuffed(0)
update_fire(0)
update_icons()
//Hud Stuff
update_hud()
return
/mob/living/carbon/monkey/update_icons()
update_hud()
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
overlays.Cut()
for(var/image/I in overlays_standing)
overlays += I
if(lying)
var/matrix/M = matrix()
M.Turn(90)
M.Translate(1,-6)
src.transform = M
else
var/matrix/M = matrix()
src.transform = M
////////
/mob/living/carbon/monkey/update_inv_wear_mask(var/update_icons=1)
if( wear_mask && istype(wear_mask, /obj/item/clothing/mask) )
overlays_standing[M_MASK_LAYER] = image("icon" = 'icons/mob/monkey.dmi', "icon_state" = "[wear_mask.icon_state]")
wear_mask.screen_loc = ui_monkey_mask
else
overlays_standing[M_MASK_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_r_hand(var/update_icons=1)
if(r_hand)
var/t_icon = INV_R_HAND_DEF_ICON
if(r_hand.item_icons && (icon_r_hand in r_hand.item_icons))
t_icon = r_hand.item_icons[icon_r_hand]
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
overlays_standing[M_R_HAND_LAYER] = image("icon" = t_icon, "icon_state" = t_state)
r_hand.screen_loc = ui_rhand
if (handcuffed) drop_r_hand()
else
overlays_standing[M_R_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_l_hand(var/update_icons=1)
if(l_hand)
var/t_icon = INV_L_HAND_DEF_ICON
if(l_hand.item_icons && (icon_l_hand in l_hand.item_icons))
t_icon = l_hand.item_icons[icon_l_hand]
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
overlays_standing[M_L_HAND_LAYER] = image("icon" = t_icon, "icon_state" = t_state)
l_hand.screen_loc = ui_lhand
if (handcuffed) drop_l_hand()
else
overlays_standing[M_L_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_back(var/update_icons=1)
if(back)
overlays_standing[M_BACK_LAYER] = image("icon" = 'icons/mob/back.dmi', "icon_state" = "[back.icon_state]")
back.screen_loc = ui_monkey_back
else
overlays_standing[M_BACK_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_handcuffed(var/update_icons=1)
if(handcuffed)
drop_r_hand()
drop_l_hand()
stop_pulling()
overlays_standing[M_HANDCUFF_LAYER] = image("icon" = 'icons/mob/monkey.dmi', "icon_state" = "handcuff1")
else
overlays_standing[M_HANDCUFF_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_hud()
if (client)
client.screen |= contents
//Call when target overlay should be added/removed
/mob/living/carbon/monkey/update_targeted(var/update_icons=1)
if (targeted_by && target_locked)
overlays_standing[TARGETED_LAYER] = target_locked
else if (!targeted_by && target_locked)
del(target_locked)
if (!targeted_by)
overlays_standing[TARGETED_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_fire(var/update_icons=1)
if(on_fire)
overlays_standing[M_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"= -M_FIRE_LAYER)
else
overlays_standing[M_FIRE_LAYER] = null
if(update_icons) update_icons()
//Monkey Overlays Indexes////////
#undef M_MASK_LAYER
#undef M_BACK_LAYER
#undef M_HANDCUFF_LAYER
#undef M_L_HAND_LAYER
#undef M_R_HAND_LAYER
#undef TARGETED_LAYER
#undef M_FIRE_LAYER
#undef M_TOTAL_LAYERS

View File

@@ -23,12 +23,8 @@
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/M = src
for(var/obj/item/organ/external/organ in M.organs)
if (!organ)
continue
else if(organ.status & ORGAN_BROKEN || organ.open)
if(organ && (organ.is_broken() || organ.open))
src.traumatic_shock += 30
if(organ.status & ORGAN_SPLINTED)
src.traumatic_shock -= 25
if(src.traumatic_shock < 0)
src.traumatic_shock = 0

View File

@@ -0,0 +1,25 @@
/mob/living
var/datum/language/default_language
/mob/living/verb/set_default_language(language as null|anything in languages)
set name = "Set Default Language"
set category = "IC"
if(language)
src << "<span class='notice'>You will now speak [language] if you do not specify a language when speaking.</span>"
else
src << "<span class='notice'>You will now speak whatever your standard default language is if you do not specify one when speaking.</span>"
default_language = language
// Silicons can't neccessarily speak everything in their languages list
/mob/living/silicon/set_default_language(language as null|anything in speech_synthesizer_langs)
..()
/mob/living/verb/check_default_language()
set name = "Check Default Language"
set category = "IC"
if(default_language)
src << "<span class='notice'>You are currently speaking [default_language] by default.</span>"
else
src << "<span class='notice'>Your current default language is your species or mob type default.</span>"

View File

@@ -376,7 +376,8 @@ default behaviour is:
/mob/living/proc/revive()
rejuvenate()
buckled = initial(src.buckled)
if(buckled)
buckled.unbuckle_mob()
if(iscarbon(src))
var/mob/living/carbon/C = src
@@ -511,7 +512,7 @@ default behaviour is:
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1)
//G = null
del(G)
qdel(G)
else
ok = 0
if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
@@ -628,22 +629,22 @@ default behaviour is:
var/resisting = 0
for(var/obj/O in L.requests)
L.requests.Remove(O)
del(O)
qdel(O)
resisting++
for(var/obj/item/weapon/grab/G in usr.grabbed_by)
resisting++
switch(G.state)
if(GRAB_PASSIVE)
del(G)
qdel(G)
if(GRAB_AGGRESSIVE)
if(prob(60)) //same chance of breaking the grab as disarm
L.visible_message("<span class='warning'>[L] has broken free of [G.assailant]'s grip!</span>")
del(G)
qdel(G)
if(GRAB_NECK)
//If the you move when grabbing someone then it's easier for them to break free. Same if the affected mob is immune to stun.
if (((world.time - G.assailant.l_move_time < 30 || !L.stunned) && prob(15)) || prob(3))
L.visible_message("<span class='warning'>[L] has broken free of [G.assailant]'s headlock!</span>")
del(G)
qdel(G)
if(resisting)
L.visible_message("<span class='danger'>[L] resists!</span>")
@@ -777,7 +778,7 @@ default behaviour is:
O.show_message(text("\red <B>[] manages to break the handcuffs!</B>", CM), 1)
CM << "\red You successfully break your handcuffs."
CM.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
del(CM.handcuffed)
qdel(CM.handcuffed)
CM.handcuffed = null
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
@@ -825,7 +826,7 @@ default behaviour is:
O.show_message(text("\red <B>[] manages to break the legcuffs!</B>", CM), 1)
CM << "\red You successfully break your legcuffs."
CM.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
del(CM.legcuffed)
qdel(CM.legcuffed)
CM.legcuffed = null
CM.update_inv_legcuffed()
else
@@ -967,6 +968,11 @@ default behaviour is:
/mob/living/proc/slip(var/slipped_on,stun_duration=8)
return 0
/mob/living/carbon/drop_from_inventory(var/obj/item/W, var/atom/Target = null)
if(W in internal_organs)
return
..()
/mob/living/carbon/proc/spin(spintime, speed)
spawn()
var/D = dir

View File

@@ -52,6 +52,7 @@
if(istype(get_active_hand(),/obj/item/device/assembly/signaler))
var/obj/item/device/assembly/signaler/signaler = get_active_hand()
if(signaler.deadman && prob(80))
log_and_message_admins("has triggered a signaler deadman's switch")
src.visible_message("\red [src] triggers their deadman's switch!")
signaler.signal()
@@ -59,7 +60,7 @@
if(P.taser_effect)
stun_effect_act(0, P.agony, def_zone, P)
src <<"\red You have been hit by [P]!"
del P
qdel(P)
return
//Armor

View File

@@ -22,9 +22,6 @@
var/last_special = 0 //Used by the resist verb, likely used to prevent players from bypassing next_move by logging in/out.
//Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects.
var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas.
var/t_phoron = null
var/t_oxygen = null
var/t_sl_gas = null

View File

@@ -80,7 +80,10 @@ proc/get_radio_key_from_channel(var/channel)
if(dongle.translate_binary) return 1
/mob/living/proc/get_default_language()
return null
return default_language
/mob/living/proc/is_muzzled()
return 0
/mob/living/proc/handle_speech_problems(var/message, var/verb)
var/list/returns[3]
@@ -135,6 +138,10 @@ proc/get_radio_key_from_channel(var/channel)
return say_dead(message)
return
if(is_muzzled())
src << "<span class='danger'>You're muzzled and cannot speak!</span>"
return
var/message_mode = parse_message_mode(message, "headset")
switch(copytext(message,1,2))
@@ -256,7 +263,7 @@ proc/get_radio_key_from_channel(var/channel)
var/speech_bubble_test = say_test(message)
var/image/speech_bubble = image('icons/mob/talk.dmi',src,"h[speech_bubble_test]")
spawn(30) del(speech_bubble)
spawn(30) qdel(speech_bubble)
for(var/mob/M in listening)
M << speech_bubble

View File

@@ -6,6 +6,7 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/proc/ai_announcement,
/mob/living/silicon/ai/proc/ai_call_shuttle,
// /mob/living/silicon/ai/proc/ai_recall_shuttle,
/mob/living/silicon/ai/proc/ai_emergency_message,
/mob/living/silicon/ai/proc/ai_camera_track,
/mob/living/silicon/ai/proc/ai_camera_list,
/mob/living/silicon/ai/proc/ai_goto_location,
@@ -45,7 +46,7 @@ var/list/ai_verbs_default = list(
density = 1
status_flags = CANSTUN|CANPARALYSE|CANPUSH
shouldnt_see = list(/obj/effect/rune)
var/list/network = list("SS13")
var/list/network = list("Exodus")
var/obj/machinery/camera/camera = null
var/list/connected_robots = list()
var/aiRestorePowerRoutine = 0
@@ -71,7 +72,6 @@ var/list/ai_verbs_default = list(
var/mob/living/silicon/ai/parent = null
var/apc_override = 0 //hack for letting the AI use its APC even when visionless
var/camera_light_on = 0 //Defines if the AI toggled the light on the camera it's looking through.
var/datum/trackable/track = null
var/last_announcement = ""
@@ -79,13 +79,11 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/proc/add_ai_verbs()
src.verbs |= ai_verbs_default
src.verbs |= ai_verbs_subsystems
src.verbs |= silicon_verbs_subsystems
src.verbs |= silicon_subsystems
/mob/living/silicon/ai/proc/remove_ai_verbs()
src.verbs -= ai_verbs_default
src.verbs -= ai_verbs_subsystems
src.verbs -= silicon_verbs_subsystems
src.verbs -= silicon_subsystems
/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0)
announcement = new()
@@ -145,7 +143,7 @@ var/list/ai_verbs_default = list(
if(!safety)//Only used by AIize() to successfully spawn an AI.
if (!B)//If there is no player/brain inside.
empty_playable_ai_cores += new/obj/structure/AIcore/deactivated(loc)//New empty terminal.
del(src)//Delete AI.
qdel(src)//Delete AI.
return
else
if (B.brainmob.mind)
@@ -195,9 +193,9 @@ var/list/ai_verbs_default = list(
job = "AI"
/mob/living/silicon/ai/Del()
/mob/living/silicon/ai/Destroy()
ai_list -= src
del(eyeobj)
qdel(eyeobj)
..()
/mob/living/silicon/ai/pointed(atom/A as mob|obj|turf in view())
@@ -243,7 +241,7 @@ var/list/ai_verbs_default = list(
/obj/machinery/ai_powersupply/New(var/mob/living/silicon/ai/ai=null)
powered_ai = ai
if(isnull(powered_ai))
Del()
qdel(src)
loc = powered_ai.loc
use_power(1) // Just incase we need to wake up the power system.
@@ -252,7 +250,7 @@ var/list/ai_verbs_default = list(
/obj/machinery/ai_powersupply/process()
if(!powered_ai || powered_ai.stat & DEAD)
Del()
qdel(src)
if(!powered_ai.anchored)
loc = powered_ai.loc
use_power = 0
@@ -380,6 +378,30 @@ var/list/ai_verbs_default = list(
if(confirm == "Yes")
cancel_call_proc(src)
/mob/living/silicon/ai/var/emergency_message_cooldown = 0
/mob/living/silicon/ai/proc/ai_emergency_message()
set category = "AI Commands"
set name = "Send Emergency Message"
if(check_unable(AI_CHECK_WIRELESS))
return
if(!is_relay_online())
usr <<"<span class='warning'>No Emergency Bluespace Relay detected. Unable to transmit message.</span>"
return
if(emergency_message_cooldown)
usr << "<span class='warning'>Arrays recycling. Please stand by.</span>"
return
var/input = input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")
if(!input)
return
Centcomm_announce(input, usr)
usr << "<span class='notice'>Message transmitted.</span>"
log_say("[key_name(usr)] has made an IA Centcomm announcement: [input]")
emergency_message_cooldown = 1
spawn(300)
emergency_message_cooldown = 0
/mob/living/silicon/ai/check_eye(var/mob/user as mob)
if (!camera)
return null
@@ -478,41 +500,41 @@ var/list/ai_verbs_default = list(
//Replaces /mob/living/silicon/ai/verb/change_network() in ai.dm & camera.dm
//Adds in /mob/living/silicon/ai/proc/ai_network_change() instead
//Addition by Mord_Sith to define AI's network change ability
/mob/living/silicon/ai/proc/ai_network_change()
set category = "AI Commands"
set name = "Jump To Network"
unset_machine()
var/cameralist[0]
/mob/living/silicon/ai/proc/get_camera_network_list()
if(check_unable())
return
var/mob/living/silicon/ai/U = usr
var/list/cameralist = new()
for (var/obj/machinery/camera/C in cameranet.cameras)
if(!C.can_use())
continue
var/list/tempnetwork = difflist(C.network,restricted_camera_networks,1)
if(tempnetwork.len)
for(var/i in tempnetwork)
cameralist[i] = i
var/old_network = network
network = input(U, "Which network would you like to view?") as null|anything in cameralist
for(var/i in tempnetwork)
cameralist[i] = i
if(!U.eyeobj)
U.view_core()
cameralist = sortAssoc(cameralist)
return cameralist
/mob/living/silicon/ai/proc/ai_network_change(var/network in get_camera_network_list())
set category = "AI Commands"
set name = "Jump To Network"
unset_machine()
if(!network)
return
if(isnull(network))
network = old_network // If nothing is selected
else
for(var/obj/machinery/camera/C in cameranet.cameras)
if(!C.can_use())
continue
if(network in C.network)
U.eyeobj.setLoc(get_turf(C))
break
if(!eyeobj)
view_core()
return
src.network = network
for(var/obj/machinery/camera/C in cameranet.cameras)
if(!C.can_use())
continue
if(network in C.network)
eyeobj.setLoc(get_turf(C))
break
src << "\blue Switched to [network] camera network."
//End of code by Mord_Sith
@@ -554,7 +576,7 @@ var/list/ai_verbs_default = list(
input = input("Select a crew member:") as null|anything in personnel_list
var/icon/character_icon = personnel_list[input]
if(character_icon)
del(holo_icon)//Clear old icon so we're not storing it in memory.
qdel(holo_icon)//Clear old icon so we're not storing it in memory.
holo_icon = getHologramIcon(icon(character_icon))
else
alert("No suitable records found. Aborting.")
@@ -567,7 +589,7 @@ var/list/ai_verbs_default = list(
)
input = input("Please select a hologram:") as null|anything in icon_list
if(input)
del(holo_icon)
qdel(holo_icon)
switch(input)
if("default")
holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1"))
@@ -668,14 +690,14 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/proc/check_unable(var/flags = 0)
if(stat == DEAD)
usr << "\red You are dead!"
src << "<span class='warning'>You are dead!</span>"
return 1
if((flags & AI_CHECK_WIRELESS) && src.control_disabled)
usr << "\red Wireless control is disabled!"
src << "<span class='warning'>Wireless control is disabled!</span>"
return 1
if((flags & AI_CHECK_RADIO) && src.aiRadio.disabledAi)
src << "\red System Error - Transceiver Disabled!"
src << "<span class='warning'>System Error - Transceiver Disabled!</span>"
return 1
return 0

View File

@@ -34,10 +34,10 @@ var/global/list/empty_playable_ai_cores = list()
job_master.FreeRole(job)
if(mind.objectives.len)
del(mind.objectives)
qdel(mind.objectives)
mind.special_role = null
clear_antag_roles(mind)
ghostize(0)
del(src)
qdel(src)

View File

@@ -92,7 +92,7 @@
var/area/current_area = get_area(src)
if (((!loc.master.power_equip) && current_area.requires_power == 1 || istype(T, /turf/space)) && !istype(src.loc,/obj/item))
if (lacks_power())
//If our area lacks equipment power, and is not magically powered (i.e. centcom), or if we are in space and not carded, lose power.
if (src:aiRestorePowerRoutine==0)
src:aiRestorePowerRoutine = 1
@@ -161,10 +161,9 @@
sleep(50)
src << "Receiving control information from APC."
sleep(2)
//bring up APC dialog
apc_override = 1
theAPC.attack_ai(src)
apc_override = 0
theAPC.operating = 1
theAPC.equipment = 3
theAPC.update()
src:aiRestorePowerRoutine = 3
src << "Here are your current laws:"
src.show_laws()
@@ -179,6 +178,11 @@
if (MED_HUD)
process_med_hud(src,0,src.eyeobj)
/mob/living/silicon/ai/proc/lacks_power()
var/turf/T = get_turf(src)
var/area/A = get_area(src)
return ((!A.master.power_equip) && A.requires_power == 1 || istype(T, /turf/space)) && !istype(src.loc,/obj/item)
/mob/living/silicon/ai/updatehealth()
if(status_flags & GODMODE)
health = 100

View File

@@ -1,9 +1,7 @@
/mob/living/silicon/ai/Login() //ThisIsDumb(TM) TODO: tidy this up <20>_<EFBFBD> ~Carn
..()
for(var/obj/effect/rune/rune in world)
var/image/blood = image(loc = rune)
blood.override = 1
client.images += blood
for(var/obj/effect/rune/rune in rune_list)
client.images += rune.blood_image
regenerate_icons()
flash = new /obj/screen()
flash.icon_state = "blank"

View File

@@ -1,36 +0,0 @@
/mob/living/silicon/ai
var/list/ai_verbs_subsystems = list(
/mob/living/silicon/ai/proc/subsystem_crew_monitor,
/mob/living/silicon/ai/proc/subsystem_power_monitor,
/mob/living/silicon/ai/proc/subsystem_rcon
)
var/obj/nano_module/crew_monitor/crew_monitor
var/obj/nano_module/rcon/rcon
var/obj/nano_module/power_monitor/power_monitor
/mob/living/silicon/ai/init_subsystems()
..()
del(alarm_monitor)
alarm_monitor = new/obj/nano_module/alarm_monitor/ai(src)
crew_monitor = new(src)
rcon = new(src)
power_monitor = new(src)
/mob/living/silicon/ai/proc/subsystem_crew_monitor()
set category = "Subystems"
set name = "Crew Monitor"
crew_monitor.ui_interact(usr)
/mob/living/silicon/ai/proc/subsystem_power_monitor()
set category = "Subystems"
set name = "Power Monitor"
power_monitor.ui_interact(usr)
/mob/living/silicon/ai/proc/subsystem_rcon()
set category = "Subystems"
set name = "RCON"
rcon.ui_interact(usr)

View File

@@ -3,11 +3,11 @@
card.removePersonality()
if(gibbed)
src.loc = get_turf(card)
del(card)
qdel(card)
else
close_up()
if(mind)
del(mind)
qdel(mind)
..(gibbed)
ghostize()
del(src)
qdel(src)

View File

@@ -8,7 +8,7 @@
var/turf/T = get_turf_or_move(src.loc)
for (var/mob/M in viewers(T))
M.show_message("\red The data cable rapidly retracts back into its spool.", 3, "\red You hear a click and the sound of wire spooling rapidly.", 2)
del(src.cable)
qdel(src.cable)
regular_hud_updates()

View File

@@ -101,7 +101,6 @@
/mob/living/silicon/pai/Login()
..()
usr << browse_rsc('html/paigrid.png') // Go ahead and cache the interface resources as early as possible
// this function shows the information about being silenced as a pAI in the Status panel
@@ -117,10 +116,6 @@
if (src.client.statpanel == "Status")
show_silenced()
if (proc_holder_list.len)//Generic list for proc_holder objects.
for(var/obj/effect/proc_holder/P in proc_holder_list)
statpanel("[P.panel]","",P)
/mob/living/silicon/pai/check_eye(var/mob/user as mob)
if (!src.current)
return null

View File

@@ -55,9 +55,9 @@ var/datum/paiController/paiController // Global handler for pAI candidates
switch(option)
if("name")
t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text
t = sanitizeSafe(input("Enter a name for your pAI", "pAI Name", candidate.name) as text, MAX_NAME_LEN)
if(t)
candidate.name = sanitizeSafe(t, MAX_NAME_LEN)
candidate.name = t
if("desc")
t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message
if(t)

View File

@@ -29,7 +29,7 @@
var/obj/item/robot_parts/robot_component/comp = wrapped
brokenstate = comp.icon_state_broken
if(wrapped)
del wrapped
qdel(wrapped)
wrapped = new/obj/item/broken_device

View File

@@ -1,7 +1,7 @@
/mob/living/silicon/robot/dust()
//Delete the MMI first so that it won't go popping out.
if(mmi)
del(mmi)
qdel(mmi)
..()
/mob/living/silicon/robot/death(gibbed)

View File

@@ -14,7 +14,7 @@
lawupdate = 0
density = 1
req_access = list(access_engine, access_robotics)
integrated_light_power = 2
integrated_light_power = 3
local_transmit = 1
mob_bump_flag = SIMPLE_ANIMAL
@@ -24,6 +24,11 @@
//Used for self-mailing.
var/mail_destination = ""
var/obj/machinery/drone_fabricator/master_fabricator
var/law_type = /datum/ai_laws/drone
var/module_type = /obj/item/weapon/robot_module/drone
var/can_pull_size = 2
var/can_pull_mobs
holder_type = /obj/item/weapon/holder/drone
@@ -36,9 +41,6 @@
add_language("Robot Talk", 0)
add_language("Drone Talk", 1)
if(camera && "Robots" in camera.network)
camera.add_network("Engineering")
//They are unable to be upgraded, so let's give them a bit of a better battery.
cell.maxcharge = 10000
cell.charge = 10000
@@ -52,16 +54,18 @@
C.max_damage = 10
verbs -= /mob/living/silicon/robot/verb/Namepick
module = new /obj/item/weapon/robot_module/drone(src)
//Some tidying-up.
flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'NanoTrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
updateicon()
/mob/living/silicon/robot/drone/init()
laws = new /datum/ai_laws/drone()
if(!laws) laws = new law_type
if(!module) module = new module_type(src)
aiCamera = new/obj/item/device/camera/siliconcam/drone_camera(src)
flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'NanoTrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
spawn(1)
if(camera && ("Robots" in camera.network))
camera.add_network("Engineering")
//Redefining some robot procs...
/mob/living/silicon/robot/drone/SetName(pickedName as text)
@@ -91,26 +95,26 @@
/mob/living/silicon/robot/drone/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/borg/upgrade/))
user << "\red The maintenance drone chassis not compatible with \the [W]."
user << "<span class='danger'>\The [src] is not compatible with \the [W].</span>"
return
else if (istype(W, /obj/item/weapon/crowbar))
user << "The machine is hermetically sealed. You can't open the case."
user << "<span class='danger'>\The [src] is hermetically sealed. You can't open the case.</span>"
return
else if (istype(W, /obj/item/weapon/card/emag))
if(!client || stat == 2)
user << "\red There's not much point subverting this heap of junk."
user << "<span class='danger'>There's not much point subverting this heap of junk.</span>"
return
if(emagged)
src << "\red [user] attempts to load subversive software into you, but your hacked subroutined ignore the attempt."
user << "\red You attempt to subvert [src], but the sequencer has no effect."
src << "<span class='danger'>\The [user] attempts to load subversive software into you, but your hacked subroutines ignore the attempt.</span>"
user << "<span class='danger'>You attempt to subvert [src], but the sequencer has no effect.</span>"
return
user << "\red You swipe the sequencer across [src]'s interface and watch its eyes flicker."
src << "\red You feel a sudden burst of malware loaded into your execute-as-root buffer. Your tiny brain methodically parses, loads and executes the script."
user << "<span class='danger'>You swipe the sequencer across [src]'s interface and watch its eyes flicker.</span>"
src << "<span class='danger'>You feel a sudden burst of malware loaded into your execute-as-root buffer. Your tiny brain methodically parses, loads and executes the script.</span>"
var/obj/item/weapon/card/emag/emag = W
emag.uses--
@@ -130,7 +134,7 @@
src << "<b>Obey these laws:</b>"
laws.show_laws(src)
src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands."
src << "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and his commands.</span>"
return
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
@@ -138,14 +142,14 @@
if(stat == 2)
if(!config.allow_drone_spawn || emagged || health < -35) //It's dead, Dave.
user << "\red The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one."
user << "<span class='danger'>The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one.</span>"
return
if(!allowed(usr))
user << "\red Access denied."
user << "<span class='danger'>Access denied.</span>"
return
user.visible_message("\red \the [user] swipes \his ID card through \the [src], attempting to reboot it.", "\red You swipe your ID card through \the [src], attempting to reboot it.")
user.visible_message("<span class='danger'>\The [user] swipes \his ID card through \the [src], attempting to reboot it.</span>", "<span class='danger'>>You swipe your ID card through \the [src], attempting to reboot it.</span>")
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in world)
if(D.key && D.client)
@@ -155,7 +159,7 @@
return
else
user.visible_message("\red \the [user] swipes \his ID card through \the [src], attempting to shut it down.", "\red You swipe your ID card through \the [src], attempting to shut it down.")
user.visible_message("<span class='danger'>\The [user] swipes \his ID card through \the [src], attempting to shut it down.</span>", "<span class='danger'>You swipe your ID card through \the [src], attempting to shut it down.</span>")
if(emagged)
return
@@ -163,7 +167,7 @@
if(allowed(usr))
shut_down()
else
user << "\red Access denied."
user << "<span class='danger'>Access denied.</span>"
return
@@ -185,7 +189,7 @@
//Drones killed by damage will gib.
/mob/living/silicon/robot/drone/handle_regular_status_updates()
if(health <= -35 && src.stat != 2)
if((health <= -35 || (master_fabricator && src.z != master_fabricator.z)) && src.stat != 2)
timeofdeath = world.time
death() //Possibly redundant, having trouble making death() cooperate.
gib()
@@ -194,32 +198,31 @@
//DRONE MOVEMENT.
/mob/living/silicon/robot/drone/Process_Spaceslipping(var/prob_slip)
//TODO: Consider making a magboot item for drones to equip. ~Z
return 0
//CONSOLE PROCS
/mob/living/silicon/robot/drone/proc/law_resync()
if(stat != 2)
if(emagged)
src << "\red You feel something attempting to modify your programming, but your hacked subroutines are unaffected."
src << "<span class='danger'>You feel something attempting to modify your programming, but your hacked subroutines are unaffected.</span>"
else
src << "\red A reset-to-factory directive packet filters through your data connection, and you obediently modify your programming to suit it."
src << "<span class='danger'>A reset-to-factory directive packet filters through your data connection, and you obediently modify your programming to suit it.</span>"
full_law_reset()
show_laws()
/mob/living/silicon/robot/drone/proc/shut_down()
if(stat != 2)
if(emagged)
src << "\red You feel a system kill order percolate through your tiny brain, but it doesn't seem like a good idea to you."
src << "<span class='danger'>You feel a system kill order percolate through your tiny brain, but it doesn't seem like a good idea to you.</span>"
else
src << "\red You feel a system kill order percolate through your tiny brain, and you obediently destroy yourself."
src << "<span class='danger'>You feel a system kill order percolate through your tiny brain, and you obediently destroy yourself.</span>"
death()
/mob/living/silicon/robot/drone/proc/full_law_reset()
clear_supplied_laws()
clear_inherent_laws()
clear_ion_laws()
laws = new /datum/ai_laws/drone
laws = new law_type
//Reboot procs.
@@ -267,17 +270,32 @@
..()
else if(istype(AM,/obj/item))
var/obj/item/O = AM
if(O.w_class > 2)
if(O.w_class > can_pull_size)
src << "<span class='warning'>You are too small to pull that.</span>"
return
else
..()
else
src << "<span class='warning'>You are too small to pull that.</span>"
return
if(!can_pull_mobs)
src << "<span class='warning'>You are too small to pull that.</span>"
return
/mob/living/silicon/robot/drone/add_robot_verbs()
src.verbs |= silicon_verbs_subsystems
src.verbs |= silicon_subsystems
/mob/living/silicon/robot/drone/remove_robot_verbs()
src.verbs -= silicon_verbs_subsystems
src.verbs -= silicon_subsystems
/mob/living/silicon/robot/drone/construction
law_type = /datum/ai_laws/construction_drone
module_type = /obj/item/weapon/robot_module/drone/construction
can_pull_size = 5
can_pull_mobs = 1
/mob/living/silicon/robot/drone/construction/init()
..()
flavor_text = "It's a bulky construction drone stamped with a Sol Central glyph."
/mob/living/silicon/robot/drone/construction/updatename()
real_name = "construction drone ([rand(100,999)])"
name = real_name

View File

@@ -19,7 +19,7 @@
return
if(!allowed(user))
user << "\red Access denied."
user << "<span class='danger'>Access denied.</span>"
return
user.set_machine(src)
@@ -27,6 +27,8 @@
dat += "<B>Maintenance Units</B><BR>"
for(var/mob/living/silicon/robot/drone/D in world)
if(D.z != src.z)
continue
dat += "<BR>[D.real_name] ([D.stat == 2 ? "<font color='red'>INACTIVE" : "<font color='green'>ACTIVE"]</FONT>)"
dat += "<font dize = 9><BR>Cell charge: [D.cell.charge]/[D.cell.maxcharge]."
dat += "<BR>Currently located in: [get_area(D)]."
@@ -46,7 +48,7 @@
return
if(!allowed(usr))
usr << "\red Access denied."
usr << "<span class='danger'>Access denied.</span>"
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
@@ -61,11 +63,11 @@
return
drone_call_area = t_area
usr << "\blue You set the area selector to [drone_call_area]."
usr << "<span class='notice'>You set the area selector to [drone_call_area].</span>"
else if (href_list["ping"])
usr << "\blue You issue a maintenance request for all active drones, highlighting [drone_call_area]."
usr << "<span class='notice'>You issue a maintenance request for all active drones, highlighting [drone_call_area].</span>"
for(var/mob/living/silicon/robot/drone/D in world)
if(D.client && D.stat == 0)
D << "-- Maintenance drone presence requested in: [drone_call_area]."
@@ -75,7 +77,7 @@
var/mob/living/silicon/robot/drone/D = locate(href_list["resync"])
if(D.stat != 2)
usr << "\red You issue a law synchronization directive for the drone."
usr << "<span class='danger'>You issue a law synchronization directive for the drone.</span>"
D.law_resync()
else if (href_list["shutdown"])
@@ -83,7 +85,7 @@
var/mob/living/silicon/robot/drone/D = locate(href_list["shutdown"])
if(D.stat != 2)
usr << "\red You issue a kill command for the unfortunate drone."
usr << "<span class='danger'>You issue a kill command for the unfortunate drone.</span>"
message_admins("[key_name_admin(usr)] issued kill order for drone [key_name_admin(D)] from control console.")
log_game("[key_name(usr)] issued kill order for [key_name(src)] from control console.")
D.shut_down()
@@ -98,10 +100,10 @@
continue
dronefab = fab
usr << "\blue Drone fabricator located."
usr << "<span class='notice'>Drone fabricator located.</span>"
return
usr << "\red Unable to locate drone fabricator."
usr << "<span class='danger'>Unable to locate drone fabricator.</span>"
else if (href_list["toggle_fab"])
@@ -110,10 +112,10 @@
if(get_dist(src,dronefab) > 3)
dronefab = null
usr << "\red Unable to locate drone fabricator."
usr << "<span class='danger'>Unable to locate drone fabricator.</span>"
return
dronefab.produce_drones = !dronefab.produce_drones
usr << "\blue You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator."
usr << "<span class='notice'>You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator.</span>"
src.updateUsrDialog()

View File

@@ -2,10 +2,12 @@
//Limited use.
/obj/item/weapon/gripper
name = "magnetic gripper"
desc = "A simple grasping tool for synthetic assets."
desc = "A simple grasping tool specialized in construction and engineering work."
icon = 'icons/obj/device.dmi'
icon_state = "gripper"
flags = NOBLUDGEON
//Has a list of items that it can hold.
var/list/can_hold = list(
/obj/item/weapon/cell,
@@ -28,8 +30,14 @@
var/obj/item/wrapped = null // Item currently being held.
var/force_holder = null //
// VEEEEERY limited version for mining borgs. Basically only for swapping cells and upgrading the drills.
/obj/item/weapon/gripper/miner
name = "drill maintenance gripper"
desc = "A simple grasping tool for the maintenance of heavy drilling machines."
icon_state = "gripper-mining"
can_hold = list(
/obj/item/weapon/cell,
/obj/item/weapon/stock_parts
@@ -38,14 +46,58 @@
/obj/item/weapon/gripper/paperwork
name = "paperwork gripper"
desc = "A simple grasping tool for clerical work."
icon = 'icons/obj/device.dmi'
icon_state = "gripper"
can_hold = list(
/obj/item/weapon/clipboard,
/obj/item/weapon/paper,
/obj/item/weapon/paper_bundle,
/obj/item/weapon/card/id
/obj/item/weapon/card/id,
/obj/item/weapon/book,
/obj/item/weapon/newspaper
)
/obj/item/weapon/gripper/research //A general usage gripper, used for toxins/robotics/xenobio/etc
name = "scientific gripper"
icon_state = "gripper-sci"
desc = "A simple grasping tool suited to assist in a wide array of research applications."
can_hold = list(
/obj/item/weapon/cell,
/obj/item/weapon/stock_parts,
/obj/item/device/mmi,
/obj/item/robot_parts,
/obj/item/borg/upgrade,
/obj/item/device/flash, //to build borgs
/obj/item/organ/brain, //to insert into MMIs.
/obj/item/stack/cable_coil, //again, for borg building
/obj/item/weapon/circuitboard,
/obj/item/slime_extract,
/obj/item/weapon/reagent_containers/glass,
/obj/item/weapon/reagent_containers/food/snacks/monkeycube
)
/obj/item/weapon/gripper/service //Used to handle food, drinks, and seeds.
name = "service gripper"
icon_state = "gripper"
desc = "A simple grasping tool used to perform tasks in the service sector, such as handling food, drinks, and seeds."
can_hold = list(
/obj/item/weapon/reagent_containers/glass,
/obj/item/weapon/reagent_containers/food,
/obj/item/seeds,
/obj/item/weapon/grown
)
/obj/item/weapon/gripper/no_use //Used when you want to hold and put items in other things, but not able to 'use' the item
/obj/item/weapon/gripper/no_use/loader //This is used to disallow building with metal.
name = "sheet loader"
desc = "A specialized loading device, designed to pick up and insert sheets of materials inside machines."
icon_state = "gripper-sheet"
can_hold = list(
/obj/item/stack/sheet
)
/obj/item/weapon/gripper/attack_self(mob/user as mob)
@@ -53,6 +105,9 @@
return wrapped.attack_self(user)
return ..()
/obj/item/weapon/gripper/no_use/attack_self(mob/user as mob)
return
/obj/item/weapon/gripper/verb/drop_item()
set name = "Drop Item"
@@ -75,7 +130,12 @@
//update_icon()
/obj/item/weapon/gripper/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
return (wrapped ? wrapped.attack(M,user) : 0)
if(wrapped) //The force of the wrapped obj gets set to zero during the attack() and afterattack().
force_holder = wrapped.force
wrapped.force = 0.0
wrapped.attack(M,user)
return 1
return 0
/obj/item/weapon/gripper/afterattack(var/atom/target, var/mob/living/user, proximity, params)
@@ -97,6 +157,9 @@
if(!resolved && wrapped && target)
wrapped.afterattack(target,user,1)
//wrapped's force was set to zero. This resets it to the value it had before.
wrapped.force = force_holder
force_holder = null
//If wrapped was neither deleted nor put into target, put it back into the gripper.
if(wrapped && user && (wrapped.loc == user))
wrapped.loc = src
@@ -145,6 +208,21 @@
user.visible_message("<span class='danger'>[user] removes the power cell from [A]!</span>", "You remove the power cell.")
else if(istype(target,/mob/living/silicon/robot))
var/mob/living/silicon/robot/A = target
if(A.opened)
if(A.cell)
wrapped = A.cell
A.cell.add_fingerprint(user)
A.cell.updateicon()
A.updateicon()
A.cell.loc = src
A.cell = null
user.visible_message("<span class='danger'>[user] removes the power cell from [A]!</span>", "You remove the power cell.")
//TODO: Matter decompiler.
/obj/item/weapon/matter_decompiler
@@ -178,7 +256,7 @@
if(istype(M,/mob/living/simple_animal/lizard) || istype(M,/mob/living/simple_animal/mouse))
src.loc.visible_message("<span class='danger'>[src.loc] sucks [M] into its decompiler. There's a horrible crunching noise.</span>","<span class='danger'>It's a bit of a struggle, but you manage to suck [M] into your decompiler. It makes a series of visceral crunching noises.</span>")
new/obj/effect/decal/cleanable/blood/splatter(get_turf(src))
del(M)
qdel(M)
if(wood)
wood.add_charge(2000)
if(plastic)
@@ -201,7 +279,7 @@
if(!M || !D) return
D << "<span class='danger'>You carefully and thoroughly decompile [M], storing as much of its resources as you can within yourself.</span>"
del(M)
qdel(M)
new/obj/effect/decal/cleanable/blood/oil(get_turf(src))
if(metal)
@@ -269,7 +347,7 @@
else
continue
del(W)
qdel(W)
grabbed_something = 1
if(grabbed_something)

View File

@@ -1,3 +1,10 @@
/proc/count_drones()
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in world)
if(D.key && D.client)
drones++
return drones
/obj/machinery/drone_fabricator
name = "drone fabricator"
desc = "A large automated factory for producing maintenance drones."
@@ -8,13 +15,20 @@
idle_power_usage = 20
active_power_usage = 5000
var/fabricator_tag = "Exodus"
var/drone_progress = 0
var/produce_drones = 1
var/time_last_drone = 500
var/drone_type = /mob/living/silicon/robot/drone
icon = 'icons/obj/machines/drone_fab.dmi'
icon_state = "drone_fab_idle"
/obj/machinery/drone_fabricator/derelict
name = "construction drone fabricator"
fabricator_tag = "Derelict"
drone_type = /mob/living/silicon/robot/drone/construction
/obj/machinery/drone_fabricator/New()
..()
@@ -48,13 +62,6 @@
if(produce_drones && drone_progress >= 100 && istype(user,/mob/dead) && config.allow_drone_spawn && count_drones() < config.max_maint_drones)
user << "<BR><B>A drone is prepared. Select 'Join As Drone' from the Ghost tab to spawn as a maintenance drone.</B>"
/obj/machinery/drone_fabricator/proc/count_drones()
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in world)
if(D.key && D.client)
drones++
return drones
/obj/machinery/drone_fabricator/proc/create_drone(var/client/player)
if(stat & NOPOWER)
@@ -71,13 +78,12 @@
flick("h_lathe_leave",src)
time_last_drone = world.time
var/mob/living/silicon/robot/drone/new_drone = new(get_turf(src))
var/mob/living/silicon/robot/drone/new_drone = new drone_type(get_turf(src))
new_drone.transfer_personality(player)
new_drone.master_fabricator = src
drone_progress = 0
/mob/dead/verb/join_as_drone()
set category = "Ghost"
@@ -86,11 +92,11 @@
if(ticker.current_state < GAME_STATE_PLAYING)
src << "\red The game hasn't started yet!"
src << "<span class='danger'>The game hasn't started yet!</span>"
return
if(!(config.allow_drone_spawn))
src << "\red That verb is not currently permitted."
src << "<span class='danger'>That verb is not currently permitted.</span>"
return
if (!src.stat)
@@ -100,14 +106,14 @@
return 0 //something is terribly wrong
if(jobban_isbanned(src,"Cyborg"))
usr << "\red You are banned from playing synthetics and cannot spawn as a drone."
usr << "<span class='danger'>You are banned from playing synthetics and cannot spawn as a drone.</span>"
return
var/deathtime = world.time - src.timeofdeath
if(istype(src,/mob/dead/observer))
var/mob/dead/observer/G = src
if(G.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
usr << "\blue <B>Upon using the antagHUD you forfeighted the ability to join the round.</B>"
usr << "<span class='notice'>Upon using the antagHUD you forfeighted the ability to join the round.</span>"
return
var/deathtimeminutes = round(deathtime / 600)
@@ -125,16 +131,18 @@
usr << "You must wait 10 minutes to respawn as a drone!"
return
var/list/all_fabricators = list()
for(var/obj/machinery/drone_fabricator/DF in world)
if(DF.stat & NOPOWER || !DF.produce_drones)
continue
if(DF.count_drones() >= config.max_maint_drones)
src << "\red There are too many active drones in the world for you to spawn."
return
if(DF.drone_progress >= 100)
DF.create_drone(src.client)
return
all_fabricators[DF.fabricator_tag] = DF
src << "\red There are no available drone spawn points, sorry."
if(!all_fabricators.len)
src << "<span class='danger'>There are no available drone spawn points, sorry.</span>"
return
var/choice = input(src,"Which fabricator do you wish to use?") as null|anything in all_fabricators
if(choice)
var/obj/machinery/drone_fabricator/chosen_fabricator = all_fabricators[choice]
chosen_fabricator.create_drone(src.client)

View File

@@ -130,10 +130,11 @@
if (src.stat != 0)
uneq_all()
if(!is_component_functioning("radio"))
radio.on = 0
else
radio.on = 1
if(radio)
if(!is_component_functioning("radio"))
radio.on = 0
else
radio.on = 1
if(is_component_functioning("camera"))
src.blinded = 0

View File

@@ -73,7 +73,6 @@
var/datum/effect/effect/system/ion_trail_follow/ion_trail = null
var/datum/effect/effect/system/spark_spread/spark_system//So they can initialize sparks whenever/N
var/jeton = 0
var/borgwires = 31 // 0b11111
var/killswitch = 0
var/killswitch_time = 60
var/weapon_lock = 0
@@ -227,14 +226,28 @@
//If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
//Improved /N
/mob/living/silicon/robot/Del()
if(mmi)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside.
/mob/living/silicon/robot/Destroy()
if(mmi && mind)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside.
var/turf/T = get_turf(loc)//To hopefully prevent run time errors.
if(T) mmi.loc = T
if(mind) mind.transfer_to(mmi.brainmob)
if(mmi.brainmob)
mind.transfer_to(mmi.brainmob)
else
src << "<span class='danger'>Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug.</span>"
ghostize()
//ERROR("A borg has been destroyed, but its MMI lacked a brainmob, so the mind could not be transferred. Player: [ckey].")
mmi = null
if(connected_ai)
connected_ai.connected_robots -= src
..()
/mob/living/silicon/robot/proc/set_module_sprites(var/list/new_sprites)
module_sprites = new_sprites
//Custom_sprite check and entry
if (custom_sprite == 1)
module_sprites["Custom"] = "[src.ckey]-[modtype]"
return module_sprites
/mob/living/silicon/robot/proc/pick_module()
if(module)
return
@@ -247,130 +260,17 @@
if(module)
return
if(!(modtype in robot_modules))
return
module_sprites = list()
switch(modtype)
if("Standard")
module = new /obj/item/weapon/robot_module/standard(src)
module_sprites["Basic"] = "robot_old"
module_sprites["Android"] = "droid"
module_sprites["Default"] = "robot"
module_sprites["Drone"] = "drone-standard"
if("Service")
module = new /obj/item/weapon/robot_module/butler(src)
module.channels = list("Service" = 1)
module_sprites["Waitress"] = "Service"
module_sprites["Kent"] = "toiletbot"
module_sprites["Bro"] = "Brobot"
module_sprites["Rich"] = "maximillion"
module_sprites["Default"] = "Service2"
module_sprites["Drone"] = "drone-service" // How does this even work...? Oh well.
if("Clerical")
module = new /obj/item/weapon/robot_module/clerical(src)
module.channels = list("Service" = 1)
module_sprites["Waitress"] = "Service"
module_sprites["Kent"] = "toiletbot"
module_sprites["Bro"] = "Brobot"
module_sprites["Rich"] = "maximillion"
module_sprites["Default"] = "Service2"
module_sprites["Drone"] = "drone-service"
if("Miner")
module = new /obj/item/weapon/robot_module/miner(src)
module.channels = list("Supply" = 1)
if(camera && "Robots" in camera.network)
camera.add_network("MINE")
module_sprites["Basic"] = "Miner_old"
module_sprites["Advanced Droid"] = "droid-miner"
module_sprites["Treadhead"] = "Miner"
module_sprites["Drone"] = "drone-miner"
if("Crisis")
module = new /obj/item/weapon/robot_module/crisis(src)
module.channels = list("Medical" = 1)
if(camera && "Robots" in camera.network)
camera.add_network("Medical")
module_sprites["Basic"] = "Medbot"
module_sprites["Standard"] = "surgeon"
module_sprites["Advanced Droid"] = "droid-medical"
module_sprites["Needles"] = "medicalrobot"
module_sprites["Drone" ] = "drone-medical"
if("Surgeon")
module = new /obj/item/weapon/robot_module/surgeon(src)
module.channels = list("Medical" = 1)
if(camera && "Robots" in camera.network)
camera.add_network("Medical")
module_sprites["Basic"] = "Medbot"
module_sprites["Standard"] = "surgeon"
module_sprites["Advanced Droid"] = "droid-medical"
module_sprites["Needles"] = "medicalrobot"
module_sprites["Drone"] = "drone-surgery"
if("Security")
module = new /obj/item/weapon/robot_module/security(src)
module.channels = list("Security" = 1)
module_sprites["Basic"] = "secborg"
module_sprites["Red Knight"] = "Security"
module_sprites["Black Knight"] = "securityrobot"
module_sprites["Bloodhound"] = "bloodhound"
module_sprites["Bloodhound - Treaded"] = "secborg+tread"
module_sprites["Drone"] = "drone-sec"
if("Engineering")
module = new /obj/item/weapon/robot_module/engineering(src)
module.channels = list("Engineering" = 1)
if(camera && "Robots" in camera.network)
camera.add_network("Engineering")
module_sprites["Basic"] = "Engineering"
module_sprites["Antique"] = "engineerrobot"
module_sprites["Landmate"] = "landmate"
module_sprites["Landmate - Treaded"] = "engiborg+tread"
module_sprites["Drone"] = "drone-engineer"
if("Construction")
module = new /obj/item/weapon/robot_module/construction(src)
module.channels = list("Engineering" = 1)
if(camera && "Robots" in camera.network)
camera.add_network("Engineering")
module_sprites["Basic"] = "Engineering"
module_sprites["Antique"] = "engineerrobot"
module_sprites["Landmate"] = "landmate"
module_sprites["Landmate - Treaded"] = "engiborg+tread"
module_sprites["Drone"] = "drone-engineer"
if("Janitor")
module = new /obj/item/weapon/robot_module/janitor(src)
module.channels = list("Service" = 1)
module_sprites["Basic"] = "JanBot2"
module_sprites["Mopbot"] = "janitorrobot"
module_sprites["Mop Gear Rex"] = "mopgearrex"
module_sprites["Drone"] = "drone-janitor"
if("Combat")
module = new /obj/item/weapon/robot_module/combat(src)
module_sprites["Combat Android"] = "droid-combat"
module.channels = list("Security" = 1)
//languages
module.add_languages(src)
//Custom_sprite check and entry
if (custom_sprite == 1)
module_sprites["Custom"] = "[src.ckey]-[modtype]"
var/module_type = robot_modules[modtype]
module = new module_type(src)
hands.icon_state = lowertext(modtype)
feedback_inc("cyborg_[lowertext(modtype)]",1)
updatename()
if(modtype == "Medical" || modtype == "Security" || modtype == "Combat")
status_flags &= ~CANPUSH
choose_icon(6,module_sprites)
radio.config(module.channels)
set_module_sprites(module.sprites)
choose_icon(module_sprites.len + 1, module_sprites)
notify_ai(ROBOT_NOTIFICATION_NEW_MODULE, module.name)
/mob/living/silicon/robot/proc/updatename(var/prefix as text)
@@ -388,10 +288,10 @@
var/changed_name = ""
if(custom_name)
changed_name = custom_name
notify_ai(ROBOT_NOTIFICATION_NEW_NAME, real_name, changed_name)
else
changed_name = "[modtype] [braintype]-[num2text(ident)]"
notify_ai(ROBOT_NOTIFICATION_NEW_NAME, real_name, changed_name)
real_name = changed_name
name = real_name
@@ -654,7 +554,7 @@
C.r_arm = new/obj/item/robot_parts/r_arm(C)
C.updateicon()
new/obj/item/robot_parts/chest(loc)
src.Del()
qdel(src)
else
// Okay we're not removing the cell or an MMI, but maybe something else?
var/list/removable_components = list()
@@ -731,7 +631,7 @@
else
user << "Unable to locate a radio."
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)||istype(W, /obj/item/weapon/card/robot)) // trying to unlock the interface with an ID card
if(emagged)//still allow them to open the cover
user << "The interface seems slightly damaged"
if(opened)
@@ -795,11 +695,14 @@
src << "<b>Obey these laws:</b>"
laws.show_laws(src)
src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands."
if(src.module && istype(src.module, /obj/item/weapon/robot_module/miner))
if(src.module)
var/rebuild = 0
for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)
del(D)
src.module.modules += new /obj/item/weapon/pickaxe/diamonddrill(src.module)
src.module.rebuild()
qdel(D)
rebuild = 1
if(rebuild)
src.module.modules += new /obj/item/weapon/pickaxe/diamonddrill(src.module)
src.module.rebuild()
updateicon()
else
user << "You fail to hack [src]'s interface."
@@ -868,6 +771,10 @@
//if they are holding or wearing a card that has access, that works
if(check_access(H.get_active_hand()) || check_access(H.wear_id))
return 1
else if(istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = M
if(check_access(R.get_active_hand()) || istype(R.get_active_hand(), /obj/item/weapon/card/robot))
return 1
return 0
/mob/living/silicon/robot/proc/check_access(obj/item/weapon/card/id/I)
@@ -885,7 +792,6 @@
return 0
/mob/living/silicon/robot/updateicon()
overlays.Cut()
if(stat == 0)
overlays += "eyes-[module_sprites[icontype]]"
@@ -912,7 +818,7 @@
//Call when target overlay should be added/removed
/mob/living/silicon/robot/update_targeted()
if(!targeted_by && target_locked)
del(target_locked)
qdel(target_locked)
updateicon()
if (targeted_by && target_locked)
overlays += target_locked
@@ -1046,7 +952,7 @@
for(var/A in tile)
if(istype(A, /obj/effect))
if(istype(A, /obj/effect/rune) || istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/overlay))
del(A)
qdel(A)
else if(istype(A, /obj/item))
var/obj/item/cleaned_item = A
cleaned_item.clean_blood()
@@ -1115,7 +1021,6 @@
return
/mob/living/silicon/robot/proc/choose_icon(var/triesleft, var/list/module_sprites)
if(triesleft<1 || !module_sprites.len)
return
else
@@ -1124,6 +1029,8 @@
if (custom_sprite == 1)
icontype = "Custom"
triesleft = 0
else if(module_sprites.len == 1)
icontype = module_sprites[1]
else
icontype = input("Select an icon! [triesleft ? "You have [triesleft] more chances." : "This is your last try."]", "Robot", null, null) in module_sprites
@@ -1134,13 +1041,13 @@
icon_state = module_sprites[1]
return
overlays -= "eyes"
updateicon()
if (triesleft >= 1)
var/choice = input("Look at your icon - is this what you want?") in list("Yes","No")
if(choice=="No")
choose_icon(triesleft, module_sprites)
return
else
triesleft = 0
return
@@ -1155,11 +1062,11 @@
/mob/living/silicon/robot/proc/add_robot_verbs()
src.verbs |= robot_verbs_default
src.verbs |= silicon_verbs_subsystems
src.verbs |= silicon_subsystems
/mob/living/silicon/robot/proc/remove_robot_verbs()
src.verbs -= robot_verbs_default
src.verbs -= silicon_verbs_subsystems
src.verbs -= silicon_subsystems
// Uses power from cyborg's cell. Returns 1 on success or 0 on failure.
// Properly converts using CELLRATE now! Amount is in Joules.

View File

@@ -1,3 +1,138 @@
//A portable analyzer, for research borgs. This is better then giving them a gripper which can hold anything and letting them use the normal analyzer.
/obj/item/weapon/portable_destructive_analyzer
name = "Portable Destructive Analyzer"
icon = 'icons/obj/items.dmi'
icon_state = "portable_analyzer"
desc = "Similar to the stationary version, this rather unwieldy device allows you to break down objects in the name of science."
var/min_reliability = 90 //Can't upgrade, call it laziness or a drawback
var/datum/research/techonly/files //The device uses the same datum structure as the R&D computer/server.
//This analyzer can only store tech levels, however.
var/obj/item/weapon/loaded_item //What is currently inside the analyzer.
/obj/item/weapon/portable_destructive_analyzer/New()
..()
files = new /datum/research/techonly(src) //Setup the research data holder.
/obj/item/weapon/portable_destructive_analyzer/attack_self(user as mob)
var/response = alert(user, "Analyzing the item inside will *DESTROY* the item for good.\n\
Syncing to the research server will send the data that is stored inside to research.\n\
Ejecting will place the loaded item onto the floor.",
"What would you like to do?", "Analyze", "Sync", "Eject")
if(response == "Analyze")
if(loaded_item)
var/confirm = alert(user, "This will destroy the item inside forever. Are you sure?","Confirm Analyze","Yes","No")
if(confirm == "Yes") //This is pretty copypasta-y
user << "You activate the analyzer's microlaser, analyzing \the [loaded_item] and breaking it down."
flick("portable_analyzer_scan", src)
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
if(loaded_item.reliability >= min_reliability)
var/list/temp_tech = ConvertReqString2List(loaded_item.origin_tech)
for(var/T in temp_tech)
files.UpdateTech(T, temp_tech[T])
user << "\The [loaded_item] had level [temp_tech[T]] in [T]."
loaded_item = null
for(var/obj/I in contents)
for(var/mob/M in I.contents)
M.death()
if(istype(I,/obj/item/stack/sheet))//Only deconsturcts one sheet at a time instead of the entire stack
var/obj/item/stack/sheet/S = I
if(S.get_amount() > 1)
S.use(1)
loaded_item = S
else
qdel(S)
desc = initial(desc)
icon_state = initial(icon_state)
else
qdel(I)
desc = initial(desc)
icon_state = initial(icon_state)
else
return
else
user << "The [src] is empty. Put something inside it first."
if(response == "Sync")
var/success = 0
for(var/obj/machinery/r_n_d/server/S in machines)
if(S.disabled)
continue
for(var/datum/tech/T in files.known_tech) //Uploading
S.files.AddTech2Known(T)
for(var/datum/tech/T in S.files.known_tech) //Downloading
files.AddTech2Known(T)
success = 1
files.RefreshResearch()
if(success)
user << "You connect to the research server, push your data upstream to it, then pull the resulting merged data from the master branch."
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
else
user << "Reserch server ping response timed out. Unable to connect. Please contact the system administrator."
playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 1)
if(response == "Eject")
if(loaded_item)
loaded_item.loc = get_turf(src)
desc = initial(desc)
icon_state = initial(icon_state)
loaded_item = null
else
user << "The [src] is already empty."
/obj/item/weapon/portable_destructive_analyzer/afterattack(var/atom/target, var/mob/living/user, proximity)
if(!target)
return
if(!proximity)
return
if(!isturf(target.loc)) // Don't load up stuff if it's inside a container or mob!
return
if(istype(target,/obj/item))
if(loaded_item)
user << "Your [src] already has something inside. Analyze or eject it first."
return
var/obj/item/I = target
I.loc = src
loaded_item = I
for(var/mob/M in viewers())
M.show_message(text("<span class='notice'>[user] adds the [I] to the [src].</span>"), 1)
desc = initial(desc) + "<br>It is holding \the [loaded_item]."
flick("portable_analyzer_load", src)
icon_state = "portable_analyzer_full"
//This is used to unlock other borg covers.
/obj/item/weapon/card/robot //This is not a child of id cards, as to avoid dumb typechecks on computers.
name = "access code transmission device"
icon_state = "id-robot"
desc = "A circuit grafted onto the bottom of an ID card. It is used to transmit access codes into other robot chassis, \
allowing you to lock and unlock other robots' panels."
/obj/item/weapon/card/id/robot/attack_self() //override so borgs can't flash their IDs.
return
/obj/item/weapon/card/id/robot/read()
usr << "The ID card does not appear to have any writing on it."
return
//A harvest item for serviceborgs.
/obj/item/weapon/robot_harvester
name = "auto harvester"
desc = "A hand-held harvest tool that resembles a sickle. It uses energy to cut plant matter very efficently."
icon = 'icons/obj/weapons.dmi'
icon_state = "autoharvester"
/obj/item/weapon/robot_harvester/afterattack(var/atom/target, var/mob/living/user, proximity)
if(!target)
return
if(!proximity)
return
if(istype(target,/obj/machinery/portable_atmospherics/hydroponics))
var/obj/machinery/portable_atmospherics/hydroponics/T = target
T.harvest(user)
else
user << "Harvesting \a [target] is not the purpose of this tool. The [src] is for plants being grown."
// A special tray for the service droid. Allow droid to pick up and drop items as if they were using the tray normally
// Click on table to unload, click on item to load. Otherwise works identically to a tray.
// Unlike the base item "tray", robotrays ONLY pick up food, drinks and condiments.

View File

@@ -1,3 +1,18 @@
var/global/list/robot_modules = list(
"Standard" = /obj/item/weapon/robot_module/standard,
"Service" = /obj/item/weapon/robot_module/clerical/butler,
"Clerical" = /obj/item/weapon/robot_module/clerical/general,
"Research" = /obj/item/weapon/robot_module/research,
"Miner" = /obj/item/weapon/robot_module/miner,
"Crisis" = /obj/item/weapon/robot_module/medical/crisis,
"Surgeon" = /obj/item/weapon/robot_module/medical/surgeon,
"Security" = /obj/item/weapon/robot_module/security/general,
"Combat" = /obj/item/weapon/robot_module/security/combat,
"Engineering" = /obj/item/weapon/robot_module/engineering/general,
"Construction" = /obj/item/weapon/robot_module/engineering/construction,
"Janitor" = /obj/item/weapon/robot_module/janitor
)
/obj/item/weapon/robot_module
name = "robot module"
icon = 'icons/obj/module.dmi'
@@ -6,10 +21,51 @@
item_state = "electronic"
flags = CONDUCT
var/channels = list()
var/networks = list()
var/languages = list(LANGUAGE_SOL_COMMON = 1, LANGUAGE_TRADEBAND = 1, LANGUAGE_UNATHI = 0, LANGUAGE_SIIK_TAJR = 0, LANGUAGE_SKRELLIAN = 0, LANGUAGE_GUTTER = 0)
var/sprites = list()
var/can_be_pushed = 1
var/no_slip = 0
var/list/modules = list()
var/list/datum/matter_synth/synths = list()
var/obj/item/emag = null
var/obj/item/borg/upgrade/jetpack = null
var/list/subsystems = list()
var/list/obj/item/borg/upgrade/supported_upgrades = list()
// Bookkeeping
var/list/added_languages = list()
var/list/added_networks = list()
var/obj/item/device/radio/borg/modified_radio = null
var/list/modified_key = null
var/list/original_radio_channels = list()
/obj/item/weapon/robot_module/New(var/mob/living/silicon/robot/R)
..()
add_camera_networks(R)
add_languages(R)
add_radio_channels(R)
add_subsystems(R)
apply_status_flags(R)
/obj/item/weapon/robot_module/proc/Reset(var/mob/living/silicon/robot/R)
..()
remove_camera_networks(R)
remove_languages(R)
remove_radio_channels(R)
remove_subsystems(R)
remove_status_flags(R)
/obj/item/weapon/robot_module/Destroy()
qdel(modules)
qdel(synths)
qdel(emag)
qdel(jetpack)
modules = null
synths = null
emag = null
jetpack = null
..()
/obj/item/weapon/robot_module/emp_act(severity)
if(modules)
@@ -24,7 +80,6 @@
return
/obj/item/weapon/robot_module/proc/respawn_consumable(var/mob/living/silicon/robot/R, var/rate)
if(!synths || !synths.len)
return
@@ -39,16 +94,65 @@
modules += O
/obj/item/weapon/robot_module/proc/add_languages(var/mob/living/silicon/robot/R)
//full set of languages
R.add_language("Sol Common", 1)
R.add_language("Tradeband", 1)
R.add_language("Sinta'unathi", 0)
R.add_language("Siik'tajr", 0)
R.add_language("Skrellian", 0)
R.add_language("Gutter", 0)
for(var/language in languages)
if(R.add_language(language, languages[language]))
added_languages |= language
/obj/item/weapon/robot_module/proc/remove_languages(var/mob/living/silicon/robot/R)
for(var/language in added_languages)
R.remove_language(language)
added_languages.Cut()
/obj/item/weapon/robot_module/proc/add_camera_networks(var/mob/living/silicon/robot/R)
if(R.camera && "Robots" in R.camera.network)
for(var/network in networks)
if(!(network in R.camera.network))
R.camera.add_network(network)
added_networks |= network
/obj/item/weapon/robot_module/proc/remove_camera_networks(var/mob/living/silicon/robot/R)
if(R.camera)
R.camera.remove_networks(added_networks)
added_networks.Cut()
/obj/item/weapon/robot_module/proc/add_radio_channels(var/mob/living/silicon/robot/R)
if(!R.radio)
return
modified_radio = R.radio
modified_key = R.radio.keyslot
original_radio_channels = modified_radio.channels.Copy()
modified_radio.config(channels)
/obj/item/weapon/robot_module/proc/remove_radio_channels(var/mob/living/silicon/robot/R)
// Only reset if the original radio component hasn't been altered/replaced
if(!(R.radio && R.radio == modified_radio && R.radio.keyslot == modified_key))
return
modified_radio.config(original_radio_channels)
original_radio_channels.Cut()
/obj/item/weapon/robot_module/proc/add_subsystems(var/mob/living/silicon/robot/R)
R.verbs |= subsystems
/obj/item/weapon/robot_module/proc/remove_subsystems(var/mob/living/silicon/robot/R)
R.verbs -= subsystems
/obj/item/weapon/robot_module/proc/apply_status_flags(var/mob/living/silicon/robot/R)
if(!can_be_pushed)
R.status_flags &= ~CANPUSH
/obj/item/weapon/robot_module/proc/remove_status_flags(var/mob/living/silicon/robot/R)
if(!can_be_pushed)
R.status_flags |= CANPUSH
/obj/item/weapon/robot_module/standard
name = "standard robot module"
sprites = list( "Basic" = "robot_old",
"Android" = "droid",
"Default" = "robot",
"Drone" = "drone-standard"
)
/obj/item/weapon/robot_module/standard/New()
..()
@@ -61,10 +165,24 @@
src.emag = new /obj/item/weapon/melee/energy/sword(src)
return
/obj/item/weapon/robot_module/surgeon
name = "surgeon robot module"
/obj/item/weapon/robot_module/medical
name = "medical robot module"
channels = list("Medical" = 1)
networks = list(NETWORK_MEDICAL)
subsystems = list(/mob/living/silicon/proc/subsystem_crew_monitor)
can_be_pushed = 0
/obj/item/weapon/robot_module/surgeon/New()
/obj/item/weapon/robot_module/medical/surgeon
name = "surgeon robot module"
sprites = list(
"Basic" = "Medbot",
"Standard" = "surgeon",
"Advanced Droid" = "droid-medical",
"Needles" = "medicalrobot",
"Drone" = "drone-surgery"
)
/obj/item/weapon/robot_module/medical/surgeon/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/device/healthanalyzer(src)
@@ -99,16 +217,24 @@
return
/obj/item/weapon/robot_module/surgeon/respawn_consumable(var/mob/living/silicon/robot/R, var/amount)
/obj/item/weapon/robot_module/medical/surgeon/respawn_consumable(var/mob/living/silicon/robot/R, var/amount)
if(src.emag)
var/obj/item/weapon/reagent_containers/spray/PS = src.emag
PS.reagents.add_reagent("pacid", 2 * amount)
..()
/obj/item/weapon/robot_module/crisis
/obj/item/weapon/robot_module/medical/crisis
name = "crisis robot module"
sprites = list(
"Basic" = "Medbot",
"Standard" = "surgeon",
"Advanced Droid" = "droid-medical",
"Needles" = "medicalrobot",
"Drone - Medical" = "drone-medical",
"Drone - Chemistry" = "drone-chemistry"
)
/obj/item/weapon/robot_module/crisis/New()
/obj/item/weapon/robot_module/medical/crisis/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/borg/sight/hud/med(src)
@@ -145,7 +271,7 @@
return
/obj/item/weapon/robot_module/crisis/respawn_consumable(var/mob/living/silicon/robot/R, var/amount)
/obj/item/weapon/robot_module/medical/crisis/respawn_consumable(var/mob/living/silicon/robot/R, var/amount)
var/obj/item/weapon/reagent_containers/syringe/S = locate() in src.modules
if(S.mode == 2)
@@ -160,10 +286,25 @@
..()
/obj/item/weapon/robot_module/construction
name = "construction robot module"
/obj/item/weapon/robot_module/construction/New()
/obj/item/weapon/robot_module/engineering
name = "engineering robot module"
channels = list("Engineering" = 1)
networks = list(NETWORK_ENGINEERING)
subsystems = list(/mob/living/silicon/proc/subsystem_power_monitor)
sprites = list(
"Basic" = "Engineering",
"Antique" = "engineerrobot",
"Landmate" = "landmate",
"Landmate - Treaded" = "engiborg+tread",
"Drone" = "drone-engineer"
)
/obj/item/weapon/robot_module/engineering/construction
name = "construction robot module"
no_slip = 1
/obj/item/weapon/robot_module/engineering/construction/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/borg/sight/meson(src)
@@ -191,17 +332,14 @@
src.modules += R
var/obj/item/stack/sheet/plasteel/cyborg/S = new /obj/item/stack/sheet/plasteel/cyborg(src)
S.synths = list(metal)
S.synths = list(plasteel)
src.modules += S
var/obj/item/stack/sheet/glass/reinforced/cyborg/RG = new /obj/item/stack/sheet/glass/reinforced/cyborg(src)
RG.synths = list(metal, glass)
src.modules += RG
/obj/item/weapon/robot_module/engineering
name = "engineering robot module"
/obj/item/weapon/robot_module/engineering/New()
/obj/item/weapon/robot_module/engineering/general/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/borg/sight/meson(src)
@@ -259,8 +397,23 @@
/obj/item/weapon/robot_module/security
name = "security robot module"
channels = list("Security" = 1)
networks = list(NETWORK_SECURITY)
subsystems = list(/mob/living/silicon/proc/subsystem_crew_monitor)
can_be_pushed = 0
supported_upgrades = list(/obj/item/borg/upgrade/tasercooler)
/obj/item/weapon/robot_module/security/New()
/obj/item/weapon/robot_module/security/general
sprites = list(
"Basic" = "secborg",
"Red Knight" = "Security",
"Black Knight" = "securityrobot",
"Bloodhound" = "bloodhound",
"Bloodhound - Treaded" = "secborg+tread",
"Drone" = "drone-sec"
)
/obj/item/weapon/robot_module/security/general/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/borg/sight/hud/sec(src)
@@ -288,6 +441,13 @@
/obj/item/weapon/robot_module/janitor
name = "janitorial robot module"
channels = list("Service" = 1)
sprites = list(
"Basic" = "JanBot2",
"Mopbot" = "janitorrobot",
"Mop Gear Rex" = "mopgearrex",
"Drone" = "drone-janitor"
)
/obj/item/weapon/robot_module/janitor/New()
..()
@@ -308,14 +468,40 @@
var/obj/item/weapon/reagent_containers/spray/S = src.emag
S.reagents.add_reagent("lube", 2 * amount)
/obj/item/weapon/robot_module/butler
/obj/item/weapon/robot_module/clerical
name = "service robot module"
channels = list("Service" = 1)
languages = list(
LANGUAGE_SOL_COMMON = 1,
LANGUAGE_UNATHI = 1,
LANGUAGE_SIIK_MAAS = 1,
LANGUAGE_SIIK_TAJR = 0,
LANGUAGE_SKRELLIAN = 1,
LANGUAGE_ROOTSPEAK = 1,
LANGUAGE_TRADEBAND = 1,
LANGUAGE_GUTTER = 1
)
/obj/item/weapon/robot_module/butler/New()
/obj/item/weapon/robot_module/clerical/butler
sprites = list( "Waitress" = "Service",
"Kent" = "toiletbot",
"Bro" = "Brobot",
"Rich" = "maximillion",
"Default" = "Service2",
"Drone - Service" = "drone-service",
"Drone - Hydro" = "drone-hydro"
)
/obj/item/weapon/robot_module/clerical/butler/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/weapon/reagent_containers/food/drinks/cans/beer(src)
src.modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src)
src.modules += new /obj/item/weapon/gripper/service(src)
src.modules += new /obj/item/weapon/reagent_containers/glass/bucket(src)
src.modules += new /obj/item/weapon/minihoe(src)
src.modules += new /obj/item/weapon/hatchet(src)
src.modules += new /obj/item/device/analyzer/plant_analyzer(src)
src.modules += new /obj/item/weapon/storage/bag/plants(src)
src.modules += new /obj/item/weapon/robot_harvester(src)
var/obj/item/weapon/rsf/M = new /obj/item/weapon/rsf(src)
M.stored_matter = 30
@@ -338,39 +524,27 @@
src.emag.name = "Mickey Finn's Special Brew"
return
/obj/item/weapon/robot_module/butler/add_languages(var/mob/living/silicon/robot/R)
//full set of languages
R.add_language("Sol Common", 1)
R.add_language("Sinta'unathi", 1)
R.add_language("Siik'maas", 1)
R.add_language("Siik'tajr", 0)
R.add_language("Skrellian", 1)
R.add_language("Rootspeak", 1)
R.add_language("Tradeband", 1)
R.add_language("Gutter", 1)
/obj/item/weapon/robot_module/clerical
/obj/item/weapon/robot_module/clerical/general
name = "clerical robot module"
sprites = list(
"Waitress" = "Service",
"Kent" = "toiletbot",
"Bro" = "Brobot",
"Rich" = "maximillion",
"Default" = "Service2",
"Drone" = "drone-service"
)
/obj/item/weapon/robot_module/clerical/New()
/obj/item/weapon/robot_module/clerical/general/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/weapon/pen/robopen(src)
src.modules += new /obj/item/weapon/form_printer(src)
src.modules += new /obj/item/weapon/gripper/paperwork(src)
src.modules += new /obj/item/weapon/hand_labeler(src)
src.emag = new /obj/item/weapon/stamp/denied(src)
/obj/item/weapon/robot_module/clerical/add_languages(var/mob/living/silicon/robot/R)
R.add_language("Sol Common", 1)
R.add_language("Sinta'unathi", 1)
R.add_language("Siik'maas", 1)
R.add_language("Siik'tajr", 0)
R.add_language("Skrellian", 1)
R.add_language("Rootspeak", 1)
R.add_language("Tradeband", 1)
R.add_language("Gutter", 1)
/obj/item/weapon/robot_module/butler/respawn_consumable(var/mob/living/silicon/robot/R, var/amount)
/obj/item/weapon/robot_module/general/butler/respawn_consumable(var/mob/living/silicon/robot/R, var/amount)
var/obj/item/weapon/reagent_containers/food/condiment/enzyme/E = locate() in src.modules
E.reagents.add_reagent("enzyme", 2 * amount)
if(src.emag)
@@ -379,6 +553,15 @@
/obj/item/weapon/robot_module/miner
name = "miner robot module"
channels = list("Supply" = 1)
networks = list(NETWORK_MINE)
sprites = list(
"Basic" = "Miner_old",
"Advanced Droid" = "droid-miner",
"Treadhead" = "Miner",
"Drone" = "drone-miner"
)
supported_upgrades = list(/obj/item/borg/upgrade/jetpack)
/obj/item/weapon/robot_module/miner/New()
..()
@@ -395,8 +578,53 @@
src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src)
return
/obj/item/weapon/robot_module/research
name = "research module"
channels = list("Science" = 1)
sprites = list(
"Droid" = "droid-science",
"Drone" = "drone-science"
)
/obj/item/weapon/robot_module/research/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/weapon/portable_destructive_analyzer(src)
src.modules += new /obj/item/weapon/gripper/research(src)
src.modules += new /obj/item/weapon/gripper/no_use/loader(src)
src.modules += new /obj/item/device/robotanalyzer(src)
src.modules += new /obj/item/weapon/card/robot(src)
src.modules += new /obj/item/weapon/wrench(src)
src.modules += new /obj/item/weapon/screwdriver(src)
src.modules += new /obj/item/weapon/crowbar(src)
src.modules += new /obj/item/weapon/scalpel(src)
src.modules += new /obj/item/weapon/circular_saw(src)
src.modules += new /obj/item/weapon/extinguisher/mini(src)
src.modules += new /obj/item/weapon/reagent_containers/syringe(src)
src.modules += new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
src.emag = new /obj/item/weapon/hand_tele(src)
var/datum/matter_synth/nanite = new /datum/matter_synth/nanite(10000)
synths += nanite
var/obj/item/stack/nanopaste/N = new /obj/item/stack/nanopaste(src)
N.uses_charge = 1
N.charge_costs = list(1000)
N.synths = list(nanite)
src.modules += N
return
/obj/item/weapon/robot_module/syndicate
name = "illegal robot module"
languages = list(
LANGUAGE_SOL_COMMON = 1,
LANGUAGE_TRADEBAND = 1,
LANGUAGE_UNATHI = 0,
LANGUAGE_SIIK_TAJR = 0,
LANGUAGE_SKRELLIAN = 0,
LANGUAGE_GUTTER = 1
)
/obj/item/weapon/robot_module/syndicate/New(var/mob/living/silicon/robot/R)
..()
@@ -410,17 +638,9 @@
R.internals = jetpack
return
/obj/item/weapon/robot_module/syndicate/add_languages(var/mob/living/silicon/robot/R)
//full set of languages
R.add_language("Sol Common", 1)
R.add_language("Tradeband", 1)
R.add_language("Sinta'unathi", 0)
R.add_language("Siik'tajr", 0)
R.add_language("Skrellian", 0)
R.add_language("Gutter", 1)
/obj/item/weapon/robot_module/combat
/obj/item/weapon/robot_module/security/combat
name = "combat robot module"
sprites = list("Combat Android" = "droid-combat")
/obj/item/weapon/robot_module/combat/New()
..()
@@ -435,6 +655,7 @@
/obj/item/weapon/robot_module/drone
name = "drone module"
no_slip = 1
/obj/item/weapon/robot_module/drone/New()
..()
@@ -446,7 +667,7 @@
src.modules += new /obj/item/device/multitool(src)
src.modules += new /obj/item/device/lightreplacer(src)
src.modules += new /obj/item/weapon/gripper(src)
src.modules += new /obj/item/weapon/reagent_containers/spray/cleaner/drone(src)
src.modules += new /obj/item/weapon/soap(src)
src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src)
src.emag.name = "Plasma Cutter"
@@ -504,16 +725,18 @@
P.synths = list(plastic)
src.modules += P
/obj/item/weapon/robot_module/drone/add_languages(var/mob/living/silicon/robot/R)
return //not much ROM to spare in that tiny microprocessor!
/obj/item/weapon/robot_module/drone/construction
name = "construction drone module"
channels = list("Engineering" = 1)
languages = list()
/obj/item/weapon/robot_module/drone/construction/New()
..()
src.modules += new /obj/item/weapon/rcd/borg(src)
/obj/item/weapon/robot_module/drone/respawn_consumable(var/mob/living/silicon/robot/R, var/amount)
var/obj/item/weapon/reagent_containers/spray/cleaner/C = locate() in src.modules
C.reagents.add_reagent("cleaner", 3 * amount)
var/obj/item/device/lightreplacer/LR = locate() in src.modules
LR.Charge(R, amount)
..()
return
@@ -521,7 +744,5 @@
/obj/item/proc/is_robot_module()
if (!istype(src.loc, /mob/living/silicon/robot))
return 0
var/mob/living/silicon/robot/R = src.loc
return (src in R.module.modules)

View File

@@ -1,5 +1,5 @@
/mob/living/silicon/robot/Process_Spaceslipping(var/prob_slip)
if(module && (istype(module,/obj/item/weapon/robot_module/construction) || istype(module,/obj/item/weapon/robot_module/drone)))
if(module && module.no_slip)
return 0
..(prob_slip)

View File

@@ -1,147 +0,0 @@
// robot_upgrades.dm
// Contains various borg upgrades.
/obj/item/borg/upgrade/
name = "A borg upgrade module."
desc = "Protected by FRM."
icon = 'icons/obj/module.dmi'
icon_state = "cyborg_upgrade"
var/construction_time = 120
var/construction_cost = list("metal"=10000)
var/locked = 0
var/require_module = 0
var/installed = 0
/obj/item/borg/upgrade/proc/action()
return
/obj/item/borg/upgrade/reset/
name = "Borg module reset board"
desc = "Used to reset a borg's module. Destroys any other upgrades applied to the borg."
icon_state = "cyborg_upgrade1"
require_module = 1
/obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/R)
R.uneq_all()
del(R.module)
R.module = null
R.modtype = "robot"
R.real_name = "Cyborg [R.ident]"
R.name = R.real_name
R.nopush = 0
R.hands.icon_state = "nomod"
R.base_icon = "robot"
R.icon_state = "robot"
R.updateicon()
R.languages = list()
R.speech_synthesizer_langs = list()
return 1
/obj/item/borg/upgrade/flashproof/
name = "Borg Flash-Supression"
desc = "A highly advanced, complicated system for supressing incoming flashes directed at the borg's optical processing system."
construction_cost = list("metal"=10000,"gold"=2000,"silver"=3000,"glass"=2000, "diamond"=5000)
icon_state = "cyborg_upgrade4"
require_module = 1
/obj/item/borg/upgrade/flashproof/New() // Why the fuck does the fabricator make a new instance of all the items?
//desc = "Sunglasses with duct tape." // Why? D:
/obj/item/borg/upgrade/flashproof/action(var/mob/living/silicon/robot/R)
if(R.module)
R.module += src
return 1
/obj/item/borg/upgrade/restart/
name = "Borg emergancy restart module"
desc = "Used to force a restart of a disabled-but-repaired borg, bringing it back online."
construction_cost = list("metal"=60000 , "glass"=5000)
icon_state = "cyborg_upgrade1"
/obj/item/borg/upgrade/restart/action(var/mob/living/silicon/robot/R)
if(!R.key)
for(var/mob/dead/observer/ghost in world)
if(ghost.corpse == R && ghost.client)
ghost.client.mob = ghost.corpse
if(R.health < 0)
usr << "You have to repair the borg before using this module!"
return 0
R.stat = 0
return 1
/obj/item/borg/upgrade/vtec/
name = "Borg VTEC Module"
desc = "Used to kick in a borgs VTEC systems, increasing their speed."
construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 5000)
icon_state = "cyborg_upgrade2"
require_module = 1
/obj/item/borg/upgrade/vtec/action(var/mob/living/silicon/robot/R)
if(R.speed == -1)
return 0
R.speed--
return 1
/obj/item/borg/upgrade/tasercooler/
name = "Borg Rapid Taser Cooling Module"
desc = "Used to cool a mounted taser, increasing the potential current in it and thus its recharge rate.."
construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 2000, "diamond" = 500)
icon_state = "cyborg_upgrade3"
require_module = 1
/obj/item/borg/upgrade/tasercooler/action(var/mob/living/silicon/robot/R)
if(!istype(R.module, /obj/item/weapon/robot_module/security))
R << "Upgrade mounting error! No suitable hardpoint detected!"
usr << "There's no mounting point for the module!"
return 0
var/obj/item/weapon/gun/energy/taser/mounted/cyborg/T = locate() in R.module
if(!T)
T = locate() in R.module.contents
if(!T)
T = locate() in R.module.modules
if(!T)
usr << "This cyborg has had its taser removed!"
return 0
if(T.recharge_time <= 2)
R << "Maximum cooling achieved for this hardpoint!"
usr << "There's no room for another cooling unit!"
return 0
else
T.recharge_time = max(2 , T.recharge_time - 4)
return 1
/obj/item/borg/upgrade/jetpack/
name = "Mining Borg Jetpack"
desc = "A carbon dioxide jetpack suitable for low-gravity mining operations"
construction_cost = list("metal"=10000,"phoron"=15000,"uranium" = 20000)
icon_state = "cyborg_upgrade3"
require_module = 1
/obj/item/borg/upgrade/jetpack/action(var/mob/living/silicon/robot/R)
if(!istype(R.module, /obj/item/weapon/robot_module/miner))
R << "Upgrade mounting error! No suitable hardpoint detected!"
usr << "There's no mounting point for the module!"
return 0
else
R.module.modules += new/obj/item/weapon/tank/jetpack/carbondioxide
for(var/obj/item/weapon/tank/jetpack/carbondioxide in R.module.modules)
R.internals = src
R.icon_state="Miner+j"
return 1

View File

@@ -31,7 +31,7 @@
add_language("Galactic Common")
init_subsystems()
/mob/living/silicon/Del()
/mob/living/silicon/Destroy()
for(var/datum/alarm_handler/AH in alarm_manager.all_handlers)
AH.unregister(src)
..()
@@ -210,9 +210,19 @@
var/dat = "<b><font size = 5>Known Languages</font></b><br/><br/>"
if(default_language)
dat += "Current default language: [default_language] - <a href='byond://?src=\ref[src];default_lang=reset'>reset</a><br/><br/>"
for(var/datum/language/L in languages)
if(!(L.flags & NONGLOBAL))
dat += "<b>[L.name] (:[L.key])</b><br/>Speech Synthesizer: <i>[(L in speech_synthesizer_langs)? "YES":"NOT SUPPORTED"]</i><br/>[L.desc]<br/><br/>"
var/default_str
if(L == default_language)
default_str = " - default - <a href='byond://?src=\ref[src];default_lang=reset'>reset</a>"
else
default_str = " - <a href='byond://?src=\ref[src];default_lang=[L]'>set default</a>"
var/synth = (L in speech_synthesizer_langs)
dat += "<b>[L.name] (:[L.key])</b>[synth ? default_str : null]<br/>Speech Synthesizer: <i>[synth ? "YES" : "NOT SUPPORTED"]</i><br/>[L.desc]<br/><br/>"
src << browse(dat, "window=checklanguage")
return
@@ -268,14 +278,6 @@
updatehealth()
/mob/living/silicon/proc/init_subsystems()
alarm_monitor = new/obj/nano_module/alarm_monitor/borg(src)
law_manager = new/obj/nano_module/law_manager(src)
for(var/datum/alarm_handler/AH in alarm_manager.all_handlers)
AH.register(src, /mob/living/silicon/proc/receive_alarm)
queued_alarms[AH] = list() // Makes sure alarms remain listed in consistent order
/mob/living/silicon/proc/receive_alarm(var/datum/alarm_handler/alarm_handler, var/datum/alarm/alarm, was_raised)
if(!next_alarm_notice)
next_alarm_notice = world.time + SecondsToTicks(10)

View File

@@ -1,26 +1,101 @@
/mob/living/silicon
var/list/silicon_verbs_subsystems = list(
var/register_alarms = 1
var/obj/nano_module/alarm_monitor/alarm_monitor
var/obj/nano_module/atmos_control/atmos_control
var/obj/nano_module/crew_monitor/crew_monitor
var/obj/nano_module/law_manager/law_manager
var/obj/nano_module/power_monitor/power_monitor
var/obj/nano_module/rcon/rcon
var/alarm_monitor_type = /obj/nano_module/alarm_monitor/borg
/mob/living/silicon
alarm_monitor_type = /obj/nano_module/alarm_monitor/borg
var/list/silicon_subsystems = list(
/mob/living/silicon/proc/subsystem_alarm_monitor,
/mob/living/silicon/proc/subsystem_law_manager
)
// Subsystems
var/obj/nano_module/alarm_monitor = null
var/obj/nano_module/law_manager = null
/mob/living/silicon/robot/syndicate
silicon_verbs_subsystems = list(
/mob/living/silicon/proc/subsystem_law_manager
/mob/living/silicon/ai
alarm_monitor_type = /obj/nano_module/alarm_monitor/ai
silicon_subsystems = list(
/mob/living/silicon/proc/subsystem_alarm_monitor,
/mob/living/silicon/proc/subsystem_atmos_control,
/mob/living/silicon/proc/subsystem_crew_monitor,
/mob/living/silicon/proc/subsystem_law_manager,
/mob/living/silicon/proc/subsystem_power_monitor,
/mob/living/silicon/proc/subsystem_rcon
)
/mob/living/silicon/robot/syndicate
register_alarms = 0
silicon_subsystems = list(/mob/living/silicon/proc/subsystem_law_manager)
/mob/living/silicon/proc/init_subsystems()
alarm_monitor = new alarm_monitor_type(src)
atmos_control = new(src)
crew_monitor = new(src)
law_manager = new(src)
power_monitor = new(src)
rcon = new(src)
if(!register_alarms)
return
for(var/datum/alarm_handler/AH in alarm_manager.all_handlers)
AH.register(src, /mob/living/silicon/proc/receive_alarm)
queued_alarms[AH] = list() // Makes sure alarms remain listed in consistent order
/********************
* Alarm Monitor *
********************/
/mob/living/silicon/proc/subsystem_alarm_monitor()
set name = "Alarm Monitor"
set category = "Subystems"
alarm_monitor.ui_interact(usr)
alarm_monitor.ui_interact(usr, state = self_state)
/********************
* Atmos Control *
********************/
/mob/living/silicon/proc/subsystem_atmos_control()
set category = "Subystems"
set name = "Atmospherics Control"
atmos_control.ui_interact(usr, state = self_state)
/********************
* Crew Monitor *
********************/
/mob/living/silicon/proc/subsystem_crew_monitor()
set category = "Subystems"
set name = "Crew Monitor"
crew_monitor.ui_interact(usr, state = self_state)
/****************
* Law Manager *
****************/
/mob/living/silicon/proc/subsystem_law_manager()
set name = "Law Manager"
set category = "Subystems"
law_manager.ui_interact(usr)
law_manager.ui_interact(usr, state = self_state)
/********************
* Power Monitor *
********************/
/mob/living/silicon/proc/subsystem_power_monitor()
set category = "Subystems"
set name = "Power Monitor"
power_monitor.ui_interact(usr, state = self_state)
/************
* RCON *
************/
/mob/living/silicon/proc/subsystem_rcon()
set category = "Subystems"
set name = "RCON"
rcon.ui_interact(usr, state = self_state)

View File

@@ -20,7 +20,7 @@
..()
parent = new_parent
/mob/living/simple_animal/bee/Del()
/mob/living/simple_animal/bee/Destroy()
if(parent)
parent.owned_bee_swarms.Remove(src)
..()
@@ -107,7 +107,7 @@
if(feral > 0)
src.strength += B.strength
del(B)
qdel(B)
src.icon_state = "bees[src.strength]"
if(strength > 5)
icon_state = "bees_swarm"
@@ -120,7 +120,7 @@
B.icon_state = "bees[B.strength]"
if(src.strength <= 0)
del(src)
qdel(src)
return
src.icon_state = "bees[B.strength]"
var/turf/simulated/floor/T = get_turf(get_step(src, pick(1,2,4,8)))
@@ -169,7 +169,7 @@
if(!parent && prob(10))
strength -= 1
if(strength <= 0)
del(src)
qdel(src)
else if(strength <= 5)
icon_state = "bees[strength]"

View File

@@ -143,7 +143,7 @@
if(!host.lastKnownIP)
host.lastKnownIP = b2h_ip
del(host_brain)
qdel(host_brain)
/mob/living/simple_animal/borer/proc/leave_host()

View File

@@ -304,7 +304,7 @@
host.computer_id = null
host.lastKnownIP = null
del(host_brain)
qdel(host_brain)
host_brain = new(src)
host_brain.ckey = host.ckey

View File

@@ -1,4 +1,3 @@
/mob/living/simple_animal/construct
name = "Construct"
real_name = "Construct"
@@ -6,8 +5,8 @@
speak_emote = list("hisses")
emote_hear = list("wails","screeches")
response_help = "thinks better of touching"
response_disarm = "flails at"
response_harm = "punches"
response_disarm = "flailed at"
response_harm = "punched"
icon_dead = "shade_dead"
speed = -1
a_intent = I_HURT
@@ -15,7 +14,7 @@
status_flags = CANPUSH
universal_speak = 0
universal_understand = 1
attack_sound = 'sound/weapons/punch1.ogg'
attack_sound = 'sound/weapons/spiderlunge.ogg'
min_oxy = 0
max_oxy = 0
min_tox = 0
@@ -25,7 +24,7 @@
min_n2 = 0
max_n2 = 0
minbodytemp = 0
show_stat_health = 0
show_stat_health = 1
faction = "cult"
supernatural = 1
var/nullblock = 0
@@ -35,6 +34,9 @@
var/list/construct_spells = list()
/mob/living/simple_animal/construct/cultify()
return
/mob/living/simple_animal/construct/New()
..()
name = text("[initial(name)] ([rand(1, 1000)])")
@@ -42,14 +44,15 @@
add_language("Cult")
add_language("Occult")
for(var/spell in construct_spells)
spell_list += new spell(src)
src.add_spell(new spell, "const_spell_ready")
updateicon()
add_glow()
/mob/living/simple_animal/construct/death()
new /obj/item/weapon/ectoplasm (src.loc)
..(null,"collapses in a shattered heap.")
ghostize()
del src
qdel(src)
/mob/living/simple_animal/construct/attack_generic(var/mob/user)
if(istype(user, /mob/living/simple_animal/construct/builder))
@@ -97,10 +100,10 @@
mob_size = 20
speed = 3
environment_smash = 2
attack_sound = 'sound/weapons/punch3.ogg'
attack_sound = 'sound/weapons/heavysmash.ogg'
status_flags = 0
resistance = 10
construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall)
construct_spells = list(/spell/aoe_turf/conjure/forcewall/lesser)
/mob/living/simple_animal/construct/armoured/Life()
weakened = 0
@@ -148,8 +151,8 @@
speed = -1
environment_smash = 1
see_in_dark = 7
attack_sound = 'sound/weapons/bladeslice.ogg'
construct_spells = list(/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift)
attack_sound = 'sound/weapons/rapidslice.ogg'
construct_spells = list(/spell/targeted/ethereal_jaunt/shift)
/////////////////////////////Artificer/////////////////////////
@@ -165,18 +168,20 @@
icon_living = "artificer"
maxHealth = 50
health = 50
response_harm = "viciously beats"
response_harm = "viciously beaten"
harm_intent_damage = 5
melee_damage_lower = 5
melee_damage_upper = 5
attacktext = "rammed"
speed = 0
environment_smash = 2
attack_sound = 'sound/weapons/punch2.ogg'
construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser,
/obj/effect/proc_holder/spell/aoe_turf/conjure/wall,
/obj/effect/proc_holder/spell/aoe_turf/conjure/floor,
/obj/effect/proc_holder/spell/aoe_turf/conjure/soulstone,)
environment_smash = 1
attack_sound = 'sound/weapons/rapidslice.ogg'
construct_spells = list(/spell/aoe_turf/conjure/construct/lesser,
/spell/aoe_turf/conjure/wall,
/spell/aoe_turf/conjure/floor,
/spell/aoe_turf/conjure/soulstone,
/spell/aoe_turf/conjure/pylon
)
/////////////////////////////Behemoth/////////////////////////
@@ -192,17 +197,18 @@
maxHealth = 750
health = 750
speak_emote = list("rumbles")
response_harm = "harmlessly punches"
response_harm = "harmlessly punched"
harm_intent_damage = 0
melee_damage_lower = 50
melee_damage_upper = 50
attacktext = "brutally crushed"
speed = 5
environment_smash = 2
attack_sound = 'sound/weapons/punch4.ogg'
attack_sound = 'sound/weapons/heavysmash.ogg'
resistance = 10
var/energy = 0
var/max_energy = 1000
construct_spells = list(/spell/aoe_turf/conjure/forcewall/lesser)
////////////////////////Harvester////////////////////////////////
@@ -219,14 +225,110 @@
health = 150
melee_damage_lower = 25
melee_damage_upper = 25
attacktext = "violently stabs"
attacktext = "violently stabbed"
speed = -1
environment_smash = 1
see_in_dark = 7
attack_sound = 'sound/weapons/pierce.ogg'
construct_spells = list(
//spell/targeted/harvest,
//spell/aoe_turf/knock/harvester,
//spell/rune_write
/spell/targeted/harvest,
/spell/aoe_turf/knock/harvester,
/spell/rune_write
)
////////////////Glow//////////////////
/mob/living/simple_animal/construct/proc/add_glow()
overlays = 0
var/overlay_layer = LIGHTING_LAYER+1
if(layer != MOB_LAYER)
overlay_layer=TURF_LAYER+0.2
overlays += image(icon,"glow-[icon_state]",overlay_layer)
////////////////HUD//////////////////////
/mob/living/simple_animal/construct/Life()
. = ..()
if(.)
if(fire)
if(fire_alert) fire.icon_state = "fire1"
else fire.icon_state = "fire0"
if(pullin)
if(pulling) pullin.icon_state = "pull1"
else pullin.icon_state = "pull0"
if(purged)
if(purge > 0) purged.icon_state = "purge1"
else purged.icon_state = "purge0"
silence_spells(purge)
/mob/living/simple_animal/construct/armoured/Life()
..()
if(healths)
switch(health)
if(250 to INFINITY) healths.icon_state = "juggernaut_health0"
if(208 to 249) healths.icon_state = "juggernaut_health1"
if(167 to 207) healths.icon_state = "juggernaut_health2"
if(125 to 166) healths.icon_state = "juggernaut_health3"
if(84 to 124) healths.icon_state = "juggernaut_health4"
if(42 to 83) healths.icon_state = "juggernaut_health5"
if(1 to 41) healths.icon_state = "juggernaut_health6"
else healths.icon_state = "juggernaut_health7"
/mob/living/simple_animal/construct/behemoth/Life()
..()
if(healths)
switch(health)
if(750 to INFINITY) healths.icon_state = "juggernaut_health0"
if(625 to 749) healths.icon_state = "juggernaut_health1"
if(500 to 624) healths.icon_state = "juggernaut_health2"
if(375 to 499) healths.icon_state = "juggernaut_health3"
if(250 to 374) healths.icon_state = "juggernaut_health4"
if(125 to 249) healths.icon_state = "juggernaut_health5"
if(1 to 124) healths.icon_state = "juggernaut_health6"
else healths.icon_state = "juggernaut_health7"
/mob/living/simple_animal/construct/builder/Life()
..()
if(healths)
switch(health)
if(50 to INFINITY) healths.icon_state = "artificer_health0"
if(42 to 49) healths.icon_state = "artificer_health1"
if(34 to 41) healths.icon_state = "artificer_health2"
if(26 to 33) healths.icon_state = "artificer_health3"
if(18 to 25) healths.icon_state = "artificer_health4"
if(10 to 17) healths.icon_state = "artificer_health5"
if(1 to 9) healths.icon_state = "artificer_health6"
else healths.icon_state = "artificer_health7"
/mob/living/simple_animal/construct/wraith/Life()
..()
if(healths)
switch(health)
if(75 to INFINITY) healths.icon_state = "wraith_health0"
if(62 to 74) healths.icon_state = "wraith_health1"
if(50 to 61) healths.icon_state = "wraith_health2"
if(37 to 49) healths.icon_state = "wraith_health3"
if(25 to 36) healths.icon_state = "wraith_health4"
if(12 to 24) healths.icon_state = "wraith_health5"
if(1 to 11) healths.icon_state = "wraith_health6"
else healths.icon_state = "wraith_health7"
/mob/living/simple_animal/construct/harvester/Life()
..()
if(healths)
switch(health)
if(150 to INFINITY) healths.icon_state = "harvester_health0"
if(125 to 149) healths.icon_state = "harvester_health1"
if(100 to 124) healths.icon_state = "harvester_health2"
if(75 to 99) healths.icon_state = "harvester_health3"
if(50 to 74) healths.icon_state = "harvester_health4"
if(25 to 49) healths.icon_state = "harvester_health5"
if(1 to 24) healths.icon_state = "harvester_health6"
else healths.icon_state = "harvester_health7"

Some files were not shown because too many files have changed in this diff Show More