Compiles, and guns work™

This commit is contained in:
TheDZD
2016-05-28 14:28:23 -04:00
parent 95d7a68a75
commit a4e950d21a
74 changed files with 288 additions and 550 deletions
+3 -3
View File
@@ -120,8 +120,8 @@ var/global/sent_honksquad = 0
equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/spray/waterflower(src), slot_in_backpack)
if(prob(50))
equip_to_slot_or_del(new /obj/item/weapon/gun/energy/clown(src), slot_in_backpack)
else
equip_to_slot_or_del(new /obj/item/weapon/gun/grenadelauncher/piecannon(src), slot_in_backpack)
//else
//equip_to_slot_or_del(new /obj/item/weapon/gun/grenadelauncher/piecannon(src), slot_in_backpack)
src.mutations.Add(CLUMSY)
@@ -134,4 +134,4 @@ var/global/sent_honksquad = 0
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
return 1
return 1
@@ -144,7 +144,7 @@ var/global/sent_syndicate_strike_team = 0
equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(src), slot_glasses)
equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(src), slot_back)
equip_to_slot_or_del(new /obj/item/ammo_box/magazine/m762, slot_in_backpack)
equip_to_slot_or_del(new /obj/item/ammo_box/magazine/mm556x45)
equip_to_slot_or_del(new /obj/item/ammo_box/magazine/m45(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/hypospray/combat/nanites(src), slot_in_backpack)
@@ -173,4 +173,4 @@ var/global/sent_syndicate_strike_team = 0
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
return 1
return 1
+3 -3
View File
@@ -18,8 +18,8 @@ var/global/vox_tick = 1
equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(src), slot_glasses) // REPLACE WITH CODED VOX ALTERNATIVE.
equip_to_slot_or_del(new /obj/item/device/chameleon(src), slot_l_store)
var/obj/item/weapon/gun/launcher/spikethrower/W = new(src)
equip_to_slot_or_del(W, slot_r_hand)
//var/obj/item/weapon/gun/launcher/spikethrower/W = new(src)
//equip_to_slot_or_del(W, slot_r_hand)
if(2) // Vox engineer!
@@ -77,4 +77,4 @@ var/global/vox_tick = 1
vox_tick++
if (vox_tick > 4) vox_tick = 1
return 1
return 1
@@ -119,7 +119,7 @@
gun.attack_self(holder.wearer)
return 1
gun.Fire(target,holder.wearer)
gun.process_fire(target,holder.wearer)
return 1
/obj/item/rig_module/mounted/egun
@@ -168,7 +168,7 @@
active_power_cost = 10
passive_power_cost = 0
gun_type = /obj/item/weapon/gun/energy/crossbow/ninja
gun_type = /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/ninja
/obj/item/rig_module/mounted/energy_blade/process()
+18 -1
View File
@@ -1982,4 +1982,21 @@
. |= A.GetAccess()
/mob/living/carbon/human/is_mechanical()
return ..() || (species.flags & ALL_RPARTS) != 0
return ..() || (species.flags & ALL_RPARTS) != 0
/mob/living/carbon/human/can_use_guns(var/obj/item/weapon/gun/G)
. = ..()
if(G.trigger_guard == TRIGGER_GUARD_NORMAL)
if(HULK in mutations)
to_chat(src, "<span class='warning'>Your meaty finger is much too large for the trigger guard!</span>")
return 0
if(species.flags & NOGUNS)
to_chat(src, "<span class='warning'>Your fingers don't fit in the trigger guard!</span>")
return 0
if(martial_art && martial_art.name == "The Sleeping Carp") //great dishonor to famiry
to_chat(src, "<span class='warning'>Use of ranged weaponry would bring dishonor to the clan.</span>")
return 0
return .
@@ -46,7 +46,10 @@ emp_act
if((P.embed && prob(20 + max(P.damage - armor, -10))))
var/obj/item/weapon/shard/shrapnel/SP = new()
(SP.name) = "[P.name] shrapnel"
(SP.desc) = "[SP.desc] It looks like it was fired from [P.shot_from]."
if(P.ammo_casing && P.ammo_casing.caliber)
(SP.desc) = "[SP.desc] It looks like it is a [P.ammo_casing.caliber] caliber round."
else
(SP.desc) = "[SP.desc] The round's caliber is unidentifiable."
(SP.loc) = organ
organ.embed(SP)
@@ -693,7 +693,7 @@
best = R
if(istype(R, /obj/item/weapon/gun))
var/obj/item/weapon/gun/G = R
if(G.can_fire())
if(G.can_shoot())
best = R
break // gun with ammo? screw the rest
if(best && best != main_hand)
@@ -727,22 +727,23 @@
if(main_hand.force != 0)
if(istype(main_hand,/obj/item/weapon/gun))
var/obj/item/weapon/gun/G = main_hand
if(G.special_check(src))
if(G.can_trigger_gun(src))
var/shouldFire = 1
if(istype(main_hand, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/P = main_hand
var/stunning = 0
if(ispath(text2path(P.projectile_type), /obj/item/projectile/energy/electrode))
stunning = 1
for(var/A in P.ammo_type)
if(ispath(A,/obj/item/ammo_casing/energy/electrode))
stunning = 1
var/mob/stunCheck = TARGET
if(stunning && stunCheck.stunned)
shouldFire = 0
if(shouldFire)
if(!G.process_chambered())
G.click_empty(src)
if(!G.can_shoot())
G.shoot_with_empty_chamber(src)
npcDrop(G, 1)
else
G.Fire(TARGET, src)
G.process_fire(TARGET, src)
else
if(get_dist(src,TARGET) > 6)
if(!walk2derpless(TARGET))
@@ -871,4 +872,4 @@
else
A.stamp(S)
custom_emote(2, "[pick("gibbers","drools","slobbers","claps wildly","spits")] as they stamp \the [A] with \a [S]!")
return
return
+6
View File
@@ -855,3 +855,9 @@
tally += 10
return tally
/mob/living/proc/can_use_guns(var/obj/item/weapon/gun/G)
if (G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser())
to_chat(src, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 0
return 1
@@ -47,10 +47,6 @@
proj_sharp = 0
proj_edge = 0
if(istype(P, /obj/item/projectile/beam/lightning)) //Stupid snowflake lightning gun.
if(P.damage >= 200)
src.dust()
if(!P.nodamage)
apply_damage(P.damage, P.damage_type, def_zone, armor)
return P.on_hit(src, armor, def_zone)
@@ -403,7 +403,7 @@ Auto Patrol[]"},
shoot_sound = 'sound/weapons/laser.ogg'
if(emagged == 2)
if(lasercolor)
projectile = /obj/item/projectile/lasertag
projectile = /obj/item/projectile/beam/lasertag
else
projectile = /obj/item/projectile/beam
else
@@ -411,9 +411,9 @@ Auto Patrol[]"},
shoot_sound = 'sound/weapons/Taser.ogg'
projectile = /obj/item/projectile/energy/electrode
else if(lasercolor == "b")
projectile = /obj/item/projectile/lasertag/blue
projectile = /obj/item/projectile/beam/lasertag/bluetag
else if(lasercolor == "r")
projectile = /obj/item/projectile/lasertag/red
projectile = /obj/item/projectile/beam/lasertag/redtag
/mob/living/simple_animal/bot/ed209/proc/shootAt(mob/target)
if(lastfired && world.time - lastfired < shot_delay)
@@ -491,10 +491,10 @@ Auto Patrol[]"},
if(!disabled)
var/lasertag_check = 0
if((lasercolor == "b"))
if(istype(Proj, /obj/item/projectile/lasertag/red))
if(istype(Proj, /obj/item/projectile/beam/lasertag/redtag))
lasertag_check++
else if((lasercolor == "r"))
if(istype(Proj, /obj/item/projectile/lasertag/blue))
if(istype(Proj, /obj/item/projectile/beam/lasertag/bluetag))
lasertag_check++
if(lasertag_check)
icon_state = "[lasercolor]ed2090"
+4 -4
View File
@@ -65,9 +65,9 @@
if ((O.client && !( O.blinded )))
to_chat(O, "\red [src] launches a razor-sharp quill at [target]!")
var/obj/item/weapon/arrow/quill/Q = new(loc)
Q.fingerprintslast = src.ckey
Q.throw_at(target,10,30)
//var/obj/item/weapon/arrow/quill/Q = new(loc)
//Q.fingerprintslast = src.ckey
//Q.throw_at(target,10,30)
quills--
spawn(100)
@@ -155,4 +155,4 @@
desc = "A series of metallic lenses and chains."
icon = 'icons/obj/clothing/hats.dmi'
icon_state = "amp"
item_state = "amp"
item_state = "amp"
+7 -3
View File
@@ -17,7 +17,6 @@
var/randomspread = 0 //Randomspread for automatics
var/click_cooldown_override = 0 //Override this to make your gun have a faster fire rate, in tenths of a second. 4 is the default gun cooldown.
/obj/item/ammo_casing/New()
..()
if(projectile_type)
@@ -32,6 +31,11 @@
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
desc = "[initial(desc)][BB ? "" : " This one is spent"]"
/obj/item/ammo_casing/proc/newshot() //For energy weapons, shotgun shells and wands (!).
if (!BB)
BB = new projectile_type(src)
return
/obj/item/ammo_casing/attackby(obj/item/I as obj, mob/user as mob, params)
if(istype(I, /obj/item/ammo_box))
var/obj/item/ammo_box/box = I
@@ -99,7 +103,7 @@
update_icon()
/obj/item/ammo_box/Destroy()
for(atom/A in stored_ammo)
for(var/atom/A in stored_ammo)
qdel(A)
stored_ammo = null
return ..()
@@ -128,7 +132,7 @@
for(var/obj/item/ammo_casing/AC in stored_ammo)
if(!AC.BB)//found a spent ammo
stored_ammo -= AC
AC.loc = get_turf(src.loc)
AC.loc = get_turf(loc)
stored_ammo += R
R.loc = src
@@ -96,7 +96,7 @@
icon_state = "gshell"
projectile_type = /obj/item/projectile/bullet/pellet
pellets = 6
deviation = 25
variance = 25
/obj/item/ammo_casing/shotgun/rubbershot
name = "rubber shot"
@@ -104,7 +104,7 @@
icon_state = "bshell"
projectile_type = /obj/item/projectile/bullet/rpellet
pellets = 6
deviation = 25
variance = 25
materials = list(MAT_METAL=4000)
/obj/item/ammo_casing/shotgun/beanbag
@@ -121,17 +121,17 @@
projectile_type = /obj/item/projectile/bullet/pellet/weak
materials = list(MAT_METAL=250)
pellets = 5
deviation = 25
variance = 25
/obj/item/ammo_casing/shotgun/improvised/overload
name = "overloaded improvised shell"
desc = "An extremely weak shotgun shell with multiple small pellets made out of metal shards. This one has been packed with even more \
propellant. It's like playing russian roulette, with a shotgun."
icon_state = "improvshell"
projectile_type = /obj/item/projectile/bullet/pellet/random
projectile_type = /obj/item/projectile/bullet/pellet/overload
materials = list(MAT_METAL=250)
pellets = 5
deviation = 40
variance = 40
/obj/item/ammo_casing/shotgun/improvised/overload/New()
..()
@@ -191,7 +191,7 @@
icon_state = "ionshell"
projectile_type = /obj/item/projectile/ion/weak
pellets = 4
deviation = 35
variance = 35
/obj/item/ammo_casing/shotgun/laserslug
name = "laser slug"
@@ -110,7 +110,8 @@
/obj/item/ammo_casing/energy/temp/newshot()
..()
BB.temperature = temperature
var/obj/item/projectile/temp/T = BB
T.temperature = temperature
/obj/item/ammo_casing/energy/meteor
projectile_type = /obj/item/projectile/meteor
@@ -202,7 +203,7 @@
projectile_type = /obj/item/projectile/energy/shock_revolver
/obj/item/ammo_casing/energy/toxplasma
projectile_type = /obj/item/projectile/toxplasma
projectile_type = /obj/item/projectile/energy/toxplasma
fire_sound = "sound/weapons/taser2.ogg"
select_name = "plasma dart"
@@ -214,7 +215,7 @@
/obj/item/ammo_casing/energy/sniper
projectile_type = /obj/item/projectile/beam/sniper
fire_sound = 'sound/weapons/marauder.ogg'
fire_delay = 50
delay = 50
select_name = "sniper beam"
/obj/item/ammo_casing/energy/teleport
@@ -222,3 +223,8 @@
fire_sound = 'sound/weapons/wave.ogg'
e_cost = 1250
select_name = "teleport beam"
var/teleport_target
/obj/item/ammo_casing/energy/teleport/newshot()
var/obj/item/projectile/energy/teleport/T = BB
T.teleport_target = teleport_target
@@ -50,7 +50,7 @@
R.loc = src
if(bullet)
bullet.loc = get_turf(src.loc)
bullet.loc = get_turf(loc)
return 1
return 0
+10 -10
View File
@@ -28,7 +28,7 @@
if (zone_override)
BB.def_zone = zone_override
else
BB.def_zone = user.zone_selected
BB.def_zone = user.zone_sel.selecting
BB.suppressed = quiet
if(reagents && BB.reagents)
@@ -60,18 +60,18 @@
/obj/item/projectile/proc/preparePixelProjectile(atom/target, var/turf/targloc, mob/living/user, params, spread)
var/turf/curloc = get_turf(user)
src.loc = get_turf(user)
src.starting = get_turf(user)
src.current = curloc
src.yo = targloc.y - curloc.y
src.xo = targloc.x - curloc.x
loc = get_turf(user)
starting = get_turf(user)
current = curloc
yo = targloc.y - curloc.y
xo = targloc.x - curloc.x
if(params)
var/list/mouse_control = params2list(params)
if(mouse_control["icon-x"])
src.p_x = text2num(mouse_control["icon-x"])
p_x = text2num(mouse_control["icon-x"])
if(mouse_control["icon-y"])
src.p_y = text2num(mouse_control["icon-y"])
p_y = text2num(mouse_control["icon-y"])
if(mouse_control["screen-loc"])
//Split screen-loc up into X+Pixel_X and Y+Pixel_Y
var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",")
@@ -90,6 +90,6 @@
var/ox = round(screenview/2) //"origin" x
var/oy = round(screenview/2) //"origin" y
var/angle = Atan2(y - oy, x - ox)
src.Angle = angle
Angle = angle
if(spread)
src.Angle += spread
Angle += spread
+5 -11
View File
@@ -65,7 +65,6 @@
..()
if(F)
verbs += /obj/item/weapon/gun/proc/toggle_gunlight
new /datum/action/item_action/toggle_gunlight(src)
build_zooming()
/obj/item/weapon/gun/examine(mob/user)
@@ -120,7 +119,7 @@
return
if(!ismob(target) || user.a_intent == "harm") //melee attack
return
if(target == user && user.zone_selected != "mouth") //so we can't shoot ourselves (unless mouth selected)
if(target == user && user.zone_sel.selecting != "mouth") //so we can't shoot ourselves (unless mouth selected)
return
if(istype(user))//Check if the user can use the gun, if the user isn't alive(turrets) assume it can.
@@ -133,7 +132,7 @@
return
if(flag)
if(user.zone_selected == "mouth")
if(user.zone_sel.selecting == "mouth")
handle_suicide(user, target, params)
return
@@ -222,7 +221,7 @@ obj/item/weapon/gun/proc/newshot()
user.update_inv_l_hand()
else
user.update_inv_r_hand()
feedback_add_details("gun_fired","[src.type]")
feedback_add_details("gun_fired","[type]")
/obj/item/weapon/gun/attack(mob/M as mob, mob/user)
if(user.a_intent == "harm") //Flogging
@@ -239,15 +238,12 @@ obj/item/weapon/gun/proc/newshot()
return
to_chat(user, "<span class='notice'>You click [S] into place on [src].</span>")
if(S.on)
SetLuminosity(0)
set_light(0)
F = S
I.loc = src
update_icon()
update_gunlight(user)
verbs += /obj/item/weapon/gun/proc/toggle_gunlight
var/datum/action/A = new /datum/action/item_action/toggle_gunlight(src)
if(loc == user)
A.Grant(user)
if(istype(I, /obj/item/weapon/screwdriver))
if(F && can_flashlight)
@@ -259,8 +255,6 @@ obj/item/weapon/gun/proc/newshot()
S.update_brightness(user)
update_icon()
verbs -= /obj/item/weapon/gun/proc/toggle_gunlight
for(var/datum/action/item_action/toggle_gunlight/TGL in actions)
qdel(TGL)
if(unique_rename)
if(istype(I, /obj/item/weapon/pen))
@@ -351,7 +345,7 @@ obj/item/weapon/gun/proc/newshot()
semicd = 1
if(!do_mob(user, target, 120) || user.zone_selected != "mouth")
if(!do_mob(user, target, 120) || user.zone_sel.selecting != "mouth")
if(user)
if(user == target)
user.visible_message("<span class='notice'>[user] decided life was worth living.</span>")
+8 -76
View File
@@ -1,71 +1,5 @@
//Vox pinning weapon.
/obj/item/weapon/gun/launcher/spikethrower
name = "Vox spike thrower"
desc = "A vicious alien projectile weapon. Parts of it quiver gelatinously, as though the thing is insectile and alive."
var/last_regen = 0
var/spike_gen_time = 100
var/max_spikes = 3
var/spikes = 3
release_force = 30
icon = 'icons/obj/gun.dmi'
icon_state = "spikethrower3"
item_state = "spikethrower"
fire_sound_text = "a strange noise"
fire_sound = 'sound/weapons/bladeslice.ogg'
/obj/item/weapon/gun/launcher/spikethrower/New()
..()
processing_objects.Add(src)
last_regen = world.time
/obj/item/weapon/gun/launcher/spikethrower/Destroy()
processing_objects.Remove(src)
return ..()
/obj/item/weapon/gun/launcher/spikethrower/process()
if(spikes < max_spikes && world.time > last_regen + spike_gen_time)
spikes++
last_regen = world.time
update_icon()
/obj/item/weapon/gun/launcher/spikethrower/examine(mob/user)
..(user)
to_chat(user, "It has [spikes] [spikes == 1 ? "spike" : "spikes"] remaining.")
/obj/item/weapon/gun/launcher/spikethrower/update_icon()
icon_state = "spikethrower[spikes]"
/obj/item/weapon/gun/launcher/spikethrower/emp_act(severity)
return
/obj/item/weapon/gun/launcher/spikethrower/special_check(user)
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(H.species && H.species.name != "Vox" && H.species.name != "Vox Armalis")
to_chat(user, "\red \The [src] does not respond to you!")
return 0
return 1
/obj/item/weapon/gun/launcher/spikethrower/update_release_force()
return
/obj/item/weapon/gun/launcher/spikethrower/chamber_round()
if(in_chamber) return 1
if(spikes < 1) return 0
spikes--
in_chamber = new /obj/item/weapon/spike(src)
return 1
/obj/item/weapon/gun/launcher/spikethrower/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
if(..()) update_icon()
//This gun only functions for armalis. The on-sprite is too huge to render properly on other sprites.
/obj/item/weapon/gun/energy/noisecannon
name = "alien heavy cannon"
desc = "It's some kind of enormous alien weapon, as long as a man is tall."
@@ -73,15 +7,11 @@
icon_state = "noisecannon"
item_state = "noisecannon"
recoil = 1
force = 10
projectile_type = "/obj/item/projectile/energy/sonic"
ammo_type = "/obj/item/projectile/energy/sonic"
cell_type = "/obj/item/weapon/stock_parts/cell/super"
fire_delay = 40
fire_sound = 'sound/effects/basscannon.ogg'
var/mode = 1
/obj/item/weapon/gun/energy/noisecannon/attack_hand(mob/user as mob)
if(loc != user)
var/mob/living/carbon/human/H = user
@@ -89,16 +19,18 @@
if(H.species.name == "Vox Armalis")
..()
return
to_chat(user, "\red \The [src] is far too large for you to pick up.")
to_chat(user, "<span class='warning'>\The [src] is far too large for you to pick up.</span>")
return
/obj/item/weapon/gun/energy/noisecannon/process_chambered() //Does not have ammo.
in_chamber = new projectile_type(src)
return 1
/obj/item/weapon/gun/energy/noisecannon/update_icon()
return
//Casing
/obj/item/ammo_casing/energy/sonic
projectile_type = /obj/item/projectile/energy/sonic
fire_sound = 'sound/effects/basscannon.ogg'
delay = 40
//Projectile.
/obj/item/projectile/energy/sonic
name = "distortion"
+14 -12
View File
@@ -3,6 +3,7 @@
name = "energy gun"
desc = "A basic energy-based gun."
fire_sound = 'sound/weapons/Taser.ogg'
fire_sound_text = "laser blast"
var/obj/item/weapon/stock_parts/cell/power_supply //What type of power cell this uses
var/cell_type = /obj/item/weapon/stock_parts/cell
@@ -42,23 +43,24 @@
update_icon()
/obj/item/weapon/gun/energy/Destroy()
if(self_recharge)
if(selfcharge)
processing_objects.Remove(src)
return ..()
/obj/item/weapon/gun/energy/process()
if(selfcharge) //Every [recharge_time] ticks, recharge a shot for the cyborg
charge_tick++
if(charge_tick < recharge_time)
if(charge_tick < charge_delay)
return 0
charge_tick = 0
if(!power_supply)
return 0 // check if we actually need to recharge
var/obj/item/ammo_casing/energy/E = ammo_type[select]
if(use_external_power)
var/obj/item/weapon/stock_parts/cell/external = get_external_power_supply()
if(!external || !external.use(charge_cost/10)) //Take power from the borg...
if(!external || !external.use((E.e_cost)/10)) //Take power from the borg...
return 0 //Note, uses /10 because of shitty mods to the cell system
power_supply.give(charge_cost) //... to recharge the shot
power_supply.give(E.e_cost) //... to recharge the shot
update_icon()
/obj/item/weapon/gun/energy/attack_self(mob/living/user as mob)
@@ -136,11 +138,11 @@
toggle_gunlight()
/obj/item/weapon/gun/energy/suicide_act(mob/user)
if (src.can_shoot())
user.visible_message("<span class='suicide'>[user] is putting the barrel of the [src.name] in \his mouth. It looks like \he's trying to commit suicide.</span>")
if (can_shoot())
user.visible_message("<span class='suicide'>[user] is putting the barrel of the [name] in \his mouth. It looks like \he's trying to commit suicide.</span>")
sleep(25)
if(user.l_hand == src || user.r_hand == src)
user.visible_message("<span class='suicide'>[user] melts \his face off with the [src.name]!</span>")
user.visible_message("<span class='suicide'>[user] melts \his face off with the [name]!</span>")
playsound(loc, fire_sound, 50, 1, -1)
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
power_supply.use(shot.e_cost)
@@ -150,21 +152,21 @@
user.visible_message("<span class='suicide'>[user] panics and starts choking to death!</span>")
return(OXYLOSS)
else
user.visible_message("<span class='suicide'>[user] is pretending to blow \his brains out with the [src.name]! It looks like \he's trying to commit suicide!</b></span>")
user.visible_message("<span class='suicide'>[user] is pretending to blow \his brains out with the [name]! It looks like \he's trying to commit suicide!</b></span>")
playsound(loc, 'sound/weapons/empty.ogg', 50, 1, -1)
return (OXYLOSS)
/obj/item/weapon/gun/energy/proc/robocharge()
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(isrobot(loc))
var/mob/living/silicon/robot/R = loc
if(R && R.cell)
var/obj/item/ammo_casing/energy/shot = ammo_type[select] //Necessary to find cost of shot
if(R.cell.use(shot.e_cost/10)) //Take power from the borg... //Divided by 10 because cells and charge costs are fucked.
power_supply.give(shot.e_cost) //... to recharge the shot
/obj/item/weapon/gun/energy/proc/get_external_power_supply()
if(istype(src.loc, /obj/item/rig_module))
var/obj/item/rig_module/module = src.loc
if(istype(loc, /obj/item/rig_module))
var/obj/item/rig_module/module = loc
if(module.holder && module.holder.wearer)
var/mob/living/carbon/human/H = module.holder.wearer
if(istype(H) && H.back)
@@ -92,9 +92,9 @@
/obj/item/weapon/gun/energy/lasercannon/mounted
name = "mounted laser cannon"
self_recharge = 1
selfcharge = 1
use_external_power = 1
recharge_time = 10
charge_delay = 10
/obj/item/weapon/gun/energy/lasercannon/cyborg
@@ -130,7 +130,6 @@
origin_tech = "combat=1;magnets=2"
clumsy_check = 0
needs_permit = 0
pin = /obj/item/device/firing_pin/tag/blue
ammo_x_offset = 2
selfcharge = 1
@@ -142,6 +141,5 @@
origin_tech = "combat=1;magnets=2"
clumsy_check = 0
needs_permit = 0
pin = /obj/item/device/firing_pin/tag/red
ammo_x_offset = 2
selfcharge = 1
@@ -23,7 +23,7 @@
/obj/item/weapon/gun/energy/gun/mounted
name = "mounted energy gun"
self_recharge = 1
selfcharge = 1
use_external_power = 1
/obj/item/weapon/gun/energy/gun/mini
@@ -37,8 +37,8 @@
can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update
/obj/item/weapon/gun/energy/gun/mini/New()
cell.maxcharge = 6000
cell.charge = 6000
power_supply.maxcharge = 6000
power_supply.charge = 6000
F = new /obj/item/device/flashlight/seclite(src)
..()
@@ -84,7 +84,6 @@
origin_tech = "combat=3;materials=5;powerstorage=3"
var/fail_tick = 0
charge_delay = 5
pin = null
can_charge = 0
ammo_x_offset = 1
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser, /obj/item/ammo_casing/energy/disabler)
@@ -106,11 +105,11 @@
switch(fail_tick)
if(0 to 200)
fail_tick += (2*(100-reliability))
M.rad_act(40)
M.apply_effect(rand(3,120), IRRADIATE)
to_chat(M, "<span class='userdanger'>Your [name] feels warmer.</span>")
if(201 to INFINITY)
SSobj.processing.Remove(src)
M.rad_act(80)
processing_objects.Remove(src)
M.apply_effect(300, IRRADIATE)
crit_fail = 1
to_chat(M, "<span class='userdanger'>Your [name]'s reactor overloads!</span>")
@@ -130,27 +129,3 @@
overlays += "[icon_state]_fail_1"
if(151 to INFINITY)
overlays += "[icon_state]_fail_2"
/obj/item/weapon/gun/energy/gun/turret/attack_self(mob/living/user as mob)
switch(mode)
if(0)
mode = 1
charge_cost = 500
fire_sound = 'sound/weapons/Laser.ogg'
to_chat(user, "\red [src.name] is now set to kill.")
projectile_type = /obj/item/projectile/beam
modifystate = "energykill"
fire_delay = 0
if(1)
mode = 0
charge_cost = 1000
fire_sound = 'sound/weapons/Taser.ogg'
to_chat(user, "\red [src.name] is now set to stun.")
projectile_type = /obj/item/projectile/energy/electrode
modifystate = "energystun"
fire_delay = 15
update_icon()
if(user.l_hand == src)
user.update_inv_l_hand()
else
user.update_inv_r_hand()
@@ -54,7 +54,7 @@
ammo_type = list(/obj/item/ammo_casing/energy/laser/pulse)
/obj/item/weapon/gun/energy/pulse/destroyer/attack_self(mob/living/user)
to_chat(user, "<span class='danger'>[src.name] has three settings, and they are all DESTROY.</span>")
to_chat(user, "<span class='danger'>[name] has three settings, and they are all DESTROY.</span>")
/obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911
name = "\improper M1911-P"
+18 -14
View File
@@ -173,7 +173,7 @@
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
power_supply.give(5000)
if(!suppressed)
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
playsound(loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
else
to_chat(loc, "<span class='warning'>[src] silently charges up.<span>")
update_icon()
@@ -200,6 +200,10 @@
holds_charge = TRUE
unique_frequency = TRUE
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/ninja
name = "energy dart thrower"
ammo_type = list(/obj/item/ammo_casing/energy/dart)
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/large
name = "energy crossbow"
desc = "A reverse engineered weapon using syndicate technology."
@@ -218,8 +222,8 @@
/obj/item/weapon/gun/energy/kinetic_accelerator/suicide_act(mob/user)
if(!suppressed)
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
user.visible_message("<span class='suicide'>[user] cocks the [src.name] and pretends to blow \his brains out! It looks like \he's trying to commit suicide!</b></span>")
playsound(loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
user.visible_message("<span class='suicide'>[user] cocks the [name] and pretends to blow \his brains out! It looks like \he's trying to commit suicide!</b></span>")
shoot_live_shot()
return (OXYLOSS)
@@ -235,9 +239,9 @@
flags = CONDUCT | OPENCONTAINER
attack_verb = list("attacked", "slashed", "cut", "sliced")
force = 12
sharpness = IS_SHARP
sharp = 1
edge = 1
can_charge = 0
heat = 3800
/obj/item/weapon/gun/energy/plasmacutter/examine(mob/user)
..()
@@ -406,7 +410,7 @@ obj/item/weapon/gun/energy/staff/focus
var/e_cost = 1000
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
ammo_type = /obj/item/ammo_casing/energy/temp
ammo_type = list(/obj/item/ammo_casing/energy/temp)
cell_type = "/obj/item/weapon/stock_parts/cell"
var/powercost = ""
@@ -427,8 +431,9 @@ obj/item/weapon/gun/energy/staff/focus
/obj/item/weapon/gun/energy/temperature/newshot()
..()
chambered.temperature = temperature
chambered.e_cost = e_cost
var/obj/item/ammo_casing/energy/temp/T = chambered
T.temperature = temperature
T.e_cost = e_cost
/obj/item/weapon/gun/energy/temperature/attack_self(mob/living/user as mob)
user.set_machine(src)
@@ -459,23 +464,22 @@ obj/item/weapon/gun/energy/staff/focus
add_fingerprint(usr)
return
/obj/item/weapon/gun/energy/temperature/process()
switch(temperature)
if(0 to 100)
charge_cost = 3000
e_cost = 3000
powercost = "High"
if(100 to 250)
charge_cost = 2000
e_cost = 2000
powercost = "Medium"
if(251 to 300)
charge_cost = 1000
e_cost = 1000
powercost = "Low"
if(301 to 400)
charge_cost = 2000
e_cost = 2000
powercost = "Medium"
if(401 to 1000)
charge_cost = 3000
e_cost = 3000
powercost = "High"
switch(powercost)
if("High") powercostcolor = "orange"
+1 -1
View File
@@ -9,7 +9,7 @@
/obj/item/weapon/gun/energy/taser/mounted
name = "mounted taser gun"
self_recharge = 1
selfcharge = 1
use_external_power = 1
/obj/item/weapon/gun/energy/taser/cyborg
@@ -35,3 +35,7 @@
var/desc = input("Please select a location to lock in.", "Telegun Target Interface") in L
teleport_target = L[desc]
/obj/item/weapon/gun/energy/telegun/newshot()
var/obj/item/ammo_casing/energy/teleport/T = chambered
T.teleport_target = teleport_target
@@ -15,7 +15,7 @@
/obj/item/weapon/gun/grenadelauncher/examine(mob/user)
if(..(user, 2))
to_chat(user, "<span class='notice'>[grenades.len] / [max_grenades] [ammo_name]s.</span>")
to_chat(user, "<span class='notice'>[grenades.len] / [max_grenades] grenades.</span>")
/obj/item/weapon/gun/grenadelauncher/attackby(obj/item/I as obj, mob/user as mob, params)
if((istype(I, /obj/item/weapon/grenade)))
@@ -24,10 +24,10 @@
return
I.loc = src
grenades += I
to_chat(user, "<span class='notice'>You put the [ammo_name] in the [name].</span>")
to_chat(user, "<span class='notice'>[grenades.len] / [max_grenades] [ammo_name]s.</span>")
to_chat(user, "<span class='notice'>You put the grenade in the [name].</span>")
to_chat(user, "<span class='notice'>[grenades.len] / [max_grenades] grenades.</span>")
else
to_chat(user, "<span class='warning'>The grenade launcher cannot hold more [ammo_name]s.</span>")
to_chat(user, "<span class='warning'>The grenade launcher cannot hold more grenades.</span>")
/obj/item/weapon/gun/grenadelauncher/afterattack(obj/target, mob/user , flag)
if(target == user)
@@ -45,8 +45,8 @@
grenades -= F
F.loc = user.loc
F.throw_at(target, 30, 2, user)
message_admins("[key_name_admin(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
log_game("[key_name(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
message_admins("[key_name_admin(user)] fired a grenade ([F.name]) from a grenade launcher ([name]).")
log_game("[key_name(user)] fired a grenade ([F.name]) from a grenade launcher ([name]).")
F.active = 1
F.icon_state = initial(icon_state) + "_active"
playsound(user.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
+2 -1
View File
@@ -5,6 +5,7 @@
icon_state = "staffofnothing"
item_state = "staff"
fire_sound = 'sound/weapons/emitter.ogg'
fire_sound_text = "energy blast"
flags = CONDUCT
w_class = 5
var/max_charges = 6
@@ -75,6 +76,6 @@
return
/obj/item/weapon/gun/magic/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is twisting the [src.name] above \his head, releasing a magical blast! It looks like \he's trying to commit suicide.</span>")
user.visible_message("<span class='suicide'>[user] is twisting the [name] above \his head, releasing a magical blast! It looks like \he's trying to commit suicide.</span>")
playsound(loc, fire_sound, 50, 1, -1)
return FIRELOSS
+1 -1
View File
@@ -67,7 +67,7 @@
var/message ="<span class='warning'>You irradiate yourself with pure energy! "
message += pick("Do not pass go. Do not collect 200 zorkmids.</span>","You feel more confident in your spell casting skills.</span>","You Die...</span>","Do you want your possessions identified?</span>")
to_chat(user, message)
user.adjustBurnLoss(500)
user.adjustFireLoss(500)
charges--
..()
+1 -1
View File
@@ -48,7 +48,7 @@
spawn(0)
current_beam.Start()
feedback_add_details("gun_fired","[src.type]")
feedback_add_details("gun_fired","[type]")
/obj/item/weapon/gun/medbeam/process()
var/mob/living/carbon/human/H = loc
+2 -2
View File
@@ -12,7 +12,7 @@
/obj/item/weapon/gun/energy/advtaser/mounted/dropped()//if somebody manages to drop this somehow...
..()
src.loc = null//send it to nullspace to get retrieved by the implant later on. gotta cover those edge cases.
loc = null//send it to nullspace to get retrieved by the implant later on. gotta cover those edge cases.
/obj/item/weapon/gun/energy/laser/mounted
name = "mounted laser"
@@ -28,4 +28,4 @@
/obj/item/weapon/gun/energy/laser/mounted/dropped()
..()
src.loc = null
loc = null
+6 -6
View File
@@ -96,7 +96,7 @@
if(user.l_hand != src && user.r_hand != src)
..()
return
to_chat(user, "<span class='notice'>You unscrew [silenced] from [src].</span>")
to_chat(user, "<span class='notice'>You unscrew [suppressed] from [src].</span>")
user.put_in_hands(suppressed)
fire_sound = S.oldsound
w_class = S.initial_w_class
@@ -108,7 +108,7 @@
/obj/item/weapon/gun/projectile/attack_self(mob/living/user as mob)
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(magazine)
magazine.loc = get_turf(src.loc)
magazine.loc = get_turf(loc)
user.put_in_hands(magazine)
magazine.update_icon()
magazine = null
@@ -136,18 +136,18 @@
return boolets
/obj/item/weapon/gun/projectile/suicide_act(mob/user)
if (src.chambered && src.chambered.BB && !src.chambered.BB.nodamage)
user.visible_message("<span class='suicide'>[user] is putting the barrel of the [src.name] in \his mouth. It looks like \he's trying to commit suicide.</span>")
if (chambered && chambered.BB && !chambered.BB.nodamage)
user.visible_message("<span class='suicide'>[user] is putting the barrel of the [name] in \his mouth. It looks like \he's trying to commit suicide.</span>")
sleep(25)
if(user.l_hand == src || user.r_hand == src)
process_fire(user, user, 0, zone_override = "head")
user.visible_message("<span class='suicide'>[user] blows \his brains out with the [src.name]!</span>")
user.visible_message("<span class='suicide'>[user] blows \his brains out with the [name]!</span>")
return(BRUTELOSS)
else
user.visible_message("<span class='suicide'>[user] panics and starts choking to death!</span>")
return(OXYLOSS)
else
user.visible_message("<span class='suicide'>[user] is pretending to blow \his brains out with the [src.name]! It looks like \he's trying to commit suicide!</b></span>")
user.visible_message("<span class='suicide'>[user] is pretending to blow \his brains out with the [name]! It looks like \he's trying to commit suicide!</b></span>")
playsound(loc, 'sound/weapons/empty.ogg', 50, 1, -1)
return (OXYLOSS)
@@ -1,6 +1,5 @@
/obj/item/weapon/gun/projectile/automatic
w_class = 3.0
automatic = 1
var/alarmed = 0
var/select = 1
can_suppress = 1
@@ -37,14 +36,14 @@
if(istype(AM, mag_type))
if(magazine)
to_chat(user, "<span class='notice'>You perform a tactical reload on \the [src], replacing the magazine.</span>")
magazine.forceMove(get_turf(src.loc))
magazine.loc = get_turf(loc)
magazine.update_icon()
magazine = null
else
to_chat(user, "<span class='notice'>You insert the magazine into \the [src].</span>")
user.remove_from_mob(AM)
magazine = AM
magazine.forceMove(src)
magazine.loc = src
chamber_round()
A.update_icon()
update_icon()
@@ -74,7 +73,7 @@
/obj/item/weapon/gun/projectile/automatic/proc/empty_alarm()
if(!chambered && !get_ammo() && !alarmed)
playsound(src.loc, 'sound/weapons/smg_empty_alarm.ogg', 40, 1)
playsound(loc, 'sound/weapons/smg_empty_alarm.ogg', 40, 1)
update_icon()
alarmed = 1
return
@@ -45,7 +45,7 @@
var/obj/item/ammo_casing/CB
CB = magazine.get_round(0)
if(CB)
CB.loc = get_turf(src.loc)
CB.loc = get_turf(loc)
CB.SpinAnimation(10, 1)
CB.update_icon()
num_unloaded++
@@ -124,7 +124,7 @@
afterattack(user, user) //you know the drill
user.visible_message("<span class='danger'>[src] goes off!</span>", "<span class='userdanger'>[src] goes off in your face!</span>")
return
if(do_after(user, 30/A.toolspeed, target = src))
if(do_after(user, 30, target = src))
if(magazine.ammo_count())
to_chat(user, "<span class='warning'>You can't modify it!</span>")
return
@@ -173,7 +173,7 @@
name = "\improper Russian Revolver"
desc = "A Russian-made revolver for drinking games. Uses .357 ammo, and has a mechanism that spins the chamber before each trigger pull."
origin_tech = "combat=2;materials=2"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rus357
mag_type = /obj/item/ammo_box/magazine/internal/rus357
var/spun = 0
@@ -211,7 +211,7 @@
var/obj/item/ammo_casing/CB
CB = magazine.get_round()
chambered = null
CB.loc = get_turf(src.loc)
CB.loc = get_turf(loc)
CB.update_icon()
num_unloaded++
if (num_unloaded)
@@ -234,7 +234,6 @@
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!spun)
to_chat(user, "<span class='warning'>You need to spin the revolver's chamber first!</span>")
return
@@ -245,12 +244,11 @@
var/obj/item/ammo_casing/AC = chambered
if(AC.fire(user, user))
playsound(user, fire_sound, 50, 1)
var/zone = check_zone(user.zone_selected)
var/obj/item/bodypart/affecting = H.get_bodypart(zone)
var/zone = check_zone(user.zone_sel.selecting)
if(zone == "head" || zone == "eyes" || zone == "mouth")
shoot_self(user, affecting)
shoot_self(user, zone)
else
user.visible_message("<span class='danger'>[user.name] cowardly fires [src] at \his [affecting.name]!</span>", "<span class='userdanger'>You cowardly fire [src] at your [affecting.name]!</span>", "<span class='italics'>You hear a gunshot!</span>")
user.visible_message("<span class='danger'>[user.name] cowardly fires [src] at \his [zone]!</span>", "<span class='userdanger'>You cowardly fire [src] at your [zone]!</span>", "<span class='italics'>You hear a gunshot!</span>")
return
user.visible_message("<span class='danger'>*click*</span>")
@@ -45,8 +45,8 @@
playsound(user.loc, 'sound/effects/bang.ogg', 50, 1)
M.primed = 1
M.throw_at(target, missile_range, missile_speed,user)
message_admins("[key_name_admin(user)] fired a rocket from a rocket launcher ([src.name]).")
log_game("[key_name_admin(user)] used a rocket launcher ([src.name]).")
message_admins("[key_name_admin(user)] fired a rocket from a rocket launcher ([name]).")
log_game("[key_name_admin(user)] used a rocket launcher ([name]).")
rockets -= I
qdel(I)
return
@@ -39,7 +39,7 @@
else if(cover_open && magazine)
//drop the mag
magazine.update_icon()
magazine.loc = get_turf(src.loc)
magazine.loc = get_turf(loc)
user.put_in_hands(magazine)
magazine = null
update_icon()
@@ -69,7 +69,7 @@
. = ..()
if((blocked != 100) && istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target
H.drip(35)
H.drip(350)
/obj/item/projectile/bullet/saw/hollow
damage = 60
@@ -22,7 +22,7 @@
update_icon()
/obj/item/weapon/gun/projectile/shotgun/process_chambered()
/obj/item/weapon/gun/projectile/shotgun/process_chamber()
return ..(0, 0)
/obj/item/weapon/gun/projectile/shotgun/chamber_round()
@@ -79,7 +79,7 @@
name = "riot shotgun"
desc = "A sturdy shotgun with a longer magazine and a fixed tactical stock designed for non-lethal riot control."
icon_state = "riotshotgun"
mag_type = /obj/item/ammo_box/magazine/internal/shotriot
mag_type = /obj/item/ammo_box/magazine/internal/shot/riot
sawn_desc = "Come with me if you want to live."
/obj/item/weapon/gun/projectile/shotgun/riot/attackby(obj/item/A, mob/user, params)
@@ -143,7 +143,7 @@
..()
if(guns_left)
var/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/GUN = new
GUN.guns_left = src.guns_left - 1
GUN.guns_left = guns_left - 1
user.drop_item()
user.swap_hand()
user.put_in_hands(GUN)
@@ -172,7 +172,7 @@
flags = CONDUCT
slot_flags = SLOT_BACK
origin_tech = "combat=3;materials=1"
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/dual
mag_type = /obj/item/ammo_box/magazine/internal/shot/dual
sawn_desc = "Omar's coming!"
unique_rename = 1
unique_reskin = 1
@@ -204,7 +204,7 @@
var/obj/item/ammo_casing/CB
CB = magazine.get_round(0)
chambered = null
CB.loc = get_turf(src.loc)
CB.loc = get_turf(loc)
CB.update_icon()
num_unloaded++
if (num_unloaded)
@@ -286,7 +286,7 @@
if(do_after(user, 30, target = src))
user.visible_message("<span class='warning'>[user] shortens \the [src]!</span>", "<span class='warning'>You shorten \the [src]!</span>")
name = "sawn-off [src.name]"
name = "sawn-off [name]"
desc = sawn_desc
icon_state = "[icon_state]-sawn"
w_class = 3
@@ -303,7 +303,7 @@
/obj/item/weapon/gun/projectile/shotgun/automatic/shoot_live_shot(mob/living/user as mob|obj)
..()
src.pump(user)
pump(user)
/obj/item/weapon/gun/projectile/shotgun/automatic/combat
name = "combat shotgun"
@@ -375,7 +375,7 @@
sawn_desc = "I'm sorry, but why did you saw your cane in the first place?"
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
fire_sound = 'sound/weapons/Gunshot_silenced.ogg'
silenced = 1
suppressed = 1
needs_permit = 0 //its just a cane beepsky.....
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/cane/attackby(obj/item/A, mob/user, params)
@@ -385,7 +385,7 @@
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/cane/examine(mob/user) // HAD TO REPEAT EXAMINE CODE BECAUSE GUN CODE DOESNT STEALTH
var/f_name = "\a [src]."
if(src.blood_DNA && !istype(src, /obj/effect/decal))
if(blood_DNA && !istype(src, /obj/effect/decal))
if(gender == PLURAL)
f_name = "some "
else
@@ -4,7 +4,7 @@
icon_state = "sniper"
item_state = "sniper"
recoil = 2
heavy_weapon = 1
weapon_weight = WEAPON_MEDIUM
mag_type = /obj/item/ammo_box/magazine/sniper_rounds
fire_delay = 40
origin_tech = "combat=8"
@@ -117,7 +117,7 @@
/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0, hit_zone)
if((blocked != 100) && istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target
H.drip(100)
H.drip(1000)
return ..()
+6 -5
View File
@@ -28,7 +28,7 @@
chambered.BB = new S.projectile_type (src)
S.reagents.trans_to(in_chamber, S.reagents.total_volume)
S.reagents.trans_to(chambered.BB, S.reagents.total_volume)
chambered.BB.name = S.name
syringes.Remove(S)
@@ -55,8 +55,9 @@
var/obj/item/weapon/reagent_containers/syringe/S = syringes[syringes.len]
if(!S) return 0
S.forceMove(user.loc)
if(!S)
return 0
S.loc = user.loc
syringes.Remove(S)
to_chat(user, "<span class='notice'>You unload [S] from \the [src]!</span>")
@@ -70,7 +71,7 @@
return
to_chat(user, "<span class='notice'>You load [A] into \the [src]!</span>")
syringes.Add(A)
A.forceMove(src)
A.loc = src
return 1
else
to_chat(user, "<span class='notice'>[src] cannot hold more syringes.</span>")
@@ -90,5 +91,5 @@
w_class = 2
origin_tech = "combat=2;syndicate=2"
force = 2 //Also very weak because it's smaller
silenced = 1 //Softer fire sound
suppressed = 1 //Softer fire sound
can_unsuppress = 0 //Permanently silenced
+9 -9
View File
@@ -79,7 +79,7 @@
playsound(loc, hitsound, volume, 1, -1)
L.visible_message("<span class='danger'>[L] is hit by \a [src][organ_hit_text]!</span>", \
"<span class='userdanger'>[L] is hit by \a [src][organ_hit_text]!</span>") //X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
L.on_hit(type)
L.apply_effects(stun, weaken, paralyze, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter)
var/reagent_note
if(reagents && reagents.reagent_list)
@@ -91,8 +91,8 @@
return L.apply_effects(stun, weaken, paralyze, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter)
/obj/item/projectile/proc/vol_by_damage()
if(src.damage)
return Clamp((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then clamp the value between 30 and 100
if(damage)
return Clamp((damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then clamp the value between 30 and 100
else
return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume
@@ -113,10 +113,10 @@
if(isnull(organ))
return
else if(isturf(A) && hitsound_wall)
var/volume = Clamp(vol_by_damage() + 20, 0, 100)
if(suppressed)
volume = 5
playsound(loc, hitsound_wall, volume, 1, -1)
var/volume = Clamp(vol_by_damage() + 20, 0, 100)
if(suppressed)
volume = 5
playsound(loc, hitsound_wall, volume, 1, -1)
var/turf/target_turf = get_turf(A)
@@ -220,5 +220,5 @@ obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a pro
return ..()
/obj/item/projectile/proc/dumbfire(var/dir)
current = get_ranged_target_turf(src, dir, world.maxx) //world.maxx is the range. Not sure how to handle this better.
fire()
current = get_ranged_target_turf(src, dir, world.maxx) //world.maxx is the range. Not sure how to handle this better.
fire()
+2 -155
View File
@@ -87,11 +87,11 @@
name = "laser tag beam"
icon_state = "omnilaser"
/obj/item/projectile/beam/lasertag/red
/obj/item/projectile/beam/lasertag/redtag
icon_state = "laser"
suit_types = list(/obj/item/clothing/suit/bluetag)
/obj/item/projectile/beam/lasertag/blue
/obj/item/projectile/beam/lasertag/bluetag
icon_state = "bluelaser"
suit_types = list(/obj/item/clothing/suit/redtag)
@@ -131,156 +131,3 @@
var/mob/living/carbon/M = target
M.visible_message("<span class='danger'>[M] explodes into a shower of gibs!</span>")
M.gib()
/* //THIS CODE MAKES ME WANT TO STAB MY EYES OUT
/obj/item/projectile/beam/lightning
invisibility = 101
name = "lightning"
damage = 0
icon = 'icons/obj/lightning.dmi'
icon_state = "lightning"
stun = 10
weaken = 10
stutter = 50
eyeblur = 50
var/tang = 0
layer = 3
var/turf/last = null
kill_count = 6
var/bullet_acted = 0
/obj/item/projectile/beam/lightning/Bump(var/atom/A)
if((A != firer) && !bullet_acted)
A.bullet_act(src)
bullet_acted = 1
/obj/item/projectile/beam/lightning/proc/adjustAngle(angle)
angle = round(angle) + 45
if(angle > 180)
angle -= 180
else
angle += 180
if(!angle)
angle = 1
return angle
/obj/item/projectile/beam/lightning/process()
var/first = 1 //So we don't make the overlay in the same tile as the firer
var/broke = 0
var/broken
var/atom/curr = current
var/Angle=round(Get_Angle(firer,curr))
var/icon/I=new('icons/obj/zap.dmi',"lightning")
I.Turn(Angle)
var/DX=(32*curr.x+curr.pixel_x)-(32*firer.x+firer.pixel_x)
var/DY=(32*curr.y+curr.pixel_y)-(32*firer.y+firer.pixel_y)
var/N=0
var/length=round(sqrt((DX)**2+(DY)**2))
var/count = 0
for(N,N<length,N+=32)
if(count >= kill_count)
break
count++
var/obj/effect/overlay/beam/X=new(loc)
X.BeamSource=src
if(N+32>length)
var/icon/II=new(icon,icon_state)
II.DrawBox(null,1,(length-N),32,32)
II.Turn(Angle)
X.icon=II
else X.icon=I
var/Pixel_x=round(sin(Angle)+32*sin(Angle)*(N+16)/32)
var/Pixel_y=round(cos(Angle)+32*cos(Angle)*(N+16)/32)
if(DX==0) Pixel_x=0
if(DY==0) Pixel_y=0
if(Pixel_x>32)
for(var/a=0, a<=Pixel_x,a+=32)
X.x++
Pixel_x-=32
if(Pixel_x<-32)
for(var/a=0, a>=Pixel_x,a-=32)
X.x--
Pixel_x+=32
if(Pixel_y>32)
for(var/a=0, a<=Pixel_y,a+=32)
X.y++
Pixel_y-=32
if(Pixel_y<-32)
for(var/a=0, a>=Pixel_y,a-=32)
X.y--
Pixel_y+=32
X.pixel_x=Pixel_x
X.pixel_y=Pixel_y
var/turf/TT = get_turf(X.loc)
if(TT == firer.loc)
continue
if(TT.density)
qdel(X)
break
for(var/atom/O in TT)
if(istype(O,/mob/living))
if(O.density)
qdel(X)
broke = 1
break
if(!O.CanPass(src))
qdel(X)
broke = 1
break
if(broke)
if(X)
qdel(X)
break
spawn
while(src) //Move until we hit something
if(first)
icon = midicon
if((!( current ) || loc == current)) //If we pass our target
broken = 1
icon = endicon
tang = adjustAngle(get_angle(original,current))
if(tang > 180)
tang -= 180
else
tang += 180
icon_state = "[tang]"
var/turf/simulated/floor/f = current
if(f && istype(f))
if(!bullet_acted)
f.break_tile()
f.hotspot_expose(1000,CELL_VOLUME)
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
broken = 1
return
if(kill_count < 1)
broken = 1
kill_count--
if(!bumped && !isturf(original))
if(loc == get_turf(original))
if(!(original in permutated))
icon = endicon
if(!broken)
tang = adjustAngle(get_angle(original,current))
if(tang > 180)
tang -= 180
else
tang += 180
icon_state = "[tang]"
Bump(original)
first = 0
if(broken)
break
else
last = get_turf(src.loc)
step_towards(src, current) //Move~
if(src.loc != current)
tang = adjustAngle(get_angle(src.loc,current))
icon_state = "[tang]"
qdel(src)
return
/obj/item/projectile/beam/lightning/on_hit(atom/target, blocked = 0)
if(istype(target, /mob/living))
var/mob/living/M = target
M.playsound_local(src, "explosion", 50, 1)
..()
*/
@@ -80,7 +80,7 @@
range = rand(8)
/obj/item/projectile/bullet/pellet/weak/on_range()
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
..()
@@ -97,7 +97,7 @@
/obj/item/projectile/bullet/pellet/overload/on_range()
explosion(src, 0, 0, 2)
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread
sparks.set_up(3, 3, src)
sparks.start()
..()
@@ -179,7 +179,7 @@
forcedodge = 1
nodamage = 1
hitsound = 'sound/items/bikehorn.ogg'
icon = 'icons/obj/hydroponics/harvest.dmi'
icon = 'icons/obj/harvest.dmi'
icon_state = "banana"
range = 200
@@ -21,7 +21,7 @@
/obj/item/projectile/energy/electrode/on_hit(var/atom/target, var/blocked = 0)
. = ..()
if(!ismob(target) || blocked >= 100) //Fully blocked by mob or collided with dense object - burst into sparks!
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
else if(iscarbon(target))
@@ -33,7 +33,7 @@
C.do_jitter_animation(jitter)
/obj/item/projectile/energy/electrode/on_range() //to ensure the bolt sparks when it reaches the end of its range if it didn't hit a target yet
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread
sparks.set_up(1, 1, src)
sparks.start()
..()
@@ -80,7 +80,7 @@
/obj/item/ammo_casing/energy/shock_revolver/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
..()
var/obj/item/projectile/hook/P = BB
var/obj/item/projectile/energy/shock_revolver/P = BB
spawn(1)
P.chain = P.Beam(user,icon_state="purple_lightning",icon = 'icons/effects/effects.dmi',time=1000, maxdistance = 30)
+10 -4
View File
@@ -48,7 +48,7 @@
/obj/item/projectile/magic/resurrection/on_hit(var/mob/living/carbon/target)
. = ..()
if(ismob(target))
var/old_stat = stat
var/old_stat = target.stat
target.suiciding = 0
target.revive()
if(!target.ckey)
@@ -94,16 +94,22 @@
if(isturf(target) && target.density)
CreateDoor(target)
else if (isturf(T) && T.density)
CreateDoor(T
CreateDoor(T)
else if(istype(target, /obj/machinery/door))
OpenDoor(target))
OpenDoor(target)
/obj/item/projectile/magic/door/proc/CreateDoor(turf/T)
var/door_type = pick(door_types)
var/obj/structure/mineral_door/D = new door_type(T)
T.ChangeTurf(/turf/open/floor/plating)
T.ChangeTurf(/turf/simulated/floor/plasteel)
D.Open()
/obj/item/projectile/magic/door/proc/OpenDoor(var/obj/machinery/door/D)
if(istype(D,/obj/machinery/door/airlock))
var/obj/machinery/door/airlock/A = D
A.locked = 0
D.open()
/obj/item/projectile/magic/change
name = "bolt of change"
icon_state = "ice_1"
@@ -1,7 +1,7 @@
/obj/item/projectile/bullet/reusable
name = "reusable bullet"
desc = "How do you even reuse a bullet?"
ammo_type = /obj/item/ammo_casing/caseless/
var/ammo_type = /obj/item/ammo_casing/caseless/
var/dropped = 0
/obj/item/projectile/bullet/reusable/on_hit(atom/target, blocked = 0)
@@ -14,7 +14,7 @@
/obj/item/projectile/bullet/reusable/proc/handle_drop()
if(!dropped)
new ammo_type(src.loc)
new ammo_type(loc)
dropped = 1
/obj/item/projectile/bullet/reusable/magspear
@@ -42,7 +42,7 @@
if(dropped)
return
dropped = 1
var/obj/item/ammo_casing/caseless/foam_dart/newdart = new ammo_type(src.loc)
var/obj/item/ammo_casing/caseless/foam_dart/newdart = new ammo_type(loc)
var/obj/item/ammo_casing/caseless/foam_dart/old_dart = ammo_casing
newdart.modified = old_dart.modified
if(pen)
+6 -11
View File
@@ -115,7 +115,7 @@
if(A == firer)
loc = A.loc
return
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
playsound(loc, 'sound/effects/meteorimpact.ogg', 40, 1)
for(var/mob/M in urange(10, src))
if(!M.stat)
shake_camera(M, 3, 1)
@@ -195,8 +195,8 @@
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
new /obj/effect/decal/cleanable/ash(src.loc)
src.visible_message("<span class='warning'>The [src.name] explodes!</span>","<span class='warning'>You hear a snap!</span>")
new /obj/effect/decal/cleanable/ash(loc)
visible_message("<span class='warning'>The [name] explodes!</span>","<span class='warning'>You hear a snap!</span>")
playsound(src, 'sound/effects/snap.ogg', 50, 1)
qdel(src)
@@ -230,7 +230,7 @@ obj/item/projectile/kinetic/New()
..()
/obj/item/projectile/kinetic/on_range()
new /obj/effect/kinetic_blast(src.loc)
new /obj/effect/kinetic_blast(loc)
..()
/obj/item/projectile/kinetic/on_hit(atom/target)
@@ -240,13 +240,13 @@ obj/item/projectile/kinetic/New()
var/turf/simulated/mineral/M = target_turf
M.gets_drilled(firer)
new /obj/item/effect/kinetic_blast(target_turf)
if(src.splash)
if(splash)
for(var/turf/T in range(splash, target_turf))
if(istype(T, /turf/simulated/mineral))
var/turf/simulated/mineral/M = T
M.gets_drilled(firer)
/obj/item/effect/kinetic_blast
/obj/effect/kinetic_blast
name = "kinetic explosion"
icon = 'icons/obj/projectiles.dmi'
icon_state = "kinetic_blast"
@@ -340,13 +340,8 @@ obj/item/projectile/kinetic/New()
icon_state = "bluespace"
damage = 0
nodamage = 1
var/obj/item/weapon/gun/energy/telegun/T = null
var/teleport_target = null
OnFired()
T = shot_from
teleport_target = T.teleport_target
/obj/item/projectile/energy/teleport/on_hit(var/atom/target, var/blocked = 0)
if(isliving(target))
if(teleport_target)
+3 -6
View File
@@ -104,7 +104,7 @@
to_chat(user, "<span class='notice>You slot [B] into [src].</span>")
src.updateUsrDialog()
/obj/item/weapon/gun/dartgun/can_fire()
/obj/item/weapon/gun/dartgun/can_shoot()
if(!cartridge)
return 0
else
@@ -209,9 +209,6 @@
if(!isturf(target.loc) || target == user) return
..()
/obj/item/weapon/gun/dartgun/can_hit(var/mob/living/target as mob, var/mob/living/user as mob)
return 1
/obj/item/weapon/gun/dartgun/attack_self(mob/user)
user.set_machine(src)
@@ -280,7 +277,7 @@
src.updateUsrDialog()
return
/obj/item/weapon/gun/dartgun/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)
/obj/item/weapon/gun/dartgun/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
if(cartridge)
spawn(0) fire_dart(target,user)
else
@@ -308,4 +305,4 @@
New()
var/datum/reagents/R = new/datum/reagents(15)
reagents = R
R.my_atom = src
R.my_atom = src
@@ -27,7 +27,7 @@ datum/chemical_reaction/coolant
/obj/structure/reagent_dispensers/coolanttank/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj ,/obj/item/projectile/beam)||istype(Proj,/obj/item/projectile/bullet))
if(!istype(Proj ,/obj/item/projectile/lasertag) && !istype(Proj ,/obj/item/projectile/practice) )
if(!Proj.damage)
explode()
/obj/structure/reagent_dispensers/coolanttank/blob_act()
-2
View File
@@ -30,11 +30,9 @@
var/obj/item/projectile/projone = new proj_type(firstloc)
var/obj/item/projectile/projtwo = new proj_type(secondloc)
projone.starting = get_turf(my_atom)
projone.shot_from = src
projone.firer = usr
projone.def_zone = "chest"
projtwo.starting = get_turf(my_atom)
projtwo.shot_from = src
projtwo.firer = usr
projtwo.def_zone = "chest"
spawn()