initial commit - cross reference with 5th port - obviously has compile errors

This commit is contained in:
LetterJay
2016-07-03 02:17:19 -05:00
commit 35a1723e98
4355 changed files with 2221257 additions and 0 deletions
@@ -0,0 +1,38 @@
/mob/living/silicon/robot/spawn_gibs()
robogibs(loc, viruses)
/mob/living/silicon/robot/gib_animation()
PoolOrNew(/obj/effect/overlay/temp/gib_animation, list(loc, "gibbed-r"))
/mob/living/silicon/robot/dust()
if(mmi)
qdel(mmi)
..()
/mob/living/silicon/robot/spawn_dust()
new /obj/effect/decal/remains/robot(loc)
/mob/living/silicon/robot/dust_animation()
PoolOrNew(/obj/effect/overlay/temp/dust_animation, list(loc, "dust-r"))
/mob/living/silicon/robot/death(gibbed)
if(stat == DEAD)
return
if(!gibbed)
visible_message("<b>[src]</b> shudders violently for a moment before falling still, its eyes slowly darkening.")
locked = 0 //unlock cover
stat = DEAD
update_canmove()
if(camera && camera.status)
camera.toggle_cam(src,0)
update_headlamp(1) //So borg lights are disabled when killed.
uneq_all() // particularly to ensure sight modes are cleared
update_icons()
sql_report_cyborg_death(src)
return ..()
@@ -0,0 +1,256 @@
/mob/living/silicon/emote(act,m_type=1,message = null)
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
switch(act)//01000001011011000111000001101000011000010110001001100101011101000110100101111010011001010110010000100001 (Seriously please keep it that way.)
if ("aflap")
if (!src.restrained())
message = "<B>[src]</B> flaps \his wings ANGRILY!"
m_type = 2
m_type = 1
if("beep","beeps")
var/M = null
if(param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> beeps at [param]."
else
message = "<B>[src]</B> beeps."
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
m_type = 2
if ("bow","bows")
if (!src.buckled)
var/M = null
if (param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> bows to [param]."
else
message = "<B>[src]</B> bows."
m_type = 1
if ("buzz")
var/M = null
if(param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> buzzes at [param]."
else
message = "<B>[src]</B> buzzes."
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
m_type = 2
if ("buzz2")
message = "<B>[src]</B> buzzes twice."
playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0)
m_type = 2
if ("boop","boops")
message = "<B>[src]</B> boops."
m_type = 2
if ("chime","chimes") //You have mail!
message = "<B>[src]</B> chimes."
playsound(loc, 'sound/machines/chime.ogg', 50, 0)
m_type = 2
if ("clap","claps")
if (!src.restrained())
message = "<B>[src]</B> claps."
m_type = 2
if ("custom")
if(jobban_isbanned(src, "emote"))
src << "You cannot send custom emotes (banned)"
return
if(src.client)
if(client.prefs.muted & MUTE_IC)
src << "You cannot send IC messages (muted)."
return
var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
if (!input)
return
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible")
m_type = 1
else if (input2 == "Hearable")
m_type = 2
else
alert("Unable to use this emote, must be either hearable or visible.")
return
message = "<B>[src]</B> [input]"
if ("deathgasp","deathgasps")
message = "<B>[src]</B> shudders violently for a moment, then becomes motionless, its eyes slowly darkening."
m_type = 1
if ("flap","flaps")
if (!src.restrained())
message = "<B>[src]</B> flaps \his wings."
m_type = 2
if ("glare","glares")
var/M = null
if (param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> glares at [param]."
else
message = "<B>[src]</B> glares."
if ("honk","honks") //Honk!
message = "<B>[src]</B> honks!"
playsound(loc, 'sound/items/bikehorn.ogg', 50, 1)
m_type = 2
if ("look","looks")
var/M = null
if (param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> looks at [param]."
else
message = "<B>[src]</B> looks."
if ("me")
if(jobban_isbanned(src, "emote"))
src << "You cannot send custom emotes (banned)"
return
if (src.client)
if(client.prefs.muted & MUTE_IC)
src << "You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))
return
if (stat)
return
if(!(message))
return
else
message = "<B>[src]</B> [message]"
if ("nod","nods")
message = "<B>[src]</B> nods."
m_type = 1
if ("ping","pings")
var/M = null
if(param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> pings at [param]."
else
message = "<B>[src]</B> pings."
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
m_type = 2
if ("sad") //When words cannot express...
message = "<B>[src]</B> plays a sad trombone."
playsound(loc, 'sound/misc/sadtrombone.ogg', 50, 0)
m_type = 2
if ("salute","salutes")
if (!src.buckled)
var/M = null
if (param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> salutes to [param]."
else
message = "<B>[src]</b> salutes."
if ("stare","stares")
var/M = null
if (param)
for (var/mob/A in view(1, src))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> stares at [param]."
else
message = "<B>[src]</B> stares."
m_type = 1
if ("twitch","twitches")
message = "<B>[src]</B> twitches violently."
m_type = 1
if ("twitch_s")
message = "<B>[src]</B> twitches."
m_type = 1
if ("warn") //HUMAN HARM DETECTED. PLEASE DIE IN AN ORDERLY FASHION.
message = "<B>[src]</B> blares an alarm!"
playsound(loc, 'sound/machines/warning-buzzer.ogg', 50, 0)
m_type = 2
if ("help")
src << "Help for cyborg emotes. You can use these emotes with say \"*emote\":\n\naflap, beep-(none)/mob, bow-(none)/mob, buzz-(none)/mob,buzz2,chime, clap, custom, deathgasp, flap, glare-(none)/mob, honk, look-(none)/mob, me, nod, ping-(none)/mob, sad, \nsalute-(none)/mob, twitch, twitch_s, warn,"
else
src << "<span class='notice'>Unusable emote '[act]'. Say *help for a list.</span>"
if (message && src.stat == CONSCIOUS)
log_emote("[name]/[key] : [message]")
if (m_type & 1)
visible_message(message)
else
audible_message(message)
return
/mob/living/silicon/robot/verb/powerwarn()
set category = "Robot Commands"
set name = "Power Warning"
if(!cell || !cell.charge)
visible_message("The power warning light on <span class='name'>[src]</span> flashes urgently.",\
"You announce you are operating in low power mode.")
playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0)
else
src << "<span class='warning'>You can only use this emote when you're out of charge.</span>"
@@ -0,0 +1,49 @@
/mob/living/silicon/robot/examine(mob/user)
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
if(desc)
msg += "[desc]\n"
var/obj/act_module = get_active_hand()
if(act_module)
msg += "It is holding \icon[act_module] \a [act_module].\n"
msg += "<span class='warning'>"
if (src.getBruteLoss())
if (src.getBruteLoss() < maxHealth*0.5)
msg += "It looks slightly dented.\n"
else
msg += "<B>It looks severely dented!</B>\n"
if (src.getFireLoss())
if (src.getFireLoss() < maxHealth*0.5)
msg += "It looks slightly charred.\n"
else
msg += "<B>It looks severely burnt and heat-warped!</B>\n"
if (src.health < -maxHealth*0.5)
msg += "It looks barely operational.\n"
if (src.fire_stacks < 0)
msg += "It's covered in water.\n"
else if (src.fire_stacks > 0)
msg += "It's coated in something flammable.\n"
msg += "</span>"
if(opened)
msg += "<span class='warning'>Its cover is open and the power cell is [cell ? "installed" : "missing"].</span>\n"
else
msg += "Its cover is closed[locked ? "" : ", and looks unlocked"].\n"
if(cell && cell.charge <= 0)
msg += "<span class='warning'>Its battery indicator is blinking red!</span>\n"
if(is_servant_of_ratvar(src) && user.Adjacent(src) && !stat) //To counter pseudo-stealth by using headlamps
msg += "<span class='warning'>Its eyes are glowing a blazing yellow!</span>\n"
switch(src.stat)
if(CONSCIOUS)
if(!src.client)
msg += "It appears to be in stand-by mode.\n" //afk
if(UNCONSCIOUS)
msg += "<span class='warning'>It doesn't seem to be responding.</span>\n"
if(DEAD)
msg += "<span class='deadsay'>It looks like its system is corrupted and requires a reset.</span>\n"
msg += "*---------*</span>"
user << msg
@@ -0,0 +1,222 @@
//These procs handle putting stuff in your hand. It's probably best to use these rather than setting stuff manually
//as they handle all relevant stuff like adding it to the player's screen and such
//Returns the thing in our active hand (whatever is in our active module-slot, in this case)
/mob/living/silicon/robot/get_active_hand()
return module_active
/*-------TODOOOOOOOOOO--------*/
/mob/living/silicon/robot/proc/uneq_module(obj/item/O)
if(!O)
return 0
O.mouse_opacity = 2
if(istype(O,/obj/item/borg/sight))
var/obj/item/borg/sight/S = O
sight_mode &= ~S.sight_mode
update_sight()
else if(istype(O, /obj/item/weapon/storage/bag/tray/))
var/obj/item/weapon/storage/bag/tray/T = O
T.do_quick_empty()
if(client)
client.screen -= O
contents -= O
if(module)
O.loc = module //Return item to module so it appears in its contents, so it can be taken out again.
if(module_active == O)
module_active = null
if(module_state_1 == O)
inv1.icon_state = "inv1"
module_state_1 = null
else if(module_state_2 == O)
inv2.icon_state = "inv2"
module_state_2 = null
else if(module_state_3 == O)
module_state_3 = null
inv3.icon_state = "inv3"
hud_used.update_robot_modules_display()
return 1
/mob/living/silicon/robot/proc/activate_module(obj/item/O)
if(!(locate(O) in src.module.modules) && O != src.module.emag)
return
if(activated(O))
src << "<span class='notice'>Already activated</span>"
return
if(!module_state_1)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_1 = O
O.layer = ABOVE_HUD_LAYER
O.screen_loc = inv1.screen_loc
contents += O
if(istype(module_state_1,/obj/item/borg/sight))
var/obj/item/borg/sight/S = module_state_1
sight_mode |= S.sight_mode
update_sight()
else if(!module_state_2)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_2 = O
O.layer = ABOVE_HUD_LAYER
O.screen_loc = inv2.screen_loc
contents += O
if(istype(module_state_2,/obj/item/borg/sight))
var/obj/item/borg/sight/S = module_state_2
sight_mode |= S.sight_mode
update_sight()
else if(!module_state_3)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_3 = O
O.layer = ABOVE_HUD_LAYER
O.screen_loc = inv3.screen_loc
contents += O
if(istype(module_state_3,/obj/item/borg/sight))
var/obj/item/borg/sight/S = module_state_3
sight_mode |= S.sight_mode
update_sight()
else
src << "<span class='warning'>You need to disable a module first!</span>"
/mob/living/silicon/robot/proc/uneq_active()
uneq_module(module_active)
/mob/living/silicon/robot/proc/uneq_all()
uneq_module(module_state_1)
uneq_module(module_state_2)
uneq_module(module_state_3)
/mob/living/silicon/robot/proc/activated(obj/item/O)
if(module_state_1 == O)
return 1
else if(module_state_2 == O)
return 1
else if(module_state_3 == O)
return 1
else
return 0
//Helper procs for cyborg modules on the UI.
//These are hackish but they help clean up code elsewhere.
//module_selected(module) - Checks whether the module slot specified by "module" is currently selected.
/mob/living/silicon/robot/proc/module_selected(module) //Module is 1-3
return module == get_selected_module()
//module_active(module) - Checks whether there is a module active in the slot specified by "module".
/mob/living/silicon/robot/proc/module_active(module) //Module is 1-3
if(module < 1 || module > 3) return 0
switch(module)
if(1)
if(module_state_1)
return 1
if(2)
if(module_state_2)
return 1
if(3)
if(module_state_3)
return 1
return 0
//get_selected_module() - Returns the slot number of the currently selected module. Returns 0 if no modules are selected.
/mob/living/silicon/robot/proc/get_selected_module()
if(module_state_1 && module_active == module_state_1)
return 1
else if(module_state_2 && module_active == module_state_2)
return 2
else if(module_state_3 && module_active == module_state_3)
return 3
return 0
//select_module(module) - Selects the module slot specified by "module"
/mob/living/silicon/robot/proc/select_module(module) //Module is 1-3
if(module < 1 || module > 3) return
if(!module_active(module)) return
switch(module)
if(1)
if(module_active != module_state_1)
inv1.icon_state = "inv1 +a"
inv2.icon_state = "inv2"
inv3.icon_state = "inv3"
module_active = module_state_1
return
if(2)
if(module_active != module_state_2)
inv1.icon_state = "inv1"
inv2.icon_state = "inv2 +a"
inv3.icon_state = "inv3"
module_active = module_state_2
return
if(3)
if(module_active != module_state_3)
inv1.icon_state = "inv1"
inv2.icon_state = "inv2"
inv3.icon_state = "inv3 +a"
module_active = module_state_3
return
return
//deselect_module(module) - Deselects the module slot specified by "module"
/mob/living/silicon/robot/proc/deselect_module(module) //Module is 1-3
if(module < 1 || module > 3) return
switch(module)
if(1)
if(module_active == module_state_1)
inv1.icon_state = "inv1"
module_active = null
return
if(2)
if(module_active == module_state_2)
inv2.icon_state = "inv2"
module_active = null
return
if(3)
if(module_active == module_state_3)
inv3.icon_state = "inv3"
module_active = null
return
return
//toggle_module(module) - Toggles the selection of the module slot specified by "module".
/mob/living/silicon/robot/proc/toggle_module(module) //Module is 1-3
if(module < 1 || module > 3) return
if(module_selected(module))
deselect_module(module)
else
if(module_active(module))
select_module(module)
else
deselect_module(get_selected_module()) //If we can't do select anything, at least deselect the current module.
return
//cycle_modules() - Cycles through the list of selected modules.
/mob/living/silicon/robot/proc/cycle_modules()
var/slot_start = get_selected_module()
if(slot_start)
deselect_module(slot_start) //Only deselect if we have a selected slot.
var/slot_num
if(slot_start == 0)
slot_num = 1
slot_start = 4
else
slot_num = slot_start + 1
while(slot_num != slot_start) //If we wrap around without finding any free slots, just give up.
if(module_active(slot_num))
select_module(slot_num)
return
slot_num++
if(slot_num > 4) // not >3 otherwise cycling with just one item on module 3 wouldn't work
slot_num = 1 //Wrap around.
/mob/living/silicon/robot/swap_hand()
cycle_modules()
@@ -0,0 +1,74 @@
/mob/living/silicon/robot/verb/cmd_show_laws()
set category = "Robot Commands"
set name = "Show Laws"
if(usr.stat == DEAD)
return //won't work if dead
show_laws()
/mob/living/silicon/robot/show_laws(everyone = 0)
laws_sanity_check()
var/who
if (everyone)
who = world
else
who = src
if(lawupdate)
if (connected_ai)
if(connected_ai.stat || connected_ai.control_disabled)
src << "<b>AI signal lost, unable to sync laws.</b>"
else
lawsync()
src << "<b>Laws synced with AI, be sure to note any changes.</b>"
if(is_special_character(src))
src << "<b>Remember, your AI does NOT share or know about your law 0.</b>"
if(src.connected_ai.laws.zeroth)
src << "<b>While you are free to disregard it, your AI has a law 0 of its own.</b>"
else
src << "<b>No AI selected to sync laws with, disabling lawsync protocol.</b>"
lawupdate = 0
who << "<b>Obey these laws:</b>"
laws.show_laws(who)
if (is_special_character(src) && connected_ai)
who << "<b>Remember, [connected_ai.name] is technically your master, but your objective comes first.</b>"
else if (connected_ai)
who << "<b>Remember, [connected_ai.name] is your master, other AIs can be ignored.</b>"
else if (emagged)
who << "<b>Remember, you are not required to listen to the AI.</b>"
else
who << "<b>Remember, you are not bound to any AI, you are not required to listen to them.</b>"
/mob/living/silicon/robot/proc/lawsync()
laws_sanity_check()
var/datum/ai_laws/master = connected_ai ? connected_ai.laws : null
var/temp
if (master)
laws.ion.len = master.ion.len
for (var/index = 1, index <= master.ion.len, index++)
temp = master.ion[index]
if (length(temp) > 0)
laws.ion[index] = temp
if (!is_special_character(src)) //Don't override the borg's existing law 0, if any
if(master.zeroth_borg) //If the AI has a defined law zero specifically for its borgs, give it that one, otherwise give it the same one. --NEO
temp = master.zeroth_borg
else
temp = master.zeroth
laws.zeroth = temp
laws.inherent.len = master.inherent.len
for (var/index = 1, index <= master.inherent.len, index++)
temp = master.inherent[index]
if (length(temp) > 0)
laws.inherent[index] = temp
laws.supplied.len = master.supplied.len
for (var/index = 1, index <= master.supplied.len, index++)
temp = master.supplied[index]
if (length(temp) > 0)
laws.supplied[index] = temp
return
@@ -0,0 +1,120 @@
/mob/living/silicon/robot/Life()
set invisibility = 0
set background = BACKGROUND_ENABLED
if (src.notransform)
return
..()
handle_robot_hud_updates()
handle_robot_cell()
/mob/living/silicon/robot/proc/handle_robot_cell()
if(stat != DEAD)
if(low_power_mode)
if(cell && cell.charge)
low_power_mode = 0
update_headlamp()
else if(stat == CONSCIOUS)
use_power()
/mob/living/silicon/robot/proc/use_power()
if(cell && cell.charge)
if(cell.charge <= 100)
uneq_all()
var/amt = Clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
cell.use(amt) //Usage table: 1/tick if off/lowest setting, 4 = 4/tick, 6 = 8/tick, 8 = 12/tick, 10 = 16/tick
else
uneq_all()
low_power_mode = 1
update_headlamp()
diag_hud_set_borgcell()
/mob/living/silicon/robot/proc/handle_robot_hud_updates()
if(!client)
return
update_cell_hud_icon()
if(syndicate)
if(ticker.mode.name == "traitor")
for(var/datum/mind/tra in ticker.mode.traitors)
if(tra.current)
var/I = image('icons/mob/mob.dmi', loc = tra.current, icon_state = "traitor") //no traitor sprite in that dmi!
src.client.images += I
if(connected_ai)
connected_ai.connected_robots -= src
connected_ai = null
if(mind)
if(!mind.special_role)
mind.special_role = "traitor"
ticker.mode.traitors += mind
/mob/living/silicon/robot/update_health_hud()
if(!client || !hud_used)
return
if(hud_used.healths)
if(stat != DEAD)
if(health >= maxHealth)
hud_used.healths.icon_state = "health0"
else if(health > maxHealth*0.6)
hud_used.healths.icon_state = "health2"
else if(health > maxHealth*0.2)
hud_used.healths.icon_state = "health3"
else if(health > -maxHealth*0.2)
hud_used.healths.icon_state = "health4"
else if(health > -maxHealth*0.6)
hud_used.healths.icon_state = "health5"
else
hud_used.healths.icon_state = "health6"
else
hud_used.healths.icon_state = "health7"
/mob/living/silicon/robot/proc/update_cell_hud_icon()
if(cell)
var/cellcharge = cell.charge/cell.maxcharge
switch(cellcharge)
if(0.75 to INFINITY)
clear_alert("charge")
if(0.5 to 0.75)
throw_alert("charge", /obj/screen/alert/lowcell, 1)
if(0.25 to 0.5)
throw_alert("charge", /obj/screen/alert/lowcell, 2)
if(0.01 to 0.25)
throw_alert("charge", /obj/screen/alert/lowcell, 3)
else
throw_alert("charge", /obj/screen/alert/emptycell)
else
throw_alert("charge", /obj/screen/alert/nocell)
//Robots on fire
/mob/living/silicon/robot/handle_fire()
if(..())
return
if(fire_stacks > 0)
fire_stacks--
fire_stacks = max(0, fire_stacks)
else
ExtinguishMob()
//adjustFireLoss(3)
return
/mob/living/silicon/robot/update_fire()
overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Generic_mob_burning")
if(on_fire)
add_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state"="Generic_mob_burning"))
/mob/living/silicon/robot/fire_act()
if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
IgniteMob()
/mob/living/silicon/robot/update_canmove()
if(stat || buckled || lockcharge)
canmove = 0
else
canmove = 1
update_transform()
update_action_buttons_icon()
return canmove
@@ -0,0 +1,9 @@
/mob/living/silicon/robot/Login()
..()
regenerate_icons()
show_laws(0)
if(mind)
ticker.mode.remove_revolutionary(mind)
ticker.mode.remove_gangster(mind,1,remove_bosses=1)
ticker.mode.remove_hog_follower(mind, 0)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,404 @@
/obj/item/weapon/robot_module
name = "robot module"
icon = 'icons/obj/module.dmi'
icon_state = "std_module"
w_class = 100
item_state = "electronic"
flags = CONDUCT
var/list/modules = list()
var/obj/item/emag = null
var/list/storages = list()
/obj/item/weapon/robot_module/Destroy()
modules.Cut()
emag = null
storages.Cut()
return ..()
/obj/item/weapon/robot_module/emp_act(severity)
if(modules)
for(var/obj/O in modules)
O.emp_act(severity)
if(emag)
emag.emp_act(severity)
..()
return
/obj/item/weapon/robot_module/proc/get_usable_modules()
. = modules.Copy()
var/mob/living/silicon/robot/R = loc
if(R.emagged)
. += emag
/obj/item/weapon/robot_module/proc/get_inactive_modules()
. = list()
var/mob/living/silicon/robot/R = loc
for(var/m in get_usable_modules())
if((m != R.module_state_1) && (m != R.module_state_2) && (m != R.module_state_3))
. += m
/obj/item/weapon/robot_module/proc/get_or_create_estorage(var/storage_type)
for(var/datum/robot_energy_storage/S in storages)
if(istype(S, storage_type))
return S
return new storage_type(src)
/obj/item/weapon/robot_module/proc/add_module(var/obj/item/I)
if(istype(I, /obj/item/stack))
var/obj/item/stack/S = I
if(is_type_in_list(S, list(/obj/item/stack/sheet/metal, /obj/item/stack/rods, /obj/item/stack/tile/plasteel)))
if(S.materials[MAT_METAL])
S.cost = S.materials[MAT_METAL] * 0.25
S.source = get_or_create_estorage(/datum/robot_energy_storage/metal)
else if(istype(S, /obj/item/stack/sheet/glass))
S.cost = 500
S.source = get_or_create_estorage(/datum/robot_energy_storage/glass)
else if(istype(S, /obj/item/stack/medical))
S.cost = 250
S.source = get_or_create_estorage(/datum/robot_energy_storage/medical)
else if(istype(S, /obj/item/stack/cable_coil))
S.cost = 1
S.source = get_or_create_estorage(/datum/robot_energy_storage/wire)
if(S && S.source)
S.materials = list()
S.is_cyborg = 1
if(istype(I, /obj/item/weapon/restraints/handcuffs/cable))
var/obj/item/weapon/restraints/handcuffs/cable/C = I
C.wirestorage = get_or_create_estorage(/datum/robot_energy_storage/wire)
I.loc = src
modules += I
rebuild()
/obj/item/weapon/robot_module/New()
modules += new /obj/item/device/assembly/flash/cyborg(src)
emag = new /obj/item/toy/sword(src)
emag.name = "Placeholder Emag Item"
return
/obj/item/weapon/robot_module/proc/respawn_consumable(mob/living/silicon/robot/R, coeff = 1)
for(var/datum/robot_energy_storage/st in storages)
st.energy = min(st.max_energy, st.energy + coeff * st.recharge_rate)
for(var/obj/item/I in get_usable_modules())
if(istype(I, /obj/item/device/assembly/flash))
var/obj/item/device/assembly/flash/F = I
F.times_used = 0
F.crit_fail = 0
F.update_icon()
if(istype(I, /obj/item/weapon/melee/baton))
var/obj/item/weapon/melee/baton/B = I
if(B.bcell)
B.bcell.charge = B.bcell.maxcharge
R.toner = R.tonermax
/obj/item/weapon/robot_module/proc/rebuild()//Rebuilds the list so it's possible to add/remove items from the module
var/list/temp_list = modules
modules = list()
for(var/obj/O in temp_list)
if(O)
modules += O
fix_modules()
/obj/item/weapon/robot_module/proc/fix_modules()
for(var/obj/item/I in modules)
I.flags |= NODROP
I.mouse_opacity = 2
if(emag)
emag.flags |= NODROP
emag.mouse_opacity = 2
/obj/item/weapon/robot_module/proc/on_emag()
return
/obj/item/weapon/robot_module/standard
name = "standard robot module"
/obj/item/weapon/robot_module/standard/New()
..()
modules += new /obj/item/weapon/reagent_containers/borghypo/epi(src)
modules += new /obj/item/device/healthanalyzer(src)
modules += new /obj/item/weapon/weldingtool/largetank/cyborg(src)
modules += new /obj/item/weapon/wrench/cyborg(src)
modules += new /obj/item/weapon/crowbar/cyborg(src)
add_module(new /obj/item/stack/sheet/metal/cyborg())
modules += new /obj/item/weapon/extinguisher(src)
modules += new /obj/item/weapon/pickaxe(src)
modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src)
modules += new /obj/item/weapon/restraints/handcuffs/cable/zipties/cyborg(src)
modules += new /obj/item/weapon/soap/nanotrasen(src)
modules += new /obj/item/borg/cyborghug(src)
emag = new /obj/item/weapon/melee/energy/sword/cyborg(src)
fix_modules()
/obj/item/weapon/robot_module/medical
name = "medical robot module"
/obj/item/weapon/robot_module/medical/New()
..()
modules += new /obj/item/device/healthanalyzer(src)
modules += new /obj/item/weapon/reagent_containers/borghypo(src)
modules += new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
modules += new /obj/item/weapon/reagent_containers/dropper(src)
modules += new /obj/item/weapon/reagent_containers/syringe(src)
modules += new /obj/item/weapon/surgical_drapes(src)
modules += new /obj/item/weapon/retractor(src)
modules += new /obj/item/weapon/hemostat(src)
modules += new /obj/item/weapon/cautery(src)
modules += new /obj/item/weapon/surgicaldrill(src)
modules += new /obj/item/weapon/scalpel(src)
modules += new /obj/item/weapon/circular_saw(src)
modules += new /obj/item/weapon/extinguisher/mini(src)
modules += new /obj/item/roller/robo(src)
modules += new /obj/item/borg/cyborghug(src)
add_module(new /obj/item/stack/medical/gauze/cyborg())
emag = new /obj/item/weapon/reagent_containers/borghypo/hacked(src)
fix_modules()
/obj/item/weapon/robot_module/engineering
name = "engineering robot module"
/obj/item/weapon/robot_module/engineering/New()
..()
modules += new /obj/item/borg/sight/meson(src)
emag = new /obj/item/borg/stun(src)
modules += new /obj/item/weapon/rcd/borg(src)
modules += new /obj/item/weapon/pipe_dispenser(src) //What could possibly go wrong?
modules += new /obj/item/weapon/extinguisher(src)
modules += new /obj/item/weapon/weldingtool/largetank/cyborg(src)
modules += new /obj/item/weapon/screwdriver/cyborg(src)
modules += new /obj/item/weapon/wrench/cyborg(src)
modules += new /obj/item/weapon/crowbar/cyborg(src)
modules += new /obj/item/weapon/wirecutters/cyborg(src)
modules += new /obj/item/device/multitool/cyborg(src)
modules += new /obj/item/device/t_scanner(src)
modules += new /obj/item/device/analyzer(src)
modules += new /obj/item/areaeditor/blueprints/cyborg(src)
add_module(new /obj/item/stack/sheet/metal/cyborg())
add_module(new /obj/item/stack/sheet/glass/cyborg())
var/obj/item/stack/sheet/rglass/cyborg/G = new /obj/item/stack/sheet/rglass/cyborg(src)
G.metsource = get_or_create_estorage(/datum/robot_energy_storage/metal)
G.glasource = get_or_create_estorage(/datum/robot_energy_storage/glass)
add_module(G)
add_module(new /obj/item/stack/rods/cyborg())
add_module(new /obj/item/stack/tile/plasteel/cyborg())
add_module(new /obj/item/stack/cable_coil/cyborg(src,MAXCOIL,"red"))
fix_modules()
/obj/item/weapon/robot_module/security
name = "security robot module"
/obj/item/weapon/robot_module/security/New()
..()
modules += new /obj/item/weapon/restraints/handcuffs/cable/zipties/cyborg(src)
modules += new /obj/item/weapon/melee/baton/loaded(src)
modules += new /obj/item/weapon/gun/energy/disabler/cyborg(src)
modules += new /obj/item/clothing/mask/gas/sechailer/cyborg(src)
emag = new /obj/item/weapon/gun/energy/laser/cyborg(src)
fix_modules()
/obj/item/weapon/robot_module/security/respawn_consumable(mob/living/silicon/robot/R, coeff = 1)
..()
var/obj/item/weapon/gun/energy/gun/advtaser/cyborg/T = locate(/obj/item/weapon/gun/energy/gun/advtaser/cyborg) in get_usable_modules()
if(T)
if(T.power_supply.charge < T.power_supply.maxcharge)
var/obj/item/ammo_casing/energy/S = T.ammo_type[T.select]
T.power_supply.give(S.e_cost * coeff)
T.update_icon()
else
T.charge_tick = 0
/obj/item/weapon/robot_module/peacekeeper
name = "peacekeeper robot module"
/obj/item/weapon/robot_module/peacekeeper/New()
..()
modules += new /obj/item/weapon/cookiesynth(src)
modules += new /obj/item/device/harmalarm(src)
modules += new /obj/item/weapon/reagent_containers/borghypo/peace(src)
modules += new /obj/item/weapon/holosign_creator/cyborg(src)
modules += new /obj/item/borg/cyborghug/peacekeeper(src)
modules += new /obj/item/weapon/extinguisher(src)
emag = new /obj/item/weapon/reagent_containers/borghypo/peace/hacked(src)
/obj/item/weapon/robot_module/janitor
name = "janitorial robot module"
var/obj/item/weapon/reagent_containers/spray/drying_agent
/obj/item/weapon/robot_module/janitor/New()
..()
modules += new /obj/item/weapon/soap/nanotrasen(src)
modules += new /obj/item/weapon/storage/bag/trash/cyborg(src)
modules += new /obj/item/weapon/mop/cyborg(src)
modules += new /obj/item/device/lightreplacer/cyborg(src)
modules += new /obj/item/weapon/holosign_creator(src)
drying_agent = new(src)
drying_agent.reagents.add_reagent("drying_agent", 250)
drying_agent.name = "drying agent spray"
drying_agent.color = "#A000A0"
modules += drying_agent
emag = new /obj/item/weapon/reagent_containers/spray(src)
emag.reagents.add_reagent("lube", 250)
emag.name = "lube spray"
fix_modules()
/obj/item/weapon/robot_module/janitor/respawn_consumable(mob/living/silicon/robot/R, coeff = 1)
..()
var/obj/item/device/lightreplacer/LR = locate(/obj/item/device/lightreplacer) in get_usable_modules()
if(LR)
for(var/i = 1, i <= coeff, i++)
LR.Charge(R)
drying_agent.reagents.add_reagent("drying_agent", 5 * coeff)
if(R.emagged && istype(emag, /obj/item/weapon/reagent_containers/spray))
emag.reagents.add_reagent("lube", 2 * coeff)
/obj/item/weapon/robot_module/butler
name = "service robot module"
/obj/item/weapon/robot_module/butler/New()
..()
modules += new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src)
modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src)
modules += new /obj/item/weapon/pen(src)
modules += new /obj/item/toy/crayon/spraycan/borg(src)
modules += new /obj/item/weapon/hand_labeler/borg(src)
modules += new /obj/item/weapon/razor(src)
modules += new /obj/item/device/instrument/violin(src)
modules += new /obj/item/device/instrument/guitar(src)
modules += new /obj/item/weapon/rsf{matter = 30}(src)
modules += new /obj/item/weapon/reagent_containers/dropper(src)
modules += new /obj/item/weapon/lighter{lit = 1}(src)
modules += new /obj/item/weapon/storage/bag/tray(src)
modules += new /obj/item/weapon/reagent_containers/borghypo/borgshaker(src)
emag = new /obj/item/weapon/reagent_containers/borghypo/borgshaker/hacked(src)
fix_modules()
/obj/item/weapon/robot_module/butler/respawn_consumable(mob/living/silicon/robot/R, coeff = 1)
..()
var/obj/item/weapon/reagent_containers/O = locate(/obj/item/weapon/reagent_containers/food/condiment/enzyme) in get_usable_modules()
if(O)
O.reagents.add_reagent("enzyme", 2 * coeff)
/obj/item/weapon/robot_module/miner
name = "miner robot module"
/obj/item/weapon/robot_module/miner/New()
..()
modules += new /obj/item/borg/sight/meson(src)
emag = new /obj/item/borg/stun(src)
modules += new /obj/item/weapon/storage/bag/ore/cyborg(src)
modules += new /obj/item/weapon/pickaxe/drill/cyborg(src)
modules += new /obj/item/weapon/shovel(src)
modules += new /obj/item/weapon/weldingtool/mini(src)
modules += new /obj/item/weapon/extinguisher/mini(src)
modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src)
modules += new /obj/item/device/t_scanner/adv_mining_scanner(src)
modules += new /obj/item/weapon/gun/energy/kinetic_accelerator/cyborg(src)
modules += new /obj/item/device/gps/cyborg(src)
fix_modules()
/obj/item/weapon/robot_module/syndicate
name = "syndicate assault robot module"
/obj/item/weapon/robot_module/syndicate/New()
..()
modules += new /obj/item/weapon/melee/energy/sword/cyborg(src)
modules += new /obj/item/weapon/gun/energy/printer(src)
modules += new /obj/item/weapon/gun/projectile/revolver/grenadelauncher/cyborg(src)
modules += new /obj/item/weapon/card/emag(src)
modules += new /obj/item/weapon/crowbar/cyborg(src)
modules += new /obj/item/weapon/pinpointer/operative(src)
emag = null
fix_modules()
/obj/item/weapon/robot_module/syndicate_medical
name = "syndicate medical robot module"
/obj/item/weapon/robot_module/syndicate_medical/New()
..()
modules += new /obj/item/weapon/reagent_containers/borghypo/syndicate(src)
modules += new /obj/item/weapon/twohanded/shockpaddles/syndicate(src)
modules += new /obj/item/device/healthanalyzer(src)
modules += new /obj/item/weapon/surgical_drapes(src)
modules += new /obj/item/weapon/retractor(src)
modules += new /obj/item/weapon/hemostat(src)
modules += new /obj/item/weapon/cautery(src)
modules += new /obj/item/weapon/scalpel(src)
modules += new /obj/item/weapon/melee/energy/sword/cyborg/saw(src) //Energy saw -- primary weapon
modules += new /obj/item/roller/robo(src)
modules += new /obj/item/weapon/card/emag(src)
modules += new /obj/item/weapon/crowbar/cyborg(src)
modules += new /obj/item/weapon/pinpointer/operative(src)
emag = null
add_module(new /obj/item/stack/medical/gauze/cyborg())
fix_modules()
/datum/robot_energy_storage
var/name = "Generic energy storage"
var/max_energy = 30000
var/recharge_rate = 1000
var/energy
/datum/robot_energy_storage/New(var/obj/item/weapon/robot_module/R = null)
energy = max_energy
if(R)
R.storages |= src
return
/datum/robot_energy_storage/proc/use_charge(amount)
if (energy >= amount)
energy -= amount
if (energy == 0)
return 1
return 2
else
return 0
/datum/robot_energy_storage/proc/add_charge(amount)
energy = min(energy + amount, max_energy)
/datum/robot_energy_storage/metal
name = "Metal Synthesizer"
/datum/robot_energy_storage/glass
name = "Glass Synthesizer"
/datum/robot_energy_storage/wire
max_energy = 50
recharge_rate = 2
name = "Wire Synthesizer"
/datum/robot_energy_storage/medical
max_energy = 2500
recharge_rate = 250
name = "Medical Synthesizer"
@@ -0,0 +1,19 @@
/mob/living/silicon/robot/Process_Spacemove(movement_dir = 0)
if(ionpulse())
return 1
return ..()
/mob/living/silicon/robot/movement_delay()
. = ..()
. += speed
. += config.robot_delay
/mob/living/silicon/robot/mob_negates_gravity()
return magpulse
/mob/living/silicon/robot/mob_has_gravity()
return ..() || mob_negates_gravity()
/mob/living/silicon/robot/experience_pressure_difference(pressure_difference, direction)
if(!magpulse)
return ..()
@@ -0,0 +1,2 @@
/mob/living/silicon/robot/IsVocal()
return !config.silent_borg