From 41b490010c73d340710a00a4ea09afdcff61b354 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 1 Sep 2015 17:52:10 +0100 Subject: [PATCH 001/107] Added the framework files for components --- code/modules/projectiles/guns/modular/components/barrel.dm | 2 ++ code/modules/projectiles/guns/modular/components/chamber.dm | 3 +++ code/modules/projectiles/guns/modular/components/chassis.dm | 2 ++ code/modules/projectiles/guns/modular/components/driver.dm | 1 + code/modules/projectiles/guns/modular/components/frame.dm | 2 ++ code/modules/projectiles/guns/modular/components/loader.dm | 0 code/modules/projectiles/guns/modular/components/lockpin.dm | 2 ++ code/modules/projectiles/guns/modular/components/misc.dm | 0 code/modules/projectiles/guns/modular/components/sight.dm | 0 code/modules/projectiles/guns/modular/components/stock.dm | 0 10 files changed, 12 insertions(+) create mode 100644 code/modules/projectiles/guns/modular/components/barrel.dm create mode 100644 code/modules/projectiles/guns/modular/components/chamber.dm create mode 100644 code/modules/projectiles/guns/modular/components/chassis.dm create mode 100644 code/modules/projectiles/guns/modular/components/driver.dm create mode 100644 code/modules/projectiles/guns/modular/components/frame.dm create mode 100644 code/modules/projectiles/guns/modular/components/loader.dm create mode 100644 code/modules/projectiles/guns/modular/components/lockpin.dm create mode 100644 code/modules/projectiles/guns/modular/components/misc.dm create mode 100644 code/modules/projectiles/guns/modular/components/sight.dm create mode 100644 code/modules/projectiles/guns/modular/components/stock.dm diff --git a/code/modules/projectiles/guns/modular/components/barrel.dm b/code/modules/projectiles/guns/modular/components/barrel.dm new file mode 100644 index 0000000000000..99274dc1632fb --- /dev/null +++ b/code/modules/projectiles/guns/modular/components/barrel.dm @@ -0,0 +1,2 @@ +//Barrels define the range of the weapon, as well as affecting their accuracy. +//For energy weapons, this refers to focusing chambers. \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/chamber.dm b/code/modules/projectiles/guns/modular/components/chamber.dm new file mode 100644 index 0000000000000..111c1493d2039 --- /dev/null +++ b/code/modules/projectiles/guns/modular/components/chamber.dm @@ -0,0 +1,3 @@ +//The chamber decides what type of projectile the gun fires. +//For ballistic, there will be a chamber for each bullet type, along with cartridges and shotgun shells +//For energy, it will include each type of beam, excluding pulse weaponry. Heavy lasers may only be made with a heavy frame \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/chassis.dm b/code/modules/projectiles/guns/modular/components/chassis.dm new file mode 100644 index 0000000000000..933cc106df495 --- /dev/null +++ b/code/modules/projectiles/guns/modular/components/chassis.dm @@ -0,0 +1,2 @@ +//The chassis is basically the actual framework of the gun, and decides what type of weapon it will be. +//Options are ballistic and energy, for the moment \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/driver.dm b/code/modules/projectiles/guns/modular/components/driver.dm new file mode 100644 index 0000000000000..0374dee77ce7e --- /dev/null +++ b/code/modules/projectiles/guns/modular/components/driver.dm @@ -0,0 +1 @@ +//Drivers affect how the gun fires. Does it use burst fire? Automatic? Semi? Charge? \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/frame.dm b/code/modules/projectiles/guns/modular/components/frame.dm new file mode 100644 index 0000000000000..78b8122a8db6a --- /dev/null +++ b/code/modules/projectiles/guns/modular/components/frame.dm @@ -0,0 +1,2 @@ +//Frames are the starting blocks of the weapon. The type of frame decides how large a weapon you can build. +//In general, weight affects the size and weight (slow to use, bulky, etc) of the weapon \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/code/modules/projectiles/guns/modular/components/lockpin.dm b/code/modules/projectiles/guns/modular/components/lockpin.dm new file mode 100644 index 0000000000000..6c2e0882ffd8a --- /dev/null +++ b/code/modules/projectiles/guns/modular/components/lockpin.dm @@ -0,0 +1,2 @@ +//This is a special little pin that you have to get either from a lockbox in R&D or from security +//Without this, the gun won't work. it's basically to stop people making guns and going on a rampage. \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/misc.dm b/code/modules/projectiles/guns/modular/components/misc.dm new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/code/modules/projectiles/guns/modular/components/sight.dm b/code/modules/projectiles/guns/modular/components/sight.dm new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/code/modules/projectiles/guns/modular/components/stock.dm b/code/modules/projectiles/guns/modular/components/stock.dm new file mode 100644 index 0000000000000..e69de29bb2d1d From d30ca1747f3701939e6a1d88b97f1da96954764a Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 1 Sep 2015 19:53:52 +0100 Subject: [PATCH 002/107] Added the different chambers --- .../guns/modular/components/chamber.dm | 107 +++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/components/chamber.dm b/code/modules/projectiles/guns/modular/components/chamber.dm index 111c1493d2039..cbd0081051d00 100644 --- a/code/modules/projectiles/guns/modular/components/chamber.dm +++ b/code/modules/projectiles/guns/modular/components/chamber.dm @@ -1,3 +1,108 @@ //The chamber decides what type of projectile the gun fires. //For ballistic, there will be a chamber for each bullet type, along with cartridges and shotgun shells -//For energy, it will include each type of beam, excluding pulse weaponry. Heavy lasers may only be made with a heavy frame \ No newline at end of file +//For energy, it will include each type of beam, excluding pulse weaponry. Heavy lasers may only be made with a heavy frame + +obj/item/weapon/modular_firearms/chamber + var/list/allowed_projectiles = list() + var/projectile_type = null + +obj/item/weapon/modular_firearms/chamber/a357 + name = "heavy-pistol chamber" + desc = "Compatible with .357 and .50 ammunition." + allowed_projectiles = list(/obj/item/projectile/bullet/pistol/strong) + +obj/item/weapon/modular_firearms/chamber/a75 + name = "gyrojet chamber" + desc = "Compatible with .75 ammunition." + allowed_projectiles = list(/obj/item/projectile/bullet/gyro) + +obj/item/weapon/modular_firearms/chamber/c9mm + name = "standard pistol chamber" + desc = "Compatible with .38 and 9mm ammunition." + allowed_projectiles = list(/obj/item/projectile/energy/flash/flare, /obj/item/projectile/bullet/pistol, /obj/item/projectile/energy/flash, /obj/item/projectile/bullet/pistol/rubber, /obj/item/projectile/bullet/pistol/practice) + +obj/item/weapon/modular_firearms/chamber/c45 + name = "medium-pistol chamber" + desc = "Compatible with .45 and 12mm ammunition." + allowed_projectiles = list(/obj/item/projectile/bullet/pistol/medium) + +obj/item/weapon/modular_firearms/chamber/shotgun + name = "shotgun chamber" + desc = "Compatible with all shotgun-grade ammunition." + allowed_projectiles = list(/obj/item/projectile/energy/flash/flare, /obj/item/projectile/bullet/shotgun, /obj/item/projectile/bullet/pellet/shotgun, /obj/item/projectile/bullet/blank, /obj/item/projectile/bullet/shotgun/practice, /obj/item/projectile/bullet/shotgun/beanbag) + +obj/item/weapon/modular_firearms/chamber/stunshell + name = "taser cartridge system" + desc = "Compatible with Taser cartridges." + allowed_projectiles = list(/obj/item/projectile/energy/electrode/stunshot, /obj/item/projectile/energy/electrode) + +obj/item/weapon/modular_firearms/chamber/a762 + name = ".762 chamber" + desc = "Compatible with .762 ammunition."" + allowed_projectiles = list(/obj/item/projectile/bullet/rifle/a762) + +obj/item/weapon/modular_firearms/chamber/a145 + name = ".145 chamber" + desc = "Compatible with .145 ammunition." + allowed_projectiles = list(/obj/item/projectile/bullet/rifle/a145) + +obj/item/weapon/modular_firearms/chamber/a556 + name = ".556 chamber" + desc = "Compatible with .556 ammunition." + allowed_projectiles = list(/obj/item/projectile/bullet/rifle/a556) + +obj/item/weapon/modular_firearms/chamber/energy + allowed_projectiles = null + +obj/item/weapon/modular_firearms/chamber/energy/laser + name = "laser emitter" + projectile_type = /obj/item/projectile/beam + +obj/item/weapon/modular_firearms/chamber/energy/plaser + name = "practice laser emitter" + projectile_type = /obj/item/projectile/beam/practice + +obj/item/weapon/modular_firearms/chamber/energy/hlaser + name = "heavy laser emitter" + projectile_type = /obj/item/projectile/beam/heavylaser + +obj/item/weapon/modular_firearms/chamber/energy/xray + name = "X-ray laser emitter" + allowed_projectiles = list() + projectile_type = /obj/item/projectile/beam/xray + +obj/item/weapon/modular_firearms/chamber/energy/xsniper + name = "sniper laser emitter" + allowed_projectiles = list() + projectile_type = /obj/item/projectile/beam/sniper + +obj/item/weapon/modular_firearms/chamber/energy/ltagblue + name = "blue laser-tag emitter" + allowed_projectiles = list() + projectile_type = /obj/item/projectile/beam/lastertag/blue + +obj/item/weapon/modular_firearms/chamber/energy/ltagred + name = "red laser-tag emitter" + allowed_projectiles = list() + projectile_type = /obj/item/projectile/beam/lastertag/red + +obj/item/weapon/modular_firearms/chamber/energy/stun + name = "stun beam emitter + allowed_projectiles = list() + projectile_type = /obj/item/projectile/beam/stun + +obj/item/weapon/modular_firearms/chamber/energy/ion + name = "ion emitter" + allowed_projectiles = list() + projectile_type = /obj/item/projectile/ion + +obj/item/weapon/modular_firearms/chamber/energy/floramut + name = "floral emitter" + allowed_projectiles = list() + projectile_type = /obj/item/projectile/energy/floramut + +obj/item/weapon/modular_firearms/chamber/energy/phoron + name = "phoron emitter" + allowed_projectiles = list() + projectile_type = /obj/item/projectile/energy/phoron + From 02a92fb8bc6be50bfe4a942c61eeb1365eabf11f Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Wed, 2 Sep 2015 08:24:36 +0100 Subject: [PATCH 003/107] WIP Modular firearm code --- baystation12.dme | 12 ++ .../projectiles/guns/modular/assembly.dm | 114 ++++++++++++++++++ .../guns/modular/components/barrel.dm | 4 +- .../guns/modular/components/chamber.dm | 4 +- .../guns/modular/components/chassis.dm | 9 +- .../guns/modular/components/driver.dm | 4 +- .../guns/modular/components/loader.dm | 3 + .../guns/modular/components/lockpin.dm | 4 +- .../guns/modular/components/misc.dm | 7 ++ .../guns/modular/components/sight.dm | 3 + .../guns/modular/components/stock.dm | 3 + code/modules/projectiles/guns/modular/core.dm | 79 ++++++++++++ icons/placeholder.dmi | Bin 378 -> 367 bytes 13 files changed, 240 insertions(+), 6 deletions(-) create mode 100644 code/modules/projectiles/guns/modular/assembly.dm create mode 100644 code/modules/projectiles/guns/modular/core.dm diff --git a/baystation12.dme b/baystation12.dme index 65e445f6f2903..f517aa982671b 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1450,6 +1450,18 @@ #include "code\modules\projectiles\guns\launcher\pneumatic.dm" #include "code\modules\projectiles\guns\launcher\rocket.dm" #include "code\modules\projectiles\guns\launcher\syringe_gun.dm" +#include "code\modules\projectiles\guns\modular\assembly.dm" +#include "code\modules\projectiles\guns\modular\core.dm" +#include "code\modules\projectiles\guns\modular\components\barrel.dm" +#include "code\modules\projectiles\guns\modular\components\chamber.dm" +#include "code\modules\projectiles\guns\modular\components\chassis.dm" +#include "code\modules\projectiles\guns\modular\components\driver.dm" +#include "code\modules\projectiles\guns\modular\components\frame.dm" +#include "code\modules\projectiles\guns\modular\components\loader.dm" +#include "code\modules\projectiles\guns\modular\components\lockpin.dm" +#include "code\modules\projectiles\guns\modular\components\misc.dm" +#include "code\modules\projectiles\guns\modular\components\sight.dm" +#include "code\modules\projectiles\guns\modular\components\stock.dm" #include "code\modules\projectiles\guns\projectile\automatic.dm" #include "code\modules\projectiles\guns\projectile\dartgun.dm" #include "code\modules\projectiles\guns\projectile\pistol.dm" diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm new file mode 100644 index 0000000000000..94016f21cb259 --- /dev/null +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -0,0 +1,114 @@ +//Frames are the starting blocks of the weapon. The type of frame decides how large a weapon you can build. +//In general, weight affects the size and weight (slow to use, bulky, etc) of the weapon + +/datum/firemode/modular + name = "modular-default" + burst = 1 + burst_delay = null + fire_delay = null + move_delay = 1 + list/accuracy = list(0) + list/dispersion = list(0) + +obj/item/weapon/modular_firearms/assembly + name = "basic assembly" + desc = "The outer framework for a firearm of some kind. This one looks rather basic." + icon = 'icons/placeholder.dmi' + var/modChassis = null + var/modChamber = null + var/modDriver = null + var/modLoader = null + var/modBarrel = null + var/modStock = null + var/modLock = null + var/modSight = null + var/modMisc = list() + var/list/allowed_projectiles = list() + var/projectile_type = null + var/framelevel = 2 + var/chargecost = null + var/weight = 1 + var/isEnergy = null + var/isKinetic = null + var/silenced = null + var/accuracy_mod = null + var/compensated = null + var/haspin = 0 + var/buildstage = 1 + var/list/components = new/list() + +/obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) + if(buildstage == 1) + if(istype(I, /obj/item/weapon/modular_firearms/chassis)) + user.drop_item() + I.loc = src + components += I + modChassis = I + if(istype(I, /obj/item/weapon/modular_firearms/chassis/energy)) + isEnergy = 1 + if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) + isKinetic = 1 + user << "\blue You install the [I] onto the [src]." + // weight = I.weight + weight + buildstage += 1 + else + user << "\red You must install a chassis first!" + + else if(buildstage == 2) + if(istype(I, /obj/item/weapon/modular_firearms/chamber)) + user.drop_item() + I.loc = src + components += I + modChamber = I + var/obj/item/weapon/modular_firearms/chamber/chamber = I + if(chamber.projectile_type) + if(isEnergy) + projectile_type = chamber.projectile_type + else + user << "\red A ballistic chamber won't work with an energy chassis!" + if(chamber.allowed_projectiles) + for(chamber.allowed_projectiles) + if(isKinetic) + allowed_projectiles += chamber.allowed_projectiles + else + user << "\red An energy chamber won't work with a ballistic chassis!" + user << "\blue You install the [I] onto the [src]." + // weight = I.weight + weight + buildstage += 1 + else + user << "\red You must install a chassis first!" + + else if(buildstage == 3) + if(istype(I, /obj/item/weapon/modular_firearms/driver)) + user.drop_item() + I.loc = src + components += I + buildstage += 1 + + else if(buildstage == 4) + if(istype(I, /obj/item/weapon/modular_firearms/loader)) + user.drop_item() + I.loc = src + components += I + buildstage += 1 + + else if(buildstage == 5) + if(istype(I, /obj/item/weapon/modular_firearms/barrel)) + user.drop_item() + I.loc = src + components += I + buildstage += 1 + + else if(buildstage == 6) + if(istype(I, /obj/item/weapon/modular_firearms/stock)) + user.drop_item() + I.loc = src + components += I + buildstage += 1 + + else if(buildstage == 7) + if(istype(I, /obj/item/weapon/modular_firearms/lockpin)) + user.drop_item() + I.loc = src + components += I + buildstage += 1 \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/barrel.dm b/code/modules/projectiles/guns/modular/components/barrel.dm index 99274dc1632fb..2bac8e26e7f55 100644 --- a/code/modules/projectiles/guns/modular/components/barrel.dm +++ b/code/modules/projectiles/guns/modular/components/barrel.dm @@ -1,2 +1,4 @@ //Barrels define the range of the weapon, as well as affecting their accuracy. -//For energy weapons, this refers to focusing chambers. \ No newline at end of file +//For energy weapons, this refers to focusing chambers. + +obj/item/weapon/modular_firearms/barrel diff --git a/code/modules/projectiles/guns/modular/components/chamber.dm b/code/modules/projectiles/guns/modular/components/chamber.dm index cbd0081051d00..3b765165d50b9 100644 --- a/code/modules/projectiles/guns/modular/components/chamber.dm +++ b/code/modules/projectiles/guns/modular/components/chamber.dm @@ -38,7 +38,7 @@ obj/item/weapon/modular_firearms/chamber/stunshell obj/item/weapon/modular_firearms/chamber/a762 name = ".762 chamber" - desc = "Compatible with .762 ammunition."" + desc = "Compatible with .762 ammunition." allowed_projectiles = list(/obj/item/projectile/bullet/rifle/a762) obj/item/weapon/modular_firearms/chamber/a145 @@ -87,7 +87,7 @@ obj/item/weapon/modular_firearms/chamber/energy/ltagred projectile_type = /obj/item/projectile/beam/lastertag/red obj/item/weapon/modular_firearms/chamber/energy/stun - name = "stun beam emitter + name = "stun beam emitter" allowed_projectiles = list() projectile_type = /obj/item/projectile/beam/stun diff --git a/code/modules/projectiles/guns/modular/components/chassis.dm b/code/modules/projectiles/guns/modular/components/chassis.dm index 933cc106df495..ee3dabfca9587 100644 --- a/code/modules/projectiles/guns/modular/components/chassis.dm +++ b/code/modules/projectiles/guns/modular/components/chassis.dm @@ -1,2 +1,9 @@ //The chassis is basically the actual framework of the gun, and decides what type of weapon it will be. -//Options are ballistic and energy, for the moment \ No newline at end of file +//Options are ballistic and energy, for the moment + +obj/item/weapon/modular_firearms/chassis + var/weight = 2 + +obj/item/weapon/modular_firearms/chassis/energy + +obj/item/weapon/modular_firearms/chassis/ballistic \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/driver.dm b/code/modules/projectiles/guns/modular/components/driver.dm index 0374dee77ce7e..ccd75013c94d2 100644 --- a/code/modules/projectiles/guns/modular/components/driver.dm +++ b/code/modules/projectiles/guns/modular/components/driver.dm @@ -1 +1,3 @@ -//Drivers affect how the gun fires. Does it use burst fire? Automatic? Semi? Charge? \ No newline at end of file +//Drivers affect how the gun fires. Does it use burst fire? Automatic? Semi? Charge? + +obj/item/weapon/modular_firearms/driver \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index e69de29bb2d1d..438d0b1d6eceb 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -0,0 +1,3 @@ +//Loaders are how the gun handles ammuni + +obj/item/weapon/modular_firearms/loader \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/lockpin.dm b/code/modules/projectiles/guns/modular/components/lockpin.dm index 6c2e0882ffd8a..0329182f05e7a 100644 --- a/code/modules/projectiles/guns/modular/components/lockpin.dm +++ b/code/modules/projectiles/guns/modular/components/lockpin.dm @@ -1,2 +1,4 @@ //This is a special little pin that you have to get either from a lockbox in R&D or from security -//Without this, the gun won't work. it's basically to stop people making guns and going on a rampage. \ No newline at end of file +//Without this, the gun won't work. it's basically to stop people making guns and going on a rampage. + +obj/item/weapon/modular_firearms/lockpin \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/misc.dm b/code/modules/projectiles/guns/modular/components/misc.dm index e69de29bb2d1d..eee262f2a9f12 100644 --- a/code/modules/projectiles/guns/modular/components/misc.dm +++ b/code/modules/projectiles/guns/modular/components/misc.dm @@ -0,0 +1,7 @@ +//Misc includes things such as silencers and compensators. + +obj/item/weapon/modular_firearms/silencer + +obj/item/weapon/modular_firearms/compensator + +obj/item/weapon/modular_firearms/flashlight \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/sight.dm b/code/modules/projectiles/guns/modular/components/sight.dm index e69de29bb2d1d..6194b465d3c3f 100644 --- a/code/modules/projectiles/guns/modular/components/sight.dm +++ b/code/modules/projectiles/guns/modular/components/sight.dm @@ -0,0 +1,3 @@ +//What it says on the tin + +obj/item/weapon/modular_firearms/sight \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/stock.dm b/code/modules/projectiles/guns/modular/components/stock.dm index e69de29bb2d1d..af3489772459b 100644 --- a/code/modules/projectiles/guns/modular/components/stock.dm +++ b/code/modules/projectiles/guns/modular/components/stock.dm @@ -0,0 +1,3 @@ +//Stocks affect the gun's accuracy and recoil, in the case of projectile weaponry. + +obj/item/weapon/modular_firearms/stock \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm new file mode 100644 index 0000000000000..bde46b073ac59 --- /dev/null +++ b/code/modules/projectiles/guns/modular/core.dm @@ -0,0 +1,79 @@ +/datum/firemode/modular + name = "modular-default" + burst = 1 + burst_delay = null + fire_delay = null + move_delay = 1 + list/accuracy = list(0) + list/dispersion = list(0) + + + /* + name = "gun" + desc = "Its a gun. It's pretty terrible, though." + icon = 'icons/obj/gun.dmi' + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_guns.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_guns.dmi', + ) + icon_state = "detective" + item_state = "gun" + flags = CONDUCT + slot_flags = SLOT_BELT|SLOT_HOLSTER + matter = list(DEFAULT_WALL_MATERIAL = 2000) + w_class = 3 + throwforce = 5 + throw_speed = 4 + throw_range = 5 + force = 5 + origin_tech = "combat=1" + attack_verb = list("struck", "hit", "bashed") + zoomdevicename = "scope" + + var/fire_delay = 6 //delay after shooting before the gun can be used again + var/burst_delay = 2 //delay between shots, if firing in bursts + var/fire_sound = 'sound/weapons/Gunshot.ogg' + var/fire_sound_text = "gunshot" + var/recoil = 0 //screen shake + var/silenced = 0 + var/muzzle_flash = 3 + var/accuracy = 0 //accuracy is measured in tiles. +1 accuracy means that everything is effectively one tile closer for the purpose of miss chance, -1 means the opposite. launchers are not supported, at the moment. + var/scoped_accuracy = null + + var/next_fire_time = 0 + + var/sel_mode = 1 //index of the currently selected mode + var/list/firemodes = list() + var/firemode_type = /datum/firemode //for subtypes that need custom firemode data + + //aiming system stuff + var/keep_aim = 1 //1 for keep shooting until aim is lowered + //0 for one bullet after tarrget moves and aim is lowered + var/multi_aim = 0 //Used to determine if you can target multiple people. + var/tmp/list/mob/living/aim_targets //List of who yer targeting. + var/tmp/mob/living/last_moved_mob //Used to fire faster at more than one person. + var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them. + var/tmp/lock_time = -100 + */ + +/obj/item/weapon/gun/modular + name = "basic assembly" + desc = "The outer framework for a firearm of some kind. This one looks rather basic." + icon = 'icons/placeholder.dmi' + var/modAssembly = null + var/modChassis = null + var/modChamber = null + var/modDriver = null + var/modLoader = null + var/modBarrel = null + var/modStock = null + var/modLock = null + var/modSight = null + var/modMisc = list() + var/framelevel = 2 + var/weight = 1 + var/guntype = null + var/isEnergy = null + var/isKinetic = null + + diff --git a/icons/placeholder.dmi b/icons/placeholder.dmi index b0297b3953c9e9c0f09dbf9c4f50522a870f7d24..8192fb79e24a933b8e1571366a878cb67826da5f 100644 GIT binary patch delta 63 zcmV-F0KotH0`CHlNda(?N=PtCiHkEOv#1!zH00t;D@x2w1+h(lqNzEFl^|gqFyvBJ VaP@NmTLA!Hh#U3NxM(kt&8gNKs4**h&Ak~4_yA6@TttXZq?f?J) From 89fb5a8818d9fd249144bfcde2c770188f72c0f7 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Wed, 2 Sep 2015 17:33:26 +0100 Subject: [PATCH 004/107] Changed allowed_projectiles to use caliber So much cleaner. Also gave some things a placeholder sprite --- .../projectiles/guns/modular/assembly.dm | 19 +++-- .../guns/modular/components/barrel.dm | 1 + .../guns/modular/components/chamber.dm | 69 +++++++++++-------- .../guns/modular/components/chassis.dm | 1 + .../guns/modular/components/driver.dm | 3 +- .../guns/modular/components/loader.dm | 3 +- .../guns/modular/components/lockpin.dm | 3 +- .../guns/modular/components/misc.dm | 5 +- .../guns/modular/components/sight.dm | 3 +- .../guns/modular/components/stock.dm | 3 +- 10 files changed, 64 insertions(+), 46 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 94016f21cb259..34e617bd4f738 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -23,13 +23,13 @@ obj/item/weapon/modular_firearms/assembly var/modLock = null var/modSight = null var/modMisc = list() - var/list/allowed_projectiles = list() var/projectile_type = null var/framelevel = 2 var/chargecost = null var/weight = 1 var/isEnergy = null var/isKinetic = null + var/caliber var/silenced = null var/accuracy_mod = null var/compensated = null @@ -48,7 +48,7 @@ obj/item/weapon/modular_firearms/assembly isEnergy = 1 if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) isKinetic = 1 - user << "\blue You install the [I] onto the [src]." + user << "\blue You install the [I] onto the [src]. Now you should install a chamber." // weight = I.weight + weight buildstage += 1 else @@ -66,17 +66,16 @@ obj/item/weapon/modular_firearms/assembly projectile_type = chamber.projectile_type else user << "\red A ballistic chamber won't work with an energy chassis!" - if(chamber.allowed_projectiles) - for(chamber.allowed_projectiles) - if(isKinetic) - allowed_projectiles += chamber.allowed_projectiles - else - user << "\red An energy chamber won't work with a ballistic chassis!" - user << "\blue You install the [I] onto the [src]." + if(chamber.caliber) + if(isKinetic) + caliber = chamber.caliber + else + user << "\red An energy chamber won't work with a ballistic chassis!" + user << "\blue You install the [I] onto the [src]. Now you should install the driver." // weight = I.weight + weight buildstage += 1 else - user << "\red You must install a chassis first!" + user << "\red You must install a chamber first!" else if(buildstage == 3) if(istype(I, /obj/item/weapon/modular_firearms/driver)) diff --git a/code/modules/projectiles/guns/modular/components/barrel.dm b/code/modules/projectiles/guns/modular/components/barrel.dm index 2bac8e26e7f55..b716551b0f4c9 100644 --- a/code/modules/projectiles/guns/modular/components/barrel.dm +++ b/code/modules/projectiles/guns/modular/components/barrel.dm @@ -2,3 +2,4 @@ //For energy weapons, this refers to focusing chambers. obj/item/weapon/modular_firearms/barrel + icon = 'icons/placeholder.dmi' \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/chamber.dm b/code/modules/projectiles/guns/modular/components/chamber.dm index 3b765165d50b9..f0addf8d4ebad 100644 --- a/code/modules/projectiles/guns/modular/components/chamber.dm +++ b/code/modules/projectiles/guns/modular/components/chamber.dm @@ -3,56 +3,73 @@ //For energy, it will include each type of beam, excluding pulse weaponry. Heavy lasers may only be made with a heavy frame obj/item/weapon/modular_firearms/chamber - var/list/allowed_projectiles = list() - var/projectile_type = null + var/caliber = null + icon = 'icons/placeholder.dmi' obj/item/weapon/modular_firearms/chamber/a357 - name = "heavy-pistol chamber" - desc = "Compatible with .357 and .50 ammunition." - allowed_projectiles = list(/obj/item/projectile/bullet/pistol/strong) + name = ".357 chamber" + desc = "Compatible with .357" + caliber = "357" + +obj/item/weapon/modular_firearms/chamber/a50 + name = ".50 chamber" + desc = "Compatible with .50" + caliber = ".50" + + +obj/item/weapon/modular_firearms/chamber/c38 + name = ".38 chamber" + desc = "Compatible with .38" + caliber = "38" obj/item/weapon/modular_firearms/chamber/a75 - name = "gyrojet chamber" + name = ".75 chamber" desc = "Compatible with .75 ammunition." - allowed_projectiles = list(/obj/item/projectile/bullet/gyro) + caliber = "75" obj/item/weapon/modular_firearms/chamber/c9mm - name = "standard pistol chamber" - desc = "Compatible with .38 and 9mm ammunition." - allowed_projectiles = list(/obj/item/projectile/energy/flash/flare, /obj/item/projectile/bullet/pistol, /obj/item/projectile/energy/flash, /obj/item/projectile/bullet/pistol/rubber, /obj/item/projectile/bullet/pistol/practice) + name = "9mm chamber" + desc = "Compatible with 9mm ammunition." + caliber = "9mm" + +obj/item/weapon/modular_firearms/chamber/a12mm + name = "12mm chamber" + desc = "Compatible with 12mm ammunition." + caliber = "12mm" +12mm obj/item/weapon/modular_firearms/chamber/c45 - name = "medium-pistol chamber" - desc = "Compatible with .45 and 12mm ammunition." - allowed_projectiles = list(/obj/item/projectile/bullet/pistol/medium) + name = ".45 chamber" + desc = "Compatible with .45 ammunition." + caliber = ".45" obj/item/weapon/modular_firearms/chamber/shotgun name = "shotgun chamber" desc = "Compatible with all shotgun-grade ammunition." - allowed_projectiles = list(/obj/item/projectile/energy/flash/flare, /obj/item/projectile/bullet/shotgun, /obj/item/projectile/bullet/pellet/shotgun, /obj/item/projectile/bullet/blank, /obj/item/projectile/bullet/shotgun/practice, /obj/item/projectile/bullet/shotgun/beanbag) + caliber = "shotgun" -obj/item/weapon/modular_firearms/chamber/stunshell - name = "taser cartridge system" - desc = "Compatible with Taser cartridges." - allowed_projectiles = list(/obj/item/projectile/energy/electrode/stunshot, /obj/item/projectile/energy/electrode) +//obj/item/weapon/modular_firearms/chamber/stunshell +// name = "taser cartridge system" +// desc = "Compatible with Taser cartridges." +// allowed_projectiles = list(/obj/item/projectile/energy/electrode/stunshot, /obj/item/projectile/energy/electrode) obj/item/weapon/modular_firearms/chamber/a762 name = ".762 chamber" desc = "Compatible with .762 ammunition." - allowed_projectiles = list(/obj/item/projectile/bullet/rifle/a762) + caliber = "a762" obj/item/weapon/modular_firearms/chamber/a145 name = ".145 chamber" desc = "Compatible with .145 ammunition." - allowed_projectiles = list(/obj/item/projectile/bullet/rifle/a145) + caliber = "14.5mm" obj/item/weapon/modular_firearms/chamber/a556 name = ".556 chamber" desc = "Compatible with .556 ammunition." - allowed_projectiles = list(/obj/item/projectile/bullet/rifle/a556) + caliber = "a556" obj/item/weapon/modular_firearms/chamber/energy - allowed_projectiles = null + var/projectile_type = null obj/item/weapon/modular_firearms/chamber/energy/laser name = "laser emitter" @@ -68,41 +85,33 @@ obj/item/weapon/modular_firearms/chamber/energy/hlaser obj/item/weapon/modular_firearms/chamber/energy/xray name = "X-ray laser emitter" - allowed_projectiles = list() projectile_type = /obj/item/projectile/beam/xray obj/item/weapon/modular_firearms/chamber/energy/xsniper name = "sniper laser emitter" - allowed_projectiles = list() projectile_type = /obj/item/projectile/beam/sniper obj/item/weapon/modular_firearms/chamber/energy/ltagblue name = "blue laser-tag emitter" - allowed_projectiles = list() projectile_type = /obj/item/projectile/beam/lastertag/blue obj/item/weapon/modular_firearms/chamber/energy/ltagred name = "red laser-tag emitter" - allowed_projectiles = list() projectile_type = /obj/item/projectile/beam/lastertag/red obj/item/weapon/modular_firearms/chamber/energy/stun name = "stun beam emitter" - allowed_projectiles = list() projectile_type = /obj/item/projectile/beam/stun obj/item/weapon/modular_firearms/chamber/energy/ion name = "ion emitter" - allowed_projectiles = list() projectile_type = /obj/item/projectile/ion obj/item/weapon/modular_firearms/chamber/energy/floramut name = "floral emitter" - allowed_projectiles = list() projectile_type = /obj/item/projectile/energy/floramut obj/item/weapon/modular_firearms/chamber/energy/phoron name = "phoron emitter" - allowed_projectiles = list() projectile_type = /obj/item/projectile/energy/phoron diff --git a/code/modules/projectiles/guns/modular/components/chassis.dm b/code/modules/projectiles/guns/modular/components/chassis.dm index ee3dabfca9587..e0e306e8d7e2b 100644 --- a/code/modules/projectiles/guns/modular/components/chassis.dm +++ b/code/modules/projectiles/guns/modular/components/chassis.dm @@ -2,6 +2,7 @@ //Options are ballistic and energy, for the moment obj/item/weapon/modular_firearms/chassis + icon = 'icons/placeholder.dmi' var/weight = 2 obj/item/weapon/modular_firearms/chassis/energy diff --git a/code/modules/projectiles/guns/modular/components/driver.dm b/code/modules/projectiles/guns/modular/components/driver.dm index ccd75013c94d2..f9547fa4e6703 100644 --- a/code/modules/projectiles/guns/modular/components/driver.dm +++ b/code/modules/projectiles/guns/modular/components/driver.dm @@ -1,3 +1,4 @@ //Drivers affect how the gun fires. Does it use burst fire? Automatic? Semi? Charge? -obj/item/weapon/modular_firearms/driver \ No newline at end of file +obj/item/weapon/modular_firearms/driver + icon = 'icons/placeholder.dmi' \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index 438d0b1d6eceb..396c65c8c4d3c 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -1,3 +1,4 @@ //Loaders are how the gun handles ammuni -obj/item/weapon/modular_firearms/loader \ No newline at end of file +obj/item/weapon/modular_firearms/loader + icon = 'icons/placeholder.dmi' \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/lockpin.dm b/code/modules/projectiles/guns/modular/components/lockpin.dm index 0329182f05e7a..10552f49ab781 100644 --- a/code/modules/projectiles/guns/modular/components/lockpin.dm +++ b/code/modules/projectiles/guns/modular/components/lockpin.dm @@ -1,4 +1,5 @@ //This is a special little pin that you have to get either from a lockbox in R&D or from security //Without this, the gun won't work. it's basically to stop people making guns and going on a rampage. -obj/item/weapon/modular_firearms/lockpin \ No newline at end of file +obj/item/weapon/modular_firearms/lockpin + icon = 'icons/placeholder.dmi' \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/misc.dm b/code/modules/projectiles/guns/modular/components/misc.dm index eee262f2a9f12..781c37bf8e524 100644 --- a/code/modules/projectiles/guns/modular/components/misc.dm +++ b/code/modules/projectiles/guns/modular/components/misc.dm @@ -1,7 +1,10 @@ //Misc includes things such as silencers and compensators. obj/item/weapon/modular_firearms/silencer + icon = 'icons/placeholder.dmi' obj/item/weapon/modular_firearms/compensator + icon = 'icons/placeholder.dmi' -obj/item/weapon/modular_firearms/flashlight \ No newline at end of file +obj/item/weapon/modular_firearms/flashlight + icon = 'icons/placeholder.dmi' \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/sight.dm b/code/modules/projectiles/guns/modular/components/sight.dm index 6194b465d3c3f..a3fcc05e69305 100644 --- a/code/modules/projectiles/guns/modular/components/sight.dm +++ b/code/modules/projectiles/guns/modular/components/sight.dm @@ -1,3 +1,4 @@ //What it says on the tin -obj/item/weapon/modular_firearms/sight \ No newline at end of file +obj/item/weapon/modular_firearms/sight + icon = 'icons/placeholder.dmi' \ No newline at end of file diff --git a/code/modules/projectiles/guns/modular/components/stock.dm b/code/modules/projectiles/guns/modular/components/stock.dm index af3489772459b..b9f5a1a077eec 100644 --- a/code/modules/projectiles/guns/modular/components/stock.dm +++ b/code/modules/projectiles/guns/modular/components/stock.dm @@ -1,3 +1,4 @@ //Stocks affect the gun's accuracy and recoil, in the case of projectile weaponry. -obj/item/weapon/modular_firearms/stock \ No newline at end of file +obj/item/weapon/modular_firearms/stock + icon = 'icons/placeholder.dmi' \ No newline at end of file From beff2c1e3384ddda43ab57000af791c1c5227755 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Wed, 2 Sep 2015 17:36:55 +0100 Subject: [PATCH 005/107] Removed a stray piece of text --- code/modules/projectiles/guns/modular/components/chamber.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/components/chamber.dm b/code/modules/projectiles/guns/modular/components/chamber.dm index f0addf8d4ebad..77d5203657139 100644 --- a/code/modules/projectiles/guns/modular/components/chamber.dm +++ b/code/modules/projectiles/guns/modular/components/chamber.dm @@ -37,7 +37,6 @@ obj/item/weapon/modular_firearms/chamber/a12mm desc = "Compatible with 12mm ammunition." caliber = "12mm" -12mm obj/item/weapon/modular_firearms/chamber/c45 name = ".45 chamber" desc = "Compatible with .45 ammunition." From e75842148a16ab4e89c3c0644ab5c55340d3cd4f Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Wed, 2 Sep 2015 17:41:54 +0100 Subject: [PATCH 006/107] Moved projectile type into chamber/ --- code/modules/projectiles/guns/modular/components/chamber.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/components/chamber.dm b/code/modules/projectiles/guns/modular/components/chamber.dm index 77d5203657139..95caf65225df1 100644 --- a/code/modules/projectiles/guns/modular/components/chamber.dm +++ b/code/modules/projectiles/guns/modular/components/chamber.dm @@ -4,6 +4,7 @@ obj/item/weapon/modular_firearms/chamber var/caliber = null + var/projectile_type = null icon = 'icons/placeholder.dmi' obj/item/weapon/modular_firearms/chamber/a357 @@ -68,7 +69,6 @@ obj/item/weapon/modular_firearms/chamber/a556 caliber = "a556" obj/item/weapon/modular_firearms/chamber/energy - var/projectile_type = null obj/item/weapon/modular_firearms/chamber/energy/laser name = "laser emitter" From 3736e6e74941d8431dd94c36012f0712ce97818b Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Wed, 2 Sep 2015 19:09:13 +0100 Subject: [PATCH 007/107] Placeholder code for drivers --- .../guns/modular/components/driver.dm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/components/driver.dm b/code/modules/projectiles/guns/modular/components/driver.dm index f9547fa4e6703..f0ffb680856f0 100644 --- a/code/modules/projectiles/guns/modular/components/driver.dm +++ b/code/modules/projectiles/guns/modular/components/driver.dm @@ -1,4 +1,20 @@ //Drivers affect how the gun fires. Does it use burst fire? Automatic? Semi? Charge? +/*/datum/firemode/modular + name = "modular-default" + burst = 1 + burst_delay = null + fire_delay = null + move_delay = 1 + list/accuracy = list(0) + list/dispersion = list(0) + */ + obj/item/weapon/modular_firearms/driver - icon = 'icons/placeholder.dmi' \ No newline at end of file + icon = 'icons/placeholder.dmi' + var/burst = 1 + var/burst_delay = null + var/fire_delay = null + var/move_delay = 1 + var/list/accuracy = list(0) + var/list/dispersion = list(0) From 88e27ea4841c3daa364c74555d95bbf372e13622 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Thu, 3 Sep 2015 13:04:35 +0100 Subject: [PATCH 008/107] Placeholder drivers to work with --- .../guns/modular/components/driver.dm | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/code/modules/projectiles/guns/modular/components/driver.dm b/code/modules/projectiles/guns/modular/components/driver.dm index f0ffb680856f0..a7b8e7fd9a1d7 100644 --- a/code/modules/projectiles/guns/modular/components/driver.dm +++ b/code/modules/projectiles/guns/modular/components/driver.dm @@ -18,3 +18,53 @@ obj/item/weapon/modular_firearms/driver var/move_delay = 1 var/list/accuracy = list(0) var/list/dispersion = list(0) + +obj/item/weapon/modular_firearms/driver/autoinacc + name = "rapid-automatic driver" + icon = 'icons/placeholder.dmi' + var/burst = 7 + var/burst_delay = null + var/fire_delay = null + var/move_delay = 1 + var/list/accuracy = list(0) + var/list/dispersion = list(1.5) + +obj/item/weapon/modular_firearms/driver/semiauto + name = "semi-automatic driver" + icon = 'icons/placeholder.dmi' + var/burst = 1 + var/burst_delay = null + var/fire_delay = null + var/move_delay = 1 + var/list/accuracy = list(0) + var/list/dispersion = list(0) + +obj/item/weapon/modular_firearms/driver/burst3 + name = "burst driver" + icon = 'icons/placeholder.dmi' + var/burst = 3 + var/burst_delay = null + var/fire_delay = null + var/move_delay = 1 + var/list/accuracy = list(0) + var/list/dispersion = list(0.4) + +obj/item/weapon/modular_firearms/driver/auto + name = "automatic driver" + icon = 'icons/placeholder.dmi' + var/burst = 5 + var/burst_delay = null + var/fire_delay = null + var/move_delay = 1 + var/list/accuracy = list(0) + var/list/dispersion = list(0.5) + +obj/item/weapon/modular_firearms/driver/preciseburst + name = "precision burst driver" + icon = 'icons/placeholder.dmi' + var/burst = 3 + var/burst_delay = 1 + var/fire_delay = null + var/move_delay = 1 + var/list/accuracy = list(0) + var/list/dispersion = list(0.2) From 030e0e9538dcfadb79202a2bdbd794dc9a905298 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Thu, 3 Sep 2015 14:52:53 +0100 Subject: [PATCH 009/107] Assembly driver code. Heavily WIP and untested. --- .../projectiles/guns/modular/assembly.dm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 34e617bd4f738..ecfa2d4b3df7f 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -21,6 +21,7 @@ obj/item/weapon/modular_firearms/assembly var/modBarrel = null var/modStock = null var/modLock = null + var/firemode = /datum/firemode/modular var/modSight = null var/modMisc = list() var/projectile_type = null @@ -36,6 +37,12 @@ obj/item/weapon/modular_firearms/assembly var/haspin = 0 var/buildstage = 1 var/list/components = new/list() + var/burst = 1 + var/burst_delay = null + var/fire_delay = null + var/move_delay = 1 + var/list/accuracy = list(0) + var/list/dispersion = list(0) /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) if(buildstage == 1) @@ -82,6 +89,15 @@ obj/item/weapon/modular_firearms/assembly user.drop_item() I.loc = src components += I + modDriver = I + var/obj/item/weapon/modular_firearms/driver/D = I + burst = D.burst + burst_delay = D.burst_delay + fire_delay = D.fire_delay + move_delay = D.move_delay + accuracy = D.accuracy + dispersion = D.dispersion + user << "\blue You install the [I] into the [src]." buildstage += 1 else if(buildstage == 4) @@ -110,4 +126,4 @@ obj/item/weapon/modular_firearms/assembly user.drop_item() I.loc = src components += I - buildstage += 1 \ No newline at end of file + buildstage += 1 From 5ffda2b45b6cc7890ba4846daf50b1a0b25b8512 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Thu, 3 Sep 2015 15:00:41 +0100 Subject: [PATCH 010/107] Adds a debug check --- .../projectiles/guns/modular/assembly.dm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index ecfa2d4b3df7f..a757343ef936d 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -91,15 +91,19 @@ obj/item/weapon/modular_firearms/assembly components += I modDriver = I var/obj/item/weapon/modular_firearms/driver/D = I - burst = D.burst - burst_delay = D.burst_delay - fire_delay = D.fire_delay - move_delay = D.move_delay - accuracy = D.accuracy - dispersion = D.dispersion + if(D.burst) + burst = D.burst + burst_delay = D.burst_delay + fire_delay = D.fire_delay + move_delay = D.move_delay + accuracy = D.accuracy + dispersion = D.dispersion + else + user << "\red How did you manage this?" user << "\blue You install the [I] into the [src]." buildstage += 1 - + else + user << "\red You must install a driver first!" else if(buildstage == 4) if(istype(I, /obj/item/weapon/modular_firearms/loader)) user.drop_item() From c9cb2c9b632be9ae95cbd3ed23bde0ef5db2c586 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Thu, 3 Sep 2015 15:06:47 +0100 Subject: [PATCH 011/107] Duplicate definition fix --- .../guns/modular/components/driver.dm | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/code/modules/projectiles/guns/modular/components/driver.dm b/code/modules/projectiles/guns/modular/components/driver.dm index a7b8e7fd9a1d7..f4ca5a04991ca 100644 --- a/code/modules/projectiles/guns/modular/components/driver.dm +++ b/code/modules/projectiles/guns/modular/components/driver.dm @@ -22,49 +22,49 @@ obj/item/weapon/modular_firearms/driver obj/item/weapon/modular_firearms/driver/autoinacc name = "rapid-automatic driver" icon = 'icons/placeholder.dmi' - var/burst = 7 - var/burst_delay = null - var/fire_delay = null - var/move_delay = 1 - var/list/accuracy = list(0) - var/list/dispersion = list(1.5) + burst = 7 + burst_delay = null + fire_delay = null + move_delay = 1 + list/accuracy = list(0) + list/dispersion = list(1.5) obj/item/weapon/modular_firearms/driver/semiauto name = "semi-automatic driver" icon = 'icons/placeholder.dmi' - var/burst = 1 - var/burst_delay = null - var/fire_delay = null - var/move_delay = 1 - var/list/accuracy = list(0) - var/list/dispersion = list(0) + burst = 1 + burst_delay = null + fire_delay = null + move_delay = 1 + list/accuracy = list(0) + list/dispersion = list(0) obj/item/weapon/modular_firearms/driver/burst3 name = "burst driver" icon = 'icons/placeholder.dmi' - var/burst = 3 - var/burst_delay = null - var/fire_delay = null - var/move_delay = 1 - var/list/accuracy = list(0) - var/list/dispersion = list(0.4) + burst = 3 + burst_delay = null + fire_delay = null + move_delay = 1 + list/accuracy = list(0) + list/dispersion = list(0.4) obj/item/weapon/modular_firearms/driver/auto name = "automatic driver" icon = 'icons/placeholder.dmi' - var/burst = 5 - var/burst_delay = null - var/fire_delay = null - var/move_delay = 1 - var/list/accuracy = list(0) - var/list/dispersion = list(0.5) + burst = 5 + burst_delay = null + fire_delay = null + move_delay = 1 + list/accuracy = list(0) + list/dispersion = list(0.5) obj/item/weapon/modular_firearms/driver/preciseburst name = "precision burst driver" icon = 'icons/placeholder.dmi' - var/burst = 3 - var/burst_delay = 1 - var/fire_delay = null - var/move_delay = 1 - var/list/accuracy = list(0) - var/list/dispersion = list(0.2) + burst = 3 + burst_delay = 1 + fire_delay = null + move_delay = 1 + list/accuracy = list(0) + list/dispersion = list(0.2) From a82602c00511b9dad61324663ba868ed65d01098 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 11:08:47 +0100 Subject: [PATCH 012/107] Reworked driver firemodes --- .../guns/modular/components/driver.dm | 62 ++++++------------- 1 file changed, 19 insertions(+), 43 deletions(-) diff --git a/code/modules/projectiles/guns/modular/components/driver.dm b/code/modules/projectiles/guns/modular/components/driver.dm index f4ca5a04991ca..7ee458ec091de 100644 --- a/code/modules/projectiles/guns/modular/components/driver.dm +++ b/code/modules/projectiles/guns/modular/components/driver.dm @@ -12,59 +12,35 @@ obj/item/weapon/modular_firearms/driver icon = 'icons/placeholder.dmi' - var/burst = 1 - var/burst_delay = null - var/fire_delay = null - var/move_delay = 1 - var/list/accuracy = list(0) - var/list/dispersion = list(0) + var/list/firemodes = list( + list(name="semiauto", burst=1, fire_delay=0) + ) -obj/item/weapon/modular_firearms/driver/autoinacc +obj/item/weapon/modular_firearms/driver/longburst name = "rapid-automatic driver" icon = 'icons/placeholder.dmi' - burst = 7 - burst_delay = null - fire_delay = null - move_delay = 1 - list/accuracy = list(0) - list/dispersion = list(1.5) + firemodes = list( + list(name="long bursts", burst=8, move_delay=8, accuracy = list(0,-1,-1,-2,-2,-2,-3,-3), dispersion = list(1.0, 1.0, 1.0, 1.0, 1.2)), + list(name="short bursts", burst=5, move_delay=6, accuracy = list(0,-1,-1,-2,-2,-2,-3,-3), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2)) + ) obj/item/weapon/modular_firearms/driver/semiauto name = "semi-automatic driver" icon = 'icons/placeholder.dmi' - burst = 1 - burst_delay = null - fire_delay = null - move_delay = 1 - list/accuracy = list(0) - list/dispersion = list(0) obj/item/weapon/modular_firearms/driver/burst3 name = "burst driver" icon = 'icons/placeholder.dmi' - burst = 3 - burst_delay = null - fire_delay = null - move_delay = 1 - list/accuracy = list(0) - list/dispersion = list(0.4) + firemodes = list( + list(name="3-round bursts", burst=3, move_delay=6, accuracy = list(0,-1,-1), dispersion = list(0.0, 0.6, 0.6)), + list(name="semiauto", burst=1, fire_delay=0) + ) -obj/item/weapon/modular_firearms/driver/auto - name = "automatic driver" +obj/item/weapon/modular_firearms/driver/burst5 + name = "5-burst driver" icon = 'icons/placeholder.dmi' - burst = 5 - burst_delay = null - fire_delay = null - move_delay = 1 - list/accuracy = list(0) - list/dispersion = list(0.5) - -obj/item/weapon/modular_firearms/driver/preciseburst - name = "precision burst driver" - icon = 'icons/placeholder.dmi' - burst = 3 - burst_delay = 1 - fire_delay = null - move_delay = 1 - list/accuracy = list(0) - list/dispersion = list(0.2) + firemodes = list( + list(name="short bursts", burst=5, move_delay=6, accuracy = list(0,-1,-1,-2,-2,-2,-3,-3), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2)), + list(name="3-round bursts", burst=3, move_delay=6, accuracy = list(0,-1,-1), dispersion = list(0.0, 0.6, 0.6)), + list(name="semiauto", burst=1, fire_delay=0) + ) From 6f4dcd8d788169b1df397747a31e76eca8ce1613 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 11:12:49 +0100 Subject: [PATCH 013/107] Reworked driver firemodes --- .../projectiles/guns/modular/assembly.dm | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index a757343ef936d..f0fadfb77697b 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -37,12 +37,7 @@ obj/item/weapon/modular_firearms/assembly var/haspin = 0 var/buildstage = 1 var/list/components = new/list() - var/burst = 1 - var/burst_delay = null - var/fire_delay = null - var/move_delay = 1 - var/list/accuracy = list(0) - var/list/dispersion = list(0) + var/list/firemodes = list() /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) if(buildstage == 1) @@ -91,13 +86,9 @@ obj/item/weapon/modular_firearms/assembly components += I modDriver = I var/obj/item/weapon/modular_firearms/driver/D = I - if(D.burst) - burst = D.burst - burst_delay = D.burst_delay - fire_delay = D.fire_delay - move_delay = D.move_delay - accuracy = D.accuracy - dispersion = D.dispersion + if(D.firemodes) + for(D.firemodes) + list/firemodes += D.firemodes else user << "\red How did you manage this?" user << "\blue You install the [I] into the [src]." From 18b5525bdef832db67854e33883178b451da50e3 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 11:24:51 +0100 Subject: [PATCH 014/107] Added loaders --- .../guns/modular/components/loader.dm | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index 396c65c8c4d3c..6e14452bbff67 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -1,4 +1,35 @@ //Loaders are how the gun handles ammuni obj/item/weapon/modular_firearms/loader - icon = 'icons/placeholder.dmi' \ No newline at end of file + icon = 'icons/placeholder.dmi' + var/load_method = null + var/isbolt = null + +obj/item/weapon/modular_firearms/loader/magazine + name = "magazine loader" + load_method = MAGAZINE + handle_casings = EJECT_CASINGS + +obj/item/weapon/modular_firearms/loader/speedloader + name = "speedloader" + load_method = SPEEDLOADER + handle_casings = EJECT_CASINGS + +obj/item/weapon/modular_firearms/loader/shell + name = "shell loader" + load_method = SINGLE_CASING + handle_casings = HOLD_CASINGS + var/max_shells = 4 + +obj/item/weapon/modular_firearms/loader/combat //lockbox + name = "combat shell loader" + load_method = SINGLE_CASING + handle_casings = HOLD_CASINGS + var/max_shells = 7 + +obj/item/weapon/modular_firearms/loader/bolt + name = "bolt loader" + load_method = SINGLE_CASING + handle_casings = HOLD_CASINGS + max_shells = 1 + isbolt = 1 From 78258d913d0ebc08f661c028071f2e728c58a360 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 11:25:34 +0100 Subject: [PATCH 015/107] Moved the C.shell under shell --- code/modules/projectiles/guns/modular/components/loader.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index 6e14452bbff67..539ec15b929e6 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -21,10 +21,8 @@ obj/item/weapon/modular_firearms/loader/shell handle_casings = HOLD_CASINGS var/max_shells = 4 -obj/item/weapon/modular_firearms/loader/combat //lockbox +obj/item/weapon/modular_firearms/loader/shell/combat //lockbox name = "combat shell loader" - load_method = SINGLE_CASING - handle_casings = HOLD_CASINGS var/max_shells = 7 obj/item/weapon/modular_firearms/loader/bolt From 7d7c46d7e5e64a448ecccb400e763f63591ded12 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 11:32:36 +0100 Subject: [PATCH 016/107] Added loaders, and commenting --- .../projectiles/guns/modular/assembly.dm | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index f0fadfb77697b..d8c9c4a34fc2a 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -37,7 +37,11 @@ obj/item/weapon/modular_firearms/assembly var/haspin = 0 var/buildstage = 1 var/list/components = new/list() - var/list/firemodes = list() + var/load_method = null + var/handle_casings = null + var/isbolt = null + var/max_shells = null + var/list/firemodes = list() //dear lord that's a lot of variables. I'm sure there's a much better way of doing this. /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) if(buildstage == 1) @@ -63,14 +67,14 @@ obj/item/weapon/modular_firearms/assembly components += I modChamber = I var/obj/item/weapon/modular_firearms/chamber/chamber = I - if(chamber.projectile_type) + if(chamber.projectile_type) //checking for energy weaponry if(isEnergy) - projectile_type = chamber.projectile_type + projectile_type = chamber.projectile_type //if it's an energy weapon, copy the beam type into the assembly else user << "\red A ballistic chamber won't work with an energy chassis!" - if(chamber.caliber) + if(chamber.caliber) //checking for kinetic weaponry if(isKinetic) - caliber = chamber.caliber + caliber = chamber.caliber //if it's a kinetic weapon, copy the calibre into the assembly else user << "\red An energy chamber won't work with a ballistic chassis!" user << "\blue You install the [I] onto the [src]. Now you should install the driver." @@ -86,8 +90,8 @@ obj/item/weapon/modular_firearms/assembly components += I modDriver = I var/obj/item/weapon/modular_firearms/driver/D = I - if(D.firemodes) - for(D.firemodes) + if(D.firemodes) //just to check that they didn't make it past the istype check using the base driver, although that shouldn't be obtainable + for(D.firemodes) //for each firemode the driver has, add it to our list list/firemodes += D.firemodes else user << "\red How did you manage this?" @@ -100,7 +104,18 @@ obj/item/weapon/modular_firearms/assembly user.drop_item() I.loc = src components += I + modLoader = I + var/obj.item/weapon/modular_firearms/loader/L = I + load_method = L.load_method //copy the firetype into the assembly + handle_casings = L.handle_casings + if(L.isbolt) //if it's a bolt weapon, set bolt to true + isbolt = 1 + if(L.max_shells) //if it's a shotgun or a bolt action, set their max shell count + max_shells = L.max_shells + user << "\blue You install the [I] into the [src]." buildstage += 1 + else + user << "\red You must install a loader first!" else if(buildstage == 5) if(istype(I, /obj/item/weapon/modular_firearms/barrel)) From 53a221b91d881ba85bb91020ea6ef958a850da3e Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 11:37:51 +0100 Subject: [PATCH 017/107] Quick patch --- code/modules/projectiles/guns/modular/core.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index bde46b073ac59..493727d4e31a5 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -1,4 +1,4 @@ -/datum/firemode/modular +/*/datum/firemode/modular name = "modular-default" burst = 1 burst_delay = null @@ -55,7 +55,7 @@ var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them. var/tmp/lock_time = -100 */ - +/* /obj/item/weapon/gun/modular name = "basic assembly" desc = "The outer framework for a firearm of some kind. This one looks rather basic." @@ -76,4 +76,4 @@ var/isEnergy = null var/isKinetic = null - +*/ From 04337535da855172352821390dccdca13f2f8fab Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 11:40:56 +0100 Subject: [PATCH 018/107] Will test travis --- baystation12.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baystation12.dme b/baystation12.dme index f517aa982671b..23b172cf58ed5 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1,4 +1,4 @@ -// DM Environment file for baystation12.dme. +// Dream Maker Environment file for baystation12.dme. // All manual changes should be made outside the BEGIN_ and END_ blocks. // New source code should be placed in .dm files: choose File/New --> Code File. // BEGIN_INTERNALS From 1d7bfe48d551b7eb15496529e4fa5711cb9a7294 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:41:11 +0100 Subject: [PATCH 019/107] Revert --- baystation12.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baystation12.dme b/baystation12.dme index 23b172cf58ed5..f517aa982671b 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1,4 +1,4 @@ -// Dream Maker Environment file for baystation12.dme. +// DM Environment file for baystation12.dme. // All manual changes should be made outside the BEGIN_ and END_ blocks. // New source code should be placed in .dm files: choose File/New --> Code File. // BEGIN_INTERNALS From c72ac0843331842f04edb799e20e056d841bc8df Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:42:53 +0100 Subject: [PATCH 020/107] Create energy.dm --- code/modules/projectiles/guns/modular/premade/energy.dm | 1 + 1 file changed, 1 insertion(+) create mode 100644 code/modules/projectiles/guns/modular/premade/energy.dm diff --git a/code/modules/projectiles/guns/modular/premade/energy.dm b/code/modules/projectiles/guns/modular/premade/energy.dm new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/code/modules/projectiles/guns/modular/premade/energy.dm @@ -0,0 +1 @@ + From 93cc95cb1c8eed871909f894281fb9d36e2115b9 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:43:13 +0100 Subject: [PATCH 021/107] Create automatic --- .../projectiles/guns/modular/premade/projectile/automatic | 1 + 1 file changed, 1 insertion(+) create mode 100644 code/modules/projectiles/guns/modular/premade/projectile/automatic diff --git a/code/modules/projectiles/guns/modular/premade/projectile/automatic b/code/modules/projectiles/guns/modular/premade/projectile/automatic new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/code/modules/projectiles/guns/modular/premade/projectile/automatic @@ -0,0 +1 @@ + From aa43d174fa7e96c5b92d4c377481502f144cd6e6 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:43:20 +0100 Subject: [PATCH 022/107] Create shotgun.dm --- .../projectiles/guns/modular/premade/projectile/shotgun.dm | 1 + 1 file changed, 1 insertion(+) create mode 100644 code/modules/projectiles/guns/modular/premade/projectile/shotgun.dm diff --git a/code/modules/projectiles/guns/modular/premade/projectile/shotgun.dm b/code/modules/projectiles/guns/modular/premade/projectile/shotgun.dm new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/code/modules/projectiles/guns/modular/premade/projectile/shotgun.dm @@ -0,0 +1 @@ + From 2a6ac615051624738ecb1f12fbc71682e9533197 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:43:28 +0100 Subject: [PATCH 023/107] Rename automatic to automatic.dm --- .../guns/modular/premade/projectile/{automatic => automatic.dm} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename code/modules/projectiles/guns/modular/premade/projectile/{automatic => automatic.dm} (100%) diff --git a/code/modules/projectiles/guns/modular/premade/projectile/automatic b/code/modules/projectiles/guns/modular/premade/projectile/automatic.dm similarity index 100% rename from code/modules/projectiles/guns/modular/premade/projectile/automatic rename to code/modules/projectiles/guns/modular/premade/projectile/automatic.dm From 4453824af244cd01f3dacfb3a49dde3d9cebe028 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:43:39 +0100 Subject: [PATCH 024/107] Create sniper.dm --- .../projectiles/guns/modular/premade/projectile/sniper.dm | 1 + 1 file changed, 1 insertion(+) create mode 100644 code/modules/projectiles/guns/modular/premade/projectile/sniper.dm diff --git a/code/modules/projectiles/guns/modular/premade/projectile/sniper.dm b/code/modules/projectiles/guns/modular/premade/projectile/sniper.dm new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/code/modules/projectiles/guns/modular/premade/projectile/sniper.dm @@ -0,0 +1 @@ + From 9874a984037c1166b93f46c4b173210215d57b41 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:43:47 +0100 Subject: [PATCH 025/107] Create pistol.dm --- .../projectiles/guns/modular/premade/projectile/pistol.dm | 1 + 1 file changed, 1 insertion(+) create mode 100644 code/modules/projectiles/guns/modular/premade/projectile/pistol.dm diff --git a/code/modules/projectiles/guns/modular/premade/projectile/pistol.dm b/code/modules/projectiles/guns/modular/premade/projectile/pistol.dm new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/code/modules/projectiles/guns/modular/premade/projectile/pistol.dm @@ -0,0 +1 @@ + From 4029a0db0a1f33fa8bca037c220db79b918ce4b7 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:43:58 +0100 Subject: [PATCH 026/107] Delete energy.dm --- code/modules/projectiles/guns/modular/premade/energy.dm | 1 - 1 file changed, 1 deletion(-) delete mode 100644 code/modules/projectiles/guns/modular/premade/energy.dm diff --git a/code/modules/projectiles/guns/modular/premade/energy.dm b/code/modules/projectiles/guns/modular/premade/energy.dm deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/code/modules/projectiles/guns/modular/premade/energy.dm +++ /dev/null @@ -1 +0,0 @@ - From b704897a695afe6c871b01e4234185b7dae0f225 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:44:16 +0100 Subject: [PATCH 027/107] Create beam.dm --- code/modules/projectiles/guns/modular/premade/energy/beam.dm | 1 + 1 file changed, 1 insertion(+) create mode 100644 code/modules/projectiles/guns/modular/premade/energy/beam.dm diff --git a/code/modules/projectiles/guns/modular/premade/energy/beam.dm b/code/modules/projectiles/guns/modular/premade/energy/beam.dm new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/code/modules/projectiles/guns/modular/premade/energy/beam.dm @@ -0,0 +1 @@ + From 8829218abe247755b4f34213dd7313009a538d6b Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:44:32 +0100 Subject: [PATCH 028/107] Create special.dm --- code/modules/projectiles/guns/modular/premade/energy/special.dm | 1 + 1 file changed, 1 insertion(+) create mode 100644 code/modules/projectiles/guns/modular/premade/energy/special.dm diff --git a/code/modules/projectiles/guns/modular/premade/energy/special.dm b/code/modules/projectiles/guns/modular/premade/energy/special.dm new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/code/modules/projectiles/guns/modular/premade/energy/special.dm @@ -0,0 +1 @@ + From be91923f29617a396face719cc6dde225916af0c Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:44:46 +0100 Subject: [PATCH 029/107] Create nuclear.dm --- code/modules/projectiles/guns/modular/premade/energy/nuclear.dm | 1 + 1 file changed, 1 insertion(+) create mode 100644 code/modules/projectiles/guns/modular/premade/energy/nuclear.dm diff --git a/code/modules/projectiles/guns/modular/premade/energy/nuclear.dm b/code/modules/projectiles/guns/modular/premade/energy/nuclear.dm new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/code/modules/projectiles/guns/modular/premade/energy/nuclear.dm @@ -0,0 +1 @@ + From a9eba3646a63911980182c7d2585743d9b595818 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:45:15 +0100 Subject: [PATCH 030/107] Create dart.dm --- code/modules/projectiles/guns/modular/premade/projectile/dart.dm | 1 + 1 file changed, 1 insertion(+) create mode 100644 code/modules/projectiles/guns/modular/premade/projectile/dart.dm diff --git a/code/modules/projectiles/guns/modular/premade/projectile/dart.dm b/code/modules/projectiles/guns/modular/premade/projectile/dart.dm new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/code/modules/projectiles/guns/modular/premade/projectile/dart.dm @@ -0,0 +1 @@ + From 6223b8c1a20ec29d9f22a677ca585122fbac70d5 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 13:57:52 +0100 Subject: [PATCH 031/107] Added energy loaders --- .../guns/modular/components/loader.dm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index 539ec15b929e6..df16b3c955b06 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -4,6 +4,9 @@ obj/item/weapon/modular_firearms/loader icon = 'icons/placeholder.dmi' var/load_method = null var/isbolt = null + var/useCell = null + var/useSupply = null + var/Eloader = null obj/item/weapon/modular_firearms/loader/magazine name = "magazine loader" @@ -31,3 +34,16 @@ obj/item/weapon/modular_firearms/loader/bolt handle_casings = HOLD_CASINGS max_shells = 1 isbolt = 1 + +obj/item/weapon/modular_firearms/loader/cellport + name = "cell port" + icon = 'icons/placeholder.dmi' + useCell = 1 + Eloader = 1 + +obj/item/weapon/modular_firearms/loader/powersupply + name = "internal power supply" + icon = 'icons/placeholder.dmi' + useSupply = 1 + Eloader = 1 + From 17b8dacf167b0384e2b3a852ea22916070b102ae Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 14:06:25 +0100 Subject: [PATCH 032/107] Var refactor Will now use a compile_gun() proc to load all the vars, so that premade guns work --- .../projectiles/guns/modular/assembly.dm | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index d8c9c4a34fc2a..75e353a23b093 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -21,27 +21,20 @@ obj/item/weapon/modular_firearms/assembly var/modBarrel = null var/modStock = null var/modLock = null - var/firemode = /datum/firemode/modular var/modSight = null var/modMisc = list() - var/projectile_type = null var/framelevel = 2 - var/chargecost = null var/weight = 1 var/isEnergy = null var/isKinetic = null - var/caliber var/silenced = null - var/accuracy_mod = null var/compensated = null var/haspin = 0 var/buildstage = 1 var/list/components = new/list() - var/load_method = null - var/handle_casings = null - var/isbolt = null - var/max_shells = null - var/list/firemodes = list() //dear lord that's a lot of variables. I'm sure there's a much better way of doing this. + var/useCell = null + var/useSupply = null + var/useBullet = null /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) if(buildstage == 1) @@ -69,14 +62,18 @@ obj/item/weapon/modular_firearms/assembly var/obj/item/weapon/modular_firearms/chamber/chamber = I if(chamber.projectile_type) //checking for energy weaponry if(isEnergy) - projectile_type = chamber.projectile_type //if it's an energy weapon, copy the beam type into the assembly + continue + // projectile_type = chamber.projectile_type //if it's an energy weapon, copy the beam type into the assembly else user << "\red A ballistic chamber won't work with an energy chassis!" + return if(chamber.caliber) //checking for kinetic weaponry if(isKinetic) - caliber = chamber.caliber //if it's a kinetic weapon, copy the calibre into the assembly + continue + // caliber = chamber.caliber //if it's a kinetic weapon, copy the calibre into the assembly else user << "\red An energy chamber won't work with a ballistic chassis!" + return user << "\blue You install the [I] onto the [src]. Now you should install the driver." // weight = I.weight + weight buildstage += 1 @@ -90,11 +87,11 @@ obj/item/weapon/modular_firearms/assembly components += I modDriver = I var/obj/item/weapon/modular_firearms/driver/D = I - if(D.firemodes) //just to check that they didn't make it past the istype check using the base driver, although that shouldn't be obtainable - for(D.firemodes) //for each firemode the driver has, add it to our list - list/firemodes += D.firemodes + if(D.firemodes) + continue else user << "\red How did you manage this?" + return user << "\blue You install the [I] into the [src]." buildstage += 1 else @@ -106,12 +103,19 @@ obj/item/weapon/modular_firearms/assembly components += I modLoader = I var/obj.item/weapon/modular_firearms/loader/L = I - load_method = L.load_method //copy the firetype into the assembly - handle_casings = L.handle_casings - if(L.isbolt) //if it's a bolt weapon, set bolt to true - isbolt = 1 - if(L.max_shells) //if it's a shotgun or a bolt action, set their max shell count - max_shells = L.max_shells +// load_method = L.load_method //copy the firetype into the assembly +// handle_casings = L.handle_casings + if(!L.Eloader) + useBullet = 1 + // if(L.isbolt) //if it's a bolt weapon, set bolt to true + // isbolt = 1 + // if(L.max_shells) //if it's a shotgun or a bolt action, set their max shell count + // max_shells = L.max_shells + if(L.Eloader) + if(L.useCell) + useCell = 1 + if(L.useSupply) + useSupply = 1 user << "\blue You install the [I] into the [src]." buildstage += 1 else @@ -137,3 +141,5 @@ obj/item/weapon/modular_firearms/assembly I.loc = src components += I buildstage += 1 + + From 8c03525d4305c649a943f660ace1d411d3411537 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 14:07:23 +0100 Subject: [PATCH 033/107] Removed obsolete code --- code/modules/projectiles/guns/modular/assembly.dm | 8 -------- 1 file changed, 8 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 75e353a23b093..5cc28aa9c4e5c 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -63,14 +63,12 @@ obj/item/weapon/modular_firearms/assembly if(chamber.projectile_type) //checking for energy weaponry if(isEnergy) continue - // projectile_type = chamber.projectile_type //if it's an energy weapon, copy the beam type into the assembly else user << "\red A ballistic chamber won't work with an energy chassis!" return if(chamber.caliber) //checking for kinetic weaponry if(isKinetic) continue - // caliber = chamber.caliber //if it's a kinetic weapon, copy the calibre into the assembly else user << "\red An energy chamber won't work with a ballistic chassis!" return @@ -103,14 +101,8 @@ obj/item/weapon/modular_firearms/assembly components += I modLoader = I var/obj.item/weapon/modular_firearms/loader/L = I -// load_method = L.load_method //copy the firetype into the assembly -// handle_casings = L.handle_casings if(!L.Eloader) useBullet = 1 - // if(L.isbolt) //if it's a bolt weapon, set bolt to true - // isbolt = 1 - // if(L.max_shells) //if it's a shotgun or a bolt action, set their max shell count - // max_shells = L.max_shells if(L.Eloader) if(L.useCell) useCell = 1 From 09a27fbd6a62cf257d1182bfb8c16c4e773a4421 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 14:10:26 +0100 Subject: [PATCH 034/107] Wiped core.dm, different purpose --- code/modules/projectiles/guns/modular/core.dm | 80 +------------------ 1 file changed, 1 insertion(+), 79 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 493727d4e31a5..e91091d074b2e 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -1,79 +1 @@ -/*/datum/firemode/modular - name = "modular-default" - burst = 1 - burst_delay = null - fire_delay = null - move_delay = 1 - list/accuracy = list(0) - list/dispersion = list(0) - - - /* - name = "gun" - desc = "Its a gun. It's pretty terrible, though." - icon = 'icons/obj/gun.dmi' - item_icons = list( - slot_l_hand_str = 'icons/mob/items/lefthand_guns.dmi', - slot_r_hand_str = 'icons/mob/items/righthand_guns.dmi', - ) - icon_state = "detective" - item_state = "gun" - flags = CONDUCT - slot_flags = SLOT_BELT|SLOT_HOLSTER - matter = list(DEFAULT_WALL_MATERIAL = 2000) - w_class = 3 - throwforce = 5 - throw_speed = 4 - throw_range = 5 - force = 5 - origin_tech = "combat=1" - attack_verb = list("struck", "hit", "bashed") - zoomdevicename = "scope" - - var/fire_delay = 6 //delay after shooting before the gun can be used again - var/burst_delay = 2 //delay between shots, if firing in bursts - var/fire_sound = 'sound/weapons/Gunshot.ogg' - var/fire_sound_text = "gunshot" - var/recoil = 0 //screen shake - var/silenced = 0 - var/muzzle_flash = 3 - var/accuracy = 0 //accuracy is measured in tiles. +1 accuracy means that everything is effectively one tile closer for the purpose of miss chance, -1 means the opposite. launchers are not supported, at the moment. - var/scoped_accuracy = null - - var/next_fire_time = 0 - - var/sel_mode = 1 //index of the currently selected mode - var/list/firemodes = list() - var/firemode_type = /datum/firemode //for subtypes that need custom firemode data - - //aiming system stuff - var/keep_aim = 1 //1 for keep shooting until aim is lowered - //0 for one bullet after tarrget moves and aim is lowered - var/multi_aim = 0 //Used to determine if you can target multiple people. - var/tmp/list/mob/living/aim_targets //List of who yer targeting. - var/tmp/mob/living/last_moved_mob //Used to fire faster at more than one person. - var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them. - var/tmp/lock_time = -100 - */ -/* -/obj/item/weapon/gun/modular - name = "basic assembly" - desc = "The outer framework for a firearm of some kind. This one looks rather basic." - icon = 'icons/placeholder.dmi' - var/modAssembly = null - var/modChassis = null - var/modChamber = null - var/modDriver = null - var/modLoader = null - var/modBarrel = null - var/modStock = null - var/modLock = null - var/modSight = null - var/modMisc = list() - var/framelevel = 2 - var/weight = 1 - var/guntype = null - var/isEnergy = null - var/isKinetic = null - -*/ +//Will be used for procs instead From 44b88b5f983ae056db048ad4cfdcf3f691c53875 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 14:13:57 +0100 Subject: [PATCH 035/107] Continue fix --- code/modules/projectiles/guns/modular/assembly.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 5cc28aa9c4e5c..0e5ce713ada11 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -62,13 +62,11 @@ obj/item/weapon/modular_firearms/assembly var/obj/item/weapon/modular_firearms/chamber/chamber = I if(chamber.projectile_type) //checking for energy weaponry if(isEnergy) - continue else user << "\red A ballistic chamber won't work with an energy chassis!" return if(chamber.caliber) //checking for kinetic weaponry if(isKinetic) - continue else user << "\red An energy chamber won't work with a ballistic chassis!" return @@ -86,7 +84,6 @@ obj/item/weapon/modular_firearms/assembly modDriver = I var/obj/item/weapon/modular_firearms/driver/D = I if(D.firemodes) - continue else user << "\red How did you manage this?" return From 63dff89bde9e08f2a311d22f072945f2432e9c0b Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 4 Sep 2015 14:15:21 +0100 Subject: [PATCH 036/107] Var fix --- code/modules/projectiles/guns/modular/components/loader.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index df16b3c955b06..9a61f82755676 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -7,6 +7,7 @@ obj/item/weapon/modular_firearms/loader var/useCell = null var/useSupply = null var/Eloader = null + var/max_shells = null obj/item/weapon/modular_firearms/loader/magazine name = "magazine loader" @@ -22,11 +23,11 @@ obj/item/weapon/modular_firearms/loader/shell name = "shell loader" load_method = SINGLE_CASING handle_casings = HOLD_CASINGS - var/max_shells = 4 + max_shells = 4 obj/item/weapon/modular_firearms/loader/shell/combat //lockbox name = "combat shell loader" - var/max_shells = 7 + max_shells = 7 obj/item/weapon/modular_firearms/loader/bolt name = "bolt loader" From b34ca807bcc3847123cc50dbb0aba57a1f91b157 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 12:11:09 +0100 Subject: [PATCH 037/107] Major component refactor A proc is now used, rather than repeating variables for each time an object is used on the frame. This also means that the proc can be called without attacking the frame, such as if an admin triggers it. This will also be used for dissasembly in the future. --- .../projectiles/guns/modular/assembly.dm | 132 ++++++++++-------- 1 file changed, 75 insertions(+), 57 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 0e5ce713ada11..3698ceb45e88b 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -35,100 +35,118 @@ obj/item/weapon/modular_firearms/assembly var/useCell = null var/useSupply = null var/useBullet = null + +/obj/item/weapon/modular_firearms/assembly/process_part(obj/item/I as obj, mob/user as mob) + if(istype(I, /obj/item/weapon/modular_firearms/chassis)) + if(istype(I, /obj/item/weapon/modular_firearms/chassis/energy)) + isEnergy = 1 + if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) + isKinetic = 1 + if(istype(I, /obj/item/weapon/modular_firearms/chamber)) + var/obj/item/weapon/modular_firearms/chamber/chamber = I + if(chamber.projectile_type) //checking for energy weaponry + if(isEnergy) + else + user << "\red A ballistic chamber won't work with an energy chassis!" + return + if(chamber.caliber) //checking for kinetic weaponry + if(isKinetic) + else + user << "\red An energy chamber won't work with a ballistic chassis!" + return + if(istype(I, /obj/item/weapon/modular_firearms/driver)) + var/obj/item/weapon/modular_firearms/driver/D = I + if(D.firemodes) + else + user << "\red How did you manage this?" + return + if(istype(I, /obj/item/weapon/modular_firearms/loader)) + var/obj/item/weapon/modular_firearms/loader/L = I + if(!L.Eloader) + useBullet = 1 + if(L.Eloader) + if(L.useCell) + useCell = 1 + if(L.useSupply) + useSupply = 1 + if(istype(I, /obj/item/weapon/modular_firearms/barrel)) + if(istype(I, /obj/item/weapon/modular_firearms/stock)) + if(istype(I, /obj/item/weapon/modular_firearms/scope)) + /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) - if(buildstage == 1) - if(istype(I, /obj/item/weapon/modular_firearms/chassis)) + if(istype(I, /obj/item/weapon/modular_firearms/chassis)) + if(!modChassis) user.drop_item() I.loc = src components += I modChassis = I - if(istype(I, /obj/item/weapon/modular_firearms/chassis/energy)) - isEnergy = 1 - if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) - isKinetic = 1 + process_part(I, user) user << "\blue You install the [I] onto the [src]. Now you should install a chamber." // weight = I.weight + weight - buildstage += 1 else - user << "\red You must install a chassis first!" - else if(buildstage == 2) - if(istype(I, /obj/item/weapon/modular_firearms/chamber)) + if(istype(I, /obj/item/weapon/modular_firearms/chamber)) + if((!modChamber) && (modChassis)) user.drop_item() I.loc = src components += I modChamber = I - var/obj/item/weapon/modular_firearms/chamber/chamber = I - if(chamber.projectile_type) //checking for energy weaponry - if(isEnergy) - else - user << "\red A ballistic chamber won't work with an energy chassis!" - return - if(chamber.caliber) //checking for kinetic weaponry - if(isKinetic) - else - user << "\red An energy chamber won't work with a ballistic chassis!" - return - user << "\blue You install the [I] onto the [src]. Now you should install the driver." + process_part(I, user) + user << "\blue You install the [I] onto the [src]." // weight = I.weight + weight - buildstage += 1 - else - user << "\red You must install a chamber first!" + else if(modChamber) + user << "\red There is already a [modChamber] installed!" + else if(!modChamber) + user << "\red The [I] needs to be attached to a chassis!" - else if(buildstage == 3) - if(istype(I, /obj/item/weapon/modular_firearms/driver)) + if(istype(I, /obj/item/weapon/modular_firearms/driver)) + if((!modDriver) && (modChamber)) user.drop_item() I.loc = src components += I modDriver = I - var/obj/item/weapon/modular_firearms/driver/D = I - if(D.firemodes) - else - user << "\red How did you manage this?" - return - user << "\blue You install the [I] into the [src]." - buildstage += 1 - else - user << "\red You must install a driver first!" - else if(buildstage == 4) - if(istype(I, /obj/item/weapon/modular_firearms/loader)) + process_part(I, user) + user << "\blue You install the [I] onto the [src]." + else if(modDriver) + user << "\red There is already a [modDriver] installed!" + else if(!modChamber) + user << "\red The [I] needs to be attached to a chamber!" + + if(istype(I, /obj/item/weapon/modular_firearms/loader)) + if((!modLoader) && (modChamber)) user.drop_item() I.loc = src components += I modLoader = I - var/obj.item/weapon/modular_firearms/loader/L = I - if(!L.Eloader) - useBullet = 1 - if(L.Eloader) - if(L.useCell) - useCell = 1 - if(L.useSupply) - useSupply = 1 - user << "\blue You install the [I] into the [src]." - buildstage += 1 - else - user << "\red You must install a loader first!" + process_part(I, user) + user << "\blue You install the [I] onto the [src]." + else if(modLoader) + user << "\red There is already a [modLoader] installed!" + else if(!modChamber) + user << "\red The [I] needs to be attached to a chamber!" - else if(buildstage == 5) - if(istype(I, /obj/item/weapon/modular_firearms/barrel)) + if(istype(I, /obj/item/weapon/modular_firearms/barrel)) + if((!modBarrel) && (modChamber)) user.drop_item() I.loc = src components += I + modBarrel += I buildstage += 1 - else if(buildstage == 6) - if(istype(I, /obj/item/weapon/modular_firearms/stock)) + if(istype(I, /obj/item/weapon/modular_firearms/stock)) + if((!modStock) && (modChassis)) user.drop_item() I.loc = src components += I buildstage += 1 - - else if(buildstage == 7) - if(istype(I, /obj/item/weapon/modular_firearms/lockpin)) + + if(istype(I, /obj/item/weapon/modular_firearms/scope)) + if((!modScope) && (modChassis)) user.drop_item() I.loc = src components += I buildstage += 1 + From 1c5049963b391cbf28f37d9ff80f8189c13bd2df Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 12:16:57 +0100 Subject: [PATCH 038/107] Further refactor Super-clean way of doing it, removing dozens of unnecessary lines of code. This is so CLEEEEEEEEEAN --- .../projectiles/guns/modular/assembly.dm | 45 +++++++------------ 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 3698ceb45e88b..47eeccae3dbe3 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -42,6 +42,7 @@ obj/item/weapon/modular_firearms/assembly isEnergy = 1 if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) isKinetic = 1 + modChassis = I if(istype(I, /obj/item/weapon/modular_firearms/chamber)) var/obj/item/weapon/modular_firearms/chamber/chamber = I if(chamber.projectile_type) //checking for energy weaponry @@ -54,12 +55,14 @@ obj/item/weapon/modular_firearms/assembly else user << "\red An energy chamber won't work with a ballistic chassis!" return + modChamber = I if(istype(I, /obj/item/weapon/modular_firearms/driver)) var/obj/item/weapon/modular_firearms/driver/D = I if(D.firemodes) else user << "\red How did you manage this?" return + modDriver = I if(istype(I, /obj/item/weapon/modular_firearms/loader)) var/obj/item/weapon/modular_firearms/loader/L = I if(!L.Eloader) @@ -69,30 +72,28 @@ obj/item/weapon/modular_firearms/assembly useCell = 1 if(L.useSupply) useSupply = 1 + modLoader = I if(istype(I, /obj/item/weapon/modular_firearms/barrel)) if(istype(I, /obj/item/weapon/modular_firearms/stock)) if(istype(I, /obj/item/weapon/modular_firearms/scope)) +/obj/item/weapon/modular_firearms/assembly/add_part(obj/item/I as obj, mob/user as mob) + user.drop_item() + I.loc = src + components += I + process_part(I, user) /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/weapon/modular_firearms/chassis)) if(!modChassis) - user.drop_item() - I.loc = src - components += I - modChassis = I - process_part(I, user) + add_part(I, user) user << "\blue You install the [I] onto the [src]. Now you should install a chamber." // weight = I.weight + weight else if(istype(I, /obj/item/weapon/modular_firearms/chamber)) if((!modChamber) && (modChassis)) - user.drop_item() - I.loc = src - components += I - modChamber = I - process_part(I, user) + add_part(I, user) user << "\blue You install the [I] onto the [src]." // weight = I.weight + weight else if(modChamber) @@ -102,11 +103,7 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/driver)) if((!modDriver) && (modChamber)) - user.drop_item() - I.loc = src - components += I - modDriver = I - process_part(I, user) + add_part(I, user) user << "\blue You install the [I] onto the [src]." else if(modDriver) user << "\red There is already a [modDriver] installed!" @@ -115,11 +112,7 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/loader)) if((!modLoader) && (modChamber)) - user.drop_item() - I.loc = src - components += I - modLoader = I - process_part(I, user) + add_part(I, user) user << "\blue You install the [I] onto the [src]." else if(modLoader) user << "\red There is already a [modLoader] installed!" @@ -128,24 +121,18 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/barrel)) if((!modBarrel) && (modChamber)) - user.drop_item() - I.loc = src - components += I + add_part(I, user) modBarrel += I buildstage += 1 if(istype(I, /obj/item/weapon/modular_firearms/stock)) if((!modStock) && (modChassis)) - user.drop_item() - I.loc = src - components += I + add_part(I, user) buildstage += 1 if(istype(I, /obj/item/weapon/modular_firearms/scope)) if((!modScope) && (modChassis)) - user.drop_item() - I.loc = src - components += I + add_part(I, user) buildstage += 1 From 7e050917523f82ea69ae59184df6b8914f2c7dea Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 12:18:16 +0100 Subject: [PATCH 039/107] Removed unnecessary vars Buildstage has been entirely removed, thanks to the refactor. --- code/modules/projectiles/guns/modular/assembly.dm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 47eeccae3dbe3..628c7d1c85b26 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -29,8 +29,6 @@ obj/item/weapon/modular_firearms/assembly var/isKinetic = null var/silenced = null var/compensated = null - var/haspin = 0 - var/buildstage = 1 var/list/components = new/list() var/useCell = null var/useSupply = null @@ -123,17 +121,14 @@ obj/item/weapon/modular_firearms/assembly if((!modBarrel) && (modChamber)) add_part(I, user) modBarrel += I - buildstage += 1 if(istype(I, /obj/item/weapon/modular_firearms/stock)) if((!modStock) && (modChassis)) add_part(I, user) - buildstage += 1 if(istype(I, /obj/item/weapon/modular_firearms/scope)) if((!modScope) && (modChassis)) add_part(I, user) - buildstage += 1 From 66a44c2ffa0f273b9c402b943b396e9957ab450b Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 12:22:06 +0100 Subject: [PATCH 040/107] Cleaning up code --- code/modules/projectiles/guns/modular/assembly.dm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 628c7d1c85b26..51e685ada289a 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -34,8 +34,8 @@ obj/item/weapon/modular_firearms/assembly var/useSupply = null var/useBullet = null -/obj/item/weapon/modular_firearms/assembly/process_part(obj/item/I as obj, mob/user as mob) - if(istype(I, /obj/item/weapon/modular_firearms/chassis)) +/obj/item/weapon/modular_firearms/assembly/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)) isEnergy = 1 if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) @@ -72,10 +72,13 @@ obj/item/weapon/modular_firearms/assembly useSupply = 1 modLoader = I if(istype(I, /obj/item/weapon/modular_firearms/barrel)) + modBarrel += I if(istype(I, /obj/item/weapon/modular_firearms/stock)) + modStock += I if(istype(I, /obj/item/weapon/modular_firearms/scope)) + modScope += I -/obj/item/weapon/modular_firearms/assembly/add_part(obj/item/I as obj, mob/user as mob) +/obj/item/weapon/modular_firearms/assembly/add_part(obj/item/I as obj, mob/user as mob) //Handles all part processing in a single proc. So clean~ user.drop_item() I.loc = src components += I @@ -85,7 +88,7 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/chassis)) if(!modChassis) add_part(I, user) - user << "\blue You install the [I] onto the [src]. Now you should install a chamber." + user << "\blue You install the [I] onto the [src]." // weight = I.weight + weight else @@ -120,7 +123,7 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/barrel)) if((!modBarrel) && (modChamber)) add_part(I, user) - modBarrel += I + if(istype(I, /obj/item/weapon/modular_firearms/stock)) if((!modStock) && (modChassis)) From 6fd2b095344abf81210e48ba491bb53d8199107a Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 12:26:31 +0100 Subject: [PATCH 041/107] Moved procs into core --- code/modules/projectiles/guns/modular/core.dm | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index e91091d074b2e..c78c1607e1d55 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -1 +1,52 @@ //Will be used for procs instead + + +/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)) + if(istype(I, /obj/item/weapon/modular_firearms/chassis/energy)) + isEnergy = 1 + if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) + isKinetic = 1 + modChassis = I + if(istype(I, /obj/item/weapon/modular_firearms/chamber)) + var/obj/item/weapon/modular_firearms/chamber/chamber = I + if(chamber.projectile_type) //checking for energy weaponry + if(isEnergy) + else + user << "\red A ballistic chamber won't work with an energy chassis!" + return + if(chamber.caliber) //checking for kinetic weaponry + if(isKinetic) + else + user << "\red An energy chamber won't work with a ballistic chassis!" + return + modChamber = I + if(istype(I, /obj/item/weapon/modular_firearms/driver)) + var/obj/item/weapon/modular_firearms/driver/D = I + if(D.firemodes) + else + user << "\red How did you manage this?" + return + modDriver = I + if(istype(I, /obj/item/weapon/modular_firearms/loader)) + var/obj/item/weapon/modular_firearms/loader/L = I + if(!L.Eloader) + useBullet = 1 + if(L.Eloader) + if(L.useCell) + useCell = 1 + if(L.useSupply) + useSupply = 1 + modLoader = I + if(istype(I, /obj/item/weapon/modular_firearms/barrel)) + modBarrel += I + if(istype(I, /obj/item/weapon/modular_firearms/stock)) + modStock += I + if(istype(I, /obj/item/weapon/modular_firearms/scope)) + modScope += I + +/obj/item/weapon/modular_firearms/assembly/proc/add_part(obj/item/I as obj, mob/user as mob) //Handles all part processing in a single proc. So clean~ + user.drop_item() + I.loc = src + components += I + process_part(I, user) From d95fb536b996302d49c090e8e866f9cde4baeccc Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 12:27:05 +0100 Subject: [PATCH 042/107] Moved procs into core --- .../projectiles/guns/modular/assembly.dm | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 51e685ada289a..38a3887da22c7 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -33,56 +33,6 @@ obj/item/weapon/modular_firearms/assembly var/useCell = null var/useSupply = null var/useBullet = null - -/obj/item/weapon/modular_firearms/assembly/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)) - isEnergy = 1 - if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) - isKinetic = 1 - modChassis = I - if(istype(I, /obj/item/weapon/modular_firearms/chamber)) - var/obj/item/weapon/modular_firearms/chamber/chamber = I - if(chamber.projectile_type) //checking for energy weaponry - if(isEnergy) - else - user << "\red A ballistic chamber won't work with an energy chassis!" - return - if(chamber.caliber) //checking for kinetic weaponry - if(isKinetic) - else - user << "\red An energy chamber won't work with a ballistic chassis!" - return - modChamber = I - if(istype(I, /obj/item/weapon/modular_firearms/driver)) - var/obj/item/weapon/modular_firearms/driver/D = I - if(D.firemodes) - else - user << "\red How did you manage this?" - return - modDriver = I - if(istype(I, /obj/item/weapon/modular_firearms/loader)) - var/obj/item/weapon/modular_firearms/loader/L = I - if(!L.Eloader) - useBullet = 1 - if(L.Eloader) - if(L.useCell) - useCell = 1 - if(L.useSupply) - useSupply = 1 - modLoader = I - if(istype(I, /obj/item/weapon/modular_firearms/barrel)) - modBarrel += I - if(istype(I, /obj/item/weapon/modular_firearms/stock)) - modStock += I - if(istype(I, /obj/item/weapon/modular_firearms/scope)) - modScope += I - -/obj/item/weapon/modular_firearms/assembly/add_part(obj/item/I as obj, mob/user as mob) //Handles all part processing in a single proc. So clean~ - user.drop_item() - I.loc = src - components += I - process_part(I, user) /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/weapon/modular_firearms/chassis)) From c486d7aafb6f011ea388c429cd8e146d00162e13 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 12:34:03 +0100 Subject: [PATCH 043/107] Added testing SRC's Not sure if these are needed, worth seeing if they fix the compile errors. --- code/modules/projectiles/guns/modular/core.dm | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index c78c1607e1d55..32a6bc643833e 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -4,30 +4,30 @@ /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)) if(istype(I, /obj/item/weapon/modular_firearms/chassis/energy)) - isEnergy = 1 + src.isEnergy = 1 if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) - isKinetic = 1 + src.isKinetic = 1 modChassis = I if(istype(I, /obj/item/weapon/modular_firearms/chamber)) var/obj/item/weapon/modular_firearms/chamber/chamber = I if(chamber.projectile_type) //checking for energy weaponry - if(isEnergy) + if(src.isEnergy) else user << "\red A ballistic chamber won't work with an energy chassis!" return if(chamber.caliber) //checking for kinetic weaponry - if(isKinetic) + if(src.isKinetic) else user << "\red An energy chamber won't work with a ballistic chassis!" return - modChamber = I + src.modChamber = I if(istype(I, /obj/item/weapon/modular_firearms/driver)) var/obj/item/weapon/modular_firearms/driver/D = I if(D.firemodes) else user << "\red How did you manage this?" return - modDriver = I + src.modDriver = I if(istype(I, /obj/item/weapon/modular_firearms/loader)) var/obj/item/weapon/modular_firearms/loader/L = I if(!L.Eloader) @@ -37,16 +37,16 @@ useCell = 1 if(L.useSupply) useSupply = 1 - modLoader = I + src.modLoader = I if(istype(I, /obj/item/weapon/modular_firearms/barrel)) - modBarrel += I + src.modBarrel += I if(istype(I, /obj/item/weapon/modular_firearms/stock)) - modStock += I + src.modStock += I if(istype(I, /obj/item/weapon/modular_firearms/scope)) - modScope += I + src.modScope += I /obj/item/weapon/modular_firearms/assembly/proc/add_part(obj/item/I as obj, mob/user as mob) //Handles all part processing in a single proc. So clean~ user.drop_item() I.loc = src - components += I - process_part(I, user) + src.components += I + src.process_part(I, user) From a3aa64d00e34c2e6c226f8260d482a29530fa704 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 13:52:05 +0100 Subject: [PATCH 044/107] Added barrels --- .../guns/modular/components/barrel.dm | 80 ++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/components/barrel.dm b/code/modules/projectiles/guns/modular/components/barrel.dm index b716551b0f4c9..80911c9ea68fb 100644 --- a/code/modules/projectiles/guns/modular/components/barrel.dm +++ b/code/modules/projectiles/guns/modular/components/barrel.dm @@ -2,4 +2,82 @@ //For energy weapons, this refers to focusing chambers. obj/item/weapon/modular_firearms/barrel - icon = 'icons/placeholder.dmi' \ No newline at end of file + name = "barrel" + icon = 'icons/placeholder.dmi' + var/accuracy_mod = null + var/weight = null + +obj/item/weapon/modular_firearms/barrel/sniper + name = "marksman barrel" + accuracy_mod = 1.5 + weight = 4 + +obj/item/weapon/modular_firearms/barrel/rifle + name = "long barrel" + accuracy_mod = 1 + weight = 3 + + +obj/item/weapon/modular_firearms/barrel/standard + name = "standard barrel" + accuracy_mod = 0.5 + weight = 2 + +obj/item/weapon/modular_firearms/barrel/short + name = "short barrel" + accuracy_mod = 0 + weight = 1 + +obj/item/weapon/modular_firearms/barrel/snub + name = "snub barrel" + accuracy_mod = -0.5 + weight = 0 + +obj/item/weapon/modular_firearms/barrel/rotating + name = "rotating barrel" + accuracy_mod = -2 + weight = 3 + var/burst_mod = 3 + + /* //Not quite sure about energy barrels yet. +obj/item/weapon/modular_firearms/barrel/energy + var/power_mod = null + + +obj/item/weapon/modular_firearms/barrel/energy/long + name = "high-refraction focusing chamber" + accuracy_mod = 2 + weight = 3 + power_mod = 4 + +obj/item/weapon/modular_firearms/barrel/energy/high + name = "dense focusing chamber" + accuracy_mod = 1 + weight = 2 + power_mod = 3 + +obj/item/weapon/modular_firearms/barrel/energy/heavy + name = "heavy focusing chamber" + accuracy_mod = 0 + weight = 4 + power_mod = 5 + var/heavyfocus = 1 + +obj/item/weapon/modular_firearms/barrel/energy/standard + name = "regulated focusing chamber" + accuracy_mod = 0 + weight = 1 + power_mod = 2 + +obj/item/weapon/modular_firearms/barrel/energy/standard + name = "simple focusing chamber" + accuracy_mod = 0 + weight = 0.5 + power_mod = 1 + + */ + + + + + From c81005f9f771369d566d1ac669840390f8af6590 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 14:01:57 +0100 Subject: [PATCH 045/107] Added some +fun barrels Good luck ever getting them though. --- .../guns/modular/components/barrel.dm | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/code/modules/projectiles/guns/modular/components/barrel.dm b/code/modules/projectiles/guns/modular/components/barrel.dm index 80911c9ea68fb..e4b7c3268d806 100644 --- a/code/modules/projectiles/guns/modular/components/barrel.dm +++ b/code/modules/projectiles/guns/modular/components/barrel.dm @@ -6,38 +6,51 @@ obj/item/weapon/modular_firearms/barrel icon = 'icons/placeholder.dmi' var/accuracy_mod = null var/weight = null + var/burst_mod = null obj/item/weapon/modular_firearms/barrel/sniper name = "marksman barrel" - accuracy_mod = 1.5 + accuracy_mod = 1 weight = 4 obj/item/weapon/modular_firearms/barrel/rifle name = "long barrel" - accuracy_mod = 1 + accuracy_mod = 0.5 weight = 3 obj/item/weapon/modular_firearms/barrel/standard name = "standard barrel" - accuracy_mod = 0.5 + accuracy_mod = 0 weight = 2 obj/item/weapon/modular_firearms/barrel/short name = "short barrel" - accuracy_mod = 0 + accuracy_mod = -0.5 weight = 1 obj/item/weapon/modular_firearms/barrel/snub name = "snub barrel" - accuracy_mod = -0.5 + accuracy_mod = -1 weight = 0 -obj/item/weapon/modular_firearms/barrel/rotating +obj/item/weapon/modular_firearms/barrel/rotating //boom goes your accuracy. Good luck getting one though name = "rotating barrel" + accuracy_mod = -3 + weight = 5 + burst_mod = 5 + +obj/item/weapon/modular_firearms/barrel/double + name = "double barrel" + accuracy_mod = -1 + weight = 2 + burst_mod = 2 + +obj/item/weapon/modular_firearms/barrel/triple + name = "triple barrel" accuracy_mod = -2 weight = 3 - var/burst_mod = 3 + burst_mod = 3 /* //Not quite sure about energy barrels yet. obj/item/weapon/modular_firearms/barrel/energy From a3079e2ac56423cec4e1006431d244fd3fbfd614 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 14:03:54 +0100 Subject: [PATCH 046/107] Added barrel handling to core --- code/modules/projectiles/guns/modular/core.dm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 32a6bc643833e..4f6b168f85511 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -39,7 +39,12 @@ useSupply = 1 src.modLoader = I if(istype(I, /obj/item/weapon/modular_firearms/barrel)) - src.modBarrel += I + var/obj/item/weapon/modular_firearms/barrel/B = I + src.accuracy_mod += B.accuracy_mod + src.weight += B.weight + if(B.burst_mod) //dear lord + src.burst_mod += B.burst_mod + src.modBarrel += B if(istype(I, /obj/item/weapon/modular_firearms/stock)) src.modStock += I if(istype(I, /obj/item/weapon/modular_firearms/scope)) From 4ab2c73bde320ac042855ed6033a76ffe277125c Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 14:12:28 +0100 Subject: [PATCH 047/107] Added stocks --- .../guns/modular/components/stock.dm | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/components/stock.dm b/code/modules/projectiles/guns/modular/components/stock.dm index b9f5a1a077eec..246c347d8b4f7 100644 --- a/code/modules/projectiles/guns/modular/components/stock.dm +++ b/code/modules/projectiles/guns/modular/components/stock.dm @@ -1,4 +1,35 @@ //Stocks affect the gun's accuracy and recoil, in the case of projectile weaponry. obj/item/weapon/modular_firearms/stock - icon = 'icons/placeholder.dmi' \ No newline at end of file + icon = 'icons/placeholder.dmi' + var/weight = null + var/folding = null + var/telescopic = null + var/recoil_mod = null + +obj/item/weapon/modular_firearms/stock/comp + name = "compound stock" + recoil_mod = -2 + weight = 2 + +obj/item/weapon/modular_firearms/stock/fixed + name = "fixed stock" + recoil_mod = -1.5 + weight = 1.5 + +obj/item/weapon/modular_firearms/stock/folding + name = "folding stock" + recoil_mod = -1 + weight = 1 + folding = 1 + +obj/item/weapon/modular_firearms/stock/tele + name = "telescopic stock" + recoil_mod = -1.5 + weight = 1.5 + telescopic = 1 + +obj/item/weapon/modular_firearms/stock/pistol + name = "pistol stock" + recoil_mod = -0.5 + weight = 0.5 From 21bc19c30e6a426a86250545d9b4ed9d58a83c94 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 14:13:57 +0100 Subject: [PATCH 048/107] Comments --- code/modules/projectiles/guns/modular/components/stock.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/guns/modular/components/stock.dm b/code/modules/projectiles/guns/modular/components/stock.dm index 246c347d8b4f7..2398c2a40b5c9 100644 --- a/code/modules/projectiles/guns/modular/components/stock.dm +++ b/code/modules/projectiles/guns/modular/components/stock.dm @@ -3,8 +3,8 @@ obj/item/weapon/modular_firearms/stock icon = 'icons/placeholder.dmi' var/weight = null - var/folding = null - var/telescopic = null + var/folding = null //can be folded away. Makes the weapon less unwieldy, but removes recoil bonus + var/telescopic = null //can collapse. Slightly better but heavier than the folding stock var/recoil_mod = null obj/item/weapon/modular_firearms/stock/comp @@ -23,7 +23,7 @@ obj/item/weapon/modular_firearms/stock/folding weight = 1 folding = 1 -obj/item/weapon/modular_firearms/stock/tele +obj/item/weapon/modular_firearms/stock/tele //telescopic everything name = "telescopic stock" recoil_mod = -1.5 weight = 1.5 From a7ffae9f99cb9a9f71d4d34ad4cebc3d047bc824 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 7 Sep 2015 14:16:45 +0100 Subject: [PATCH 049/107] Fixed a compile error --- code/modules/projectiles/guns/modular/components/loader.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index 9a61f82755676..9979a63c8a4a9 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -8,6 +8,7 @@ obj/item/weapon/modular_firearms/loader var/useSupply = null var/Eloader = null var/max_shells = null + var/handle_casings = null obj/item/weapon/modular_firearms/loader/magazine name = "magazine loader" From cb4e0640955ebf11166d9555004a2611b5a689e7 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 12:44:30 +0100 Subject: [PATCH 050/107] Small fix --- code/modules/projectiles/guns/modular/assembly.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 38a3887da22c7..c900fd2bacfc2 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -79,8 +79,8 @@ obj/item/weapon/modular_firearms/assembly if((!modStock) && (modChassis)) add_part(I, user) - if(istype(I, /obj/item/weapon/modular_firearms/scope)) - if((!modScope) && (modChassis)) + if(istype(I, /obj/item/weapon/modular_firearms/sight)) + if((!modSight) && (modChassis)) add_part(I, user) From bbdf5a0a32a70ef39dec76609ffa71dc9ef7cd43 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 12:44:43 +0100 Subject: [PATCH 051/107] Small fix --- code/modules/projectiles/guns/modular/core.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 4f6b168f85511..77cfd24f04252 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -47,8 +47,8 @@ src.modBarrel += B if(istype(I, /obj/item/weapon/modular_firearms/stock)) src.modStock += I - if(istype(I, /obj/item/weapon/modular_firearms/scope)) - src.modScope += I + if(istype(I, /obj/item/weapon/modular_firearms/sight)) + src.modSight += I /obj/item/weapon/modular_firearms/assembly/proc/add_part(obj/item/I as obj, mob/user as mob) //Handles all part processing in a single proc. So clean~ user.drop_item() From 14e94b2c9af5a7e1cbbebf615db3395b99757250 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 12:46:27 +0100 Subject: [PATCH 052/107] Fixed assemblies eating parts Hopefully, at least. --- code/modules/projectiles/guns/modular/core.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 77cfd24f04252..667d98c3bc486 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -51,7 +51,7 @@ src.modSight += I /obj/item/weapon/modular_firearms/assembly/proc/add_part(obj/item/I as obj, mob/user as mob) //Handles all part processing in a single proc. So clean~ + src.process_part(I, user) user.drop_item() I.loc = src src.components += I - src.process_part(I, user) From dbb1928519e802dc510d41feb2701364dfa3af0a Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 12:49:19 +0100 Subject: [PATCH 053/107] Added assembly handling for sights and stocks Now for core. --- .../modules/projectiles/guns/modular/assembly.dm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index c900fd2bacfc2..ad5591417d4fa 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -20,7 +20,6 @@ obj/item/weapon/modular_firearms/assembly var/modLoader = null var/modBarrel = null var/modStock = null - var/modLock = null var/modSight = null var/modMisc = list() var/framelevel = 2 @@ -73,15 +72,30 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/barrel)) if((!modBarrel) && (modChamber)) add_part(I, user) + user << "\blue You install the [I] onto the [src]." + else if(modBarrel) + user << "\red There is already a [modBarrel] installed!" + else if(!modChamber) + user << "\red The [I] needs to be attached to a chamber!" if(istype(I, /obj/item/weapon/modular_firearms/stock)) if((!modStock) && (modChassis)) add_part(I, user) + user << "\blue You install the [I] onto the [src]." + else if(modStock) + user << "\red There is already a [modStock] installed!" + else if(!modChassis) + user << "\red The [I] needs to be attached to a chassis!" if(istype(I, /obj/item/weapon/modular_firearms/sight)) if((!modSight) && (modChassis)) add_part(I, user) + user << "\blue You install the [I] onto the [src]." + else if(modSight) + user << "\red There is already a [modStock] installed!" + else if(!modChassis) + user << "\red The [I] needs to be attached to a chassis!" From 8ba16d8a6b2454dee45c5354cf22b6267ff7a8b3 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:03:25 +0100 Subject: [PATCH 054/107] Added a var for error handling --- code/modules/projectiles/guns/modular/assembly.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index ad5591417d4fa..d832be8aca091 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -14,6 +14,7 @@ obj/item/weapon/modular_firearms/assembly name = "basic assembly" desc = "The outer framework for a firearm of some kind. This one looks rather basic." icon = 'icons/placeholder.dmi' + var/msg = null var/modChassis = null var/modChamber = null var/modDriver = null From b54d69267b259af8e139fa13d69de7f7016b809c Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:06:30 +0100 Subject: [PATCH 055/107] Refactored failure messages --- code/modules/projectiles/guns/modular/core.dm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 667d98c3bc486..29135913f77e7 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -1,7 +1,7 @@ //Will be used for procs instead -/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)) +/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)) src.isEnergy = 1 @@ -13,19 +13,19 @@ if(chamber.projectile_type) //checking for energy weaponry if(src.isEnergy) else - user << "\red A ballistic chamber won't work with an energy chassis!" + src.msg = "\red A ballistic chamber won't work with an energy chassis!" return if(chamber.caliber) //checking for kinetic weaponry if(src.isKinetic) else - user << "\red An energy chamber won't work with a ballistic chassis!" + src.msg = "\red An energy chamber won't work with a ballistic chassis!" return src.modChamber = I if(istype(I, /obj/item/weapon/modular_firearms/driver)) var/obj/item/weapon/modular_firearms/driver/D = I if(D.firemodes) else - user << "\red How did you manage this?" + src.msg = "\red Have you considered using a real driver?" return src.modDriver = I if(istype(I, /obj/item/weapon/modular_firearms/loader)) @@ -40,11 +40,7 @@ src.modLoader = I if(istype(I, /obj/item/weapon/modular_firearms/barrel)) var/obj/item/weapon/modular_firearms/barrel/B = I - src.accuracy_mod += B.accuracy_mod - src.weight += B.weight - if(B.burst_mod) //dear lord - src.burst_mod += B.burst_mod - src.modBarrel += B + src.modBarrel = I if(istype(I, /obj/item/weapon/modular_firearms/stock)) src.modStock += I if(istype(I, /obj/item/weapon/modular_firearms/sight)) @@ -52,6 +48,9 @@ /obj/item/weapon/modular_firearms/assembly/proc/add_part(obj/item/I as obj, mob/user as mob) //Handles all part processing in a single proc. So clean~ src.process_part(I, user) + if(!src.msg) + src.msg = ("\blue You install the [I] onto the [src].") + user << src.msg user.drop_item() I.loc = src src.components += I From b76bff180ee1d8ada6a89831af911499cbff74ba Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:07:29 +0100 Subject: [PATCH 056/107] Refactored failure messages and a minor fix --- code/modules/projectiles/guns/modular/assembly.dm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index d832be8aca091..7f5603d1b7148 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -38,14 +38,12 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/chassis)) if(!modChassis) add_part(I, user) - user << "\blue You install the [I] onto the [src]." // weight = I.weight + weight else if(istype(I, /obj/item/weapon/modular_firearms/chamber)) if((!modChamber) && (modChassis)) add_part(I, user) - user << "\blue You install the [I] onto the [src]." // weight = I.weight + weight else if(modChamber) user << "\red There is already a [modChamber] installed!" @@ -55,7 +53,6 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/driver)) if((!modDriver) && (modChamber)) add_part(I, user) - user << "\blue You install the [I] onto the [src]." else if(modDriver) user << "\red There is already a [modDriver] installed!" else if(!modChamber) @@ -64,7 +61,6 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/loader)) if((!modLoader) && (modChamber)) add_part(I, user) - user << "\blue You install the [I] onto the [src]." else if(modLoader) user << "\red There is already a [modLoader] installed!" else if(!modChamber) @@ -73,7 +69,6 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/barrel)) if((!modBarrel) && (modChamber)) add_part(I, user) - user << "\blue You install the [I] onto the [src]." else if(modBarrel) user << "\red There is already a [modBarrel] installed!" else if(!modChamber) @@ -83,7 +78,6 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/stock)) if((!modStock) && (modChassis)) add_part(I, user) - user << "\blue You install the [I] onto the [src]." else if(modStock) user << "\red There is already a [modStock] installed!" else if(!modChassis) @@ -92,9 +86,8 @@ obj/item/weapon/modular_firearms/assembly if(istype(I, /obj/item/weapon/modular_firearms/sight)) if((!modSight) && (modChassis)) add_part(I, user) - user << "\blue You install the [I] onto the [src]." else if(modSight) - user << "\red There is already a [modStock] installed!" + user << "\red There is already a [modSight] installed!" else if(!modChassis) user << "\red The [I] needs to be attached to a chassis!" From b7354c73ce9b8e8d538e9807144dac52e411973b Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:19:38 +0100 Subject: [PATCH 057/107] Glorious refactoring Took out at least 25 lines. Procs are great. --- .../projectiles/guns/modular/assembly.dm | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 7f5603d1b7148..5e1a504ae55d7 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -42,54 +42,41 @@ obj/item/weapon/modular_firearms/assembly else if(istype(I, /obj/item/weapon/modular_firearms/chamber)) + var/part = modChamber + var/prereq = modChassis if((!modChamber) && (modChassis)) add_part(I, user) // weight = I.weight + weight - else if(modChamber) - user << "\red There is already a [modChamber] installed!" - else if(!modChamber) - user << "\red The [I] needs to be attached to a chassis!" if(istype(I, /obj/item/weapon/modular_firearms/driver)) + var/part = modDriver + var/prereq = modChamber if((!modDriver) && (modChamber)) add_part(I, user) - else if(modDriver) - user << "\red There is already a [modDriver] installed!" - else if(!modChamber) - user << "\red The [I] needs to be attached to a chamber!" if(istype(I, /obj/item/weapon/modular_firearms/loader)) + var/part = modLoader + var/prereq = modChamber if((!modLoader) && (modChamber)) add_part(I, user) - else if(modLoader) - user << "\red There is already a [modLoader] installed!" - else if(!modChamber) - user << "\red The [I] needs to be attached to a chamber!" if(istype(I, /obj/item/weapon/modular_firearms/barrel)) + var/part = modBarrel + var/prereq = modChamber if((!modBarrel) && (modChamber)) add_part(I, user) - else if(modBarrel) - user << "\red There is already a [modBarrel] installed!" - else if(!modChamber) - user << "\red The [I] needs to be attached to a chamber!" - if(istype(I, /obj/item/weapon/modular_firearms/stock)) + var/part = modStock + var/prereq = modChassis if((!modStock) && (modChassis)) add_part(I, user) - else if(modStock) - user << "\red There is already a [modStock] installed!" - else if(!modChassis) - user << "\red The [I] needs to be attached to a chassis!" if(istype(I, /obj/item/weapon/modular_firearms/sight)) + var/part = modSight + var/prereq = modChassis if((!modSight) && (modChassis)) add_part(I, user) - else if(modSight) - user << "\red There is already a [modSight] installed!" - else if(!modChassis) - user << "\red The [I] needs to be attached to a chassis!" From 1c3728a87ff0f3c2fe6b6f46a5562d4932655778 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:25:14 +0100 Subject: [PATCH 058/107] Even more refactoring --- .../projectiles/guns/modular/assembly.dm | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 5e1a504ae55d7..db855c09257e7 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -36,47 +36,42 @@ obj/item/weapon/modular_firearms/assembly /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/weapon/modular_firearms/chassis)) - if(!modChassis) - add_part(I, user) + var/part = modChassis + var/prereq = null + add_part(I, user, part, prereq) // weight = I.weight + weight else if(istype(I, /obj/item/weapon/modular_firearms/chamber)) var/part = modChamber var/prereq = modChassis - if((!modChamber) && (modChassis)) - add_part(I, user) + add_part(I, user, part, prereq) // weight = I.weight + weight if(istype(I, /obj/item/weapon/modular_firearms/driver)) var/part = modDriver var/prereq = modChamber - if((!modDriver) && (modChamber)) - add_part(I, user) + add_part(I, user, part, prereq) if(istype(I, /obj/item/weapon/modular_firearms/loader)) var/part = modLoader var/prereq = modChamber - if((!modLoader) && (modChamber)) - add_part(I, user) + add_part(I, user, part, prereq) if(istype(I, /obj/item/weapon/modular_firearms/barrel)) var/part = modBarrel var/prereq = modChamber - if((!modBarrel) && (modChamber)) - add_part(I, user) + add_part(I, user, part, prereq) if(istype(I, /obj/item/weapon/modular_firearms/stock)) var/part = modStock var/prereq = modChassis - if((!modStock) && (modChassis)) - add_part(I, user) + add_part(I, user, part, prereq) if(istype(I, /obj/item/weapon/modular_firearms/sight)) var/part = modSight var/prereq = modChassis - if((!modSight) && (modChassis)) - add_part(I, user) + add_part(I, user, part, prereq) From c3abd3a4d6608296b76d0684bfb33b13585e5b51 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:39:22 +0100 Subject: [PATCH 059/107] Fixed the refactor --- code/modules/projectiles/guns/modular/core.dm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 29135913f77e7..e0a184f38eef8 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -46,7 +46,17 @@ if(istype(I, /obj/item/weapon/modular_firearms/sight)) src.modSight += I -/obj/item/weapon/modular_firearms/assembly/proc/add_part(obj/item/I as obj, mob/user as mob) //Handles all part processing in a single proc. So clean~ +/obj/item/weapon/modular_firearms/assembly/proc/add_part(obj/item/I as obj, mob/user as mob, var/part, var/prereq) //Handles all part processing in a single proc. So clean~ + if(part) + if(part in src.components) + user << "\red There is already a [part] installed!" + return + else + user << "\red Error - null part variable for [I]" + if(prereq) + if(!prereq in src.components) + user << "\red The [I] needs to be attached to a [prereq]!" + return src.process_part(I, user) if(!src.msg) src.msg = ("\blue You install the [I] onto the [src].") From 0439f1ed0485ac315f329f48d73cfa178636b34c Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:40:03 +0100 Subject: [PATCH 060/107] Fixed errors not returning --- code/modules/projectiles/guns/modular/core.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index e0a184f38eef8..276b5a05bfda4 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -53,6 +53,7 @@ return else user << "\red Error - null part variable for [I]" + return if(prereq) if(!prereq in src.components) user << "\red The [I] needs to be attached to a [prereq]!" From 0c1809170d39238ef991dde84233da5b90459216 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:42:01 +0100 Subject: [PATCH 061/107] Cleaned up code, framework for decon --- .../projectiles/guns/modular/assembly.dm | 59 ++++++++----------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index db855c09257e7..f9c3886fc3a69 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -35,42 +35,35 @@ obj/item/weapon/modular_firearms/assembly var/useBullet = null /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) - if(istype(I, /obj/item/weapon/modular_firearms/chassis)) - var/part = modChassis - var/prereq = null - add_part(I, user, part, prereq) - // weight = I.weight + weight - else + if(istype(I, /obj/item/weapon/modular_firearms)) + if(istype(I, /obj/item/weapon/modular_firearms/chassis)) + var/part = modChassis + var/prereq = null + + if(istype(I, /obj/item/weapon/modular_firearms/chamber)) + var/part = modChamber + var/prereq = modChassis + + if(istype(I, /obj/item/weapon/modular_firearms/driver)) + var/part = modDriver + var/prereq = modChamber + + if(istype(I, /obj/item/weapon/modular_firearms/loader)) + var/part = modLoader + var/prereq = modChamber - if(istype(I, /obj/item/weapon/modular_firearms/chamber)) - var/part = modChamber - var/prereq = modChassis - add_part(I, user, part, prereq) - // weight = I.weight + weight + if(istype(I, /obj/item/weapon/modular_firearms/barrel)) + var/part = modBarrel + var/prereq = modChamber - if(istype(I, /obj/item/weapon/modular_firearms/driver)) - var/part = modDriver - var/prereq = modChamber - add_part(I, user, part, prereq) - - if(istype(I, /obj/item/weapon/modular_firearms/loader)) - var/part = modLoader - var/prereq = modChamber - add_part(I, user, part, prereq) - - if(istype(I, /obj/item/weapon/modular_firearms/barrel)) - var/part = modBarrel - var/prereq = modChamber - add_part(I, user, part, prereq) - - if(istype(I, /obj/item/weapon/modular_firearms/stock)) - var/part = modStock - var/prereq = modChassis - add_part(I, user, part, prereq) + if(istype(I, /obj/item/weapon/modular_firearms/stock)) + var/part = modStock + var/prereq = modChassis - if(istype(I, /obj/item/weapon/modular_firearms/sight)) - var/part = modSight - var/prereq = modChassis + if(istype(I, /obj/item/weapon/modular_firearms/sight)) + var/part = modSight + var/prereq = modChassis + add_part(I, user, part, prereq) From 8ce8a7b54b74dcacd8676c2145f6164f757fc245 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:43:19 +0100 Subject: [PATCH 062/107] Removed unnecessary vars --- .../projectiles/guns/modular/assembly.dm | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index f9c3886fc3a69..4145f823fb191 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -36,33 +36,35 @@ obj/item/weapon/modular_firearms/assembly /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/weapon/modular_firearms)) + var/part = null + var/prereq = null if(istype(I, /obj/item/weapon/modular_firearms/chassis)) - var/part = modChassis - var/prereq = null + part = modChassis + prereq = null if(istype(I, /obj/item/weapon/modular_firearms/chamber)) - var/part = modChamber - var/prereq = modChassis + part = modChamber + prereq = modChassis if(istype(I, /obj/item/weapon/modular_firearms/driver)) - var/part = modDriver - var/prereq = modChamber + part = modDriver + prereq = modChamber if(istype(I, /obj/item/weapon/modular_firearms/loader)) - var/part = modLoader - var/prereq = modChamber + part = modLoader + prereq = modChamber if(istype(I, /obj/item/weapon/modular_firearms/barrel)) - var/part = modBarrel - var/prereq = modChamber + part = modBarrel + prereq = modChamber if(istype(I, /obj/item/weapon/modular_firearms/stock)) - var/part = modStock - var/prereq = modChassis + part = modStock + prereq = modChassis if(istype(I, /obj/item/weapon/modular_firearms/sight)) - var/part = modSight - var/prereq = modChassis + part = modSight + prereq = modChassis add_part(I, user, part, prereq) From f0e71978864b2285f9b7de2cbc7ccbb6a6997f8d Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 13:47:31 +0100 Subject: [PATCH 063/107] Added a list --- code/modules/projectiles/guns/modular/assembly.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 4145f823fb191..b6c7f147147d9 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -29,7 +29,8 @@ obj/item/weapon/modular_firearms/assembly var/isKinetic = null var/silenced = null var/compensated = null - var/list/components = new/list() + var/list/components = list() + var/list/removable = list() var/useCell = null var/useSupply = null var/useBullet = null From 65a84cc13c654205cb81d36d179fb20b018be7a1 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 14:06:46 +0100 Subject: [PATCH 064/107] Added a part removal proc --- code/modules/projectiles/guns/modular/core.dm | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 276b5a05bfda4..8c885a26292aa 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -65,3 +65,26 @@ user.drop_item() I.loc = src src.components += I + +/obj/item/weapon/modular_firearms/assembly/proc/remove_part(obj/item/I as obj, mob/user as mob) + var/picked = input("Select part to remove", "none")as null|anything in removable + if(!picked || !removable[picked]) + return + var/removing = removable[picked] + removing.loc = user + src.components -= removing + if(removing = src.modChassis) //will figure out how to make this cleaner at some point + src.modChassis = null + if(removing = src.modChamber) + src.modChamber = null + if(removing = src.modDriver) + src.modDriver = null + if(removing = src.modLoader) + src.modLoader = null + if(removing = src.modBarrel) + src.modBarrel = null + if(removing = src.modSight) + src.modSight = null + if(removing = src.modStock) + src.modStock = null + user << "\red You remove the [removing] from the frame" From 9e2497a1708b2d049ca57cdf988e25af13a73a7f Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 14:10:35 +0100 Subject: [PATCH 065/107] Part removal update --- code/modules/projectiles/guns/modular/core.dm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 8c885a26292aa..4143b6c68a9a0 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -8,6 +8,7 @@ if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) src.isKinetic = 1 modChassis = I + src.removable += I if(istype(I, /obj/item/weapon/modular_firearms/chamber)) var/obj/item/weapon/modular_firearms/chamber/chamber = I if(chamber.projectile_type) //checking for energy weaponry @@ -21,6 +22,8 @@ src.msg = "\red An energy chamber won't work with a ballistic chassis!" return src.modChamber = I + src.removable -= src.modChassis + src.removable += I if(istype(I, /obj/item/weapon/modular_firearms/driver)) var/obj/item/weapon/modular_firearms/driver/D = I if(D.firemodes) @@ -28,6 +31,8 @@ src.msg = "\red Have you considered using a real driver?" return src.modDriver = I + src.removable += I + src.removable -= src.modChamber if(istype(I, /obj/item/weapon/modular_firearms/loader)) var/obj/item/weapon/modular_firearms/loader/L = I if(!L.Eloader) @@ -38,13 +43,21 @@ if(L.useSupply) useSupply = 1 src.modLoader = I + src.removable += I + src.removable -= src.modChamber if(istype(I, /obj/item/weapon/modular_firearms/barrel)) var/obj/item/weapon/modular_firearms/barrel/B = I src.modBarrel = I + src.removable += I + src.removable -= src.modChamber if(istype(I, /obj/item/weapon/modular_firearms/stock)) src.modStock += I + src.removable += I + src.removable -= src.modChassis if(istype(I, /obj/item/weapon/modular_firearms/sight)) src.modSight += I + src.removable += I + src.removable -= src.modChassis /obj/item/weapon/modular_firearms/assembly/proc/add_part(obj/item/I as obj, mob/user as mob, var/part, var/prereq) //Handles all part processing in a single proc. So clean~ if(part) From 49e0eb023828d8f53b370504e8325e0adcb5bd46 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 8 Sep 2015 14:14:28 +0100 Subject: [PATCH 066/107] Hopeful compile fix --- code/modules/projectiles/guns/modular/core.dm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 4143b6c68a9a0..36cab02bf3391 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -86,18 +86,18 @@ var/removing = removable[picked] removing.loc = user src.components -= removing - if(removing = src.modChassis) //will figure out how to make this cleaner at some point + if(removing == src.modChassis) //will figure out how to make this cleaner at some point src.modChassis = null - if(removing = src.modChamber) + if(removing == src.modChamber) src.modChamber = null - if(removing = src.modDriver) + if(removing == src.modDriver) src.modDriver = null - if(removing = src.modLoader) + if(removing == src.modLoader) src.modLoader = null - if(removing = src.modBarrel) + if(removing == src.modBarrel) src.modBarrel = null - if(removing = src.modSight) + if(removing == src.modSight) src.modSight = null - if(removing = src.modStock) + if(removing == src.modStock) src.modStock = null user << "\red You remove the [removing] from the frame" From 77c267f153c01b5bacbe0601be892831f9aeabff Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Wed, 9 Sep 2015 13:19:12 +0100 Subject: [PATCH 067/107] Added attachment handling to disassembly --- code/modules/projectiles/guns/modular/core.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 36cab02bf3391..f82157b1d28f2 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -100,4 +100,6 @@ src.modSight = null if(removing == src.modStock) src.modStock = null + if(removing == src.modAttachment) + src.modAttachment = null user << "\red You remove the [removing] from the frame" From eb51a8d0aaab2be39cd37e9f9f5b391cede4625d Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 11 Sep 2015 14:10:44 +0100 Subject: [PATCH 068/107] Added charge costs --- code/modules/projectiles/guns/modular/components/chamber.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/modules/projectiles/guns/modular/components/chamber.dm b/code/modules/projectiles/guns/modular/components/chamber.dm index 95caf65225df1..1d73eadd9d2a3 100644 --- a/code/modules/projectiles/guns/modular/components/chamber.dm +++ b/code/modules/projectiles/guns/modular/components/chamber.dm @@ -69,6 +69,7 @@ obj/item/weapon/modular_firearms/chamber/a556 caliber = "a556" obj/item/weapon/modular_firearms/chamber/energy + var/charge_cost = 200 obj/item/weapon/modular_firearms/chamber/energy/laser name = "laser emitter" @@ -80,14 +81,17 @@ obj/item/weapon/modular_firearms/chamber/energy/plaser obj/item/weapon/modular_firearms/chamber/energy/hlaser name = "heavy laser emitter" + charge_cost = 400 projectile_type = /obj/item/projectile/beam/heavylaser obj/item/weapon/modular_firearms/chamber/energy/xray name = "X-ray laser emitter" + charge_cost = 100 projectile_type = /obj/item/projectile/beam/xray obj/item/weapon/modular_firearms/chamber/energy/xsniper name = "sniper laser emitter" + charge_cost = 400 projectile_type = /obj/item/projectile/beam/sniper obj/item/weapon/modular_firearms/chamber/energy/ltagblue @@ -104,10 +108,12 @@ obj/item/weapon/modular_firearms/chamber/energy/stun obj/item/weapon/modular_firearms/chamber/energy/ion name = "ion emitter" + charge_cost = 300 projectile_type = /obj/item/projectile/ion obj/item/weapon/modular_firearms/chamber/energy/floramut name = "floral emitter" + charge_cost = 100 projectile_type = /obj/item/projectile/energy/floramut obj/item/weapon/modular_firearms/chamber/energy/phoron From ac914ef41831ad291574e873e60e999e0e3d828c Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 11 Sep 2015 14:16:41 +0100 Subject: [PATCH 069/107] Create base.dm --- .../projectiles/guns/modular/firearms/base.dm | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 code/modules/projectiles/guns/modular/firearms/base.dm diff --git a/code/modules/projectiles/guns/modular/firearms/base.dm b/code/modules/projectiles/guns/modular/firearms/base.dm new file mode 100644 index 0000000000000..4d12b34052529 --- /dev/null +++ b/code/modules/projectiles/guns/modular/firearms/base.dm @@ -0,0 +1,21 @@ +/obj/item/weapon/gun/MFCS + name = "modular gun template" + desc = "Nothing to see here. Move along, citizen." + var/modChassis = null + var/modChamber = null + var/modDriver = null + var/modLoader = null + var/modBarrel = null + var/modStock = null + var/modSight = null + var/modMisc = list() + var/weight = 1 + fire_delay + burst_delay + list/firemodes = list() + accuracy = 0 + var/list/components = list() + var/list/removable = list() + var/useCell = null + var/useSupply = null + var/useBullet = null From 98940d80977171bbd353926ef14d70599c7b30d5 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 11 Sep 2015 14:16:43 +0100 Subject: [PATCH 070/107] Base projectile file --- .../guns/modular/firearms/projectile.dm | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 code/modules/projectiles/guns/modular/firearms/projectile.dm diff --git a/code/modules/projectiles/guns/modular/firearms/projectile.dm b/code/modules/projectiles/guns/modular/firearms/projectile.dm new file mode 100644 index 0000000000000..4ffa7808fd9f0 --- /dev/null +++ b/code/modules/projectiles/guns/modular/firearms/projectile.dm @@ -0,0 +1,21 @@ +/obj/item/weapon/gun/MFCS/projectile + name = "modular gun" + desc = "A gun, obviously." + modChassis = null + modChamber = null + modDriver = null + modLoader = null + modBarrel = null + modStock = null + modSight = null + modMisc = list() + recoil = 0 + muzzle_flash = 0 + accuracy = 0 + fire_delay = 0 + burst_delay = 0 + list/firemodes = list() + caliber = null + max_shells = null + load_method = null + handle_casings = null From 3135235730a266d9174e55ec3b596665f1598ff0 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Fri, 11 Sep 2015 14:17:05 +0100 Subject: [PATCH 071/107] Work-in-progress compile proc --- code/modules/projectiles/guns/modular/core.dm | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index f82157b1d28f2..40fb9c17a1aa1 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -103,3 +103,36 @@ if(removing == src.modAttachment) src.modAttachment = null user << "\red You remove the [removing] from the frame" + +/* var/obj/item/weapon/cell/power_supply //What type of power cell this uses + var/charge_cost = 200 //How much energy is needed to fire. + var/max_shots = 10 //Determines the capacity of the weapon's power cell. Specifying a cell_type overrides this value. + var/cell_type = null + var/projectile_type = /obj/item/projectile/beam/practice + var/modifystate + var/charge_meter = 1 + */ +/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 + type = 1 + if(src.isEnergy) + var/new/obj/item/weapon/gun/MFCS/energy/P as obj + type = 2 + P.modChassis = src.modChassis + P.modChamber = src.modChamber + if(type = 1) + if(src.caliber) + P.caliber = src.caliber + if(type = 2) + if(src.projectile_type) + P.projectile_type = src.projectile_type + P.charge_cost = src.modChamber.charge_cost + P.modLoader = src.modLoader + if(!Eloader) + P.max_shells = src.modLoader.max_shells + P.load_method = src.modLoader.load_method + + + From b9742e7d12165ef86aec755add58143b7950d30b Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 14 Sep 2015 12:18:06 +0100 Subject: [PATCH 072/107] Added casing handling to compile --- code/modules/projectiles/guns/modular/core.dm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 40fb9c17a1aa1..3c5309de0a562 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -130,9 +130,11 @@ P.projectile_type = src.projectile_type P.charge_cost = src.modChamber.charge_cost P.modLoader = src.modLoader - if(!Eloader) - P.max_shells = src.modLoader.max_shells - P.load_method = src.modLoader.load_method + var/load = src.modLoader + if(!load.Eloader) + P.max_shells = load.max_shells + P.load_method = load.load_method + P.handle_casings = load.handle_casings From d8744ffded8baaf4d5705100167694e6e9bc1204 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 14 Sep 2015 12:20:09 +0100 Subject: [PATCH 073/107] Added heat level handling --- code/modules/projectiles/guns/energy.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 2a7fdad64753f..6eb900c3f53c9 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -19,6 +19,7 @@ var/projectile_type = /obj/item/projectile/beam/practice var/modifystate var/charge_meter = 1 //if set, the icon state will be chosen based on the current charge + var/heat_level = 0 //Handles overheating for energy weapons //self-recharging var/self_recharge = 0 //if set, the weapon will recharge itself From 810071e0e17f6a32006faaa76a4990197b086b65 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 14 Sep 2015 12:27:56 +0100 Subject: [PATCH 074/107] Added a heat limit var for later use --- code/modules/projectiles/guns/energy.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 6eb900c3f53c9..93715f5225d6f 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -20,6 +20,7 @@ var/modifystate var/charge_meter = 1 //if set, the icon state will be chosen based on the current charge var/heat_level = 0 //Handles overheating for energy weapons + var/heat_cap = null //self-recharging var/self_recharge = 0 //if set, the weapon will recharge itself From e395c88098bca2f95e911581a294f9541880bc1a Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 14 Sep 2015 12:38:18 +0100 Subject: [PATCH 075/107] Work-in-progress overheat handling --- code/modules/projectiles/gun.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 0cc7b38fe61e7..a61a23b063f24 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -150,6 +150,15 @@ if(!special_check(user)) return + + if(istype (src, /obj/item/weapon/gun/energy)) + if(src.heat_level = src.heat_cap) + user << "[src] overheats, flashing a red warning indicator!"" + if((src.heat_level - src.heat_cap) = 1) + user << "[src] beeps in alarm, searing hot!" + if((src.heat_level - src.heat_cap) = 2) + user << "[src] hisses, leaking steam. It can't take any more!" + if((src.heat_level - src.heat_cap) >= 3) if(world.time < next_fire_time) if (world.time % 3) //to prevent spam @@ -179,6 +188,9 @@ var/acc = firemode.accuracy[min(i, firemode.accuracy.len)] var/disp = firemode.dispersion[min(i, firemode.dispersion.len)] process_accuracy(projectile, user, target, acc, disp) + + if(istype (src, /obj/item/weapon/gun/energy)) + src.heat_level += 1 if(pointblank) process_point_blank(projectile, user, target) From 43546a6c2fa265aa0df73e292075124a216ad90b Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 14 Sep 2015 13:46:41 +0100 Subject: [PATCH 076/107] More heat handling --- code/modules/projectiles/gun.dm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index a61a23b063f24..7027d4d8dd2f9 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -152,13 +152,23 @@ return if(istype (src, /obj/item/weapon/gun/energy)) + if(src.vent_stack) + return if(src.heat_level = src.heat_cap) - user << "[src] overheats, flashing a red warning indicator!"" + user << "[src] feels hot in your hands!"" if((src.heat_level - src.heat_cap) = 1) - user << "[src] beeps in alarm, searing hot!" + user << "[src] beeps in alarm, painfully hot!" if((src.heat_level - src.heat_cap) = 2) - user << "[src] hisses, leaking steam. It can't take any more!" + user << "[src] flashes a red warning light, searing hot! It can't take much more!" if((src.heat_level - src.heat_cap) >= 3) + if(prob(80)) + user << "[src] overheats, venting boiling-hot steam!" + src.vent_stack += 5 + return + else + user << "[src] explodes violently in your hands!" + src.explode() + return if(world.time < next_fire_time) if (world.time % 3) //to prevent spam From fbeaab888e2fef0a2aaa0f9ccdd9ca24d1e03920 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 14 Sep 2015 13:48:11 +0100 Subject: [PATCH 077/107] Cooldown handling Not sure if this will work or not. We'll see. --- code/modules/projectiles/guns/energy.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 93715f5225d6f..5eb78a418aedc 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -21,6 +21,7 @@ var/charge_meter = 1 //if set, the icon state will be chosen based on the current charge var/heat_level = 0 //Handles overheating for energy weapons var/heat_cap = null + var/vent_stack = null //self-recharging var/self_recharge = 0 //if set, the weapon will recharge itself @@ -60,6 +61,8 @@ ..() /obj/item/weapon/gun/energy/process() + if(heat_level) + heat_level -= 0.5 if(self_recharge) //Every [recharge_time] ticks, recharge a shot for the cyborg charge_tick++ if(charge_tick < recharge_time) return 0 From 6a87a0cc59e46bb467c9c908e669b0f94cf15f19 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 14 Sep 2015 13:49:42 +0100 Subject: [PATCH 078/107] Further handling --- code/modules/projectiles/guns/energy.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 5eb78a418aedc..6f3a97d5d82dc 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -19,8 +19,8 @@ var/projectile_type = /obj/item/projectile/beam/practice var/modifystate var/charge_meter = 1 //if set, the icon state will be chosen based on the current charge - var/heat_level = 0 //Handles overheating for energy weapons - var/heat_cap = null + var/heat_level = null //Handles overheating for energy weapons + var/heat_cap = 5 var/vent_stack = null //self-recharging @@ -63,6 +63,8 @@ /obj/item/weapon/gun/energy/process() if(heat_level) heat_level -= 0.5 + if(vent_stack) + vent_stack -= 1 if(self_recharge) //Every [recharge_time] ticks, recharge a shot for the cyborg charge_tick++ if(charge_tick < recharge_time) return 0 From 9ff3805020a8ce252cec1f04396d7dc90f8cf12f Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 14 Sep 2015 13:51:41 +0100 Subject: [PATCH 079/107] Create energy.dm --- .../guns/modular/firearms/energy.dm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 code/modules/projectiles/guns/modular/firearms/energy.dm diff --git a/code/modules/projectiles/guns/modular/firearms/energy.dm b/code/modules/projectiles/guns/modular/firearms/energy.dm new file mode 100644 index 0000000000000..94a1fbdf490cb --- /dev/null +++ b/code/modules/projectiles/guns/modular/firearms/energy.dm @@ -0,0 +1,19 @@ + +/obj/item/weapon/gun/energy/modular + name = "energy gun" + desc = "Pew pew." + var/modChassis = null + var/modChamber = null + var/modDriver = null + var/modLoader = null + var/modBarrel = null + var/modStock = null + var/modSight = null + var/modMisc = list() + var/weight = 1 + fire_delay = null + burst_delay = null + list/firemodes = list() + accuracy = 0 + var/list/components = list() + var/list/removable = list() From a05665deaa7f411b294e0364efef6e9a07df484b Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 14 Sep 2015 14:05:37 +0100 Subject: [PATCH 080/107] Extra quotation fix --- code/modules/projectiles/gun.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 7027d4d8dd2f9..a2ef0eab6a998 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -155,7 +155,7 @@ if(src.vent_stack) return if(src.heat_level = src.heat_cap) - user << "[src] feels hot in your hands!"" + user << "[src] feels hot in your hands!" if((src.heat_level - src.heat_cap) = 1) user << "[src] beeps in alarm, painfully hot!" if((src.heat_level - src.heat_cap) = 2) From c834f2e38d61100dfde02063eaf0073c32e73c2a Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Tue, 15 Sep 2015 12:52:33 +0100 Subject: [PATCH 081/107] Comments and punctuation Very minor, but it's something to do while I figure out fire delays for energy weapons. --- code/modules/projectiles/guns/modular/core.dm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 3c5309de0a562..bd6dc5ea211a3 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -1,4 +1,4 @@ -//Will be used for procs instead +//MFCS procs -- Cirra /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. @@ -8,7 +8,7 @@ if(istype(I, /obj/item/weapon/modular_firearms/chassis/ballistic)) src.isKinetic = 1 modChassis = I - src.removable += I + src.removable += I //adds itself to the removable list if(istype(I, /obj/item/weapon/modular_firearms/chamber)) var/obj/item/weapon/modular_firearms/chamber/chamber = I if(chamber.projectile_type) //checking for energy weaponry @@ -22,14 +22,14 @@ src.msg = "\red An energy chamber won't work with a ballistic chassis!" return src.modChamber = I - src.removable -= src.modChassis + src.removable -= src.modChassis //removes its source part from the removable list. src.removable += I if(istype(I, /obj/item/weapon/modular_firearms/driver)) var/obj/item/weapon/modular_firearms/driver/D = I if(D.firemodes) else - src.msg = "\red Have you considered using a real driver?" - return + src.msg = "\red Have you considered using a real driver?" //this will usually only be returned if + return // they try and use the base driver src.modDriver = I src.removable += I src.removable -= src.modChamber @@ -65,7 +65,7 @@ user << "\red There is already a [part] installed!" return else - user << "\red Error - null part variable for [I]" + user << "\red Error - null part variable for [I]." //for debugging return if(prereq) if(!prereq in src.components) @@ -102,7 +102,7 @@ src.modStock = null if(removing == src.modAttachment) src.modAttachment = null - user << "\red You remove the [removing] from the frame" + user << "\red You remove the [removing] from the frame." /* var/obj/item/weapon/cell/power_supply //What type of power cell this uses var/charge_cost = 200 //How much energy is needed to fire. From bae477588f94a345fae796d374c1a33d03dc8351 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 21 Sep 2015 11:52:35 +0100 Subject: [PATCH 082/107] Changed if's to else if's Should stop it being checked again and again in the code. Thanks Zuhayr. --- code/modules/projectiles/gun.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index a2ef0eab6a998..571e185ffe8af 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -154,13 +154,13 @@ if(istype (src, /obj/item/weapon/gun/energy)) if(src.vent_stack) return - if(src.heat_level = src.heat_cap) + else if(src.heat_level = src.heat_cap) user << "[src] feels hot in your hands!" - if((src.heat_level - src.heat_cap) = 1) + else if((src.heat_level - src.heat_cap) = 1) user << "[src] beeps in alarm, painfully hot!" - if((src.heat_level - src.heat_cap) = 2) + else if((src.heat_level - src.heat_cap) = 2) user << "[src] flashes a red warning light, searing hot! It can't take much more!" - if((src.heat_level - src.heat_cap) >= 3) + else if((src.heat_level - src.heat_cap) >= 3) if(prob(80)) user << "[src] overheats, venting boiling-hot steam!" src.vent_stack += 5 From cbe3287d4c24dd12ac46230895696f0c0d0d0a55 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 21 Sep 2015 11:54:53 +0100 Subject: [PATCH 083/107] Used a var instead of rechecking istype. Credit to Zuhayr. Let's see if I did this correctly. --- code/modules/projectiles/gun.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 571e185ffe8af..750b59b85bf49 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -144,6 +144,7 @@ return ..() //Pistolwhippin' /obj/item/weapon/gun/proc/Fire(atom/target, mob/living/user, clickparams, pointblank=0, reflex=0) + var/isenergy = null if(!user || !target) return add_fingerprint(user) @@ -152,6 +153,7 @@ return if(istype (src, /obj/item/weapon/gun/energy)) + isenergy = 1 if(src.vent_stack) return else if(src.heat_level = src.heat_cap) @@ -199,7 +201,7 @@ var/disp = firemode.dispersion[min(i, firemode.dispersion.len)] process_accuracy(projectile, user, target, acc, disp) - if(istype (src, /obj/item/weapon/gun/energy)) + if(isenergy) src.heat_level += 1 if(pointblank) From 3042717caa0a3092bea1aa9bdddc35e6b181a5b4 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 21 Sep 2015 12:20:09 +0100 Subject: [PATCH 084/107] More handling and a refactor Credit for lines 119 to 124 to @Zuhayr --- code/modules/projectiles/guns/modular/core.dm | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index bd6dc5ea211a3..19310f2a62733 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -1,5 +1,7 @@ //MFCS procs -- Cirra +/obj/item/weapon/modular_firearms/assembly/proc/debug(var/part as var, var/type as var) + user << "DEBUG: [part] is current [type]" /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)) @@ -112,29 +114,33 @@ var/modifystate var/charge_meter = 1 */ + /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 - type = 1 + type = obj/item/weapon/gun/MFCS/projectile if(src.isEnergy) - var/new/obj/item/weapon/gun/MFCS/energy/P as obj - type = 2 + type = obj/item/weapon/gun/MFCS/energy + var/new/[type]/P //No idea if this'll work. Let's hope. P.modChassis = src.modChassis P.modChamber = src.modChamber - if(type = 1) - if(src.caliber) - P.caliber = src.caliber - if(type = 2) - if(src.projectile_type) - P.projectile_type = src.projectile_type - P.charge_cost = src.modChamber.charge_cost + if(src.caliber) + P.caliber = src.caliber + else + P.projectile_type = src.projectile_type + P.charge_cost = src.modChamber.charge_cost P.modLoader = src.modLoader var/load = src.modLoader if(!load.Eloader) P.max_shells = load.max_shells P.load_method = load.load_method P.handle_casings = load.handle_casings - - + else + P.cell = new/obj/item/weapon/cell(P) + P.modDriver = src.modDriver + var/driver = src.modDriver + for(datum/firemode/F in driver.firemodes()) + P.firemodes += F + for(obj/item/I in P.contents()) + src.debug(I, I.name) From cebdd5fc556ef5fd62a5636f7bc66b2e2f4b42de Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 21 Sep 2015 12:22:56 +0100 Subject: [PATCH 085/107] Added some else if's --- code/modules/projectiles/guns/modular/assembly.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index b6c7f147147d9..c4d686b618ce4 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -43,27 +43,27 @@ obj/item/weapon/modular_firearms/assembly part = modChassis prereq = null - if(istype(I, /obj/item/weapon/modular_firearms/chamber)) + else if(istype(I, /obj/item/weapon/modular_firearms/chamber)) part = modChamber prereq = modChassis - if(istype(I, /obj/item/weapon/modular_firearms/driver)) + else if(istype(I, /obj/item/weapon/modular_firearms/driver)) part = modDriver prereq = modChamber - if(istype(I, /obj/item/weapon/modular_firearms/loader)) + else if(istype(I, /obj/item/weapon/modular_firearms/loader)) part = modLoader prereq = modChamber - if(istype(I, /obj/item/weapon/modular_firearms/barrel)) + else if(istype(I, /obj/item/weapon/modular_firearms/barrel)) part = modBarrel prereq = modChamber - if(istype(I, /obj/item/weapon/modular_firearms/stock)) + else if(istype(I, /obj/item/weapon/modular_firearms/stock)) part = modStock prereq = modChassis - if(istype(I, /obj/item/weapon/modular_firearms/sight)) + else if(istype(I, /obj/item/weapon/modular_firearms/sight)) part = modSight prereq = modChassis From cb258b67dff89a1e981486d358a43305b1cde80c Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 21 Sep 2015 12:25:37 +0100 Subject: [PATCH 086/107] Switched to using span classes --- code/modules/projectiles/guns/modular/core.dm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 19310f2a62733..619563c7a7696 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -16,12 +16,12 @@ if(chamber.projectile_type) //checking for energy weaponry if(src.isEnergy) else - src.msg = "\red A ballistic chamber won't work with an energy chassis!" + src.msg = " A ballistic chamber won't work with an energy chassis!" return if(chamber.caliber) //checking for kinetic weaponry if(src.isKinetic) else - src.msg = "\red An energy chamber won't work with a ballistic chassis!" + src.msg = " An energy chamber won't work with a ballistic chassis!" return src.modChamber = I src.removable -= src.modChassis //removes its source part from the removable list. @@ -30,7 +30,7 @@ var/obj/item/weapon/modular_firearms/driver/D = I if(D.firemodes) else - src.msg = "\red Have you considered using a real driver?" //this will usually only be returned if + src.msg = " Have you considered using a real driver?" //this will usually only be returned if return // they try and use the base driver src.modDriver = I src.removable += I @@ -64,18 +64,18 @@ /obj/item/weapon/modular_firearms/assembly/proc/add_part(obj/item/I as obj, mob/user as mob, var/part, var/prereq) //Handles all part processing in a single proc. So clean~ if(part) if(part in src.components) - user << "\red There is already a [part] installed!" + user << " There is already a [part] installed!" return else - user << "\red Error - null part variable for [I]." //for debugging + user << " Error - null part variable for [I]." //for debugging return if(prereq) if(!prereq in src.components) - user << "\red The [I] needs to be attached to a [prereq]!" + user << " The [I] needs to be attached to a [prereq]!" return src.process_part(I, user) if(!src.msg) - src.msg = ("\blue You install the [I] onto the [src].") + src.msg = ("\blue You install the [I] onto the [src].") user << src.msg user.drop_item() I.loc = src @@ -104,7 +104,7 @@ src.modStock = null if(removing == src.modAttachment) src.modAttachment = null - user << "\red You remove the [removing] from the frame." + user << " You remove the [removing] from the frame." /* var/obj/item/weapon/cell/power_supply //What type of power cell this uses var/charge_cost = 200 //How much energy is needed to fire. From b65bc808023b260c38ec02641d8774941f00ed95 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 21 Sep 2015 13:37:58 +0100 Subject: [PATCH 087/107] Modifying the P again. Once again, credit to @Zuhayr. I learned a little bit from this one, so this should help in the future. --- code/modules/projectiles/guns/modular/core.dm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 619563c7a7696..7635228336555 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -116,13 +116,12 @@ */ /obj/item/weapon/modular_firearms/assembly/proc/compile(mob/user as mob) - var/type = null + var/obj/item/weapon/gun/MFCS/P // Declares but does not instantiate a variable or create the object. if(src.isKinetic) - type = obj/item/weapon/gun/MFCS/projectile - if(src.isEnergy) - type = obj/item/weapon/gun/MFCS/energy - var/new/[type]/P //No idea if this'll work. Let's hope. - P.modChassis = src.modChassis + P = new obj/item/weapon/gun/MFCS/projectile(loc) // Previously declared variable refers to this object. + else if(src.isEnergy) + P = new obj/item/weapon/gun/MFCS/energy(loc) // As above, different path, shared parent type. + P.modChassis = src.modChassis //etc. Credit to Zuhayr for the above. P.modChamber = src.modChamber if(src.caliber) P.caliber = src.caliber From 9d41e0e77c618280ba3d8968040e61b3b2b864f1 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 21 Sep 2015 13:44:11 +0100 Subject: [PATCH 088/107] Added barrel compiling --- code/modules/projectiles/guns/modular/core.dm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 7635228336555..355c202c92328 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -135,11 +135,17 @@ P.load_method = load.load_method P.handle_casings = load.handle_casings else - P.cell = new/obj/item/weapon/cell(P) + P.cell = new/obj/item/weapon/cell(P) //Initializes a powercell inside of the energy weapon. P.modDriver = src.modDriver var/driver = src.modDriver for(datum/firemode/F in driver.firemodes()) - P.firemodes += F - + P.firemodes += F //adds each firemode from the driver to the gun + P.modBarrel = src.modBarrel + var/barrel = src.modBarrel + if(barrel.accuracy_mod) + P.accuracy += barrel.accuracy_mod + if(barrel.burst_mod) //checking if it's some kind of special barrel such as double or rotating + for(datum/firemode/F in P.firemodes()) + F.burst += barrel.burst_mod //should add the number of extra shots to each firemode the gun has for(obj/item/I in P.contents()) src.debug(I, I.name) From 4aa29a35c8119eb0c5b447f26889cfabcd66a43f Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 21 Sep 2015 14:05:49 +0100 Subject: [PATCH 089/107] Added stock compiling --- code/modules/projectiles/guns/modular/core.dm | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 355c202c92328..222b838436a81 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -142,10 +142,25 @@ P.firemodes += F //adds each firemode from the driver to the gun P.modBarrel = src.modBarrel var/barrel = src.modBarrel - if(barrel.accuracy_mod) - P.accuracy += barrel.accuracy_mod if(barrel.burst_mod) //checking if it's some kind of special barrel such as double or rotating for(datum/firemode/F in P.firemodes()) F.burst += barrel.burst_mod //should add the number of extra shots to each firemode the gun has - for(obj/item/I in P.contents()) + if(src.modStock) + P.modStock = src.modStock + var/stock = src.modStock + if(stock.folding) + P.stockmessage = "You fold away the [modStock]" + else if(stock.telescopic) + P.stockmessage = "You collapse the [modStock]" + + for(obj/item/I in P.contents()) //so I don't have to repeat these lines every time something modifies them + if(I.accuracy_mod) + P.accuracy += I.accuracy_mod + if(I.weight) //will be used to calculate w_class + P.weight += I.weight + if(I.overlays) //critical component of the upcoming modular sprite system + P.overlays += I.overlays + if(I.recoil_mod) + P.recoil += I.recoil_mod + src.debug(I, I.name) From a4096e96f15a398a1b9eaa4cba4ee8bb31351915 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Wed, 23 Sep 2015 13:06:35 +0100 Subject: [PATCH 090/107] Added new power supplies --- .../guns/modular/components/loader.dm | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index 9979a63c8a4a9..a188ca90152ee 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -37,15 +37,27 @@ obj/item/weapon/modular_firearms/loader/bolt max_shells = 1 isbolt = 1 -obj/item/weapon/modular_firearms/loader/cellport - name = "cell port" - icon = 'icons/placeholder.dmi' - useCell = 1 - Eloader = 1 - obj/item/weapon/modular_firearms/loader/powersupply name = "internal power supply" icon = 'icons/placeholder.dmi' useSupply = 1 Eloader = 1 + var/celltype = /obj/item/weapon/cell + var/cooler = null +obj/item/weapon/modular_firearms/loader/powersupply/verylow + name = "WT-500 power supply" + desc = "Powered with an AA battery. This is pretty awful." + celltype = /obj/item/weapon/cell/crap + +obj/item/weapon/modular_firearms/loader/powersupply/low + name = "WT-1000 power supply" + celltype = /obj/item/weapon/cell/device + +obj/item/weapon/modular_firearms/loader/powersupply/med + name = "WT-2000 power supply" + celltype = /obj/item/weapon/cell + +obj/item/weapon/modular_firearms/loader/powersupply/high + name = "WT-5000 power supply." + celltype = /obj/item/weapon/cell/apc From 6771d5b41fece9d93cd4dd7418a8938faba5a8f4 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Wed, 23 Sep 2015 13:13:29 +0100 Subject: [PATCH 091/107] Update power_cells.dm --- code/game/objects/items/weapons/power_cells.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/game/objects/items/weapons/power_cells.dm b/code/game/objects/items/weapons/power_cells.dm index 96c635b77861f..12584989cdeb1 100644 --- a/code/game/objects/items/weapons/power_cells.dm +++ b/code/game/objects/items/weapons/power_cells.dm @@ -72,6 +72,14 @@ icon_state = "hcell" maxcharge = 10000 matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 60) + +/obj/item/weapon/cell/med + name = "WT-2000 power cell" + desc = "A middle-of-the-line power cell produced by Ward-Takahashi." + origin_tech = "powerstorage=1" + icon_state = "hcell" + maxcharge = 2000 + matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 40) /obj/item/weapon/cell/high/empty/New() ..() From dac207e7342eb184210a68bc14806c18a1cdca1b Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 11:51:37 +0100 Subject: [PATCH 092/107] Start of the replacement Beginning the process of replacing all standard firearms with MFCS firearms. --- code/modules/projectiles/gun.dm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 750b59b85bf49..c4871bee24d5c 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -61,6 +61,23 @@ var/accuracy = 0 //accuracy is measured in tiles. +1 accuracy means that everything is effectively one tile closer for the purpose of miss chance, -1 means the opposite. launchers are not supported, at the moment. var/scoped_accuracy = null +//MFCS vars below + + var/modChassis = null + var/modChamber = null + var/modDriver = null + var/modLoader = null + var/modBarrel = null + var/modStock = null + var/modSight = null + var/modMisc = list() + var/list/components = list() + var/list/removable = list() + var/stockmessage = null + var/compilesprite = null + +//End of MFCS vars + var/next_fire_time = 0 var/sel_mode = 1 //index of the currently selected mode From a871763460cee74f465a59a12085088f2a4ad189 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 12:00:21 +0100 Subject: [PATCH 093/107] Added a heavy assembly Will handle larger weapons. --- code/modules/projectiles/guns/modular/assembly.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index c4d686b618ce4..0f1946ef53b10 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -11,7 +11,7 @@ list/dispersion = list(0) obj/item/weapon/modular_firearms/assembly - name = "basic assembly" + name = "standard assembly" desc = "The outer framework for a firearm of some kind. This one looks rather basic." icon = 'icons/placeholder.dmi' var/msg = null @@ -23,7 +23,7 @@ obj/item/weapon/modular_firearms/assembly var/modStock = null var/modSight = null var/modMisc = list() - var/framelevel = 2 + w_class = 3 var/weight = 1 var/isEnergy = null var/isKinetic = null @@ -69,5 +69,7 @@ obj/item/weapon/modular_firearms/assembly add_part(I, user, part, prereq) - - +obj/item/weapon/modular_firearms/assembly/heavy + name = "heavy assembly" + desc = "The outer framework for a firearm. You could probably make something over the top with this." + w_class = 4 From 4b46e3cff879389014f209dd1368cc35c3012f9d Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 12:29:49 +0100 Subject: [PATCH 094/107] Added mastertype and compiled vars --- code/modules/projectiles/guns/modular/assembly.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index 0f1946ef53b10..c643a05912b92 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -14,6 +14,8 @@ obj/item/weapon/modular_firearms/assembly name = "standard assembly" desc = "The outer framework for a firearm of some kind. This one looks rather basic." icon = 'icons/placeholder.dmi' + var/mastertype = null + var/compiled = null var/msg = null var/modChassis = null var/modChamber = null @@ -24,11 +26,8 @@ obj/item/weapon/modular_firearms/assembly var/modSight = null var/modMisc = list() w_class = 3 - var/weight = 1 var/isEnergy = null var/isKinetic = null - var/silenced = null - var/compensated = null var/list/components = list() var/list/removable = list() var/useCell = null From 750a5d59fe0bf1fa01e724186c9d3202d33924c5 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 12:32:28 +0100 Subject: [PATCH 095/107] Added the framework for recompiling --- code/modules/projectiles/gun.dm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index c4871bee24d5c..00c89f9d0b33d 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -63,6 +63,7 @@ //MFCS vars below + var/modAssembly = null var/modChassis = null var/modChamber = null var/modDriver = null @@ -71,6 +72,7 @@ var/modStock = null var/modSight = null var/modMisc = list() + var/mastertype = src var/list/components = list() var/list/removable = list() var/stockmessage = null @@ -103,6 +105,25 @@ if(isnull(scoped_accuracy)) scoped_accuracy = accuracy + + if(modAssembly) + if(!modAssembly.compiled) + recompile() + +/obj/item/weapon/gun/proc/recompile() + var/assembly/A = new modAssembly(loc) + A.mastertype = src + A.modChassis = modChassis + A.modChamber = modChamber + A.modDriver = modDriver + A.modLoader = modLoader + A.modBarrel = modBarrel + if(modStock) + A.modStock = modStock + if(modScope) + A.modScope = modScope + A.compiled = null + A.compile() //Checks whether a given mob can use the gun //Any checks that shouldn't result in handle_click_empty() being called if they fail should go here. From 1876c0052479fd64342def35175eda210aa11d53 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:01:02 +0100 Subject: [PATCH 096/107] Small fix --- code/modules/projectiles/gun.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 00c89f9d0b33d..47848d7704aa4 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -107,12 +107,13 @@ scoped_accuracy = accuracy if(modAssembly) + mastertype = src if(!modAssembly.compiled) recompile() /obj/item/weapon/gun/proc/recompile() var/assembly/A = new modAssembly(loc) - A.mastertype = src + A.mastertype = mastertype A.modChassis = modChassis A.modChamber = modChamber A.modDriver = modDriver From a3d7873a93558a861e3637ec1641e63defd541ea Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:03:20 +0100 Subject: [PATCH 097/107] Update loader.dm --- code/modules/projectiles/guns/modular/components/loader.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index a188ca90152ee..713eeb97bf21d 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -17,7 +17,7 @@ obj/item/weapon/modular_firearms/loader/magazine obj/item/weapon/modular_firearms/loader/speedloader name = "speedloader" - load_method = SPEEDLOADER + load_method = SPEEDLOADER|SINGLE_CASING handle_casings = EJECT_CASINGS obj/item/weapon/modular_firearms/loader/shell From 225d7ffe63b54313e77a61d78c6f255e89b8b426 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:07:03 +0100 Subject: [PATCH 098/107] Rearrangement --- code/modules/projectiles/guns/modular/components/loader.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/modular/components/loader.dm b/code/modules/projectiles/guns/modular/components/loader.dm index 713eeb97bf21d..6ed57488b588c 100644 --- a/code/modules/projectiles/guns/modular/components/loader.dm +++ b/code/modules/projectiles/guns/modular/components/loader.dm @@ -17,7 +17,7 @@ obj/item/weapon/modular_firearms/loader/magazine obj/item/weapon/modular_firearms/loader/speedloader name = "speedloader" - load_method = SPEEDLOADER|SINGLE_CASING + load_method = SINGLE_CASING|SPEEDLOADER handle_casings = EJECT_CASINGS obj/item/weapon/modular_firearms/loader/shell From 4a594b68ab7e32e4c312bed2750cca81f835a814 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:07:41 +0100 Subject: [PATCH 099/107] Set the base parts for projectile weaponry --- code/modules/projectiles/guns/projectile.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index 576488e774526..4da7bab818cdc 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -10,6 +10,13 @@ w_class = 3 matter = list(DEFAULT_WALL_MATERIAL = 1000) recoil = 1 + + modFrame = /obj/item/weapon/modular_firearms/assembly + modChassis = /obj/item/weapon/modular_firearms/chassis/ballistic + modLoader = /obj/item/weapon/modular_firearms/loader/speedloader + modChamber = /obj/item/weapon/modular_firearms/chamber/a357 + modBarrel = /obj/item/weapon/modular_firearms/barrel/snub + modDriver = /obj/item/weapon/modular_firearms/driver var/caliber = "357" //determines which casings will fit var/handle_casings = EJECT_CASINGS //determines how spent casings should be handled From 4d871170f3dacb2ddcbdb8b92984cc59476272c6 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:09:19 +0100 Subject: [PATCH 100/107] Update projectile.dm --- code/modules/projectiles/guns/projectile.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index 4da7bab818cdc..3c286f13e4ed0 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -15,7 +15,7 @@ modChassis = /obj/item/weapon/modular_firearms/chassis/ballistic modLoader = /obj/item/weapon/modular_firearms/loader/speedloader modChamber = /obj/item/weapon/modular_firearms/chamber/a357 - modBarrel = /obj/item/weapon/modular_firearms/barrel/snub + modBarrel = /obj/item/weapon/modular_firearms/barrel/standard modDriver = /obj/item/weapon/modular_firearms/driver var/caliber = "357" //determines which casings will fit From da5c66b4291e5d570b4071f222e1fbdecd45dea8 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:16:27 +0100 Subject: [PATCH 101/107] Added the Z8 driver --- .../modules/projectiles/guns/modular/components/driver.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/modules/projectiles/guns/modular/components/driver.dm b/code/modules/projectiles/guns/modular/components/driver.dm index 7ee458ec091de..b7a9344f0e016 100644 --- a/code/modules/projectiles/guns/modular/components/driver.dm +++ b/code/modules/projectiles/guns/modular/components/driver.dm @@ -44,3 +44,11 @@ obj/item/weapon/modular_firearms/driver/burst5 list(name="3-round bursts", burst=3, move_delay=6, accuracy = list(0,-1,-1), dispersion = list(0.0, 0.6, 0.6)), list(name="semiauto", burst=1, fire_delay=0) ) + +obj/item/weapon/modular_firearms/driver/z8 + name = "Z8 driver" + firemodes = list( + list(name="semiauto", burst=1, fire_delay=0), + list(name="3-round bursts", burst=3, move_delay=6, accuracy = list(0,-1,-1), dispersion = list(0.0, 0.6, 0.6)), + list(name="fire grenades", use_launcher=1) + ) From 125e8d2745149170384b459a1f5cb41a4a2c010a Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:19:39 +0100 Subject: [PATCH 102/107] Moved automatic weapons over to the MFCS system. --- .../projectiles/guns/projectile/automatic.dm | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index 106f8a0ea4778..5f983aa04a587 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -11,11 +11,8 @@ ammo_type = /obj/item/ammo_casing/c9mm multi_aim = 1 - firemodes = list( - list(name="semiauto", burst=1, fire_delay=0), - list(name="3-round bursts", burst=3, move_delay=4, accuracy = list(0,-1,-1,-2,-2), dispersion = list(0.0, 0.6, 1.0)), - list(name="short bursts", burst=5, move_delay=4, accuracy = list(0,-1,-1,-2,-2), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2)), - ) + modChamber = /obj/item/weapon/modular_firearms/chamber/c9mm + modDriver = /obj/item/weapon/modular_firearms/driver/burst5 /obj/item/weapon/gun/projectile/automatic/mini_uzi name = "\improper Uzi" @@ -27,6 +24,8 @@ caliber = ".45" origin_tech = "combat=5;materials=2;syndicate=8" ammo_type = /obj/item/ammo_casing/c45 + + modBarrel = /obj/item/weapon/modular_firearms/barrel/short /obj/item/weapon/gun/projectile/automatic/c20r name = "\improper C-20r SMG" @@ -43,6 +42,9 @@ magazine_type = /obj/item/ammo_magazine/a12mm auto_eject = 1 auto_eject_sound = 'sound/weapons/smg_empty_alarm.ogg' + + modLoader = /obj/item/weapon/modular_firearms/loader/magazine + modChamber = obj/item/weapon/modular_firearms/chamber/a12mm /obj/item/weapon/gun/projectile/automatic/c20r/update_icon() ..() @@ -65,11 +67,10 @@ load_method = MAGAZINE magazine_type = /obj/item/ammo_magazine/c762 - firemodes = list( - list(name="semiauto", burst=1, fire_delay=0), - list(name="3-round bursts", burst=3, move_delay=6, accuracy = list(0,-1,-1,-2,-2), dispersion = list(0.0, 0.6, 0.6)), - list(name="short bursts", burst=5, move_delay=6, accuracy = list(0,-1,-1,-2,-2), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2)), - ) + modAssembly = /obj/item/weapon/modular_firearms/assembly/heavy + modDriver = /obj/item/weapon/modular_firearms/driver/burst5 + modLoader = /obj/item/weapon/modular_firearms/loader/magazine + modChamber = /obj/item/weapon/modular_firearms/chamber/a762 /obj/item/weapon/gun/projectile/automatic/sts35/update_icon() ..() @@ -89,6 +90,9 @@ fire_sound = 'sound/weapons/Gunshot_light.ogg' load_method = MAGAZINE magazine_type = /obj/item/ammo_magazine/mc9mmt/rubber + + modLoader = /obj/item/weapon/modular_firearms/loader/magazine + modChamber = /obj/item/weapon/modular_firearms/chamber/c9mm /obj/item/weapon/gun/projectile/automatic/wt550/update_icon() ..() @@ -118,13 +122,13 @@ auto_eject = 1 auto_eject_sound = 'sound/weapons/smg_empty_alarm.ogg' + modAssembly = /obj/item/weapon/modular_firearms/assembly/heavy + modDriver = /obj/item/weapon/modular_firearms/driver/z8 + modLoader = /obj/item/weapon/modular_firearms/loader/magazine + modChamber = /obj/item/weapon/modular_firearms/chamber/a556 + burst_delay = 4 firemode_type = /datum/firemode/z8 - firemodes = list( - list(name="semiauto", burst=1, fire_delay=0), - list(name="3-round bursts", burst=3, move_delay=6, accuracy = list(0,-1,-1), dispersion = list(0.0, 0.6, 0.6)), - list(name="fire grenades", use_launcher=1) - ) var/obj/item/weapon/gun/launcher/grenade/underslung/launcher @@ -186,10 +190,10 @@ load_method = MAGAZINE magazine_type = /obj/item/ammo_magazine/a762 - firemodes = list( - list(name="short bursts", burst=5, move_delay=6, accuracy = list(0,-1,-1,-2,-2,-2,-3,-3), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2)), - list(name="long bursts", burst=8, move_delay=8, accuracy = list(0,-1,-1,-2,-2,-2,-3,-3), dispersion = list(1.0, 1.0, 1.0, 1.0, 1.2)), - ) + modAssembly = /obj/item/weapon/modular_firearms/assembly/heavy + modLoader = /obj/item/weapon/modular_firearms/loader/magazine + modDriver = /obj/item/weapon/modular_firearms/driver/longburst + modChamber = /obj/item/weapon/modular_firearms/chamber/a762 var/cover_open = 0 From 6c565d2d391565cfe2a7443fd51f3ec51e14ddad Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:23:31 +0100 Subject: [PATCH 103/107] Moved pistols over to the MFCS system --- .../projectiles/guns/projectile/pistol.dm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/code/modules/projectiles/guns/projectile/pistol.dm b/code/modules/projectiles/guns/projectile/pistol.dm index 7e0fdc99a316a..0da42528f398b 100644 --- a/code/modules/projectiles/guns/projectile/pistol.dm +++ b/code/modules/projectiles/guns/projectile/pistol.dm @@ -7,6 +7,9 @@ origin_tech = "combat=2;materials=2" fire_sound = 'sound/weapons/Gunshot_light.ogg' load_method = MAGAZINE + + modChamber = /obj/item/weapon/modular_firearms/chamber/c45 + modLoader = /obj/item/weapon/modular_firearms/loader/magazine /obj/item/weapon/gun/projectile/colt/detective desc = "A cheap Martian knock-off of a Colt M1911. Uses .45 rounds." @@ -39,6 +42,9 @@ origin_tech = "combat=2;materials=2" fire_sound = 'sound/weapons/Gunshot_light.ogg' load_method = MAGAZINE + + modChamber = /obj/item/weapon/modular_firearms/chamber/c45 + modLoader = /obj/item/weapon/modular_firearms/loader/magazine /obj/item/weapon/gun/projectile/sec/flash name = "\improper NT Mk58 signal pistol" @@ -59,6 +65,9 @@ origin_tech = "combat=2;materials=2;syndicate=8" load_method = MAGAZINE magazine_type = /obj/item/ammo_magazine/c45m + + modChamber = /obj/item/weapon/modular_firearms/chamber/c45 + modLoader = /obj/item/weapon/modular_firearms/loader/magazine /obj/item/weapon/gun/projectile/deagle name = "desert eagle" @@ -70,6 +79,9 @@ load_method = MAGAZINE magazine_type = /obj/item/ammo_magazine/a50 auto_eject = 1 + + modChamber = /obj/item/weapon/modular_firearms/chamber/a50 + modLoader = /obj/item/weapon/modular_firearms/loader/magazine /obj/item/weapon/gun/projectile/deagle/gold desc = "A gold plated gun folded over a million times by superior martian gunsmiths. Uses .50 AE ammo." @@ -98,6 +110,9 @@ auto_eject = 1 auto_eject_sound = 'sound/weapons/smg_empty_alarm.ogg' + modChamber = /obj/item/weapon/modular_firearms/chamber/a75 + modLoader = /obj/item/weapon/modular_firearms/loader/magazine + /obj/item/weapon/gun/projectile/gyropistol/update_icon() ..() if(ammo_magazine) @@ -117,6 +132,9 @@ fire_sound = 'sound/weapons/Gunshot_light.ogg' load_method = MAGAZINE magazine_type = /obj/item/ammo_magazine/mc9mm + + modChamber = /obj/item/weapon/modular_firearms/chamber/c9mm + modLoader = /obj/item/weapon/modular_firearms/loader/magazine /obj/item/weapon/gun/projectile/pistol/flash name = "\improper Stechtkin signal pistol" From c8168c4ba49749e22aecf4e2ce50bc977df4fd6c Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:37:24 +0100 Subject: [PATCH 104/107] Update core.dm Sprite overrides are now handled, max_shells is no longer overriden for existing weapons, and "mastertypes" have been implemented. --- code/modules/projectiles/guns/modular/core.dm | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/code/modules/projectiles/guns/modular/core.dm b/code/modules/projectiles/guns/modular/core.dm index 222b838436a81..abea12a8e5586 100644 --- a/code/modules/projectiles/guns/modular/core.dm +++ b/code/modules/projectiles/guns/modular/core.dm @@ -117,10 +117,14 @@ /obj/item/weapon/modular_firearms/assembly/proc/compile(mob/user as mob) var/obj/item/weapon/gun/MFCS/P // Declares but does not instantiate a variable or create the object. - if(src.isKinetic) - P = new obj/item/weapon/gun/MFCS/projectile(loc) // Previously declared variable refers to this object. - else if(src.isEnergy) - P = new obj/item/weapon/gun/MFCS/energy(loc) // As above, different path, shared parent type. + src.compiled = 1 + if(src.mastertype) + P = new mastertype(loc) + else + if(src.isKinetic) + P = new obj/item/weapon/gun/MFCS/projectile(loc) // Previously declared variable refers to this object. + else if(src.isEnergy) + P = new obj/item/weapon/gun/MFCS/energy(loc) // As above, different path, shared parent type. P.modChassis = src.modChassis //etc. Credit to Zuhayr for the above. P.modChamber = src.modChamber if(src.caliber) @@ -131,7 +135,8 @@ P.modLoader = src.modLoader var/load = src.modLoader if(!load.Eloader) - P.max_shells = load.max_shells + if(!P.max_shells) + P.max_shells = load.max_shells P.load_method = load.load_method P.handle_casings = load.handle_casings else @@ -159,7 +164,11 @@ if(I.weight) //will be used to calculate w_class P.weight += I.weight if(I.overlays) //critical component of the upcoming modular sprite system - P.overlays += I.overlays + if(!P.compilesprite) + P.overlays += I.overlays + else + I.overlays = list() + P.icon_state = P.compilesprite if(I.recoil_mod) P.recoil += I.recoil_mod From e686188967ea52b1367e91effb768499ea534ba6 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:44:09 +0100 Subject: [PATCH 105/107] Compilesprites into gun.dm Added compilesprite defining to new() and recompile() --- code/modules/projectiles/gun.dm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 47848d7704aa4..bfcf5bccc50ed 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -106,14 +106,17 @@ if(isnull(scoped_accuracy)) scoped_accuracy = accuracy + compilesprite = icon_state + if(modAssembly) mastertype = src if(!modAssembly.compiled) recompile() /obj/item/weapon/gun/proc/recompile() - var/assembly/A = new modAssembly(loc) + var/assembly/A = new modAssembly(src) A.mastertype = mastertype + A.compilesprite = compilesprite A.modChassis = modChassis A.modChamber = modChamber A.modDriver = modDriver @@ -123,7 +126,7 @@ A.modStock = modStock if(modScope) A.modScope = modScope - A.compiled = null + A.compiled = 0 A.compile() //Checks whether a given mob can use the gun @@ -182,6 +185,12 @@ else return ..() //Pistolwhippin' +/obj/item/weapon/gun/attackby(obj/item/I as obj, mob/user as mob) + if(istype (I, /obj/item/weapon/screwdriver)) + user << "You begin taking apart the [src]." + sleep(20) + recompile() + /obj/item/weapon/gun/proc/Fire(atom/target, mob/living/user, clickparams, pointblank=0, reflex=0) var/isenergy = null if(!user || !target) return From 14dc23b946ce6d7de2f69bf806769a41616019e7 Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 13:45:31 +0100 Subject: [PATCH 106/107] Removed redundant code --- code/modules/projectiles/guns/modular/assembly.dm | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/code/modules/projectiles/guns/modular/assembly.dm b/code/modules/projectiles/guns/modular/assembly.dm index c643a05912b92..8987c54191959 100644 --- a/code/modules/projectiles/guns/modular/assembly.dm +++ b/code/modules/projectiles/guns/modular/assembly.dm @@ -1,14 +1,6 @@ //Frames are the starting blocks of the weapon. The type of frame decides how large a weapon you can build. //In general, weight affects the size and weight (slow to use, bulky, etc) of the weapon -/datum/firemode/modular - name = "modular-default" - burst = 1 - burst_delay = null - fire_delay = null - move_delay = 1 - list/accuracy = list(0) - list/dispersion = list(0) obj/item/weapon/modular_firearms/assembly name = "standard assembly" @@ -30,9 +22,6 @@ obj/item/weapon/modular_firearms/assembly var/isKinetic = null var/list/components = list() var/list/removable = list() - var/useCell = null - var/useSupply = null - var/useBullet = null /obj/item/weapon/modular_firearms/assembly/attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/weapon/modular_firearms)) From 079ed5eb9b4a750592cc618002cb36262280e05e Mon Sep 17 00:00:00 2001 From: BlueNexus Date: Mon, 28 Sep 2015 14:14:54 +0100 Subject: [PATCH 107/107] WIP readme --- .../projectiles/guns/modular/readme.txt | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 code/modules/projectiles/guns/modular/readme.txt diff --git a/code/modules/projectiles/guns/modular/readme.txt b/code/modules/projectiles/guns/modular/readme.txt new file mode 100644 index 0000000000000..925e2f0b6969a --- /dev/null +++ b/code/modules/projectiles/guns/modular/readme.txt @@ -0,0 +1,79 @@ +################################################################################################ +# README - MODULAR FIREARM CONSTRUCTION SYSTEM +# ---------------------------------------------------------------------------------------------- +# 1. Constructing firearms +# 2. Deconstructing firearms +# 3. Components +# 4. Overview of the finished product +# 5. Debugging +# +# +# --Constructing firearms-- +# MFCS allows players to design new guns from an array +# of parts, in-game. These parts can be obtained by +# cargo, or constructed by research, and will normally +# come in a HoS-locked box. Once the player has obtained +# enough of these components to create a new weapon, +# they may "compile" the firearm after installing each +# part on the firearm's frame. +# +# Assembly +# In order to assemble a firearm, the user should obtain the parts they wish to use, starting with +# the "assembly." The type of assembly will indicate the size of the final weapon, as should be clear. +# In order to actually assemble the weapon, the player should follow the following steps. +# +# 1. Click on the assembly with a chassis in hand (ballistic/energy.) This will decide if the weapon +# will fire beams or other energy projectiles, or if it will fire bullets. For now, there are only +# Two types of chassis, although another may be coming in the future. +# +# 2. Click on the assembly with a chamber. This will decide what type of projectile the weapon will fire - +# If the assembly has a ballistic chassis attached, then the player may attach a chamber for any type of +# bullet in the game. For energy chassis's, the player may do the same, but for any type of energy projectile +# including lasers, x-ray, ion, phoron, et cetera. From this point, the steps may be carried out in a variety +# of different orders. It should be noted that in the case of ballistic weapons, this step also decides the +# calibre of the weapon. At this point, the chassis may no longer be removed. +# +# 3. Click on the assembly with either a barrel, a driver, or a loader. +# i) If the player attaches a barrel at this stage, then this will decide the accuracy of the weapon. This +# does not affect the accuracy levels of each firemode, however. Once a barrel is attached, the chamber may not be removed. +# ii) If the player attaches a driver at this stage, then this will decide how the weapon fires. Each driver represents a set +# of firemodes, which will be applied to the final weapon. For instance, the player may attach a longburst driver if they wish +# to replicate the functionality of a SAW, while a semi-automatic driver will act like most pistols in the game. As +# should be obvious, it would be very foolish to attach a driver which allows for longer bursts than the weapon is +# capable of, due to its capacity. Once this part is attached, the chamber may not be removed. +# iii) If the player attaches a loader at this stage, then this will decide how the weapon can be loaded with ammunition. +# care should be taken to ensure that the player does not install a loader with a lower capacity than the weapon's firemodes, +# such as a bolt loader with a fully automatic weapon. In the case of an energy weapon, this step will decide on the size +# of the firearm's power supply. Depending on the chosen loader, the weapon will then accept +# any ammunition of the same calibre as the weapon itself, as long as that ammunition is delivered with the correct loading +# procedure. For instance, a weapon with a magazine loader will accept any magazines with ammunition of the same calibre +# as that defined by the chamber. As with the other two options, carrying out this step will render the chamber unremovable. +# step 3 can be carried out until all three parts are installed. +# +# 4. (optional) Click on the assembly with either a stock or a scope. +# i) If the player attaches a stock at this stage, then this will affect the recoil of the weapon in question, usually reducing +# it. In some cases, the stock will be able to be folded, at which point the weapon will display a message and the W_class will +# be reduced by one. In all cases, having the stock attached and/or extended will increase the W_class of the firearm by 1. +# ii) If the player attaches a scope at this stage, then this will have two effects. If the scope is some kind of long-range +# sniper's scope, this will allow the player to zoom, as they can with any sniper rifle in the game. Their accuracy in this +# mode will be affected by the barrel and firemode in use. If the scope is of any other kind, this will affect the accuracy +# of the weapon when unscoped. For instance, a red-dot sight will slightly increase the accuracy of the weapon, in comparison +# to standard iron sights. +# +# 5. Click on the assembly with a screwdriver. This will complete the weapon, and put it into the hands of the player. Note that +# doing this while the weapon is already compiled will dissasemble it, and the process must be restarted. +# +# ---------------------------- +# assembly +# | +# chassis +# | | | +# stock _| | |_ scope +# chamber +# | | | +# driver _| | |_ barrel +# loader +# ----------------------------- +# +# Fig. 1 - The tree of parts in a firearm. All parts that are linked to others futher down the tree may not be removed +# until all of the further-down parts are removed