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

Adds Positronic Brains to Latejoin Menu #11162

Merged
merged 27 commits into from
Sep 4, 2024

Conversation

Programs-The-Station
Copy link
Contributor

@Programs-The-Station Programs-The-Station commented Jul 7, 2024

About The Pull Request

This PR Adds On Station Positronics to the Latejoin menu. A player at the lobby will activate a random positronic from the available ones on station.

It was going to be extremely difficult to separate round-start cyborg from positronics, so I left the ability for one late join cyborg to occur and added positronics as a separate category.

Posis created on station and moved off station will automatically be removed from the list of candidates.

Posis created off station and moved on station will automatically join the list.

Posis deleted / exploded will automatically remove themselves from the list if applicable.

Closes Request #9133 .

Why It's Good For The Game

You can now latejoin as a posibrain directly.

Testing Photographs and Procedure

Starting Test Case ![Before On Station Posis](https://github.com/BeeStation/BeeStation-Hornet/assets/100493881/71451b8e-20ec-4d89-8f6a-ea0256f22b27)

On Station Posi 1

3 Posis Created On Station: Total Jobs: 3

3 Posis On Station

Posi Created Off Station (Mining), no change in job slots.

4_Posi created off station no change

That Posi Being Brought On Station: Total Jobs: 4

5_Posi Created off Station, brought on station

Positronic Job Now Available in Latejoin Menu

6_Positronic Job Now Available

Joining From Latejoin

7_From Latejoin

Joining As Ghost

8_Ghost Posi Still Works

All Latejoin Tests

9_Posi Latejoin 1

10_Posi Latejoin 2

11_Posi Latejoin 3

12_Posi latejoin 4

No More Posis After Latejoining

13_No More posis

Deleting and Exploding Posis Removes Them From the List (Started with 2 in each case)

14_Deleting Posi Removes from List

15_Exploding Posi removes it from list

Changelog

🆑 Programs-The-Station, Rukofamicom
add: You can now Latejoin directly as an on-station posibrain.
add: Due to Job-code, Positronic Brain is now a job.
/:cl:

@Programs-The-Station Programs-The-Station marked this pull request as draft July 7, 2024 03:51
@Programs-The-Station Programs-The-Station marked this pull request as ready for review July 7, 2024 04:02
Copy link
Member

@EvilDragonfiend EvilDragonfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be a subtype of borg job, so that you don't have to touch many things manually. (since it shares the same things with borg job)

Copy link
Contributor

@Rukofamicom Rukofamicom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to actually fulfil #9133 it should replace cyborg as a job on latejoin entirely.

Cyborg shouldn't still be allowed the single late join, or any late joins if a cyborg goes to cryo.

@MarkusLarsson421
Copy link
Contributor

Having one single Cyborg slot is needed still I think. If there is no Roboticist or Scientist there will be zero Cyborgs no matter how many positronic brains you have.

@Programs-The-Station
Copy link
Contributor Author

In order to actually fulfil #9133 it should replace cyborg as a job on latejoin entirely.

Cyborg shouldn't still be allowed the single late join, or any late joins if a cyborg goes to cryo.

The problem with this logic is that implies that an AI that cryos should not open up a new slot, because you can just create more AIs.

Because of how Cyborgs are spawned vs the positronic activation, I'd have to remove the roundstart cyborg completely, or rework large amounts of the job code to pass in additional snowflake parameters.

The best I can do is set the Cyborg total positions to zero, and the spawn positions to 1, but I do not know if that will allow for a cyborg to spawn round start. I'd have to test it.

I'm not going to combine the two, but I can look at making Posi a subtype of Cyborg. The reason I didn't is because the "job" posibrain is just a workaround to get the jobs subsystem to recognize that they exist. It shouldn't exist in any consoles. Handling bans and such are already handled in the positronic code, so there's no reason to tie them to the job.

I think Bacon should decide if this fulfills #9133 or not.

@Rukofamicom
Copy link
Contributor

Rukofamicom commented Jul 7, 2024

I think Bacon should decide if this fulfills #9133 or not.

image

I would argue it's already very explicitly part of that link, but yes he may have changed his mind and should probably weigh in himself.

Having one single Cyborg slot is needed still I think. If there is no Roboticist or Scientist there will be zero Cyborgs no matter how many positronic brains you have.

There should be zero positronic brains without a roboticist to print them. That's the intent behind the change - cyborgs are introduced by roboticists and should only really be a thing at either roundstart or as a part of robotics?

@MarkusLarsson421
Copy link
Contributor

Wasn't there supposed to be a round-start positronic brain? Or are cyborgs just locked behind miners now?

@Programs-The-Station
Copy link
Contributor Author

Update: Setting Cyborg Total Positions to 0 allowed for 1 roundstart cyborg ( 1 spawned position). The cyborg cryoing did not open up a slot.

I'm not going to push this change until a decision is reached on whether or not we want the ability to have one late join cyborg.

Copy link
Member

@EvilDragonfiend EvilDragonfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to make a proc /datum/job/cyborg/proc/spawn_silicon(...), and should call it from proc/after_spawn()
/datum/job/cyborg/after_spawn() codes should go to the new proc spawn_silicon()
positron brain should override the proc.

Copy link
Member

@EvilDragonfiend EvilDragonfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to use onTransitZ() proc to make it more accurate.

@Programs-The-Station
Copy link
Contributor Author

You need to make a proc /datum/job/cyborg/proc/spawn_silicon(...), and should call it from proc/after_spawn() /datum/job/cyborg/after_spawn() codes should go to the new proc spawn_silicon() positron brain should override the proc.

So you want me to rewrite cyborg code as well? There's no proc like that, not even in the AI stuff. Both AI and Cyborg use the "equip" function to do the transformation from human to silicon.

@EvilDragonfiend
Copy link
Member

EvilDragonfiend commented Jul 8, 2024

You need to make a proc /datum/job/cyborg/proc/spawn_silicon(...), and should call it from proc/after_spawn() /datum/job/cyborg/after_spawn() codes should go to the new proc spawn_silicon() positron brain should override the proc.

So you want me to rewrite cyborg code as well? There's no proc like that, not even in the AI stuff. Both AI and Cyborg use the "equip" function to do the transformation from human to silicon.

No, it isn't asking you to rewrite the whole code. it's just simple. You need to do a simple touch.

/datum/job/cyborg/after_spawn(mob/living/silicon/robot/R, mob/M, latejoin = FALSE, client/preference_source, on_dummy = FALSE)
	if(!M.client || on_dummy)
		return
	after_spawn_silicon(R)

/datum/job/cyborg/proc/after_spawn_silicon(mob/living/silicon/robot/R)
	R.updatename(M.client)
	R.gender = NEUTER

/datum/job/cyborg/posibrain/after_spawn_silicon(mob/living/silicon/robot/R)
	// that you wrote in this PR

job code is miserable as fuck, but you don't have to refactor that much.

Copy link
Contributor

@Rukofamicom Rukofamicom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a response from bacon who is having Internet issues - yes the latejoin cyborg should be removed as per the initial posting.

They are either already part of the station or must be built by a roboticist (or someone standing in as one)

@Programs-The-Station
Copy link
Contributor Author

All requests updated.

The reason for my second comment on the after_spawn_silicon is that I just needed clarification if you wanted me to add that proc to Cyborg.dm, which your example was helpful.

Copy link
Member

@EvilDragonfiend EvilDragonfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

position shpuld take a length of the list, instead of doing ++ or --. like SSjob.GetJob(JOB_NAME_POSIBRAIN).total_positions = length(GLOB.posibrains)

also, Byond can't do
SSjob.GetJob(JOB_NAME_POSIBRAIN).extra_access
so you need to do
var/datum/job/job = getjob blabla and then do job.position = 1234

i am outside. sorry for poor review

Copy link
Contributor

@Rukofamicom Rukofamicom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latejoin cyborgs resolved

@EvilDragonfiend
Copy link
Member

EvilDragonfiend commented Aug 22, 2024

okay, I concluded it might not be a good idea without a spawner. here's the reason.

posibrains are immobile, and in a worst case, they can't help themselves. They even can be used to trap people from lobby into a kind of contained area (like maint lockers or something), making them ghosting eventually.
So, there should be a kind of some machine that can help to build a borg body automatically through this design suggestion:

  • Cyborg Maker
    • a new machine that's used to build a corg body automatically.
    • accepts items: all cyborg building materials, and a positronic brain
    • with enough materials to make a borg and a positronic brain, the lobby will tell which role they can take.
    • trying the job will take you into the brain in the maker machine...
      • The machine will tell an active positronic brain is available to radio/nearby
      • it will give you a borg body in 2 minutes.
      • Anyone can take off your positronic brain before the building is fully finished, then you'll need to get a borg body manually by someone.

pros of this idea: this can be built on non-station areas. Posibrain roles will not be only restricted to station area on lobby.

sorry for saying this with the long days taken 💀

@Programs-The-Station
Copy link
Contributor Author

okay, I concluded it might not be a good idea without a spawner. here's the reason.

posibrains are immobile, and in a worst case, they can't help themselves. They even can be used to trap people from lobby into a kind of contained area (like maint lockers or something), making them ghosting eventually. So, there should be a kind of some machine that can help to build a borg body automatically through this design suggestion:

* **Cyborg Maker**
  
  * a new machine that's used to build a corg body _automatically_.
  * accepts items: all cyborg building materials, and a positronic brain
  * with enough materials to make a borg and a positronic brain, the lobby will tell which role they can take.
  * trying the job will take you into the brain in the maker machine...
    
    * The machine will tell an active positronic brain is available to radio/nearby
    * it will give you a borg body in 2 minutes.
    * Anyone can take off your positronic brain before the building is fully finished, then you'll need to get a borg body manually by someone.

pros of this idea: this can be built on non-station areas. Posibrain roles will not be only restricted to station area on lobby.

sorry for saying this with the long days taken 💀

No worries. I figured that might be the answer. I'm not going to continue on with this PR. Someone else can recoup it, but the pinned issue should be updated.

@PowerfulBacon
Copy link
Member

PowerfulBacon commented Aug 22, 2024

That doesn't matter, positronics can only be crafted by robotics. A cyborg maker is far out of scope and not necessary for this idea, which is fine as is.

@EvilDragonfiend
Copy link
Member

EvilDragonfiend commented Aug 22, 2024

That doesn't matter, positronics can only be crafted by robotics. A cyborg maker is far out of scope and not necessary for this idea, which is fine as is.

I believe any new player getting in a trouble in this edge case wouldn't be anything ideal, when especially there's no one robotics for an example even if there's no malicious intent.

@Programs-The-Station
Copy link
Contributor Author

I mean, I'll reopen it if this is still desired as it is in this form. I'm not going to add an entire machine though.

@EvilDragonfiend
Copy link
Member

EvilDragonfiend commented Aug 23, 2024

I mean, I'll reopen it if this is still desired as it is in this form. I'm not going to add an entire machine though.

The machine is an idea to prevent that entrapment case as an example, not demanding it here. We can discuss how we can make this not abusable against players from lobby. I had to elaborate my statement.

@Programs-The-Station
Copy link
Contributor Author

Alright, in that case, I'll open it back up.

@Programs-The-Station
Copy link
Contributor Author

Just to make sure, at this point, as far as I am aware, I am waiting for review. I've made the requested changes that I believe make sense.

Is this just waiting on maints for final review and approval then?

Copy link
Member

@EvilDragonfiend EvilDragonfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks alright anyway

code/modules/mob/living/brain/posibrain.dm Outdated Show resolved Hide resolved
code/modules/mob/living/brain/posibrain.dm Outdated Show resolved Hide resolved
@PowerfulBacon
Copy link
Member

Any maint please feel free to dismiss my review and merge when addressed

Copy link
Member

@EvilDragonfiend EvilDragonfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think the posibrain job should be in job datum directory... I forgot to address that.

Any maint please feel free to dismiss my review and merge when addressed

same here

@MarkusLarsson421
Copy link
Contributor

MarkusLarsson421 commented Aug 26, 2024

I am a bit late with this, but wouldn't it just be easier to add Cyborgs to be ghost controllable? Just give the station one of these randomly spawned somewhere and found via the ghost menu and let them take it like they are taking an Exploration VIP or a Lavaland Beach Bartender,

@Programs-The-Station
Copy link
Contributor Author

Programs-The-Station commented Aug 27, 2024

Thanks, Ruko!

MOST comments resolved. Posibrain job now in own datum, returns null instead of false, equip failing is working still in process now fixed.

Do NOT Merge

@Programs-The-Station
Copy link
Contributor Author

Alright. Turns out the equip function natively returns null if no mob transformations occur (like AI/Cyborg/Posibrain), and return a mob if the creature was transformed.

Thus, with the first version of code, a null spawn (like Captain) would kick the user directly back to the lobby, preventing anyone from spawning.

The new and improved version returns FALSE on a failed equip (which already was a thing, see the third line of equip, if(!h) return FALSE.)

This sets me up to compare the return to see if the result is not a mob AND not null, indicating failure, and the game should kick the player back to the lobby.

Good for a final review and merge.

@Rukofamicom Rukofamicom dismissed stale reviews from EvilDragonfiend and PowerfulBacon September 4, 2024 02:00

addressed

@Rukofamicom Rukofamicom added this pull request to the merge queue Sep 4, 2024
Merged via the queue into BeeStation:master with commit 85e0a61 Sep 4, 2024
8 checks passed
@Programs-The-Station Programs-The-Station deleted the posi_on_joinmenu branch September 6, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants