Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whiskey Outpost Reqs Tweaks #4803

Merged
merged 5 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/game/area/WhiskeyOutpost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
icon_state = "livingspace"

/area/whiskey_outpost/inside/supply
name = "\improper Supply Depo"
name = "\improper Supply Depot"
icon_state = "req"

/*
Expand Down
79 changes: 67 additions & 12 deletions code/game/gamemodes/colonialmarines/whiskey_outpost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@
OT = "sup" //no breaking anything.

else if (OT == "sup")
randpick = rand(0,50)
randpick = rand(0,84)
fira marked this conversation as resolved.
Show resolved Hide resolved
switch(randpick)
if(0 to 5)//Marine Gear 10% Chance.
if(0 to 3)//Marine Gear 3% Chance.
crate = new /obj/structure/closet/crate/secure/gear(T)
choosemax = rand(5,10)
randomitems = list(/obj/item/clothing/head/helmet/marine,
Expand All @@ -340,19 +340,19 @@
/obj/effect/landmark/wo_supplies/storage/webbing,
/obj/item/device/binoculars)

if(6 to 10)//Lights and shiet 10%
if(4 to 6)//Lights and shiet 2%
new /obj/structure/largecrate/supply/floodlights(T)
new /obj/structure/largecrate/supply/supplies/flares(T)


if(11 to 13) //6% Chance to drop this !FUN! junk.
if(7 to 10) //3% Chance to drop this !FUN! junk.
crate = new /obj/structure/closet/crate/secure/gear(T)
spawnitems = list(/obj/item/storage/belt/utility/full,
/obj/item/storage/belt/utility/full,
/obj/item/storage/belt/utility/full,
/obj/item/storage/belt/utility/full)

if(14 to 18)//Materials 10% Chance.
if(11 to 22)//Materials 12% Chance.
crate = new /obj/structure/closet/crate/secure/gear(T)
choosemax = rand(3,8)
randomitems = list(/obj/item/stack/sheet/metal,
Expand All @@ -363,15 +363,15 @@
/obj/item/stack/sandbags_empty/half,
/obj/item/stack/sandbags_empty/half)

if(19 to 20)//Blood Crate 4% chance
if(23 to 25)//Blood Crate 2% chance
crate = new /obj/structure/closet/crate/medical(T)
spawnitems = list(/obj/item/reagent_container/blood/OMinus,
/obj/item/reagent_container/blood/OMinus,
/obj/item/reagent_container/blood/OMinus,
/obj/item/reagent_container/blood/OMinus,
/obj/item/reagent_container/blood/OMinus)

if(21 to 25)//Advanced meds Crate 10%
if(26 to 30)//Advanced meds Crate 5%
crate = new /obj/structure/closet/crate/medical(T)
spawnitems = list(/obj/item/storage/firstaid/fire,
/obj/item/storage/firstaid/regular,
Expand All @@ -386,15 +386,15 @@
/obj/item/clothing/glasses/hud/health,
/obj/item/device/defibrillator)

if(26 to 30)//Random Medical Items 10% as well. Made the list have less small junk
if(31 to 34)//Random Medical Items 4%. Made the list have less small junk
crate = new /obj/structure/closet/crate/medical(T)
spawnitems = list(/obj/item/storage/belt/medical/lifesaver/full,
/obj/item/storage/belt/medical/lifesaver/full,
/obj/item/storage/belt/medical/lifesaver/full,
/obj/item/storage/belt/medical/lifesaver/full,
/obj/item/storage/belt/medical/lifesaver/full)

if(31 to 35)//Random explosives Crate 10% because the lord commeth and said let there be explosives.
if(35 to 40)//Random explosives Crate 5% because the lord commeth and said let there be explosives.
crate = new /obj/structure/closet/crate/ammo(T)
choosemax = rand(1,5)
randomitems = list(/obj/item/storage/box/explosive_mines,
Expand All @@ -404,28 +404,83 @@
/obj/item/explosive/grenade/high_explosive,
/obj/item/storage/box/nade_box
)
if(36 to 40) // Junk
if(41 to 44)
crate = new /obj/structure/closet/crate/ammo(T)
spawnitems = list(
/obj/item/attachable/heavy_barrel,
/obj/item/attachable/heavy_barrel,
/obj/item/attachable/heavy_barrel,
/obj/item/attachable/heavy_barrel)

if(40 to 48)//Weapon + supply beacon drop. 6%
if(45 to 50)//Weapon + supply beacon drop. 5%
crate = new /obj/structure/closet/crate/ammo(T)
spawnitems = list(/obj/item/device/whiskey_supply_beacon,
/obj/item/device/whiskey_supply_beacon,
/obj/item/device/whiskey_supply_beacon,
/obj/item/device/whiskey_supply_beacon)

if(49 to 50)//Rare weapons. Around 4%
if(51 to 57)//Rare weapons. Around 6%
crate = new /obj/structure/closet/crate/ammo(T)
spawnitems = list(/obj/effect/landmark/wo_supplies/ammo/box/rare/m41aap,
/obj/effect/landmark/wo_supplies/ammo/box/rare/m41aapmag,
/obj/effect/landmark/wo_supplies/ammo/box/rare/m41aextend,
/obj/effect/landmark/wo_supplies/ammo/box/rare/smgap,
/obj/effect/landmark/wo_supplies/ammo/box/rare/smgextend)

if(58 to 65) // Sandbags kit
crate = new /obj/structure/closet/crate(T)
spawnitems = list(/obj/item/tool/shovel/etool,
/obj/item/stack/sandbags_empty/half,
/obj/item/stack/sandbags_empty/half,
/obj/item/stack/sandbags_empty/half)

if(66 to 70) // Mortar shells. Pew Pew!
crate = new /obj/structure/closet/crate/secure/mortar_ammo(T)
choosemax = rand(6,10)
randomitems = list(/obj/item/mortar_shell/he,
/obj/item/mortar_shell/incendiary,
/obj/item/mortar_shell/flare,
/obj/item/mortar_shell/frag)

if(71 to 79)
crate = new /obj/structure/closet/crate/ammo(T)
choosemax = rand(2, 3)
randomitems = list(/obj/item/ammo_box/rounds,
/obj/item/ammo_box/rounds/ap,
/obj/item/ammo_box/rounds/smg,
/obj/item/ammo_box/rounds/smg/ap,
/obj/item/ammo_box/magazine/ap,
/obj/item/ammo_box/magazine/ext,
/obj/item/ammo_box/magazine/m4ra/ap,
/obj/item/ammo_box/magazine/m4ra/ap,
/obj/item/ammo_box/magazine/m39/ap,
/obj/item/ammo_box/magazine/m39/ext,
)

if(80 to 82)
crate = new /obj/structure/closet/crate/ammo(T)
choosemax = rand(2, 3)
randomitems = list(/obj/item/ammo_magazine/rifle/lmg/holo_target,
/obj/item/ammo_magazine/rifle/lmg/holo_target,
/obj/item/ammo_magazine/rifle/lmg,
/obj/item/ammo_magazine/rifle/lmg,
)

if(83 to 86)
crate = new /obj/structure/closet/crate/ammo(T)
spawnitems = list(
/obj/item/attachable/magnetic_harness,
/obj/item/attachable/magnetic_harness,
/obj/item/attachable/magnetic_harness,
/obj/item/attachable/magnetic_harness)

if(86 to 90)
crate = new /obj/structure/closet/crate/secure/gear(T)
spawnitems = list(
/obj/item/device/binoculars/range,
/obj/item/device/binoculars/range,
)

if(crate)
crate.storage_capacity = 60

Expand Down
23 changes: 19 additions & 4 deletions code/game/machinery/vending/cm_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@
var/vend_delay = 0 //delaying vending of an item (for drinks machines animation, for example). Make sure to synchronize this with animation duration
var/vend_sound //use with caution. Potential spam

/// X Offset to vend to
var/vend_x_offset = 0
/// Y Offset to vend to
var/vend_y_offset = 0
/// Vending direction from adjacent users, if not using vend_x_offset or vend_y_offset
var/vend_dir
/// Direction to adjacent user from which we're allowed to do offset vending
var/list/vend_dir_whitelist

var/list/listed_products = list()

Expand Down Expand Up @@ -125,11 +131,20 @@ GLOBAL_LIST_EMPTY(vending_products)
GLOB.vending_products[typepath] = 1

//get which turf the vendor will dispense its products on.
/obj/structure/machinery/cm_vending/proc/get_appropriate_vend_turf()
var/turf/T = loc
/obj/structure/machinery/cm_vending/proc/get_appropriate_vend_turf(mob/living/carbon/human/user)
var/turf/turf = loc
if(vend_x_offset != 0 || vend_y_offset != 0) //this check should be more less expensive than using locate to locate your own tile every vending.
T = locate(x + vend_x_offset, y + vend_y_offset, z)
return T
turf = locate(x + vend_x_offset, y + vend_y_offset, z)
return turf
if(vend_dir)
if(vend_dir_whitelist)
var/user_dir = get_dir(loc, user)
if(!(user_dir in vend_dir_whitelist))
return turf
var/turf/relative_turf = get_step(user, vend_dir)
if(relative_turf.Adjacent(src))
return relative_turf
return turf

/obj/structure/machinery/cm_vending/get_examine_text(mob/living/carbon/human/user)
. = ..()
Expand Down
56 changes: 7 additions & 49 deletions code/game/machinery/vending/vendor_types/requisitions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,22 +175,8 @@
//Special cargo-specific vendor with vending offsets
/obj/structure/machinery/cm_vending/sorted/cargo_guns/cargo
vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_LOAD_AMMO_BOXES //We want to vend to turf not hand, since we are in requisitions

/obj/structure/machinery/cm_vending/sorted/cargo_guns/cargo/get_appropriate_vend_turf(mob/living/carbon/human/H)
var/turf/turf_to_vent_to
if(vend_x_offset != 0 || vend_y_offset != 0) //this will allow to avoid code below that suits only Almayer.
turf_to_vent_to = locate(x + vend_x_offset, y + vend_y_offset, z)
else
turf_to_vent_to = get_turf(get_step(src, NORTH))
if(H.loc == turf_to_vent_to)
turf_to_vent_to = get_turf(get_step(H.loc, WEST))
else
turf_to_vent_to = get_turf(get_step(src, SOUTH))
if(H.loc == turf_to_vent_to)
turf_to_vent_to = get_turf(get_step(H.loc, WEST))
else
turf_to_vent_to = H.loc
return turf_to_vent_to
vend_dir = WEST
vend_dir_whitelist = list(NORTH, SOUTH)

/obj/structure/machinery/cm_vending/sorted/cargo_guns/cargo/blend
icon_state = "req_guns_wall"
Expand All @@ -209,6 +195,8 @@
req_access = list(ACCESS_MARINE_CARGO)
vendor_theme = VENDOR_THEME_USCM
vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_LOAD_AMMO_BOXES
vend_dir = WEST
vend_dir_whitelist = list(SOUTHWEST, NORTHWEST)

/obj/structure/machinery/cm_vending/sorted/cargo_ammo/vend_fail()
return
Expand Down Expand Up @@ -307,22 +295,6 @@
/obj/structure/machinery/cm_vending/sorted/cargo_ammo/cargo
vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_LOAD_AMMO_BOXES //We want to vend to turf not hand, since we are in requisitions

/obj/structure/machinery/cm_vending/sorted/cargo_ammo/cargo/get_appropriate_vend_turf(mob/living/carbon/human/H)
var/turf/turf_to_vent_to
if(vend_x_offset != 0 || vend_y_offset != 0) //this will allow to avoid code below that suits only Almayer.
turf_to_vent_to = locate(x + vend_x_offset, y + vend_y_offset, z)
else
turf_to_vent_to = get_turf(get_step(src, NORTHWEST))
if(H.loc == turf_to_vent_to)
turf_to_vent_to = get_turf(get_step(H.loc, WEST))
else
turf_to_vent_to = get_turf(get_step(src, SOUTHWEST))
if(H.loc == turf_to_vent_to)
turf_to_vent_to = get_turf(get_step(H.loc, WEST))
else
turf_to_vent_to = H.loc
return turf_to_vent_to

//------------ATTACHMENTS VENDOR---------------

/obj/structure/machinery/cm_vending/sorted/attachments
Expand All @@ -331,6 +303,9 @@
req_access = list(ACCESS_MARINE_CARGO)
vendor_theme = VENDOR_THEME_USCM
icon_state = "req_attach"
vend_dir = WEST
vend_dir_whitelist = list(SOUTHEAST, NORTHEAST)
vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY //We want to vend to turf not hand, since we are in requisitions

/obj/structure/machinery/cm_vending/sorted/attachments/vend_fail()
return
Expand Down Expand Up @@ -379,30 +354,13 @@
list("M44 Magnum Sharpshooter Stock", round(scale * 4.5), /obj/item/attachable/stock/revolver, VENDOR_ITEM_REGULAR)
)

/obj/structure/machinery/cm_vending/sorted/attachments/get_appropriate_vend_turf(mob/living/carbon/human/H)
var/turf/turf_to_vent_to
if(vend_x_offset != 0 || vend_y_offset != 0) //this will allow to avoid code below that suits only Almayer.
turf_to_vent_to = locate(x + vend_x_offset, y + vend_y_offset, z)
else
turf_to_vent_to = get_turf(get_step(src, NORTHEAST))
if(H.loc == turf_to_vent_to)
turf_to_vent_to = get_turf(get_step(H.loc, WEST))
else
turf_to_vent_to = get_turf(get_step(src, SOUTHEAST))
if(H.loc == turf_to_vent_to)
turf_to_vent_to = get_turf(get_step(H.loc, WEST))
else
turf_to_vent_to = loc
return turf_to_vent_to

/obj/structure/machinery/cm_vending/sorted/attachments/blend
icon_state = "req_attach_wall"
tiles_with = list(
/obj/structure/window/framed/almayer,
/obj/structure/machinery/door/airlock,
/turf/closed/wall/almayer,
)
vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY //We want to vend to turf not hand, since we are in requisitions

//------------UNIFORM VENDOR---------------

Expand Down
Loading