Skip to content

Commit

Permalink
very nice
Browse files Browse the repository at this point in the history
  • Loading branch information
wraith-54321 committed Nov 23, 2023
1 parent 09a53fc commit 93ee5f6
Show file tree
Hide file tree
Showing 29 changed files with 580 additions and 82 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/~monkestation/uplink.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// the uplink flag for contractors
#define UPLINK_CONTRACTORS (1 << 6)
26 changes: 25 additions & 1 deletion code/datums/components/uplink.dm
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,22 @@
data["current_stock"] = remaining_stock
data["shop_locked"] = uplink_handler.shop_locked
data["purchased_items"] = length(uplink_handler.purchase_log?.purchase_log)
data["locked_entries"] = uplink_handler.locked_entries //monkestation edit
//monkestation edit start
data["locked_entries"] = uplink_handler.locked_entries
data["is_contractor"] = (uplink_handler.uplink_flag == UPLINK_CONTRACTORS)
var/list/contractor_items = list()
for(var/datum/contractor_item/item in uplink_handler.contractor_market_items)
contractor_items += list(list(
"id" = item.type,
"name" = item.name,
"desc" = item.desc,
"cost" = item.cost,
"stock" = item.stock,
"item_icon" = item.item_icon,
))
data["contractor_items"] = contractor_items
data["contractor_rep"] = uplink_handler.contractor_rep
//monkestation edit end
return data

/datum/component/uplink/ui_static_data(mob/user)
Expand Down Expand Up @@ -302,6 +317,15 @@
if(uplink_handler.owner?.current != ui.user || !uplink_handler.can_take_objectives)
return TRUE

//monkestation edit start
switch(action)
if("buy_contractor")
var/item = params["item"]
for(var/datum/contractor_item/hub_item in uplink_handler.contractor_market_items)
if(hub_item.name == item)
hub_item.handle_purchase(uplink_handler, ui.user)
//monkestation edit end

switch(action)
if("regenerate_objectives")
uplink_handler.generate_objectives()
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/items/melee/baton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,11 @@
)
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform))

//monkestation edit start
/obj/item/melee/baton/telescopic/additional_effects_non_cyborg(mob/living/target, mob/living/user)
. = ..()
target.Disorient(6 SECONDS, 5, paralyze = 3 SECONDS, stack_status = FALSE)
//monkestation edit end

/obj/item/melee/baton/telescopic/suicide_act(mob/living/user)
var/mob/living/carbon/human/human_user = user
Expand Down Expand Up @@ -375,7 +377,7 @@
force = 5
cooldown = 2.5 SECONDS
force_say_chance = 80 //very high force say chance because it's funny
stamina_damage = 170
stamina_damage = 170 //monkestation edit: stam damage increased
clumsy_knockdown_time = 24 SECONDS
affect_cyborg = TRUE
on_stun_sound = 'sound/effects/contractorbatonhit.ogg'
Expand All @@ -390,6 +392,7 @@
/obj/item/melee/baton/telescopic/contractor_baton/additional_effects_non_cyborg(mob/living/target, mob/living/user)
target.set_jitter_if_lower(40 SECONDS)
target.set_stutter_if_lower(40 SECONDS)
target.Disorient(6 SECONDS, 5, paralyze = 3 SECONDS, stack_status = TRUE) //monkestation edit

/obj/item/melee/baton/security
name = "stun baton"
Expand Down
13 changes: 9 additions & 4 deletions code/modules/antagonists/traitor/datum_traitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
if(give_secondary_objectives)
uplink_handler.has_objectives = TRUE
uplink_handler.generate_objectives()
//monkestation edit start
else
uplink_handler.has_objectives = FALSE
//monkestation edit end

if(uplink_handler.progression_points < SStraitor.current_global_progression)
uplink_handler.progression_points = SStraitor.current_global_progression * SStraitor.newjoin_progression_coeff
Expand Down Expand Up @@ -344,14 +348,15 @@
var/completed_objectives_text = "Completed Uplink Objectives: "
for(var/datum/traitor_objective/objective as anything in uplink_handler.completed_objectives)
if(objective.objective_state == OBJECTIVE_STATE_COMPLETED)
completed_objectives_text += "<br><B>[objective.name]</B> - ([objective.telecrystal_reward] TC, [DISPLAY_PROGRESSION(objective.progression_reward)] Reputation)"
completed_objectives_text += "<br><B>[objective.name]</B> - ([objective.telecrystal_reward] TC, [DISPLAY_PROGRESSION(objective.progression_reward)] Threat Level)"
//monkestation edit on previous line: replaced "Reputation" with "Threat Level"
result += completed_objectives_text
result += "<br>The traitor had a total of [DISPLAY_PROGRESSION(uplink_handler.progression_points)] Reputation and [uplink_handler.telecrystals] Unused Telecrystals."

result += "<br>The traitor had a total of [DISPLAY_PROGRESSION(uplink_handler.progression_points)] Threat Level and [uplink_handler.telecrystals] Unused Telecrystals."
//monkestation edit on previous line: replaced "Reputation" with "Threat Level"
var/special_role_text = lowertext(name)

//monkestation edit start
if(contractor_hub)
if(uplink_handler?.purchased_contractor_items)
result += contractor_round_end()
//monkestation edit end

Expand Down
16 changes: 10 additions & 6 deletions code/modules/antagonists/traitor/objective_category.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,31 @@
// Category should just get autoGC'd here if they don't have any length, this may not be necessary
qdel(category)

/datum/traitor_category_handler/proc/objective_valid(datum/traitor_objective/objective_path, progression_points)
/datum/traitor_category_handler/proc/objective_valid(datum/traitor_objective/objective_path, progression_points, uplink_flag) //monkestation edit: adds uplink_flag
if(initial(objective_path.abstract_type) == objective_path)
return FALSE
if(progression_points < initial(objective_path.progression_minimum))
return FALSE
if(progression_points > initial(objective_path.progression_maximum))
return FALSE
//monkestation edit start
if(!(initial(objective_path.valid_uplinks) & uplink_flag))
return FALSE
//monkestation edit end
return TRUE

/datum/traitor_category_handler/proc/get_possible_objectives(progression_points)
/datum/traitor_category_handler/proc/get_possible_objectives(progression_points, uplink_flag) //monkestation edit: adds uplink_flag
var/list/valid_objectives = list()
for(var/datum/traitor_objective_category/category as anything in all_categories)
var/list/category_list = list()
for(var/value in category.objectives)
if(islist(value))
var/list/objective_category = filter_invalid_objective_list(value, progression_points)
var/list/objective_category = filter_invalid_objective_list(value, progression_points, uplink_flag) //monkestation edit:: adds uplink_flag
if(!length(objective_category))
continue
category_list[objective_category] = category.objectives[value]
else
if(!objective_valid(value, progression_points))
if(!objective_valid(value, progression_points, uplink_flag)) //monkestation edit: adds uplink_flag
continue
category_list[value] = category.objectives[value]
if(!length(category_list))
Expand All @@ -41,7 +45,7 @@

return valid_objectives

/datum/traitor_category_handler/proc/filter_invalid_objective_list(list/objectives, progression_points)
/datum/traitor_category_handler/proc/filter_invalid_objective_list(list/objectives, progression_points, uplink_flag) //monkestation edit: adds uplink_flag
var/list/filtered_objectives = list()
for(var/value in objectives)
if(islist(value))
Expand All @@ -50,7 +54,7 @@
continue
filtered_objectives[result] = objectives[value]
else
if(!objective_valid(value, progression_points))
if(!objective_valid(value, progression_points, uplink_flag)) //monkestation edit: adds uplink_flag
continue
filtered_objectives[value] = objectives[value]
return filtered_objectives
Expand Down
3 changes: 3 additions & 0 deletions code/modules/antagonists/traitor/objectives/kidnapping.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//MONKESTATIONFILE REMOVAL, CHECK THE FILE IN THE MODULAR DIRECTORY
/*
/datum/traitor_objective/target_player/kidnapping
name = "Kidnap %TARGET% the %JOB TITLE% and deliver them to %AREA%"
description = "%TARGET% holds extremely important information regarding secret NT projects - and you'll need to kidnap and deliver them to %AREA%, where our transport pod will be waiting. \
Expand Down Expand Up @@ -321,3 +323,4 @@
for (var/obj/item/implant/storage/internal_bag in kidnapee.implants)
belongings += internal_bag.contents
return belongings
*/
5 changes: 5 additions & 0 deletions code/modules/antagonists/traitor/traitor_objective.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@
/datum/traitor_objective/proc/completion_payout()
handler.progression_points += progression_reward
handler.telecrystals += telecrystal_reward
//monkestation edit start
if(given_contractor_rep)
handler.contractor_rep += given_contractor_rep
//monkestation edit end

/// Used for sending data to the uplink UI
/datum/traitor_objective/proc/uplink_ui_data(mob/user)
Expand All @@ -241,6 +245,7 @@
"objective_state" = objective_state,
"original_progression" = original_progression,
"telecrystal_penalty" = telecrystal_penalty,
"contractor_rep" = given_contractor_rep, //monkestation edit
)

/datum/traitor_objective/proc/on_objective_taken(mob/user)
Expand Down
16 changes: 13 additions & 3 deletions code/modules/antagonists/traitor/uplink_handler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,24 @@
on_update()
return TRUE

/// Generates objectives for this uplink handler
/datum/uplink_handler/proc/generate_objectives()
/** Generates objectives for this uplink handler
* forced_types - an assoc list of objective types that when passed will always be generated first if possible to generate, value is how many of that type to generate
*/
/datum/uplink_handler/proc/generate_objectives(list/forced_types = list()) //monkestation edit: adds forced_types
var/potential_objectives_left = maximum_potential_objectives - (length(potential_objectives) + length(active_objectives))
var/list/objectives = SStraitor.category_handler.get_possible_objectives(progression_points)
var/list/objectives = SStraitor.category_handler.get_possible_objectives(progression_points, uplink_flag) //monkestation edit: adds uplink_flag
if(!length(objectives))
return
while(length(objectives) && potential_objectives_left > 0)
var/objective_typepath = pick_weight(objectives)
//monkestation edit start
if(length(forced_types))
var/picked_type = pick(forced_types)
forced_types[picked_type] -= 1
if(!forced_types[picked_type])
forced_types -= picked_type
objective_typepath = picked_type
//monkestation edit end
var/list/target_list = objectives
while(islist(objective_typepath))
if(!length(objective_typepath))
Expand Down
1 change: 1 addition & 0 deletions code/modules/uplink/uplink_items/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
..()
if(HAS_TRAIT(SSstation, STATION_TRAIT_CYBERNETIC_REVOLUTION))
purchasable_from |= UPLINK_TRAITORS
purchasable_from |= UPLINK_CONTRACTORS //monkestation edit
17 changes: 16 additions & 1 deletion monkestation/code/datums/components/uplink.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
//this file contains extra stuff we have for uplink components like contractors
#define STARTING_COMMON_CONTRACTS 3
#define STARTING_UNCOMMON_CONTRACTS 2
#define STARTING_RARE_CONTRACTS 1
/datum/component/uplink/proc/become_contractor()
uplink_handler.uplink_flag = UPLINK_CONTRACTORS
uplink_handler.clear_secondaries()
uplink_handler.generate_objectives(list(
/datum/traitor_objective/target_player/kidnapping/common = STARTING_COMMON_CONTRACTS,
/datum/traitor_objective/target_player/kidnapping/uncommon = STARTING_UNCOMMON_CONTRACTS,
/datum/traitor_objective/target_player/kidnapping/rare = STARTING_RARE_CONTRACTS,
))
for(var/item as anything in subtypesof(/datum/contractor_item))
uplink_handler.contractor_market_items += new item

#undef STARTING_COMMON_CONTRACTS
#undef STARTING_UNCOMMON_CONTRACTS
#undef STARTING_RARE_CONTRACTS
10 changes: 5 additions & 5 deletions monkestation/code/game/objects/items/storage/uplink_kits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/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"
Expand All @@ -41,7 +41,7 @@
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/storage/box/syndie_kit/contractor_loadout(src)
new /obj/item/melee/baton/telescopic/contractor_baton(src)

// You get one item from each sub list
Expand Down Expand Up @@ -84,9 +84,9 @@
)

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])
items_to_give[pick(item_list[KIT_ITEM_CATEGORY_SUPPORT])] = 1
items_to_give[pick(item_list[KIT_ITEM_CATEGORY_WEAPONS])] = 1
items_to_give[pick(item_list[KIT_ITEM_CATEGORY_MISC])] = 1
generate_items_inside(items_to_give, src)

// Paper guide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
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)
for(var/datum/contractor_item/contractor_purchase in uplink_handler.purchased_contractor_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>"

//TEST SPANS
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))
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)
if(length(uplink_handler.purchased_contractor_items))
result += "<br>(used [total_spent_rep] Rep) "
result += contractor_item_icons
result += "<br>"
Expand Down

This file was deleted.

Loading

0 comments on commit 93ee5f6

Please sign in to comment.