diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 4e91bc33d8c..3c39813f5f1 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -88,6 +88,7 @@ var/area_uid var/area/alarm_area var/danger_level = 0 + var/buildstage = 2 //2 is built, 1 is building, 0 is frame. var/target_temperature = T0C+20 var/regulating_temperature = 0 @@ -107,8 +108,26 @@ TLV["temperature"] = list(20, 40, 140, 160) // K target_temperature = 90 - New() + New(var/loc, var/dir, var/building = 0) ..() + + if(building) + if(loc) + src.loc = loc + + if(dir) + src.dir = dir + + buildstage = 0 + wiresexposed = 1 + pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) + pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 + update_icon() + return + + first_run() + + proc/first_run() alarm_area = get_area(src) if (alarm_area.master) alarm_area = alarm_area.master @@ -131,7 +150,7 @@ process() - if((stat & (NOPOWER|BROKEN)) || shorted) + if((stat & (NOPOWER|BROKEN)) || shorted || buildstage != 2) return var/turf/simulated/location = loc @@ -486,6 +505,14 @@ var/wireFlag = AAlarmIndexToFlag[wireIndex] return ((AAlarmwires & wireFlag) == 0) + proc/allWiresCut() + var/i = 1 + while(i<=5) + if(AAlarmwires & AAlarmIndexToFlag[i]) + return 0 + i++ + return 1 + proc/cut(var/wireColor) var/wireFlag = AAlarmWireColorToFlag[wireColor] var/wireIndex = AAlarmWireColorToIndex[wireColor] @@ -609,6 +636,9 @@ interact(mob/user) user.set_machine(src) + if(buildstage!=2) + return + if ( (get_dist(src, user) > 1 )) if (!istype(user, /mob/living/silicon)) user.machine = null @@ -1064,28 +1094,74 @@ table tr:first-child th:first-child { border: none;} update_icon() return */ - if(istype(W, /obj/item/weapon/screwdriver)) // Opening that Air Alarm up. - //user << "You pop the Air Alarm's maintence panel open." - wiresexposed = !wiresexposed - user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]" - update_icon() - return + src.add_fingerprint(user) - if (wiresexposed && ((istype(W, /obj/item/device/multitool) || istype(W, /obj/item/weapon/wirecutters)))) - return attack_hand(user) + switch(buildstage) + if(2) + if(istype(W, /obj/item/weapon/screwdriver)) // Opening that Air Alarm up. + //user << "You pop the Air Alarm's maintence panel open." + wiresexposed = !wiresexposed + user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]" + update_icon() + return + if (wiresexposed && ((istype(W, /obj/item/device/multitool) || istype(W, /obj/item/weapon/wirecutters)))) + return attack_hand(user) + + if (istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))// trying to unlock the interface with an ID card + if(stat & (NOPOWER|BROKEN)) + user << "It does nothing" + return + else + if(allowed(usr) && !isWireCut(AALARM_WIRE_IDSCAN)) + locked = !locked + user << "\blue You [ locked ? "lock" : "unlock"] the Air Alarm interface." + updateUsrDialog() + else + user << "\red Access denied." + return + + if(1) + if(istype(W, /obj/item/weapon/cable_coil)) + var/obj/item/weapon/cable_coil/coil = W + if(coil.amount < 5) + user << "You need more cable for this!" + return + + user << "You wire \the [src]!" + coil.amount -= 5 + if(!coil.amount) + del(coil) + + buildstage = 2 + update_icon() + first_run() + + else if(istype(W, /obj/item/weapon/crowbar)) + user << "You pry out the circuit!" + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + spawn(20) + var/obj/item/weapon/airalarm_electronics/circuit = new /obj/item/weapon/airalarm_electronics() + circuit.loc = user.loc + buildstage = 0 + update_icon() + return + if(0) + if(istype(W, /obj/item/weapon/airalarm_electronics)) + user << "You insert the circuit!" + del(W) + buildstage = 1 + update_icon() + + /* Commented out due to RUNTIMES, RUNTIMES EVERYWHERE. + else if(istype(W, /obj/item/weapon/wrench)) + user << "You remove the fire alarm assembly from the wall!" + var/obj/item/firealarm_frame/frame = new /obj/item/firealarm_frame() + frame.loc = user.loc + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + del(src) */ + return - else if (istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))// trying to unlock the interface with an ID card - if(stat & (NOPOWER|BROKEN)) - user << "It does nothing" - else - if(allowed(usr) && !isWireCut(AALARM_WIRE_IDSCAN)) - locked = !locked - user << "\blue You [ locked ? "lock" : "unlock"] the Air Alarm interface." - updateUsrDialog() - else - user << "\red Access denied." - return return ..() /obj/machinery/alarm/power_change() @@ -1234,15 +1310,6 @@ FIRE ALARM user.visible_message("\red [user] has reconnected [src]'s detecting unit!", "You have reconnected [src]'s detecting unit.") else user.visible_message("\red [user] has disconnected [src]'s detecting unit!", "You have disconnected [src]'s detecting unit.") - - else if (istype(W, /obj/item/weapon/wirecutters)) - buildstage = 1 - playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) - var/obj/item/weapon/cable_coil/coil = new /obj/item/weapon/cable_coil() - coil.amount = 5 - coil.loc = user.loc - user << "You cut the wires from \the [src]" - update_icon() if(1) if(istype(W, /obj/item/weapon/cable_coil)) var/obj/item/weapon/cable_coil/coil = W diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 23d9918d9cc..e37ac58fd96 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -462,7 +462,8 @@ client/proc/one_click_antag() candidates.Remove(G) if(candidates.len) - var/raiders = 4 + var/max_raiders = 6 + var/raiders = max_raiders //Spawns vox raiders and equips them. for (var/obj/effect/landmark/L in world) if(L.name == "Response Team") @@ -484,18 +485,17 @@ client/proc/one_click_antag() new_vox << "\red Don't forget to turn on your nitrogen internals!" raiders-- - if(raiders > 4) + if(raiders > max_raiders) return 0 else return 0 return 1 /datum/admins/proc/create_vox_raider(obj/spawn_location, leader_chosen = 0) + var/mob/living/carbon/human/new_vox = new(spawn_location.loc) new_vox.gender = pick(MALE, FEMALE) - var/datum/preferences/A = new() //Randomize appearance for the raider. - A.randomize_appearance_for(new_vox) new_vox.h_style = "Short Vox Quills" new_vox.regenerate_icons() diff --git a/code/modules/admin/verbs/vox_raiders.dm b/code/modules/admin/verbs/vox_raiders.dm index 8774c3f14d1..b63362fbcd6 100644 --- a/code/modules/admin/verbs/vox_raiders.dm +++ b/code/modules/admin/verbs/vox_raiders.dm @@ -43,6 +43,10 @@ var/global/vox_tick = 1 W.cell.charge = 500 equip_to_slot_or_del(W, slot_r_hand) + var/obj/item/stack/rods/A = new(src) + A.amount = 20 + equip_to_slot_or_del(A, slot_l_hand) + if(4) // Vox medic! equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/pressure(src), slot_wear_suit) equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/pressure(src), slot_head) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 78546ceea22..a14d16e6fd2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1157,21 +1157,22 @@ mob/living/carbon/human/yank_out_object() if(O == selection) affected = organ if(self) - src << "You attempt to get a good grip on the [selection] in your [affected] with bloody fingers." + src << "You attempt to get a good grip on the [selection] in your [affected.display_name] with bloody fingers." else - U << "You attempt to get a good grip on the [selection] in [S]'s [affected] with bloody fingers." + U << "You attempt to get a good grip on the [selection] in [S]'s [affected.display_name] with bloody fingers." if(istype(U,/mob/living/carbon/human/)) U.bloody_hands(S) if(!do_after(U, 80)) return - if(!selection || !affected || !S || !U) - return + if(!selection || !affected || !S || !U) + return + if(self) - visible_message("[src] rips [selection] out of their [affected] in a welter of blood.","You rip [selection] out of your [affected] in a welter of blood.") + visible_message("[src] rips [selection] out of their [affected.display_name] in a welter of blood.","You rip [selection] out of your [affected] in a welter of blood.") else - visible_message("[usr] rips [selection] out of [src]'s [affected] in a welter of blood.","[src] rips [selection] out of your [affected] in a welter of blood.") + visible_message("[usr] rips [selection] out of [src]'s [affected.display_name] in a welter of blood.","[usr] rips [selection] out of your [affected] in a welter of blood.") selection.loc = get_turf(src) affected.implants -= selection diff --git a/code/modules/mob/living/silicon/robot/component.dm b/code/modules/mob/living/silicon/robot/component.dm index 223a1c547eb..e730974401c 100644 --- a/code/modules/mob/living/silicon/robot/component.dm +++ b/code/modules/mob/living/silicon/robot/component.dm @@ -39,7 +39,7 @@ brute_damage += brute electronics_damage += electronics - if(brute_damage + electronics_damage > max_damage) destroy() + if(brute_damage + electronics_damage >= max_damage) destroy() /datum/robot_component/proc/heal_damage(brute, electronics) if(installed != 1) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 160b8904daa..c5d18dccd2b 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -66,9 +66,7 @@ else src.camera.status = 1 - health = 200 - (getOxyLoss() + getFireLoss() + getBruteLoss()) - - if(getOxyLoss() > 50) Paralyse(3) + updatehealth() if(src.sleeping) Paralyse(3) diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm index 710a2598c9c..632b39e9f6f 100644 --- a/code/modules/mob/living/silicon/robot/robot_damage.dm +++ b/code/modules/mob/living/silicon/robot/robot_damage.dm @@ -3,21 +3,21 @@ health = 100 stat = CONSCIOUS return - health = 100 - getBruteLoss() - getFireLoss() + health = 100 - (getBruteLoss() + getFireLoss()) return /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 + if(C.installed != 0) 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 + if(C.installed != 0) amount += C.electronics_damage return amount /mob/living/silicon/robot/adjustBruteLoss(var/amount) @@ -52,7 +52,6 @@ if(!parts.len) return var/datum/robot_component/picked = pick(parts) picked.heal_damage(brute,burn) - updatehealth() /mob/living/silicon/robot/take_organ_damage(var/brute = 0, var/burn = 0, var/sharp = 0) var/list/components = get_damageable_components() @@ -78,7 +77,6 @@ var/datum/robot_component/C = pick(components) C.take_damage(brute,burn,sharp) - updatehealth() /mob/living/silicon/robot/heal_overall_damage(var/brute, var/burn) var/list/datum/robot_component/parts = get_damaged_components(brute,burn) @@ -95,7 +93,6 @@ burn -= (burn_was-picked.electronics_damage) parts -= picked - updatehealth() /mob/living/silicon/robot/take_overall_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/used_weapon = null) if(status_flags & GODMODE) return //godmode @@ -129,6 +126,4 @@ brute -= (picked.brute_damage - brute_was) burn -= (picked.electronics_damage - burn_was) - parts -= picked - - updatehealth() + parts -= picked \ No newline at end of file diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a11401c6680..1597a3cd545 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -946,7 +946,7 @@ mob/verb/yank_out_object() if(self) visible_message("[src] rips [selection] out of their body.","You rip [selection] out of your body.") else - visible_message("[usr] rips [selection] out of [src]'s body.","[src] rips [selection] out of your body.") + visible_message("[usr] rips [selection] out of [src]'s body.","[usr] rips [selection] out of your body.") selection.loc = get_turf(src)