diff --git a/code/game/antagonist/outsider/raider.dm b/code/game/antagonist/outsider/raider.dm index e17632dccb..b6adfb82f1 100644 --- a/code/game/antagonist/outsider/raider.dm +++ b/code/game/antagonist/outsider/raider.dm @@ -19,12 +19,15 @@ var/datum/antagonist/raider/raiders /obj/item/clothing/under/pirate, /obj/item/clothing/under/redcoat, /obj/item/clothing/under/serviceoveralls, - /obj/item/clothing/under/captain_fly + /obj/item/clothing/under/captain_fly, + /obj/item/clothing/under/det, + /obj/item/clothing/under/brown, ) var/list/raider_shoes = list( /obj/item/clothing/shoes/jackboots, - /obj/item/clothing/shoes/sandal, + /obj/item/clothing/shoes/workboots, + /obj/item/clothing/shoes/brown, /obj/item/clothing/shoes/laceup ) @@ -40,7 +43,6 @@ var/datum/antagonist/raider/raiders /obj/item/clothing/head/pirate, /obj/item/clothing/head/bandana, /obj/item/clothing/head/hgpiratecap, - /obj/item/clothing/head/flatcap ) var/list/raider_suits = list( @@ -50,7 +52,9 @@ var/datum/antagonist/raider/raiders /obj/item/clothing/suit/storage/leather_jacket, /obj/item/clothing/suit/storage/toggle/brown_jacket, /obj/item/clothing/suit/storage/toggle/hoodie, - /obj/item/clothing/suit/storage/toggle/hoodie/black + /obj/item/clothing/suit/storage/toggle/hoodie/black, + /obj/item/clothing/suit/unathi/mantle, + /obj/item/clothing/suit/poncho, ) var/list/raider_guns = list( @@ -60,14 +64,33 @@ var/datum/antagonist/raider/raiders /obj/item/weapon/gun/energy/mindflayer, /obj/item/weapon/gun/energy/toxgun, /obj/item/weapon/gun/energy/stunrevolver, + /obj/item/weapon/gun/energy/ionrifle, + /obj/item/weapon/gun/energy/taser, /obj/item/weapon/gun/energy/crossbow/largecrossbow, + /obj/item/weapon/gun/launcher/crossbow, + /obj/item/weapon/gun/launcher/grenade, + /obj/item/weapon/gun/launcher/pneumatic, /obj/item/weapon/gun/projectile/automatic/mini_uzi, /obj/item/weapon/gun/projectile/automatic/c20r, + /obj/item/weapon/gun/projectile/automatic/wt550, + /obj/item/weapon/gun/projectile/automatic/sts35, /obj/item/weapon/gun/projectile/silenced, /obj/item/weapon/gun/projectile/shotgun/pump, /obj/item/weapon/gun/projectile/shotgun/pump/combat, + /obj/item/weapon/gun/projectile/shotgun/doublebarrel, + /obj/item/weapon/gun/projectile/shotgun/doublebarrel/pellet, + /obj/item/weapon/gun/projectile/shotgun/doublebarrel/sawn, /obj/item/weapon/gun/projectile/colt, - /obj/item/weapon/gun/projectile/pistol + /obj/item/weapon/gun/projectile/sec, + /obj/item/weapon/gun/projectile/pistol, + /obj/item/weapon/gun/projectile/revolver, + /obj/item/weapon/gun/projectile/pirate + ) + + var/list/raider_holster = list( + /obj/item/clothing/accessory/holster/armpit, + /obj/item/clothing/accessory/holster/waist, + /obj/item/clothing/accessory/holster/hip ) /datum/antagonist/raider/New() @@ -178,14 +201,18 @@ var/datum/antagonist/raider/raiders var/new_glasses = pick(raider_glasses) var/new_helmet = pick(raider_helmets) var/new_suit = pick(raider_suits) - var/new_gun = pick(raider_guns) player.equip_to_slot_or_del(new new_shoes(player),slot_shoes) + if(!player.shoes) + //If equipping shoes failed, fall back to equipping sandals + var/fallback_type = pick(/obj/item/clothing/shoes/sandal, /obj/item/clothing/shoes/jackboots/unathi) + player.equip_to_slot_or_del(new fallback_type(player), slot_shoes) + player.equip_to_slot_or_del(new new_uniform(player),slot_w_uniform) player.equip_to_slot_or_del(new new_glasses(player),slot_glasses) player.equip_to_slot_or_del(new new_helmet(player),slot_head) player.equip_to_slot_or_del(new new_suit(player),slot_wear_suit) - player.equip_to_slot_or_del(new new_gun(player),slot_belt) + equip_weapons(player) var/obj/item/weapon/card/id/id = create_id("Visitor", player) id.name = "[player.real_name]'s Passport" @@ -198,6 +225,70 @@ var/datum/antagonist/raider/raiders return 1 +/datum/antagonist/raider/proc/equip_weapons(var/mob/living/carbon/human/player) + var/new_gun = pick(raider_guns) + var/new_holster = pick(raider_holster) //raiders don't start with any backpacks, so let's be nice and give them a holster if they can use it. + var/turf/T = get_turf(player) + + var/obj/item/primary = new new_gun(T) + var/obj/item/clothing/accessory/holster/holster = null + + //Give some of the raiders a pirate gun as a secondary + if(prob(60)) + var/obj/item/secondary = new /obj/item/weapon/gun/projectile/pirate(T) + if(!(primary.slot_flags & SLOT_HOLSTER)) + holster = new new_holster(T) + holster.holstered = secondary + secondary.loc = holster + else + player.equip_to_slot_or_del(secondary, slot_belt) + + if(primary.slot_flags & SLOT_HOLSTER) + holster = new new_holster(T) + holster.holstered = primary + primary.loc = holster + else if(!player.belt && (primary.slot_flags & SLOT_BELT)) + player.equip_to_slot_or_del(primary, slot_belt) + else if(!player.back && (primary.slot_flags & SLOT_BACK)) + player.equip_to_slot_or_del(primary, slot_back) + else + player.put_in_any_hand_if_possible(primary) + + //If they got a projectile gun, give them a little bit of spare ammo + equip_ammo(player, primary) + + if(holster) + var/obj/item/clothing/under/uniform = player.w_uniform + if(istype(uniform) && uniform.can_attach_accessory(holster)) + uniform.attackby(holster, player) + else + player.put_in_any_hand_if_possible(holster) + +/datum/antagonist/raider/proc/equip_ammo(var/mob/living/carbon/human/player, var/obj/item/weapon/gun/gun) + if(istype(gun, /obj/item/weapon/gun/projectile)) + var/obj/item/weapon/gun/projectile/bullet_thrower = gun + if(bullet_thrower.magazine_type) + player.equip_to_slot_or_del(new bullet_thrower.magazine_type(player), slot_l_store) + if(prob(20)) //don't want to give them too much + player.equip_to_slot_or_del(new bullet_thrower.magazine_type(player), slot_r_store) + else if(bullet_thrower.ammo_type) + var/obj/item/weapon/storage/box/ammobox = new(get_turf(player.loc)) + for(var/i in 1 to rand(3,5) + rand(0,2)) + new bullet_thrower.ammo_type(ammobox) + player.put_in_any_hand_if_possible(ammobox) + return + if(istype(gun, /obj/item/weapon/gun/launcher/grenade)) + var/list/grenades = list( + /obj/item/weapon/grenade/empgrenade, + /obj/item/weapon/grenade/smokebomb, + /obj/item/weapon/grenade/flashbang + ) + var/obj/item/weapon/storage/box/ammobox = new(get_turf(player.loc)) + for(var/i in 1 to 7) + var/grenade_type = pick(grenades) + new grenade_type(ammobox) + player.put_in_any_hand_if_possible(ammobox) + /datum/antagonist/raider/proc/equip_vox(var/mob/living/carbon/human/player) var/uniform_type = pick(list(/obj/item/clothing/under/vox/vox_robes,/obj/item/clothing/under/vox/vox_casual)) diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index e81c33626e..b6a8cac9f1 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -174,16 +174,8 @@ if(M.equip_to_appropriate_slot(newitem)) return newitem - if(istype(M.back,/obj/item/weapon/storage)) - var/obj/item/weapon/storage/backpack = M.back - if(backpack.contents.len < backpack.storage_slots) - newitem.loc = M.back - return newitem + if(M.equip_to_storage(newitem)) + return newitem - // Try to place it in any item that can store stuff, on the mob. - for(var/obj/item/weapon/storage/S in M.contents) - if (S.contents.len < S.storage_slots) - newitem.loc = S - return newitem newitem.loc = get_turf(M.loc) return newitem diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index d835ea6446..1115826be8 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -73,6 +73,21 @@ var/list/slot_equipment_priority = list( \ return 0 +/mob/proc/equip_to_storage(obj/item/newitem) + // Try put it in their backpack + if(istype(src.back,/obj/item/weapon/storage)) + var/obj/item/weapon/storage/backpack = src.back + if(backpack.contents.len < backpack.storage_slots) + newitem.loc = src.back + return 1 + + // Try to place it in any item that can store stuff, on the mob. + for(var/obj/item/weapon/storage/S in src.contents) + if (S.contents.len < S.storage_slots) + newitem.loc = S + return 1 + return 0 + //These procs handle putting s tuff in your hand. It's probably best to use these rather than setting l_hand = ...etc //as they handle all relevant stuff like adding it to the player's screen and updating their overlays. diff --git a/code/modules/projectiles/guns/projectile/pistol.dm b/code/modules/projectiles/guns/projectile/pistol.dm index d054f4eff8..7e0fdc99a3 100644 --- a/code/modules/projectiles/guns/projectile/pistol.dm +++ b/code/modules/projectiles/guns/projectile/pistol.dm @@ -164,3 +164,37 @@ icon = 'icons/obj/gun.dmi' icon_state = "silencer" w_class = 2 + +/obj/item/weapon/gun/projectile/pirate + name = "zipgun" + desc = "Little more than a barrel, handle, and firing mechanism, cheap makeshift firearms like this one are not uncommon in frontier systems." + icon_state = "sawnshotgun" + item_state = "sawnshotgun" + handle_casings = CYCLE_CASINGS //player has to take the old casing out manually before reloading + load_method = SINGLE_CASING + max_shells = 1 //literally just a barrel + + var/global/list/ammo_types = list( + /obj/item/ammo_casing/a357 = ".357", + /obj/item/ammo_casing/c9mmf = "9mm", + /obj/item/ammo_casing/c45f = ".45", + /obj/item/ammo_casing/a12mm = "12mm", + /obj/item/ammo_casing/shotgun = "12 gauge", + /obj/item/ammo_casing/shotgun = "12 gauge", + /obj/item/ammo_casing/shotgun/pellet = "12 gauge", + /obj/item/ammo_casing/shotgun/pellet = "12 gauge", + /obj/item/ammo_casing/shotgun/pellet = "12 gauge", + /obj/item/ammo_casing/shotgun/beanbag = "12 gauge", + /obj/item/ammo_casing/shotgun/stunshell = "12 gauge", + /obj/item/ammo_casing/shotgun/flash = "12 gauge", + /obj/item/ammo_casing/a762 = "7.62mm", + /obj/item/ammo_casing/a556 = "5.56mm" + ) + +/obj/item/weapon/gun/projectile/pirate/New() + ammo_type = pick(ammo_types) + desc += " Uses [ammo_types[ammo_type]] rounds." + + var/obj/item/ammo_casing/ammo = ammo_type + caliber = initial(ammo.caliber) + ..() diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index 1b3bb21451..504ce461b3 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -47,7 +47,6 @@ max_shells = 7 //match the ammo box capacity, also it can hold a round in the chamber anyways, for a total of 8. ammo_type = /obj/item/ammo_casing/shotgun - /obj/item/weapon/gun/projectile/shotgun/doublebarrel name = "double-barreled shotgun" desc = "A true classic." @@ -95,12 +94,23 @@ return if(do_after(user, 30)) //SHIT IS STEALTHY EYYYYY icon_state = "sawnshotgun" + item_state = "sawnshotgun" w_class = 3 - item_state = "gun" + force = 5 slot_flags &= ~SLOT_BACK //you can't sling it on your back slot_flags |= (SLOT_BELT|SLOT_HOLSTER) //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally) - or in a holster, why not. name = "sawn-off shotgun" desc = "Omar's coming!" user << "You shorten the barrel of \the [src]!" else - ..() \ No newline at end of file + ..() + +/obj/item/weapon/gun/projectile/shotgun/doublebarrel/sawn + name = "sawn-off shotgun" + desc = "Omar's coming!" + icon_state = "sawnshotgun" + item_state = "sawnshotgun" + slot_flags = SLOT_BELT|SLOT_HOLSTER + ammo_type = /obj/item/ammo_casing/shotgun/pellet + w_class = 3 + force = 5 diff --git a/icons/mob/items/lefthand_guns.dmi b/icons/mob/items/lefthand_guns.dmi index 5e3c059267..d13b831811 100644 Binary files a/icons/mob/items/lefthand_guns.dmi and b/icons/mob/items/lefthand_guns.dmi differ diff --git a/icons/mob/items/righthand_guns.dmi b/icons/mob/items/righthand_guns.dmi index e742ca6833..62958f66f2 100644 Binary files a/icons/mob/items/righthand_guns.dmi and b/icons/mob/items/righthand_guns.dmi differ