From b0e5a3208b7bd0aa7b6db09ce17e5f2ab0b392a4 Mon Sep 17 00:00:00 2001 From: crazyclonetheninja Date: Thu, 16 Dec 2010 01:13:43 +0000 Subject: [PATCH] PDAs now show rank. To update your rank, just click on the PDA with your ID card. Note, the name needs to be the same as the one the PDA started with. Spare PDAs readded to map. Bugfix for shotguns. Once again, by Barhandar. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@633 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/devices/PDA.dm | 29 +++++-- code/game/objects/items/weapons/guns_ammo.dm | 90 ++++++++++++++------ maps/tgstation.2.0.0.dmm | 2 +- 3 files changed, 87 insertions(+), 34 deletions(-) diff --git a/code/game/objects/devices/PDA.dm b/code/game/objects/devices/PDA.dm index 96d1d89262e..0327574f144 100644 --- a/code/game/objects/devices/PDA.dm +++ b/code/game/objects/devices/PDA.dm @@ -10,6 +10,7 @@ flags = FPRINT | TABLEPASS | ONBELT var/owner = null + var/rank = null var/default_cartridge = 0 // Access level defined by cartridge var/obj/item/weapon/cartridge/cartridge = null //current cartridge var/mode = 0 //0-10, Main menu, Crew manifest, Engine monitor, Atmos scanner, med records, notes, sec records, messenger, mop locator, signaler, status display. @@ -1422,12 +1423,28 @@ Code: src.cartridge = C src.updateUsrDialog() - else if (istype(C, /obj/item/weapon/card/id) && !src.owner && C:registered) - src.owner = C:registered - src.ownjob = C:assignment - src.name = "PDA-[src.owner]" - user << "\blue Card scanned." - src.updateUsrDialog() + else if (istype(C, /obj/item/weapon/card/id) && C:registered) + if(!src.owner) + src.owner = C:registered + src.rank = C:assignment + src.name = "PDA-[src.owner]([src.rank])" + user << "\blue Card scanned." + src.updateSelfDialog() + return + if(!(src.owner == C:registered)) + user << "\blue Name on card does not match registered name. Please try again." + src.updateSelfDialog() + return + if((src.owner == C:registered) && (src.rank == C:assignment)) + user << "\blue Rank is up to date." + src.updateSelfDialog() + return + if((src.owner == C:registered) && (src.rank != C:assignment)) + src.rank = C:assignment + src.name = "PDA-[src.owner]([src.rank])" + user << "\blue Rank updated." + src.updateSelfDialog() + return /obj/item/device/pda/attack(mob/C as mob, mob/user as mob) diff --git a/code/game/objects/items/weapons/guns_ammo.dm b/code/game/objects/items/weapons/guns_ammo.dm index 05c64fbcaa6..ba515e194fe 100644 --- a/code/game/objects/items/weapons/guns_ammo.dm +++ b/code/game/objects/items/weapons/guns_ammo.dm @@ -367,34 +367,70 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/us spawn( 0 ) return //following code definitely can be made in a more efficient way, I just don't know it -- Barhandar - else if (shellsunlimited == 1) - var/obj/bullet/A = new /obj/bullet/weakbullet( user.loc ) - src.pumped = 0 - A.current = U - A.yo = U.y - T.y - A.xo = U.x - T.x - user.next_move = world.time + 4 - spawn( 0 ) - A.process() - if (!istype(U, /turf)) - del(A) + switch(shellsunlimited) + if (1) + var/obj/bullet/A = new /obj/bullet/weakbullet( user.loc ) + src.pumped = 0 + A.current = U + A.yo = U.y - T.y + A.xo = U.x - T.x + user.next_move = world.time + 4 + spawn( 0 ) + A.process() + if (!istype(U, /turf)) + del(A) + return + if (2) + var/obj/bullet/A = new /obj/bullet( user.loc ) + src.pumped = 0 + A.current = U + A.yo = U.y - T.y + A.xo = U.x - T.x + user.next_move = world.time + 4 + spawn( 0 ) + A.process() + if (!istype(U, /turf)) + del(A) + return + if (3) //I don't know why the fuck you'll need unlimited blank shells. Just to be sure. -- Barhandar + src.pumped = 0 + spawn( 0 ) return - else if (shellsunlimited == 2) - var/obj/bullet/A = new /obj/bullet( user.loc ) - src.pumped = 0 - A.current = U - A.yo = U.y - T.y - A.xo = U.x - T.x - user.next_move = world.time + 4 - spawn( 0 ) - A.process() - if (!istype(U, /turf)) - del(A) - return - else if (shellsunlimited == 3) //I don't know why the fuck you'll need unlimited blank shells. Just to be sure. -- Barhandar - src.pumped = 0 - spawn( 0 ) - return + else switch(src.shells[index]) + if (1) + var/obj/bullet/A = new /obj/bullet/weakbullet( user.loc ) + src.pumped = 0 + src.shells[index] = 0 + index-- + A.current = U + A.yo = U.y - T.y + A.xo = U.x - T.x + user.next_move = world.time + 4 + spawn( 0 ) + A.process() + if (!istype(U, /turf)) + del(A) + return + if (2) + var/obj/bullet/A = new /obj/bullet( user.loc ) + src.pumped = 0 + src.shells[index] = 0 + index-- + A.current = U + A.yo = U.y - T.y + A.xo = U.x - T.x + user.next_move = world.time + 4 + spawn( 0 ) + A.process() + if (!istype(U, /turf)) + del(A) + return + if (3) + src.pumped = 0 + src.shells[index] = 0 + index-- + spawn( 0 ) + return diff --git a/maps/tgstation.2.0.0.dmm b/maps/tgstation.2.0.0.dmm index 9ca08323830..ec876d79d66 100644 --- a/maps/tgstation.2.0.0.dmm +++ b/maps/tgstation.2.0.0.dmm @@ -1709,7 +1709,7 @@ "aGS" = (/obj/table/reinforced{tag = "icon-reinf_tabledir (SOUTHWEST)"; icon_state = "reinf_tabledir"; dir = 10},/obj/item/device/aicard,/turf/simulated/floor{tag = "icon-red (NORTHWEST)"; icon_state = "red"; dir = 9},/area/bridge) "aGT" = (/obj/item/device/radio/signaler,/obj/table/reinforced{tag = "icon-reinf_tabledir (SOUTHEAST)"; icon_state = "reinf_tabledir"; dir = 6},/obj/item/device/radio/signaler,/turf/simulated/floor{tag = "icon-red (NORTH)"; icon_state = "red"; dir = 1},/area/bridge) "aGU" = (/obj/machinery/computer/security,/obj/cable{icon_state = "0-2"; d2 = 2},/obj/cable,/turf/simulated/floor{tag = "icon-red (NORTH)"; icon_state = "red"; dir = 1},/area/bridge) -"aGV" = (/obj/table/reinforced{tag = "icon-reinf_tabledir (SOUTHWEST)"; icon_state = "reinf_tabledir"; dir = 10},/obj/item/weapon/storage/id_kit,/turf/simulated/floor{dir = 1; icon_state = "blue"},/area/bridge) +"aGV" = (/obj/table/reinforced{tag = "icon-reinf_tabledir (SOUTHWEST)"; icon_state = "reinf_tabledir"; dir = 10},/obj/item/weapon/storage/PDAbox,/turf/simulated/floor{dir = 1; icon_state = "blue"},/area/bridge) "aGW" = (/obj/table/reinforced{dir = 6; icon_state = "reinf_tabledir"; tag = "icon-reinf_tabledir"},/obj/item/clothing/glasses/sunglasses,/obj/window/reinforced{dir = 4; icon_state = "rwindow"; name = "tinted window"; opacity = 1; tag = "icon-rwindow (EAST)"},/turf/simulated/floor{dir = 1; icon_state = "blue"},/area/bridge) "aGX" = (/obj/machinery/computer/communications,/obj/cable{icon_state = "0-2"; d2 = 2},/turf/simulated/floor{dir = 1; icon_state = "blue"},/area/bridge) "aGY" = (/obj/table/reinforced{dir = 10; icon_state = "reinf_tabledir"; tag = "icon-reinf_tabledir"},/obj/item/weapon/storage/id_kit,/obj/window/reinforced{dir = 8; icon_state = "rwindow"; name = "tinted window"; opacity = 1; tag = "icon-rwindow (WEST)"},/turf/simulated/floor{dir = 1; icon_state = "blue"},/area/bridge)