Skip to content

Commit

Permalink
Lets you wear emag on your ID slot and tweaks quick equip (#27573)
Browse files Browse the repository at this point in the history
* Allow wearing emag and cmag on id slot

* remove cmag

* tweak quick equip
  • Loading branch information
datlo authored Jan 2, 2025
1 parent 7bbebbb commit 2bc0388
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
var/w_class = WEIGHT_CLASS_NORMAL
/// This is used to determine on which slots an item can fit.
var/slot_flags = 0
/// If set, this determines which slots are considered when using quick equip
var/prefered_slot_flags = 0
/// Determines what it can pass over/through. IE. 'PASSTABLE' will allow it to pass over tables
pass_flags = PASSTABLE
pressure_resistance = 4
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/items/weapons/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
desc = "A card."
icon = 'icons/obj/card.dmi'
w_class = WEIGHT_CLASS_TINY
slot_flags = ITEM_SLOT_ID

new_attack_chain = TRUE
var/associated_account_number = 0

Expand All @@ -29,6 +31,7 @@
icon_state = "emag"
item_state = "card-id"
origin_tech = "magnets=2;syndicate=2"
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS

/obj/item/card/emag
desc = "It's a card with a magnetic strip attached to some circuitry."
Expand All @@ -38,6 +41,7 @@
origin_tech = "magnets=2;syndicate=2"
flags = NOBLUDGEON
flags_2 = NO_MAT_REDEMPTION_2
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS

/obj/item/card/emag/pre_attack(atom/target, mob/living/user, params)
if(..() || ismob(target))
Expand Down Expand Up @@ -71,6 +75,7 @@
origin_tech = "magnets=2;syndicate=2"
flags = NOBLUDGEON
flags_2 = NO_MAT_REDEMPTION_2
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS

/obj/item/card/cmag/Initialize(mapload)
. = ..()
Expand All @@ -95,7 +100,6 @@
var/total_mining_points = 0
var/list/access = list()
var/registered_name = "Unknown" // The name registered_name on the card
slot_flags = ITEM_SLOT_ID
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 100, ACID = 100)
resistance_flags = FIRE_PROOF | ACID_PROOF
var/untrackable // Can not be tracked by AI's
Expand Down
7 changes: 7 additions & 0 deletions code/game/objects/items/weapons/storage/bags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
icon_state = "satchel"
origin_tech = "engineering=2"
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_BOTH_POCKETS
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS
w_class = WEIGHT_CLASS_NORMAL
storage_slots = 10
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * ore.w_class
Expand Down Expand Up @@ -230,6 +231,7 @@
storage_slots = 40 //the number of plant pieces it can carry.
max_combined_w_class = 40 //Doesn't matter what this is, so long as it's more or equal to storage_slots * plants.w_class
max_w_class = WEIGHT_CLASS_NORMAL
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS
w_class = WEIGHT_CLASS_TINY
can_hold = list(
/obj/item/seeds,
Expand Down Expand Up @@ -444,6 +446,7 @@
desc = "A bag for storing pills, patches, and bottles."
storage_slots = 50
max_combined_w_class = 200
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS
w_class = WEIGHT_CLASS_TINY
can_hold = list(/obj/item/reagent_containers/pill,
/obj/item/reagent_containers/patch,
Expand All @@ -461,6 +464,7 @@
desc = "A bag for the safe transportation and disposal of biowaste and other biological materials."
storage_slots = 25
max_combined_w_class = 200
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS
w_class = WEIGHT_CLASS_TINY
can_hold = list(/obj/item/slime_extract, /obj/item/food/monkeycube,
/obj/item/reagent_containers/syringe, /obj/item/reagent_containers/glass/beaker,
Expand All @@ -479,6 +483,7 @@
item_state = "mailbag"
storage_slots = 14
max_combined_w_class = 28
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS
w_class = WEIGHT_CLASS_TINY
can_hold = list(/obj/item/envelope, /obj/item/stamp, /obj/item/pen, /obj/item/paper, /obj/item/mail_scanner)
resistance_flags = FLAMMABLE
Expand All @@ -494,6 +499,7 @@
item_state = "construction_bag"
storage_slots = 30
max_combined_w_class = 60
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS
w_class = WEIGHT_CLASS_TINY
can_hold = list(/obj/item/airlock_electronics, /obj/item/firelock_electronics, /obj/item/firealarm_electronics, /obj/item/apc_electronics, /obj/item/airalarm_electronics, /obj/item/camera_assembly, /obj/item/stock_parts/cell, /obj/item/circuitboard, /obj/item/stack/cable_coil)
resistance_flags = FLAMMABLE
Expand All @@ -509,6 +515,7 @@
icon_state = "satchel"
origin_tech = "engineering=2"
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_BOTH_POCKETS
prefered_slot_flags = ITEM_SLOT_BOTH_POCKETS
w_class = WEIGHT_CLASS_NORMAL
storage_slots = 15
max_combined_w_class = 60
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
for(var/slot in GLOB.slot_equipment_priority)
if(isstorage(W) && slot == ITEM_SLOT_HEAD) // Storage items should be put on the belt before the head
continue
if(W.prefered_slot_flags && !(W.prefered_slot_flags & slot)) //If there's a prefered slot flags list, make sure this slot is in it
continue
if(equip_to_slot_if_possible(W, slot, FALSE, TRUE)) //del_on_fail = 0; disable_warning = 0
return 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@
volume = 120
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 75, ACID = 50) //Weak melee protection, because you can wear it on your head
slot_flags = ITEM_SLOT_HEAD
prefered_slot_flags = ITEM_SLOT_IN_BACKPACK
resistance_flags = NONE
blocks_emissive = EMISSIVE_BLOCK_GENERIC
container_type = OPENCONTAINER
Expand Down

0 comments on commit 2bc0388

Please sign in to comment.