diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 75c3666c84..c92871a2b6 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -309,6 +309,14 @@ return !P.launch_from_gun(target, user, src, target_zone, x_offset, y_offset) +//aprt of reskins that have two sprites, no touch please +/obj/item/weapon/gun/projectile/colt/detective/attack_hand(var/mob/living/user) + if(!unique_reskin && loc == user) + reskin_gun(user) + return + ..() + + //Suicide handling. /obj/item/weapon/gun/var/mouthshoot = 0 //To stop people from suiciding twice... >.> /obj/item/weapon/gun/proc/handle_suicide(mob/living/user) @@ -389,5 +397,4 @@ return new_mode /obj/item/weapon/gun/attack_self(mob/user) - switch_firemodes(user) - + switch_firemodes(user) \ No newline at end of file diff --git a/code/modules/projectiles/guns/projectile/pistol.dm b/code/modules/projectiles/guns/projectile/pistol.dm index 09ef988dfd..2ffcf78e06 100644 --- a/code/modules/projectiles/guns/projectile/pistol.dm +++ b/code/modules/projectiles/guns/projectile/pistol.dm @@ -1,4 +1,5 @@ /obj/item/weapon/gun/projectile/colt + var/unique_reskin name = "vintage .45 pistol" desc = "A cheap Martian knock-off of a Colt M1911. Uses .45 rounds." magazine_type = /obj/item/ammo_magazine/c45m @@ -8,10 +9,80 @@ fire_sound = 'sound/weapons/Gunshot_light.ogg' load_method = MAGAZINE +//For some reason you have to add one of these "if else" statements on the M1911 reskins or the code breaks. +//If you're not working with two different sprites, just set them to the same icon_state. + /obj/item/weapon/gun/projectile/colt/detective desc = "A Martian recreation of an old Terran pistol. Uses .45 rounds." magazine_type = /obj/item/ammo_magazine/c45m/rubber +/obj/item/weapon/gun/projectile/colt/detective/update_icon() + if(ammo_magazine) + icon_state = "colt" + else + icon_state = "colt-e" + + return + return..() +/obj/item/weapon/gun/projectile/colt/detective/update_icon() + if(unique_reskin == "usp") + if(ammo_magazine) + icon_state = "usp" + else + icon_state = "usp-e" + + return + return..() +obj/item/weapon/gun/projectile/colt/detective/update_icon() + if(unique_reskin == "p08") + if(ammo_magazine) + icon_state = "p08" + else + icon_state = "p08empty" + + return + return..() + +obj/item/weapon/gun/projectile/colt/detective/update_icon() + if(unique_reskin == "p08b") + if(ammo_magazine) + icon_state = "p08b" + else + icon_state = "p08emptyb" + + return + return..() + +obj/item/weapon/gun/projectile/colt/detective/update_icon() + if(unique_reskin == "VP78") + if(ammo_magazine) + icon_state = "VP78" + else + icon_state = "VP78-e" + + return + return..() + +obj/item/weapon/gun/projectile/colt/detective/update_icon() + if(unique_reskin == "secguncomp") + if(ammo_magazine) + icon_state = "secguncomp" + else + icon_state = "secguncomp-e" + + return + return..() + +obj/item/weapon/gun/projectile/colt/detective/update_icon() + if(unique_reskin == "secgundark") + if(ammo_magazine) + icon_state = "secgundark" + else + icon_state = "secgundark-e" + + return + return..() + /obj/item/weapon/gun/projectile/colt/detective/verb/rename_gun() set name = "Name Gun" set category = "Object" @@ -40,9 +111,15 @@ options["NT Mk. 58"] = "secguncomp" options["NT Mk. 58 Custom"] = "secgundark" options["Colt M1911"] = "colt" + options["USP"] = "usp" + options["H&K VP"] = "VP78" + options["P08 Luger"] = "p08" + options["P08 Luger, Brown"] = "p08b" + options["Cancel"] = null //why wasn't this a thing to begin with var/choice = input(M,"What do you want to skin the gun to?","Reskin Gun") in options if(src && choice && !M.stat && in_range(M,src)) icon_state = options[choice] + unique_reskin = options[choice] M << "Your gun is now skinned as [choice]. Say hello to your new friend." return 1 @@ -56,6 +133,13 @@ fire_sound = 'sound/weapons/Gunshot_light.ogg' load_method = MAGAZINE +/obj/item/weapon/gun/projectile/sec/update_icon() + ..() + if(ammo_magazine) + icon_state = "secguncomp" + else + icon_state = "secguncomp-e" + /obj/item/weapon/gun/projectile/sec/flash name = ".45 signal pistol" magazine_type = /obj/item/ammo_magazine/c45m/flash @@ -65,6 +149,13 @@ name = "custom .45 Pistol" icon_state = "secgundark" +/obj/item/weapon/gun/projectile/sec/wood/update_icon() + ..() + if(ammo_magazine) + icon_state = "secgundark" + else + icon_state = "secgundark-e" + /obj/item/weapon/gun/projectile/silenced name = "silenced pistol" desc = "A small, quiet, easily concealable gun. Uses .45 rounds." diff --git a/icons/obj/gun.dmi b/icons/obj/gun.dmi index ea1647e092..4bd860d338 100644 Binary files a/icons/obj/gun.dmi and b/icons/obj/gun.dmi differ