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

Gunsmithing! #2664

Closed
wants to merge 66 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
46e4dce
a thing
FalloutFalcon Nov 22, 2023
55d0b19
kinda workin
FalloutFalcon Nov 22, 2023
809d204
this uhh is not working. gonna rework this all
FalloutFalcon Nov 22, 2023
c4906ac
Improves deconstruction functionality to lathe
FalloutFalcon Nov 22, 2023
b1c734e
new options? half working
FalloutFalcon Nov 22, 2023
3bbba1f
might try to port some eris stuff (foolish)
FalloutFalcon Nov 23, 2023
39679d8
gun parts
FalloutFalcon Nov 23, 2023
d3155d0
"works" dont like how this is handled
FalloutFalcon Nov 25, 2023
5bbc36a
we getting there
FalloutFalcon Nov 25, 2023
db2edc3
grip dont control gun and seperate files
FalloutFalcon Nov 25, 2023
de7c2b5
shrug
FalloutFalcon Nov 25, 2023
22de36f
scrap blueprint system
FalloutFalcon Jan 19, 2024
8f28e6b
frames on gun init
FalloutFalcon Jan 20, 2024
976ae14
dynamicly generate the parts
FalloutFalcon Jan 22, 2024
04982c4
yea
FalloutFalcon Jan 24, 2024
08df15f
yea
FalloutFalcon Jan 24, 2024
8cc5bfe
aaa
FalloutFalcon Jan 24, 2024
5304d07
wow it just works!!
FalloutFalcon Jan 25, 2024
182551f
bitflags soon
FalloutFalcon Jan 25, 2024
ad28497
ye
FalloutFalcon Jan 26, 2024
8a870e0
yea
FalloutFalcon Jan 26, 2024
a5dc317
commit to recipes
FalloutFalcon Jan 31, 2024
98b5d80
yea
FalloutFalcon Jan 31, 2024
8c1b7c5
Refactor gun crafting module and add new tools
FalloutFalcon Jan 31, 2024
2959730
poorly optimized holy dang
FalloutFalcon Jan 31, 2024
93f1813
yea
FalloutFalcon Jan 31, 2024
2bf0717
evil tbh
FalloutFalcon Jan 31, 2024
f08b4bb
ye
FalloutFalcon Jan 31, 2024
4420698
kinda working i think?
FalloutFalcon Jan 31, 2024
f4c2581
unit test?
FalloutFalcon Jan 31, 2024
3a2863c
yea
FalloutFalcon Jan 31, 2024
d4762b3
hard to tell if parts are reinstalled without any
FalloutFalcon Jan 31, 2024
f80aad3
what if wrong?
FalloutFalcon Jan 31, 2024
026d860
TEST
FalloutFalcon Jan 31, 2024
7503789
bleh
FalloutFalcon Feb 1, 2024
b05cf87
no bitflags
FalloutFalcon Feb 1, 2024
2aec984
shrug
FalloutFalcon Feb 1, 2024
52e6d39
Merge branch 'guncrafting' of https://github.com/FalloutFalcon/Shipte…
FalloutFalcon Feb 2, 2024
281debc
yea
FalloutFalcon Feb 2, 2024
0eee121
yea
FalloutFalcon Feb 2, 2024
c52fb7f
wooo so much stuff..
FalloutFalcon Feb 4, 2024
3c9125d
much clearer
FalloutFalcon Feb 4, 2024
e814742
oops all camelCase
FalloutFalcon Feb 5, 2024
422ddb1
see how this goes
FalloutFalcon Feb 5, 2024
67db4f3
Merge branch 'master' into guncrafting
FalloutFalcon Feb 5, 2024
0ffb50f
ballistic
FalloutFalcon Feb 5, 2024
e54f627
cruft guns
FalloutFalcon Feb 5, 2024
48deb25
Merge branch 'master' of https://github.com/shiptest-ss13/Shiptest in…
FalloutFalcon Feb 5, 2024
8e1c8d2
Merge branch 'master' into guncrafting
FalloutFalcon Feb 5, 2024
4756438
hm
FalloutFalcon Feb 5, 2024
a049ff9
oh the paths changed alot?
FalloutFalcon Feb 5, 2024
54ec418
yea
FalloutFalcon Feb 5, 2024
f6af122
candor
FalloutFalcon Feb 5, 2024
ed83234
Merge remote-tracking branch 'upstream/master' into guncrafting
FalloutFalcon Feb 24, 2024
a4604f4
ya
FalloutFalcon Feb 29, 2024
e735f97
i dunno
FalloutFalcon Mar 5, 2024
f345d44
yea
FalloutFalcon Mar 9, 2024
8506478
culling to pistols and revvys and reduces gun part quanity from crate
FalloutFalcon Mar 21, 2024
9e22fae
augh
FalloutFalcon Mar 21, 2024
44e83b3
Merge remote-tracking branch 'Shiptest/master' into guncrafting
FalloutFalcon Mar 21, 2024
91e07f2
unit unit
FalloutFalcon Apr 2, 2024
4dd50c8
Merge remote-tracking branch 'Shiptest/master' into guncrafting
FalloutFalcon Apr 2, 2024
1fe0695
soft port of CEV-eris tool system
FalloutFalcon Apr 2, 2024
1cba2a0
stuff
FalloutFalcon Apr 2, 2024
d0f6552
yea
FalloutFalcon Apr 2, 2024
ecfdd90
pass mabye
FalloutFalcon Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code/__DEFINES/gun_crafting.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define GUN_PART_FRAME "frame"
#define GUN_PART_BARREL "barrel"
#define GUN_PART_GRIP "grip"
#define GUN_PART_MECHANISM "mechanism"
25 changes: 0 additions & 25 deletions code/__DEFINES/tools.dm

This file was deleted.

97 changes: 97 additions & 0 deletions code/__DEFINES/tools_and_qualities.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// Tool types
#define TOOL_CROWBAR "crowbar"
#define TOOL_MULTITOOL "multitool"
#define TOOL_SCREWDRIVER "screwdriver"
#define TOOL_WIRECUTTER "wirecutter"
#define TOOL_WRENCH "wrench"
#define TOOL_WELDER "welder"
#define TOOL_ANALYZER "analyzer"
#define TOOL_MINING "mining"
#define TOOL_SHOVEL "shovel"
#define TOOL_RETRACTOR "retractor"
#define TOOL_HEMOSTAT "hemostat"
#define TOOL_CAUTERY "cautery"
#define TOOL_DRILL "drill"
#define TOOL_SCALPEL "scalpel"
#define TOOL_SAW "saw"

///////////////
// ERIS PORT //
///////////////

// If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY,
// tool sound is only played when op is started. If not, it's played twice.
#define MIN_TOOL_SOUND_DELAY 20

/// When a tooltype_act proc is successful
#define TOOL_ACT_TOOLTYPE_SUCCESS (1<<0)
/// When [COMSIG_ATOM_TOOL_ACT] blocks the act
#define TOOL_ACT_SIGNAL_BLOCKING (1<<1)

#define ABORT_CHECK -1
#define TOOL_USE_FAIL -1
#define TOOL_USE_CANCEL 0
#define TOOL_USE_SUCCESS 1

#define QUALITY_BOLT_TURNING "bolt turning"
#define QUALITY_PULSING "pulsing"
#define QUALITY_PRYING "prying"
#define QUALITY_WELDING "welding"
#define QUALITY_SCREW_DRIVING "screw driving"
#define QUALITY_WIRE_CUTTING "wire cutting"
#define QUALITY_CLAMPING "clamping"
#define QUALITY_CAUTERIZING "cauterizing"
#define QUALITY_RETRACTING "retracting"
#define QUALITY_DRILLING "drilling"
#define QUALITY_HAMMERING "hammering"
#define QUALITY_SAWING "sawing"
#define QUALITY_BONE_SETTING "bone setting"
#define QUALITY_SHOVELING "shoveling"
#define QUALITY_DIGGING "digging"
#define QUALITY_EXCAVATION "excavation"
#define QUALITY_CUTTING "cutting"
#define QUALITY_LASER_CUTTING "laser cutting" //laser scalpels and e-swords - bloodless cutting
#define QUALITY_ADHESIVE "adhesive"
#define QUALITY_SEALING "sealing"
#define QUALITY_FILING "filing"

//Time for a work for tool system calculated in that way: basic time - tool level - stat check..
//It means that basic tools will give -30 on time, and people on right job should have -20 at least, or even more.
#define WORKTIME_INSTANT 0
#define WORKTIME_NEAR_INSTANT 30
#define WORKTIME_FAST 60
#define WORKTIME_NORMAL 90
#define WORKTIME_SLOW 120
#define WORKTIME_LONG 170
#define WORKTIME_EXTREMELY_LONG 250

//Fail chance for tool system calculated in that way: basic chance - tool level - stat check.
//Basic tools will give -30% on fail chance, and people on right job should have -20% at least.
#define FAILCHANCE_ZERO 0
#define FAILCHANCE_VERY_EASY 30
#define FAILCHANCE_EASY 50
#define FAILCHANCE_NORMAL 60
#define FAILCHANCE_HARD 80
#define FAILCHANCE_CHALLENGING 90
#define FAILCHANCE_VERY_HARD 120
#define FAILCHANCE_IMPOSSIBLE 150

//Sounds for working with tools
#define NO_WORKSOUND -1

#define WORKSOUND_CIRCULAR_SAW 'sound/weapons/circsawhit.ogg'
#define WORKSOUND_SIMPLE_SAW 'sound/items/saw.ogg'
#define WORKSOUND_WRENCHING 'sound/items/Ratchet.ogg'
#define WORKSOUND_WIRECUTTING 'sound/items/Wirecutter.ogg'
#define WORKSOUND_WELDING "weld"
#define WORKSOUND_PULSING 'sound/items/multitool_pulse.ogg'
#define WORKSOUND_SCREW_DRIVING 'sound/items/Screwdriver.ogg'
#define WORKSOUND_EASY_CROWBAR 'sound/items/Crowbar.ogg'
#define WORKSOUND_HAMMER 'sound/items/hammer.ogg'
#define WORKSOUND_REMOVING 'sound/items/Deconstruct.ogg'
#define WORKSOUND_DRIVER_TOOL 'sound/items/e_screwdriver.ogg'
#define WORKSOUND_PICKAXE 'sound/items/pickaxe.ogg'
#define WORKSOUND_HARD_SLASH 'sound/weapons/bladeslice.ogg'
#define WORKSOUND_CHAINSAW 'sound/items/chainsaw.ogg'
#define WORKSOUND_TAPE 'sound/items/duct_tape.ogg'
#define WORKSOUND_HONK 'sound/items/bikehorn.ogg'
4 changes: 4 additions & 0 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
GLOB.surgeries_list += new path()
sortList(GLOB.surgeries_list, /proc/cmp_typepaths_asc)

for(var/path in subtypesof(/datum/lathe_recipe/gun))
GLOB.gun_recipe_list += new path()
sortList(GLOB.gun_recipe_list, /proc/cmp_typepaths_asc)

// Hair Gradients - Initialise all /datum/sprite_accessory/hair_gradient into an list indexed by gradient-style name
for(var/path in subtypesof(/datum/sprite_accessory/hair_gradient))
var/datum/sprite_accessory/hair_gradient/H = new path()
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/lists/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ GLOBAL_LIST(chemical_reagents_list)
GLOBAL_LIST_EMPTY(materials_list)
/// List of all /datum/tech datums indexed by id.
GLOBAL_LIST_EMPTY(tech_list)
// List of all hand assembled gun recipes.
GLOBAL_LIST_EMPTY(gun_recipe_list)
/// List of all surgeries by name, associated with their path.
GLOBAL_LIST_EMPTY(surgeries_list)
/// List of all table craft recipes
Expand Down
22 changes: 0 additions & 22 deletions code/datums/components/crafting/guncrafting.dm

This file was deleted.

1 change: 1 addition & 0 deletions code/datums/mapgen/planetary/WasteGenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
flora_spawn_list = list( //there are no plants here
/obj/effect/spawner/lootdrop/waste/mechwreck = 200,
/obj/effect/spawner/lootdrop/waste/mechwreck/rare = 50,
/obj/effect/spawner/lootdrop/gun_parts = 500,
/obj/effect/spawner/lootdrop/waste/trash = 900,
/obj/effect/spawner/lootdrop/waste/radiation = 80,
/obj/effect/spawner/lootdrop/waste/radiation/more_rads = 20,
Expand Down
18 changes: 18 additions & 0 deletions code/game/objects/effects/spawners/lootdrop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,24 @@

//wasteplanet things

/obj/effect/spawner/lootdrop/gun_parts
name = "gun parts spawner"
loot = list(
/obj/item/stack/gun_part = 10,
/obj/item/part/gun/modular/grip = 1,
/obj/item/part/gun/modular/grip/wood = 1,
/obj/item/part/gun/modular/grip/black = 1,
/obj/item/part/gun/modular/mechanism = 1,
/obj/item/part/gun/modular/mechanism/revolver = 1,
/obj/item/part/gun/modular/mechanism/pistol = 1,
/obj/item/part/gun/modular/barrel = 1,
/obj/item/part/gun/modular/barrel/revolver = 1,
/obj/item/part/gun/modular/barrel/pistol = 1,
/obj/item/part/gun/frame/revolver = 1,
/obj/item/part/gun/frame/deringer = 1,
/obj/item/part/gun/frame/pistol
)

/obj/effect/spawner/lootdrop/waste/grille_or_trash
name = "wasteplanet loot spawner"
loot = list(
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
///you can see someone's mask through their transparent visor, but you can't reach it
var/transparent_protection = NONE

var/list/tool_qualities// List of item qualities for tools system. See tools_and_qualities.dm.

///flags for what should be done when you click on the item, default is picking it up
var/interaction_flags_item = INTERACT_ITEM_ATTACK_HAND_PICKUP

Expand Down
3 changes: 0 additions & 3 deletions code/game/objects/items/storage/uplink_kits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,6 @@
for(var/i in 1 to 3)
new/obj/item/grenade/chem_grenade/ez_clean(src)

/obj/item/storage/box/hug/reverse_revolver/PopulateContents()
new /obj/item/gun/ballistic/revolver/reverse(src)

/obj/item/storage/box/syndie_kit/mimery/PopulateContents()
new /obj/item/book/granter/spell/mimery_blockade(src)
new /obj/item/book/granter/spell/mimery_guns(src)
Expand Down
33 changes: 33 additions & 0 deletions code/game/objects/items/tools/_tools.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/obj/item/tool
name = "tool"
icon = 'icons/obj/tools.dmi'
slot_flags = ITEM_SLOT_BELT
force = 10
throwforce = 10
w_class = WEIGHT_CLASS_SMALL

/******************************
/* Data and Checking */
*******************************/
/obj/item/proc/has_quality(quality_id)
return !quality_id || (quality_id in tool_qualities)


/obj/item/proc/get_tool_quality(quality_id)
if(tool_qualities && tool_qualities.len)
return tool_qualities[quality_id]
return null

//We are cheking if our item got required qualities. If we require several qualities, and item posses more than one of those, we ask user to choose how that item should be used
/obj/item/proc/get_tool_type(mob/living/user, list/required_qualities, atom/use_on, datum/callback/CB)
if(!tool_qualities) //This is not a tool, or does not have tool qualities
return

var/list/L = required_qualities & tool_qualities

if(L.len)
if(L.len == 1)
return L[1]
for(var/i in L)
L[i] = image(icon = 'icons/mob/radial.dmi', icon_state = i)
return show_radial_menu(user, use_on ? use_on : user, L, tooltips = TRUE, require_near = TRUE, custom_check = CB)
40 changes: 40 additions & 0 deletions code/game/objects/items/tools/simple_tools.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Tools not cool enough for there own file

/obj/item/tool/admin_debug
name = "Electric Boogaloo 3000"
icon_state = "omnitool"
item_state = "omnitool"
tool_qualities = list(QUALITY_BOLT_TURNING = 100,
QUALITY_PRYING = 100,
QUALITY_WELDING = 100,
QUALITY_SCREW_DRIVING = 100,
QUALITY_CLAMPING = 100,
QUALITY_CAUTERIZING = 100,
QUALITY_WIRE_CUTTING = 100,
QUALITY_RETRACTING = 100,
QUALITY_DRILLING = 100,
QUALITY_SAWING = 100,
QUALITY_VEIN_FIXING = 100,
QUALITY_BONE_SETTING = 100,
QUALITY_BONE_FIXING = 100,
QUALITY_SHOVELING = 100,
QUALITY_DIGGING = 100,
QUALITY_EXCAVATION = 100,
QUALITY_CUTTING = 100,
QUALITY_HAMMERING = 100,
QUALITY_FILING = 100)

/obj/item/tool/hammer
name = "ballpin hammer"
icon_state = "oldcrowbar"
tool_qualities = list(QUALITY_HAMMERING = 50)

/obj/item/tool/file
name = "metal file"
icon_state = "oldwrench"
tool_qualities = list(QUALITY_FILING = 50)

/obj/item/tool/saw
name = "rusty hacksaw"
icon_state = "oldcutters_map"
tool_qualities = list(QUALITY_SAWING = 50)
14 changes: 1 addition & 13 deletions code/modules/antagonists/cult/blood_magic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@

/obj/item/melee/blood_magic/manipulator/attack_self(mob/living/user)
if(iscultist(user))
var/list/options = list("Blood Spear (150)", "Blood Bolt Barrage (300)", "Blood Beam (500)")
var/list/options = list("Blood Spear (150)", "Blood Beam (500)")
var/choice = input(user, "Choose a greater blood rite...", "Greater Blood Rites") as null|anything in options
if(!choice)
to_chat(user, "<span class='cultitalic'>You decide against conducting a greater blood rite.</span>")
Expand All @@ -835,18 +835,6 @@
user.visible_message(
"<span class='warning'>A [rite.name] appears at [user]'s feet!</span>", \
"<span class='cultitalic'>A [rite.name] materializes at your feet.</span>")
if("Blood Bolt Barrage (300)")
if(uses < BLOOD_BARRAGE_COST)
to_chat(user, "<span class='cultitalic'>You need [BLOOD_BARRAGE_COST] charges to perform this rite.</span>")
else
var/obj/rite = new /obj/item/gun/ballistic/rifle/illestren/enchanted/arcane_barrage/blood()
uses -= BLOOD_BARRAGE_COST
qdel(src)
if(user.put_in_hands(rite))
to_chat(user, "<span class='cult'><b>Your hands glow with power!</b></span>")
else
to_chat(user, "<span class='cultitalic'>You need a free hand for this rite!</span>")
qdel(rite)
if("Blood Beam (500)")
if(uses < BLOOD_BEAM_COST)
to_chat(user, "<span class='cultitalic'>You need [BLOOD_BEAM_COST] charges to perform this rite.</span>")
Expand Down
41 changes: 0 additions & 41 deletions code/modules/antagonists/cult/cult_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -703,47 +703,6 @@
L.visible_message("<span class='warning'>An unseen force pulls the blood spear from [L]'s hands!</span>")
spear.throw_at(owner, 10, 2, owner)


/obj/item/gun/ballistic/rifle/illestren/enchanted/arcane_barrage/blood
name = "blood bolt barrage"
desc = "Blood for blood."
color = "#ff0000"
guns_left = 24
mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage/blood
fire_sound = 'sound/magic/wand_teleport.ogg'


/obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage/blood
ammo_type = /obj/item/ammo_casing/magic/arcane_barrage/blood

/obj/item/ammo_casing/magic/arcane_barrage/blood
projectile_type = /obj/projectile/magic/arcane_barrage/blood
firing_effect_type = /obj/effect/temp_visual/cult/sparks

/obj/projectile/magic/arcane_barrage/blood
name = "blood bolt"
icon_state = "mini_leaper"
nondirectional_sprite = TRUE
damage_type = BRUTE
impact_effect_type = /obj/effect/temp_visual/dir_setting/bloodsplatter

/obj/projectile/magic/arcane_barrage/blood/Bump(atom/target)
var/turf/T = get_turf(target)
playsound(T, 'sound/effects/splat.ogg', 50, TRUE)
if(iscultist(target))
if(ishuman(target))
var/mob/living/carbon/human/H = target
if(H.stat != DEAD)
H.reagents.add_reagent(/datum/reagent/fuel/unholywater, 4)
if(isshade(target) || isconstruct(target))
var/mob/living/simple_animal/M = target
if(M.health+5 < M.maxHealth)
M.adjustHealth(-5)
new /obj/effect/temp_visual/cult/sparks(T)
qdel(src)
else
..()

/obj/item/blood_beam
name = "\improper magical aura"
desc = "Sinister looking aura that distorts the flow of reality around it."
Expand Down
12 changes: 0 additions & 12 deletions code/modules/antagonists/wizard/equipment/spellbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,6 @@
. = ..()
REMOVE_TRAIT(user, TRAIT_TESLA_SHOCKIMMUNE, "lightning_bolt_spell")

/datum/spellbook_entry/infinite_guns
name = "Lesser Summon Guns"
spell_type = /obj/effect/proc_holder/spell/targeted/infinite_guns/gun
cost = 3
no_coexistance_typecache = /obj/effect/proc_holder/spell/targeted/infinite_guns/arcane_barrage

/datum/spellbook_entry/arcane_barrage
name = "Arcane Barrage"
spell_type = /obj/effect/proc_holder/spell/targeted/infinite_guns/arcane_barrage
cost = 3
no_coexistance_typecache = /obj/effect/proc_holder/spell/targeted/infinite_guns/gun

/datum/spellbook_entry/barnyard
name = "Barnyard Curse"
spell_type = /obj/effect/proc_holder/spell/pointed/barnyardcurse
Expand Down
Loading
Loading