Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skill implants. (Need help, on progress and dont merge that shit) #669

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions code/__DEFINES/loadout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +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/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 @@ -120,6 +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/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 @@ -162,6 +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/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 @@ -200,6 +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/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 @@ -259,6 +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/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
3 changes: 2 additions & 1 deletion code/__DEFINES/skills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@
#define SKILL_LEAD_BEGINNER 1 //All non-Standard Marines
#define SKILL_LEAD_TRAINED 2 //PO, CMO, etc
#define SKILL_LEAD_EXPERT 3 //SL, SO
#define SKILL_LEAD_MASTER 4 //XO, CO
#define SKILL_LEAD_MASTER 4 //XO, FC
#define SKILL_LEAD_SUPER 5 // implanted FC

//melee_weapons skill
//buff to melee weapon attack damage
Expand Down
6 changes: 6 additions & 0 deletions code/game/objects/items/implants/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
if(!allowed_limbs)
allowed_limbs = GLOB.human_body_parts

/obj/item/implant/proc/on_initialize()
if(flags_implant & GRANT_ACTIVATION_ACTION)
activation_action = new(src, src)
if(allow_reagents)
reagents = new /datum/reagents(MAX_IMPLANT_REAGENTS)
reagents.my_atom = WEAKREF(src)
Dark-Umbrella marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/implant/Destroy(force)
unimplant()
Expand Down
79 changes: 58 additions & 21 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,37 +47,74 @@
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"
Dark-Umbrella marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/implantcase/cargo/attackby(obj/item/I, mob/user, params)
. = ..()
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]"))
return FALSE

if(M.internal_implant)
if((internal_implant || M.internal_implant.implanted))
return
M.internal_implant.forceMove(src)
internal_implant = M.internal_implant
M.internal_implant = null

if(internal_implant)
if(M.internal_implant)
return
internal_implant.forceMove(M)
M.internal_implant = internal_implant
internal_implant = null
update_icon()
M.update_icon()

else if(istype(I, /obj/item/implant/skill))
user.temporarilyRemoveItemFromInventory(I)
I.forceMove(src)
internal_implant = I
update_icon()
93 changes: 77 additions & 16 deletions code/game/objects/items/implants/implanter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,128 @@
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"
Dark-Umbrella marked this conversation as resolved.
Show resolved Hide resolved
icon_state = "cargo"
var/spent = FALSE
var/allowed_limbs
var/list/implants

/obj/item/implanter/cargo/Initialize(mapload, ...)
. = ..()
update_icon_state()
if(internal_implant)
update_icon_state()
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(internal_implant)
icon_state = "cargo_full"
if(!internal_implant)
icon_state = "cargo_s"

/obj/item/implanter/cargo/proc/has_implant(datum/limb/targetlimb)
for (var/obj/item/implant/skill/I in targetlimb.implants)
if(!is_type_in_list(I, GLOB.known_implants))
return TRUE
return FALSE

/obj/item/implanter/cargo/attack(mob/living/target, mob/living/user, list/implants, datum/limb/targetlimb, var/obj/item/implant/skill/i)
. = ..()
if(!ishuman(target))
return FALSE
if(spent == TRUE)
balloon_alert(user, "already used!")
return FALSE
if(!internal_implant)
to_chat(user, span_warning("There is no implant in the [src]!"))
return FALSE
if(!(user.zone_selected in allowed_limbs))
balloon_alert(user, "wrong limb!")
return FALSE
for(i in user.zone_selected)
has_implant(targetlimb)
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) || !internal_implant)
to_chat(user, span_notice("You failed to implant [target]."))
return FALSE
if(internal_implant.try_implant(target, user))
target.visible_message(span_warning("[target] has been implanted by [user]."))
log_combat(user, target, "implanted", src)
internal_implant = null
spent = TRUE
update_icon_state()
return TRUE
to_chat(user, span_notice("You fail to implant [target]."))
Loading
Loading