diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 313a9106f48..47e77e1bccb 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -574,6 +574,8 @@ its easier to just keep the beam vertical. /atom/Click(location,control,params) //world << "atom.Click() on [src] by [usr] : src.type is [src.type]" + if(!istype(src,/obj/item/weapon/gun)) + usr.last_target_click = world.time if(usr.client.buildmode) build_click(usr, usr.client.buildmode, location, control, params, src) return diff --git a/code/game/hud.dm b/code/game/hud.dm index 9a29adc082b..a3022719807 100644 --- a/code/game/hud.dm +++ b/code/game/hud.dm @@ -46,9 +46,9 @@ #define ui_borg_panel "14:28,2:7" //Gun buttons -#define ui_gun1 "13:26,2:5" -#define ui_gun2 "12:24,2:5" -#define ui_gun3 "11:22,2:5" +#define ui_gun1 "13:26,3:7" +#define ui_gun2 "14:28, 4:7" +#define ui_gun3 "13:26,4:7" #define ui_gun_select "14:28,3:7" //Upper-middle right (damage indicators) diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm index 0e2c6bed099..f1d65d271db 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -3,7 +3,8 @@ #define X_SUIT_LAYER 2 #define X_L_HAND_LAYER 3 #define X_R_HAND_LAYER 4 -#define X_TOTAL_LAYERS 4 +#define TARGETED_LAYER 5 +#define X_TOTAL_LAYERS 5 ///////////////////////////////// /mob/living/carbon/alien/humanoid @@ -120,10 +121,22 @@ overlays_standing[X_L_HAND_LAYER] = null if(update_icons) update_icons() +//Call when target overlay should be added/removed +/mob/living/carbon/alien/humanoid/update_targeted(var/update_icons=1) + if (targeted_by && target_locked) + overlays_lying[TARGETED_LAYER] = target_locked + overlays_standing[TARGETED_LAYER] = target_locked + else if (!targeted_by && target_locked) + del(target_locked) + if (!targeted_by) + overlays_lying[TARGETED_LAYER] = null + overlays_standing[TARGETED_LAYER] = null + if(update_icons) update_icons() //Xeno Overlays Indexes////////// #undef X_HEAD_LAYER #undef X_SUIT_LAYER #undef X_L_HAND_LAYER #undef X_R_HAND_LAYER +#undef TARGETED_LAYER #undef X_TOTAL_LAYERS diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 07d1541f929..c0a9d4128d5 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -132,7 +132,6 @@ Please contact me on #coderbus IRC. ~Carn x //this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers //I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date. /mob/living/carbon/human/update_icons() - world << "[src] CALLED THE HUMAN VERSION OF UPDATE_ICONS" lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again update_hud() //TODO: remove the need for this overlays = null @@ -471,29 +470,17 @@ proc/get_damage_icon_part(damage_state, body_part) update_hair(0) if(update_icons) update_icons() +//Call when target overlay should be added/removed /mob/living/carbon/human/update_targeted(var/update_icons=1) - // If someone's targeting you - if (targeted_by.len) - - //If the target is already there and finished locking (after two seconds), put in locked state and be done - if (overlays_standing[TARGETED_LAYER]||overlays_lying[TARGETED_LAYER]) - var/target_locked = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locked") - overlays_lying[TARGETED_LAYER] = target_locked - overlays_standing[TARGETED_LAYER] = target_locked - return - - var/target_locking = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locking") - world << "TARGET_LOCKING IS [target_locking]" - - //Put in our overlay, since it isn't already there - overlays_lying[TARGETED_LAYER] = target_locking - overlays_standing[TARGETED_LAYER] = target_locking - - else + if (targeted_by && target_locked) + overlays_lying[TARGETED_LAYER] = target_locked + overlays_standing[TARGETED_LAYER] = target_locked + else if (!targeted_by && target_locked) + del(target_locked) + if (!targeted_by) overlays_lying[TARGETED_LAYER] = null overlays_standing[TARGETED_LAYER] = null - - if(update_icons) update_icons() + if(update_icons) update_icons() /* --------------------------------------- */ @@ -877,4 +864,5 @@ proc/get_damage_icon_part(damage_state, body_part) #undef L_HAND_LAYER #undef R_HAND_LAYER #undef TAIL_LAYER -#undef TOTAL_LAYERS +#undef TARGETED_LAYER +#undef TOTAL_LAYERS diff --git a/code/modules/mob/living/carbon/monkey/update_icons.dm b/code/modules/mob/living/carbon/monkey/update_icons.dm index 4df4f6623b4..08d0c58cdfc 100644 --- a/code/modules/mob/living/carbon/monkey/update_icons.dm +++ b/code/modules/mob/living/carbon/monkey/update_icons.dm @@ -4,7 +4,8 @@ #define M_HANDCUFF_LAYER 3 #define M_L_HAND_LAYER 4 #define M_R_HAND_LAYER 5 -#define M_TOTAL_LAYERS 5 +#define TARGETED_LAYER 6 +#define M_TOTAL_LAYERS 6 ///////////////////////////////// /mob/living/carbon/monkey @@ -101,11 +102,24 @@ if (client) client.screen |= contents +//Call when target overlay should be added/removed +/mob/living/carbon/monkey/update_targeted(var/update_icons=1) + if (targeted_by && target_locked) + overlays_lying[TARGETED_LAYER] = target_locked + overlays_standing[TARGETED_LAYER] = target_locked + else if (!targeted_by && target_locked) + del(target_locked) + if (!targeted_by) + overlays_lying[TARGETED_LAYER] = null + overlays_standing[TARGETED_LAYER] = null + if(update_icons) update_icons() + //Monkey Overlays Indexes//////// #undef M_MASK_LAYER #undef M_BACK_LAYER #undef M_HANDCUFF_LAYER #undef M_L_HAND_LAYER #undef M_R_HAND_LAYER +#undef TARGETED_LAYER #undef M_TOTAL_LAYERS diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 203e1c029f2..e373bd3f5ff 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1,7 +1,7 @@ /mob/living/silicon/robot name = "Cyborg" real_name = "Cyborg" - icon = 'icons/mob/robots.dmi'// + icon = 'icons/mob/robots.dmi' icon_state = "robot" maxHealth = 300 health = 300 @@ -790,7 +790,13 @@ overlays += "ov-openpanel -c" return - +//Call when target overlay should be added/removed +/mob/living/silicon/robot/update_targeted() + if(!targeted_by && target_locked) + del(target_locked) + updateicon() + if (targeted_by && target_locked) + overlays += target_locked /mob/living/silicon/robot/proc/installed_modules() if(weapon_lock) diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 5b9b46edf81..416bb6fea7c 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -23,10 +23,12 @@ /mob/living/simple_animal/corgi/Life() ..() - regenerate_icons() + //regenerate_icons() //Don't call this every life tick. + //I'm serious. If you're going to enable dressing up Ian, + //Find a GOOD place to call regenerate_icons(). /mob/living/simple_animal/corgi/show_inv(mob/user as mob) - /* + /* If you're turning this back on, scroll down and uncomment target_updated user.machine = src if(user.stat) return @@ -391,7 +393,14 @@ overlays += back_icon return - +//UNCOMMENT THIS WHEN YOU UNCOMMENT CODE FOR DRESSING UP IAN +/*//Call when target overlay should be added/removed +/mob/living/simple_animal/friendly/corgi/update_targeted() + if(!targeted_by && target_locked) + del(target_locked) + regenerate_icons() + if (targeted_by && target_locked) + overlays += target_locked*/ /mob/living/simple_animal/corgi/puppy name = "\improper corgi puppy" @@ -406,4 +415,4 @@ if(href_list["remove_inv"] || href_list["add_inv"]) usr << "\red You can't fit this on [src]" return - ..() + ..() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index b2f2f33287f..d9ed6512a12 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -432,4 +432,12 @@ var/obj/mecha/M = target_mob if (M.occupant) return (0) - return (1) \ No newline at end of file + return (1) + +//Call when target overlay should be added/removed +/mob/living/simple_animal/update_targeted() + if(!targeted_by && target_locked) + del(target_locked) + overlays = null + if (targeted_by && target_locked) + overlays += target_locked \ No newline at end of file diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index a6c3ebe5877..e208c04638f 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -282,7 +282,7 @@ return 0 move_delay = world.time//set move delay - + mob.last_move_intent = world.time + 10 switch(mob.m_intent) if("run") if(mob.drowsyness > 0) diff --git a/code/modules/mob/update_icons.dm b/code/modules/mob/update_icons.dm index 32ea610cd10..a6ae6dc4a09 100644 --- a/code/modules/mob/update_icons.dm +++ b/code/modules/mob/update_icons.dm @@ -5,7 +5,6 @@ return /mob/proc/update_icons() - world << "[src] CALLED THE MOB VERSION OF UPDATE_ICONS" return /mob/proc/update_hud() diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index a44abf2a9ff..bf6bc3032c7 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -28,6 +28,8 @@ var/automatic = 0 //Used to determine if you can target multiple people. var/tmp/mob/living/last_moved_mob //Used to fire faster at more than one person. var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them. + var/firerate = 1 // 0 for one bullet after tarrget moves and aim is lowered, + //1 for keep shooting until aim is lowered proc/load_into_chamber() return @@ -39,7 +41,7 @@ load_into_chamber() return 0 -//Removing the lock and the buttons. + //Removing the lock and the buttons. dropped(mob/user as mob) if(target) for(var/mob/living/M in target) @@ -59,19 +61,32 @@ for(var/obj/O in contents) O.emp_act(severity) -//Handling lowering yer gun. - attack_self() + verb/lower_aim() + set name = "Lower Aim" + set category = "Object" if(target) for(var/mob/living/M in target) if(M) M.NotTargeted(src) del(target) usr.visible_message("\blue \The [usr] lowers \the [src]...") - return 0 - return 1 + + //Clicking gun will still lower aim for guns that don't overwrite this + attack_self() + lower_aim() + + verb/toggle_firerate() + set name = "Toggle Firerate" + set category = "Object" + firerate = !firerate + if (firerate == 0) + loc << "You will now continue firing when your target moves." + else + loc << "You will now only fire once, then lower your aim, when your target moves." //Suiciding. attack(mob/living/M as mob, mob/living/user as mob, def_zone) + world << "[user] USED ATTACK()" if (M == user && user.zone_sel.selecting == "mouth" && load_into_chamber() && !mouthshoot) //Suicide handling. mouthshoot = 1 M.visible_message("\red \The [user] sticks their gun in their mouth, ready to pull the trigger...") @@ -117,11 +132,11 @@ update_icon() return else if(user.a_intent != "hurt" && load_into_chamber() && istype(in_chamber,/obj/item/projectile/energy/electrode)) //Point blank tasering. - /*if (M.canstun == 0 || M.canweaken == 0) + if (!(M.status_flags & CANSTUN) || !(M.status_flags & CANWEAKEN)) user.visible_message("\red \The [M] has been stunned with the taser gun by \the [user] to no effect!") del(in_chamber) update_icon() - return*/ + return if (prob(50)) if (M.paralysis < 60 && (!(HULK in M.mutations)) ) M.paralysis = 60 @@ -146,11 +161,57 @@ if(!load_into_chamber()) //No ammo, hit them! return ..() else + world << "\red PREFIRE IS CALLED TO SHOOT AT [M] BY [user]" PreFire(M,user) ///Otherwise, shoot! return else return ..() //Pistolwhippin' +//Compute how to fire..... + proc/PreFire(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, params) + //GraphicTrace(usr.x,usr.y,A.x,A.y,usr.z) + if(lock_time > world.time - 2) return //Lets not spam it. + if(!ismob(A)) //Didn't click someone, check if there is anyone along that guntrace +// 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) //Find dat mob. + if(M && ismob(M) && isliving(M) && M in view(user)) + //if(!(M.client && M.client.admin_invis)) TODO: Look into admin invisibility in post-merge code + Aim(M) //Aha! Aim at them! + return + else if(!ismob(M) || (ismob(M) && !(M in view(user)))) //Nope! They weren't there! + world << "\red CLICKED BUT COULDN'T FIND MOB, FIRED" + Fire(A,user,params) //Fire like normal, then. + if(ismob(A) && isliving(A) && !(A in target)) + Aim(A) //Clicked a mob, aim at them. + else if(lock_time < world.time + 10) + world << "\red LOCK TIME IS > WORLD TIME, FIRED" + Fire(A,user,params) //Bang! + else if(!target) + world << "\red DIDN'T HAVE A TARGET, FIRED" + Fire(A,user,params) //Boom! + //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) + // Stolen from sd_get_approx_dir, didn't want to reinclude + var/d=get_dir(usr,A) + var/dir_to_fire = d //Turn them to face their target. + if(d&d-1) // diagonal + var/ax=abs(usr.x-A.x) + var/ay=abs(usr.y-A.y) + if(ax>=ay<<1) dir_to_fire = d&12 // keep east/west (4 and 8) + else if(ay>=ax<<1) dir_to_fire = d&3 // keep north/south (1 and 2) + if(dir_to_fire != usr.dir) + usr.dir = dir_to_fire + proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)//TODO: go over this //Exclude lasertag guns from the CLUMSY check. @@ -158,7 +219,7 @@ if(istype(user, /mob/living)) var/mob/living/M = user if ((CLUMSY in M.mutations) && prob(50)) - M << "\red The [src.name] blows up in your face." + M << "\red The [src.name] blows up in your face!" M.take_organ_damage(0,20) M.drop_item() del(src) @@ -251,8 +312,6 @@ usr.visible_message("\red [usr] turns \the [src] on [M]!") else usr.visible_message("\red [usr] aims \a [src] at [M]!") - for(var/mob/K in viewers(usr)) - K << 'TargetOn.ogg' M.Targeted(src) @@ -291,6 +350,8 @@ else if(ay>=ax<<1) dir_to_fire = d&3 // keep north/south (1 and 2) if(dir_to_fire != M.dir) M.dir = dir_to_fire + if (!firerate) // If firerate is set to lower aim after one shot, untarget the target + T.NotTargeted(src) 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 @@ -300,50 +361,6 @@ else Fire(A,user,params) //Otherwise, fire normally. -//Compute how to fire..... - proc/PreFire(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, params) - //GraphicTrace(usr.x,usr.y,A.x,A.y,usr.z) - if(lock_time > world.time - 2) return //Lets not spam it. - if(!ismob(A)) //Didn't click someone, check if there is anyone along that guntrace -// 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) //Find dat mob. - if(M && ismob(M) && isliving(M) && M in view(user)) - //if(!(M.client && M.client.admin_invis)) TODO: Look into admin invisibility in post-merge code - Aim(M) //Aha! Aim at them! - return - else if(!ismob(M) || (ismob(M) && !(M in view(user)))) //Nope! They weren't there! - Fire(A,user,params) //Fire like normal, then. - if(ismob(A) && isliving(A) && !(A in target)) - Aim(A) //Clicked a mob, aim at them. - else if(lock_time < world.time + 10) - Fire(A,user,params) //Bang! - else if(!target) - Fire(A,user,params) //Boom! - //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) - // Stolen from sd_get_approx_dir, didn't want to reinclude - var/d=get_dir(usr,A) - var/dir_to_fire = d //Turn them to face their target. - if(d&d-1) // diagonal - var/ax=abs(usr.x-A.x) - var/ay=abs(usr.y-A.y) - if(ax>=ay<<1) dir_to_fire = d&12 // keep east/west (4 and 8) - else if(ay>=ax<<1) dir_to_fire = d&3 // keep north/south (1 and 2) - if(dir_to_fire != usr.dir) - usr.dir = dir_to_fire - - - //Yay, math! #define SIGN(X) ((X<0)?-1:1) @@ -391,7 +408,7 @@ mob/var target_time = -100 last_move_intent = -100 last_target_click = -5 - obj/effect/target_locked/target_locked = null + target_locked = null mob/proc Targeted(var/obj/item/weapon/gun/I) //Self explanitory. @@ -399,12 +416,14 @@ mob/proc I.target = list(src) else if(I.automatic && I.target.len < 5) //Automatic weapon, they can hold down a room. I.target += src - else if(I.target.len >= 5) //Otherwise, they can just aim at one person. + else if(I.target.len >= 5) if(ismob(I.loc)) I.loc << "You can only target 5 people at once!" return else return + for(var/mob/K in viewers(usr)) + K << 'TargetOn.ogg' if(!targeted_by) targeted_by = list() targeted_by += I I.lock_time = world.time + 20 //Target has 2 second to realize they're targeted and stop (or target the opponent). @@ -414,20 +433,13 @@ mob/proc so try not to get on their bad side.\black ))" if(targeted_by.len == 1) spawn(0) - //target_locked = new /obj/effect/target_locked(src) //Add the overlay - //overlays += target_locked - spawn(0) //Make it show the 2 states properly - //if(target_locked) - // target_locked.icon_state = "locking" - //update_icons() - update_targeted() - //overlays += target_locked + target_locked = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locking") + overlays += target_locked + spawn(0) sleep(20) - //if(target_locked) - // target_locked.icon_state = "locked" - //update_icons() - update_targeted() - //overlays += target_locked + if(target_locked) + target_locked = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locked") + update_targeted() var/mob/T = I.loc //Adding the buttons to the controler person if(T) @@ -436,12 +448,15 @@ mob/proc if(T.client) T.client.screen += T.item_use_icon T.client.screen += T.gun_move_icon - if(m_intent == "run" && T.client && T.client.target_can_move == 1 && T.client.target_can_run == 0) + else //If the client's gone, stop aiming + I.lower_aim() + return + if(m_intent == "run" && T.client.target_can_move == 1 && T.client.target_can_run == 0) src << "\red Your move intent is now set to walk, as your targeter permits it." //Self explanitory. m_intent = "walk" hud_used.move_intent.icon_state = "walking" while(targeted_by && T.client) - if(last_move_intent > I.lock_time + 10 && !T.client.target_can_move) //If the target moved while targeted + if(last_move_intent > I.lock_time + 10 && !T.client.target_can_move) //If target moved when not allowed to I.TargetActed(src) if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better. I.lock_time = world.time + 5 @@ -465,7 +480,7 @@ mob/proc if(!I.silenced) for(var/mob/M in viewers(src)) M << 'TargetOff.ogg' - //del(target_locked) //Remove the overlay + del(target_locked) //Remove the overlay targeted_by -= I I.target.Remove(src) //De-target them if(!I.target.len) @@ -475,8 +490,8 @@ mob/proc del(T.item_use_icon) del(T.gun_move_icon) del(T.gun_run_icon) - //if(!targeted_by.len) del targeted_by - spawn(1) /*update_icons()*/ update_targeted() + if(!targeted_by.len) del targeted_by + spawn(1) update_targeted() /* Captive(var/obj/item/weapon/gun/I) Sound(src,'CounterAttack.ogg') @@ -505,15 +520,15 @@ mob/proc //Used to overlay the awesome stuff -/obj/effect +///obj/effect // target_locking // icon = 'icons/effects/Targeted.dmi' // icon_state = "locking" // layer = 99 - target_locked - icon = 'icons/effects/Targeted.dmi' - icon_state = "locked" - layer = 17.9 +// target_locked +// icon = 'icons/effects/Targeted.dmi' +// icon_state = "locking" +// layer = 17.9 // captured // icon = 'Captured.dmi' // layer = 99 @@ -521,9 +536,13 @@ mob/proc //If you move out of range, it isn't going to still stay locked on you any more. client/var target_can_move = 0 + move_dir = 2 target_can_run = 0 + run_dir = 2 target_can_click = 0 + click_dir = 2 gun_mode = 0 + mode_dir = 1 mob/Move() . = ..() for(var/obj/item/weapon/gun/G in targeted_by) //Handle moving out of the gunner's view. @@ -541,14 +560,18 @@ client/verb //These are called by the on-screen buttons, adjusting what the victim can and cannot do. AllowTargetMove() set hidden=1 - spawn(1) target_can_move = !target_can_move + target_can_move = !target_can_move + if (move_dir == 2) + move_dir = 1 + else + move_dir = 2 if(!target_can_move) // winset(usr,"default.target_can_move","is-flat=true;border=sunken") usr << "Target may now walk." usr.gun_run_icon = new /obj/screen/gun/run(null) screen += usr.gun_run_icon if(usr.gun_move_icon) - usr.gun_move_icon.dir = 1 + usr.gun_move_icon.dir = move_dir usr.gun_move_icon.name = "Disallow Walking" else // winset(usr,"default.target_can_move","is-flat=false;border=none") @@ -556,7 +579,7 @@ client/verb target_can_run = 0 del(usr.gun_run_icon) if(usr.gun_move_icon) - usr.gun_move_icon.dir = 2 + usr.gun_move_icon.dir = move_dir usr.gun_move_icon.name = "Allow Walking" for(var/obj/item/weapon/gun/G in usr) G.lock_time = world.time + 5 @@ -573,18 +596,22 @@ client/verb M << "\red Your character will now be shot if they move." AllowTargetRun() set hidden=1 - spawn(1) target_can_run = !target_can_run + target_can_run = !target_can_run + if (run_dir == 2) + run_dir = 1 + else + run_dir = 2 if(!target_can_run) // winset(usr,"default.target_can_move","is-flat=true;border=sunken") usr << "Target may now run." if(usr.gun_run_icon) - usr.gun_run_icon.dir = 1 + usr.gun_run_con.dir = run_dir usr.gun_run_icon.name = "Disallow Running" else // winset(usr,"default.target_can_move","is-flat=false;border=none") usr << "Target may no longer run." if(usr.gun_run_icon) - usr.gun_run_icon.dir = 2 + usr.gun_run_icon.dir = run_dir usr.gun_run_icon.name = "Allow Running" for(var/obj/item/weapon/gun/G in src) G.lock_time = world.time + 5 @@ -596,18 +623,22 @@ client/verb M << "\red Your character will now be shot if they run." AllowTargetClick() set hidden=1 - spawn(1) target_can_click = !target_can_click + target_can_click = !target_can_click + if (click_dir == 2) + click_dir = 1 + else + click_dir = 2 if(!target_can_click) // winset(usr,"default.target_can_click","is-flat=true;border=sunken") usr << "Target may now use items." if(usr.item_use_icon) - usr.item_use_icon.dir = 1 + usr.item_use_icon.dir = click_dir usr.item_use_icon.name = "Disallow Item Use" else // winset(usr,"default.target_can_click","is-flat=false;border=none") usr << "Target may no longer use items." if(usr.item_use_icon) - usr.item_use_icon.dir = 2 + usr.item_use_icon.dir = click_dir usr.item_use_icon.name = "Allow Item Use" for(var/obj/item/weapon/gun/G in src) G.lock_time = world.time + 5 @@ -619,18 +650,28 @@ client/verb M << "\red Your character will now be shot if they use items." ToggleGunMode() + world << "\red [usr] called ToggleGuMode BEFORE:" + world << "gun_mode = [gun_mode]" + world << "mode_dir = [mode_dir]" + world << "[usr].gun_setting_icon.dir = [usr.gun_setting_icon.dir]" set hidden = 1 - spawn(1) gun_mode = !gun_mode - if(!gun_mode) + gun_mode = !gun_mode + if (mode_dir == 1) + mode_dir = 2 + else if (mode_dir == 2) + mode_dir = 1 + if(gun_mode) // winset(usr,"default.target_can_click","is-flat=true;border=sunken") usr << "You will now take people captive." - if(usr.gun_setting_icon) - usr.gun_setting_icon.dir = 2 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 = 1 + if(usr.gun_setting_icon) + usr.gun_setting_icon.dir = mode_dir + world << "\red AFTER:" + world << "gun_mode = [gun_mode]" + world << "mode_dir = [mode_dir]" + world << "[usr].gun_setting_icon.dir = [usr.gun_setting_icon.dir]" /obj/item/weapon/gun/proc/isHandgun() - return 1 \ No newline at end of file + return 1 diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index 70a21307644..aca91221415 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -7,6 +7,7 @@ caliber = "9mm" origin_tech = "combat=4;materials=2" ammo_type = "/obj/item/ammo_casing/c9mm" + automatic = 1 isHandgun() return 0 @@ -18,7 +19,7 @@ icon_state = "mini-uzi" w_class = 3.0 max_shells = 20 - caliber = ".45" + caliber = " .45" origin_tech = "combat=5;materials=2;syndicate=8" ammo_type = "/obj/item/ammo_casing/c45" diff --git a/icons/effects/Targeted.dmi b/icons/effects/Targeted.dmi index f0d4b95f64f..6d61505e6c5 100644 Binary files a/icons/effects/Targeted.dmi and b/icons/effects/Targeted.dmi differ diff --git a/icons/mob/screen1.dmi b/icons/mob/screen1.dmi index 48b8efcafc1..f50f2ea8d87 100644 Binary files a/icons/mob/screen1.dmi and b/icons/mob/screen1.dmi differ