forked from Baystation12/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Metaless surgery, realistic fail conditions, and harsher consequences #70
Open
BlueNexus
wants to merge
12
commits into
sshado:master
Choose a base branch
from
BlueNexus:isSurgeon
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 all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3139da2
Merge pull request #4 from sshado/master
BlueNexus 37549fa
Added IsSurgeon to the mind of new mobs
BlueNexus 7283731
Added IsSurgeon to the mind of new mobs
BlueNexus 3a3c787
50% fail chance for non-surgeons
BlueNexus e6317bc
Groundwork for new failure system
BlueNexus 5cc9abc
Added failop proc
BlueNexus 844ef7b
More failop
BlueNexus f1f6258
Indentation issue
BlueNexus 35bfe8f
Hopefully fixed some things
BlueNexus d6d06e4
Gave the ERT isSurgeon
BlueNexus ea56783
Gave mercenaries isSurgeon
BlueNexus 89b11f7
Surgeon allocation
BlueNexus 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
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
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
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
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 |
---|---|---|
|
@@ -83,7 +83,7 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool) | |
if (user.a_intent == I_HURT) //check for Hippocratic Oath | ||
return 0 | ||
var/zone = user.zone_sel.selecting | ||
if(zone in M.op_stage.in_progress || user.operating) //Can't operate on someone repeatedly. | ||
if((zone in M.op_stage.in_progress) || (user.operating)) //Can't operate on someone repeatedly. | ||
user << "\red You can't operate on this area while surgery is already in progress." | ||
return 1 | ||
for(var/datum/surgery_step/S in surgery_steps) | ||
|
@@ -94,17 +94,19 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool) | |
if(step_is_valid == 2) // This is a failure that already has a message for failing. | ||
return 1 | ||
M.op_stage.in_progress += zone | ||
S.begin_step(user, M, zone, tool) | ||
user.operating = 1//start on it | ||
user.fail_next_op = 0 | ||
S.begin_step(user, M, zone, tool) | ||
//We had proper tools! (or RNG smiled.) and user did not move or change hands. | ||
if(prob(S.tool_quality(tool)) && do_mob(user, M, rand(S.min_duration, S.max_duration))) | ||
if(prob(S.tool_quality(tool)) && do_mob(user, M, rand(S.min_duration, S.max_duration)) && ((user.mind.isSurgeon) || (!user.mind.isSurgeon) && (prob(50))) && (!user.fail_next_op)) //if they aren't a surgeon, give them a 50% chance of succeeding | ||
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. That !user.mind.isSurgeon is completely redundant. (A || !A && B) is equals to just A || B. 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. ...Oh. I'll adjust that. |
||
S.end_step(user, M, zone, tool) //finish successfully | ||
else if ((tool in user.contents) && user.Adjacent(M)) //or | ||
else if ((tool in user.contents) && user.Adjacent(M) || ((!user.mind.isSurgeon) && (prob(50))) || (user.fail_next_op)) //otherwise, fail the step. Also note, this is a bloody mess of brackets, and I have no idea if it works or not. | ||
S.fail_step(user, M, zone, tool) //malpractice~ | ||
else // This failing silently was a pain. | ||
user << "\red You must remain close to your patient to conduct surgery." | ||
M.op_stage.in_progress -= zone | ||
user.operating = 0 | ||
user.fail_next_op = 0 | ||
if (ishuman(M)) | ||
var/mob/living/carbon/human/H = M | ||
H.update_surgery() | ||
|
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.
Is this necessary?
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.
I'm not sure, but from my experience, it doesn't seem to work unless you define that. I'm not really focusing on this project at the moment, anyway - MFCS is my main project.
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.
It shouldn't be, not in this case.
var/player is already mob/living/carbon/human, which is a child of mob/living (var/M), as such, it already has all of the variables inherited from var/M. Was var/player defined as mob/living, and var/M defined as mob/living/carbon/human, then it would be necessary.