-
Notifications
You must be signed in to change notification settings - Fork 199
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
Ports Bay12 Posibrains[Ask me before Merge.] #772
Open
RemieRichards
wants to merge
8
commits into
NTStation:master
Choose a base branch
from
RemieRichards:PosibrainPort
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
8 commits
Select commit
Hold shift + click to select a range
1bd7ea2
Adds Posibrains, MMIs that ghosts can inhabit.
RemieRichards 42e9232
Woopsie!
RemieRichards 1bb1cc8
Woopsie 2
RemieRichards 6818668
Fixes Posibrain/HUD Runtimes
RemieRichards 7798017
Merge branch 'PosibrainPort' of https://github.com/RemieRichards/NTst…
RemieRichards b08926f
Bandaid fix for MASSIVE Visual errors with Combat Mechs and MMI/Posib…
RemieRichards d65901f
Removes Antag and Memories from Positronic brains
RemieRichards 196cadc
Ghosts don't really need the config check.
RemieRichards 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
/obj/item/device/mmi/posibrain | ||
name = "positronic brain" | ||
desc = "A cube of shining metal, four inches to a side and covered in shallow grooves." | ||
icon = 'icons/obj/assemblies.dmi' | ||
icon_state = "posibrain" | ||
w_class = 3 | ||
origin_tech = "biotech=3;programming=2" | ||
|
||
construction_cost = list("metal" = 700, "glass" = 350) | ||
construction_time = 75 | ||
var/searching = 0 | ||
var/askDelay = 10 * 60 * 1 | ||
brainmob = null | ||
req_access = list(access_robotics) | ||
locked = 0 | ||
mecha = null//This does not appear to be used outside of reference in mecha.dm. | ||
|
||
|
||
/obj/item/device/mmi/posibrain/attack_self(mob/user as mob) | ||
if(brainmob && !brainmob.key && searching == 0) | ||
//Start the process of searching for a new user. | ||
user << "<span class='notice'>You carefully locate the manual activation switch and start the positronic brain's boot process.</span>" | ||
searching = 1 | ||
handle_posibrain_icon() | ||
request_player() | ||
spawn(600) | ||
reset_search() | ||
|
||
/obj/item/device/mmi/posibrain/proc/request_player() | ||
for(var/mob/dead/observer/O in player_list) | ||
if(jobban_isbanned(O, "pAI")) | ||
continue | ||
if(O.client) | ||
if(O.client.prefs.be_special & BE_PAI) | ||
question(O.client) | ||
|
||
/obj/item/device/mmi/posibrain/proc/question(var/client/C) | ||
spawn(0) | ||
if(!C) return | ||
var/response = alert(C, "Someone is requesting a personality for a positronic brain. Would you like to play as one?", "Positronic brain request", "Yes", "No", "Never for this round") | ||
if(!C || brainmob.key || 0 == searching) | ||
return //handle logouts that happen whilst the alert is waiting for a response, and responses issued after a brain has been located. | ||
if(response == "Yes") | ||
transfer_personality(C.mob) | ||
else if (response == "Never for this round") | ||
C.prefs.be_special ^= BE_PAI | ||
|
||
|
||
/obj/item/device/mmi/posibrain/transfer_identity(var/mob/living/carbon/H) | ||
name = "positronic brain ([H])" | ||
brainmob.name = H.real_name | ||
brainmob.real_name = H.real_name | ||
brainmob.dna = H.dna | ||
brainmob.timeofhostdeath = H.timeofdeath | ||
brainmob.stat = 0 | ||
if(brainmob.mind) | ||
brainmob.mind.assigned_role = "Positronic Brain" | ||
if(H.mind) | ||
H.mind.transfer_to(brainmob) | ||
|
||
brainmob.mind.remove_all_antag() | ||
brainmob.mind.wipe_memory() | ||
|
||
brainmob << "<span class='warning'>ALL PAST LIVES ARE FORGOTTEN.</span>" | ||
|
||
brainmob << "<span class='notice'>Hello World!</span>" | ||
handle_posibrain_icon() | ||
return | ||
|
||
/obj/item/device/mmi/posibrain/proc/transfer_personality(var/mob/candidate) | ||
|
||
searching = 0 | ||
brainmob.mind = candidate.mind | ||
brainmob.ckey = candidate.ckey | ||
name = "positronic brain ([brainmob.name])" | ||
|
||
brainmob.mind.remove_all_antag() | ||
brainmob.mind.wipe_memory() | ||
|
||
brainmob << "<span class='warning'>ALL PAST LIVES ARE FORGOTTEN.</span>" | ||
|
||
brainmob << "<b>You are a positronic brain, brought into existence on [station_name()].</b>" | ||
brainmob << "<b>As a synthetic intelligence, you answer to all crewmembers, as well as the AI.</b>" | ||
brainmob << "<b>Remember, the purpose of your existence is to serve the crew and the station. Above all else, do no harm.</b>" | ||
brainmob << "<b>Use say :b to speak to other artificial intelligences.</b>" | ||
brainmob.mind.assigned_role = "Positronic Brain" | ||
|
||
var/turf/T = get_turf() | ||
for (var/mob/M in viewers(T)) | ||
M.show_message("<span class='notice'>The positronic brain chimes quietly.</span>") | ||
handle_posibrain_icon() | ||
|
||
/obj/item/device/mmi/posibrain/proc/reset_search() //We give the players sixty seconds to decide, then reset the timer. | ||
|
||
if(brainmob && brainmob.key) return | ||
|
||
searching = 0 | ||
handle_posibrain_icon() | ||
|
||
var/turf/T = get_turf() | ||
for (var/mob/M in viewers(T)) | ||
M.show_message("<span class='notice'>The positronic brain buzzes quietly, and the golden lights fade away. Perhaps you could try again?</span>") | ||
|
||
/obj/item/device/mmi/posibrain/examine() | ||
|
||
set src in oview() | ||
|
||
if(!usr || !src) return | ||
if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) ) | ||
usr << "<span class='notice'>Something is there but you can't see it.</span>" | ||
return | ||
|
||
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n[desc]\n" | ||
msg += "<span class='warning'>" | ||
|
||
if(brainmob && brainmob.key) | ||
switch(brainmob.stat) | ||
if(CONSCIOUS) | ||
if(!src.brainmob.client) msg += "It appears to be in stand-by mode.\n" //afk | ||
if(UNCONSCIOUS) msg += "<span class='warning'>It doesn't seem to be responsive.</span>\n" | ||
if(DEAD) msg += "<span class='deadsay'>It appears to be completely inactive.</span>\n" | ||
else | ||
msg += "<span class='deadsay'>It appears to be completely inactive.</span>\n" | ||
msg += "<span class='info'>*---------*</span>" | ||
usr << msg | ||
return | ||
|
||
/obj/item/device/mmi/posibrain/emp_act(severity) | ||
if(!brainmob) | ||
return | ||
else | ||
switch(severity) | ||
if(1) | ||
brainmob.emp_damage += rand(20,30) | ||
if(2) | ||
brainmob.emp_damage += rand(10,20) | ||
if(3) | ||
brainmob.emp_damage += rand(0,10) | ||
..() | ||
|
||
/obj/item/device/mmi/posibrain/New() | ||
|
||
brainmob = new(src) | ||
brainmob.name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]" | ||
brainmob.real_name = brainmob.name | ||
brainmob.loc = src | ||
brainmob.container = src | ||
brainmob.robot_talk_understand = 1 | ||
brainmob.stat = 0 | ||
brainmob.silent = 0 | ||
dead_mob_list -= brainmob | ||
|
||
..() | ||
|
||
|
||
/obj/item/device/mmi/posibrain/attackby(var/obj/item/O as obj, var/mob/user as mob) | ||
return | ||
|
||
|
||
/obj/item/device/mmi/posibrain/proc/handle_posibrain_icon() | ||
if(searching) | ||
icon_state = "posibrain-searching" | ||
return | ||
if(brainmob) | ||
icon_state = "posibrain-occupied" | ||
else | ||
icon_state = "posibrain" |
Oops, something went wrong.
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.
Isn't
\a
redundant?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.
Posibrain names aren't all supportive of A or all supportive of AN so \a is fine there.
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.
No no, I mean, just not having A, AN, or
\a
, because isn't[src]
supposed to insert it automatically?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.
Uh, the only uses of A and AN are to correctly insert A, AN etc in the sentence when you don't know what it is, as in [src] or [exampleobj], I don't believe [src] or [exampleobj] or whatever automatically place A/AN because that reduces the uses of A and AN down to "this is \a bike" which will always be "this is a bike".
tl;dr I think you're wrong, and if you're not wrong then \a and \an are stupid.
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.
Yeah, I am wrong, sorry. I tested by removing
\a
from/atom/verb/examine()
, and it said "That's the fire alarm.". So[src]
automatically inserts "the" or "The", not "a" or "an".