From d04514e9ad535ee6eab4f339b72326796ed1d1dd Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 17:04:08 -0700 Subject: [PATCH 1/9] Partial fix for #3087 --- code/game/machinery/alarm.dm | 123 ++++++++++++++++++++++++++--------- 1 file changed, 93 insertions(+), 30 deletions(-) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 4e91bc33d8c..15f5c667ade 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] @@ -1064,28 +1091,73 @@ 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() + 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 +1306,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 From 5dc40474ec53c566bd40e7430823ed7210721498 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 21:53:17 -0700 Subject: [PATCH 2/9] Removes vox randomness in appearance. --- code/modules/admin/verbs/one_click_antag.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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() From b6699cbf9a6baf6208d09f302cc798811ddea135 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 21:57:51 -0700 Subject: [PATCH 3/9] Adds ammo to vox spawning with a crossbow. --- code/modules/admin/verbs/vox_raiders.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/admin/verbs/vox_raiders.dm b/code/modules/admin/verbs/vox_raiders.dm index 8774c3f14d1..7b81fc116fd 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/R = new(src) + R.amount = 20 + equip_to_slot_or_del(W, 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) From a2249fb1dc4cb4d90db0b2705d93b395893d9671 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 22:01:09 -0700 Subject: [PATCH 4/9] Fixes yank out verb string issues. --- code/modules/mob/living/carbon/human/human.dm | 8 ++++---- code/modules/mob/mob.dm | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 78546ceea22..ab9109707ee 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1157,9 +1157,9 @@ 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) @@ -1169,9 +1169,9 @@ mob/living/carbon/human/yank_out_object() 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/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) From 60b9d0f8fcb8ffadc83e364c846c1c08e2e62d69 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 22:09:27 -0700 Subject: [PATCH 5/9] Compile fix. --- code/modules/admin/verbs/vox_raiders.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/verbs/vox_raiders.dm b/code/modules/admin/verbs/vox_raiders.dm index 7b81fc116fd..b63362fbcd6 100644 --- a/code/modules/admin/verbs/vox_raiders.dm +++ b/code/modules/admin/verbs/vox_raiders.dm @@ -43,9 +43,9 @@ var/global/vox_tick = 1 W.cell.charge = 500 equip_to_slot_or_del(W, slot_r_hand) - var/obj/item/stack/rods/R = new(src) - R.amount = 20 - equip_to_slot_or_del(W, slot_l_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) From 0cfaf8e70b51b46b15e82a3839ee0c7400bb6537 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 22:15:40 -0700 Subject: [PATCH 6/9] Minor string fix. --- code/modules/mob/living/carbon/human/human.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ab9109707ee..a14d16e6fd2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1166,10 +1166,11 @@ mob/living/carbon/human/yank_out_object() 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].display_name 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.display_name] in a welter of blood.","[usr] rips [selection] out of your [affected] in a welter of blood.") From 8f596f5fc1bcc9af0ff35c82e7c1347746e1c98f Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 22:32:37 -0700 Subject: [PATCH 7/9] Air alarm runtime fix. --- code/game/machinery/alarm.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 15f5c667ade..3c39813f5f1 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -636,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 @@ -1142,6 +1145,7 @@ table tr:first-child th:first-child { border: none;} circuit.loc = user.loc buildstage = 0 update_icon() + return if(0) if(istype(W, /obj/item/weapon/airalarm_electronics)) user << "You insert the circuit!" From aeec95b350d89090fdde5b7e897f7bb794a3a38a Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 23:31:27 -0700 Subject: [PATCH 8/9] Robot immortality fixes. --- code/modules/mob/living/silicon/robot/component.dm | 2 +- code/modules/mob/living/silicon/robot/life.dm | 4 +--- .../mob/living/silicon/robot/robot_damage.dm | 13 ++++--------- 3 files changed, 6 insertions(+), 13 deletions(-) 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..ebcc575c0d8 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 != 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 + 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 From 349851313e54deca9ab2386490f18ebf7b39121c Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 23:34:44 -0700 Subject: [PATCH 9/9] Typo. --- code/modules/mob/living/silicon/robot/robot_damage.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm index ebcc575c0d8..632b39e9f6f 100644 --- a/code/modules/mob/living/silicon/robot/robot_damage.dm +++ b/code/modules/mob/living/silicon/robot/robot_damage.dm @@ -10,7 +10,7 @@ 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()