diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index b6f7e260ef0..29eea4900da 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -39,6 +39,7 @@ #define ui_borg_sensor "CENTER-3:16, SOUTH:5" //borgs #define ui_borg_lamp "CENTER-4:16, SOUTH:5" //borgies +#define ui_borg_thrusters "CENTER-5:16, SOUTH:5"//borgies #define ui_inv1 "CENTER-2:16,SOUTH:5" //borgs #define ui_inv2 "CENTER-1 :16,SOUTH:5" //borgs #define ui_inv3 "CENTER :16,SOUTH:5" //borgs diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 6497dc38cf4..b13623a9bfd 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -36,14 +36,13 @@ var/mob/living/silicon/robot/R = usr R.toggle_module(3) - /obj/screen/robot/radio name = "radio" icon_state = "radio" /obj/screen/robot/radio/Click() var/mob/living/silicon/robot/R = usr - R.radio_menu() + R.radio.interact(R) /obj/screen/robot/store name = "store" @@ -61,9 +60,17 @@ var/mob/living/silicon/robot/R = usr R.control_headlamp() +/obj/screen/robot/thrusters + name = "ion thrusters" + icon_state = "ionpulse0" + +/obj/screen/robot/thrusters/Click() + var/mob/living/silicon/robot/R = usr + R.toggle_ionpulse() /datum/hud/robot/New(mob/owner) ..() + var/mob/living/silicon/robot/mymobR = mymob var/obj/screen/using //Radio @@ -72,9 +79,6 @@ static_inventory += using //Module select - - var/mob/living/silicon/robot/mymobR = mymob - using = new /obj/screen/robot/module1() using.screen_loc = ui_inv1 static_inventory += using @@ -93,7 +97,6 @@ //End of module select //Photography stuff - using = new /obj/screen/ai/image_take() using.screen_loc = ui_borg_camera static_inventory += using @@ -113,6 +116,12 @@ static_inventory += using mymobR.lamp_button = using +//Thrusters + using = new /obj/screen/robot/thrusters() + using.screen_loc = ui_borg_thrusters + static_inventory += using + mymobR.thruster_button = using + //Intent using = new /obj/screen/act_intent/robot() using.icon_state = mymob.a_intent diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index fa5c0c83b28..a891a8c9350 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -1,4 +1,4 @@ - // robot_upgrades.dm +// robot_upgrades.dm // Contains various borg upgrades. /obj/item/borg/upgrade @@ -8,8 +8,8 @@ icon_state = "cyborg_upgrade" origin_tech = "programming=4" var/locked = 0 - var/require_module = 0 var/installed = 0 + var/require_module = 0 var/module_type = null /obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R) @@ -20,7 +20,6 @@ R << "Upgrade mounting error! No suitable hardpoint detected!" usr << "There's no mounting point for the module!" return 1 - return 0 /obj/item/borg/upgrade/reset name = "cyborg module reset board" @@ -29,24 +28,32 @@ require_module = 1 /obj/item/borg/upgrade/reset/action(mob/living/silicon/robot/R) - if(..()) return 0 + if(..()) + return + + R.notify_ai(2) + R.uneq_all() R.hands.icon_state = "nomod" R.icon_state = "robot" qdel(R.module) R.module = null + R.modtype = "robot" - R.updatename("Default") - R.status_flags |= CANPUSH R.designation = "Default" - R.notify_ai(2) + R.updatename("Default") + R.update_icons() R.update_headlamp() - R.magpulse = 0 + + R.speed = 0 // Remove upgrades. + R.ionpulse = FALSE + R.magpulse = FALSE + + R.status_flags |= CANPUSH return 1 - /obj/item/borg/upgrade/rename name = "cyborg reclassification board" desc = "Used to rename a cyborg." @@ -57,12 +64,10 @@ heldname = stripped_input(user, "Enter new robot name", "Cyborg Reclassification", heldname, MAX_NAME_LEN) /obj/item/borg/upgrade/rename/action(mob/living/silicon/robot/R) - if(..()) return 0 - R.notify_ai(3, R.name, heldname) - R.name = heldname - R.real_name = heldname - R.camera.c_tag = heldname - R.custom_name = heldname //Required or else if the cyborg's module changes, their name is lost. + if(..()) + return + + R.fully_replace_character_name(R.name, heldname) return 1 @@ -82,17 +87,18 @@ if(ghost.mind && ghost.mind.current == R) R.key = ghost.key + R.notify_ai(1) + R.stat = UNCONSCIOUS R.update_stat() if(R.camera && !R.wires.is_cut(WIRE_CAMERA)) R.camera.toggle_cam(R,0) + dead_mob_list -= R //please never forget this ever kthx living_mob_list += R - R.notify_ai(1) return 1 - /obj/item/borg/upgrade/vtec name = "cyborg VTEC module" desc = "Used to kick in a cyborg's VTEC systems, increasing their speed." @@ -101,15 +107,17 @@ origin_tech = "engineering=4;materials=5" /obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R) - if(..()) return 0 + if(..()) + return + if(R.speed < 0) + R << "A VTEC unit is already installed!" + usr << "There's no room for another VTEC unit!" + return - if(R.speed == -1) - return 0 + R.speed = -2 // Gotta go fast. - R.speed-- return 1 - /obj/item/borg/upgrade/disablercooler name = "cyborg rapid disabler cooling module" desc = "Used to cool a mounted disabler, increasing the potential current in it and thus its recharge rate." @@ -119,47 +127,39 @@ origin_tech = "engineering=4;powerstorage=4" /obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R) - if(..()) return 0 + if(..()) + return - var/obj/item/weapon/gun/energy/disabler/cyborg/T = locate() in R.module + var/obj/item/weapon/gun/energy/disabler/cyborg/T = locate() in R.module.modules if(!T) - T = locate() in R.module.contents - if(!T) - T = locate() in R.module.modules - if(!T) - usr << "This cyborg has had its disabler removed!" - return 0 - + usr << "There's no disabler in this unit!" + return if(T.charge_delay <= 2) - R << "Maximum cooling achieved for this hardpoint!" - usr << "There's no room for another cooling unit!" - return 0 + R << "A cooling unit is already installed!" + usr << "There's no room for another cooling unit!" + return - else - T.charge_delay = max(2 , T.charge_delay - 4) + T.charge_delay = max(2 , T.charge_delay - 4) return 1 - -/obj/item/borg/upgrade/jetpack - name = "mining cyborg jetpack" - desc = "A carbon dioxide jetpack suitable for low-gravity mining operations." +/obj/item/borg/upgrade/thrusters + name = "ion thruster upgrade" + desc = "A energy-operated thruster system for cyborgs." icon_state = "cyborg_upgrade3" - require_module = 1 - module_type = /obj/item/weapon/robot_module/miner origin_tech = "engineering=4;powerstorage=4" -/obj/item/borg/upgrade/jetpack/action(mob/living/silicon/robot/R) - if(..()) return 0 +/obj/item/borg/upgrade/thrusters/action(mob/living/silicon/robot/R) + if(..()) + return - R.module.modules += new/obj/item/weapon/tank/jetpack/carbondioxide(R.module) - for(var/obj/item/weapon/tank/jetpack/carbondioxide in R.module.modules) - R.internal = src - R.jetpackoverlay = 1 - R.module.rebuild() + if(R.ionpulse) + usr << "This unit already has ion thrusters installed!" + return + + R.ionpulse = TRUE return 1 - /obj/item/borg/upgrade/ddrill name = "mining cyborg diamond drill" desc = "A diamond drill replacement for the mining module's standard drill." @@ -169,16 +169,18 @@ origin_tech = "engineering=5;materials=5" /obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R) - if(..()) return 0 + if(..()) + return for(var/obj/item/weapon/pickaxe/drill/cyborg/D in R.module.modules) qdel(D) for(var/obj/item/weapon/shovel/S in R.module.modules) qdel(S) + R.module.modules += new /obj/item/weapon/pickaxe/drill/cyborg/diamond(R.module) R.module.rebuild() - return 1 + return 1 /obj/item/borg/upgrade/soh name = "mining cyborg satchel of holding" @@ -189,14 +191,16 @@ origin_tech = "engineering=5;materials=5;bluespace=3" /obj/item/borg/upgrade/soh/action(mob/living/silicon/robot/R) - if(..()) return 0 + if(..()) + return for(var/obj/item/weapon/storage/bag/ore/cyborg/S in R.module.modules) qdel(S) + R.module.modules += new /obj/item/weapon/storage/bag/ore/holding(R.module) R.module.rebuild() - return 1 + return 1 /obj/item/borg/upgrade/syndicate name = "illegal equipment module" @@ -206,12 +210,14 @@ origin_tech = "combat=4;syndicate=2" /obj/item/borg/upgrade/syndicate/action(mob/living/silicon/robot/R) - if(..()) return 0 + if(..()) + return - if(R.emagged == 1) - return 0 + if(R.emagged) + return R.SetEmagged(1) + return 1 /obj/item/borg/upgrade/selfrepair @@ -228,14 +234,17 @@ /obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R) if(..()) - return 0 + return + var/obj/item/borg/upgrade/selfrepair/U = locate() in R if(U) usr << "This unit is already equipped with a self-repair module." return 0 + cyborg = R icon_state = "selfrepair_off" action_button_name = "Toggle Self-Repair" + return 1 /obj/item/borg/upgrade/selfrepair/ui_action_click() @@ -256,7 +265,7 @@ /obj/item/borg/upgrade/selfrepair/proc/deactivate() SSobj.processing -= src - on = 0 + on = FALSE update_icon() /obj/item/borg/upgrade/selfrepair/process() @@ -264,8 +273,8 @@ repair_tick = 1 return - if( cyborg && (cyborg.stat != DEAD) && on) - if(cyborg.cell.charge < powercost*2) + if(cyborg && (cyborg.stat != DEAD) && on) + if(cyborg.cell.charge < powercost * 2) cyborg << "Self-repair module deactivated. Please recharge." deactivate() return @@ -285,7 +294,7 @@ cyborg.cell.use(5) repair_tick = 0 - if( (world.time - 2000) > msg_cooldown ) + if((world.time - 2000) > msg_cooldown ) var/msgmode = "standby" if(cyborg.health < 0) msgmode = "critical" diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm index 76bf8a97fe2..9fde058f0e9 100644 --- a/code/game/objects/items/weapons/tanks/jetpack.dm +++ b/code/game/objects/items/weapons/tanks/jetpack.dm @@ -33,8 +33,8 @@ w_class = 4 distribute_pressure = ONE_ATMOSPHERE * O2STANDARD var/gas_type = "o2" - var/on = 0 - var/stabilization_on = 0 + var/on = FALSE + var/turbo = FALSE var/datum/effect_system/trail_follow/ion/ion_trail @@ -63,16 +63,16 @@ if(user.incapacitated()) return - if(!on && !stabilization_on) + if(!on) turn_on() user << "You turn the thrusters on." - else if(on && !stabilization_on) - stabilization_on = TRUE - user << "You turn the stabilizers on." - else if(on && stabilization_on) + else if(!turbo) + turbo = TRUE + user << "You engage turbo mode." + else turn_off() - stabilization_on = FALSE - user << "You turn the thrusters and stabilizers off." + turbo = FALSE + user << "You turn jetpack off." /obj/item/weapon/tank/jetpack/proc/turn_on() on = TRUE diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index ea16885f05f..ab3fc2b9cf9 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -1,39 +1,32 @@ /mob/living/carbon/human/movement_delay() - . += dna.species.movement_delay(src) - . += ..() . += config.human_delay /mob/living/carbon/human/Process_Spacemove(movement_dir = 0) - if(..()) return 1 + if(!isturf(loc)) // In a mecha? A locker? Who knows! + return 0 - //Do we have a working jetpack - if(istype(back, /obj/item/weapon/tank/jetpack) && isturf(loc)) //Second check is so you can't use a jetpack in a mech - var/obj/item/weapon/tank/jetpack/J = back - if((movement_dir || J.stabilization_on) && J.allow_thrust(0.01, src)) - return 1 - if(istype(wear_suit, /obj/item/clothing/suit/space/hardsuit) && isturf(loc)) //Second check is so you can't use a jetpack in a mech + // Do we have a jetpack (and is it on)? + var/obj/item/weapon/tank/jetpack/J = back + if(!istype(J)) var/obj/item/clothing/suit/space/hardsuit/C = wear_suit - if(C.jetpack) - if((movement_dir || C.jetpack.stabilization_on) && C.jetpack.allow_thrust(0.01, src)) - return 1 - - return 0 - + J = C.jetpack + if(istype(J) && J.allow_thrust(0.01, src)) + return 1 /mob/living/carbon/human/slip(s_amount, w_amount, obj/O, lube) if(isobj(shoes) && (shoes.flags&NOSLIP) && !(lube&GALOSHES_DONT_HELP)) return 0 - .=..() + return ..() /mob/living/carbon/human/experience_pressure_difference() playsound(src, 'sound/effects/space_wind.ogg', 50, 1) if(shoes && shoes.flags&NOSLIP) return 0 - . = ..() + return ..() /mob/living/carbon/human/mob_has_gravity() . = ..() diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index c8c8faffbc4..99b6cbb675e 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -749,61 +749,47 @@ /datum/species/proc/movement_delay(mob/living/carbon/human/H) . = 0 + if(H.status_flags & GOTTAGOFAST) + . -= 1 + if(H.status_flags & GOTTAGOREALLYFAST) + . -= 2 + if(!(H.status_flags & IGNORESLOWDOWN)) - - var/grav = has_gravity(H) - var/hasjetpack = 0 - if(!grav) - var/obj/item/weapon/tank/jetpack/J - var/obj/item/weapon/tank/jetpack/P - - if(istype(H.back, /obj/item/weapon/tank/jetpack)) - J = H.back - if(istype(H.wear_suit,/obj/item/clothing/suit/space/hardsuit)) //copypasta but faster implementation currently + if(!has_gravity(H)) + // If there's no gravity we have the option of sanic speed. + var/obj/item/weapon/tank/jetpack/J = H.back + if(!istype(J)) var/obj/item/clothing/suit/space/hardsuit/C = H.wear_suit - P = C.jetpack - if(J) - if(J.allow_thrust(0.01, H)) - hasjetpack = 1 - else if(P) - if(P.allow_thrust(0.01, H)) - hasjetpack = 1 + J = C.jetpack - . = -1 - hasjetpack + if(istype(J) && J.turbo && J.allow_thrust(0.01, H)) + return -2 // Turbo mode. Gotta go fast. - if(grav || !hasjetpack) - var/health_deficiency = (100 - H.health + H.staminaloss) - if(health_deficiency >= 40) - . += (health_deficiency / 25) + var/health_deficiency = (100 - H.health + H.staminaloss) + if(health_deficiency >= 40) + . += (health_deficiency / 25) - var/hungry = (500 - H.nutrition) / 5 //So overeat would be 100 and default level would be 80 - if(hungry >= 70) - . += hungry / 50 + var/hungry = (500 - H.nutrition) / 5 // So overeat would be 100 and default level would be 80 + if(hungry >= 70) + . += hungry / 50 - if(H.wear_suit) - . += H.wear_suit.slowdown - if(H.shoes) - . += H.shoes.slowdown - if(H.back) - . += H.back.slowdown - if(H.l_hand && (H.l_hand.flags & HANDSLOW)) - . += H.l_hand.slowdown - if(H.r_hand && (H.r_hand.flags & HANDSLOW)) - . += H.r_hand.slowdown + if(H.wear_suit) + . += H.wear_suit.slowdown + if(H.shoes) + . += H.shoes.slowdown + if(H.back) + . += H.back.slowdown + if(H.l_hand && (H.l_hand.flags & HANDSLOW)) + . += H.l_hand.slowdown + if(H.r_hand && (H.r_hand.flags & HANDSLOW)) + . += H.r_hand.slowdown - if((H.disabilities & FAT)) - . += 1.5 - if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT) - . += (BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR + if((H.disabilities & FAT)) + . += 1.5 + if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT) + . += (BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR - . += speedmod - - if(grav) - if(H.status_flags & GOTTAGOFAST) - . -= 1 - - if(H.status_flags & GOTTAGOREALLYFAST) - . -= 2 + . += speedmod ////////////////// // ATTACK PROCS // diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 67c36e0cc5e..7ddc810833c 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -31,13 +31,12 @@ diag_hud_set_borgcell() /mob/living/silicon/robot/handle_regular_hud_updates() - if(!client) return update_cell_hud_icon() - if (syndicate) + if(syndicate) if(ticker.mode.name == "traitor") for(var/datum/mind/tra in ticker.mode.traitors) if(tra.current) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 49a01873380..16ea319a42c 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -8,11 +8,14 @@ macro_default = "robot-default" macro_hotkeys = "robot-hotkeys" bubble_icon = "robot" - var/sight_mode = 0 - var/custom_name = "" designation = "Default" //used for displaying the prefix & getting the current module of cyborg has_limbs = 1 - var/magpulse = 0 + + var/custom_name = "" + var/braintype = "Cyborg" + var/modtype = "robot" + var/obj/item/robot_parts/robot_suit/robot_suit = null //Used for deconstruction to remember what the borg was constructed out of.. + var/obj/item/device/mmi/mmi = null //Hud stuff @@ -20,6 +23,7 @@ var/obj/screen/inv2 = null var/obj/screen/inv3 = null var/obj/screen/lamp_button = null + var/obj/screen/thruster_button = null var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not var/obj/screen/robot_modules_background @@ -35,40 +39,39 @@ var/obj/item/weapon/stock_parts/cell/cell = null var/obj/machinery/camera/camera = null - var/obj/item/device/mmi/mmi = null - var/opened = 0 var/emagged = 0 var/emag_cooldown = 0 var/wiresexposed = 0 + + var/ident = 0 var/locked = 1 var/list/req_access = list(access_robotics) - var/ident = 0 - //var/list/laws = list() + var/alarms = list("Motion"=list(), "Fire"=list(), "Atmosphere"=list(), "Power"=list(), "Camera"=list(), "Burglar"=list()) var/viewalerts = 0 - var/modtype = "robot" - var/jetpack = 0 - var/datum/effect_system/trail_follow/ion/ion_trail = null - var/datum/effect_system/spark_spread/spark_system//So they can initialize sparks whenever/N - var/jeton = 0 + + var/speed = 0 // VTEC speed boost. + var/magpulse = FALSE // Magboot-like effect. + var/ionpulse = FALSE // Jetpack-like effect. + var/ionpulse_on = FALSE // Jetpack-like effect. + var/datum/effect_system/trail_follow/ion/ion_trail // Ionpulse effect. + var/low_power_mode = 0 //whether the robot has no charge left. + var/datum/effect_system/spark_spread/spark_system // So they can initialize sparks whenever/N var/lawupdate = 1 //Cyborgs will sync their laws with their AI by default - var/lockcharge //Boolean of whether the borg is locked down or not - var/speed = 0 //Cause sec borgs gotta go fast //No they dont! var/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them. + var/lockcharge //Boolean of whether the borg is locked down or not - var/obj/item/weapon/tank/internal = null //Hatred. Used if a borg has a jetpack. - var/obj/item/robot_parts/robot_suit/robot_suit = null //Used for deconstruction to remember what the borg was constructed out of.. var/toner = 0 var/tonermax = 40 - var/jetpackoverlay = 0 - var/braintype = "Cyborg" + var/lamp_max = 10 //Maximum brightness of a borg lamp. Set as a var for easy adjusting. var/lamp_intensity = 0 //Luminosity of the headlamp. 0 is off. Higher settings than the minimum require power. var/lamp_recharging = 0 //Flag for if the lamp is on cooldown after being forcibly disabled. + var/sight_mode = 0 var/updating = 0 //portable camera camerachunk update hud_possible = list(ANTAG_HUD, DIAG_STAT_HUD, DIAG_HUD, DIAG_BATT_HUD) @@ -159,11 +162,15 @@ /mob/living/silicon/robot/proc/pick_module() if(module) return + designation = input("Please, select a module!", "Robot", null, null) in list("Standard", "Engineering", "Medical", "Miner", "Janitor","Service", "Security") - var/animation_length=0 + var/animation_length = 0 + if(module) return + updatename() + switch(designation) if("Standard") module = new /obj/item/weapon/robot_module/standard(src) @@ -239,9 +246,11 @@ feedback_inc("cyborg_janitor",1) transform_animation(animation_length) + notify_ai(2) update_icons() update_headlamp() + SetEmagged(emagged) // Update emag status and give/take emag modules. /mob/living/silicon/robot/proc/transform_animation(animation_length) @@ -256,7 +265,6 @@ icon = 'icons/mob/robots.dmi' /mob/living/silicon/robot/proc/updatename() - var/changed_name = "" if(custom_name) changed_name = custom_name @@ -267,7 +275,6 @@ if(camera) camera.c_tag = real_name //update the camera name too - /mob/living/silicon/robot/verb/cmd_robot_alerts() set category = "Robot Commands" set name = "Show Alerts" @@ -286,7 +293,6 @@ set hidden = 1 uneq_active() - /mob/living/silicon/robot/proc/robot_alerts() var/dat = "