diff --git a/_maps/map_files/cyberiad/z2.dmm b/_maps/map_files/cyberiad/z2.dmm index f594cbce969..971c88c49bb 100644 --- a/_maps/map_files/cyberiad/z2.dmm +++ b/_maps/map_files/cyberiad/z2.dmm @@ -663,7 +663,7 @@ "mM" = (/turf/space,/turf/simulated/shuttle/wall{icon_state = "diagonalWall3"},/area/shuttle/vox/station) "mN" = (/obj/structure/shuttle/engine/heater,/obj/structure/window/reinforced{dir = 1},/turf/simulated/floor/plating/airless,/area/shuttle/vox/station) "mO" = (/obj/structure/rack,/obj/item/clothing/accessory/storage/black_vest,/obj/item/clothing/suit/space/vox/medic,/obj/item/clothing/head/helmet/space/vox/medic,/obj/item/clothing/mask/breath,/turf/simulated/shuttle/floor4/vox,/area/shuttle/vox/station) -"mP" = (/obj/structure/rack,/obj/item/weapon/gun/launcher/pneumatic,/obj/item/weapon/harpoon,/obj/item/weapon/harpoon,/obj/item/weapon/harpoon,/obj/item/weapon/harpoon,/obj/item/weapon/tank/nitrogen,/obj/machinery/light/spot{tag = "icon-tube1 (EAST)"; icon_state = "tube1"; dir = 4},/turf/simulated/shuttle/floor4/vox,/area/shuttle/vox/station) +"mP" = (/obj/structure/rack,/obj/item/weapon/pneumatic_cannon,/obj/item/weapon/harpoon,/obj/item/weapon/harpoon,/obj/item/weapon/harpoon,/obj/item/weapon/harpoon,/obj/item/weapon/tank/nitrogen,/obj/machinery/light/spot{tag = "icon-tube1 (EAST)"; icon_state = "tube1"; dir = 4},/turf/simulated/shuttle/floor4/vox,/area/shuttle/vox/station) "mQ" = (/turf/space,/turf/simulated/shuttle/wall{dir = 4; icon_state = "diagonalWall3"},/area/shuttle/vox/station) "mR" = (/turf/space/transit/north/shuttlespace_ns7,/area/vox_station/transit) "mS" = (/obj/effect/step_trigger/thrower{affect_ghosts = 1; direction = 2; name = "thrower_throwdown"; tiles = 0},/turf/space/transit/north/shuttlespace_ns12,/area/space) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 46c3e1ff3d2..473710ffed7 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -39,8 +39,6 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \ null, \ new/datum/stack_recipe("canister", /obj/machinery/portable_atmospherics/canister, 10, time = 15, one_per_turf = 1, on_floor = 1), \ null, \ - new/datum/stack_recipe("cannon frame", /obj/item/weapon/cannonframe, 10, time = 15, one_per_turf = 0, on_floor = 0), \ - null, \ new/datum/stack_recipe("floor tile", /obj/item/stack/tile/plasteel, 1, 4, 20), \ new/datum/stack_recipe("metal rod", /obj/item/stack/rods, 1, 2, 60), \ null, \ diff --git a/code/game/objects/items/weapons/pneumaticCannon.dm b/code/game/objects/items/weapons/pneumaticCannon.dm new file mode 100644 index 00000000000..e5889b923d2 --- /dev/null +++ b/code/game/objects/items/weapons/pneumaticCannon.dm @@ -0,0 +1,169 @@ +/obj/item/weapon/pneumatic_cannon + name = "pneumatic cannon" + desc = "A gas-powered cannon that can fire any object loaded into it." + w_class = 4 + force = 8 //Very heavy + attack_verb = list("bludgeoned", "smashed", "beaten") + icon = 'icons/obj/pneumaticCannon.dmi' + icon_state = "pneumaticCannon" + item_state = "bulldog" + lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi' + righthand_file = 'icons/mob/inhands/guns_righthand.dmi' + var/maxWeightClass = 20 //The max weight of items that can fit into the cannon + var/loadedWeightClass = 0 //The weight of items currently in the cannon + var/obj/item/weapon/tank/tank = null //The gas tank that is drawn from to fire things + var/gasPerThrow = 3 //How much gas is drawn from a tank's pressure to fire + var/list/loadedItems = list() //The items loaded into the cannon that will be fired out + var/pressureSetting = 1 //How powerful the cannon is - higher pressure = more gas but more powerful throws + + +/obj/item/weapon/pneumatic_cannon/examine(mob/user) + ..() + if(!in_range(user, src)) + user << "You'll need to get closer to see any more." + return + for(var/obj/item/I in loadedItems) + spawn(0) + user << "\icon [I] It has \the [I] loaded." + if(tank) + user << "\icon [tank] It has \the [tank] mounted onto it." + + +/obj/item/weapon/pneumatic_cannon/attackby(obj/item/weapon/W, mob/user, params) + ..() + if(istype(W, /obj/item/weapon/tank/) && !tank) + if(istype(W, /obj/item/weapon/tank/emergency_oxygen)) + user << "\The [W] is too small for \the [src]." + return + updateTank(W, 0, user) + return + if(W.type == type) + user << "You're fairly certain that putting a pneumatic cannon inside another pneumatic cannon would cause a spacetime disruption." + return + if(istype(W, /obj/item/weapon/wrench)) + switch(pressureSetting) + if(1) + pressureSetting = 2 + if(2) + pressureSetting = 3 + if(3) + pressureSetting = 1 + user << "You tweak \the [src]'s pressure output to [pressureSetting]." + return + if(istype(W, /obj/item/weapon/screwdriver) && tank) + updateTank(tank, 1, user) + return + if(loadedWeightClass >= maxWeightClass) + user << "\The [src] can't hold any more items!" + return + if(istype(W, /obj/item)) + var/obj/item/IW = W + if((loadedWeightClass + IW.w_class) > maxWeightClass) + user << "\The [IW] won't fit into \the [src]!" + return + if(IW.w_class > src.w_class) + user << "\The [IW] is too large to fit into \the [src]!" + return + if(!user.unEquip(W)) + return + user << "You load \the [IW] into \the [src]." + loadedItems.Add(IW) + loadedWeightClass += IW.w_class + IW.loc = src + return + + +/obj/item/weapon/pneumatic_cannon/afterattack(atom/target, mob/living/carbon/human/user, flag, params) + if(istype(target, /obj/item/weapon/storage)) //So you can store it in backpacks + return ..() + if(istype(target, /obj/structure/closet)) //So you can store it in closets + return ..() + if(istype(target, /obj/structure/rack)) //So you can store it on racks + return ..() + if(!istype(user)) + return ..() + Fire(user, target) + + +/obj/item/weapon/pneumatic_cannon/proc/Fire(var/mob/living/carbon/human/user, var/atom/target) + if(!istype(user) && !target) + return + var/discharge = 0 + if(!loadedItems || !loadedWeightClass) + user << "\The [src] has nothing loaded." + return + if(!tank) + user << "\The [src] can't fire without a source of gas." + return + if(tank && !tank.air_contents.remove(gasPerThrow * pressureSetting)) + user << "\The [src] lets out a weak hiss and doesn't react!" + return + if(user && (CLUMSY in user.mutations) && prob(75)) + user.visible_message("[user] loses their grip on [src], causing it to go off!", "[src] slips out of your hands and goes off!") + user.drop_item() + if(prob(10)) + target = get_turf(user) + else + var/list/possible_targets = range(3,src) + target = pick(possible_targets) + discharge = 1 + if(!discharge) + user.visible_message("[user] fires \the [src]!", \ + "You fire \the [src]!") + add_logs(target, user, "fired at", src) + playsound(src.loc, 'sound/weapons/sonic_jackhammer.ogg', 50, 1) + for(var/obj/item/ITD in loadedItems) //Item To Discharge + spawn(0) + loadedItems.Remove(ITD) + loadedWeightClass -= ITD.w_class + ITD.throw_speed = pressureSetting * 2 + ITD.loc = get_turf(src) + ITD.throw_at(target, pressureSetting * 5, pressureSetting * 2,user) + if(pressureSetting >= 3 && user) + user.visible_message("[user] is thrown down by the force of the cannon!", "[src] slams into your shoulder, knocking you down!") + user.Weaken(3) + + +/obj/item/weapon/pneumatic_cannon/ghetto //Obtainable by improvised methods; more gas per use, less capacity, but smaller + name = "improvised pneumatic cannon" + desc = "A gas-powered, object-firing cannon made out of common parts." + force = 5 + w_class = 3 + maxWeightClass = 7 + gasPerThrow = 5 + +/datum/table_recipe/improvised_pneumatic_cannon //Pretty easy to obtain but + name = "Pneumatic Cannon" + result = /obj/item/weapon/pneumatic_cannon/ghetto + tools = list(/obj/item/weapon/weldingtool, + /obj/item/weapon/wrench) + reqs = list(/obj/item/stack/sheet/metal = 4, + /obj/item/stack/packageWrap = 8, + /obj/item/pipe = 2) + time = 300 + +/obj/item/weapon/pneumatic_cannon/proc/updateTank(obj/item/weapon/tank/thetank, removing = 0, mob/living/carbon/human/user) + if(removing) + if(!src.tank) + return + user << "You detach \the [thetank] from \the [src]." + src.tank.loc = get_turf(user) + user.put_in_hands(tank) + src.tank = null + if(!removing) + if(src.tank) + user << "\The [src] already has a tank." + return + if(!user.unEquip(thetank)) + return + user << "You hook \the [thetank] up to \the [src]." + src.tank = thetank + thetank.loc = src + src.update_icons() + +/obj/item/weapon/pneumatic_cannon/proc/update_icons() + src.overlays.Cut() + if(!tank) + return + src.overlays += image('icons/obj/pneumaticCannon.dmi', "[tank.icon_state]") + src.update_icon() diff --git a/code/modules/projectiles/guns/projectile/pneumatic.dm b/code/modules/projectiles/guns/projectile/pneumatic.dm deleted file mode 100644 index 2822d375096..00000000000 --- a/code/modules/projectiles/guns/projectile/pneumatic.dm +++ /dev/null @@ -1,210 +0,0 @@ -/obj/item/weapon/gun/launcher/pneumatic - name = "pneumatic cannon" - desc = "A large gas-powered cannon." - icon = 'icons/obj/gun.dmi' - icon_state = "pneumatic" - item_state = "pneumatic" - w_class = 5.0 - flags = CONDUCT - fire_sound_text = "a loud whoosh of moving air" - fire_delay = 50 - fire_sound = 'sound/weapons/tablehit1.ogg' - - var/fire_pressure // Used in fire checks/pressure checks. - var/max_w_class = 3 // Hopper intake size. - var/max_combined_w_class = 20 // Total internal storage size. - var/obj/item/weapon/tank/tank = null // Tank of gas for use in firing the cannon. - var/obj/item/weapon/storage/tank_container = new() // Something to hold the tank item so we don't accidentally fire it. - var/pressure_setting = 10 // Percentage of the gas in the tank used to fire the projectile. - var/possible_pressure_amounts = list(5,10,20,25,50) // Possible pressure settings. - var/minimum_tank_pressure = 10 // Minimum pressure to fire the gun. - var/force_divisor = 400 // Force equates to speed. Speed/5 equates to a damage multiplier for whoever you hit. - // For reference, a fully pressurized oxy tank at 50% gas release firing a health - // analyzer with a force_divisor of 10 hit with a damage multiplier of 3000+. -/obj/item/weapon/gun/launcher/pneumatic/New() - ..() - tank_container.tag = "gas_tank_holder" - -/obj/item/weapon/gun/launcher/pneumatic/verb/set_pressure() //set amount of tank pressure. - - set name = "Set Valve Pressure" - set category = "Object" - set src in range(0) - var/N = input("Percentage of tank used per shot:","[src]") as null|anything in possible_pressure_amounts - if (N) - pressure_setting = N - usr << "You dial the pressure valve to [pressure_setting]%." - -/obj/item/weapon/gun/launcher/pneumatic/verb/eject_tank() //Remove the tank. - - set name = "Eject Tank" - set category = "Object" - set src in range(0) - - if(tank) - usr << "You twist the valve and pop the tank out of [src]." - tank.loc = usr.loc - tank = null - icon_state = "pneumatic" - item_state = "pneumatic" - usr.update_icons() - else - usr << "There's no tank in [src]." - -/obj/item/weapon/gun/launcher/pneumatic/attackby(obj/item/W as obj, mob/user as mob, params) - if(!tank && istype(W,/obj/item/weapon/tank)) - user.drop_item() - tank = W - tank.loc = src.tank_container - user.visible_message("[user] jams [W] into [src]'s valve and twists it closed.","You jam [W] into [src]'s valve and twist it closed.") - icon_state = "pneumatic-tank" - item_state = "pneumatic-tank" - user.update_icons() - else if(W.w_class <= max_w_class) - - var/total_stored = 0 - for(var/obj/item/O in src.contents) - total_stored += O.w_class - if(total_stored + W.w_class <= max_combined_w_class) - user.drop_item(W) - W.loc = src - user << "You shove [W] into the hopper." - else - user << "That won't fit into the hopper - it's full." - return - else - user << "That won't fit into the hopper." - -/obj/item/weapon/gun/launcher/pneumatic/attack_self(mob/user as mob) - - if(contents.len > 0) - var/obj/item/removing = contents[contents.len] - if(removing == in_chamber) - in_chamber = null - - removing.loc = get_turf(src) - user.put_in_hands(removing) - user << "You remove [removing] from the hopper." - else - user << "There is nothing to remove in \the [src]." - return - -/obj/item/weapon/gun/launcher/pneumatic/chamber_round() - if(!contents.len) - return 0 - - in_chamber = contents[1] - return !isnull(in_chamber) - -/obj/item/weapon/gun/launcher/pneumatic/examine(mob/user) - if(..(user, 2)) - user << "The valve is dialed to [pressure_setting]%." - if(tank) - user << "The tank dial reads [tank.air_contents.return_pressure()] kPa." - else - user << "Nothing is attached to the tank valve!" - -/obj/item/weapon/gun/launcher/pneumatic/special_check(user) - - if (!tank) - user << "There is no gas tank in [src]!" - return 0 - - fire_pressure = (tank.air_contents.return_pressure()/100)*pressure_setting - if (fire_pressure < minimum_tank_pressure) - user << "There isn't enough gas in the tank to fire [src]." - return 0 - - return 1 - -/obj/item/weapon/gun/launcher/pneumatic/update_release_force() - if(!in_chamber) return - release_force = ((fire_pressure*tank.volume)/in_chamber.w_class)/force_divisor //projectile speed. - if(release_force >80) release_force = 80 //damage cap. - -/obj/item/weapon/gun/launcher/pneumatic/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0) - - if(!tank || !..()) return //Only do this on a successful shot. - - var/lost_gas_amount = tank.air_contents.total_moles()*(pressure_setting/100) - var/datum/gas_mixture/removed = tank.air_contents.remove(lost_gas_amount) - user.loc.assume_air(removed) - -//Constructable pneumatic cannon. - -/obj/item/weapon/cannonframe - name = "pneumatic cannon frame" - desc = "A half-finished pneumatic cannon." - icon_state = "pneumatic0" - item_state = "pneumatic" - - var/buildstate = 0 - -/obj/item/weapon/cannonframe/update_icon() - icon_state = "pneumatic[buildstate]" - -/obj/item/weapon/cannonframe/examine(mob/user) - ..(user) - switch(buildstate) - if(1) user << "It has a pipe segment installed." - if(2) user << "It has a pipe segment welded in place." - if(3) user << "It has an outer chassis installed." - if(4) user << "It has an outer chassis welded in place." - if(5) user << "It has a transfer valve installed." - -/obj/item/weapon/cannonframe/attackby(obj/item/W as obj, mob/user as mob, params) - if(istype(W,/obj/item/pipe)) - if(buildstate == 0) - user.drop_item() - qdel(W) - user << "\blue You secure the piping inside the frame." - buildstate++ - update_icon() - return - else if(istype(W,/obj/item/stack/sheet/metal)) - if(buildstate == 2) - var/obj/item/stack/sheet/metal/M = W - if(M.amount >= 5) - M.use(5) - user << "\blue You assemble a chassis around the cannon frame." - buildstate++ - update_icon() - else - user << "\blue You need at least five metal sheets to complete this task." - return - else if(istype(W,/obj/item/device/transfer_valve)) - if(buildstate == 4) - user.drop_item() - qdel(W) - user << "\blue You install the transfer valve and connect it to the piping." - buildstate++ - update_icon() - return - else if(istype(W,/obj/item/weapon/weldingtool)) - if(buildstate == 1) - var/obj/item/weapon/weldingtool/T = W - if(T.remove_fuel(0,user)) - if(!src || !T.isOn()) return - playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) - user << "\blue You weld the pipe into place." - buildstate++ - update_icon() - if(buildstate == 3) - var/obj/item/weapon/weldingtool/T = W - if(T.remove_fuel(0,user)) - if(!src || !T.isOn()) return - playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) - user << "\blue You weld the metal chassis together." - buildstate++ - update_icon() - if(buildstate == 5) - var/obj/item/weapon/weldingtool/T = W - if(T.remove_fuel(0,user)) - if(!src || !T.isOn()) return - playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) - user << "\blue You weld the valve into place." - new /obj/item/weapon/gun/launcher/pneumatic(get_turf(src)) - qdel(src) - return - else - ..() diff --git a/icons/obj/pneumaticCannon.dmi b/icons/obj/pneumaticCannon.dmi new file mode 100644 index 00000000000..41de7677b56 Binary files /dev/null and b/icons/obj/pneumaticCannon.dmi differ diff --git a/paradise.dme b/paradise.dme index d1ccd59eae7..5609a53594b 100644 --- a/paradise.dme +++ b/paradise.dme @@ -720,6 +720,7 @@ #include "code\game\objects\items\weapons\mop.dm" #include "code\game\objects\items\weapons\paint.dm" #include "code\game\objects\items\weapons\paiwire.dm" +#include "code\game\objects\items\weapons\pneumaticCannon.dm" #include "code\game\objects\items\weapons\power_cells.dm" #include "code\game\objects\items\weapons\RCD.dm" #include "code\game\objects\items\weapons\RSF.dm" @@ -1627,7 +1628,6 @@ #include "code\modules\projectiles\guns\projectile\grenade launcher.dm" #include "code\modules\projectiles\guns\projectile\launchers.dm" #include "code\modules\projectiles\guns\projectile\pistol.dm" -#include "code\modules\projectiles\guns\projectile\pneumatic.dm" #include "code\modules\projectiles\guns\projectile\revolver.dm" #include "code\modules\projectiles\guns\projectile\rocket.dm" #include "code\modules\projectiles\guns\projectile\shotgun.dm"