diff --git a/modular_citadel/code/modules/jobs/job_types/security.dm b/modular_citadel/code/modules/jobs/job_types/security.dm new file mode 100644 index 0000000000..a034ac9cd5 --- /dev/null +++ b/modular_citadel/code/modules/jobs/job_types/security.dm @@ -0,0 +1,2 @@ +/datum/outfit/job/warden + suit_store = /obj/item/gun/energy/pumpaction/defender \ No newline at end of file diff --git a/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm b/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm new file mode 100644 index 0000000000..8fcf7a6463 --- /dev/null +++ b/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm @@ -0,0 +1,199 @@ +/* +// PUMP-ACTION ENERGY GUNS +*/ + +/obj/item/gun/energy/pumpaction //parent object with all procs defined under. Useless in-game, but VERY important codewise + icon_state = "blaster" + name = "pump-action particle blaster" + desc = "A pump action energy gun that requires manual racking to charge supercapacitors." + icon = 'modular_citadel/icons/obj/guns/pumpactionblaster.dmi' + cell_type = /obj/item/stock_parts/cell/pumpaction + var/recentpump = 0 // to prevent spammage + +/obj/item/gun/energy/pumpaction/emp_act(severity) //makes it not rack itself when emp'd + cell.use(round(cell.charge / severity)) + chambered = null //we empty the chamber + update_icon() + +/obj/item/gun/energy/pumpaction/process() //makes it not rack itself when self-charging + if(selfcharge) + charge_tick++ + if(charge_tick < charge_delay) + return + charge_tick = 0 + if(!cell) + return + cell.give(100) + update_icon() + +/obj/item/gun/energy/pumpaction/attack_self(mob/living/user) //makes clicking on it in hand pump it + if(recentpump > world.time) + return + pump(user) + recentpump = world.time + 10 + return + +/obj/item/gun/energy/pumpaction/process_chamber() //makes it so that it doesn't rack itself after firing + if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired... + var/obj/item/ammo_casing/energy/shot = chambered + cell.use(shot.e_cost)//... drain the cell cell + chambered = null //either way, released the prepared shot + +/obj/item/gun/energy/pumpaction/select_fire(mob/living/user) //makes it so that it doesn't rack itself when changing firing modes unless already racked + select++ + if (select > ammo_type.len) + select = 1 + var/obj/item/ammo_casing/energy/shot = ammo_type[select] + fire_sound = shot.fire_sound + fire_delay = shot.delay + if (shot.select_name) + to_chat(user, "[src] is now set to [shot.select_name].") + if(chambered) + chambered = null + recharge_newshot(1) + update_icon() + if(ismob(loc)) //forces inhands to update + var/mob/M = loc + M.update_inv_hands() + return + +/obj/item/gun/energy/pumpaction/update_icon() //adds racked indicators + ..() + var/obj/item/ammo_casing/energy/shot = ammo_type[select] + if(chambered) + add_overlay("[icon_state]_rack_[shot.select_name]") + else + add_overlay("[icon_state]_rack_empty") + +/obj/item/gun/energy/pumpaction/proc/pump(mob/M) //pumping proc. Checks if the gun is empty and plays a different sound if it is. + var/obj/item/ammo_casing/energy/shot = ammo_type[select] + if(cell.charge < shot.e_cost) + playsound(M, 'modular_citadel/sound/weapons/laserPumpEmpty.ogg', 100, 1) //Ends with three beeps made from highly processed knife honing noises + else + playsound(M, 'modular_citadel/sound/weapons/laserPump.ogg', 100, 1) //Ends with high pitched charging noise + recharge_newshot() //try to charge a new shot + update_icon() + return 1 + +/obj/item/gun/energy/pumpaction/AltClick(mob/living/user) //for changing firing modes since attackself is already used for pumping + if(!in_range(src, user)) //Basic checks to prevent abuse + return + if(user.incapacitated() || !istype(user)) + to_chat(user, "You can't do that right now!") + return + + if(ammo_type.len > 1) + select_fire(user) + update_icon() + +/obj/item/gun/energy/pumpaction/examine(mob/user) //so people don't ask HOW TO CHANGE FIRING MODE + ..() + to_chat(user, "Alt-click to change firing modes.") + +/obj/item/gun/energy/pumpaction/worn_overlays(isinhands, icon_file) //ammo counter for inhands + . = ..() + var/ratio = CEILING((cell.charge / cell.maxcharge) * charge_sections, 1) + var/obj/item/ammo_casing/energy/shot = ammo_type[select] + if(isinhands) + if(cell.charge < shot.e_cost) + var/mutable_appearance/ammo_inhand = mutable_appearance(icon_file, "[item_state]_empty") + . += ammo_inhand + else + var/mutable_appearance/ammo_inhand = mutable_appearance(icon_file, "[item_state]_charge_[shot.select_name][ratio]") + . += ammo_inhand + if(chambered) + var/mutable_appearance/rack_inhand = mutable_appearance(icon_file, "[item_state]_rack_[shot.select_name]") + . += rack_inhand + else + var/mutable_appearance/rack_inhand = mutable_appearance(icon_file, "[item_state]_rack_empty") + . += rack_inhand + +/obj/item/stock_parts/cell/pumpaction //nice number to achieve the amount of shots wanted + name = "pump action particle blaster power supply" + maxcharge = 1200 + +//PUMP ACTION DISABLER + +/obj/item/gun/energy/pumpaction/blaster + icon_state = "blaster" + name = "pump-action particle blaster" + desc = "A non-lethal pump-action particle blaster with an overdrive firing mode. Requires manual racking after every shot to charge an integral bank of supercapacitors." + item_state = "particleblaster" + lefthand_file = 'modular_citadel/icons/mob/inhands/guns_lefthand.dmi' + righthand_file = 'modular_citadel/icons/mob/inhands/guns_righthand.dmi' + ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter/disabler/pump, /obj/item/ammo_casing/energy/disabler/slug) + ammo_x_offset = 2 + modifystate = 1 + +//WARDEN'S SPECIAL vERSION + +/obj/item/gun/energy/pumpaction/defender + icon_state = "defender" + name = "particle defender" + desc = "A pump-action particle blaster with a unique particle focusing chamber optimized for decisive de-escalation. Requires manual racking after every shot to charge an integral bank of supercapacitors." + item_state = "particleblaster" + lefthand_file = 'modular_citadel/icons/mob/inhands/guns_lefthand.dmi' + righthand_file = 'modular_citadel/icons/mob/inhands/guns_righthand.dmi' + ammo_type = list(/obj/item/ammo_casing/energy/electrode/pump, /obj/item/ammo_casing/energy/laser/pump) + ammo_x_offset = 2 + modifystate = 1 + +//AMMO CASINGS (fire modes) + +/obj/item/ammo_casing/energy/laser/scatter/disabler/pump + projectile_type = /obj/item/projectile/beam/disabler/weak + e_cost = 150 + pellets = 5 + variance = 30 + fire_sound = 'modular_citadel/sound/weapons/ParticleBlaster.ogg' + select_name = "disable" + +/obj/item/ammo_casing/energy/disabler/slug + projectile_type = /obj/item/projectile/beam/disabler/slug + select_name = "overdrive" + e_cost = 200 + fire_sound = 'modular_citadel/sound/weapons/LaserSlugv3.ogg' + +/obj/item/ammo_casing/energy/laser/pump + projectile_type = /obj/item/projectile/beam/weak + e_cost = 200 + select_name = "kill" + pellets = 3 + variance = 15 + fire_sound = 'modular_citadel/sound/weapons/ParticleBlaster.ogg' + +/obj/item/ammo_casing/energy/electrode/pump + projectile_type = /obj/item/projectile/energy/electrode/pump + select_name = "stun" + fire_sound = 'modular_citadel/sound/weapons/LaserSlugv3.ogg' + e_cost = 300 + pellets = 3 + variance = 20 + +//PROJECTILES + +/obj/item/projectile/beam/disabler/weak + name = "particle blast" + damage = 18 + icon_state = "disablerpellet" + icon = 'modular_citadel/icons/obj/projectiles.dmi' + +/obj/item/projectile/beam/disabler/slug + name = "positron blast" + damage = 60 + range = 14 + speed = 0.6 + icon_state = "disablerslug" + icon = 'modular_citadel/icons/obj/projectiles.dmi' + +/obj/item/projectile/energy/electrode/pump + name = "electron blast" + icon_state = "stunjectile" + icon = 'modular_citadel/icons/obj/projectiles.dmi' + color = null + nodamage = 1 + knockdown = 100 + stutter = 5 + jitter = 20 + hitsound = 'sound/weapons/taserhit.ogg' + range = 7 \ No newline at end of file diff --git a/modular_citadel/icons/mob/inhands/guns_lefthand.dmi b/modular_citadel/icons/mob/inhands/guns_lefthand.dmi new file mode 100644 index 0000000000..601cc921d7 Binary files /dev/null and b/modular_citadel/icons/mob/inhands/guns_lefthand.dmi differ diff --git a/modular_citadel/icons/mob/inhands/guns_righthand.dmi b/modular_citadel/icons/mob/inhands/guns_righthand.dmi new file mode 100644 index 0000000000..c76907d2e8 Binary files /dev/null and b/modular_citadel/icons/mob/inhands/guns_righthand.dmi differ diff --git a/modular_citadel/icons/obj/guns/pumpactionblaster.dmi b/modular_citadel/icons/obj/guns/pumpactionblaster.dmi new file mode 100644 index 0000000000..7a34a398da Binary files /dev/null and b/modular_citadel/icons/obj/guns/pumpactionblaster.dmi differ diff --git a/modular_citadel/icons/obj/projectiles.dmi b/modular_citadel/icons/obj/projectiles.dmi new file mode 100644 index 0000000000..f5f6f2f8f3 Binary files /dev/null and b/modular_citadel/icons/obj/projectiles.dmi differ diff --git a/modular_citadel/sound/weapons/LaserSlugv3.ogg b/modular_citadel/sound/weapons/LaserSlugv3.ogg new file mode 100644 index 0000000000..dbb8f4b954 Binary files /dev/null and b/modular_citadel/sound/weapons/LaserSlugv3.ogg differ diff --git a/modular_citadel/sound/weapons/ParticleBlaster.ogg b/modular_citadel/sound/weapons/ParticleBlaster.ogg new file mode 100644 index 0000000000..ae0ae165f9 Binary files /dev/null and b/modular_citadel/sound/weapons/ParticleBlaster.ogg differ diff --git a/modular_citadel/sound/weapons/laserPump.ogg b/modular_citadel/sound/weapons/laserPump.ogg new file mode 100644 index 0000000000..4063765c5b Binary files /dev/null and b/modular_citadel/sound/weapons/laserPump.ogg differ diff --git a/modular_citadel/sound/weapons/laserPumpEmpty.ogg b/modular_citadel/sound/weapons/laserPumpEmpty.ogg new file mode 100644 index 0000000000..ce82e2bd9d Binary files /dev/null and b/modular_citadel/sound/weapons/laserPumpEmpty.ogg differ diff --git a/tgstation.dme b/tgstation.dme index 8debd4146e..cfe71cbc04 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2603,6 +2603,7 @@ #include "modular_citadel\code\modules\jobs\job_types\captain.dm" #include "modular_citadel\code\modules\jobs\job_types\cargo_service.dm" #include "modular_citadel\code\modules\jobs\job_types\engineering.dm" +#include "modular_citadel\code\modules\jobs\job_types\security.dm" #include "modular_citadel\code\modules\mentor\follow.dm" #include "modular_citadel\code\modules\mentor\mentor.dm" #include "modular_citadel\code\modules\mentor\mentor_memo.dm" @@ -2618,6 +2619,7 @@ #include "modular_citadel\code\modules\mob\living\simple_animal\banana_spider.dm" #include "modular_citadel\code\modules\mob\living\simple_animal\kiwi.dm" #include "modular_citadel\code\modules\power\lighting.dm" +#include "modular_citadel\code\modules\projectiles\guns\pumpenergy.dm" #include "modular_citadel\code\modules\projectiles\guns\ballistic\revolver.dm" #include "modular_citadel\code\modules\projectiles\guns\energy\energy_gun.dm" #include "modular_citadel\code\modules\projectiles\guns\energy\laser.dm"