mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-03 22:13:24 +00:00
Organs:
Moved into their own folder and got split into three files. Damage zones have been regrouped slightly to make it easier to deal with them. Currently the organ groups are head, l/r leg, l/r arm, and head. Attacking: Armor is properly checked. Currently aiming for the chest gives a higher chance to stun whereas the head will stun for longer. Stungloves/Disarm now show up in the attack log. Stungloves ignore intent. Silicon: AI units can now move between cams that are not on the ss13 network. Cyborg's alert screen should not longer pop up every time they get an alert if they have opened it once during the round. Robot vision now uses the standard amount of energy. Gamemodes: Added Deuryn's unrev message. Runes can only be examined if you are close to them. Moved the Loyalty implants to the HoS' locker at the request of HerpA. Nuke agents now come with explosive implants that will activate upon death. Projectiles: Once again went though the gun code and cleaned things up, it is much better now. Bullet_act fixed up and most mobs now use the one in living, just overload it if they need to do something diff. Freeze /caplaser/xbow no longer have an infinite loop. Shotguns have to be pumped manually. Went though the latest runtime log. Power cells now use return on their give/use procs Assemblies have been reworked and are nearly finished, just need to finish up the special assembly code, redo the signalers, and add one or two new assembly items. Laying down will now only take 3 ticks to get up, from 5. You can no longer punch people on the spawn screen. This is a big one and was cleared by two heads, TK will only allow you to pick up items. If you have an item in your hand it will act normal. This revision got much larger than originally intended my tests show everything is working fine, but you never know. Ill likely do more mob teaks in the next few days. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2333 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -1,647 +1,44 @@
|
||||
/obj/item/weapon/gun/energy
|
||||
icon_state = "energy"
|
||||
name = "energy gun"
|
||||
desc = "A basic energy-based gun with two settings: Stun and kill."
|
||||
fire_sound = 'Taser.ogg'
|
||||
|
||||
/obj/item/weapon/gun/energy/laser
|
||||
name = "laser gun"
|
||||
icon_state = "laser"
|
||||
fire_sound = 'Laser.ogg'
|
||||
w_class = 3.0
|
||||
m_amt = 2000
|
||||
origin_tech = "combat=3;magnets=2"
|
||||
mode = 1 //We don't want laser guns to be on a stun setting. --Superxpdude
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
return // We don't want laser guns to be able to change to a stun setting. --Superxpdude
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain
|
||||
icon_state = "caplaser"
|
||||
desc = "This is an antique laser gun. All craftsmanship is of the highest quality. It is decorated with assistant leather and chrome. The object menaces with spikes of energy. On the item is an image of Space Station 13. The station is exploding."
|
||||
force = 10
|
||||
origin_tech = null //forgotten technology of ancients lol
|
||||
|
||||
New()
|
||||
..()
|
||||
charge()
|
||||
|
||||
proc
|
||||
charge()
|
||||
if(power_supply.charge < power_supply.maxcharge)
|
||||
power_supply.give(100)
|
||||
update_icon()
|
||||
spawn(50) charge()
|
||||
//Added this to the cap's laser back before the gun overhaul to make it halfways worth stealing. It's back now. --NEO
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/cyborg/load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(isrobot(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
R.cell.use(40)
|
||||
in_chamber = new /obj/item/projectile/beam(src)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse_rifle
|
||||
name = "pulse rifle"
|
||||
desc = "A heavy-duty, pulse-based energy weapon with multiple fire settings, preferred by front-line combat personnel."
|
||||
icon_state = "pulse"
|
||||
force = 10 //The standard high damage
|
||||
mode = 2
|
||||
fire_sound = 'pulse.ogg'
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
switch (mode)
|
||||
if(0)
|
||||
in_chamber = new /obj/item/projectile/electrode(src)
|
||||
if(1)
|
||||
in_chamber = new /obj/item/projectile/beam(src)
|
||||
if(2)
|
||||
in_chamber = new /obj/item/projectile/beam/pulse(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
mode++
|
||||
switch(mode)
|
||||
if(1)
|
||||
user << "\red [src.name] is now set to kill."
|
||||
fire_sound = 'Laser.ogg'
|
||||
charge_cost = 100
|
||||
if(2)
|
||||
user << "\red [src.name] is now set to destroy."
|
||||
fire_sound = 'pulse.ogg'
|
||||
charge_cost = 200
|
||||
else
|
||||
mode = 0
|
||||
user << "\red [src.name] is now set to stun."
|
||||
fire_sound = 'Taser.ogg'
|
||||
charge_cost = 50
|
||||
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell/super(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse_rifle/destroyer
|
||||
name = "pulse destroyer"
|
||||
desc = "A heavy-duty, pulse-based energy weapon. The mode is set to DESTROY. Always destroy."
|
||||
mode = 2
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell/infinite(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
update_icon()
|
||||
attack_self(mob/living/user as mob)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse_rifle/M1911
|
||||
name = "m1911-P"
|
||||
desc = "It's not the size of the gun, it's the size of the hole it puts through people."
|
||||
icon_state = "m1911-p"
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell/infinite(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/nuclear
|
||||
name = "Advanced Energy Gun"
|
||||
desc = "An energy gun with an experimental miniaturized reactor."
|
||||
origin_tech = "combat=3;materials=5;powerstorage=3"
|
||||
var/lightfail = 0
|
||||
icon_state = "nucgun"
|
||||
|
||||
New()
|
||||
..()
|
||||
charge()
|
||||
|
||||
proc
|
||||
charge()
|
||||
if(power_supply.charge < power_supply.maxcharge)
|
||||
if(failcheck())
|
||||
power_supply.give(100)
|
||||
update_icon()
|
||||
if(!crit_fail)
|
||||
spawn(50) charge()
|
||||
|
||||
|
||||
failcheck()
|
||||
lightfail = 0
|
||||
if (prob(src.reliability)) return 1 //No failure
|
||||
if (prob(src.reliability))
|
||||
for (var/mob/M in range(0,src)) //Only a minor failure, enjoy your radiation if you're in the same tile or carrying it
|
||||
if (src in M.contents)
|
||||
M << "\red Your gun feels pleasantly warm for a moment."
|
||||
else
|
||||
M << "\red You feel a warm sensation."
|
||||
M.radiation += rand(1,40)
|
||||
lightfail = 1
|
||||
else
|
||||
for (var/mob/M in range(rand(1,4),src)) //Big failure, TIME FOR RADIATION BITCHES
|
||||
if (src in M.contents)
|
||||
M << "\red Your gun's reactor overloads!"
|
||||
M << "\red You feel a wave of heat wash over you."
|
||||
M.radiation += 100
|
||||
crit_fail = 1 //break the gun so it stops recharging
|
||||
update_icon()
|
||||
|
||||
|
||||
update_charge()
|
||||
if (crit_fail)
|
||||
overlays += "nucgun-whee"
|
||||
return
|
||||
var/ratio = power_supply.charge / power_supply.maxcharge
|
||||
ratio = round(ratio, 0.25) * 100
|
||||
overlays += text("nucgun-[]", ratio)
|
||||
|
||||
|
||||
update_reactor()
|
||||
if(crit_fail)
|
||||
overlays += "nucgun-crit"
|
||||
return
|
||||
if(lightfail)
|
||||
overlays += "nucgun-medium"
|
||||
else if ((power_supply.charge/power_supply.maxcharge) <= 0.5)
|
||||
overlays += "nucgun-light"
|
||||
else
|
||||
overlays += "nucgun-clean"
|
||||
|
||||
|
||||
update_mode()
|
||||
if (mode == 2)
|
||||
overlays += "nucgun-stun"
|
||||
else if (mode == 1)
|
||||
overlays += "nucgun-kill"
|
||||
var
|
||||
obj/item/weapon/cell/power_supply //What type of power cell this uses
|
||||
charge_cost = 100 //How much energy is needed to fire.
|
||||
cell_type = "/obj/item/weapon/cell"
|
||||
projectile_type = "/obj/item/projectile"
|
||||
|
||||
emp_act(severity)
|
||||
..()
|
||||
reliability -= round(15/severity)
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
update_charge()
|
||||
update_reactor()
|
||||
update_mode()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/taser
|
||||
name = "taser gun"
|
||||
desc = "A small, low capacity gun used for non-lethal takedowns."
|
||||
icon_state = "taser"
|
||||
fire_sound = 'Taser.ogg'
|
||||
charge_cost = 100
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/electrode(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
return
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell/crap(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/taser/cyborg/load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(isrobot(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
R.cell.use(40)
|
||||
in_chamber = new /obj/item/projectile/electrode(src)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/lasercannon//TODO: go over this one
|
||||
name = "laser cannon"
|
||||
desc = "A heavy-duty laser cannon."
|
||||
icon_state = "lasercannon"
|
||||
fire_sound = 'lasercannonfire.ogg'
|
||||
origin_tech = "combat=4;materials=3;powerstorage=3"
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/beam/heavylaser(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
return
|
||||
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
power_supply.use(round(power_supply.maxcharge / severity))
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/shockgun
|
||||
name = "shock gun"
|
||||
desc = "A high tech energy weapon that stuns and burns a target."
|
||||
icon_state = "shockgun"
|
||||
fire_sound = 'Laser.ogg'
|
||||
origin_tech = "combat=5;materials=4;powerstorage=3"
|
||||
charge_cost = 250
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/beam/fireball(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
return
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/ionrifle
|
||||
name = "ion rifle"
|
||||
desc = "A man portable anti-armor weapon designed to disable mechanical threats"
|
||||
icon_state = "ionrifle"
|
||||
fire_sound = 'Laser.ogg'
|
||||
origin_tech = "combat=3;magnets=2"//This could likely be changed up a bit
|
||||
w_class = 4.0
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
|
||||
charge_cost = 200
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/ion(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
return
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/decloner
|
||||
name = "biological demolecularisor"
|
||||
desc = "A gun that discharges high amounts of controlled radiation to slowly break a target into component elements."
|
||||
icon_state = "decloner"
|
||||
fire_sound = 'pulse3.ogg'
|
||||
origin_tech = "combat=5;materials=4;powerstorage=3"
|
||||
charge_cost = 100
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/declone(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/stunrevolver
|
||||
name = "stun revolver"
|
||||
desc = "A high-tech revolver that fires stun cartridges. The stun cartridges can be recharged using a conventional energy weapon recharger."
|
||||
icon_state = "stunrevolver"
|
||||
fire_sound = 'Gunshot.ogg'
|
||||
origin_tech = "combat=3;materials=3;powerstorage=2"
|
||||
charge_cost = 125
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/electrode(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
return
|
||||
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/freeze
|
||||
name = "freeze gun"
|
||||
icon_state = "freezegun"
|
||||
fire_sound = 'pulse3.ogg'
|
||||
desc = "A gun that shoots supercooled hydrogen particles to drastically chill a target's body temperature."
|
||||
var/temperature = T20C
|
||||
var/current_temperature = T20C
|
||||
charge_cost = 100
|
||||
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
|
||||
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell/crap(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
spawn()
|
||||
Life()
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/freeze(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
user.machine = src
|
||||
var/temp_text = ""
|
||||
if(temperature > (T0C - 50))
|
||||
temp_text = "<FONT color=black>[temperature] ([round(temperature-T0C)]°C) ([round(temperature*1.8-459.67)]°F)</FONT>"
|
||||
..()
|
||||
if(cell_type)
|
||||
power_supply = new cell_type(src)
|
||||
else
|
||||
temp_text = "<FONT color=blue>[temperature] ([round(temperature-T0C)]°C) ([round(temperature*1.8-459.67)]°F)</FONT>"
|
||||
|
||||
var/dat = {"<B>Freeze Gun Configuration: </B><BR>
|
||||
Current output temperature: [temp_text]<BR>
|
||||
Target output temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
|
||||
"}
|
||||
|
||||
user << browse(dat, "window=freezegun;size=450x300")
|
||||
onclose(user, "freezegun")
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if (..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min(T20C, src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max(0, src.current_temperature+amount)
|
||||
if (istype(src.loc, /mob))
|
||||
attack_self(src.loc)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
proc/Life()
|
||||
while(src)
|
||||
sleep(10)
|
||||
|
||||
switch(temperature)
|
||||
if(0 to 10) charge_cost = 500
|
||||
if(11 to 50) charge_cost = 150
|
||||
if(51 to 100) charge_cost = 100
|
||||
if(101 to 150) charge_cost = 75
|
||||
if(151 to 200) charge_cost = 50
|
||||
if(201 to 300) charge_cost = 25
|
||||
|
||||
if(current_temperature != temperature)
|
||||
var/difference = abs(current_temperature - temperature)
|
||||
if(difference >= 10)
|
||||
if(current_temperature < temperature)
|
||||
temperature -= 10
|
||||
else
|
||||
temperature += 10
|
||||
else
|
||||
temperature = current_temperature
|
||||
if (istype(src.loc, /mob))
|
||||
attack_self(src.loc)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/plasma
|
||||
name = "plasma gun"
|
||||
icon_state = "plasmagun"
|
||||
fire_sound = 'pulse3.ogg'
|
||||
desc = "A gun that fires super heated plasma at targets, thus increasing their overall body temparature and also harming them."
|
||||
var/temperature = T20C
|
||||
var/current_temperature = T20C
|
||||
charge_cost = 100
|
||||
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
|
||||
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell/crap(src)
|
||||
power_supply = new(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
spawn()
|
||||
Life()
|
||||
return
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/plasma(src)
|
||||
power_supply.use(charge_cost)
|
||||
if(in_chamber) return 1
|
||||
if(!power_supply) return 0
|
||||
if(!power_supply.use(charge_cost)) return 0
|
||||
if(!projectile_type) return 0
|
||||
in_chamber = new projectile_type(src)
|
||||
return 1
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
user.machine = src
|
||||
var/temp_text = ""
|
||||
if(temperature < (T0C + 50))
|
||||
temp_text = "<FONT color=black>[temperature] ([round(temperature+T0C)]°C) ([round(temperature*1.8+459.67)]°F)</FONT>"
|
||||
else
|
||||
temp_text = "<FONT color=red>[temperature] ([round(temperature+T0C)]°C) ([round(temperature*1.8+459.67)]°F)</FONT>"
|
||||
|
||||
var/dat = {"<B>Plasma Gun Configuration: </B><BR>
|
||||
Current output temperature: [temp_text]<BR>
|
||||
Target output temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
|
||||
"}
|
||||
|
||||
user << browse(dat, "window=plasmagun;size=450x300")
|
||||
onclose(user, "plasmagun")
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if (..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount < 0)
|
||||
src.current_temperature = max(T20C, src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = min(800, src.current_temperature+amount)
|
||||
if (istype(src.loc, /mob))
|
||||
attack_self(src.loc)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
proc/Life()
|
||||
while(src)
|
||||
sleep(10)
|
||||
|
||||
switch(temperature)
|
||||
if(601 to 800) charge_cost = 500
|
||||
if(401 to 600) charge_cost = 150
|
||||
if(201 to 400) charge_cost = 100
|
||||
if(101 to 200) charge_cost = 75
|
||||
if(51 to 100) charge_cost = 50
|
||||
if(0 to 50) charge_cost = 25
|
||||
|
||||
if(current_temperature != temperature)
|
||||
var/difference = abs(current_temperature + temperature)
|
||||
if(difference >= 10)
|
||||
if(current_temperature < temperature)
|
||||
temperature -= 10
|
||||
else
|
||||
temperature += 10
|
||||
|
||||
else
|
||||
temperature = current_temperature
|
||||
|
||||
if (istype(src.loc, /mob))
|
||||
attack_self(src.loc)
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/crossbow
|
||||
name = "mini energy-crossbow"
|
||||
desc = "A weapon favored by many of the syndicates stealth specialists."
|
||||
icon_state = "crossbow"
|
||||
w_class = 2.0
|
||||
item_state = "crossbow"
|
||||
m_amt = 2000
|
||||
origin_tech = "combat=2;magnets=2;syndicate=5"
|
||||
silenced = 1
|
||||
fire_sound = 'Genhit.ogg'
|
||||
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell/crap(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
charge()
|
||||
|
||||
|
||||
proc/charge()
|
||||
if(power_supply)
|
||||
if(power_supply.charge < power_supply.maxcharge) power_supply.give(100)
|
||||
spawn(50) charge()
|
||||
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
return
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge < charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/bolt(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
var/ratio = power_supply.charge / power_supply.maxcharge
|
||||
ratio = round(ratio, 0.25) * 100
|
||||
icon_state = text("[][]", initial(icon_state), ratio)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/crossbow/cyborg/load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(isrobot(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
R.cell.use(20)
|
||||
in_chamber = new /obj/item/projectile/bolt(src)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/crossbow/largecrossbow
|
||||
name = "Energy Crossbow"
|
||||
desc = "A weapon favored by syndicate infiltration teams."
|
||||
icon_state = "crossbow"
|
||||
w_class = 4.0
|
||||
item_state = "crossbow"
|
||||
force = 10
|
||||
m_amt = 2000
|
||||
origin_tech = "combat=2;magnets=2;syndicate=5"
|
||||
silenced = 1
|
||||
fire_sound = 'Genhit.ogg'
|
||||
|
||||
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell/crap(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
charge()
|
||||
|
||||
|
||||
charge()
|
||||
if(power_supply)
|
||||
if(power_supply.charge < power_supply.maxcharge) power_supply.give(200)
|
||||
spawn(20) charge()
|
||||
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
return
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(power_supply.charge <= charge_cost)
|
||||
return 0
|
||||
in_chamber = new /obj/item/projectile/largebolt(src)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
|
||||
59
code/modules/projectiles/guns/energy/laser.dm
Normal file
59
code/modules/projectiles/guns/energy/laser.dm
Normal file
@@ -0,0 +1,59 @@
|
||||
/obj/item/weapon/gun/energy/laser
|
||||
name = "laser gun"
|
||||
icon_state = "laser"
|
||||
fire_sound = 'Laser.ogg'
|
||||
w_class = 3.0
|
||||
m_amt = 2000
|
||||
origin_tech = "combat=3;magnets=2"
|
||||
projectile_type = "/obj/item/projectile/beam"
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain
|
||||
icon_state = "caplaser"
|
||||
desc = "This is an antique laser gun. All craftsmanship is of the highest quality. It is decorated with assistant leather and chrome. The object menaces with spikes of energy. On the item is an image of Space Station 13. The station is exploding."
|
||||
force = 10
|
||||
origin_tech = "combat=5;magnets=4"
|
||||
var/charge_tick = 0
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
|
||||
process()
|
||||
charge_tick++
|
||||
if(!charge_tick >= 5) return 0
|
||||
charge_tick = 0
|
||||
if(!power_supply) return 0
|
||||
power_supply.give(100)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/cyborg/load_into_chamber()
|
||||
if(in_chamber) return 1
|
||||
if(isrobot(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
R.cell.use(40)
|
||||
in_chamber = new/obj/item/projectile/beam(src)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/lasercannon
|
||||
name = "laser cannon"
|
||||
desc = "A heavy-duty laser cannon."
|
||||
icon_state = "lasercannon"
|
||||
fire_sound = 'lasercannonfire.ogg'
|
||||
origin_tech = "combat=4;materials=3;powerstorage=3"
|
||||
projectile_type = "/obj/item/projectile/beam/heavylaser"
|
||||
123
code/modules/projectiles/guns/energy/nuclear.dm
Normal file
123
code/modules/projectiles/guns/energy/nuclear.dm
Normal file
@@ -0,0 +1,123 @@
|
||||
/obj/item/weapon/gun/energy/gun
|
||||
icon_state = "energy"
|
||||
name = "energy gun"
|
||||
desc = "A basic energy-based gun with two settings: Stun and kill."
|
||||
fire_sound = 'Taser.ogg'
|
||||
|
||||
charge_cost = 100 //How much energy is needed to fire.
|
||||
projectile_type = "/obj/item/projectile/energy/electrode"
|
||||
|
||||
var
|
||||
mode = 0 //0 = stun, 1 = kill
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
switch(mode)
|
||||
if(0)
|
||||
mode = 1
|
||||
charge_cost = 100
|
||||
fire_sound = 'Laser.ogg'
|
||||
user << "\red [src.name] is now set to kill."
|
||||
projectile_type = "/obj/item/projectile/beam"
|
||||
if(1)
|
||||
mode = 0
|
||||
charge_cost = 100
|
||||
fire_sound = 'Taser.ogg'
|
||||
user << "\red [src.name] is now set to stun."
|
||||
projectile_type = "/obj/item/projectile/energy/electrode"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/nuclear
|
||||
name = "Advanced Energy Gun"
|
||||
desc = "An energy gun with an experimental miniaturized reactor."
|
||||
origin_tech = "combat=3;materials=5;powerstorage=3"
|
||||
var/lightfail = 0
|
||||
icon_state = "nucgun"
|
||||
var/charge_tick = 0
|
||||
|
||||
New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
|
||||
process()
|
||||
charge_tick++
|
||||
if(!charge_tick >= 5) return 0
|
||||
charge_tick = 0
|
||||
if(!power_supply) return 0
|
||||
if(!failcheck()) return 0
|
||||
power_supply.give(100)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
|
||||
proc
|
||||
failcheck()
|
||||
lightfail = 0
|
||||
if (prob(src.reliability)) return 1 //No failure
|
||||
if (prob(src.reliability))
|
||||
for (var/mob/living/M in range(0,src)) //Only a minor failure, enjoy your radiation if you're in the same tile or carrying it
|
||||
if (src in M.contents)
|
||||
M << "\red Your gun feels pleasantly warm for a moment."
|
||||
else
|
||||
M << "\red You feel a warm sensation."
|
||||
M.apply_effect(rand(1,40), IRRADIATE)
|
||||
lightfail = 1
|
||||
else
|
||||
for (var/mob/living/M in range(rand(1,4),src)) //Big failure, TIME FOR RADIATION BITCHES
|
||||
if (src in M.contents)
|
||||
M << "\red Your gun's reactor overloads!"
|
||||
M << "\red You feel a wave of heat wash over you."
|
||||
M.apply_effect(100, IRRADIATE)
|
||||
crit_fail = 1 //break the gun so it stops recharging
|
||||
processing_objects.Remove(src)
|
||||
update_icon()
|
||||
return 0
|
||||
|
||||
|
||||
update_charge()
|
||||
if (crit_fail)
|
||||
overlays += "nucgun-whee"
|
||||
return
|
||||
var/ratio = power_supply.charge / power_supply.maxcharge
|
||||
ratio = round(ratio, 0.25) * 100
|
||||
overlays += text("nucgun-[]", ratio)
|
||||
|
||||
|
||||
update_reactor()
|
||||
if(crit_fail)
|
||||
overlays += "nucgun-crit"
|
||||
return
|
||||
if(lightfail)
|
||||
overlays += "nucgun-medium"
|
||||
else if ((power_supply.charge/power_supply.maxcharge) <= 0.5)
|
||||
overlays += "nucgun-light"
|
||||
else
|
||||
overlays += "nucgun-clean"
|
||||
|
||||
|
||||
update_mode()
|
||||
if (mode == 2)
|
||||
overlays += "nucgun-stun"
|
||||
else if (mode == 1)
|
||||
overlays += "nucgun-kill"
|
||||
|
||||
|
||||
emp_act(severity)
|
||||
..()
|
||||
reliability -= round(15/severity)
|
||||
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
update_charge()
|
||||
update_reactor()
|
||||
update_mode()
|
||||
26
code/modules/projectiles/guns/energy/pulse.dm
Normal file
26
code/modules/projectiles/guns/energy/pulse.dm
Normal file
@@ -0,0 +1,26 @@
|
||||
/obj/item/weapon/gun/energy/pulse_rifle
|
||||
name = "pulse rifle"
|
||||
desc = "A heavy-duty, pulse-based energy weapon, preferred by front-line combat personnel."
|
||||
icon_state = "pulse"
|
||||
force = 10
|
||||
fire_sound = 'pulse.ogg'
|
||||
charge_cost = 200
|
||||
projectile_type = "/obj/item/projectile/beam/pulse"
|
||||
cell_type = "/obj/item/weapon/cell/super"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse_rifle/destroyer
|
||||
name = "pulse destroyer"
|
||||
desc = "A heavy-duty, pulse-based energy weapon."
|
||||
cell_type = "/obj/item/weapon/cell/infinite"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse_rifle/M1911
|
||||
name = "m1911-P"
|
||||
desc = "It's not the size of the gun, it's the size of the hole it puts through people."
|
||||
icon_state = "m1911-p"
|
||||
cell_type = "/obj/item/weapon/cell/infinite"
|
||||
|
||||
|
||||
21
code/modules/projectiles/guns/energy/special.dm
Normal file
21
code/modules/projectiles/guns/energy/special.dm
Normal file
@@ -0,0 +1,21 @@
|
||||
/obj/item/weapon/gun/energy/ionrifle
|
||||
name = "ion rifle"
|
||||
desc = "A man portable anti-armor weapon designed to disable mechanical threats"
|
||||
icon_state = "ionrifle"
|
||||
fire_sound = 'Laser.ogg'
|
||||
origin_tech = "combat=2;magnets=4"
|
||||
w_class = 4.0
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
|
||||
charge_cost = 100
|
||||
projectile_type = "/obj/item/projectile/ion"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/decloner
|
||||
name = "biological demolecularisor"
|
||||
desc = "A gun that discharges high amounts of controlled radiation to slowly break a target into component elements."
|
||||
icon_state = "decloner"
|
||||
fire_sound = 'pulse3.ogg'
|
||||
origin_tech = "combat=5;materials=4;powerstorage=3"
|
||||
charge_cost = 100
|
||||
projectile_type = "/obj/item/projectile/energy/declone"
|
||||
85
code/modules/projectiles/guns/energy/stun.dm
Normal file
85
code/modules/projectiles/guns/energy/stun.dm
Normal file
@@ -0,0 +1,85 @@
|
||||
|
||||
/obj/item/weapon/gun/energy/taser
|
||||
name = "taser gun"
|
||||
desc = "A small, low capacity gun used for non-lethal takedowns."
|
||||
icon_state = "taser"
|
||||
fire_sound = 'Taser.ogg'
|
||||
charge_cost = 100
|
||||
projectile_type = "/obj/item/projectile/electrode"
|
||||
cell_type = "/obj/item/weapon/cell/crap"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/taser/cyborg/load_into_chamber()//TOOD: change this over to the slowly recharge other cell
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(isrobot(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
R.cell.use(charge_cost)
|
||||
in_chamber = new /obj/item/projectile/energy/electrode(src)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/stunrevolver
|
||||
name = "stun revolver"
|
||||
desc = "A high-tech revolver that fires stun cartridges. The stun cartridges can be recharged using a conventional energy weapon recharger."
|
||||
icon_state = "stunrevolver"
|
||||
fire_sound = 'Gunshot.ogg'
|
||||
origin_tech = "combat=3;materials=3;powerstorage=2"
|
||||
charge_cost = 125
|
||||
projectile_type = "/obj/item/projectile/electrode"
|
||||
cell_type = "/obj/item/weapon/cell"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/crossbow
|
||||
name = "mini energy-crossbow"
|
||||
desc = "A weapon favored by many of the syndicates stealth specialists."
|
||||
icon_state = "crossbow"
|
||||
w_class = 2.0
|
||||
item_state = "crossbow"
|
||||
m_amt = 2000
|
||||
origin_tech = "combat=2;magnets=2;syndicate=5"
|
||||
silenced = 1
|
||||
fire_sound = 'Genhit.ogg'
|
||||
projectile_type = "/obj/item/projectile/energy/bolt"
|
||||
cell_type = "/obj/item/weapon/cell/crap"
|
||||
var/charge_tick = 0
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
|
||||
process()
|
||||
charge_tick++
|
||||
if(!charge_tick >= 5) return 0
|
||||
charge_tick = 0
|
||||
if(!power_supply) return 0
|
||||
power_supply.give(100)
|
||||
return 1
|
||||
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/crossbow/largecrossbow
|
||||
name = "Energy Crossbow"
|
||||
desc = "A weapon favored by syndicate infiltration teams."
|
||||
w_class = 4.0
|
||||
force = 10
|
||||
m_amt = 200000
|
||||
projectile_type = "/obj/item/projectile/largebolt"
|
||||
|
||||
|
||||
78
code/modules/projectiles/guns/energy/temperature.dm
Normal file
78
code/modules/projectiles/guns/energy/temperature.dm
Normal file
@@ -0,0 +1,78 @@
|
||||
/obj/item/weapon/gun/energy/temperature
|
||||
name = "temperature gun"
|
||||
icon_state = "freezegun"
|
||||
fire_sound = 'pulse3.ogg'
|
||||
desc = "A gun that changes temperatures."
|
||||
var/temperature = T20C
|
||||
var/current_temperature = T20C
|
||||
charge_cost = 100
|
||||
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
|
||||
|
||||
projectile_type = "/obj/item/projectile/temp"
|
||||
cell_type = "/obj/item/weapon/cell/crap"
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
user.machine = src
|
||||
var/temp_text = ""
|
||||
if(temperature > (T0C - 50))
|
||||
temp_text = "<FONT color=black>[temperature] ([round(temperature-T0C)]°C) ([round(temperature*1.8-459.67)]°F)</FONT>"
|
||||
else
|
||||
temp_text = "<FONT color=blue>[temperature] ([round(temperature-T0C)]°C) ([round(temperature*1.8-459.67)]°F)</FONT>"
|
||||
|
||||
var/dat = {"<B>Freeze Gun Configuration: </B><BR>
|
||||
Current output temperature: [temp_text]<BR>
|
||||
Target output temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
|
||||
"}
|
||||
|
||||
user << browse(dat, "window=freezegun;size=450x300")
|
||||
onclose(user, "freezegun")
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if (..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min(500, src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max(0, src.current_temperature+amount)
|
||||
if (istype(src.loc, /mob))
|
||||
attack_self(src.loc)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
process()
|
||||
switch(temperature)
|
||||
if(0 to 100) charge_cost = 1000
|
||||
if(100 to 250) charge_cost = 500
|
||||
if(251 to 300) charge_cost = 100
|
||||
if(301 to 400) charge_cost = 500
|
||||
if(401 to 500) charge_cost = 1000
|
||||
|
||||
if(current_temperature != temperature)
|
||||
var/difference = abs(current_temperature - temperature)
|
||||
if(difference >= 10)
|
||||
if(current_temperature < temperature)
|
||||
temperature -= 10
|
||||
else
|
||||
temperature += 10
|
||||
else
|
||||
temperature = current_temperature
|
||||
if(istype(src.loc, /mob))
|
||||
attack_self(src.loc)
|
||||
return
|
||||
@@ -1,225 +1,63 @@
|
||||
/obj/item/weapon/gun/projectile/detective
|
||||
desc = "A cheap Martian knock-off of a Smith & Wesson Model 10. Uses .38-Special rounds."
|
||||
name = ".38 revolver"
|
||||
icon_state = "detective"
|
||||
caliber = "38"
|
||||
/obj/item/weapon/gun/projectile
|
||||
desc = "A classic revolver. Uses 357 ammo"
|
||||
name = "revolver"
|
||||
icon_state = "revolver"
|
||||
caliber = "357"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
w_class = 3.0
|
||||
m_amt = 1000
|
||||
|
||||
var
|
||||
ammo_type = "/obj/item/ammo_casing"
|
||||
list/loaded = list()
|
||||
max_shells = 7
|
||||
load_method = 0 //0 = Single shells or quick loader, 1 = magazine
|
||||
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing/c38(src)
|
||||
loaded += new ammo_type(src)
|
||||
update_icon()
|
||||
|
||||
special_check(var/mob/living/carbon/human/M)
|
||||
if(istype(M))
|
||||
if(istype(M.w_uniform, /obj/item/clothing/under/det) && istype(M.head, /obj/item/clothing/head/det_hat) && istype(M.wear_suit, /obj/item/clothing/suit/det_suit))
|
||||
return 1
|
||||
M << "\red You just don't feel cool enough to use this gun looking like that."
|
||||
|
||||
load_into_chamber()
|
||||
if(!loaded.len) return 0
|
||||
|
||||
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
|
||||
loaded -= AC //Remove casing from loaded list.
|
||||
AC.loc = get_turf(src) //Eject casing onto ground.
|
||||
|
||||
if(AC.BB)
|
||||
in_chamber = AC.BB //Load projectile into chamber.
|
||||
AC.BB.loc = src //Set projectile loc to gun.
|
||||
return 1
|
||||
return 0
|
||||
|
||||
verb
|
||||
rename_gun()
|
||||
set name = "Name Gun"
|
||||
set desc = "Click to rename your gun. If you're the detective."
|
||||
|
||||
var/mob/U = usr
|
||||
if(ishuman(U)&&U.mind&&U.mind.assigned_role=="Detective")
|
||||
var/input = input("What do you want to name the gun?",,"")
|
||||
input = sanitize(input)
|
||||
if(input)
|
||||
if(in_range(U,src)&&(!isnull(src))&&!U.stat)
|
||||
name = input
|
||||
U << "You name the gun [input]. Say hello to your new friend."
|
||||
else
|
||||
U << "\red Can't let you do that, detective!"
|
||||
else
|
||||
U << "\red You don't feel cool enough to name this gun, chump."
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/mateba
|
||||
name = "mateba"
|
||||
desc = "When you absolutely, positively need a 10mm hole in the other guy. Uses .357 ammo."
|
||||
icon_state = "mateba"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun
|
||||
name = "shotgun"
|
||||
desc = "Useful for sweeping alleys."
|
||||
icon_state = "shotgun"
|
||||
max_shells = 2
|
||||
w_class = 4.0
|
||||
force = 10
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
|
||||
caliber = "shotgun"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
var/recentpump = 0 // to prevent spammage
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing/shotgun/beanbag(src)
|
||||
update_icon()
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
if(recentpump) return
|
||||
pump()
|
||||
recentpump = 1
|
||||
sleep(10)
|
||||
recentpump = 0
|
||||
attackby(var/obj/item/A as obj, mob/user as mob)
|
||||
var/num_loaded = 0
|
||||
if(istype(A, /obj/item/ammo_magazine))
|
||||
var/obj/item/ammo_magazine/AM = A
|
||||
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
|
||||
if(loaded.len >= max_shells)
|
||||
break
|
||||
if(AC.caliber == caliber && loaded.len < max_shells)
|
||||
AC.loc = src
|
||||
AM.stored_ammo -= AC
|
||||
loaded += AC
|
||||
num_loaded++
|
||||
else if(istype(A, /obj/item/ammo_casing) && !load_method)
|
||||
var/obj/item/ammo_casing/AC = A
|
||||
if(AC.caliber == caliber && loaded.len < max_shells)
|
||||
user.drop_item()
|
||||
AC.loc = src
|
||||
loaded += AC
|
||||
num_loaded++
|
||||
if(num_loaded)
|
||||
user << text("\blue You load [] shell\s into the gun!", num_loaded)
|
||||
A.update_icon()
|
||||
return
|
||||
|
||||
proc/pump(mob/M)
|
||||
playsound(M, 'shotgunpump.ogg', 60, 1)
|
||||
pumped = 0
|
||||
for(var/obj/item/ammo_casing/AC in Storedshots)
|
||||
Storedshots -= AC //Remove casing from loaded list.
|
||||
AC.loc = get_turf(src) //Eject casing onto ground.
|
||||
update_icon()
|
||||
desc = initial(desc) + text(" Has [] rounds remaining.", loaded.len)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/combat
|
||||
name = "combat shotgun"
|
||||
icon_state = "cshotgun"
|
||||
w_class = 4.0
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
|
||||
max_shells = 8
|
||||
origin_tech = "combat=3"
|
||||
maxpump = 1
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing/shotgun(src)
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/combat2
|
||||
name = "security combat shotgun"
|
||||
icon_state = "cshotgun"
|
||||
w_class = 4.0
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
|
||||
max_shells = 4
|
||||
origin_tech = "combat=3"
|
||||
maxpump = 1
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing/shotgun/beanbag(src)
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic //Hopefully someone will find a way to make these fire in bursts or something. --Superxpdude
|
||||
name = "Submachine Gun"
|
||||
desc = "A lightweight, fast firing gun. Uses 9mm rounds."
|
||||
icon_state = "saber"
|
||||
w_class = 3.0
|
||||
max_shells = 18
|
||||
caliber = "9mm"
|
||||
origin_tech = "combat=4;materials=2"
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing/c9mm(src)
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/mini_uzi
|
||||
name = "Mini-Uzi"
|
||||
desc = "A lightweight, fast firing gun, for when you REALLY need someone dead. Uses .45 rounds."
|
||||
icon_state = "mini-uzi"
|
||||
w_class = 3.0
|
||||
max_shells = 20
|
||||
caliber = ".45"
|
||||
origin_tech = "combat=5;materials=2;syndicate=8"
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing/c45(src)
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/silenced
|
||||
name = "Silenced Pistol"
|
||||
desc = "A small, quiet, easily concealable gun. Uses .45 rounds."
|
||||
icon_state = "silenced_pistol"
|
||||
w_class = 3.0
|
||||
max_shells = 12
|
||||
caliber = ".45"
|
||||
silenced = 1
|
||||
origin_tech = "combat=2;materials=2;syndicate=8"
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing/c45(src)
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/deagle
|
||||
name = "Desert Eagle"
|
||||
desc = "A robust handgun that uses 357 magnum ammo"
|
||||
icon_state = "deagle"
|
||||
w_class = 3.0
|
||||
force = 14.0
|
||||
max_shells = 9
|
||||
caliber = "357"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing(src)
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/deagleg
|
||||
name = "Desert Eagle"
|
||||
desc = "A gold plated gun folded over a million times by superior martian gunsmiths. Uses 357 ammo."
|
||||
icon_state = "deagleg"
|
||||
item_state = "deagleg"
|
||||
w_class = 3.0
|
||||
max_shells = 9
|
||||
caliber = "357"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing(src)
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/deaglecamo
|
||||
name = "Desert Eagle"
|
||||
desc = "A Deagle brand Deagle for operators operating operationally. Uses 357 ammo."
|
||||
icon_state = "deaglecamo"
|
||||
item_state = "deagleg"
|
||||
w_class = 3.0
|
||||
max_shells = 9
|
||||
caliber = "357"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing(src)
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/gyropistol
|
||||
name = "Gyrojet Pistol"
|
||||
desc = "A bulky pistol designed to fire self propelled rounds"
|
||||
icon_state = "gyropistol"
|
||||
w_class = 3.0
|
||||
max_shells = 8
|
||||
caliber = "a75"
|
||||
fire_sound = 'Explosion1.ogg'
|
||||
origin_tech = "combat=3"
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= max_shells, i++)
|
||||
loaded += new /obj/item/ammo_casing/a75(src)
|
||||
update_icon()
|
||||
22
code/modules/projectiles/guns/projectile/automatic.dm
Normal file
22
code/modules/projectiles/guns/projectile/automatic.dm
Normal file
@@ -0,0 +1,22 @@
|
||||
/obj/item/weapon/gun/projectile/automatic //Hopefully someone will find a way to make these fire in bursts or something. --Superxpdude
|
||||
name = "Submachine Gun"
|
||||
desc = "A lightweight, fast firing gun. Uses 9mm rounds."
|
||||
icon_state = "saber"
|
||||
w_class = 3.0
|
||||
max_shells = 18
|
||||
caliber = "9mm"
|
||||
origin_tech = "combat=4;materials=2"
|
||||
ammo_type = "/obj/item/ammo_casing/c9mm"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/mini_uzi
|
||||
name = "Mini-Uzi"
|
||||
desc = "A lightweight, fast firing gun, for when you REALLY need someone dead. Uses .45 rounds."
|
||||
icon_state = "mini-uzi"
|
||||
w_class = 3.0
|
||||
max_shells = 20
|
||||
caliber = ".45"
|
||||
origin_tech = "combat=5;materials=2;syndicate=8"
|
||||
ammo_type = "/obj/item/ammo_casing/c45"
|
||||
|
||||
47
code/modules/projectiles/guns/projectile/pistol.dm
Normal file
47
code/modules/projectiles/guns/projectile/pistol.dm
Normal file
@@ -0,0 +1,47 @@
|
||||
/obj/item/weapon/gun/projectile/silenced
|
||||
name = "Silenced Pistol"
|
||||
desc = "A small, quiet, easily concealable gun. Uses .45 rounds."
|
||||
icon_state = "silenced_pistol"
|
||||
w_class = 3.0
|
||||
max_shells = 12
|
||||
caliber = ".45"
|
||||
silenced = 1
|
||||
origin_tech = "combat=2;materials=2;syndicate=8"
|
||||
ammo_type = "/obj/item/ammo_casing/c45"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/deagle
|
||||
name = "Desert Eagle"
|
||||
desc = "A robust handgun that uses 357 magnum ammo"
|
||||
icon_state = "deagle"
|
||||
force = 14.0
|
||||
max_shells = 9
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/deagle/gold
|
||||
name = "Desert Eagle"
|
||||
desc = "A gold plated gun folded over a million times by superior martian gunsmiths. Uses 357 ammo."
|
||||
icon_state = "deagleg"
|
||||
item_state = "deagleg"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/deagle/camo
|
||||
name = "Desert Eagle"
|
||||
desc = "A Deagle brand Deagle for operators operating operationally. Uses 357 ammo."
|
||||
icon_state = "deaglecamo"
|
||||
item_state = "deagleg"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/gyropistol
|
||||
name = "Gyrojet Pistol"
|
||||
desc = "A bulky pistol designed to fire self propelled rounds"
|
||||
icon_state = "gyropistol"
|
||||
max_shells = 8
|
||||
caliber = "a75"
|
||||
fire_sound = 'Explosion1.ogg'
|
||||
origin_tech = "combat=3"
|
||||
ammo_type = "/obj/item/ammo_casing/a75"
|
||||
43
code/modules/projectiles/guns/projectile/revolver.dm
Normal file
43
code/modules/projectiles/guns/projectile/revolver.dm
Normal file
@@ -0,0 +1,43 @@
|
||||
/obj/item/weapon/gun/projectile/detective
|
||||
desc = "A cheap Martian knock-off of a Smith & Wesson Model 10. Uses .38-Special rounds."
|
||||
name = "revolver"
|
||||
icon_state = "detective"
|
||||
caliber = "38"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
ammo_type = "/obj/item/ammo_casing/c38"
|
||||
|
||||
|
||||
special_check(var/mob/living/carbon/human/M)
|
||||
if(ishuman(M))
|
||||
if(istype(M.w_uniform, /obj/item/clothing/under/det) && istype(M.head, /obj/item/clothing/head/det_hat) && istype(M.wear_suit, /obj/item/clothing/suit/det_suit))
|
||||
return 1
|
||||
M << "\red You just don't feel cool enough to use this gun looking like that."
|
||||
return 0
|
||||
|
||||
|
||||
verb/rename_gun()
|
||||
set name = "Name Gun"
|
||||
set desc = "Click to rename your gun. If you're the detective."
|
||||
|
||||
var/mob/M = usr
|
||||
if(!M.mind) return 0
|
||||
if(!M.mind.assigned_role == "Detective")
|
||||
M << "\red You don't feel cool enough to name this gun, chump."
|
||||
return 0
|
||||
|
||||
var/input = input("What do you want to name the gun?",,"")
|
||||
input = sanitize(input)
|
||||
|
||||
if(src && input && !M.stat && in_range(M,src))
|
||||
name = input
|
||||
M << "You name the gun [input]. Say hello to your new friend."
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/mateba
|
||||
name = "mateba"
|
||||
desc = "When you absolutely, positively need a 10mm hole in the other guy. Uses .357 ammo."
|
||||
icon_state = "mateba"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
60
code/modules/projectiles/guns/projectile/shotgun.dm
Normal file
60
code/modules/projectiles/guns/projectile/shotgun.dm
Normal file
@@ -0,0 +1,60 @@
|
||||
/obj/item/weapon/gun/projectile/shotgun
|
||||
name = "shotgun"
|
||||
desc = "Useful for sweeping alleys."
|
||||
icon_state = "shotgun"
|
||||
max_shells = 2
|
||||
w_class = 4.0
|
||||
force = 10
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
|
||||
caliber = "shotgun"
|
||||
origin_tech = "combat=3;materials=1"
|
||||
ammo_type = "/obj/item/ammo_casing/shotgun/beanbag"
|
||||
var
|
||||
recentpump = 0 // to prevent spammage
|
||||
pumped = 0
|
||||
obj/item/ammo_casing/current_shell = null
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber) return 1
|
||||
return 0
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
if(recentpump) return
|
||||
pump()
|
||||
recentpump = 1
|
||||
spawn(10)
|
||||
recentpump = 0
|
||||
return
|
||||
|
||||
|
||||
proc/pump(mob/M)
|
||||
playsound(M, 'shotgunpump.ogg', 60, 1)
|
||||
pumped = 0
|
||||
if(current_shell)//We have a shell in the chamber
|
||||
current_shell.loc = get_turf(src)//Eject casing
|
||||
if(!loaded.len) return 0
|
||||
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
|
||||
loaded -= AC //Remove casing from loaded list.
|
||||
current_shell = AC
|
||||
if(AC.BB)
|
||||
in_chamber = AC.BB //Load projectile into chamber.
|
||||
AC.BB.loc = src //Set projectile loc to gun.
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/combat
|
||||
name = "combat shotgun"
|
||||
icon_state = "cshotgun"
|
||||
max_shells = 8
|
||||
ammo_type = "/obj/item/ammo_casing/shotgun"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/combat2
|
||||
name = "security combat shotgun"
|
||||
icon_state = "cshotgun"
|
||||
max_shells = 4
|
||||
|
||||
Reference in New Issue
Block a user