mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 10:03:50 +01:00
Gun Code Overhaul Phase 1: (Now with 50% less wasted code!)
- Gun code condensed to make future modifications easier. Functionality should (mostly) remain the same. - Taser guns shoot ONE WHOLE SHOT more then they do now. Yippy! - Energy Crossbow has a slightly higher shot capacity (still automatically recharges). - Guns that shoot projectiles (such as revolvers) now eject the ammo casings when they fire (this will be adjusted somewhat in phase 2). - Revolvers can either be loaded one shell at a time or all at once with an ammo box. - All guns now have a badmin var. Have fun (think shotguns). - A few admin-only guns have been removed (for now). They'll get re-added in a future update. - Shotguns no longer need to be pumped before firing (will change back in phase 2). - All gunshots fired by players are now logged in both the firer's and the target's attack_log. So if someone gets shot and it doesn't show up, it's because a turret or something shot them. Hopefully I didn't miss anything. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1659 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
/obj/closet/syndicate/nuclear/New()
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/weapon/ammo/a357( src )
|
||||
new /obj/item/weapon/ammo/a357( src )
|
||||
new /obj/item/weapon/ammo/a357( src )
|
||||
new /obj/item/ammo_magazine( src )
|
||||
new /obj/item/ammo_magazine( src )
|
||||
new /obj/item/ammo_magazine( src )
|
||||
new /obj/item/weapon/storage/handcuff_kit( src )
|
||||
new /obj/item/weapon/storage/flashbang_kit( src )
|
||||
new /obj/item/weapon/gun/energy/general( src )
|
||||
new /obj/item/weapon/gun/energy/general( src )
|
||||
new /obj/item/weapon/gun/energy/general( src )
|
||||
new /obj/item/weapon/gun/energy( src )
|
||||
new /obj/item/weapon/gun/energy( src )
|
||||
new /obj/item/weapon/gun/energy( src )
|
||||
new /obj/item/weapon/pinpointer( src )
|
||||
new /obj/item/weapon/pinpointer( src )
|
||||
new /obj/item/weapon/pinpointer( src )
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
sleep(2)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/flask(src)
|
||||
new /obj/item/device/radio/headset/heads/captain( src )
|
||||
new /obj/item/weapon/gun/energy/general( src )
|
||||
new /obj/item/weapon/gun/energy( src )
|
||||
new /obj/item/weapon/storage/id_kit( src )
|
||||
new /obj/item/clothing/under/rank/captain( src )
|
||||
new /obj/item/clothing/shoes/brown( src )
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
new /obj/item/device/radio/headset/headset_sec(src)
|
||||
new /obj/item/weapon/flashbang(src)
|
||||
new /obj/item/weapon/handcuffs(src)
|
||||
new /obj/item/weapon/gun/energy/taser_gun(src)
|
||||
new /obj/item/weapon/gun/energy/taser(src)
|
||||
new /obj/item/device/flash(src)
|
||||
new /obj/item/clothing/under/color/red(src)
|
||||
new /obj/item/clothing/shoes/brown(src)
|
||||
@@ -46,7 +46,7 @@
|
||||
..()
|
||||
sleep(2)
|
||||
new /obj/item/device/radio/headset/heads/hop( src )
|
||||
new /obj/item/weapon/gun/energy/general( src )
|
||||
new /obj/item/weapon/gun/energy( src )
|
||||
new /obj/item/device/flash( src )
|
||||
new /obj/item/weapon/storage/id_kit( src )
|
||||
new /obj/item/clothing/under/rank/head_of_personnel( src )
|
||||
@@ -61,7 +61,7 @@
|
||||
sleep(2)
|
||||
new /obj/item/device/radio/headset/heads/hos(src)
|
||||
new /obj/item/weapon/shield/riot(src)
|
||||
new /obj/item/weapon/gun/energy/general( src )
|
||||
new /obj/item/weapon/gun/energy( src )
|
||||
new /obj/item/device/flash( src )
|
||||
new /obj/item/weapon/storage/id_kit( src )
|
||||
new /obj/item/clothing/under/rank/head_of_security( src )
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
new /obj/item/weapon/sword(src)
|
||||
new /obj/item/weapon/sword(src)
|
||||
new /obj/item/weapon/sword(src)
|
||||
new /obj/item/weapon/gun/energy/laser_gun(src)
|
||||
new /obj/item/weapon/gun/energy/laser_gun(src)
|
||||
new /obj/item/weapon/gun/energy/laser_gun(src)
|
||||
new /obj/item/weapon/gun/energy/laser(src)
|
||||
new /obj/item/weapon/gun/energy/laser(src)
|
||||
new /obj/item/weapon/gun/energy/laser(src)
|
||||
new /obj/item/weapon/baton(src)
|
||||
new /obj/item/weapon/baton(src)
|
||||
new /obj/item/weapon/baton(src)
|
||||
@@ -33,9 +33,9 @@
|
||||
new /obj/item/weapon/sword(src)
|
||||
new /obj/item/weapon/sword(src)
|
||||
new /obj/item/weapon/sword(src)
|
||||
new /obj/item/weapon/gun/energy/laser_gun(src)
|
||||
new /obj/item/weapon/gun/energy/laser_gun(src)
|
||||
new /obj/item/weapon/gun/energy/laser_gun(src)
|
||||
new /obj/item/weapon/gun/energy/laser(src)
|
||||
new /obj/item/weapon/gun/energy/laser(src)
|
||||
new /obj/item/weapon/gun/energy/laser(src)
|
||||
new /obj/item/weapon/baton(src)
|
||||
new /obj/item/weapon/baton(src)
|
||||
new /obj/item/weapon/baton(src)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
/obj/beam/a_laser/pulse_laser
|
||||
name = "pulse laser"
|
||||
icon_state = "u_laser"
|
||||
|
||||
Bump(atom/A)
|
||||
spawn()
|
||||
if(A)
|
||||
A.bullet_act(PROJECTILE_PULSE, src, def_zone)
|
||||
del(src)
|
||||
@@ -83,12 +83,11 @@
|
||||
if("revolver")
|
||||
if (src.uses >= 6)
|
||||
src.uses -= 6
|
||||
var/obj/item/weapon/gun/revolver/O = new /obj/item/weapon/gun/revolver(get_turf(src.hostpda))
|
||||
O.bullets = 7
|
||||
new /obj/item/weapon/gun/projectile(get_turf(src.hostpda))
|
||||
if("revolver_ammo")
|
||||
if (src.uses >= 2)
|
||||
src.uses -= 2
|
||||
new /obj/item/weapon/ammo/a357(get_turf(src.hostpda))
|
||||
new /obj/item/ammo_magazine(get_turf(src.hostpda))
|
||||
if("xbow")
|
||||
if (src.uses >= 5)
|
||||
src.uses -= 5
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (1)
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
if (occupied)
|
||||
new /obj/item/weapon/gun/energy/laser_gun/captain( src.loc )
|
||||
new /obj/item/weapon/gun/energy/laser/captain( src.loc )
|
||||
occupied = 0
|
||||
del(src)
|
||||
if (2)
|
||||
@@ -35,14 +35,14 @@
|
||||
if (prob(75))
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
if (occupied)
|
||||
new /obj/item/weapon/gun/energy/laser_gun/captain( src.loc )
|
||||
new /obj/item/weapon/gun/energy/laser/captain( src.loc )
|
||||
occupied = 0
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/displaycase/meteorhit(obj/O as obj)
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
new /obj/item/weapon/gun/energy/laser_gun/captain( src.loc )
|
||||
new /obj/item/weapon/gun/energy/laser/captain( src.loc )
|
||||
del(src)
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
/obj/displaycase/attack_hand(mob/user as mob)
|
||||
if (src.destroyed && src.occupied)
|
||||
new /obj/item/weapon/gun/energy/laser_gun/captain( src.loc )
|
||||
new /obj/item/weapon/gun/energy/laser/captain( src.loc )
|
||||
user << "\b You deactivate the hover field built into the case."
|
||||
src.occupied = 0
|
||||
src.add_fingerprint(user)
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
if ((istype(mover, /obj/effects) || istype(mover, /obj/item/weapon/dummy) || istype(mover, /obj/beam) || istype(mover, /obj/meteor/small)))
|
||||
return 1
|
||||
else
|
||||
if (istype(mover, /obj/bullet))
|
||||
if (istype(mover, /obj/item/projectile))
|
||||
return prob(30)
|
||||
else
|
||||
return !src.density
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,693 @@
|
||||
var/const/PROJECTILE_TASER = 1
|
||||
var/const/PROJECTILE_LASER = 2
|
||||
var/const/PROJECTILE_BULLET = 3
|
||||
var/const/PROJECTILE_PULSE = 4
|
||||
var/const/PROJECTILE_BOLT = 5
|
||||
var/const/PROJECTILE_WEAKBULLET = 6
|
||||
var/const/PROJECTILE_TELEGUN = 7
|
||||
var/const/PROJECTILE_DART = 8
|
||||
|
||||
///////////////////////////////////////////////
|
||||
////////////////AMMO SECTION///////////////////
|
||||
///////////////////////////////////////////////
|
||||
|
||||
/obj/item/projectile
|
||||
name = "projectile"
|
||||
icon = 'projectiles.dmi'
|
||||
icon_state = "bullet"
|
||||
density = 1
|
||||
throwforce = 0.1 //an attempt to make it possible to shoot your way through space
|
||||
unacidable = 1//Just to be sure.
|
||||
anchored = 1.0
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
|
||||
var
|
||||
def_zone = ""
|
||||
damage_type = PROJECTILE_BULLET
|
||||
mob/firer = null
|
||||
silenced = 0
|
||||
yo = null
|
||||
xo = null
|
||||
current = null
|
||||
|
||||
weakbullet
|
||||
damage_type = PROJECTILE_WEAKBULLET
|
||||
|
||||
beam
|
||||
name = "laser"
|
||||
damage_type = PROJECTILE_LASER
|
||||
icon_state = "laser"
|
||||
|
||||
pulse
|
||||
name = "pulse"
|
||||
damage_type = PROJECTILE_PULSE
|
||||
icon_state = "u_laser"
|
||||
|
||||
dart
|
||||
name = "dart"
|
||||
damage_type = PROJECTILE_DART
|
||||
icon_state = "toxin"
|
||||
|
||||
electrode
|
||||
name = "electrode"
|
||||
damage_type = PROJECTILE_TASER
|
||||
icon_state = "spark"
|
||||
|
||||
bolt
|
||||
name = "bolt"
|
||||
damage_type = PROJECTILE_BOLT
|
||||
icon_state = "cbbolt"
|
||||
|
||||
Bump(atom/A as mob|obj|turf|area)
|
||||
spawn(0)
|
||||
if(A)
|
||||
A.bullet_act(damage_type, src, def_zone)
|
||||
if(istype(A,/turf) && !istype(src, /obj/item/projectile/beam))
|
||||
for(var/obj/O in A)
|
||||
O.bullet_act(damage_type, src, def_zone)
|
||||
if(firer && istype(A, /mob))
|
||||
var/mob/M = A
|
||||
if(!silenced)
|
||||
visible_message("\red [A.name] has been shot by [firer.name].", "\blue You hear a [istype(src, /obj/item/projectile/beam) ? "gunshot" : "laser blast"].")
|
||||
else
|
||||
if(M)
|
||||
if(M.client)
|
||||
M << "\red You've been shot!"
|
||||
if(istype(firer, /mob))
|
||||
M.attack_log += text("[] <b>[]/[]</b> shot <b>[]/[]</b> with a <b>[]</b>", world.time, firer, firer.client, M, M.client, src)
|
||||
firer.attack_log += text("[] <b>[]/[]</b> shot <b>[]/[]</b> with a <b>[]</b>", world.time, firer, firer.client, M, M.client, src)
|
||||
else
|
||||
M.attack_log += text("[] <b>UNKOWN SUBJECT (No longer exists)</b> shot <b>[]/[]</b> with a <b>[]</b>", world.time, M, M.client, src)
|
||||
del(src)
|
||||
return
|
||||
|
||||
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if(istype(mover, /obj/item/projectile))
|
||||
return prob(95)
|
||||
else
|
||||
return 1
|
||||
|
||||
process()
|
||||
spawn while(src)
|
||||
if ((!( current ) || loc == current))
|
||||
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
|
||||
if ((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
|
||||
del(src)
|
||||
return
|
||||
step_towards(src, current)
|
||||
sleep( 1 )
|
||||
return
|
||||
|
||||
/obj/item/ammo_casing
|
||||
name = "bullet casing (.375)"
|
||||
desc = "A .357 bullet casing."
|
||||
icon = 'ammo.dmi'
|
||||
icon_state = "s-casing"
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
|
||||
throwforce = 1
|
||||
var
|
||||
caliber = "357" //Which kind of guns it can be loaded into
|
||||
obj/item/projectile/BB //The loaded bullet
|
||||
New()
|
||||
BB = new /obj/item/projectile(src)
|
||||
pixel_x = rand(-10.0, 10)
|
||||
pixel_y = rand(-10.0, 10)
|
||||
dir = pick(cardinal)
|
||||
|
||||
|
||||
c38
|
||||
name = "bullet casing (.38)"
|
||||
desc = "A .38 bullet casing."
|
||||
caliber = "38"
|
||||
|
||||
New()
|
||||
BB = new /obj/item/projectile/weakbullet(src)
|
||||
pixel_x = rand(-10.0, 10)
|
||||
pixel_y = rand(-10.0, 10)
|
||||
dir = pick(cardinal)
|
||||
|
||||
shotgun
|
||||
desc = "A 12gauge shell."
|
||||
name = "12 gauge shell"
|
||||
icon_state = "gshell"
|
||||
caliber = "shotgun"
|
||||
m_amt = 25000
|
||||
|
||||
New()
|
||||
BB = new /obj/item/projectile
|
||||
src.pixel_x = rand(-10.0, 10)
|
||||
src.pixel_y = rand(-10.0, 10)
|
||||
blank
|
||||
desc = "A blank shell."
|
||||
name = "blank shell"
|
||||
icon_state = "blshell"
|
||||
m_amt = 500
|
||||
|
||||
New()
|
||||
src.pixel_x = rand(-10.0, 10)
|
||||
src.pixel_y = rand(-10.0, 10)
|
||||
|
||||
beanbag
|
||||
desc = "A weak beanbag shell."
|
||||
name = "beanbag shell"
|
||||
icon_state = "bshell"
|
||||
m_amt = 10000
|
||||
|
||||
New()
|
||||
BB = new /obj/item/projectile/weakbullet
|
||||
src.pixel_x = rand(-10.0, 10)
|
||||
src.pixel_y = rand(-10.0, 10)
|
||||
|
||||
dart
|
||||
desc = "A dart for use in shotguns.."
|
||||
name = "shotgun dart"
|
||||
icon_state = "blshell" //someone, draw the icon, please.
|
||||
m_amt = 50000 //because it's like, instakill.
|
||||
|
||||
New()
|
||||
BB = new /obj/item/projectile/dart
|
||||
src.pixel_x = rand(-10.0, 10)
|
||||
src.pixel_y = rand(-10.0, 10)
|
||||
|
||||
/obj/item/ammo_magazine
|
||||
name = "ammo box (.357)"
|
||||
desc = "A box of .357 ammo"
|
||||
icon_state = "357"
|
||||
icon = 'ammo.dmi'
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
|
||||
item_state = "syringe_kit"
|
||||
m_amt = 50000
|
||||
throwforce = 2
|
||||
w_class = 1.0
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
var
|
||||
list/stored_ammo = list()
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= 7, i++)
|
||||
stored_ammo += new /obj/item/ammo_casing(src)
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
icon_state = text("[initial(icon_state)]-[]", stored_ammo.len)
|
||||
desc = text("There are [] shell\s left!", stored_ammo.len)
|
||||
|
||||
c38
|
||||
name = "speed loader (.38)"
|
||||
icon_state = "38"
|
||||
New()
|
||||
for(var/i = 1, i <= 7, i++)
|
||||
stored_ammo += new /obj/item/ammo_casing/c38(src)
|
||||
update_icon()
|
||||
|
||||
|
||||
///////////////////////////////////////////////
|
||||
//////////////////////Guns/////////////////////
|
||||
///////////////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun
|
||||
name = "gun"
|
||||
desc = "Its a gun. It's pretty terrible, though."
|
||||
icon = 'gun.dmi'
|
||||
icon_state = "detective"
|
||||
item_state = "gun"
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT | USEDELAY
|
||||
m_amt = 2000
|
||||
w_class = 2.0
|
||||
throw_speed = 4
|
||||
throwforce = 5
|
||||
throw_range = 10
|
||||
force = 10
|
||||
|
||||
origin_tech = "combat=1"
|
||||
var
|
||||
fire_sound = 'Gunshot.ogg'
|
||||
obj/item/projectile/in_chamber
|
||||
caliber = ""
|
||||
silenced = 0
|
||||
badmin = 0
|
||||
|
||||
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
|
||||
throw_speed = 2
|
||||
throw_range = 10
|
||||
m_amt = 1000
|
||||
force = 24
|
||||
var
|
||||
list/loaded = list()
|
||||
max_shells = 7
|
||||
load_method = 0 //0 = Single shells or quick loader, 1 = magazine
|
||||
|
||||
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
|
||||
else
|
||||
return 0
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= 7, i++)
|
||||
loaded += new /obj/item/ammo_casing(src)
|
||||
update_icon()
|
||||
|
||||
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
|
||||
|
||||
update_icon()
|
||||
desc = initial(desc) + text(" Has [] rounds remaining.", loaded.len)
|
||||
|
||||
detective
|
||||
desc = "A cheap Martian knock-off of a Smith & Wesson Model 10. Uses .38-Special rounds."
|
||||
name = ".38 revolver"
|
||||
max_shells = 7
|
||||
force = 14.0
|
||||
caliber = "38"
|
||||
|
||||
New()
|
||||
for(var/i = 1, i <= 5, i++)
|
||||
loaded += new /obj/item/ammo_casing/c38(src)
|
||||
update_icon()
|
||||
|
||||
special_check(var/mob/living/carbon/human/M)
|
||||
if(istype(M) && 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
|
||||
mateba
|
||||
name = "mateba"
|
||||
desc = "When you absolutely, positively need a 10mm hole in the other guy. Uses .357 ammo."
|
||||
icon_state = "mateba"
|
||||
|
||||
shotgun
|
||||
name = "shotgun"
|
||||
desc = "Useful for sweeping alleys."
|
||||
icon_state = "shotgun"
|
||||
max_shells = 2
|
||||
w_class = 4.0
|
||||
force = 7.0
|
||||
caliber = "shotgun"
|
||||
|
||||
New()
|
||||
update_icon()
|
||||
|
||||
combat
|
||||
name = "combat shotgun"
|
||||
icon_state = "cshotgun"
|
||||
w_class = 4.0
|
||||
force = 12.0
|
||||
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY | ONBACK
|
||||
max_shells = 8
|
||||
origin_tech = "combat=3"
|
||||
|
||||
energy
|
||||
icon_state = "energy"
|
||||
name = "energy"
|
||||
desc = "A basic energy-based gun with two settings: Stun and kill."
|
||||
fire_sound = 'Laser.ogg'
|
||||
var
|
||||
var/obj/item/weapon/cell/power_supply
|
||||
mode = 0 //0 = stun, 1 = kill
|
||||
charge_cost = 100 //How much energy is needed to fire.
|
||||
|
||||
New()
|
||||
power_supply = new(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
|
||||
load_into_chamber()
|
||||
if(in_chamber)
|
||||
return 1
|
||||
if(!power_supply)
|
||||
return 0
|
||||
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)
|
||||
power_supply.use(charge_cost)
|
||||
return 1
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
switch(mode)
|
||||
if(0)
|
||||
mode = 1
|
||||
charge_cost = 100
|
||||
user << "\red [src.name] is now set to kill."
|
||||
if(1)
|
||||
mode = 0
|
||||
charge_cost = 100
|
||||
user << "\red [src.name] is now set to stun."
|
||||
update_icon()
|
||||
return
|
||||
|
||||
update_icon()
|
||||
var/ratio = power_supply.charge / power_supply.maxcharge
|
||||
ratio = round(ratio, 0.25) * 100
|
||||
icon_state = text("[][]", initial(icon_state), ratio)
|
||||
|
||||
laser
|
||||
name = "laser gun"
|
||||
icon_state = "laser"
|
||||
w_class = 3.0
|
||||
throw_speed = 2
|
||||
throw_range = 10
|
||||
force = 7.0
|
||||
m_amt = 2000
|
||||
origin_tech = "combat=3;magnets=2"
|
||||
|
||||
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
|
||||
|
||||
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/beam(src)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
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 = 15
|
||||
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."
|
||||
charge_cost = 100
|
||||
if(2)
|
||||
user << "\red [src.name] is now set to destroy."
|
||||
charge_cost = 200
|
||||
else
|
||||
mode = 0
|
||||
user << "\red [src.name] is now set to stun."
|
||||
charge_cost = 50
|
||||
New()
|
||||
power_supply = new /obj/item/weapon/cell/super(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
update_icon()
|
||||
|
||||
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"
|
||||
|
||||
emp_act(severity)
|
||||
..()
|
||||
reliability -= round(15/severity)
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
update_charge()
|
||||
update_reactor()
|
||||
update_mode()
|
||||
|
||||
taser
|
||||
name = "taser gun"
|
||||
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)
|
||||
|
||||
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/electrode(src)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
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"
|
||||
force = 4.0
|
||||
throw_speed = 2
|
||||
throw_range = 10
|
||||
m_amt = 2000
|
||||
origin_tech = "combat=2;magnets=2;syndicate=2"
|
||||
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
|
||||
|
||||
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/electrode(src)
|
||||
return 1
|
||||
return 0
|
||||
proc
|
||||
load_into_chamber()
|
||||
in_chamber = new /obj/item/projectile/weakbullet(src)
|
||||
return 1
|
||||
|
||||
badmin_ammo() //CREEEEEED!!!!!!!!!
|
||||
switch(badmin)
|
||||
if(1)
|
||||
in_chamber = new /obj/item/projectile/electrode(src)
|
||||
if(2)
|
||||
in_chamber = new /obj/item/projectile/weakbullet(src)
|
||||
if(3)
|
||||
in_chamber = new /obj/item/projectile(src)
|
||||
if(4)
|
||||
in_chamber = new /obj/item/projectile/beam(src)
|
||||
if(5)
|
||||
in_chamber = new /obj/item/projectile/beam/pulse(src)
|
||||
else
|
||||
return 0
|
||||
if(!istype(src, /obj/item/weapon/gun/energy))
|
||||
var/obj/item/ammo_casing/AC = new(get_turf(src))
|
||||
AC.name = "unidentifiable bullet casing"
|
||||
AC.desc = "This casing has the Central Command Insignia etched into the side."
|
||||
return 1
|
||||
|
||||
special_check(var/mob/M) //Placeholder for any special checks, like detective's revolver.
|
||||
return 1
|
||||
|
||||
emp_act(severity)
|
||||
for(var/obj/O in contents)
|
||||
O.emp_act(severity)
|
||||
|
||||
afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj)
|
||||
if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy))
|
||||
return
|
||||
if(istype(user, /mob/living))
|
||||
var/mob/living/M = user
|
||||
if ((M.mutations & CLOWN) && prob(50))
|
||||
M << "\red The [src.name] blows up in your face."
|
||||
M.take_organ_damage(0,20)
|
||||
M.drop_item()
|
||||
del(src)
|
||||
return
|
||||
if ((istype(user, /mob/living/carbon/monkey)) && ticker.mode != "monkey")
|
||||
user << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
var/turf/curloc = user.loc
|
||||
var/atom/targloc = get_turf(target)
|
||||
if (!targloc || !istype(targloc, /turf) || !curloc)
|
||||
return
|
||||
|
||||
if(badmin)
|
||||
badmin_ammo()
|
||||
else if(!special_check())
|
||||
return
|
||||
else if(!load_into_chamber())
|
||||
user << "\red *click* *click*";
|
||||
return
|
||||
|
||||
update_icon()
|
||||
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
|
||||
if(!in_chamber)
|
||||
return
|
||||
|
||||
in_chamber.firer = user
|
||||
in_chamber.def_zone = user.get_organ_target()
|
||||
|
||||
if(targloc == curloc)
|
||||
user.bullet_act(in_chamber.damage_type)
|
||||
del(in_chamber)
|
||||
else
|
||||
in_chamber.loc = get_turf(user)
|
||||
user.next_move = world.time + 4
|
||||
in_chamber.silenced = silenced
|
||||
in_chamber.current = curloc
|
||||
in_chamber.yo = targloc.y - curloc.y
|
||||
in_chamber.xo = targloc.x - curloc.x
|
||||
spawn()
|
||||
in_chamber.process()
|
||||
sleep(1)
|
||||
in_chamber = null
|
||||
@@ -538,7 +538,7 @@ CLIPBOARDS
|
||||
del(src)
|
||||
return
|
||||
if("l_gun")
|
||||
var/obj/item/weapon/gun/energy/laser_gun/W = new /obj/item/weapon/gun/energy/laser_gun( M )
|
||||
var/obj/item/weapon/gun/energy/laser/W = new /obj/item/weapon/gun/energy/laser( M )
|
||||
if (M.hand)
|
||||
M.l_hand = W
|
||||
else
|
||||
@@ -549,7 +549,7 @@ CLIPBOARDS
|
||||
del(src)
|
||||
return
|
||||
if("t_gun")
|
||||
var/obj/item/weapon/gun/energy/taser_gun/W = new /obj/item/weapon/gun/energy/taser_gun( M )
|
||||
var/obj/item/weapon/gun/energy/taser/W = new /obj/item/weapon/gun/energy/taser( M )
|
||||
if (M.hand)
|
||||
M.l_hand = W
|
||||
else
|
||||
|
||||
@@ -78,12 +78,11 @@ SYNDICATE UPLINK
|
||||
if("revolver")
|
||||
if (src.uses >= 6)
|
||||
src.uses -= 6
|
||||
var/obj/item/weapon/gun/revolver/O = new /obj/item/weapon/gun/revolver(get_turf(src))
|
||||
O.bullets = 7
|
||||
new /obj/item/weapon/gun/projectile(get_turf(src))
|
||||
if("revolver_ammo")
|
||||
if (src.uses >= 2)
|
||||
src.uses -= 2
|
||||
new /obj/item/weapon/ammo/a357(get_turf(src))
|
||||
new /obj/item/ammo_magazine(get_turf(src))
|
||||
if("xbow")
|
||||
if (src.uses >= 5)
|
||||
src.uses -= 5
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
|
||||
/obj/item/weapon/storage/blankbox/New()
|
||||
|
||||
new /obj/item/weapon/ammo/shell/blank( src )
|
||||
new /obj/item/weapon/ammo/shell/blank( src )
|
||||
new /obj/item/weapon/ammo/shell/blank( src )
|
||||
new /obj/item/weapon/ammo/shell/blank( src )
|
||||
new /obj/item/weapon/ammo/shell/blank( src )
|
||||
new /obj/item/weapon/ammo/shell/blank( src )
|
||||
new /obj/item/weapon/ammo/shell/blank( src )
|
||||
new /obj/item/ammo_casing/shotgun/blank( src )
|
||||
new /obj/item/ammo_casing/shotgun/blank( src )
|
||||
new /obj/item/ammo_casing/shotgun/blank( src )
|
||||
new /obj/item/ammo_casing/shotgun/blank( src )
|
||||
new /obj/item/ammo_casing/shotgun/blank( src )
|
||||
new /obj/item/ammo_casing/shotgun/blank( src )
|
||||
new /obj/item/ammo_casing/shotgun/blank( src )
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
src.orient_objs(4, 10, 4, 3)
|
||||
else if(istype(user, /mob/living/carbon/human) && src == H.belt)//only humans have belts
|
||||
src.orient_objs(1, 3, 8, 3)
|
||||
else
|
||||
else
|
||||
src.orient_objs(7, 8, 10, 7)
|
||||
return
|
||||
|
||||
|
||||
@@ -940,142 +940,6 @@
|
||||
src.part3.release()
|
||||
return
|
||||
|
||||
/obj/bullet/Bump(atom/A as mob|obj|turf|area)
|
||||
spawn(0)
|
||||
if(A)
|
||||
A.bullet_act(PROJECTILE_BULLET, src, def_zone)
|
||||
if(istype(A,/turf))
|
||||
for(var/obj/O in A)
|
||||
O.bullet_act(PROJECTILE_BULLET, src, def_zone)
|
||||
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/bullet/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if(istype(mover, /obj/bullet))
|
||||
return prob(95)
|
||||
else
|
||||
return 1
|
||||
|
||||
/obj/bullet/weakbullet/Bump(atom/A as mob|obj|turf|area)
|
||||
spawn(0)
|
||||
if(A)
|
||||
A.bullet_act(PROJECTILE_WEAKBULLET, src)
|
||||
if(istype(A,/turf))
|
||||
for(var/obj/O in A)
|
||||
O.bullet_act(PROJECTILE_WEAKBULLET, src, def_zone)
|
||||
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/bullet/electrode/Bump(atom/A as mob|obj|turf|area)
|
||||
spawn(0)
|
||||
if(A)
|
||||
A.bullet_act(PROJECTILE_TASER)
|
||||
if(istype(A,/turf))
|
||||
for(var/obj/O in A)
|
||||
O.bullet_act(PROJECTILE_TASER, src, def_zone)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/bullet/cbbolt/Bump(atom/A as mob|obj|turf|area)
|
||||
spawn(0)
|
||||
if(A)
|
||||
A.bullet_act(PROJECTILE_BOLT)
|
||||
if(istype(A,/turf))
|
||||
for(var/obj/O in A)
|
||||
O.bullet_act(PROJECTILE_BOLT, src, def_zone)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/bullet/neurodart/Bump(atom/A as mob|obj|turf|area)
|
||||
spawn(0)
|
||||
if(A)
|
||||
A.bullet_act(PROJECTILE_DART)
|
||||
if(istype(A,/turf))
|
||||
for(var/obj/O in A)
|
||||
O.bullet_act(PROJECTILE_DART, src, def_zone)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/bullet/teleshot/Bump(atom/A as mob|obj|turf|area)
|
||||
if (src.target == null)
|
||||
var/list/turfs = list( )
|
||||
for(var/turf/T in orange(10, src))
|
||||
if(T.x>world.maxx-4 || T.x<4) continue //putting them at the edge is dumb
|
||||
if(T.y>world.maxy-4 || T.y<4) continue
|
||||
turfs += T
|
||||
if(turfs)
|
||||
src.target = pick(turfs)
|
||||
if (!src.target)
|
||||
del(src)
|
||||
return
|
||||
spawn(0)
|
||||
if(A)
|
||||
var/turf/T = get_turf(A)
|
||||
for(var/atom/movable/M in T)
|
||||
if(istype(M, /obj/effects)) //sparks don't teleport
|
||||
continue
|
||||
if (M.anchored)
|
||||
continue
|
||||
if (istype(M, /atom/movable))
|
||||
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
|
||||
s.set_up(5, 1, M)
|
||||
s.start()
|
||||
if(prob(src.failchance)) //oh dear a problem, put em in deep space
|
||||
do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0)
|
||||
else
|
||||
do_teleport(M, src.target, 2)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/bullet/proc/process()
|
||||
spawn while(src)
|
||||
if ((!( src.current ) || src.loc == src.current))
|
||||
src.current = locate(min(max(src.x + src.xo, 1), world.maxx), min(max(src.y + src.yo, 1), world.maxy), src.z)
|
||||
if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy))
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
step_towards(src, src.current)
|
||||
sleep( 1 )
|
||||
return
|
||||
|
||||
/obj/beam/a_laser/Bump(atom/A as mob|obj|turf)
|
||||
spawn(0)
|
||||
if(A)
|
||||
A.bullet_act(PROJECTILE_LASER, src, def_zone)
|
||||
del(src)
|
||||
|
||||
/obj/beam/a_laser/proc/process()
|
||||
spawn while(src)
|
||||
//world << text("laser at [] []:[], target is [] []:[]", src.loc, src.x, src.y, src:current, src.current:x, src.current:y)
|
||||
if ((!( src.current ) || src.loc == src.current))
|
||||
src.current = locate(min(max(src.x + src.xo, 1), world.maxx), min(max(src.y + src.yo, 1), world.maxy), src.z)
|
||||
//world << text("current changed: target is now []. location was [],[], added [],[]", src.current, src.x, src.y, src.xo, src.yo)
|
||||
if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy))
|
||||
//world << text("off-world, deleting")
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
step_towards(src, src.current)
|
||||
// make it able to hit lying-down folk
|
||||
var/list/dudes = list()
|
||||
for(var/mob/living/M in src.loc)
|
||||
dudes += M
|
||||
if(dudes.len)
|
||||
src.Bump(pick(dudes))
|
||||
//world << text("laser stepped, now [] []:[], target is [] []:[]", src.loc, src.x, src.y, src.current, src.current:x, src.current:y)
|
||||
src.life--
|
||||
if (src.life <= 0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
sleep(1)
|
||||
return
|
||||
|
||||
/obj/beam/i_beam/proc/hit()
|
||||
//world << "beam \ref[src]: hit"
|
||||
if (src.master)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
del(src)
|
||||
|
||||
/obj/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover, /obj/beam))
|
||||
if(istype(mover, /obj/beam) || istype(mover, /obj/item/projectile/beam))
|
||||
return 1
|
||||
if (src.dir == SOUTHWEST || src.dir == SOUTHEAST || src.dir == NORTHWEST || src.dir == NORTHEAST)
|
||||
return 0 //full tile window, you can't move into it!
|
||||
@@ -54,7 +54,7 @@
|
||||
return 1
|
||||
|
||||
/obj/window/CheckExit(atom/movable/O as mob|obj, target as turf)
|
||||
if(istype(O, /obj/beam))
|
||||
if(istype(O, /obj/beam) || istype(O, /obj/item/projectile/beam))
|
||||
return 1
|
||||
if (get_dir(O.loc, target) == src.dir)
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user