forked from Sandstorm-Station/Sandstorm-Station-13
-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
CONDENSER IMPLANT (bounty) #736
Open
Comicao1
wants to merge
11
commits into
SPLURT-Station:master
Choose a base branch
from
Comicao1:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1f38bab
done
Comicao1 e5f15e0
Merge pull request #1 from SPLURT-Station/master
Comicao1 342ffea
Fixes linter
Comicao1 ccf4480
Merge remote-tracking branch 'upstream/master'
Comicao1 a6c9245
I'll dance dance dance with my hands hands hands
Comicao1 b4be93f
Merge branch 'master' of https://github.com/Comicao1/S.P.L.U.R.T-Stat…
Comicao1 b36ebfd
Merge remote-tracking branch 'upstream/master'
Comicao1 f5b6a8a
Merge remote-tracking branch 'upstream/master'
Comicao1 7133130
Merge branch 'SPLURT-Station:master' into master
Comicao1 6400cb5
Update augments_internal.dm
Comicao1 422988a
Merge branch 'master' of https://github.com/Comicao1/S.P.L.U.R.T-Stat…
Comicao1 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 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
102 changes: 102 additions & 0 deletions
102
modular_splurt/code/modules/surgery/organs/augments_internal.dm
This file contains 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,102 @@ | ||
|
||
|
||
|
||
/obj/item/organ/cyberimp/brain/condenser | ||
name = "condenser implant" | ||
desc = "This cybernetic brain implant will allow you to force your hand muscles to contract, preventing item dropping. Twitch ear to toggle." | ||
implant_color = "#DE7E00" | ||
slot = ORGAN_SLOT_BRAIN_ANTIDROP | ||
actions_types = list(/datum/action/item_action/organ_action/toggle) | ||
var/datum/condenser_implant/condenser/condenser | ||
var/on = 0 | ||
var/wanted_size = 30 | ||
|
||
/obj/item/organ/cyberimp/brain/condenser/New() | ||
..() | ||
condenser = new(null, src) | ||
|
||
/obj/item/organ/cyberimp/brain/condenser/ui_action_click() | ||
condenser.ui_interact(usr) | ||
|
||
/datum/condenser_implant/condenser | ||
var/obj/item/organ/cyberimp/brain/condenser/FATHER = null | ||
|
||
/datum/condenser_implant/condenser/ui_interact(mob/user, datum/tgui/ui) | ||
ui = SStgui.try_update_ui(user, src, ui) | ||
if(!ui) | ||
ui = new(user, src, "Condenser", "Condenser") | ||
ui.open() | ||
|
||
/datum/condenser_implant/condenser/New(mob/viewer, obj/item/organ/cyberimp/brain/condenser/objectA) | ||
FATHER = objectA | ||
ui_interact(viewer) | ||
|
||
/datum/condenser_implant/ui_state(mob/user) | ||
return GLOB.conscious_state | ||
|
||
/datum/condenser_implant/condenser/ui_act(action, params) | ||
if(..()) | ||
return | ||
switch(action) | ||
if("condenser") | ||
FATHER.on = !FATHER.on | ||
. = TRUE | ||
if("size") | ||
var/sent_value = params["size"] | ||
FATHER.wanted_size = sent_value | ||
. = TRUE | ||
|
||
/datum/condenser_implant/condenser/ui_data(mob/user) | ||
if(!ishuman(user)) | ||
return | ||
var/list/data = list() | ||
var/mob/living/carbon/human/H = user | ||
var/obj/item/organ/genital/penis/P = null | ||
var/obj/item/organ/genital/testicles/T = null | ||
var/obj/item/organ/genital/breasts/B = null | ||
|
||
for(var/obj/item/organ/genital/penis/PP in H.internal_organs) | ||
P = PP | ||
for(var/obj/item/organ/genital/testicles/TT in H.internal_organs) | ||
T = TT | ||
for(var/obj/item/organ/genital/breasts/BB in H.internal_organs) | ||
B = BB | ||
|
||
|
||
data["on"] = FATHER.on | ||
data["wanted_size"] = FATHER.wanted_size | ||
if(FATHER.on) | ||
if(P) | ||
P.length = max(FATHER.wanted_size, 1) | ||
if(T) | ||
T.size = clamp(FATHER.wanted_size, BALLS_SIZE_MIN, BALLS_SIZE_MAX) | ||
if(B) | ||
B.cached_size = max(FATHER.wanted_size, 1) | ||
else | ||
if(P) | ||
P.length = initial(P.prev_length) | ||
if(B) | ||
B.cached_size = max(FATHER.wanted_size, 1) | ||
|
||
if(P) | ||
if(P.length != P.prev_length) | ||
P.update() | ||
P.update_size() | ||
P.get_features(user) | ||
P.prev_length = P.length | ||
|
||
if(T) | ||
T.get_features(user) | ||
T.update_appearance() | ||
T.update_size() | ||
|
||
if(B) | ||
if(B.cached_size != B.prev_size) | ||
B.update() | ||
B.update_size() | ||
B.get_features(user) | ||
else | ||
B.prev_size = B.cached_size | ||
|
||
return data | ||
|
This file contains 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,3 @@ | ||
/obj/item/autosurgeon/condenser | ||
starting_organ = /obj/item/organ/cyberimp/brain/condenser | ||
|
This file contains 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 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,42 @@ | ||
import { useBackend } from '../backend'; | ||
import { Button, LabeledList, NumberInput, Section } from '../components'; | ||
import { Window } from '../layouts'; | ||
|
||
export const Condenser = (props, context) => { | ||
const { act, data } = useBackend(context); | ||
return ( | ||
<Window | ||
width={335} | ||
height={115}> | ||
<Window.Content> | ||
<Section> | ||
<LabeledList> | ||
<LabeledList.Item label="Condenser"> | ||
<Button | ||
icon={data.on ? 'power-off' : 'times'} | ||
content={data.on ? 'On' : 'Off'} | ||
selected={data.on} | ||
onClick={() => act('condenser')} /> | ||
</LabeledList.Item> | ||
|
||
<LabeledList.Item label="Maximum Size"> | ||
<NumberInput | ||
animated | ||
value={parseFloat(data.wanted_size)} | ||
unit="inches" | ||
width="75px" | ||
minValue={0} | ||
maxValue={30} | ||
step={10} | ||
onChange={(e, value) => act('size', { | ||
size: value, | ||
})} /> | ||
</LabeledList.Item> | ||
|
||
</LabeledList> | ||
</Section> | ||
</Window.Content> | ||
</Window> | ||
); | ||
}; | ||
|
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.
why is all of this in
ui_data()
though...? It would be better if it was in theui_act()
and that said proc and the js menu had better handling of setting genitals sizes through that.I also don't see where the original sizes for the genitals are being saved so they can be returned to that size once the condenser stops targeting those genitals... or a panel to select which genitals the condenser should target at all...
For all of this, I'd recommend you code it in a similar way to how the size normalizers are coded, but instead aimed towards genitals. also it's better that you use modify_size() rather than manually setting the size of each genital and updating them. There's no need to get_features() if you do that