This repository was archived by the owner on May 22, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 456
[Bounty] Adds the CVS recipient injector #18502
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bd17a91
Added
BurgerLUA 3aa50a4
25TC to 20TC
BurgerLUA 6b8c568
no longer unlimited
BurgerLUA bcd4420
fixes lint
BurgerLUA fec0d25
Update sentient_disease_injector.dm
BurgerLUA 794bb84
Apply suggestions from code review
BurgerLUA 545e96f
adds icons
BurgerLUA 9869497
Merge branch 'Sentient-Virus-Maker' of https://github.com/BurgerLUA/Y…
BurgerLUA 9fb7b16
wow it actually works
BurgerLUA 8076e36
reorders
BurgerLUA 9a2dd60
Update sentient_disease_injector.dm
BurgerLUA 7d772b3
Update sentient_disease_injector.dm
BurgerLUA 3b348cd
Update sentient_disease_injector.dm
BurgerLUA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| /obj/item/sentient_disease_injector | ||
| name = "\improper CVS recipient injector" | ||
| desc = "It doesn't look like it prints receipts..." | ||
|
|
||
| icon = 'yogstation/icons/obj/syringe.dmi' | ||
| icon_state = "cvs" | ||
|
|
||
| var/uses = 3 | ||
|
|
||
| var/obj/item/reagent_containers/glass/bottle/vial/stored_vial | ||
|
|
||
| resistance_flags = ACID_PROOF | ||
| slot_flags = ITEM_SLOT_BELT | ||
|
|
||
| /obj/item/sentient_disease_injector/Initialize() | ||
| . = ..() | ||
| update_icon() | ||
|
|
||
| /obj/item/sentient_disease_injector/update_icon() | ||
|
|
||
| . = ..() | ||
|
|
||
| cut_overlays() | ||
|
|
||
| if(uses > 0) | ||
| add_overlay( | ||
| image( | ||
| icon = icon, | ||
| icon_state = "[icon_state]_virus[min(uses,3)]" | ||
| ) | ||
| ) | ||
|
|
||
| if(stored_vial) | ||
| if(stored_vial.reagents.total_volume > 0) | ||
| var/mutable_appearance/filling = mutable_appearance(icon,"[icon_state]_reagents") | ||
| filling.color = mix_color_from_reagents(stored_vial.reagents.reagent_list) | ||
| add_overlay(filling) | ||
| add_overlay( | ||
| image( | ||
| icon = icon, | ||
| icon_state = "[icon_state]_vial]" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this dangling ] need to be here? |
||
| ) | ||
| ) | ||
|
|
||
| /obj/item/sentient_disease_injector/examine(mob/user) | ||
| . = ..() | ||
| if(stored_vial) | ||
| . += span_notice("It has a [stored_vial] inserted.") | ||
| if(uses > 0) | ||
| . += span_notice("It has [uses] [uses == 1 ? "use" : "uses"] remaining.") | ||
| else | ||
| . += span_notice("It is spent.") | ||
|
|
||
| /obj/item/sentient_disease_injector/attackby(obj/item/I, mob/user, params) | ||
|
|
||
| if(!istype(I,/obj/item/reagent_containers)) | ||
| return ..() //Something else. | ||
|
|
||
| if(stored_vial) //Already exists. | ||
| to_chat(user, span_warning("There is already \a [stored_vial] inside.")) | ||
| return | ||
|
|
||
| if(!istype(I, /obj/item/reagent_containers/glass/bottle/vial)) | ||
| to_chat(user, span_warning("\The [stored_vial] won't fit inside.")) | ||
| return | ||
|
|
||
| var/datum/reagent/R = I.reagents.get_master_reagent() | ||
|
|
||
| if(!R) | ||
| to_chat(user, span_warning("\The [I] is empty!")) | ||
| return | ||
|
|
||
| if(!length(R.data) || !length(R.data["viruses"])) | ||
| to_chat(user, span_warning("\The [src] can't seem to detect any viruses inside \the [I]...")) | ||
| return | ||
|
|
||
| stored_vial = I | ||
| stored_vial.forceMove(src) | ||
|
|
||
| to_chat(user, span_notice("You insert \the [I] into \the [src].")) | ||
|
|
||
| update_icon() | ||
|
|
||
| return TRUE | ||
|
|
||
| /obj/item/sentient_disease_injector/attack_self(mob/user) | ||
|
|
||
| if(!stored_vial) | ||
| return | ||
|
|
||
| stored_vial.forceMove(user.loc) | ||
| user.put_in_hands(stored_vial) | ||
| to_chat(user, span_notice("You eject \the [stored_vial] from \the [src].")) | ||
| stored_vial = null | ||
|
|
||
| update_icon() | ||
|
|
||
| return TRUE | ||
|
|
||
| /obj/item/sentient_disease_injector/attack(obj/item/I, mob/user, params) | ||
| return //Prevents damage. | ||
|
|
||
| /obj/item/sentient_disease_injector/afterattack(atom/target, mob/user, proximity) | ||
|
|
||
| if(!proximity || !iscarbon(target)) | ||
| return ..() | ||
|
|
||
| if(uses <= 0) | ||
| to_chat(user, span_warning("\The [src] is spent!")) | ||
| return | ||
|
|
||
| var/mob/living/carbon/C = target | ||
|
|
||
| if(!C.can_inject(user, 1, user.zone_selected, TRUE)) | ||
| to_chat(user, span_warning("You can't seem to inject \the [C] that way!")) | ||
|
|
||
| if(ishuman(C)) | ||
| var/obj/item/bodypart/affecting = C.get_bodypart(check_zone(user.zone_selected)) | ||
| if(!affecting) | ||
| to_chat(user, span_warning("\The [src] can't inject a missing limb!")) | ||
| return | ||
| if(affecting.status != BODYPART_ORGANIC) | ||
| to_chat(user, span_warning("\The [src] won't work on a robotic limb!")) | ||
| return | ||
|
|
||
| to_chat(user, span_notice("You stealthily inject \the [C] with \the [src].")) | ||
|
|
||
| uses -= 1 | ||
|
|
||
| for(var/datum/disease/D as anything in C.diseases) //Cure all existing diseases | ||
| D.cure(add_resistance = FALSE) | ||
|
|
||
| if(stored_vial && stored_vial.reagents.total_volume) //If there is a stored vial, inject. | ||
| var/list/injected = list() | ||
| for(var/datum/reagent/R as anything in stored_vial.reagents.reagent_list) | ||
| injected += R.name | ||
| log_combat(user, C, "attempted to inject", src, "([english_list(injected)])") | ||
| stored_vial.reagents.reaction(C, INJECT, 1) | ||
| stored_vial.reagents.trans_to(C, stored_vial.reagents.total_volume, transfered_by = user) | ||
| else | ||
| log_combat(user, C, "attempted to inject", src) | ||
|
|
||
| if(length(C.diseases)) | ||
| INVOKE_ASYNC(src, PROC_REF(create_sentient_virus), target, user) | ||
|
|
||
| update_icon() | ||
|
|
||
| return TRUE | ||
|
|
||
| /obj/item/sentient_disease_injector/Destroy() | ||
| QDEL_NULL(stored_vial) | ||
| . = ..() | ||
|
|
||
| /obj/item/sentient_disease_injector/proc/create_sentient_virus(mob/living/carbon/target,mob/user) | ||
|
|
||
| var/list/candidates = pollGhostCandidates("Do you wish to be considered for the special role of 'custom sentient disease'?", ROLE_ALIEN, null, ROLE_ALIEN) | ||
| if(!length(candidates)) | ||
| return FALSE //No candidates. | ||
|
|
||
| var/mob/dead/observer/selected = pick_n_take(candidates) | ||
| var/mob/camera/disease/virus = new/mob/camera/disease(get_turf(target)) | ||
| virus.key = selected.key | ||
| message_admins("[ADMIN_LOOKUPFLW(virus)] has been made into a sentient disease by [ADMIN_LOOKUPFLW(usr)]'s [src].") | ||
| log_game("[key_name(virus)] was spawned as a sentient disease by [ADMIN_LOOKUPFLW(usr)]'s [src].") | ||
| //Mix and cure all existing diseases. | ||
| for(var/datum/disease/D as anything in target.diseases) | ||
| if(D == virus) | ||
| continue | ||
| virus.disease_template.Mix(D) | ||
| D.cure(add_resistance = FALSE) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Allow the sentient disease to pick a name via INVOKE_ASYNC(virus, TYPE_PROC_REF(/mob/camera/disease, pick_name)) |
||
| return virus.force_infect(target) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're making the icon file modularized why not the dm file aswell?