diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index be2ac74343..1080281ea0 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -115,6 +115,12 @@ icon_state = "45-10" amount_left = 10.0 +/obj/item/weapon/ammo/assaultmag + desc = "There are 30 bullets left!" + name = "5.56x45mm NATO" + icon_state = "5.56" + amount_left = 30.0 + /obj/item/weapon/ammo/shell //easier to add new shell types. Like badmin laser/taser/pulse shells. desc = "Generic shell description." name = "Generic shell." @@ -592,7 +598,7 @@ icon_state = "cshotgun" w_class = 4.0 force = 12.0 - flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY // THERE IS NO COMBAT SHOTGUN BACK SPRITE. DON'T ADD ONBACK -- Callagan + flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK shellsmax = 8 origin_tech = "combat=3" @@ -703,6 +709,32 @@ m_amt = 2000 // origin_tech = "combat=3;materials=2" +/obj/item/weapon/gun/carbine + desc = "There are 0 bullets left. Uses 5.56x45mm NATO" + name = "carbine" + icon_state = "carbinenomag" + var/obj/item/weapon/ammo/assaultmag/magazine + flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY + w_class = 4.0 + throw_speed = 2 + throw_range = 10 + force = 6.0 + m_amt = 2000 +// origin_tech = "combat=3;materials=2" + +/obj/item/weapon/gun/ak331 + desc = "There are 0 bullets left. Uses 5.56x45mm NATO" + name = "ak331" + icon_state = "ak331nomag" + var/obj/item/weapon/ammo/assaultmag/magazine + flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY + w_class = 4.0 + throw_speed = 2 + throw_range = 10 + force = 18.0 + m_amt = 2000 +// origin_tech = "combat=3;materials=2" + /obj/item/weapon/gun/detectiverevolver desc = "A cheap Martian knock-off of a Smith & Wesson Model 10. Uses .38-Special rounds." name = ".38 revolver" diff --git a/code/game/objects/items/weapons/guns_ammo.dm b/code/game/objects/items/weapons/guns_ammo.dm index 7a024bd97e..346080dd90 100644 --- a/code/game/objects/items/weapons/guns_ammo.dm +++ b/code/game/objects/items/weapons/guns_ammo.dm @@ -1178,6 +1178,12 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/us ..() return +/obj/item/weapon/ammo/assaultmag/examine() + set src in usr + src.desc = text("There are [] bullet\s left!", src.amount_left) + ..() + return + /obj/item/weapon/gun/glock/attackby(obj/item/weapon/ammo/a45/A as obj, mob/user as mob) ..() @@ -1308,3 +1314,166 @@ obj/item/weapon/gun/revolver/attackby(obj/item/weapon/ammo/a357/A as obj, mob/us A.process() return return + +/obj/item/weapon/gun/carbine/examine() + set src in usr + if (src.magazine) + if (istype(src.magazine, /obj/item/weapon/ammo/assaultmag)) + src.desc = text("There are [] bullet\s left! Uses 5.56x45mm NATO", src.magazine.amount_left) + else + src.desc = "There are 0 bullets left! Uses 5.56x45mm NATO" + ..() + return + +/obj/item/weapon/gun/carbine/verb/eject() + set src in usr + if (src.magazine) + if (istype(src.magazine, /obj/item/weapon/ammo/assaultmag)) + if (istype(src.loc, /mob)) + var/obj/item/W = src.loc:equipped() + var/emptyHand = (W == null) + if(emptyHand) + src.magazine.DblClick() + if(!istype(src.magazine.loc, /obj/item/weapon/gun/m1911)) + src.magazine = null + src.icon_state = "carbinenomag" + else + src.magazine.loc = src.loc + src.magazine = null + ..() + return + +/obj/item/weapon/gun/carbine/attackby(obj/item/weapon/ammo/assaultmag/A as obj, mob/user as mob) + ..() + + if (istype(A, /obj/item/weapon/ammo/assaultmag)) + if (src.magazine) + user << "\blue There is already a magazine in!" + return 1 + user.drop_item() + A.loc = src + src.magazine = A + src.icon_state = "carbine" + return 1 + return + +/obj/item/weapon/gun/carbine/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag) + + if (flag) + return + if ((istype(user, /mob/living/carbon/monkey)) && ticker.mode != "monkey") + usr << "\red You don't have the dexterity to do this!" + return + src.add_fingerprint(user) + if (src.magazine.amount_left < 1) + user.show_message("\red *click* *click*", 2) + return + playsound(user, 'Gunshot.ogg', 100, 1) + src.magazine.amount_left-- + for(var/mob/O in viewers(user, null)) + O.show_message(text("\red [] fires the carbine at []!", user, target), 1, "\red You hear a gunshot", 2) + var/turf/T = user.loc + var/turf/U = (istype(target, /atom/movable) ? target.loc : target) + if ((!( U ) || !( T ))) + return + while(!( istype(U, /turf) )) + U = U.loc + if (!( istype(T, /turf) )) + return + if (U == T) + user.bullet_act(PROJECTILE_WEAKBULLET) + return + var/obj/bullet/weakbullet/A = new /obj/bullet/weakbullet( user.loc ) + if (!istype(U, /turf)) + del(A) + return + 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() + return + return + + +/obj/item/weapon/gun/ak331/examine() + set src in usr + if (src.magazine) + if (istype(src.magazine, /obj/item/weapon/ammo/assaultmag)) + src.desc = text("There are [] bullet\s left! Uses 5.56x45mm NATO", src.magazine.amount_left) + else + src.desc = "There are 0 bullets left! Uses 5.56x45mm NATO" + ..() + return + +/obj/item/weapon/gun/ak331/verb/eject() + set src in usr + if (src.magazine) + if (istype(src.magazine, /obj/item/weapon/ammo/assaultmag)) + if (istype(src.loc, /mob)) + var/obj/item/W = src.loc:equipped() + var/emptyHand = (W == null) + if(emptyHand) + src.magazine.DblClick() + if(!istype(src.magazine.loc, /obj/item/weapon/gun/m1911)) + src.magazine = null + src.icon_state = "ak331nomag" + else + src.magazine.loc = src.loc + src.magazine = null + ..() + return + +/obj/item/weapon/gun/ak331/attackby(obj/item/weapon/ammo/assaultmag/A as obj, mob/user as mob) + ..() + + if (istype(A, /obj/item/weapon/ammo/assaultmag)) + if (src.magazine) + user << "\blue There is already a magazine in!" + return 1 + user.drop_item() + A.loc = src + src.magazine = A + src.icon_state = "ak331" + return 1 + return + +/obj/item/weapon/gun/ak331/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag) + + if (flag) + return + if ((istype(user, /mob/living/carbon/monkey)) && ticker.mode != "monkey") + usr << "\red You don't have the dexterity to do this!" + return + src.add_fingerprint(user) + if (src.magazine.amount_left < 1) + user.show_message("\red *click* *click*", 2) + return + playsound(user, 'Gunshot.ogg', 100, 1) + src.magazine.amount_left-- + for(var/mob/O in viewers(user, null)) + O.show_message(text("\red [] fires the ak331 at []!", user, target), 1, "\red You hear a gunshot", 2) + var/turf/T = user.loc + var/turf/U = (istype(target, /atom/movable) ? target.loc : target) + if ((!( U ) || !( T ))) + return + while(!( istype(U, /turf) )) + U = U.loc + if (!( istype(T, /turf) )) + return + if (U == T) + user.bullet_act(PROJECTILE_BULLET) + return + var/obj/bullet/A = new /obj/bullet( user.loc ) + if (!istype(U, /turf)) + del(A) + return + 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() + return + return \ No newline at end of file diff --git a/icons/mob/back.dmi b/icons/mob/back.dmi index f11f3b3a1f..6dae7e2b46 100644 Binary files a/icons/mob/back.dmi and b/icons/mob/back.dmi differ diff --git a/icons/obj/ammo.dmi b/icons/obj/ammo.dmi index abc233bc9f..7e86b83e39 100644 Binary files a/icons/obj/ammo.dmi and b/icons/obj/ammo.dmi differ diff --git a/icons/obj/gun.dmi b/icons/obj/gun.dmi index 73fb058e82..2fb0e5fc57 100644 Binary files a/icons/obj/gun.dmi and b/icons/obj/gun.dmi differ