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

Starts refactoring Xenomorph.dm and other xenocode. #4941

Closed
wants to merge 18 commits into from

Conversation

Birdtalon
Copy link
Contributor

@Birdtalon Birdtalon commented Nov 16, 2023

About the pull request

This PR attempts to begin refactoring parts of Xenocode. It's all over the place and I had to start somewhere. Starting to forget what I've done so far and this is getting quite big. So this is mainly to keep track of things as my memory is that of a goldfish 🐟

File Structure:

  • Moves /datum/caste_datum and associated code out of xeno_defines.dm into caste_datum.dm (new)
  • xeno_defines.dm now lives in ./__DEFINES
  • /datum/hive_status now lives in hive_status.dm (new)
  • /datum/hive_status_ui moved form hive_status.dm lives in hive_status_ui.dm
  • /datum/xeno_mark_define moved to xeno_marks.dm (new)
  • Client procs for getting playtime now moved to xeno_client_procs.dm

Code:

  • Refactors set_hive_and_update(), moves istype(src) to the subclasses for larva and queen
  • Refactors xeno numbering, all xeno hives now number 1-999 independently and pick from a list instead of generating rand every time and iterating over GLOB.all_xenos every time.
  • Removes unneeded istype(src) in /mob/living/carbon/xenomorph/larva/update_icons() we already have state_overide here for this reason.
  • Refactors larva name generation out of update_icons() and into its own generate_name()
  • All xenomorph naming is handled by calling generate_name() Removed handle_name() and moved everything to generate_name()
  • Calling generate_name() to change from "Bloody larva" to "mature" is now in ...larva/Life() instead of in update_icons() since update_icons() was called on every Life() tick anyway.
  • Refactors /mob/living/carbon/xenomorph/Initialize() removes a few duplicate proc calls, generate_name() called twice, recalculate_actions() called twice etc.
  • Adds silly name decorator if a Xeno number is 666
  • Replaces single letter vars in hive_status.dm

Explain why it's good for the game

Testing Photographs and Procedure

Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

🆑
code: Starts refactoring, standardising and cleaning Xenomorph.dm and hive_status.
add: Little easter egg for 666 xeno number.
/:cl:

@Birdtalon Birdtalon changed the title Xenohell Starts refactoring Xenomorph.dm and other xenocode. Nov 16, 2023
@cm13-github cm13-github added the Merge Conflict PR can't be merged because it touched too much code label Nov 17, 2023
@cm13-github
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@cm13-github cm13-github removed the Merge Conflict PR can't be merged because it touched too much code label Nov 18, 2023
@cm13-github
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@Birdtalon
Copy link
Contributor Author

This is going to be a nightmare to review I should have saved the file structure changes to a different PR but didn't think at the time. Frustration at xeno_defines.dm not being for xeno defines got to me 😢

@Birdtalon Birdtalon marked this pull request as ready for review November 18, 2023 13:38
@Birdtalon
Copy link
Contributor Author

I am going to split this into atomic PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants