-
-
Notifications
You must be signed in to change notification settings - Fork 683
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
Refactors secbot code, cleans up bot code in general. Centralizes defines #8492
Conversation
Check yourself. |
Please do not introduce spelling mistakes into code just because someone in a place outside of Bee made the same spelling mistake. Fix your PR |
Making an issue worse is not justification for making the change. But yes I will stop here. It's something for maints to decide whether it is a frivolous and unnecessary change, not me ultimately |
Since this is ED related.. could i request an update on the recipe on the "crafting menu" section of EDs? Because a lot of new(and some veterans) Roboticists guide themselves by the items required on crafting menu and they go "uhh we need dragnets" or just fail to make them because the recipe is outdated, we currently use the building method shown in the Wiki of Roboticists(and i prefer that one tbh) |
Yes, that is fixed in this PR. Okay, so for building stuff, thing are separated into recipes (seen in crafting menu), and build steps (like adding a cyborg arm to a medkit will make it an unfinished medborg) Basically, someone changed the building steps of making ED-209s to disabler, but didn't change the recipe. This didn't make sense to me so I changed it both to disabler, which was what Ivan was calling an "undocumented change" above. I saw the difference when I was gutting laser tag beams from the ed209.dmm, and just went ahead and made them congruent |
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.
Even though I agree that the Americans are wrong and couldn't spell hard words, changing variable names and proc names is frowned upon with no good reason either way, since it makes for hassles regarding conflicts and porting. If it's in the code, there is no reason to correct spelling mistakes really, as long as the name is sensible and the point is given.
Done |
judgement does in fact have an E. are you using incorrect (british) spelling? ||(yes, I am aware that judgement is actually the british spelling of the word)|| |
did you get ED-209 sprite fixed? |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Remove the snowflake code that you added for bluespace cells, it should accept all types of power cells for the sake of consistency. You can add code that adjusts the bot based on cell type, but you can't blacklist a single type of cell just because. Update PR body and CL as well. |
Yeah, I did it just because. My thoughts exactly. |
var/cell_type = /obj/item/stock_parts/cell | ||
var/vest_type = /obj/item/clothing/suit/armor/vest |
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 did these just get removed instead of storing what was used to make the bot? The components used in construction should be stored so they can be dropped via drop_part()
when the bot is destroyed.
I'd recommend storing them in a list rather than individual variables though if you were trying to keep it clean, I touch more on this later in the explode() proc review.
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.
handled for now. Can confirm they drop during /explode()
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.
This is not handled, the variables are still removed instead of keeping the items stored for dropping later.
Again, a list is the easiest way to do this.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Damn |
Im gonna remove those weirdass nullcrate-specific Grievous' too, since for some reason they were left in after Nullcrates were removed |
It's in testing evidence. Updated when I marked the PR as ready.
Of which the number for the define ASSEMBLY_NINTH_STEP is 8. It is in the correct order. |
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.
This is all I can get to right now, but I want to clarify what I'm asking for probably can't be resolved by porting. You're going to have to adapt the port sometimes instead of doing it 1:1
Adding the second port on top only made this more complicated without addressing two of the three things I requested.
#define ASSEMBLY_SIXTH_STEP 5 | ||
#define ASSEMBLY_SEVENTH_STEP 6 | ||
#define ASSEMBLY_EIGHTH_STEP 7 | ||
#define ASSEMBLY_NINTH_STEP 8 |
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.
Add another one and replace the `if(9) with it.
///Alert when a new Cyborg is created. | ||
#define NEW_BORG 1 | ||
///Alert when a Cyborg selects a model. | ||
#define NEW_MODULE 2 | ||
///Alert when a Cyborg changes their name. | ||
#define RENAME 3 | ||
///Alert when an AI disconnects themselves from their shell. | ||
#define AI_SHELL 4 | ||
///Alert when a Cyborg gets disconnected from their AI. | ||
#define DISCONNECT 5 |
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.
Aren't these deprecated now?
var/judgement_criteria = judgement_criteria() | ||
for (var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal | ||
if((C.stat) || (C.handcuffed)) | ||
continue | ||
|
||
if((C.name == oldtarget_name) && (world.time < last_found + 100)) | ||
continue | ||
|
||
threatlevel = C.assess_threat(judgment_criteria, weaponcheck=CALLBACK(src, PROC_REF(check_for_weapons))) | ||
threatlevel = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, PROC_REF(check_for_weapons))) |
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.
Do I really need to dig up the last conversation about trying to "fix" the spelling of words that are different between british and american English?
var/cell_type = /obj/item/stock_parts/cell | ||
var/vest_type = /obj/item/clothing/suit/armor/vest |
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.
This is not handled, the variables are still removed instead of keeping the items stored for dropping later.
Again, a list is the easiest way to do this.
if(bot_type == ADVANCED_SEC_BOT) | ||
var/obj/item/bot_assembly/ed209/ed_assembly = new(Tsec) | ||
ed_assembly.build_step = ASSEMBLY_FIRST_STEP | ||
ed_assembly.add_overlay("hs_hole") | ||
ed_assembly.created_name = name | ||
new /obj/item/assembly/prox_sensor(Tsec) | ||
var/obj/item/gun/energy/disabler/disabler_gun = new(Tsec) | ||
disabler_gun.cell.charge = 0 | ||
disabler_gun.update_appearance() | ||
if(prob(50)) | ||
new /obj/item/bodypart/l_leg/robot(Tsec) | ||
if(prob(25)) | ||
new /obj/item/bodypart/r_leg/robot(Tsec) | ||
if(prob(25))//50% chance for a helmet OR vest | ||
if(prob(50)) | ||
new /obj/item/clothing/head/helmet(Tsec) | ||
else | ||
new /obj/item/clothing/suit/armor/vest(Tsec) | ||
else | ||
var/obj/item/bot_assembly/secbot/secbot_assembly = new(Tsec) | ||
secbot_assembly.build_step = ASSEMBLY_FIRST_STEP | ||
secbot_assembly.add_overlay("hs_hole") | ||
secbot_assembly.created_name = name | ||
new /obj/item/assembly/prox_sensor(Tsec) |
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.
Right now this proc is exactly like the code you're aiming to fix with this PR, and I question why code very specific to ED209, not potential future ranged bots, is being defined in the parent type.
If component parts are stored in a list, most of this proc could be simplified to this to make it drop an assortment of random parts
for(var/obj/item/I in component_parts)
if(prob(50))
drop_part(I, loc)
And this also future-proofs it against later bots.
Alright, I think ive cleaned it to a reasonable degree that the ranged var is no longer an issue.
Er.. no this looks almost exactly like it did before, the ranged variable wasn't the issue and you're still effectively using it with a define anyway. You're hard-spawning items that may have nothing to do with what was used in the construction of the ED209. Use a list or use the variables you removed at bare minimum.
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.
Might be an idea to have a unit test which constructs an EDD from a non-standard vest type, explodes it and then confirms that the correct construction types are being dropped.
Ports:
About The Pull Request
Okay, so right now the ED-209 is basically just copy-paste of securitron code, which is really unecessary in the grand scheme of things. This makes ED-209s a child of securitrons, so you can just call /secbot/ instead of both.
Some other stuff:
PR 2
Additionally:
Why It's Good For The Game
Less shitcode is goodcode.
Following this PR will be a floorbot cleanup, then we can finally TGUI these fucking things
Testing Photographs and Procedure
Screenshots&Videos
Grievous works.
dreamseeker_WN3ETaooeg.mp4
All secbots properly share the same behavior and take me out. Sergeant-At-Armsky starts on the Detain setting, so he babysits me.
dreamseeker_CQxKzUaf5K.mp4
Changelog
🆑 RKz, Fikou, JohnFulpWillard
remove: ED-209 lasertag functionality (it was never implemented and no one was ever gonna make one if I made it functional IC)
fix: ED-209 aim isn't as broken, it shouldn't be harder to shoot a stationary target laying down when it can hit a moving target running down the hall
fix: fixed a few misc errors in ED-209 code
refactor: ED-209s are children of secbots now. Beepsky finally got his kids from the divorce.
code: Centralizes all bot defines.
refactor: Turns Sergeant-At-Armsky into his own subtype, rather than a mapedit on every map...
refactor: refactors most bot checks into flags
remove: Removes nullcrate variant of Secbot Grievous, as nullcrates havent existed in over two years...
/:cl: