Skip to content

Commit

Permalink
should commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wraith-54321 committed Nov 19, 2023
1 parent 122c09c commit 62b2776
Show file tree
Hide file tree
Showing 26 changed files with 714 additions and 3 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/~monkestation/baton_upgrades.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define BATON_ALL_UPGRADE (1<<0)
#define BATON_CUFF_UPGRADE (1<<1)
#define BATON_MUTE_UPGRADE (1<<2)
5 changes: 5 additions & 0 deletions code/modules/antagonists/traitor/datum_traitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@

var/special_role_text = lowertext(name)

//monkestation edit start
if(contractor_hub)
result += contractor_round_end()
//monkestation edit end

if(traitor_won)
result += span_greentext("The [special_role_text] was successful!")
else
Expand Down
2 changes: 2 additions & 0 deletions monkestation/code/datums/components/uplink.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//this file contains extra stuff we have for uplink components like contractors

77 changes: 74 additions & 3 deletions monkestation/code/game/objects/items/storage/uplink_kits.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#define KIT_ITEM_CATEGORY_SUPPORT "support"
#define KIT_ITEM_CATEGORY_WEAPONS "weapons"
#define KIT_ITEM_CATEGORY_MISC "misc"
/obj/item/storage/box/syndie_kit/imp_hard_spear
name = "hardlight spear implant box"

/obj/item/storage/box/syndie_kit/imp_hard_spear/PopulateContents()
new /obj/item/implanter/hard_spear(src)



/obj/item/storage/box/syndimaid
name = "Syndicate maid outfit"
desc = "A box containing a 'tactical' and 'practical' maid outfit."
Expand All @@ -17,4 +18,74 @@
/obj/item/clothing/under/syndicate/skirt/maid = 1,
/obj/item/clothing/gloves/combat/maid = 1,
/obj/item/clothing/accessory/maidapron/syndicate = 1,)
generate_items_inside(items_inside,src)\
generate_items_inside(items_inside,src)

/obj/item/storage/box/syndie_kit/contractor_loadout
name = "Standard Loadout"
desc = "Supplied to Syndicate contractors, providing their specialised space suit and chameleon uniform."
icon_state = "syndiebox"
illustration = "writing_syndie"

/obj/item/storage/box/syndie_kit/contractor_loadout/PopulateContents()
new /obj/item/mod/control/pre_equipped/contractor(src)
new /obj/item/storage/box/syndie_kit/chameleon(src)
new /obj/item/storage/fancy/cigarettes/cigpack_syndicate(src)
new /obj/item/card/id/advanced/chameleon(src)
new /obj/item/lighter(src)
new /obj/item/jammer(src)

/obj/item/storage/box/syndie_kit/contract_kit/PopulateContents()
new /obj/item/storage/box/syndicate/contractor_loadout(src)
new /obj/item/melee/baton/telescopic/contractor_baton(src)

// You get one item from each sub list
var/static/list/item_list = list(
KIT_ITEM_CATEGORY_SUPPORT = list(
/obj/item/pen/sleepy,
/obj/item/storage/medkit/tactical,
/obj/item/pen/sleepy,
/obj/item/gun/syringe/syndicate,
/obj/item/storage/backpack/duffelbag/syndie/x4,
/obj/item/clothing/shoes/chameleon/noslip,
/obj/item/clothing/glasses/thermal/syndi,
/obj/item/storage/box/syndie_kit/imp_freedom,
/obj/item/reagent_containers/hypospray/medipen/stimulants,
/obj/item/card/emag/doorjack,
),

KIT_ITEM_CATEGORY_WEAPONS = list(
/obj/item/melee/powerfist, //over value but its never used
/obj/item/storage/box/syndie_kit/origami_bundle,
/obj/item/clothing/gloves/krav_maga/combatglovesplus,
/obj/item/gun/ballistic/automatic/c20r/toy/unrestricted/riot,
/obj/item/storage/box/syndie_kit/throwing_weapons,
/obj/item/storage/box/syndie_kit/chemical, //technically over value but it cant be used on its own
/obj/item/autosurgeon/syndicate/anti_stun, //way over value but you dont get a real weapon, might have to remove this one
),

KIT_ITEM_CATEGORY_MISC = list(
/obj/item/syndie_glue,
/obj/item/slimepotion/slime/sentience/nuclear,
/obj/item/storage/box/syndie_kit/imp_uplink,
/obj/item/grenade/clusterbuster/soap,
/obj/item/flashlight/emp,
/obj/item/encryptionkey/syndicate,
/obj/item/multitool/ai_detect,
/obj/item/storage/toolbox/syndicate,
/obj/item/card/emag,
/obj/item/ai_module/syndicate,
)
)

var/list/items_to_give = list()
items_to_give += pick(item_list[KIT_ITEM_CATEGORY_SUPPORT])
items_to_give += pick(item_list[KIT_ITEM_CATEGORY_WEAPONS])
items_to_give += pick(item_list[KIT_ITEM_CATEGORY_MISC])
generate_items_inside(items_to_give, src)

// Paper guide
new /obj/item/paper/contractor_guide(src)

#undef KIT_ITEM_CATEGORY_SUPPORT
#undef KIT_ITEM_CATEGORY_WEAPONS
#undef KIT_ITEM_CATEGORY_MISC
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Proc detailing contract kit buys/completed contracts/additional info
/datum/antagonist/traitor/proc/contractor_round_end()
var/result = ""
var/total_spent_rep = 0

var/contractor_item_icons = "" // Icons of purchases
var/contractor_support_unit = "" // Set if they had a support unit - and shows appended to their contracts completed

/// Get all the icons/total cost for all our items bought
for (var/datum/contractor_item/contractor_purchase in contractor_hub.purchased_items)
contractor_item_icons += "<span class='tooltip_container'>\[ <i class=\"fas [contractor_purchase.item_icon]\"></i><span class='tooltip_hover'><b>[contractor_purchase.name] - [contractor_purchase.cost] Rep</b><br><br>[contractor_purchase.desc]</span> \]</span>"

total_spent_rep += contractor_purchase.cost

/// Special case for reinforcements, we want to show their ckey and name on round end.
if (istype(contractor_purchase, /datum/contractor_item/contractor_partner))
var/datum/contractor_item/contractor_partner/partner = contractor_purchase
contractor_support_unit += "<br><b>[partner.partner_mind.key]</b> played <b>[partner.partner_mind.current.name]</b>, their contractor support unit."

if (contractor_hub.purchased_items.len)
result += "<br>(used [total_spent_rep] Rep) "
result += contractor_item_icons
result += "<br>"

return result
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/datum/contractor_hub
var/contract_rep = 0
var/static/list/hub_items = list()
var/list/purchased_items = list()
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
/datum/contractor_item
var/name // Name of item
var/desc // description of item
var/item // item path, no item path means the purchase needs it's own handle_purchase()
var/item_icon = "broadcast-tower" // fontawesome icon to use inside the hub - https://fontawesome.com/icons/
var/stock = -1 // Any number above 0 for how many times it can be bought in a round for a single traitor. -1 is unlimited.
var/cost // Cost of the item in contract rep.

/datum/contractor_item/contractor_pinpointer
name = "Contractor Pinpointer"
desc = "A pinpointer that finds targets even without active suit sensors. Due to taking advantage of an exploit within the system, \
it can't pinpoint to the same accuracy as the traditional models. Becomes permanently locked to the user that first activates it."
item = /obj/item/pinpointer/crew/contractor
item_icon = "search-location"
stock = 2
cost = 1

/datum/contractor_item/fulton_extraction_kit
name = "Fulton Extraction Kit"
desc = "For getting your target across the station to those difficult dropoffs. Place the beacon somewhere secure, and link the pack. \
Activating the pack on your target will send them over to the beacon - make sure they're not just going to run away though!"
item = /obj/item/storage/box/contractor/fulton_extraction
item_icon = "parachute-box"
stock = 1
cost = 1

/datum/contractor_item/contractor_partner
name = "Reinforcements"
desc = "Upon purchase we'll contact available units in the area. Should there be an agent free, we'll send them down to assist you immediately. \
If no units are free, we give a full refund."
item_icon = "user-friends"
stock = 1
cost = 2
var/datum/mind/partner_mind = null

/datum/contractor_item/contractor_partner/handle_purchase(datum/contractor_hub/hub, mob/living/user)
. = ..()
if(!.)
return

to_chat(user, span_notice("The uplink vibrates quietly, connecting to nearby agents..."))

var/list/mob/dead/observer/candidates = poll_ghost_candidates("Do you want to play as the Contractor Support Unit for [user.real_name]?", ROLE_TRAITOR, FALSE, 100, \
POLL_IGNORE_CONTRACTOR_SUPPORT)

if(LAZYLEN(candidates))
var/mob/dead/observer/candidate = pick(candidates)
spawn_contractor_partner(user, candidate.key)
else
to_chat(user, span_notice("No available agents at this time, please try again later."))

// refund and add the limit back.
stock += 1
hub.contract_rep += cost
hub.purchased_items -= src

/datum/contractor_item/contractor_partner/proc/spawn_contractor_partner(mob/living/user, key)
var/mob/living/carbon/human/partner = new()
var/datum/outfit/contractor_partner/partner_outfit = new()

partner_outfit.equip(partner)

var/obj/structure/closet/supplypod/arrival_pod = new(null, STYLE_SYNDICATE)
arrival_pod.explosionSize = list(0,0,0,0)
arrival_pod.bluespace = TRUE

var/turf/free_location = find_obstruction_free_location(2, user)

// We really want to send them - if we can't find a nice location just land it on top of them.
if(!free_location)
free_location = get_turf(user)

partner.forceMove(arrival_pod)
partner.ckey = key

/// We give a reference to the mind that'll be the support unit
partner_mind = partner.mind
partner_mind.make_contractor_support()

to_chat(partner_mind.current, "\n[span_alertwarning("[user.real_name] is your superior. Follow any, and all orders given by them. You're here to support their mission only.")]")
to_chat(partner_mind.current, "[span_alertwarning("Should they perish, or be otherwise unavailable, \
you're to assist other active agents in this mission area to the best of your ability.")]\n\n")

new /obj/effect/pod_landingzone(free_location, arrival_pod)

//this can be bought for TC, might have to be removed/replaced
/datum/contractor_item/blackout
name = "Blackout"
desc = "Request Syndicate Command to distrupt the station's powernet. Disables power across the station for a short duration."
item_icon = "bolt"
stock = 2
cost = 3

/datum/contractor_item/blackout/handle_purchase(datum/contractor_hub/hub)
. = ..()

if (.)
power_fail(35, 50)
priority_announce("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", \
"Critical Power Failure", ANNOUNCER_POWEROFF)

// Subtract cost, and spawn if it's an item.
/datum/contractor_item/proc/handle_purchase(datum/contractor_hub/hub, mob/living/user)

if (hub.contract_rep >= cost)
hub.contract_rep -= cost
else
return FALSE

if (stock >= 1)
stock -= 1
else if (stock == 0)
return FALSE

hub.purchased_items.Add(src)

user.playsound_local(user, 'sound/machines/uplinkpurchase.ogg', 100)

if (item && ispath(item))
var/atom/item_to_create = new item(get_turf(user))

if(user.put_in_hands(item_to_create))
to_chat(user, span_notice("Your purchase materializes into your hands!"))
else
to_chat(user, span_notice("Your purchase materializes onto the floor."))

return item_to_create
return TRUE

/obj/item/pinpointer/crew/contractor
name = "contractor pinpointer"
desc = "A handheld tracking device that locks onto certain signals. Ignores suit sensors, but is much less accurate."
icon_state = "pinpointer_syndicate"
worn_icon_state = "pinpointer_black"
minimum_range = 25
has_owner = TRUE
ignore_suit_sensor_level = TRUE

/obj/item/storage/box/contractor/fulton_extraction
name = "Fulton Extraction Kit"
icon_state = "syndiebox"
illustration = "writing_syndie"

/obj/item/storage/box/contractor/fulton_extraction/PopulateContents()
new /obj/item/extraction_pack(src)
new /obj/item/fulton_core(src)

/datum/contractor_item/baton_holster
name = "Baton Holster Module"
desc = "Never worry about dropping your baton again with this holster module! Simply insert your baton into the module, put it in your MODsuit, \
and the baton will retract whenever dropped."
item = /obj/item/mod/module/baton_holster
item_icon = "arrow-up-from-arc" //I cannot find anything better, replace if you find something more fitting
stock = 1
cost = 1

/datum/contractor_item/baton_upgrade_cuff
name = "Baton Cuff Upgrade"
desc = "Using technology reverse-engineered from some alien batons we had lying around, you can now cuff people using your baton with the secondary attack. \
Due to technical limitations, only cable cuffs and zipties work, and they need to be loaded into the baton manually."
item = /obj/item/baton_upgrade/cuff
item_icon = "handcuff"
stock = 1
cost = 1

/datum/contractor_item/baton_upgrade_mute
name = "Baton Mute Upgrade"
desc = "A relatively new advancement in completely proprietary baton technology, this baton upgrade will mute anyone hit for ten seconds, maximizing at twenty seconds."
item = /obj/item/baton_upgrade/mute
item_icon = "comment-slash"
stock = 1
cost = 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/datum/antagonist/traitor/contractor_support
name = "Contractor Support Unit"
antag_moodlet = /datum/mood_event/focused

show_in_roundend = FALSE // We're already adding them in to the contractor's roundend.
give_objectives = TRUE // We give them their own custom objective.
show_in_antagpanel = FALSE // Not a proper/full antag.
give_uplink = FALSE // Don't give them an uplink.
give_secondary_objectives = FALSE
/// Team datum that contains the contractor and the support unit
var/datum/team/contractor_team/contractor_team

/// Team for storing both the contractor and their support unit - only really for the HUD and admin logging.
/datum/team/contractor_team
show_roundend_report = FALSE

/datum/antagonist/traitor/contractor_support/forge_traitor_objectives()
var/datum/objective/generic_objective = new

generic_objective.name = "Follow the Contractor's Orders"
generic_objective.explanation_text = "Follow your orders. Assist agents in this mission area."

generic_objective.completed = TRUE

objectives += generic_objective

/datum/outfit/contractor_partner
name = "Contractor Support Unit"

uniform = /obj/item/clothing/under/chameleon
suit = /obj/item/clothing/suit/chameleon
back = /obj/item/storage/backpack
belt = /obj/item/modular_computer/pda/chameleon
mask = /obj/item/clothing/mask/cigarette/syndicate
shoes = /obj/item/clothing/shoes/chameleon/noslip
ears = /obj/item/radio/headset/chameleon
id = /obj/item/card/id/advanced/chameleon
r_hand = /obj/item/storage/toolbox/syndicate
id_trim = /datum/id_trim/chameleon/operative

backpack_contents = list(
/obj/item/storage/box/survival,
/obj/item/implanter/uplink,
/obj/item/clothing/mask/chameleon,
/obj/item/storage/fancy/cigarettes/cigpack_syndicate,
/obj/item/lighter
)

/datum/outfit/contractor_partner/post_equip(mob/living/carbon/human/partner, visualsOnly)
. = ..()
var/obj/item/clothing/mask/cigarette/syndicate/cig = partner.get_item_by_slot(ITEM_SLOT_MASK)

// pre-light their cig
cig.light()
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/datum/mind/proc/make_contractor_support()
if(has_antag_datum(/datum/antagonist/traitor/contractor_support))
return
add_antag_datum(/datum/antagonist/traitor/contractor_support)
Loading

0 comments on commit 62b2776

Please sign in to comment.