Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dark-Umbrella authored and MalorMorfin committed Dec 6, 2024
1 parent 4b8a617 commit a72db29
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 196 deletions.
44 changes: 22 additions & 22 deletions code/__DEFINES/loadout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ GLOBAL_LIST_INIT(marine_selector_cats, list(
#define SANDBAG_PRICE_IN_GEAR_VENDOR 3

GLOBAL_LIST_INIT(marine_gear_listed_products, list(
/obj/item/implantator/combat/firearms = list(CAT_MARINE, "Aiming support implanter", 15, "cyan2"),
/obj/item/implantator/combat/melee = list(CAT_MARINE, "Close combat codex implanter", 15, "cyan2"),
/obj/item/implantator/codex/medical = list(CAT_MARINE, "Medtech implanter", 20, "cyan2"),
/obj/item/implantator/codex/engineer = list(CAT_MARINE, "Construction support system implanter", 20, "cyan2"),
/obj/item/implanter/implantator/combat/firearms = list(CAT_MARINE, "Aiming support implanter", 15, "cyan2"),
/obj/item/implanter/implantator/combat/melee = list(CAT_MARINE, "Close combat codex implanter", 15, "cyan2"),
/obj/item/implanter/implantator/codex/medical = list(CAT_MARINE, "Medtech implanter", 20, "cyan2"),
/obj/item/implanter/implantator/codex/engineer = list(CAT_MARINE, "Construction support system implanter", 20, "cyan2"),
/obj/item/storage/backpack/marine/radiopack = list(CAT_MARINE, "Radio Pack", 5, "orange"),
/obj/item/storage/belt/marine/auto_catch = list(CAT_MARINE, "M344 pattern ammo load rig", 10, "orange"),
/obj/item/stack/sandbags_empty/half = list(CAT_MARINE, "Sandbags x25", SANDBAG_PRICE_IN_GEAR_VENDOR, "orange"),
Expand Down Expand Up @@ -124,9 +124,9 @@ GLOBAL_LIST_INIT(robot_gear_listed_products, list(

GLOBAL_LIST_INIT(engineer_gear_listed_products, list(
/obj/effect/vendor_bundle/engi = list(CAT_ESS, "Essential Engineer Set", 0, "white"),
/obj/item/implantator/combat/firearms = list(CAT_ENGSUP, "Aiming support implanter", 25, "cyan2"),
/obj/item/implantator/combat/melee = list(CAT_ENGSUP, "Close combat codex implanter", 25, "cyan2"),
/obj/item/implantator/codex/engineer = list(CAT_ENGSUP, "Construction support system implanter", 20, "cyan2"),
/obj/item/implanter/implantator/combat/firearms = list(CAT_ENGSUP, "Aiming support implanter", 25, "cyan2"),
/obj/item/implanter/implantator/combat/melee = list(CAT_ENGSUP, "Close combat codex implanter", 25, "cyan2"),
/obj/item/implanter/implantator/codex/engineer = list(CAT_ENGSUP, "Construction support system implanter", 20, "cyan2"),
/obj/item/stack/sheet/metal/small_stack = list(CAT_ENGSUP, "Metal x10", METAL_PRICE_IN_GEAR_VENDOR, "orange"),
/obj/item/stack/sheet/plasteel/small_stack = list(CAT_ENGSUP, "Plasteel x10", PLASTEEL_PRICE_IN_GEAR_VENDOR, "orange"),
/obj/item/stack/sandbags_empty/half = list(CAT_ENGSUP, "Sandbags x25", SANDBAG_PRICE_IN_GEAR_VENDOR, "orange"),
Expand Down Expand Up @@ -169,10 +169,10 @@ GLOBAL_LIST_INIT(engineer_gear_listed_products, list(

GLOBAL_LIST_INIT(medic_gear_listed_products, list(
/obj/effect/vendor_bundle/medic = list(CAT_ESS, "Essential Medic Set", 0, "white"),
/obj/item/implantator/combat/firearms = list(CAT_MEDSUP, "Aiming support implanter", 25, "cyan2"),
/obj/item/implantator/combat/melee = list(CAT_MEDSUP, "Close combat codex implanter", 25, "cyan2"),
/obj/item/implantator/codex/medical = list(CAT_MEDSUP, "Medtech implanter", 20, "cyan2"),
/obj/item/implantator/codex/surgery = list(CAT_MEDSUP, "Surgery assisting system implanter", 20, "cyan2"),
/obj/item/implanter/implantator/combat/firearms = list(CAT_MEDSUP, "Aiming support implanter", 25, "cyan2"),
/obj/item/implanter/implantator/combat/melee = list(CAT_MEDSUP, "Close combat codex implanter", 25, "cyan2"),
/obj/item/implanter/implantator/codex/medical = list(CAT_MEDSUP, "Medtech implanter", 20, "cyan2"),
/obj/item/implanter/implantator/codex/surgery = list(CAT_MEDSUP, "Surgery assisting system implanter", 20, "cyan2"),
/obj/item/reagent_containers/glass/bottle/lemoline/doctor = list(CAT_MEDSUP, "Lemoline bottle", 14, "orange"),
/obj/item/storage/pill_bottle/meralyne = list(CAT_MEDSUP, "Meralyne pills", 14, "orange"),
/obj/item/storage/pill_bottle/dermaline = list(CAT_MEDSUP, "Dermaline pills", 14, "orange"),
Expand Down Expand Up @@ -211,11 +211,11 @@ GLOBAL_LIST_INIT(medic_gear_listed_products, list(

GLOBAL_LIST_INIT(leader_gear_listed_products, list(
/obj/effect/vendor_bundle/leader = list(CAT_ESS, "Essential SL Set", 0, "white"),
/obj/item/implantator/combat/firearms = list(CAT_LEDSUP, "Aiming support implanter", 15, "cyan2"),
/obj/item/implantator/combat/melee = list(CAT_LEDSUP, "Close combat codex implanter", 15, "cyan2"),
/obj/item/implantator/codex/medical = list(CAT_LEDSUP, "Medtech implanter", 15, "cyan2"),
/obj/item/implantator/codex/engineer = list(CAT_LEDSUP, "Construction support system implanter", 15, "cyan2"),
/obj/item/implantator/oper_system/leadership = list(CAT_LEDSUP, "Command protocols 'Graiyor' codex loader", 20, "cyan2"),
/obj/item/implanter/implantator/combat/firearms = list(CAT_LEDSUP, "Aiming support implanter", 15, "cyan2"),
/obj/item/implanter/implantator/combat/melee = list(CAT_LEDSUP, "Close combat codex implanter", 15, "cyan2"),
/obj/item/implanter/implantator/codex/medical = list(CAT_LEDSUP, "Medtech implanter", 15, "cyan2"),
/obj/item/implanter/implantator/codex/engineer = list(CAT_LEDSUP, "Construction support system implanter", 15, "cyan2"),
/obj/item/implanter/implantator/oper_system/leadership = list(CAT_LEDSUP, "Command protocols 'Graiyor' codex loader", 20, "cyan2"),
/obj/item/armor_module/module/valkyrie_autodoc = list(CAT_LEDSUP, "Valkyrie Automedical Armor System", 25,"white"),
/obj/effect/vendor_bundle/tyr/two = list(CAT_LEDSUP, "Tyr 2 extra armor set", 25,"white"),
/obj/effect/vendor_bundle/mimir/two = list(CAT_LEDSUP, "Mimir 2 extra armor set", 25,"white"),
Expand Down Expand Up @@ -275,12 +275,12 @@ GLOBAL_LIST_INIT(leader_gear_listed_products, list(

GLOBAL_LIST_INIT(commander_gear_listed_products, list(
/obj/effect/vendor_bundle/commander = list(CAT_ESS, "Essential FC Set", 0, "white"),
/obj/item/implantator/combat/firearms = list(CAT_FCSUP, "Aiming support implanter", 15, "cyan2"),
/obj/item/implantator/combat/melee = list(CAT_FCSUP, "Close combat codex implanter", 15, "cyan2"),
/obj/item/implantator/codex/medical = list(CAT_FCSUP, "Medtech implanter", 15, "cyan2"),
/obj/item/implantator/codex/surgery = list(CAT_FCSUP, "Surgery assisting system implanter", 15, "cyan2"),
/obj/item/implantator/codex/engineer = list(CAT_FCSUP, "Construction support system implanter", 15, "cyan2"),
/obj/item/implantator/oper_system/leadership/delux = list(CAT_FCSUP, "Delux command protocols 'Graiyor' codex loader", 20, "cyan2"),
/obj/item/implanter/implantator/combat/firearms = list(CAT_FCSUP, "Aiming support implanter", 15, "cyan2"),
/obj/item/implanter/implantator/combat/melee = list(CAT_FCSUP, "Close combat codex implanter", 15, "cyan2"),
/obj/item/implanter/implantator/codex/medical = list(CAT_FCSUP, "Medtech implanter", 15, "cyan2"),
/obj/item/implanter/implantator/codex/surgery = list(CAT_FCSUP, "Surgery assisting system implanter", 15, "cyan2"),
/obj/item/implanter/implantator/codex/engineer = list(CAT_FCSUP, "Construction support system implanter", 15, "cyan2"),
/obj/item/implanter/implantator/oper_system/leadership/delux = list(CAT_FCSUP, "Delux command protocols 'Graiyor' codex loader", 20, "cyan2"),
/obj/item/beacon/supply_beacon = list(CAT_FCSUP, "Supply beacon", 5, "blue"),
/obj/item/beacon/orbital_bombardment_beacon = list(CAT_FCSUP, "Orbital beacon", 5, "blue"),
/obj/item/fulton_extraction_pack = list(CAT_FCSUP, "Fulton Extraction Pack", 5, "blue"),
Expand Down
47 changes: 23 additions & 24 deletions code/game/objects/items/implants/implantcase.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
throw_speed = 1
throw_range = 5
w_class = WEIGHT_CLASS_TINY
var/obj/item/implant/imp
var/obj/item/implant/internal_implant


/obj/item/implantcase/Initialize(mapload, imp)
/obj/item/implantcase/Initialize(mapload, internal_implant)
. = ..()
if(imp)
imp = new imp(src)
if(internal_implant)
internal_implant = new internal_implant(src)
update_icon()

/obj/item/implantcase/Destroy()
QDEL_NULL(imp)
QDEL_NULL(internal_implant)
return ..()

/obj/item/implantcase/update_icon_state()
. = ..()
if(imp)
icon_state = "implantcase-[imp.implant_color]"
if(internal_implant)
icon_state = "implantcase-[internal_implant.implant_color]"
else
icon_state = "implantcase-0"

Expand All @@ -47,52 +47,51 @@
name = initial(name)

else if(istype(I, /obj/item/reagent_containers/syringe))
if(!imp?.allow_reagents)
if(!internal_implant?.allow_reagents)
return

if(imp.reagents.total_volume >= imp.reagents.maximum_volume)
if(internal_implant.reagents.total_volume >= internal_implant.reagents.maximum_volume)
to_chat(user, span_warning("[src] is full."))
return

I.reagents.trans_to(imp, 5)
I.reagents.trans_to(internal_implant, 5)
to_chat(user, span_notice("You inject 5 units of the solution. The syringe now contains [I.reagents.total_volume] units."))

else if(istype(I, /obj/item/implanter))
var/obj/item/implanter/M = I
if(M.imp)
if((imp || M.imp.implanted))
if(M.internal_implant)
if((internal_implant || M.internal_implant.implanted))
return
M.imp.forceMove(src)
imp = M.imp
M.imp = null
M.internal_implant.forceMove(src)
internal_implant = M.internal_implant
M.internal_implant = null

else if(imp)
if(M.imp)
else if(internal_implant)
if(M.internal_implant)
return
imp.forceMove(M)
M.imp = imp
imp = null
internal_implant.forceMove(M)
M.internal_implant = internal_implant
internal_implant = null

update_icon()
M.update_icon()

else if(istype(I, /obj/item/implant))
user.temporarilyRemoveItemFromInventory(I)
I.forceMove(src)
imp = I
internal_implant = I
update_icon()

/obj/item/implantcase/cargo
name = "glass implant case"
desc = "A case containing an implant."
icon = 'icons/obj/items/implants.dmi'
icon_state = "implantcase-0"
var/obj/item/implant/skill/internal_implant

/obj/item/implantcase/cargo/attackby(obj/item/I, mob/user, params)
. = ..()
if(istype(I, /obj/item/implantator))
var/obj/item/implantator/M = I
if(istype(I, /obj/item/implanter/implantator))
var/obj/item/implanter/implantator/M = I

if(!do_after(user, 5 SECONDS, NONE, user, BUSY_ICON_GENERIC))
to_chat(user, span_notice("You stop transfering [internal_implant]"))
Expand Down
50 changes: 25 additions & 25 deletions code/game/objects/items/implants/implanter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,70 +10,70 @@
throw_speed = 1
throw_range = 5
w_class = WEIGHT_CLASS_TINY
var/obj/item/implant/imp = null
var/obj/item/implant/internal_implant = null

/obj/item/implanter/Initialize(mapload, ...)
. = ..()
if(imp)
imp = new imp(src)
if(internal_implant)
internal_implant = new internal_implant(src)
update_icon()

/obj/item/implanter/Destroy()
QDEL_NULL(imp)
QDEL_NULL(internal_implant)
return ..()

/obj/item/implanter/update_icon_state()
. = ..()
icon_state = "implanter[imp?"1":"0"]"
icon_state = "implanter[internal_implant?"1":"0"]"

/obj/item/implanter/examine(mob/user, distance, infix, suffix)
. = ..()
. += "it contains [imp ? "a [imp.name]" : "no implant"]!"
. += "it contains [internal_implant ? "a [internal_implant.name]" : "no implant"]!"

/obj/item/implanter/attack(mob/target, mob/user)
. = ..()
if(!ishuman(target))
return FALSE
if(!imp)
if(!internal_implant)
to_chat(user, span_warning("There is no implant in the [src]!"))
return FALSE
user.visible_message(span_warning("[user] is attemping to implant [target]."), span_notice("You're attemping to implant [target]."))

if(!do_after(user, 5 SECONDS, NONE, target, BUSY_ICON_GENERIC) || !imp)
if(!do_after(user, 5 SECONDS, NONE, target, BUSY_ICON_GENERIC) || !internal_implant)
to_chat(user, span_notice("You failed to implant [target]."))
return

if(imp.try_implant(target, user))
if(internal_implant.try_implant(target, user))
target.visible_message(span_warning("[target] has been implanted by [user]."))
log_combat(user, target, "implanted", src)
imp = null
internal_implant = null
update_icon()
return TRUE
to_chat(user, span_notice("You fail to implant [target]."))

/obj/item/implanter/neurostim
name = "neurostim implanter"
imp = /obj/item/implant/neurostim
internal_implant = /obj/item/implant/neurostim

/obj/item/implanter/chem
name = "chem implant implanter"
imp = /obj/item/implant/chem
internal_implant = /obj/item/implant/chem

/obj/item/implanter/chem/blood
name = "blood recovery implant implanter"
imp = /obj/item/implant/chem/blood
internal_implant = /obj/item/implant/chem/blood

/obj/item/implanter/cloak
name = "cloak implant implanter"
imp = /obj/item/implant/cloak
internal_implant = /obj/item/implant/cloak

/obj/item/implanter/blade
name = "blade implant implanter"
imp = /obj/item/implant/deployitem/blade
internal_implant = /obj/item/implant/deployitem/blade

/obj/item/implanter/suicide_dust
name = "Self-Gibbing implant"
imp = /obj/item/implant/suicide_dust
internal_implant = /obj/item/implant/suicide_dust

/obj/item/implanter/cargo
name = "implanter"
Expand All @@ -85,19 +85,19 @@
/obj/item/implanter/cargo/Initialize(mapload, ...)
. = ..()
update_icon_state()
if(imp)
if(internal_implant)
update_icon_state()
desc = imp.desc
imp = new imp(src)
desc = internal_implant.desc
internal_implant = new internal_implant(src)
if(!allowed_limbs)
allowed_limbs = GLOB.human_body_parts

/obj/item/implanter/cargo/update_icon_state()
. = ..()
icon_state = "cargo"
if(imp)
if(internal_implant)
icon_state = "cargo_full"
if(!imp)
if(!internal_implant)
icon_state = "cargo_s"

/obj/item/implanter/cargo/proc/has_implant(datum/limb/targetlimb)
Expand All @@ -113,7 +113,7 @@
if(spent == TRUE)
balloon_alert(user, "already used!")
return FALSE
if(!imp)
if(!internal_implant)
to_chat(user, span_warning("There is no implant in the [src]!"))
return FALSE
if(!(user.zone_selected in allowed_limbs))
Expand All @@ -124,13 +124,13 @@
balloon_alert(user, "limb already implanted!")
return FALSE
user.visible_message(span_warning("[user] is attemping to implant [target]."), span_notice("You're attemping to implant [target]."))
if(!do_after(user, 5 SECONDS, NONE, target, BUSY_ICON_GENERIC) || !imp)
if(!do_after(user, 5 SECONDS, NONE, target, BUSY_ICON_GENERIC) || !internal_implant)
to_chat(user, span_notice("You failed to implant [target]."))
return FALSE
if(imp.try_implant(target, user))
if(internal_implant.try_implant(target, user))
target.visible_message(span_warning("[target] has been implanted by [user]."))
log_combat(user, target, "implanted", src)
imp = null
internal_implant = null
spent = TRUE
update_icon_state()
return TRUE
Expand Down
Loading

0 comments on commit a72db29

Please sign in to comment.