mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 07:03:30 +01:00
Merge branch 'bleeding-edge-freeze' of https://github.com/comma/Baystation12 into viro
This commit is contained in:
@@ -380,7 +380,7 @@
|
||||
u_equip(item)
|
||||
update_icons()
|
||||
|
||||
if (istype(usr, /mob/living/carbon/monkey)) //Check if a monkey is throwing. Modify/remove this line as required.
|
||||
if (istype(usr, /mob/living/carbon)) //Check if a carbon mob is throwing. Modify/remove this line as required.
|
||||
item.loc = src.loc
|
||||
if(src.client)
|
||||
src.client.screen -= item
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
if(!organ) return
|
||||
if(istype(used_weapon,/obj/item/weapon))
|
||||
var/obj/item/weapon/W = used_weapon //Sharp objects will always embed if they do enough damage.
|
||||
if(damage > (5*W.w_class) && (prob(damage/W.w_class) || sharp)) //The larger it is, the harder it needs to hit to stick.
|
||||
if( (damage > (10*W.w_class)) && ( (sharp && !ismob(W.loc)) || prob(damage/W.w_class) ) )
|
||||
organ.implants += W
|
||||
visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
|
||||
W.add_blood(src)
|
||||
@@ -237,7 +237,7 @@
|
||||
W.loc = src
|
||||
|
||||
else if(istype(used_weapon,/obj/item/projectile)) //We don't want to use the actual projectile item, so we spawn some shrapnel.
|
||||
if(prob(50) && damagetype == BRUTE)
|
||||
if(prob(75) && damagetype == BRUTE)
|
||||
var/obj/item/projectile/P = used_weapon
|
||||
var/obj/item/weapon/shard/shrapnel/S = new()
|
||||
S.name = "[P.name] shrapnel"
|
||||
|
||||
@@ -161,6 +161,17 @@ emp_act
|
||||
if((user != src) && check_shields(I.force, "the [I.name]"))
|
||||
return 0
|
||||
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
if(!(affecting.status & ORGAN_ROBOT))
|
||||
user << "\red That limb isn't robotic."
|
||||
return
|
||||
if(affecting.sabotaged)
|
||||
user << "\red [src]'s [affecting.display_name] is already sabotaged!"
|
||||
else
|
||||
user << "\red You sneakily slide [I] into the dataport on [src]'s [affecting.display_name] and short out the safeties."
|
||||
affecting.sabotaged = 1
|
||||
return
|
||||
|
||||
if(I.attack_verb.len)
|
||||
visible_message("\red <B>[src] has been [pick(I.attack_verb)] in the [hit_area] with [I.name] by [user]!</B>")
|
||||
else
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
update_inv_glasses()
|
||||
else if (W == head)
|
||||
head = null
|
||||
if(W.flags & BLOCKHAIR)
|
||||
if((W.flags & BLOCKHAIR) || (W.flags & BLOCKHEADHAIR))
|
||||
update_hair(0) //rebuild hair
|
||||
success = 1
|
||||
update_inv_head()
|
||||
@@ -107,7 +107,7 @@
|
||||
else if (W == wear_mask)
|
||||
wear_mask = null
|
||||
success = 1
|
||||
if(W.flags & BLOCKHAIR)
|
||||
if((W.flags & BLOCKHAIR) || (W.flags & BLOCKHEADHAIR))
|
||||
update_hair(0) //rebuild hair
|
||||
if(internal)
|
||||
if(internals)
|
||||
@@ -188,7 +188,7 @@
|
||||
update_inv_back(redraw_mob)
|
||||
if(slot_wear_mask)
|
||||
src.wear_mask = W
|
||||
if(wear_mask.flags & BLOCKHAIR)
|
||||
if((wear_mask.flags & BLOCKHAIR) || (wear_mask.flags & BLOCKHEADHAIR))
|
||||
update_hair(redraw_mob) //rebuild hair
|
||||
W.equipped(src, slot)
|
||||
update_inv_wear_mask(redraw_mob)
|
||||
@@ -229,7 +229,7 @@
|
||||
update_inv_gloves(redraw_mob)
|
||||
if(slot_head)
|
||||
src.head = W
|
||||
if(head.flags & BLOCKHAIR)
|
||||
if((head.flags & BLOCKHAIR) || (head.flags & BLOCKHEADHAIR))
|
||||
update_hair(redraw_mob) //rebuild hair
|
||||
if(istype(W,/obj/item/clothing/head/kitty))
|
||||
W.update_icon(src)
|
||||
|
||||
@@ -350,7 +350,6 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
//masks and helmets can obscure our hair.
|
||||
if( (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
|
||||
if(update_icons) update_icons()
|
||||
|
||||
return
|
||||
|
||||
//base icons
|
||||
@@ -367,7 +366,7 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
face_standing.Blend(facial_s, ICON_OVERLAY)
|
||||
face_lying.Blend(facial_l, ICON_OVERLAY)
|
||||
|
||||
if(h_style)
|
||||
if(h_style && !(head && (head.flags & BLOCKHEADHAIR)))
|
||||
var/datum/sprite_accessory/hair_style = hair_styles_list[h_style]
|
||||
if(hair_style)
|
||||
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
|
||||
|
||||
@@ -90,32 +90,37 @@
|
||||
var/obj/item/weapon/W = O
|
||||
var/momentum = speed/2
|
||||
var/dir = get_dir(M,src)
|
||||
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
|
||||
|
||||
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
|
||||
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
|
||||
|
||||
if(near_wall(dir,2) && W.w_class >= 3 && W.sharp) //If they're close to a wall and the projectile is suitable.
|
||||
visible_message("<span class='warning'>[src] is pinned to the wall by [O]!</span>","<span class='warning'>You are pinned to the wall by [O]!</span>")
|
||||
if(!istype(src,/mob/living/carbon/human))
|
||||
O.loc = src
|
||||
src.embedded += O
|
||||
src.anchored = 1
|
||||
src.pinned += O
|
||||
else
|
||||
src.anchored = 1
|
||||
src.pinned += O
|
||||
if(W.w_class >= 3 && W.sharp && armor < 2) //Projectile is suitable, armour is bypassable.
|
||||
var/turf/T = near_wall(dir,2)
|
||||
if(T)
|
||||
src.loc = T
|
||||
visible_message("<span class='warning'>[src] is pinned to the wall by [O]!</span>","<span class='warning'>You are pinned to the wall by [O]!</span>")
|
||||
if(!istype(src,/mob/living/carbon/human))
|
||||
O.loc = src
|
||||
src.embedded += O
|
||||
src.anchored = 1
|
||||
src.pinned += O
|
||||
else
|
||||
src.anchored = 1
|
||||
src.pinned += O
|
||||
|
||||
|
||||
/mob/living/proc/near_wall(var/direction,var/distance=1)
|
||||
var/turf/T = get_step(get_turf(src),direction)
|
||||
var/turf/last_turf = src.loc
|
||||
var/i = 1
|
||||
|
||||
while(i>0 && i<=distance)
|
||||
if(T.density) //Turf is a wall!
|
||||
return 1
|
||||
return last_turf
|
||||
i++
|
||||
last_turf = T
|
||||
T = get_step(T,direction)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
// End BS12 momentum-transfer code.
|
||||
@@ -0,0 +1,145 @@
|
||||
// TODO: remove the robot.mmi and robot.cell variables and completely rely on the robot component system
|
||||
|
||||
/datum/robot_component/var/name
|
||||
/datum/robot_component/var/installed = 0
|
||||
/datum/robot_component/var/powered = 0
|
||||
/datum/robot_component/var/toggled = 1
|
||||
/datum/robot_component/var/brute_damage = 0
|
||||
/datum/robot_component/var/electronics_damage = 0
|
||||
/datum/robot_component/var/energy_consumption = 0
|
||||
/datum/robot_component/var/max_damage = 30
|
||||
/datum/robot_component/var/mob/living/silicon/robot/owner
|
||||
|
||||
// The actual device object that has to be installed for this.
|
||||
/datum/robot_component/var/external_type = null
|
||||
|
||||
// The wrapped device(e.g. radio), only set if external_type isn't null
|
||||
/datum/robot_component/var/obj/item/wrapped = null
|
||||
|
||||
/datum/robot_component/New(mob/living/silicon/robot/R)
|
||||
src.owner = R
|
||||
|
||||
/datum/robot_component/proc/install()
|
||||
/datum/robot_component/proc/uninstall()
|
||||
|
||||
/datum/robot_component/proc/destroy()
|
||||
if(wrapped)
|
||||
del wrapped
|
||||
|
||||
|
||||
wrapped = new/obj/item/broken_device
|
||||
|
||||
// The thing itself isn't there anymore, but some fried remains are.
|
||||
installed = -1
|
||||
uninstall()
|
||||
|
||||
/datum/robot_component/proc/take_damage(brute, electronics, sharp)
|
||||
if(installed != 1) return
|
||||
|
||||
brute_damage += brute
|
||||
electronics_damage += electronics
|
||||
|
||||
if(brute_damage + electronics_damage > max_damage) destroy()
|
||||
|
||||
/datum/robot_component/proc/heal_damage(brute, electronics)
|
||||
if(installed != 1)
|
||||
// If it's not installed, can't repair it.
|
||||
return 0
|
||||
|
||||
brute_damage = max(0, brute_damage - brute)
|
||||
electronics_damage = max(0, electronics_damage - electronics)
|
||||
|
||||
/datum/robot_component/proc/is_powered()
|
||||
return installed == 1 && (!energy_consumption || powered)
|
||||
|
||||
|
||||
/datum/robot_component/proc/consume_power()
|
||||
if(toggled == 0)
|
||||
powered = 0
|
||||
return
|
||||
if(owner.cell.charge >= energy_consumption)
|
||||
owner.cell.use(energy_consumption)
|
||||
powered = 1
|
||||
else
|
||||
powered = 0
|
||||
|
||||
|
||||
/datum/robot_component/actuator
|
||||
name = "actuator"
|
||||
energy_consumption = 2
|
||||
external_type = /obj/item/robot_parts/robot_component/actuator
|
||||
max_damage = 60
|
||||
|
||||
/datum/robot_component/cell
|
||||
name = "power cell"
|
||||
max_damage = 60
|
||||
|
||||
/datum/robot_component/cell/destroy()
|
||||
..()
|
||||
owner.cell = null
|
||||
|
||||
/datum/robot_component/radio
|
||||
name = "radio"
|
||||
external_type = /obj/item/robot_parts/robot_component/radio
|
||||
energy_consumption = 3
|
||||
max_damage = 10
|
||||
|
||||
/datum/robot_component/binary_communication
|
||||
name = "binary communication device"
|
||||
external_type = /obj/item/robot_parts/robot_component/binary_communication_device
|
||||
energy_consumption = 0
|
||||
max_damage = 30
|
||||
|
||||
/datum/robot_component/camera
|
||||
name = "camera"
|
||||
external_type = /obj/item/robot_parts/robot_component/camera
|
||||
energy_consumption = 2
|
||||
max_damage = 20
|
||||
|
||||
/datum/robot_component/diagnosis_unit
|
||||
name = "self-diagnosis unit"
|
||||
energy_consumption = 1
|
||||
external_type = /obj/item/robot_parts/robot_component/diagnosis_unit
|
||||
max_damage = 30
|
||||
|
||||
/mob/living/silicon/robot/proc/initialize_components()
|
||||
// This only initializes the components, it doesn't set them to installed.
|
||||
|
||||
components["actuator"] = new/datum/robot_component/actuator(src)
|
||||
components["radio"] = new/datum/robot_component/radio(src)
|
||||
components["power cell"] = new/datum/robot_component/cell(src)
|
||||
components["diagnosis unit"] = new/datum/robot_component/diagnosis_unit(src)
|
||||
components["camera"] = new/datum/robot_component/camera(src)
|
||||
components["comms"] = new/datum/robot_component/binary_communication(src)
|
||||
|
||||
/mob/living/silicon/robot/proc/is_component_functioning(module_name)
|
||||
var/datum/robot_component/C = components[module_name]
|
||||
return C && C.installed == 1 && C.toggled && C.is_powered()
|
||||
|
||||
/obj/item/broken_device
|
||||
name = "broken component"
|
||||
icon = 'robot_component.dmi'
|
||||
icon_state = "broken"
|
||||
|
||||
/obj/item/robot_parts/robot_component
|
||||
icon = 'robot_component.dmi'
|
||||
icon_state = "working"
|
||||
construction_time = 200
|
||||
construction_cost = list("metal"=5000)
|
||||
|
||||
|
||||
// TODO: actual icons ;)
|
||||
/obj/item/robot_parts/robot_component/binary_communication_device
|
||||
name = "binary communication device"
|
||||
|
||||
/obj/item/robot_parts/robot_component/actuator
|
||||
name = "actuator"
|
||||
|
||||
/obj/item/robot_parts/robot_component/camera
|
||||
name = "camera"
|
||||
|
||||
/obj/item/robot_parts/robot_component/diagnosis_unit
|
||||
name = "diagnosis unit"
|
||||
|
||||
/obj/item/robot_parts/robot_component/radio
|
||||
name = "radio"
|
||||
@@ -10,7 +10,18 @@
|
||||
|
||||
switch(act)
|
||||
if ("me")
|
||||
return custom_emote(m_type, message)
|
||||
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
|
||||
return custom_emote(m_type, message)
|
||||
|
||||
if ("custom")
|
||||
return custom_emote(m_type, message)
|
||||
@@ -62,20 +73,6 @@
|
||||
message = "<B>[src]</B> flaps his wings ANGRILY!"
|
||||
m_type = 2
|
||||
|
||||
if ("me")
|
||||
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 ("twitch")
|
||||
message = "<B>[src]</B> twitches violently."
|
||||
m_type = 1
|
||||
@@ -207,8 +204,12 @@
|
||||
m_type = 2
|
||||
else
|
||||
src << "You are not security."
|
||||
|
||||
if ("help")
|
||||
src << "salute, bow-(none)/mob, clap, flap, aflap, twitch, twitch_s, nod, deathgasp, glare-(none)/mob, stare-(none)/mob, look, beep, ping, \nbuzz, law, halt"
|
||||
else
|
||||
src << text("Invalid Emote: []", act)
|
||||
src << "\blue Unusable emote '[act]'. Say *help for a list."
|
||||
|
||||
if ((message && src.stat == 0))
|
||||
if (m_type & 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
|
||||
@@ -37,23 +37,25 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/use_power()
|
||||
|
||||
if (src.cell)
|
||||
if (is_component_functioning("power cell"))
|
||||
if(src.cell.charge <= 0)
|
||||
uneq_all()
|
||||
src.stat = 1
|
||||
else if (src.cell.charge <= 100)
|
||||
uneq_all()
|
||||
src.sight_mode = 0
|
||||
src.cell.use(1)
|
||||
else
|
||||
if(src.module_state_1)
|
||||
src.cell.use(5)
|
||||
src.cell.use(3)
|
||||
if(src.module_state_2)
|
||||
src.cell.use(5)
|
||||
src.cell.use(3)
|
||||
if(src.module_state_3)
|
||||
src.cell.use(5)
|
||||
src.cell.use(1)
|
||||
src.blinded = 0
|
||||
src.cell.use(3)
|
||||
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
C.consume_power()
|
||||
|
||||
if(!is_component_functioning("actuator"))
|
||||
Paralyse(3)
|
||||
|
||||
src.stat = 0
|
||||
else
|
||||
uneq_all()
|
||||
@@ -128,6 +130,17 @@
|
||||
src.druggy--
|
||||
src.druggy = max(0, src.druggy)
|
||||
|
||||
if(!is_component_functioning("radio"))
|
||||
radio.on = 0
|
||||
else
|
||||
radio.on = 1
|
||||
|
||||
if(is_component_functioning("camera"))
|
||||
src.blinded = 0
|
||||
else
|
||||
src.blinded = 1
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/robot/proc/handle_regular_hud_updates()
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
var/obj/item/weapon/cell/cell = null
|
||||
var/obj/machinery/camera/camera = null
|
||||
|
||||
// Components are basically robot organs.
|
||||
var/list/components = list()
|
||||
|
||||
var/obj/item/device/mmi/mmi = null
|
||||
|
||||
var/obj/item/device/pda/ai/rbPDA = null
|
||||
@@ -58,7 +61,7 @@
|
||||
var/braintype = "Cyborg"
|
||||
var/pose
|
||||
|
||||
/mob/living/silicon/robot/New(loc,var/syndie = 0)
|
||||
/mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0)
|
||||
spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
@@ -67,12 +70,10 @@
|
||||
updatename("Default")
|
||||
updateicon()
|
||||
|
||||
if(!cell)
|
||||
cell = new /obj/item/weapon/cell(src)
|
||||
cell.maxcharge = 7500
|
||||
cell.charge = 7500
|
||||
|
||||
if(syndie)
|
||||
if(!cell)
|
||||
cell = new /obj/item/weapon/cell(src)
|
||||
|
||||
laws = new /datum/ai_laws/antimov()
|
||||
lawupdate = 0
|
||||
scrambledcodes = 1
|
||||
@@ -99,6 +100,25 @@
|
||||
camera.network = list("SS13")
|
||||
if(isWireCut(5)) // 5 = BORG CAMERA
|
||||
camera.status = 0
|
||||
|
||||
initialize_components()
|
||||
if(!unfinished)
|
||||
// Create all the robot parts.
|
||||
for(var/V in components) if(V != "power cell")
|
||||
var/datum/robot_component/C = components[V]
|
||||
C.installed = 1
|
||||
C.wrapped = new C.external_type
|
||||
|
||||
if(!cell)
|
||||
cell = new /obj/item/weapon/cell(src)
|
||||
cell.maxcharge = 7500
|
||||
cell.charge = 7500
|
||||
|
||||
if(cell)
|
||||
var/datum/robot_component/cell_component = components["power cell"]
|
||||
cell_component.wrapped = cell
|
||||
cell_component.installed = 1
|
||||
|
||||
..()
|
||||
|
||||
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
|
||||
@@ -132,12 +152,21 @@
|
||||
module = new /obj/item/weapon/robot_module/standard(src)
|
||||
hands.icon_state = "standard"
|
||||
var/icontype
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree") icontype = ("Lucy")
|
||||
else icontype = input("Select an icon!", "Robot", null, null) in list("Basic", "Standard")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "robot_old"
|
||||
if("Lucy") icon_state = "rowtree-lucy"
|
||||
else icon_state = "robot"
|
||||
var/triesleft = 6
|
||||
while (triesleft)
|
||||
triesleft--
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree")
|
||||
icontype = ("Lucy")
|
||||
triesleft = 0
|
||||
else icontype = input("Select an icon! [triesleft ? "You would have [triesleft] more tries." : "This is your last try."]", "Robot", null, null) in list("Basic", "Standard")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "robot_old"
|
||||
if("Lucy") icon_state = "rowtree-lucy"
|
||||
else icon_state = "robot"
|
||||
if(triesleft)
|
||||
switch(input("Look at your icon - is this what you want?") in list("Yes","No"))
|
||||
if("Yes")
|
||||
triesleft = 0
|
||||
modtype = "Stand"
|
||||
feedback_inc("cyborg_standard",1)
|
||||
|
||||
@@ -146,15 +175,24 @@
|
||||
module = new /obj/item/weapon/robot_module/butler(src)
|
||||
hands.icon_state = "service"
|
||||
var/icontype
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree") icontype = ("Lucy")
|
||||
else icontype = input("Select an icon!", "Robot", null, null) in list("Waitress", "Bro", "Butler", "Kent", "Rich")
|
||||
switch(icontype)
|
||||
if("Waitress") icon_state = "Service"
|
||||
if("Kent") icon_state = "toiletbot"
|
||||
if("Bro") icon_state = "Brobot"
|
||||
if("Rich") icon_state = "maximillion"
|
||||
if("Lucy") icon_state = "rowtree-lucy"
|
||||
else icon_state = "Service2"
|
||||
var/triesleft = 6
|
||||
while (triesleft)
|
||||
triesleft--
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree")
|
||||
icontype = ("Lucy")
|
||||
triesleft = 0
|
||||
else icontype = input("Select an icon! [triesleft ? "You would have [triesleft] more tries." : "This is your last try."]", "Robot", null, null) in list("Waitress", "Bro", "Butler", "Kent", "Rich")
|
||||
switch(icontype)
|
||||
if("Waitress") icon_state = "Service"
|
||||
if("Kent") icon_state = "toiletbot"
|
||||
if("Bro") icon_state = "Brobot"
|
||||
if("Rich") icon_state = "maximillion"
|
||||
if("Lucy") icon_state = "rowtree-lucy"
|
||||
else icon_state = "Service2"
|
||||
if(triesleft)
|
||||
switch(input("Look at your icon - is this what you want?") in list("Yes","No"))
|
||||
if("Yes")
|
||||
triesleft = 0
|
||||
modtype = "Butler"
|
||||
feedback_inc("cyborg_service",1)
|
||||
|
||||
@@ -163,13 +201,22 @@
|
||||
module = new /obj/item/weapon/robot_module/miner(src)
|
||||
hands.icon_state = "miner"
|
||||
var/icontype
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree") icontype = ("Lucy")
|
||||
else icontype = input("Select an icon!", "Robot", null, null) in list("Basic", "Advanced Droid", "Treadhead")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "Miner_old"
|
||||
if("Advanced Droid") icon_state = "droid-miner"
|
||||
if("Lucy") icon_state = "rowtree-lucy"
|
||||
else icon_state = "Miner"
|
||||
var/triesleft = 6
|
||||
while (triesleft)
|
||||
triesleft--
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree")
|
||||
icontype = ("Lucy")
|
||||
triesleft = 0
|
||||
else icontype = input("Select an icon! [triesleft ? "You would have [triesleft] more tries." : "This is your last try."]", "Robot", null, null) in list("Basic", "Advanced Droid", "Treadhead")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "Miner_old"
|
||||
if("Advanced Droid") icon_state = "droid-miner"
|
||||
if("Lucy") icon_state = "rowtree-lucy"
|
||||
else icon_state = "Miner"
|
||||
if(triesleft)
|
||||
switch(input("Look at your icon - is this what you want?") in list("Yes","No"))
|
||||
if("Yes")
|
||||
triesleft = 0
|
||||
modtype = "Miner"
|
||||
feedback_inc("cyborg_miner",1)
|
||||
channels = list("Mining" = 1)
|
||||
@@ -179,14 +226,23 @@
|
||||
module = new /obj/item/weapon/robot_module/medical(src)
|
||||
hands.icon_state = "medical"
|
||||
var/icontype
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree") icontype = ("Lucy")
|
||||
else icontype = input("Select an icon!", "Robot", null, null) in list("Basic", "Advanced Droid", "Needles", "Hoverbot")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "Medbot"
|
||||
if("Advanced Droid") icon_state = "droid-medical"
|
||||
if("Needles") icon_state = "medicalrobot"
|
||||
if("Lucy") icon_state = "rowtree-medical"
|
||||
else icon_state = "surgeon"
|
||||
var/triesleft = 6
|
||||
while (triesleft)
|
||||
triesleft--
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree")
|
||||
icontype = ("Lucy")
|
||||
triesleft = 0
|
||||
else icontype = input("Select an icon! [triesleft ? "You would have [triesleft] more tries." : "This is your last try."]", "Robot", null, null) in list("Basic", "Advanced Droid", "Needles", "Hoverbot")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "Medbot"
|
||||
if("Advanced Droid") icon_state = "droid-medical"
|
||||
if("Needles") icon_state = "medicalrobot"
|
||||
if("Lucy") icon_state = "rowtree-medical"
|
||||
else icon_state = "surgeon"
|
||||
if(triesleft)
|
||||
switch(input("Look at your icon - is this what you want?") in list("Yes","No"))
|
||||
if("Yes")
|
||||
triesleft = 0
|
||||
modtype = "Med"
|
||||
status_flags &= ~CANPUSH
|
||||
feedback_inc("cyborg_medical",1)
|
||||
@@ -197,14 +253,23 @@
|
||||
module = new /obj/item/weapon/robot_module/security(src)
|
||||
hands.icon_state = "security"
|
||||
var/icontype
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree") icontype = ("Lucy")
|
||||
else icontype = input("Select an icon!", "Robot", null, null) in list("Basic", "Red Knight", "Black Knight", "Bloodhound")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "secborg"
|
||||
if("Red Knight") icon_state = "Security"
|
||||
if("Black Knight") icon_state = "securityrobot"
|
||||
if("Lucy") icon_state = "rowtree-security"
|
||||
else icon_state = "bloodhound"
|
||||
var/triesleft = 6
|
||||
while (triesleft)
|
||||
triesleft--
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree")
|
||||
icontype = ("Lucy")
|
||||
triesleft = 0
|
||||
else icontype = input("Select an icon! [triesleft ? "You would have [triesleft] more tries." : "This is your last try."]", "Robot", null, null) in list("Basic", "Red Knight", "Black Knight", "Bloodhound")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "secborg"
|
||||
if("Red Knight") icon_state = "Security"
|
||||
if("Black Knight") icon_state = "securityrobot"
|
||||
if("Lucy") icon_state = "rowtree-security"
|
||||
else icon_state = "bloodhound"
|
||||
if(triesleft)
|
||||
switch(input("Look at your icon - is this what you want?") in list("Yes","No"))
|
||||
if("Yes")
|
||||
triesleft = 0
|
||||
modtype = "Sec"
|
||||
//speed = -1 Secborgs have nerfed tasers now, so the speed boost is not necessary
|
||||
status_flags &= ~CANPUSH
|
||||
@@ -216,13 +281,22 @@
|
||||
module = new /obj/item/weapon/robot_module/engineering(src)
|
||||
hands.icon_state = "engineer"
|
||||
var/icontype
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree") icontype = ("Lucy")
|
||||
else icontype = input("Select an icon!", "Robot", null, null) in list("Basic", "Antique", "Landmate")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "Engineering"
|
||||
if("Antique") icon_state = "engineerrobot"
|
||||
if("Lucy") icon_state = "rowtree-engineering"
|
||||
else icon_state = "landmate"
|
||||
var/triesleft = 6
|
||||
while (triesleft)
|
||||
triesleft--
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree")
|
||||
icontype = ("Lucy")
|
||||
triesleft = 0
|
||||
else icontype = input("Select an icon! [triesleft ? "You would have [triesleft] more tries." : "This is your last try."]", "Robot", null, null) in list("Basic", "Antique", "Landmate")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "Engineering"
|
||||
if("Antique") icon_state = "engineerrobot"
|
||||
if("Lucy") icon_state = "rowtree-engineering"
|
||||
else icon_state = "landmate"
|
||||
if(triesleft)
|
||||
switch(input("Look at your icon - is this what you want?") in list("Yes","No"))
|
||||
if("Yes")
|
||||
triesleft = 0
|
||||
modtype = "Eng"
|
||||
feedback_inc("cyborg_engineering",1)
|
||||
channels = list("Engineering" = 1)
|
||||
@@ -232,13 +306,22 @@
|
||||
module = new /obj/item/weapon/robot_module/janitor(src)
|
||||
hands.icon_state = "janitor"
|
||||
var/icontype
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree") icontype = ("Lucy")
|
||||
else icontype = input("Select an icon!", "Robot", null, null) in list("Basic", "Mopbot", "Zamboni")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "JanBot2"
|
||||
if("Mopbot") icon_state = "janitorrobot"
|
||||
if("Lucy") icon_state = "rowtree-lucy"
|
||||
else icon_state = "mopgearrex"
|
||||
var/triesleft = 6
|
||||
while (triesleft)
|
||||
triesleft--
|
||||
if (src.name == "Lucy" && src.ckey == "rowtree")
|
||||
icontype = ("Lucy")
|
||||
triesleft = 0
|
||||
else icontype = input("Select an icon! [triesleft ? "You would have [triesleft] more tries." : "This is your last try."]", "Robot", null, null) in list("Basic", "Mopbot", "Zamboni")
|
||||
switch(icontype)
|
||||
if("Basic") icon_state = "JanBot2"
|
||||
if("Mopbot") icon_state = "janitorrobot"
|
||||
if("Lucy") icon_state = "rowtree-lucy"
|
||||
else icon_state = "mopgearrex"
|
||||
if(triesleft)
|
||||
switch(input("Look at your icon - is this what you want?") in list("Yes","No"))
|
||||
if("Yes")
|
||||
triesleft = 0
|
||||
modtype = "Jan"
|
||||
feedback_inc("cyborg_janitor",1)
|
||||
|
||||
@@ -262,10 +345,14 @@
|
||||
changed_name = "[(prefix ? "[prefix] " : "")][braintype]-[num2text(ident)]"
|
||||
real_name = changed_name
|
||||
name = real_name
|
||||
|
||||
|
||||
// if we've changed our name, we also need to update the display name for our PDA
|
||||
setup_PDA()
|
||||
|
||||
//We also need to update name of internal camera.
|
||||
if (camera)
|
||||
camera.c_tag = changed_name
|
||||
|
||||
/mob/living/silicon/robot/verb/Namepick()
|
||||
if(custom_name)
|
||||
return 0
|
||||
@@ -314,6 +401,53 @@
|
||||
viewalerts = 1
|
||||
src << browse(dat, "window=robotalerts&can_close=0")
|
||||
|
||||
/mob/living/silicon/robot/proc/self_diagnosis()
|
||||
if(!is_component_functioning("diagnosis unit"))
|
||||
return null
|
||||
|
||||
var/dat = "<HEAD><TITLE>[src.name] Self-Diagnosis Report</TITLE></HEAD><BODY>\n"
|
||||
for (var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
dat += "<b>[C.name]</b><br><table><tr><td>Power consumption</td><td>[C.energy_consumption]</td></tr><tr><td>Brute Damage:</td><td>[C.brute_damage]</td></tr><tr><td>Electronics Damage:</td><td>[C.electronics_damage]</td></tr><tr><td>Powered:</td><td>[(!C.energy_consumption || C.is_powered()) ? "Yes" : "No"]</td></tr><tr><td>Toggled:</td><td>[ C.toggled ? "Yes" : "No"]</td></table><br>"
|
||||
|
||||
return dat
|
||||
|
||||
|
||||
/mob/living/silicon/robot/verb/self_diagnosis_verb()
|
||||
set category = "Robot Commands"
|
||||
set name = "Self Diagnosis"
|
||||
|
||||
if(!is_component_functioning("diagnosis unit"))
|
||||
src << "\red Your self-diagnosis component isn't functioning."
|
||||
|
||||
var/dat = self_diagnosis()
|
||||
src << browse(dat, "window=robotdiagnosis")
|
||||
|
||||
|
||||
/mob/living/silicon/robot/verb/toggle_component()
|
||||
set category = "Robot Commands"
|
||||
set name = "Toggle Component"
|
||||
set desc = "Toggle a component, conserving power."
|
||||
|
||||
var/list/installed_components = list()
|
||||
for(var/V in components)
|
||||
if(V == "power cell") continue
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(C.installed)
|
||||
installed_components += V
|
||||
|
||||
var/toggle = input(src, "Which component do you want to toggle?", "Toggle Component") as null|anything in installed_components
|
||||
if(!toggle)
|
||||
return
|
||||
|
||||
var/datum/robot_component/C = components[toggle]
|
||||
if(C.toggled)
|
||||
C.toggled = 0
|
||||
src << "\red You disable [C.name]."
|
||||
else
|
||||
C.toggled = 1
|
||||
src << "\red You enable [C.name]."
|
||||
|
||||
/mob/living/silicon/robot/blob_act()
|
||||
if (stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
@@ -497,7 +631,24 @@
|
||||
if (istype(W, /obj/item/weapon/handcuffs)) // fuck i don't even know why isrobot() in handcuff code isn't working so this will have to do
|
||||
return
|
||||
|
||||
if(opened) // Are they trying to insert something?
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(!C.installed && istype(W, C.external_type))
|
||||
C.installed = 1
|
||||
C.wrapped = W
|
||||
C.install()
|
||||
user.drop_item()
|
||||
W.loc = null
|
||||
|
||||
usr << "\blue You install the [W.name]."
|
||||
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/weldingtool))
|
||||
if (!getBruteLoss())
|
||||
user << "Nothing to fix here!"
|
||||
return
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0))
|
||||
adjustBruteLoss(-30)
|
||||
@@ -510,6 +661,9 @@
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/cable_coil) && wiresexposed)
|
||||
if (!getFireLoss())
|
||||
user << "Nothing to fix here!"
|
||||
return
|
||||
var/obj/item/weapon/cable_coil/coil = W
|
||||
adjustFireLoss(-30)
|
||||
updatehealth()
|
||||
@@ -536,6 +690,27 @@
|
||||
C.updateicon()
|
||||
new/obj/item/robot_parts/chest(loc)
|
||||
src.Del()
|
||||
else
|
||||
// Okay we're not removing the cell or an MMI, but maybe something else?
|
||||
var/list/removable_components = list()
|
||||
for(var/V in components)
|
||||
if(V == "power cell") continue
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(C.installed == 1)
|
||||
removable_components += V
|
||||
|
||||
var/remove = input(user, "Which component do you want to pry out?", "Remove Component") as null|anything in removable_components
|
||||
if(!remove)
|
||||
return
|
||||
var/datum/robot_component/C = components[remove]
|
||||
var/obj/item/I = C.wrapped
|
||||
user << "You remove \the [I]."
|
||||
I.loc = src.loc
|
||||
|
||||
if(C.installed == 1)
|
||||
C.uninstall()
|
||||
C.installed = 0
|
||||
|
||||
else
|
||||
if(locked)
|
||||
user << "The cover is locked and cannot be opened."
|
||||
@@ -545,17 +720,20 @@
|
||||
updateicon()
|
||||
|
||||
else if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside
|
||||
var/datum/robot_component/C = components["power cell"]
|
||||
if(wiresexposed)
|
||||
user << "Close the panel first."
|
||||
else if(cell)
|
||||
else if(cell || C.installed)
|
||||
user << "There is a power cell already installed."
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
cell = W
|
||||
user << "You insert the power cell."
|
||||
// chargecount = 0
|
||||
updateicon()
|
||||
|
||||
C.installed = 1
|
||||
C.wrapped = W
|
||||
C.install()
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/multitool))
|
||||
if (wiresexposed)
|
||||
@@ -828,6 +1006,7 @@
|
||||
add_fingerprint(user)
|
||||
|
||||
if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
|
||||
var/datum/robot_component/cell_component = components["power cell"]
|
||||
if(cell)
|
||||
cell.updateicon()
|
||||
cell.add_fingerprint(user)
|
||||
@@ -835,6 +1014,11 @@
|
||||
user << "You remove \the [cell]."
|
||||
cell = null
|
||||
updateicon()
|
||||
else if(cell_component.installed == -1)
|
||||
cell_component.installed = 0
|
||||
var/obj/item/broken_device = cell_component.wrapped
|
||||
user << "You remove \the [broken_device]."
|
||||
user.put_in_active_hand(broken_device)
|
||||
|
||||
if(ishuman(user))
|
||||
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/mob/living/silicon/robot/getBruteLoss()
|
||||
var/amount = 0
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(C.installed == 1) amount += C.brute_damage
|
||||
return amount
|
||||
|
||||
/mob/living/silicon/robot/getFireLoss()
|
||||
var/amount = 0
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(C.installed == 1) amount += C.electronics_damage
|
||||
return amount
|
||||
|
||||
|
||||
/mob/living/silicon/robot/adjustBruteLoss(var/amount)
|
||||
if(amount > 0)
|
||||
take_overall_damage(amount, 0)
|
||||
else
|
||||
heal_overall_damage(-amount, 0)
|
||||
|
||||
/mob/living/silicon/robot/adjustFireLoss(var/amount)
|
||||
if(amount > 0)
|
||||
take_overall_damage(0, amount)
|
||||
else
|
||||
heal_overall_damage(0, -amount)
|
||||
|
||||
/mob/living/silicon/robot/proc/get_damaged_components(var/brute, var/burn)
|
||||
var/list/datum/robot_component/parts = list()
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(C.installed == 1) if((brute && C.brute_damage) || (burn && C.electronics_damage))
|
||||
parts += C
|
||||
return parts
|
||||
|
||||
/mob/living/silicon/robot/proc/get_damageable_components()
|
||||
var/list/rval = new
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
if(C.installed == 1) rval += C
|
||||
return rval
|
||||
|
||||
/mob/living/silicon/robot/heal_organ_damage(var/brute, var/burn)
|
||||
var/list/datum/robot_component/parts = get_damaged_components(brute,burn)
|
||||
if(!parts.len) return
|
||||
var/datum/robot_component/picked = pick(parts)
|
||||
picked.heal_damage(brute,burn)
|
||||
|
||||
/mob/living/silicon/robot/take_organ_damage(var/brute, var/burn, var/sharp = 0)
|
||||
var/datum/robot_component/C = pick(get_damageable_components())
|
||||
C.take_damage(brute,burn,sharp)
|
||||
|
||||
/mob/living/silicon/robot/heal_overall_damage(var/brute, var/burn)
|
||||
var/list/datum/robot_component/parts = get_damaged_components(brute,burn)
|
||||
|
||||
while(parts.len && (brute>0 || burn>0) )
|
||||
var/datum/robot_component/picked = pick(parts)
|
||||
|
||||
var/brute_was = picked.brute_damage
|
||||
var/burn_was = picked.electronics_damage
|
||||
|
||||
picked.heal_damage(brute,burn)
|
||||
|
||||
brute -= (brute_was-picked.brute_damage)
|
||||
burn -= (burn_was-picked.electronics_damage)
|
||||
|
||||
parts -= picked
|
||||
|
||||
/mob/living/silicon/robot/take_overall_damage(var/brute, var/burn, var/sharp = 0, var/used_weapon = null)
|
||||
if(status_flags & GODMODE) return //godmode
|
||||
var/list/datum/robot_component/parts = get_damageable_components()
|
||||
while(parts.len && (brute>0 || burn>0) )
|
||||
var/datum/robot_component/picked = pick(parts)
|
||||
|
||||
var/brute_was = picked.brute_damage
|
||||
var/burn_was = picked.electronics_damage
|
||||
|
||||
picked.take_damage(brute,burn)
|
||||
|
||||
brute -= (picked.brute_damage - brute_was)
|
||||
burn -= (picked.electronics_damage - burn_was)
|
||||
|
||||
parts -= picked
|
||||
@@ -24,6 +24,14 @@
|
||||
return ..(message)
|
||||
message = copytext(message, 3)
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
|
||||
// TODO: move the component system up to silicon so we don't have to use this ugly hack..
|
||||
if(istype(src, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = src
|
||||
if(!R.is_component_functioning("comms"))
|
||||
src << "\red Your binary communications component isn't functional."
|
||||
return
|
||||
|
||||
robot_talk(message)
|
||||
else if (department_radio_keys[prefix] == "department")
|
||||
if(isAI(src)&&client)//For patching directly into AI holopads.
|
||||
|
||||
@@ -596,7 +596,6 @@ var/list/slot_equipment_priority = list( \
|
||||
M.LAssailant = null
|
||||
else
|
||||
M.LAssailant = usr
|
||||
return
|
||||
|
||||
if(pulling)
|
||||
var/pulling_old = pulling
|
||||
@@ -604,6 +603,7 @@ var/list/slot_equipment_priority = list( \
|
||||
// Are we pulling the same thing twice? Just stop pulling.
|
||||
if(pulling_old == AM)
|
||||
return
|
||||
|
||||
src.pulling = AM
|
||||
AM.pulledby = src
|
||||
|
||||
|
||||
@@ -431,6 +431,19 @@ datum/preferences
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-vir"), ICON_OVERLAY)
|
||||
if(4)
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY)
|
||||
if(ROBOTICIST)
|
||||
clothes_s = new /icon('icons/mob/uniform.dmi', "robotics_s")
|
||||
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
|
||||
clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY)
|
||||
clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "toolbox_blue"), ICON_OVERLAY)
|
||||
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY)
|
||||
switch(backbag)
|
||||
if(2)
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY)
|
||||
if(3)
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY)
|
||||
if(4)
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY)
|
||||
|
||||
else if(job_engsec_high)
|
||||
switch(job_engsec_high)
|
||||
@@ -538,19 +551,7 @@ datum/preferences
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY)
|
||||
if(4)
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY)
|
||||
if(ROBOTICIST)
|
||||
clothes_s = new /icon('icons/mob/uniform.dmi', "robotics_s")
|
||||
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
|
||||
clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY)
|
||||
clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "toolbox_blue"), ICON_OVERLAY)
|
||||
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY)
|
||||
switch(backbag)
|
||||
if(2)
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY)
|
||||
if(3)
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY)
|
||||
if(4)
|
||||
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY)
|
||||
|
||||
if(AI)//Gives AI and borgs assistant-wear, so they can still customize their character
|
||||
clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s")
|
||||
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
|
||||
|
||||
Reference in New Issue
Block a user