diff --git a/code/defines/mob/mob.dm b/code/defines/mob/mob.dm index 4f67c079ec4..bc772f9ffc6 100644 --- a/code/defines/mob/mob.dm +++ b/code/defines/mob/mob.dm @@ -44,6 +44,7 @@ var/obj/screen/gun/item/item_use_icon = null var/obj/screen/gun/move/gun_move_icon = null var/obj/screen/gun/run/gun_run_icon = null + var/obj/screen/gun/mode/gun_setting_icon var/total_luminosity = 0 //This controls luminosity for mobs, when you pick up lights and such this is edited. If you want the mob to use lights it must update its lum in its life proc or such. Note clamp this value around 7 or such to prevent massive light lag. var/last_luminosity = 0 diff --git a/code/game/hud.dm b/code/game/hud.dm index 5f3e1e7c75d..d265ec0d134 100644 --- a/code/game/hud.dm +++ b/code/game/hud.dm @@ -44,9 +44,10 @@ #define ui_inv3 "SOUTH-1,3" -#define ui_gun1 "WEST,NORTH" -#define ui_gun2 "WEST+1,NORTH" -#define ui_gun3 "WEST+2,NORTH" +#define ui_gun1 "SOUTH,8" +#define ui_gun2 "SOUTH,9" +#define ui_gun3 "SOUTH,10" +#define ui_gun_select "SOUTH-1,9" diff --git a/code/game/objects/closets.dm b/code/game/objects/closets.dm index 3f431081f97..d4ee7745cb6 100644 --- a/code/game/objects/closets.dm +++ b/code/game/objects/closets.dm @@ -149,6 +149,8 @@ src.welded =! src.welded for(var/mob/M in viewers(src)) M.show_message("\red [src] has been [welded?"welded shut":"unwelded"] by [user.name].", 3, "\red You hear welding.", 2) + else if(istype(W,/obj/item/weapon/packageWrap)) + return else src.attack_hand(user) return diff --git a/code/game/objects/devices/PDA/PDA.dm b/code/game/objects/devices/PDA/PDA.dm index e8783ac589a..17915b0c443 100755 --- a/code/game/objects/devices/PDA/PDA.dm +++ b/code/game/objects/devices/PDA/PDA.dm @@ -333,6 +333,7 @@ /obj/item/device/pda/Topic(href, href_list) ..() var/mob/living/U = usr + U.last_target_click = world.time //Looking for master was kind of pointless since PDAs don't appear to have one. if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ) ) if ( !(U.stat || U.restrained()) ) @@ -382,6 +383,8 @@ mode = 2 if("21")//Read messeges mode = 21 + if("41")//Read messeges + mode = 41 if("3")//Atmos scan mode = 3 if("4")//Redirects to hub diff --git a/code/modules/mob/living/carbon/alien/humanoid/hud.dm b/code/modules/mob/living/carbon/alien/humanoid/hud.dm index 608dd6464d6..ec2a726538d 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/hud.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/hud.dm @@ -291,6 +291,8 @@ mymob.rest.name = "rest" mymob.rest.screen_loc = ui_rest + mymob.gun_setting_icon = new /obj/screen/gun/mode(null) + mymob.zone_sel = new /obj/screen/zone_sel( null ) mymob.zone_sel.overlays = null @@ -298,6 +300,6 @@ mymob.client.screen = null - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach ) + mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep, mymob.gun_setting_icon) //, mymob.mach ) mymob.client.screen += src.adding + src.other diff --git a/code/modules/mob/living/carbon/human/hud.dm b/code/modules/mob/living/carbon/human/hud.dm index 632220c09bb..0748588199a 100644 --- a/code/modules/mob/living/carbon/human/hud.dm +++ b/code/modules/mob/living/carbon/human/hud.dm @@ -663,10 +663,12 @@ mymob.zone_sel.overlays = null mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting)) + mymob.gun_setting_icon = new /obj/screen/gun/mode(null) + mymob.client.screen = null //, mymob.i_select, mymob.m_select - mymob.client.screen += list( mymob.pain, mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach ) + mymob.client.screen += list( mymob.pain, mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep, mymob.gun_setting_icon) //, mymob.mach ) mymob.client.screen += src.adding + src.other //if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo diff --git a/code/modules/mob/living/carbon/monkey/hud.dm b/code/modules/mob/living/carbon/monkey/hud.dm index 645e93c2da7..f41726cf1dc 100644 --- a/code/modules/mob/living/carbon/monkey/hud.dm +++ b/code/modules/mob/living/carbon/monkey/hud.dm @@ -563,10 +563,12 @@ mymob.zone_sel.overlays = null mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting)) + mymob.gun_setting_icon = new /obj/screen/gun/mode(null) + mymob.client.screen = null //, mymob.i_select, mymob.m_select - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach ) + mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep, mymob.gun_setting_icon) //, mymob.mach ) mymob.client.screen += src.adding + src.other //if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo diff --git a/code/modules/mob/living/silicon/robot/hud.dm b/code/modules/mob/living/silicon/robot/hud.dm index 0dbc0eda88a..fb8c6397199 100644 --- a/code/modules/mob/living/silicon/robot/hud.dm +++ b/code/modules/mob/living/silicon/robot/hud.dm @@ -242,9 +242,11 @@ mymob.zone_sel.overlays = null mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting)) + mymob.gun_setting_icon = new /obj/screen/gun/mode(null) + mymob.client.screen = null - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach ) + mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep, mymob.gun_setting_icon) //, mymob.mach ) mymob.client.screen += src.adding + src.other return diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index d1d09497040..dc5a633a1bf 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -30,6 +30,7 @@ name = "gun" icon = 'screen1.dmi' master = null + dir = 1 move name = "Allow Walking" @@ -46,6 +47,12 @@ icon_state = "no_item" screen_loc = ui_gun1 + mode + name = "Toggle Gun Mode" + desc = "The shortcut key for this is \"F6\"" + icon_state = "gun" + screen_loc = ui_gun_select + /obj/screen/zone_sel/MouseDown(location, control,params) // Changes because of 4.0 var/list/PL = params2list(params) @@ -590,78 +597,75 @@ usr:module_active = null if("Allow Walking") - if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes. - usr << "You need to wait some before you can change what they can do!" + if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return if(!istype(usr.equipped(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.AllowTargetMove() - icon_state = "walking" + dir = (dir%2)+1 name = "Disallow Walking" gun_click_time = world.time if("Disallow Walking") - if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes. - usr << "You need to wait some before you can change what they can do!" + if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return if(!istype(usr.equipped(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.AllowTargetMove() - icon_state = "no_walk" + dir = (dir%2)+1 name = "Allow Walking" gun_click_time = world.time if("Allow Running") - if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes. - usr << "You need to wait some before you can change what they can do!" + if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return if(!istype(usr.equipped(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.AllowTargetRun() - icon_state = "running" + dir = (dir%2)+1 name = "Disallow Running" gun_click_time = world.time if("Disallow Running") - if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes. - usr << "You need to wait some before you can change what they can do!" + if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return if(!istype(usr.equipped(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.AllowTargetRun() - icon_state = "no_run" + dir = (dir%2)+1 name = "Allow Running" gun_click_time = world.time if("Allow Item Use") - if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes. - usr << "You need to wait some before you can change what they can do!" + if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return if(!istype(usr.equipped(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return name = "Disallow Item Use" - icon_state = "act_throw_off" + dir = (dir%2)+1 usr.AllowTargetClick() gun_click_time = world.time if("Disallow Item Use") - if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes. - usr << "You need to wait some before you can change what they can do!" + if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return if(!istype(usr.equipped(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return name = "Allow Item Use" - icon_state = "no_item" + dir = (dir%2)+1 usr.AllowTargetClick() gun_click_time = world.time + if("Toggle Gun Mode") + usr.ToggleGunMode() + else DblClick() return diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index bbd3cf4586b..0ae8a0c0a30 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -190,42 +190,43 @@ afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params) if(flag) return //we're placing gun on a table or in backpack if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this? - PreFire(A,user,params) + if(user && user.gun_mode) + PreFire(A,user,params) + else + Fire(A,user,params) //Compute how to fire..... proc/PreFire(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, params) - if(usr.a_intent in list("help","grab","disarm")) - //GraphicTrace(usr.x,usr.y,A.x,A.y,usr.z) - if(lock_time > world.time - 2) return - if(!ismob(A)) + //GraphicTrace(usr.x,usr.y,A.x,A.y,usr.z) + if(lock_time > world.time - 2) return + if(!ismob(A)) // var/mob/M = locate() in range(0,A) // if(M && !ismob(A)) // if(M.type == /mob) // return FindTarget(M,user,params) - var/mob/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr) - if(M && ismob(M) && !target) - Aim(M) - return - if(ismob(A) && target != A) - Aim(A) - else if(lock_time < world.time + 10) - Fire(A,user,params) - else if(!target) - Fire(A,user,params) + var/mob/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr) + if(M && ismob(M) && !target && !M.client.admin_invis) + Aim(M) + return + if(ismob(A) && target != A) + Aim(A) + else if(lock_time < world.time + 10) + Fire(A,user,params) + else if(!target) + Fire(A,user,params) + //else + //var/item/gun/G = usr.OHand + //if(!G) + //Fire(A,0) + //else if(istype(G)) + //G.Fire(A,3) + //Fire(A,2) //else - //var/item/gun/G = usr.OHand - //if(!G) - //Fire(A,0) - //else if(istype(G)) - //G.Fire(A,3) - //Fire(A,2) - //else - //Fire(A) - var/dir_to_fire = sd_get_approx_dir(usr,A) - if(dir_to_fire != usr.dir) - usr.dir = dir_to_fire - else - Fire(A, user) + //Fire(A) + var/dir_to_fire = sd_get_approx_dir(usr,A) + if(dir_to_fire != usr.dir) + usr.dir = dir_to_fire + //Yay, math! @@ -372,6 +373,7 @@ mob/var target_can_move = 0 target_can_run = 0 target_can_click = 0 + gun_mode = 0 mob/Move() . = ..() for(var/obj/item/weapon/gun/G in targeted_by) @@ -438,4 +440,16 @@ mob/verb if(!target_can_click) G.target << "Your character may now use items at the discretion of their targeter." else - G.target << "\red Your character will now be shot if they use items." \ No newline at end of file + G.target << "\red Your character will now be shot if they use items." + + ToggleGunMode() + set hidden = 1 + spawn(1) gun_mode = !gun_mode + if(!gun_mode) +// winset(usr,"default.target_can_click","is-flat=true;border=sunken") + usr << "You will now take people captive." + else +// winset(usr,"default.target_can_click","is-flat=false;border=none") + usr << "You will now shoot where you target." + if(usr.gun_setting_icon) + usr.gun_setting_icon.dir = (usr.gun_setting_icon.dir%2)+1 \ No newline at end of file diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 821179b9572..ef37ca12b9e 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -172,7 +172,7 @@ afterattack(var/obj/target as obj, mob/user as mob) - if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack)) + if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack) || istype(target,/obj/item/smallDelivery)) return if(target.anchored) return @@ -193,17 +193,16 @@ src.amount -= 1 else if (istype(target, /obj/structure/closet/crate)) var/obj/structure/closet/crate/O = target - if (src.amount > 3) + if (src.amount > 3 && !O.opened) var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc)) P.wrapped = O O.loc = P src.amount -= 3 - else + else if(src.amount > 3) user << "\blue You need more paper." else if (istype (target, /obj/structure/closet)) var/obj/structure/closet/O = target - if (src.amount > 3) - O.close() + if (src.amount > 3 && !O.opened) var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc)) P.wrapped = O P.waswelded = O.welded @@ -211,7 +210,7 @@ O.welded = 1 O.loc = P src.amount -= 3 - else + else if(src.amount > 3) user << "\blue You need more paper." else user << "\blue The object you are trying to wrap is unsuitable for the sorting machinery!" diff --git a/icons/mob/screen1.dmi b/icons/mob/screen1.dmi index 3b56a6cd6c9..16e6b814c31 100644 Binary files a/icons/mob/screen1.dmi and b/icons/mob/screen1.dmi differ diff --git a/icons/mob/screen1_old.dmi b/icons/mob/screen1_old.dmi index c214d6441dd..1918ebce9fe 100644 Binary files a/icons/mob/screen1_old.dmi and b/icons/mob/screen1_old.dmi differ diff --git a/icons/mob/screen1_robot.dmi b/icons/mob/screen1_robot.dmi index da10c176b44..636a7208420 100644 Binary files a/icons/mob/screen1_robot.dmi and b/icons/mob/screen1_robot.dmi differ diff --git a/interface/skin.dmf b/interface/skin.dmf index adab69791fe..61d3bdec5b3 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -131,13 +131,21 @@ macro "macro" name = "F3" command = "say" is-disabled = false + elem + name = "F4" + command = "me" + is-disabled = false elem name = "F5" command = "asay" is-disabled = false + elem + name = "F6" + command = "ToggleGunMode" + is-disabled = false macro "tcside" - + macro "vending" elem name = "NORTHEAST" @@ -292,6 +300,7 @@ menu "menu" is-disabled = false saved-params = "is-checked" + window "Telecomms IDE" elem "Telecomms IDE" type = MAIN