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

Modular firearms - MFCS #186

Open
wants to merge 108 commits into
base: A-Dev
Choose a base branch
from
Open

Modular firearms - MFCS #186

wants to merge 108 commits into from

Conversation

BlueNexus
Copy link
Collaborator

//THIS IS HEAVILY WORK IN PROGRESS//

The MFCS allows players to construct and disassemble firearms using a wide variety of components, allowing the player to customise recoil, accuracy, projectile type, fire rate and mode, projectile speed, loading method and more. All firearms in the game will be replaced with these modular variants. MFCS Firearms may be constructed by R&D or anybody who gets a hold of the parts, however the final part will come in a lock box, to prevent them being made and used for grief. This will hopefully give research something interesting to do, and will add a lot of depth to the firearms in the game. Keep in mind, this project is massively work in progress. Feedback would be appreciated, however.

Current build - 215


/obj/item/weapon/modular_firearms/assembly/proc/process_part(obj/item/I as obj, mob/user as mob) //this should handle processing new parts in the weapon, without relying on the weapon actually being attacked.
if(istype(I, /obj/item/weapon/modular_firearms/chassis))
if(istype(I, /obj/item/weapon/modular_firearms/chassis/energy))

Choose a reason for hiding this comment

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

Checking mutually exclusive types repeatedly again.

@MistakeNot4892
Copy link

Cirra asked me for critique, ftr, this isn't me randomly deciding to talk shit on another codebase's PRs.

A lot of the code here seems bloated or redundant, I feel like you could make good use of associative lists for all the various kinetic/ballistic/etc checks rather than having so much boilerplate for each individual var.

/obj/item/weapon/modular_firearms/assembly/proc/compile(mob/user as mob)
var/type = null
if(src.isKinetic)
var/new/obj/item/weapon/gun/MFCS/projectile/P as obj

Choose a reason for hiding this comment

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

'as obj' is deprecated.

Should stop it being checked again and again in the code. Thanks Zuhayr.
Credit to Zuhayr. Let's see if I did this correctly.
Credit for lines 119 to 124 to @zuhayr
Once again, credit to @zuhayr. I learned a little bit from this one, so this should help in the future.
Beginning the process of replacing all standard firearms with MFCS firearms.
Will handle larger weapons.
Sprite overrides are now handled, max_shells is no longer overriden for existing weapons, and "mastertypes" have been implemented.
Added compilesprite defining to new() and recompile()
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.

2 participants