Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 6952387

Browse files
Moltijoeynot01
andauthored
Gives blood brothers a box filled with random shitty traitor items (#22197)
* Update brother.dm * Update brother.dm * Update brother.dm * Update code/modules/antagonists/brother/brother.dm Co-authored-by: ynot01 <[email protected]> * Update code/modules/antagonists/brother/brother.dm Co-authored-by: ynot01 <[email protected]> * Update brother.dm * i hate ynot <3 * Update brother.dm * Update brother.dm * Update brother.dm * Update brother.dm --------- Co-authored-by: ynot01 <[email protected]>
1 parent 1348e53 commit 6952387

File tree

3 files changed

+90
-24
lines changed

3 files changed

+90
-24
lines changed

code/datums/components/uplink.dm

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@ GLOBAL_LIST_EMPTY(uplinks)
44
#define NT_ERT_TROOPER 1
55
#define NT_ERT_MEDIC 2
66
#define NT_ERT_ENGINEER 3
7+
8+
#define UPLINK_CATEGORY_DISCOUNTS "Discounts"
9+
#define UPLINK_CATEGORY_BUNDLES "Bundles"
10+
#define UPLINK_CATEGORY_CONSPICUOUS "Conspicuous Weapons"
11+
#define UPLINK_CATEGORY_STEALTH_WEAPONS "Stealthy Weapons"
12+
#define UPLINK_CATEGORY_AMMO "Ammunition"
13+
#define UPLINK_CATEGORY_EXPLOSIVES "Explosives"
14+
#define UPLINK_CATEGORY_SUPPORT "Support and Exosuits"
15+
#define UPLINK_CATEGORY_STEALTH_GADGETS "Stealth Gadgets"
16+
#define UPLINK_CATEGORY_SPACE_SUITS "Space Suits"
17+
#define UPLINK_CATEGORY_IMPLANTS "Implants"
18+
#define UPLINK_CATEGORY_INFILTRATION "Infiltration Gear"
19+
#define UPLINK_CATEGORY_SPECIES "Species-Restricted"
20+
#define UPLINK_CATEGORY_ROLE "Role-Restricted"
21+
#define UPLINK_CATEGORY_MISC "Misc. Gadgets"
22+
#define UPLINK_CATEGORY_BADASS "(Pointless) Badassery"
23+
#define UPLINK_CATEGORY_ENERGY "Energy Weapons"
24+
#define UPLINK_CATEGORY_BALLISTIC "Ballistic Weapons"
25+
#define UPLINK_CATEGORY_EXOSUITS "Exosuits"
26+
#define UPLINK_CATEGORY_CQC "Close Quarters Combat"
27+
#define UPLINK_CATEGORY_NT_SUPPORT "Support"
28+
#define UPLINK_CATEGORY_HARDSUITS "Armor & Hardsuits"
29+
#define UPLINK_CATEGORY_OTHER "Other Gear"
730
/**
831
* Uplinks
932
*

code/modules/antagonists/brother/brother.dm

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,20 @@
2828
return ..()
2929

3030
/datum/antagonist/brother/proc/equip_brother()
31+
var/mob/living/carbon/brother = owner.current
3132
var/obj/item/book/granter/crafting_recipe/weapons/W = new
32-
W.on_reading_finished(owner.current)
33+
W.on_reading_finished(brother)
3334
qdel(W)
3435

36+
if(istype(brother))
37+
var/obj/item/storage/box/bloodbrother/T = new()
38+
if(brother.equip_to_slot_or_del(T, ITEM_SLOT_BACKPACK))
39+
SEND_SIGNAL(brother.back, COMSIG_TRY_STORAGE_SHOW, brother)
40+
return
41+
42+
//this only prints if it fails to give the box
43+
to_chat(brother, span_userdanger("Unfortunately, you weren't able to get a keepsake box. This is bad and you should adminhelp (press F1)."))
44+
3545
/datum/antagonist/brother/on_removal()
3646
SSticker.mode.brothers -= owner
3747
if(owner.current)
@@ -230,3 +240,36 @@
230240

231241
/datum/team/brother_team/antag_listing_name()
232242
return "[name] blood brothers"
243+
244+
245+
//box given to every bloodbrother
246+
/obj/item/storage/box/bloodbrother
247+
name = "keepsake box"
248+
desc = "A box full of unusual items found in the maintenance hallways."
249+
///total tc cost that can be inside the box
250+
var/total_box_value = 5
251+
///maximum amount of tc any individual item can be
252+
var/item_value_cap = 2
253+
///list of categories that items are allowed to come from
254+
var/list/allowed_categories = list(UPLINK_CATEGORY_STEALTH_GADGETS, UPLINK_CATEGORY_MISC, UPLINK_CATEGORY_BADASS)
255+
256+
/obj/item/storage/box/bloodbrother/PopulateContents()
257+
var/list/uplink_items = get_uplink_items(null, FALSE)
258+
var/remaining_value = total_box_value
259+
260+
for(var/i = 50; i > 0; i--) //only iterate 50 times, so it doesn't get stuck in an infinite loop
261+
if(remaining_value <= 0)
262+
break
263+
264+
var/category = pick(allowed_categories)
265+
var/item = pick(uplink_items[category])
266+
var/datum/uplink_item/I = uplink_items[category][item]
267+
268+
if(I.cost > item_value_cap || I.cost > remaining_value)
269+
uplink_items[category] -= uplink_items[category][item] //remove it so it can't keep getting picked despite being invalid
270+
continue
271+
remaining_value -= I.cost
272+
new I.item(src)
273+
274+
if(remaining_value > 0)
275+
message_admins("a blood brother has spawned with a keepsake box that has less than the usual value of items, please alert a coder")

code/modules/uplink/uplink_items.dm

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
139139

140140
//Discounts (dynamically filled above)
141141
/datum/uplink_item/discounts
142-
category = "Discounts"
142+
category = UPLINK_CATEGORY_DISCOUNTS
143143

144144
//All bundles and telecrystals
145145
/datum/uplink_item/bundles_TC
146-
category = "Bundles"
146+
category = UPLINK_CATEGORY_BUNDLES
147147
surplus = 0
148148
cant_discount = TRUE
149149

@@ -325,7 +325,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
325325

326326
// Dangerous Items
327327
/datum/uplink_item/dangerous
328-
category = "Conspicuous Weapons"
328+
category = UPLINK_CATEGORY_CONSPICUOUS
329329

330330
/datum/uplink_item/dangerous/busterarm
331331
name = "Buster Arm"
@@ -649,7 +649,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
649649

650650
// Stealthy Weapons
651651
/datum/uplink_item/stealthy_weapons
652-
category = "Stealthy Weapons"
652+
category = UPLINK_CATEGORY_STEALTH_WEAPONS
653653

654654
/datum/uplink_item/stealthy_weapons/combatglovesplus
655655
name = "Combat Gloves Plus"
@@ -781,7 +781,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
781781

782782
// Ammunition
783783
/datum/uplink_item/ammo
784-
category = "Ammunition"
784+
category = UPLINK_CATEGORY_AMMO
785785
surplus = 40
786786

787787
/datum/uplink_item/ammo/pistol
@@ -1147,7 +1147,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
11471147

11481148
//Grenades and Explosives
11491149
/datum/uplink_item/explosives
1150-
category = "Explosives"
1150+
category = UPLINK_CATEGORY_EXPLOSIVES
11511151

11521152
/datum/uplink_item/explosives/bioterrorfoam
11531153
name = "Bioterror Foam Grenade"
@@ -1383,7 +1383,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
13831383

13841384
//Support and Mechs
13851385
/datum/uplink_item/support
1386-
category = "Support and Exosuits"
1386+
category = UPLINK_CATEGORY_SUPPORT
13871387
surplus = 0
13881388
include_modes = list(/datum/game_mode/nuclear)
13891389

@@ -1468,7 +1468,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
14681468

14691469
// Stealth Items
14701470
/datum/uplink_item/stealthy_tools
1471-
category = "Stealth Gadgets"
1471+
category = UPLINK_CATEGORY_STEALTH_GADGETS
14721472

14731473
/datum/uplink_item/stealthy_tools/spy_bug
14741474
name = "Box of Spy Bugs"
@@ -1646,7 +1646,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
16461646

16471647
//Space Suits and Hardsuits
16481648
/datum/uplink_item/suits
1649-
category = "Space Suits"
1649+
category = UPLINK_CATEGORY_SPACE_SUITS
16501650
surplus = 40
16511651

16521652
/datum/uplink_item/suits/space_suit
@@ -1689,7 +1689,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
16891689

16901690
// Devices and Tools
16911691
/datum/uplink_item/device_tools
1692-
category = "Misc. Gadgets"
1692+
category = UPLINK_CATEGORY_MISC
16931693

16941694
/datum/uplink_item/device_tools/cutouts
16951695
name = "Adaptive Cardboard Cutouts"
@@ -2113,7 +2113,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
21132113

21142114
// Implants
21152115
/datum/uplink_item/implants
2116-
category = "Implants"
2116+
category = UPLINK_CATEGORY_IMPLANTS
21172117
surplus = 50
21182118

21192119

@@ -2329,7 +2329,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
23292329

23302330
//Infiltrator shit
23312331
/datum/uplink_item/infiltration
2332-
category = "Infiltration Gear"
2332+
category = UPLINK_CATEGORY_INFILTRATION
23332333
include_modes = list(/datum/game_mode/infiltration)
23342334
surplus = 0
23352335

@@ -2348,7 +2348,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
23482348

23492349
//Race-specific items
23502350
/datum/uplink_item/race_restricted
2351-
category = "Species-Restricted"
2351+
category = UPLINK_CATEGORY_SPECIES
23522352
surplus = 0
23532353

23542354
/datum/uplink_item/race_restricted/syndilamp
@@ -2415,7 +2415,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
24152415

24162416
// Role-specific items
24172417
/datum/uplink_item/role_restricted
2418-
category = "Role-Restricted"
2418+
category = UPLINK_CATEGORY_ROLE
24192419
exclude_modes = list(/datum/game_mode/nuclear, /datum/game_mode/nuclear/clown_ops)
24202420
surplus = 0
24212421

@@ -2759,7 +2759,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
27592759

27602760
// Pointless
27612761
/datum/uplink_item/badass
2762-
category = "(Pointless) Badassery"
2762+
category = UPLINK_CATEGORY_BADASS
27632763
surplus = 0
27642764

27652765
/datum/uplink_item/badass/costumes/obvious_chameleon
@@ -2892,7 +2892,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
28922892
var/required_ert_uplink = null //Do we need a specific uplink? Defaults to universal.
28932893

28942894
/datum/uplink_item/nt/energy_weps
2895-
category = "Energy Weapons"
2895+
category = UPLINK_CATEGORY_ENERGY
28962896

28972897
/datum/uplink_item/nt/energy_weps/egun
28982898
name = "Energy Gun"
@@ -2959,7 +2959,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
29592959
cost = 100
29602960

29612961
/datum/uplink_item/nt/ball_weps
2962-
category = "Ballistic Weapons"
2962+
category = UPLINK_CATEGORY_BALLISTIC
29632963
required_ert_uplink = NT_ERT_TROOPER
29642964

29652965
/datum/uplink_item/nt/ball_weps/boarder
@@ -3004,7 +3004,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
30043004
limited_stock = 2 // SAY HELLO TO MY LITTLE FRIEND
30053005

30063006
/datum/uplink_item/nt/ammo
3007-
category = "Ammunition"
3007+
category = UPLINK_CATEGORY_AMMO
30083008
required_ert_uplink = NT_ERT_TROOPER
30093009

30103010
/datum/uplink_item/nt/ammo/recharger
@@ -3118,7 +3118,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
31183118
cost = 1
31193119

31203120
/datum/uplink_item/nt/mech
3121-
category = "Exosuits"
3121+
category = UPLINK_CATEGORY_EXOSUITS
31223122
required_ert_uplink = NT_ERT_ENGINEER
31233123

31243124
/datum/uplink_item/nt/mech/marauder
@@ -3206,7 +3206,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
32063206
cost = 1
32073207

32083208
/datum/uplink_item/nt/cqc
3209-
category = "Close Quarters Combat"
3209+
category = UPLINK_CATEGORY_CQC
32103210

32113211
/datum/uplink_item/nt/cqc/esword
32123212
name = "Energy Sword"
@@ -3270,7 +3270,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
32703270
cost = 1
32713271

32723272
/datum/uplink_item/nt/support
3273-
category = "Support"
3273+
category = UPLINK_CATEGORY_NT_SUPPORT
32743274

32753275
/datum/uplink_item/nt/support/c4
32763276
name = "Composition C-4"
@@ -3376,7 +3376,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
33763376
required_ert_uplink = NT_ERT_ENGINEER
33773377

33783378
/datum/uplink_item/nt/hardsuit
3379-
category = "Armor & Hardsuits"
3379+
category = UPLINK_CATEGORY_HARDSUITS
33803380

33813381
/datum/uplink_item/nt/hardsuit/armor
33823382
name = "Armor Vest"
@@ -3459,7 +3459,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
34593459
cant_discount = TRUE
34603460

34613461
/datum/uplink_item/nt/gear
3462-
category = "Other Gear"
3462+
category = UPLINK_CATEGORY_OTHER
34633463

34643464
/datum/uplink_item/nt/gear/secbelt
34653465
name = "Stocked Security Belt"

0 commit comments

Comments
 (0)