@@ -78,7 +78,7 @@
|
||||
suppressed = A
|
||||
S.oldsound = fire_sound
|
||||
S.initial_w_class = w_class
|
||||
fire_sound = 'sound/weapons/Gunshot_silenced.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot_silenced.ogg'
|
||||
w_class = WEIGHT_CLASS_NORMAL //so pistols do not fit in pockets when suppressed
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
item_state = "c20r"
|
||||
origin_tech = "combat=5;materials=2;syndicate=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/smgm45
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot_smg.ogg'
|
||||
fire_delay = 2
|
||||
burst_size = 2
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
@@ -142,7 +142,7 @@
|
||||
item_state = "m90"
|
||||
origin_tech = "combat=5;materials=2;syndicate=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/m556
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot_smg.ogg'
|
||||
can_suppress = 0
|
||||
var/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/underbarrel
|
||||
burst_size = 3
|
||||
@@ -216,7 +216,7 @@
|
||||
slot_flags = 0
|
||||
origin_tech = "combat=5;materials=1;syndicate=3"
|
||||
mag_type = /obj/item/ammo_box/magazine/tommygunm45
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot_smg.ogg'
|
||||
can_suppress = 0
|
||||
burst_size = 4
|
||||
fire_delay = 1
|
||||
@@ -229,13 +229,11 @@
|
||||
slot_flags = 0
|
||||
origin_tech = "combat=6;engineering=4"
|
||||
mag_type = /obj/item/ammo_box/magazine/m556
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot_smg.ogg'
|
||||
can_suppress = 0
|
||||
burst_size = 3
|
||||
fire_delay = 1
|
||||
|
||||
|
||||
|
||||
// Bulldog shotgun //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog
|
||||
@@ -247,7 +245,7 @@
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
origin_tech = "combat=6;materials=4;syndicate=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/m12g
|
||||
fire_sound = 'sound/weapons/Gunshot.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot.ogg'
|
||||
can_suppress = 0
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
@@ -286,7 +284,7 @@
|
||||
origin_tech = "combat=6;engineering=3;syndicate=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/mm195x129
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot_smg.ogg'
|
||||
var/cover_open = 0
|
||||
can_suppress = 0
|
||||
burst_size = 3
|
||||
@@ -409,6 +407,7 @@
|
||||
else
|
||||
icon_state = "surplus-e"
|
||||
|
||||
|
||||
// Laser rifle (rechargeable magazine) //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/laser
|
||||
@@ -421,7 +420,7 @@
|
||||
can_suppress = 0
|
||||
burst_size = 0
|
||||
actions_types = list()
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
fire_sound = 'sound/weapons/laser.ogg'
|
||||
casing_ejector = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/laser/update_icon()
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
automatic = 0
|
||||
fire_delay = 1
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
fire_sound = 'sound/weapons/laser.ogg'
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/minigun
|
||||
casing_ejector = 0
|
||||
var/obj/item/weapon/minigunpack/ammo_pack
|
||||
|
||||
@@ -92,17 +92,13 @@
|
||||
desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds."
|
||||
icon_state = "detective"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev38
|
||||
unique_rename = 1
|
||||
unique_reskin = 1
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/detective/Initialize()
|
||||
. = ..()
|
||||
options["Default"] = "detective"
|
||||
options["Leopard Spots"] = "detective_leopard"
|
||||
options["Black Panther"] = "detective_panther"
|
||||
options["Gold Trim"] = "detective_gold"
|
||||
options["The Peacemaker"] = "detective_peacemaker"
|
||||
options["Cancel"] = null
|
||||
unique_rename = TRUE
|
||||
unique_reskin = list("Default" = "detective",
|
||||
"Leopard Spots" = "detective_leopard",
|
||||
"Black Panther" = "detective_panther",
|
||||
"Gold Trim" = "detective_gold",
|
||||
"The Peacemaker" = "detective_peacemaker"
|
||||
)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/detective/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override = "")
|
||||
if(magazine.caliber != initial(magazine.caliber))
|
||||
@@ -269,18 +265,14 @@
|
||||
slot_flags = SLOT_BACK
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/dual
|
||||
sawn_desc = "Omar's coming!"
|
||||
unique_rename = 1
|
||||
unique_reskin = 1
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/Initialize()
|
||||
. = ..()
|
||||
options["Default"] = "dshotgun"
|
||||
options["Dark Red Finish"] = "dshotgun-d"
|
||||
options["Ash"] = "dshotgun-f"
|
||||
options["Faded Grey"] = "dshotgun-g"
|
||||
options["Maple"] = "dshotgun-l"
|
||||
options["Rosewood"] = "dshotgun-p"
|
||||
options["Cancel"] = null
|
||||
unique_rename = TRUE
|
||||
unique_reskin = list("Default" = "dshotgun",
|
||||
"Dark Red Finish" = "dshotgun-d",
|
||||
"Ash" = "dshotgun-f",
|
||||
"Faded Grey" = "dshotgun-g",
|
||||
"Maple" = "dshotgun-1",
|
||||
"Rosewood" = "dshotgun-p"
|
||||
)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
@@ -319,9 +311,9 @@
|
||||
slot_flags = null
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/improvised
|
||||
sawn_desc = "I'm just here for the gasoline."
|
||||
unique_rename = 0
|
||||
unique_reskin = 0
|
||||
var/slung = 0
|
||||
unique_rename = FALSE
|
||||
unique_reskin = null
|
||||
var/slung = FALSE
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
@@ -330,7 +322,7 @@
|
||||
if(C.use(10))
|
||||
slot_flags = SLOT_BACK
|
||||
to_chat(user, "<span class='notice'>You tie the lengths of cable to the shotgun, making a sling.</span>")
|
||||
slung = 1
|
||||
slung = TRUE
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>")
|
||||
@@ -356,6 +348,7 @@
|
||||
sawn_state = SAWN_OFF
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/reverse //Fires directly at its user... unless the user is a clown, of course.
|
||||
clumsy_check = 0
|
||||
|
||||
@@ -366,4 +359,4 @@
|
||||
user.visible_message("<span class='warning'>[user] somehow manages to shoot [user.p_them()]self in the face!</span>", "<span class='userdanger'>You somehow shoot yourself in the face! How the hell?!</span>")
|
||||
user.emote("scream")
|
||||
user.drop_item()
|
||||
user.Weaken(4)
|
||||
user.Knockdown(80)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icon_state = "saber"
|
||||
item_state = "gun"
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/smg
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot_smg.ogg'
|
||||
force = 0
|
||||
throwforce = 0
|
||||
burst_size = 3
|
||||
@@ -23,7 +23,7 @@
|
||||
icon_state = "pistol"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/pistol
|
||||
fire_sound = 'sound/weapons/Gunshot.ogg'
|
||||
fire_sound = 'sound/weapons/gunshot.ogg'
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
|
||||
@@ -0,0 +1,535 @@
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle
|
||||
name = "particle acceleration rifle"
|
||||
desc = "An energy-based anti material marksman rifle that uses highly charged particle beams moving at extreme velocities to decimate whatever is unfortunate enough to be targetted by one. \
|
||||
<span class='boldnotice'>Hold down left click while scoped to aim, when weapon is fully aimed (Tracer goes from red to green as it charges), release to fire. Moving while aiming or \
|
||||
changing where you're pointing at while aiming will delay the aiming process depending on how much you changed.</span>"
|
||||
icon = 'icons/obj/guns/energy.dmi'
|
||||
icon_state = "esniper"
|
||||
item_state = "esniper"
|
||||
fire_sound = 'sound/weapons/beam_sniper.ogg'
|
||||
slot_flags = SLOT_BACK
|
||||
force = 15
|
||||
materials = list()
|
||||
origin_tech = ""
|
||||
recoil = 5
|
||||
ammo_x_offset = 3
|
||||
ammo_y_offset = 3
|
||||
modifystate = FALSE
|
||||
zoomable = TRUE
|
||||
zoom_amt = 17
|
||||
zoom_out_amt = 20
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/beam_rifle/hitscan)
|
||||
var/hipfire_inaccuracy = 2
|
||||
var/hipfire_recoil = 10
|
||||
var/scoped_inaccuracy = 0
|
||||
var/scoped_recoil = 3
|
||||
var/scoped = FALSE
|
||||
var/noscope = FALSE //Can you fire this without a scope?
|
||||
cell_type = /obj/item/weapon/stock_parts/cell/beam_rifle
|
||||
canMouseDown = TRUE
|
||||
pin = null
|
||||
var/aiming = FALSE
|
||||
var/aiming_time = 7
|
||||
var/aiming_time_fire_threshold = 2
|
||||
var/aiming_time_left = 7
|
||||
var/aiming_time_increase_user_movement = 3
|
||||
var/scoped_slow = 1
|
||||
var/aiming_time_increase_angle_multiplier = 0.6
|
||||
|
||||
var/lastangle = 0
|
||||
var/mob/current_user = null
|
||||
var/list/obj/effect/temp_visual/current_tracers = list()
|
||||
|
||||
var/structure_piercing = 2 //This doesn't always work!
|
||||
var/structure_bleed_coeff = 0.7
|
||||
var/wall_pierce_amount = 0
|
||||
var/wall_devastate = 0
|
||||
var/aoe_structure_range = 1
|
||||
var/aoe_structure_damage = 50
|
||||
var/aoe_fire_range = 2
|
||||
var/aoe_fire_chance = 40
|
||||
var/aoe_mob_range = 1
|
||||
var/aoe_mob_damage = 30
|
||||
var/impact_structure_damage = 60
|
||||
var/projectile_damage = 30
|
||||
var/projectile_stun = 0
|
||||
var/projectile_setting_pierce = TRUE
|
||||
var/delay = 65
|
||||
var/lastfire = 0
|
||||
|
||||
var/static/image/charged_overlay = image(icon = 'icons/obj/guns/energy.dmi', icon_state = "esniper_charged")
|
||||
var/static/image/drained_overlay = image(icon = 'icons/obj/guns/energy.dmi', icon_state = "esniper_empty")
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/debug
|
||||
delay = 0
|
||||
cell_type = /obj/item/weapon/stock_parts/cell/infinite
|
||||
aiming_time = 0
|
||||
recoil = 0
|
||||
scoped_recoil = 0
|
||||
hipfire_recoil = 0
|
||||
hipfire_inaccuracy = 0
|
||||
scoped_inaccuracy = 0
|
||||
noscope = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/update_icon()
|
||||
cut_overlays()
|
||||
var/obj/item/ammo_casing/energy/primary_ammo = ammo_type[1]
|
||||
if(cell.charge > primary_ammo.e_cost)
|
||||
add_overlay(charged_overlay)
|
||||
else
|
||||
add_overlay(drained_overlay)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/attack_self(mob/user)
|
||||
projectile_setting_pierce = !projectile_setting_pierce
|
||||
to_chat(user, "<span class='boldnotice'>You set \the [src] to [projectile_setting_pierce? "pierce":"impact"] mode.</span>")
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/update_slowdown()
|
||||
if(scoped)
|
||||
slowdown = scoped_slow
|
||||
else
|
||||
slowdown = initial(slowdown)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/Destroy()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/zoom(user, forced_zoom)
|
||||
. = ..()
|
||||
scope(user, .)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/scope(mob/user, forced)
|
||||
var/scoping
|
||||
switch(forced)
|
||||
if(TRUE)
|
||||
scoping = TRUE
|
||||
if(FALSE)
|
||||
scoping = FALSE
|
||||
else
|
||||
scoping = !scoped
|
||||
if(scoping)
|
||||
spread = scoped_inaccuracy
|
||||
recoil = scoped_recoil
|
||||
scoped = TRUE
|
||||
user << "<span class='boldnotice'>You bring your [src] up and use its scope...</span>"
|
||||
else
|
||||
spread = hipfire_inaccuracy
|
||||
recoil = hipfire_recoil
|
||||
scoped = FALSE
|
||||
user << "<span class='boldnotice'>You lower your [src].</span>"
|
||||
update_slowdown()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/can_trigger_gun(var/mob/living/user)
|
||||
if(!scoped && !noscope)
|
||||
user << "<span class='userdanger'>This beam rifle can only be used while scoped!</span>"
|
||||
return FALSE
|
||||
. = ..(user)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/emp_act(severity)
|
||||
chambered = null
|
||||
recharge_newshot()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/aiming_beam()
|
||||
var/atom/A = current_user.client.mouseObject
|
||||
if(!istype(A) || !A.loc)
|
||||
return
|
||||
var/turf/T = get_turf(current_user.client.mouseObject)
|
||||
if(!istype(T))
|
||||
return
|
||||
var/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/P = new
|
||||
P.gun = src
|
||||
P.wall_pierce_amount = wall_pierce_amount
|
||||
P.structure_pierce_amount = structure_piercing
|
||||
P.do_pierce = projectile_setting_pierce
|
||||
P.preparePixelProjectile(current_user.client.mouseObject, T, current_user, current_user.client.mouseParams, 0)
|
||||
if(aiming_time)
|
||||
var/percent = ((100/aiming_time)*aiming_time_left)
|
||||
P.color = rgb(255 * percent,255 * ((100 - percent) / 100),0)
|
||||
else
|
||||
P.color = rgb(0, 255, 0)
|
||||
clear_tracers()
|
||||
P.fire()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/clear_tracers()
|
||||
for(var/I in current_tracers)
|
||||
current_tracers -= I
|
||||
var/obj/effect/temp_visual/projectile_beam/PB = I
|
||||
qdel(PB)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/terminate_aiming()
|
||||
stop_aiming()
|
||||
clear_tracers()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/process()
|
||||
if(!aiming)
|
||||
return
|
||||
if(!istype(current_user) || !isturf(current_user.loc) || !(src in current_user.held_items) || current_user.incapacitated()) //Doesn't work if you're not holding it!
|
||||
terminate_aiming()
|
||||
return
|
||||
if(aiming_time_left > 0)
|
||||
aiming_time_left--
|
||||
aiming_beam()
|
||||
process_aim()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/process_aim()
|
||||
if(current_user.client.mouseParams)
|
||||
var/list/mouse_control = params2list(current_user.client.mouseParams)
|
||||
if(isturf(current_user.client.mouseLocation))
|
||||
current_user.face_atom(current_user.client.mouseLocation)
|
||||
if(mouse_control["screen-loc"])
|
||||
var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",")
|
||||
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
|
||||
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
|
||||
var/x = (text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32)
|
||||
var/y = (text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32)
|
||||
var/screenview = (current_user.client.view * 2 + 1) * world.icon_size //Refer to http://www.byond.com/docs/ref/info.html#/client/var/view for mad maths
|
||||
var/ox = round(screenview/2) - current_user.client.pixel_x //"origin" x
|
||||
var/oy = round(screenview/2) - current_user.client.pixel_y //"origin" y
|
||||
var/angle = NORM_ROT(Atan2(y - oy, x - ox))
|
||||
var/difference = abs(lastangle - angle)
|
||||
delay_penalty(difference * aiming_time_increase_angle_multiplier)
|
||||
lastangle = angle
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/on_mob_move()
|
||||
delay_penalty(aiming_time_increase_user_movement)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/start_aiming()
|
||||
aiming_time_left = aiming_time
|
||||
aiming = TRUE
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/stop_aiming()
|
||||
aiming_time_left = aiming_time
|
||||
aiming = FALSE
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/onMouseDrag(src_object, over_object, src_location, over_location, params, mob)
|
||||
current_user = mob
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/onMouseDown(object, location, params, mob)
|
||||
start_aiming()
|
||||
current_user = mob
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/onMouseUp(object, location, params, mob/M)
|
||||
process_aim()
|
||||
if(aiming_time_left <= aiming_time_fire_threshold)
|
||||
sync_ammo()
|
||||
afterattack(M.client.mouseObject, M, FALSE, M.client.mouseParams, passthrough = TRUE)
|
||||
stop_aiming()
|
||||
clear_tracers()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/afterattack(atom/target, mob/living/user, flag, params, passthrough = FALSE)
|
||||
if(!passthrough && (aiming_time > aiming_time_fire_threshold))
|
||||
return
|
||||
if(lastfire > world.time + delay)
|
||||
return
|
||||
lastfire = world.time
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/sync_ammo()
|
||||
for(var/obj/item/ammo_casing/energy/beam_rifle/AC in contents)
|
||||
AC.sync_stats()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/delay_penalty(amount)
|
||||
aiming_time_left = Clamp(aiming_time_left + amount, 0, aiming_time)
|
||||
|
||||
/obj/item/ammo_casing/energy/beam_rifle
|
||||
name = "particle acceleration lens"
|
||||
desc = "Don't look into barrel!"
|
||||
var/wall_pierce_amount = 0
|
||||
var/wall_devastate = 0
|
||||
var/aoe_structure_range = 1
|
||||
var/aoe_structure_damage = 30
|
||||
var/aoe_fire_range = 2
|
||||
var/aoe_fire_chance = 66
|
||||
var/aoe_mob_range = 1
|
||||
var/aoe_mob_damage = 20
|
||||
var/impact_structure_damage = 50
|
||||
var/projectile_damage = 40
|
||||
var/projectile_stun = 0
|
||||
var/structure_piercing = 2
|
||||
var/structure_bleed_coeff = 0.7
|
||||
var/do_pierce = TRUE
|
||||
var/obj/item/weapon/gun/energy/beam_rifle/host
|
||||
|
||||
/obj/item/ammo_casing/energy/beam_rifle/proc/sync_stats()
|
||||
var/obj/item/weapon/gun/energy/beam_rifle/BR = loc
|
||||
if(!istype(BR))
|
||||
stack_trace("Beam rifle syncing error")
|
||||
host = BR
|
||||
do_pierce = BR.projectile_setting_pierce
|
||||
wall_pierce_amount = BR.wall_pierce_amount
|
||||
wall_devastate = BR.wall_devastate
|
||||
aoe_structure_range = BR.aoe_structure_range
|
||||
aoe_structure_damage = BR.aoe_structure_damage
|
||||
aoe_fire_range = BR.aoe_fire_range
|
||||
aoe_fire_chance = BR.aoe_fire_chance
|
||||
aoe_mob_range = BR.aoe_mob_range
|
||||
aoe_mob_damage = BR.aoe_mob_damage
|
||||
impact_structure_damage = BR.impact_structure_damage
|
||||
projectile_damage = BR.projectile_damage
|
||||
projectile_stun = BR.projectile_stun
|
||||
delay = BR.delay
|
||||
structure_piercing = BR.structure_piercing
|
||||
structure_bleed_coeff = BR.structure_bleed_coeff
|
||||
|
||||
/obj/item/ammo_casing/energy/beam_rifle/ready_proj(atom/target, mob/living/user, quiet, zone_override)
|
||||
. = ..(target, user, quiet, zone_override)
|
||||
var/obj/item/projectile/beam/beam_rifle/hitscan/HS_BB = BB
|
||||
if(!istype(HS_BB))
|
||||
return
|
||||
HS_BB.impact_direct_damage = projectile_damage
|
||||
HS_BB.stun = projectile_stun
|
||||
HS_BB.impact_structure_damage = impact_structure_damage
|
||||
HS_BB.aoe_mob_damage = aoe_mob_damage
|
||||
HS_BB.aoe_mob_range = Clamp(aoe_mob_range, 0, 15) //Badmin safety lock
|
||||
HS_BB.aoe_fire_chance = aoe_fire_chance
|
||||
HS_BB.aoe_fire_range = aoe_fire_range
|
||||
HS_BB.aoe_structure_damage = aoe_structure_damage
|
||||
HS_BB.aoe_structure_range = Clamp(aoe_structure_range, 0, 15) //Badmin safety lock
|
||||
HS_BB.wall_devastate = wall_devastate
|
||||
HS_BB.wall_pierce_amount = wall_pierce_amount
|
||||
HS_BB.structure_pierce_amount = structure_piercing
|
||||
HS_BB.structure_bleed_coeff = structure_bleed_coeff
|
||||
HS_BB.do_pierce = do_pierce
|
||||
HS_BB.gun = host
|
||||
|
||||
/obj/item/ammo_casing/energy/beam_rifle/hitscan
|
||||
projectile_type = /obj/item/projectile/beam/beam_rifle/hitscan
|
||||
select_name = "beam"
|
||||
e_cost = 5000
|
||||
fire_sound = 'sound/weapons/beam_sniper.ogg'
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle
|
||||
name = "particle beam"
|
||||
icon = ""
|
||||
hitsound = 'sound/effects/explosion3.ogg'
|
||||
damage = 0 //Handled manually.
|
||||
damage_type = BURN
|
||||
flag = "energy"
|
||||
range = 150
|
||||
jitter = 10
|
||||
var/obj/item/weapon/gun/energy/beam_rifle/gun
|
||||
var/structure_pierce_amount = 0 //All set to 0 so the gun can manually set them during firing.
|
||||
var/structure_bleed_coeff = 0
|
||||
var/structure_pierce = 0
|
||||
var/do_pierce = TRUE
|
||||
var/wall_pierce_amount = 0
|
||||
var/wall_pierce = 0
|
||||
var/wall_devastate = 0
|
||||
var/aoe_structure_range = 0
|
||||
var/aoe_structure_damage = 0
|
||||
var/aoe_fire_range = 0
|
||||
var/aoe_fire_chance = 0
|
||||
var/aoe_mob_range = 0
|
||||
var/aoe_mob_damage = 0
|
||||
var/impact_structure_damage = 0
|
||||
var/impact_direct_damage = 0
|
||||
var/turf/cached
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/proc/AOE(turf/epicenter)
|
||||
set waitfor = FALSE
|
||||
if(!epicenter)
|
||||
return
|
||||
new /obj/effect/temp_visual/explosion/fast(epicenter)
|
||||
for(var/mob/living/L in range(aoe_mob_range, epicenter)) //handle aoe mob damage
|
||||
L.adjustFireLoss(aoe_mob_damage)
|
||||
to_chat(L, "<span class='userdanger'>\The [src] sears you!</span>")
|
||||
for(var/turf/T in range(aoe_fire_range, epicenter)) //handle aoe fire
|
||||
if(prob(aoe_fire_chance))
|
||||
new /obj/effect/hotspot(T)
|
||||
for(var/obj/O in range(aoe_structure_range, epicenter))
|
||||
if(!isitem(O))
|
||||
if(O.level == 1) //Please don't break underfloor items!
|
||||
continue
|
||||
O.take_damage(aoe_structure_damage * get_damage_coeff(O), BURN, "laser", FALSE)
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/proc/check_pierce(atom/target)
|
||||
if(!do_pierce)
|
||||
return FALSE
|
||||
if(isclosedturf(target))
|
||||
if(wall_pierce++ < wall_pierce_amount)
|
||||
loc = target
|
||||
if(prob(wall_devastate))
|
||||
target.ex_act(2)
|
||||
return TRUE
|
||||
if(ismovableatom(target))
|
||||
var/atom/movable/AM = target
|
||||
if(AM.density && !AM.CanPass(src, get_turf(target)) && !ismob(AM))
|
||||
if(structure_pierce++ < structure_pierce_amount)
|
||||
if(isobj(AM))
|
||||
var/obj/O = AM
|
||||
O.take_damage((impact_structure_damage + aoe_structure_damage) * structure_bleed_coeff * get_damage_coeff(AM), BURN, "energy", FALSE)
|
||||
loc = get_turf(AM)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/proc/get_damage_coeff(atom/target)
|
||||
if(istype(target, /obj/machinery/door))
|
||||
return 0.4
|
||||
if(istype(target, /obj/structure/window))
|
||||
return 0.5
|
||||
return 1
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/proc/handle_impact(atom/target)
|
||||
if(isobj(target))
|
||||
var/obj/O = target
|
||||
O.take_damage(impact_structure_damage * get_damage_coeff(target), BURN, "laser", FALSE)
|
||||
if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
L.adjustFireLoss(impact_direct_damage)
|
||||
L.emote("scream")
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/proc/handle_hit(atom/target)
|
||||
set waitfor = FALSE
|
||||
if(!cached && !QDELETED(target))
|
||||
cached = get_turf(target)
|
||||
if(nodamage)
|
||||
return FALSE
|
||||
playsound(cached, 'sound/effects/explosion3.ogg', 100, 1)
|
||||
AOE(cached)
|
||||
if(!QDELETED(target))
|
||||
handle_impact(target)
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/Bump(atom/target, yes)
|
||||
if(check_pierce(target))
|
||||
permutated += target
|
||||
return FALSE
|
||||
if(!QDELETED(target))
|
||||
cached = get_turf(target)
|
||||
. = ..()
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/on_hit(atom/target, blocked = 0)
|
||||
if(!QDELETED(target))
|
||||
cached = get_turf(target)
|
||||
handle_hit(target)
|
||||
. = ..()
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan
|
||||
icon_state = ""
|
||||
var/tracer_type = /obj/effect/temp_visual/projectile_beam/tracer
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/fire(setAngle, atom/direct_target) //oranges didn't let me make this a var the first time around so copypasta time
|
||||
set waitfor = 0
|
||||
if(!log_override && firer && original)
|
||||
add_logs(firer, original, "fired at", src, " [get_area(src)]")
|
||||
if(setAngle)
|
||||
Angle = setAngle
|
||||
var/next_run = world.time
|
||||
var/old_pixel_x = pixel_x
|
||||
var/old_pixel_y = pixel_y
|
||||
var/safety = 0 //The code works fine, but... just in case...
|
||||
while(loc)
|
||||
if(++safety > (range * 3)) //If it's looping for way, way too long...
|
||||
return //Kill!
|
||||
if((!( current ) || loc == current))
|
||||
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
|
||||
if(!Angle)
|
||||
Angle=round(Get_Angle(src,current))
|
||||
if(spread)
|
||||
Angle += (rand() - 0.5) * spread
|
||||
var/matrix/M = new
|
||||
M.Turn(Angle)
|
||||
transform = M
|
||||
var/Pixel_x=sin(Angle)+16*sin(Angle)*2
|
||||
var/Pixel_y=cos(Angle)+16*cos(Angle)*2
|
||||
var/pixel_x_offset = old_pixel_x + Pixel_x
|
||||
var/pixel_y_offset = old_pixel_y + Pixel_y
|
||||
var/new_x = x
|
||||
var/new_y = y
|
||||
while(pixel_x_offset > 16)
|
||||
pixel_x_offset -= 32
|
||||
old_pixel_x -= 32
|
||||
new_x++// x++
|
||||
while(pixel_x_offset < -16)
|
||||
pixel_x_offset += 32
|
||||
old_pixel_x += 32
|
||||
new_x--
|
||||
while(pixel_y_offset > 16)
|
||||
pixel_y_offset -= 32
|
||||
old_pixel_y -= 32
|
||||
new_y++
|
||||
while(pixel_y_offset < -16)
|
||||
pixel_y_offset += 32
|
||||
old_pixel_y += 32
|
||||
new_y--
|
||||
pixel_x = old_pixel_x
|
||||
pixel_y = old_pixel_y
|
||||
step_towards(src, locate(new_x, new_y, z))
|
||||
next_run += max(world.tick_lag, speed)
|
||||
var/delay = next_run - world.time
|
||||
if(delay <= world.tick_lag*2)
|
||||
pixel_x = pixel_x_offset
|
||||
pixel_y = pixel_y_offset
|
||||
else
|
||||
animate(src, pixel_x = pixel_x_offset, pixel_y = pixel_y_offset, time = max(1, (delay <= 3 ? delay - 1 : delay)), flags = ANIMATION_END_NOW)
|
||||
old_pixel_x = pixel_x_offset
|
||||
old_pixel_y = pixel_y_offset
|
||||
if(original && (original.layer>=2.75) || ismob(original))
|
||||
if(loc == get_turf(original))
|
||||
if(!(original in permutated))
|
||||
Bump(original, 1)
|
||||
Range()
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/Range()
|
||||
spawn_tracer_effect()
|
||||
if(!QDELETED(src) && loc)
|
||||
cached = get_turf(src)
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/proc/spawn_tracer_effect()
|
||||
QDEL_IN((new tracer_type(loc, time = 5, angle_override = Angle, p_x = pixel_x, p_y = pixel_y, color_override = color)), 5)
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam
|
||||
tracer_type = /obj/effect/temp_visual/projectile_beam/tracer/aiming
|
||||
name = "aiming beam"
|
||||
hitsound = null
|
||||
hitsound_wall = null
|
||||
nodamage = TRUE
|
||||
damage = 0
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/prehit(atom/target)
|
||||
qdel(src)
|
||||
return FALSE
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/on_hit()
|
||||
qdel(src)
|
||||
return FALSE
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/spawn_tracer_effect()
|
||||
var/obj/effect/temp_visual/projectile_beam/T = new tracer_type(loc, time = 5, angle_override = Angle, p_x = pixel_x, p_y = pixel_y, color_override = color)
|
||||
if(istype(gun) && istype(T))
|
||||
gun.current_tracers[T] = TRUE
|
||||
|
||||
/obj/effect/temp_visual/projectile_beam
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
layer = ABOVE_MOB_LAYER
|
||||
anchored = 1
|
||||
duration = 5
|
||||
randomdir = FALSE
|
||||
light_power = 1
|
||||
light_range = 2
|
||||
light_color = "#00ffff"
|
||||
|
||||
/obj/effect/temp_visual/projectile_beam/New(time = 5, angle_override, p_x, p_y, color_override)
|
||||
duration = time
|
||||
var/mutable_appearance/look = new(src)
|
||||
look.pixel_x = p_x
|
||||
look.pixel_y = p_y
|
||||
if(color_override)
|
||||
look.color = color_override
|
||||
var/matrix/M = new
|
||||
M.Turn(angle_override)
|
||||
look.transform = M
|
||||
appearance = look
|
||||
..()
|
||||
|
||||
/obj/effect/temp_visual/projectile_beam/tracer
|
||||
icon_state = "tracer_beam"
|
||||
|
||||
/obj/effect/temp_visual/projectile_beam/tracer/aiming
|
||||
icon_state = "gbeam"
|
||||
duration = 1
|
||||
@@ -1,208 +1,208 @@
|
||||
/obj/item/weapon/gun/energy
|
||||
icon_state = "energy"
|
||||
name = "energy gun"
|
||||
desc = "A basic energy-based gun."
|
||||
icon = 'icons/obj/guns/energy.dmi'
|
||||
|
||||
var/obj/item/weapon/stock_parts/cell/cell //What type of power cell this uses
|
||||
var/cell_type = /obj/item/weapon/stock_parts/cell
|
||||
var/modifystate = 0
|
||||
var/list/ammo_type = list(/obj/item/ammo_casing/energy)
|
||||
var/select = 1 //The state of the select fire switch. Determines from the ammo_type list what kind of shot is fired next.
|
||||
var/can_charge = 1 //Can it be charged in a recharger?
|
||||
var/automatic_charge_overlays = TRUE //Do we handle overlays with base update_icon()?
|
||||
var/charge_sections = 4
|
||||
ammo_x_offset = 2
|
||||
var/shaded_charge = 0 //if this gun uses a stateful charge bar for more detail
|
||||
var/selfcharge = 0
|
||||
var/charge_tick = 0
|
||||
var/charge_delay = 4
|
||||
var/use_cyborg_cell = 0 //whether the gun's cell drains the cyborg user's cell to recharge
|
||||
|
||||
/obj/item/weapon/gun/energy/emp_act(severity)
|
||||
cell.use(round(cell.charge / severity))
|
||||
chambered = null //we empty the chamber
|
||||
recharge_newshot() //and try to charge a new shot
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/get_cell()
|
||||
return cell
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/Initialize()
|
||||
. = ..()
|
||||
if(cell_type)
|
||||
cell = new cell_type(src)
|
||||
else
|
||||
cell = new(src)
|
||||
cell.give(cell.maxcharge)
|
||||
update_ammo_types()
|
||||
recharge_newshot(1)
|
||||
if(selfcharge)
|
||||
START_PROCESSING(SSobj, src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/proc/update_ammo_types()
|
||||
var/obj/item/ammo_casing/energy/shot
|
||||
for (var/i = 1, i <= ammo_type.len, i++)
|
||||
var/shottype = ammo_type[i]
|
||||
shot = new shottype(src)
|
||||
ammo_type[i] = shot
|
||||
shot = ammo_type[select]
|
||||
fire_sound = shot.fire_sound
|
||||
fire_delay = shot.delay
|
||||
|
||||
/obj/item/weapon/gun/energy/Destroy()
|
||||
QDEL_NULL(cell)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/process()
|
||||
if(selfcharge)
|
||||
charge_tick++
|
||||
if(charge_tick < charge_delay)
|
||||
return
|
||||
charge_tick = 0
|
||||
if(!cell)
|
||||
return
|
||||
cell.give(100)
|
||||
if(!chambered) //if empty chamber we try to charge a new shot
|
||||
recharge_newshot(1)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/attack_self(mob/living/user as mob)
|
||||
if(ammo_type.len > 1)
|
||||
select_fire(user)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/can_shoot()
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
return cell.charge >= shot.e_cost
|
||||
|
||||
/obj/item/weapon/gun/energy/recharge_newshot(no_cyborg_drain)
|
||||
if (!ammo_type || !cell)
|
||||
return
|
||||
if(use_cyborg_cell && !no_cyborg_drain)
|
||||
if(iscyborg(loc))
|
||||
var/mob/living/silicon/robot/R = loc
|
||||
if(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)) //Take power from the borg...
|
||||
cell.give(shot.e_cost) //... to recharge the shot
|
||||
if(!chambered)
|
||||
var/obj/item/ammo_casing/energy/AC = ammo_type[select]
|
||||
if(cell.charge >= AC.e_cost) //if there's enough power in the cell cell...
|
||||
chambered = AC //...prepare a new shot based on the current ammo type selected
|
||||
if(!chambered.BB)
|
||||
chambered.newshot()
|
||||
|
||||
/obj/item/weapon/gun/energy/process_chamber()
|
||||
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
|
||||
var/obj/item/ammo_casing/energy/shot = chambered
|
||||
cell.use(shot.e_cost)//... drain the cell cell
|
||||
chambered = null //either way, released the prepared shot
|
||||
recharge_newshot() //try to charge a new shot
|
||||
|
||||
/obj/item/weapon/gun/energy/proc/select_fire(mob/living/user)
|
||||
select++
|
||||
if (select > ammo_type.len)
|
||||
select = 1
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
fire_sound = shot.fire_sound
|
||||
fire_delay = shot.delay
|
||||
if (shot.select_name)
|
||||
to_chat(user, "<span class='notice'>[src] is now set to [shot.select_name].</span>")
|
||||
chambered = null
|
||||
recharge_newshot(1)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/update_icon()
|
||||
..()
|
||||
if(!automatic_charge_overlays)
|
||||
return
|
||||
var/ratio = Ceiling((cell.charge / cell.maxcharge) * charge_sections)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
var/iconState = "[icon_state]_charge"
|
||||
var/itemState = null
|
||||
if(!initial(item_state))
|
||||
itemState = icon_state
|
||||
if (modifystate)
|
||||
add_overlay("[icon_state]_[shot.select_name]")
|
||||
iconState += "_[shot.select_name]"
|
||||
if(itemState)
|
||||
itemState += "[shot.select_name]"
|
||||
if(cell.charge < shot.e_cost)
|
||||
add_overlay("[icon_state]_empty")
|
||||
else
|
||||
if(!shaded_charge)
|
||||
var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
|
||||
for(var/i = ratio, i >= 1, i--)
|
||||
charge_overlay.pixel_x = ammo_x_offset * (i - 1)
|
||||
add_overlay(charge_overlay)
|
||||
else
|
||||
add_overlay("[icon_state]_charge[ratio]")
|
||||
if(itemState)
|
||||
itemState += "[ratio]"
|
||||
item_state = itemState
|
||||
|
||||
/obj/item/weapon/gun/energy/ui_action_click()
|
||||
toggle_gunlight()
|
||||
|
||||
/obj/item/weapon/gun/energy/suicide_act(mob/user)
|
||||
/obj/item/weapon/gun/energy
|
||||
icon_state = "energy"
|
||||
name = "energy gun"
|
||||
desc = "A basic energy-based gun."
|
||||
icon = 'icons/obj/guns/energy.dmi'
|
||||
|
||||
var/obj/item/weapon/stock_parts/cell/cell //What type of power cell this uses
|
||||
var/cell_type = /obj/item/weapon/stock_parts/cell
|
||||
var/modifystate = 0
|
||||
var/list/ammo_type = list(/obj/item/ammo_casing/energy)
|
||||
var/select = 1 //The state of the select fire switch. Determines from the ammo_type list what kind of shot is fired next.
|
||||
var/can_charge = 1 //Can it be charged in a recharger?
|
||||
var/automatic_charge_overlays = TRUE //Do we handle overlays with base update_icon()?
|
||||
var/charge_sections = 4
|
||||
ammo_x_offset = 2
|
||||
var/shaded_charge = 0 //if this gun uses a stateful charge bar for more detail
|
||||
var/selfcharge = 0
|
||||
var/charge_tick = 0
|
||||
var/charge_delay = 4
|
||||
var/use_cyborg_cell = 0 //whether the gun's cell drains the cyborg user's cell to recharge
|
||||
|
||||
/obj/item/weapon/gun/energy/emp_act(severity)
|
||||
cell.use(round(cell.charge / severity))
|
||||
chambered = null //we empty the chamber
|
||||
recharge_newshot() //and try to charge a new shot
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/get_cell()
|
||||
return cell
|
||||
|
||||
/obj/item/weapon/gun/energy/Initialize()
|
||||
. = ..()
|
||||
if(cell_type)
|
||||
cell = new cell_type(src)
|
||||
else
|
||||
cell = new(src)
|
||||
cell.give(cell.maxcharge)
|
||||
update_ammo_types()
|
||||
recharge_newshot(1)
|
||||
if(selfcharge)
|
||||
START_PROCESSING(SSobj, src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/proc/update_ammo_types()
|
||||
var/obj/item/ammo_casing/energy/shot
|
||||
for (var/i = 1, i <= ammo_type.len, i++)
|
||||
var/shottype = ammo_type[i]
|
||||
shot = new shottype(src)
|
||||
ammo_type[i] = shot
|
||||
shot = ammo_type[select]
|
||||
fire_sound = shot.fire_sound
|
||||
fire_delay = shot.delay
|
||||
|
||||
/obj/item/weapon/gun/energy/Destroy()
|
||||
QDEL_NULL(cell)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/process()
|
||||
if(selfcharge)
|
||||
charge_tick++
|
||||
if(charge_tick < charge_delay)
|
||||
return
|
||||
charge_tick = 0
|
||||
if(!cell)
|
||||
return
|
||||
cell.give(100)
|
||||
if(!chambered) //if empty chamber we try to charge a new shot
|
||||
recharge_newshot(1)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/attack_self(mob/living/user as mob)
|
||||
if(ammo_type.len > 1)
|
||||
select_fire(user)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/can_shoot()
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
return cell.charge >= shot.e_cost
|
||||
|
||||
/obj/item/weapon/gun/energy/recharge_newshot(no_cyborg_drain)
|
||||
if (!ammo_type || !cell)
|
||||
return
|
||||
if(use_cyborg_cell && !no_cyborg_drain)
|
||||
if(iscyborg(loc))
|
||||
var/mob/living/silicon/robot/R = loc
|
||||
if(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)) //Take power from the borg...
|
||||
cell.give(shot.e_cost) //... to recharge the shot
|
||||
if(!chambered)
|
||||
var/obj/item/ammo_casing/energy/AC = ammo_type[select]
|
||||
if(cell.charge >= AC.e_cost) //if there's enough power in the cell cell...
|
||||
chambered = AC //...prepare a new shot based on the current ammo type selected
|
||||
if(!chambered.BB)
|
||||
chambered.newshot()
|
||||
|
||||
/obj/item/weapon/gun/energy/process_chamber()
|
||||
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
|
||||
var/obj/item/ammo_casing/energy/shot = chambered
|
||||
cell.use(shot.e_cost)//... drain the cell cell
|
||||
chambered = null //either way, released the prepared shot
|
||||
recharge_newshot() //try to charge a new shot
|
||||
|
||||
/obj/item/weapon/gun/energy/proc/select_fire(mob/living/user)
|
||||
select++
|
||||
if (select > ammo_type.len)
|
||||
select = 1
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
fire_sound = shot.fire_sound
|
||||
fire_delay = shot.delay
|
||||
if (shot.select_name)
|
||||
to_chat(user, "<span class='notice'>[src] is now set to [shot.select_name].</span>")
|
||||
chambered = null
|
||||
recharge_newshot(1)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/update_icon()
|
||||
..()
|
||||
if(!automatic_charge_overlays)
|
||||
return
|
||||
var/ratio = Ceiling((cell.charge / cell.maxcharge) * charge_sections)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
var/iconState = "[icon_state]_charge"
|
||||
var/itemState = null
|
||||
if(!initial(item_state))
|
||||
itemState = icon_state
|
||||
if (modifystate)
|
||||
add_overlay("[icon_state]_[shot.select_name]")
|
||||
iconState += "_[shot.select_name]"
|
||||
if(itemState)
|
||||
itemState += "[shot.select_name]"
|
||||
if(cell.charge < shot.e_cost)
|
||||
add_overlay("[icon_state]_empty")
|
||||
else
|
||||
if(!shaded_charge)
|
||||
var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
|
||||
for(var/i = ratio, i >= 1, i--)
|
||||
charge_overlay.pixel_x = ammo_x_offset * (i - 1)
|
||||
charge_overlay.pixel_y = ammo_y_offset * (i - 1)
|
||||
add_overlay(charge_overlay)
|
||||
else
|
||||
add_overlay("[icon_state]_charge[ratio]")
|
||||
if(itemState)
|
||||
itemState += "[ratio]"
|
||||
item_state = itemState
|
||||
|
||||
/obj/item/weapon/gun/energy/ui_action_click()
|
||||
toggle_gunlight()
|
||||
|
||||
/obj/item/weapon/gun/energy/suicide_act(mob/user)
|
||||
if (src.can_shoot() && can_trigger_gun(user))
|
||||
user.visible_message("<span class='suicide'>[user] is putting the barrel of [src] in [user.p_their()] mouth. It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
sleep(25)
|
||||
if(user.is_holding(src))
|
||||
user.visible_message("<span class='suicide'>[user] melts [user.p_their()] face off with [src]!</span>")
|
||||
playsound(loc, fire_sound, 50, 1, -1)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
cell.use(shot.e_cost)
|
||||
update_icon()
|
||||
return(FIRELOSS)
|
||||
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 [user.p_their()] brains out with [src]! It looks like [user.p_theyre()] trying to commit suicide!</b></span>")
|
||||
playsound(loc, 'sound/weapons/empty.ogg', 50, 1, -1)
|
||||
return (OXYLOSS)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/vv_edit_var(var_name, var_value)
|
||||
switch(var_name)
|
||||
if("selfcharge")
|
||||
if(var_value)
|
||||
START_PROCESSING(SSobj, src)
|
||||
else
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
. = ..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/ignition_effect(atom/A, mob/living/user)
|
||||
if(!can_shoot() || !ammo_type[select])
|
||||
shoot_with_empty_chamber()
|
||||
. = ""
|
||||
else
|
||||
var/obj/item/ammo_casing/energy/E = ammo_type[select]
|
||||
var/obj/item/projectile/energy/BB = E.BB
|
||||
if(!BB)
|
||||
. = ""
|
||||
else if(BB.nodamage || !BB.damage || BB.damage_type == STAMINA)
|
||||
user.visible_message("<span class='danger'>[user] tries to light their [A.name] with [src], but it doesn't do anything. Dumbass.</span>")
|
||||
playsound(user, E.fire_sound, 50, 1)
|
||||
playsound(user, BB.hitsound, 50, 1)
|
||||
cell.use(E.e_cost)
|
||||
. = ""
|
||||
else if(BB.damage_type != BURN)
|
||||
user.visible_message("<span class='danger'>[user] tries to light their [A.name] with [src], but only succeeds in utterly destroying it. Dumbass.</span>")
|
||||
playsound(user, E.fire_sound, 50, 1)
|
||||
playsound(user, BB.hitsound, 50, 1)
|
||||
cell.use(E.e_cost)
|
||||
qdel(A)
|
||||
. = ""
|
||||
else
|
||||
playsound(user, E.fire_sound, 50, 1)
|
||||
playsound(user, BB.hitsound, 50, 1)
|
||||
cell.use(E.e_cost)
|
||||
. = "<span class='danger'>[user] casually lights their [A.name] with [src]. Damn.</span>"
|
||||
user.visible_message("<span class='suicide'>[user] is putting the barrel of [src] in [user.p_their()] mouth. It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
sleep(25)
|
||||
if(user.is_holding(src))
|
||||
user.visible_message("<span class='suicide'>[user] melts [user.p_their()] face off with [src]!</span>")
|
||||
playsound(loc, fire_sound, 50, 1, -1)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
cell.use(shot.e_cost)
|
||||
update_icon()
|
||||
return(FIRELOSS)
|
||||
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 [user.p_their()] brains out with [src]! It looks like [user.p_theyre()] trying to commit suicide!</b></span>")
|
||||
playsound(loc, 'sound/weapons/empty.ogg', 50, 1, -1)
|
||||
return (OXYLOSS)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/vv_edit_var(var_name, var_value)
|
||||
switch(var_name)
|
||||
if("selfcharge")
|
||||
if(var_value)
|
||||
START_PROCESSING(SSobj, src)
|
||||
else
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
. = ..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/ignition_effect(atom/A, mob/living/user)
|
||||
if(!can_shoot() || !ammo_type[select])
|
||||
shoot_with_empty_chamber()
|
||||
. = ""
|
||||
else
|
||||
var/obj/item/ammo_casing/energy/E = ammo_type[select]
|
||||
var/obj/item/projectile/energy/BB = E.BB
|
||||
if(!BB)
|
||||
. = ""
|
||||
else if(BB.nodamage || !BB.damage || BB.damage_type == STAMINA)
|
||||
user.visible_message("<span class='danger'>[user] tries to light their [A.name] with [src], but it doesn't do anything. Dumbass.</span>")
|
||||
playsound(user, E.fire_sound, 50, 1)
|
||||
playsound(user, BB.hitsound, 50, 1)
|
||||
cell.use(E.e_cost)
|
||||
. = ""
|
||||
else if(BB.damage_type != BURN)
|
||||
user.visible_message("<span class='danger'>[user] tries to light their [A.name] with [src], but only succeeds in utterly destroying it. Dumbass.</span>")
|
||||
playsound(user, E.fire_sound, 50, 1)
|
||||
playsound(user, BB.hitsound, 50, 1)
|
||||
cell.use(E.e_cost)
|
||||
qdel(A)
|
||||
. = ""
|
||||
else
|
||||
playsound(user, E.fire_sound, 50, 1)
|
||||
playsound(user, BB.hitsound, 50, 1)
|
||||
cell.use(E.e_cost)
|
||||
. = "<span class='danger'>[user] casually lights their [A.name] with [src]. Damn.</span>"
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
ammo_x_offset = 2
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode/spec, /obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/e_gun/old
|
||||
name = "prototype energy gun"
|
||||
desc = "NT-P:01 Prototype Energy Gun. Early stage development of a unique laser rifle that has multifaceted energy lens allowing the gun to alter the form of projectile it fires on command."
|
||||
@@ -46,7 +45,6 @@
|
||||
ammo_x_offset = 2
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser, /obj/item/ammo_casing/energy/electrode/old)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/e_gun/mini/practice_phaser
|
||||
name = "practice phaser"
|
||||
desc = "A modified version of the basic phaser gun, this one fires less concentrated energy bolts designed for target practice."
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
projectile_type = /obj/item/projectile/kinetic
|
||||
select_name = "kinetic"
|
||||
e_cost = 500
|
||||
fire_sound = 'sound/weapons/Kenetic_accel.ogg' // fine spelling there chap
|
||||
fire_sound = 'sound/weapons/kenetic_accel.ogg' // fine spelling there chap
|
||||
|
||||
/obj/item/ammo_casing/energy/kinetic/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
|
||||
..()
|
||||
@@ -172,18 +172,13 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/kinetic/prehit(atom/target)
|
||||
var/turf/target_turf = get_turf(target)
|
||||
if(!isturf(target_turf))
|
||||
return
|
||||
. = ..()
|
||||
if(.)
|
||||
if(kinetic_gun)
|
||||
var/list/mods = kinetic_gun.get_modkits()
|
||||
for(var/obj/item/borg/upgrade/modkit/M in mods)
|
||||
M.projectile_prehit(src, target, kinetic_gun)
|
||||
var/datum/gas_mixture/environment = target_turf.return_air()
|
||||
var/pressure = environment.return_pressure()
|
||||
if(pressure > 50)
|
||||
if(!lavaland_equipment_pressure_check(get_turf(target)))
|
||||
name = "weakened [name]"
|
||||
damage = damage * pressure_decrease
|
||||
pressure_decrease_active = TRUE
|
||||
@@ -261,7 +256,7 @@
|
||||
if(!user.transferItemToLoc(src, KA))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You install the modkit.</span>")
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
playsound(loc, 'sound/items/screwdriver.ogg', 100, 1)
|
||||
KA.modkits += src
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The modkit you're trying to install would conflict with an already installed modkit. Use a crowbar to remove existing modkits.</span>")
|
||||
@@ -280,7 +275,6 @@
|
||||
//use this one for effects you want to trigger before mods that do damage
|
||||
/obj/item/borg/upgrade/modkit/proc/projectile_strike_predamage(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
//and this one for things that don't need to trigger before other damage-dealing mods
|
||||
|
||||
/obj/item/borg/upgrade/modkit/proc/projectile_strike(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
|
||||
//Range
|
||||
@@ -449,8 +443,7 @@
|
||||
if(SM.reward_target == src) //we want to allow multiple people with bounty modkits to use them, but we need to replace our own marks so we don't multi-reward
|
||||
SM.reward_target = null
|
||||
qdel(SM)
|
||||
var/datum/status_effect/syphon_mark/SM = L.apply_status_effect(STATUS_EFFECT_SYPHONMARK)
|
||||
SM.reward_target = src
|
||||
L.apply_status_effect(STATUS_EFFECT_SYPHONMARK, src)
|
||||
|
||||
/obj/item/borg/upgrade/modkit/bounty/projectile_strike(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
if(isliving(target))
|
||||
@@ -471,11 +464,10 @@
|
||||
else
|
||||
bounties_reaped[L.type] = min(bounties_reaped[L.type] + (modifier * bonus_mod), maximum_bounty)
|
||||
|
||||
|
||||
//Indoors
|
||||
/obj/item/borg/upgrade/modkit/indoors
|
||||
name = "decrease pressure penalty"
|
||||
desc = "A syndicate modification kit that increases the damage a kinetic accelerator does in a high pressure environment."
|
||||
desc = "A syndicate modification kit that increases the damage a kinetic accelerator does in high pressure environments."
|
||||
modifier = 2
|
||||
denied_type = /obj/item/borg/upgrade/modkit/indoors
|
||||
maximum_of_type = 2
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
/obj/item/weapon/gun/energy/laser
|
||||
name = "laser gun"
|
||||
desc = "A basic energy-based laser gun that fires concentrated beams of light which pass through glass and thin metal."
|
||||
icon_state = "laser"
|
||||
item_state = "laser"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
materials = list(MAT_METAL=2000)
|
||||
origin_tech = "combat=4;magnets=2"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/lasergun)
|
||||
ammo_x_offset = 1
|
||||
shaded_charge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/practice
|
||||
name = "practice laser gun"
|
||||
desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice."
|
||||
origin_tech = "combat=2;magnets=2"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/practice)
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/retro
|
||||
name ="retro laser gun"
|
||||
icon_state = "retro"
|
||||
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's private security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/laser
|
||||
name = "laser gun"
|
||||
desc = "A basic energy-based laser gun that fires concentrated beams of light which pass through glass and thin metal."
|
||||
icon_state = "laser"
|
||||
item_state = "laser"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
materials = list(MAT_METAL=2000)
|
||||
origin_tech = "combat=4;magnets=2"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/lasergun)
|
||||
ammo_x_offset = 1
|
||||
shaded_charge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/practice
|
||||
name = "practice laser gun"
|
||||
desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice."
|
||||
origin_tech = "combat=2;magnets=2"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/practice)
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/retro
|
||||
name ="retro laser gun"
|
||||
icon_state = "retro"
|
||||
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's private security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/retro/old
|
||||
name ="laser gun"
|
||||
icon_state = "retro"
|
||||
@@ -31,113 +31,113 @@
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/lasergun/old)
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain
|
||||
name = "antique laser gun"
|
||||
icon_state = "caplaser"
|
||||
item_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
|
||||
ammo_x_offset = 3
|
||||
selfcharge = 1
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain/scattershot
|
||||
name = "scatter shot laser rifle"
|
||||
icon_state = "lasercannon"
|
||||
item_state = "laser"
|
||||
desc = "An industrial-grade heavy-duty laser rifle with a modified laser lense to scatter its shot into multiple smaller lasers. The inner-core can self-charge for theorically infinite use."
|
||||
origin_tech = "combat=5;materials=4;powerstorage=4"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/cyborg
|
||||
can_charge = 0
|
||||
desc = "An energy-based laser gun that draws power from the cyborg's internal energy cell directly. So this is what freedom looks like?"
|
||||
origin_tech = null
|
||||
use_cyborg_cell = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/cyborg/emp_act()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/scatter
|
||||
name = "scatter laser gun"
|
||||
desc = "A laser gun equipped with a refraction kit that spreads bolts."
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/scatter/shotty
|
||||
name = "energy shotgun"
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
icon_state = "cshotgun"
|
||||
item_state = "shotgun"
|
||||
desc = "A combat shotgun gutted and refitted with an internal laser system. Can switch between taser and scattered disabler shots."
|
||||
shaded_charge = 0
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter/disabler, /obj/item/ammo_casing/energy/electrode)
|
||||
|
||||
///Laser Cannon
|
||||
|
||||
/obj/item/weapon/gun/energy/lasercannon
|
||||
name = "accelerator laser cannon"
|
||||
desc = "An advanced laser cannon that does more damage the farther away the target is."
|
||||
icon_state = "lasercannon"
|
||||
item_state = "laser"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 10
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
origin_tech = "combat=4;magnets=4;powerstorage=3"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/accelerator)
|
||||
pin = null
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/ammo_casing/energy/laser/accelerator
|
||||
projectile_type = /obj/item/projectile/beam/laser/accelerator
|
||||
select_name = "accelerator"
|
||||
fire_sound = 'sound/weapons/lasercannonfire.ogg'
|
||||
|
||||
/obj/item/projectile/beam/laser/accelerator
|
||||
name = "accelerator laser"
|
||||
icon_state = "scatterlaser"
|
||||
range = 255
|
||||
damage = 6
|
||||
|
||||
/obj/item/projectile/beam/laser/accelerator/Range()
|
||||
..()
|
||||
damage += 7
|
||||
transform *= 1 + ((damage/7) * 0.2)//20% larger per tile
|
||||
|
||||
/obj/item/weapon/gun/energy/xray
|
||||
name = "xray laser gun"
|
||||
desc = "A high-power laser gun capable of expelling concentrated xray blasts that pass through multiple soft targets and heavier materials"
|
||||
icon_state = "xray"
|
||||
item_state = null
|
||||
origin_tech = "combat=6;materials=4;magnets=4;syndicate=1"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/xray)
|
||||
pin = null
|
||||
ammo_x_offset = 3
|
||||
|
||||
////////Laser Tag////////////////////
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/bluetag
|
||||
name = "laser tag gun"
|
||||
icon_state = "bluetag"
|
||||
desc = "A retro laser gun modified to fire harmless blue beams of light. Sound effects included!"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/bluetag)
|
||||
origin_tech = "combat=2;magnets=2"
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
pin = /obj/item/device/firing_pin/tag/blue
|
||||
ammo_x_offset = 2
|
||||
selfcharge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/redtag
|
||||
name = "laser tag gun"
|
||||
icon_state = "redtag"
|
||||
desc = "A retro laser gun modified to fire harmless beams red of light. Sound effects included!"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/redtag)
|
||||
origin_tech = "combat=2;magnets=2"
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
pin = /obj/item/device/firing_pin/tag/red
|
||||
ammo_x_offset = 2
|
||||
selfcharge = 1
|
||||
/obj/item/weapon/gun/energy/laser/captain
|
||||
name = "antique laser gun"
|
||||
icon_state = "caplaser"
|
||||
item_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
|
||||
ammo_x_offset = 3
|
||||
selfcharge = 1
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain/scattershot
|
||||
name = "scatter shot laser rifle"
|
||||
icon_state = "lasercannon"
|
||||
item_state = "laser"
|
||||
desc = "An industrial-grade heavy-duty laser rifle with a modified laser lense to scatter its shot into multiple smaller lasers. The inner-core can self-charge for theorically infinite use."
|
||||
origin_tech = "combat=5;materials=4;powerstorage=4"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/cyborg
|
||||
can_charge = 0
|
||||
desc = "An energy-based laser gun that draws power from the cyborg's internal energy cell directly. So this is what freedom looks like?"
|
||||
origin_tech = null
|
||||
use_cyborg_cell = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/cyborg/emp_act()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/scatter
|
||||
name = "scatter laser gun"
|
||||
desc = "A laser gun equipped with a refraction kit that spreads bolts."
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/scatter/shotty
|
||||
name = "energy shotgun"
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
icon_state = "cshotgun"
|
||||
item_state = "shotgun"
|
||||
desc = "A combat shotgun gutted and refitted with an internal laser system. Can switch between taser and scattered disabler shots."
|
||||
shaded_charge = 0
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter/disabler, /obj/item/ammo_casing/energy/electrode)
|
||||
|
||||
///Laser Cannon
|
||||
|
||||
/obj/item/weapon/gun/energy/lasercannon
|
||||
name = "accelerator laser cannon"
|
||||
desc = "An advanced laser cannon that does more damage the farther away the target is."
|
||||
icon_state = "lasercannon"
|
||||
item_state = "laser"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 10
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
origin_tech = "combat=4;magnets=4;powerstorage=3"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/accelerator)
|
||||
pin = null
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/ammo_casing/energy/laser/accelerator
|
||||
projectile_type = /obj/item/projectile/beam/laser/accelerator
|
||||
select_name = "accelerator"
|
||||
fire_sound = 'sound/weapons/lasercannonfire.ogg'
|
||||
|
||||
/obj/item/projectile/beam/laser/accelerator
|
||||
name = "accelerator laser"
|
||||
icon_state = "scatterlaser"
|
||||
range = 255
|
||||
damage = 6
|
||||
|
||||
/obj/item/projectile/beam/laser/accelerator/Range()
|
||||
..()
|
||||
damage += 7
|
||||
transform *= 1 + ((damage/7) * 0.2)//20% larger per tile
|
||||
|
||||
/obj/item/weapon/gun/energy/xray
|
||||
name = "xray laser gun"
|
||||
desc = "A high-power laser gun capable of expelling concentrated xray blasts that pass through multiple soft targets and heavier materials"
|
||||
icon_state = "xray"
|
||||
item_state = null
|
||||
origin_tech = "combat=6;materials=4;magnets=4;syndicate=1"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/xray)
|
||||
pin = null
|
||||
ammo_x_offset = 3
|
||||
|
||||
////////Laser Tag////////////////////
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/bluetag
|
||||
name = "laser tag gun"
|
||||
icon_state = "bluetag"
|
||||
desc = "A retro laser gun modified to fire harmless blue beams of light. Sound effects included!"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/bluetag)
|
||||
origin_tech = "combat=2;magnets=2"
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
pin = /obj/item/device/firing_pin/tag/blue
|
||||
ammo_x_offset = 2
|
||||
selfcharge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/redtag
|
||||
name = "laser tag gun"
|
||||
icon_state = "redtag"
|
||||
desc = "A retro laser gun modified to fire harmless beams red of light. Sound effects included!"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/redtag)
|
||||
origin_tech = "combat=2;magnets=2"
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
pin = /obj/item/device/firing_pin/tag/red
|
||||
ammo_x_offset = 2
|
||||
selfcharge = 1
|
||||
|
||||
@@ -1,79 +1,78 @@
|
||||
/obj/item/weapon/gun/energy/pulse
|
||||
name = "pulse rifle"
|
||||
desc = "A heavy-duty, multifaceted energy rifle with three modes. Preferred by front-line combat personnel."
|
||||
icon_state = "pulse"
|
||||
item_state = null
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 10
|
||||
modifystate = TRUE
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/pulse, /obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser)
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/pulse"
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/emp_act(severity)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse
|
||||
name = "pulse rifle"
|
||||
desc = "A heavy-duty, multifaceted energy rifle with three modes. Preferred by front-line combat personnel."
|
||||
icon_state = "pulse"
|
||||
item_state = null
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 10
|
||||
modifystate = TRUE
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/pulse, /obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser)
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/pulse"
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/emp_act(severity)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize/Initialize()
|
||||
. = ..()
|
||||
. = ..()
|
||||
GLOB.poi_list += src
|
||||
var/msg = "A pulse rifle prize has been created at [ADMIN_COORDJMP(src)]"
|
||||
|
||||
message_admins(msg)
|
||||
log_game(msg)
|
||||
|
||||
notify_ghosts("Someone won a pulse rifle as a prize!", source = src, action = NOTIFY_ORBIT)
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize/Destroy()
|
||||
GLOB.poi_list -= src
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/carbine
|
||||
name = "pulse carbine"
|
||||
desc = "A compact variant of the pulse rifle with less firepower but easier storage."
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
slot_flags = SLOT_BELT
|
||||
icon_state = "pulse_carbine"
|
||||
item_state = null
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/carbine"
|
||||
can_flashlight = 1
|
||||
flight_x_offset = 18
|
||||
flight_y_offset = 12
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/carbine/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol
|
||||
name = "pulse pistol"
|
||||
desc = "A pulse rifle in an easily concealed handgun package with low capacity."
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
slot_flags = SLOT_BELT
|
||||
icon_state = "pulse_pistol"
|
||||
item_state = "gun"
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/pistol"
|
||||
can_charge = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/destroyer
|
||||
name = "pulse destroyer"
|
||||
desc = "A heavy-duty energy rifle built for pure destruction."
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
|
||||
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>")
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol/m1911
|
||||
name = "\improper M1911-P"
|
||||
desc = "A compact pulse core in a classic handgun frame for Nanotrasen officers. It's not the size of the gun, it's the size of the hole it puts through people."
|
||||
icon_state = "m1911"
|
||||
item_state = "gun"
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
|
||||
var/msg = "A pulse rifle prize has been created at [ADMIN_COORDJMP(src)]"
|
||||
|
||||
message_admins(msg)
|
||||
log_game(msg)
|
||||
|
||||
notify_ghosts("Someone won a pulse rifle as a prize!", source = src, action = NOTIFY_ORBIT)
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize/Destroy()
|
||||
GLOB.poi_list -= src
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/carbine
|
||||
name = "pulse carbine"
|
||||
desc = "A compact variant of the pulse rifle with less firepower but easier storage."
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
slot_flags = SLOT_BELT
|
||||
icon_state = "pulse_carbine"
|
||||
item_state = null
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/carbine"
|
||||
can_flashlight = 1
|
||||
flight_x_offset = 18
|
||||
flight_y_offset = 12
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/carbine/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol
|
||||
name = "pulse pistol"
|
||||
desc = "A pulse rifle in an easily concealed handgun package with low capacity."
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
slot_flags = SLOT_BELT
|
||||
icon_state = "pulse_pistol"
|
||||
item_state = "gun"
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/pistol"
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/destroyer
|
||||
name = "pulse destroyer"
|
||||
desc = "A heavy-duty energy rifle built for pure destruction."
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
|
||||
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>")
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol/m1911
|
||||
name = "\improper M1911-P"
|
||||
desc = "A compact pulse core in a classic handgun frame for Nanotrasen officers. It's not the size of the gun, it's the size of the hole it puts through people."
|
||||
icon_state = "m1911"
|
||||
item_state = "gun"
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
/obj/item/weapon/gun/energy/plasmacutter
|
||||
name = "plasma cutter"
|
||||
desc = "A mining tool capable of expelling concentrated plasma bursts. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
|
||||
desc = "A mining tool capable of expelling concentrated plasma bursts. You could use it to cut limbs off xenos! Or, you know, mine stuff."
|
||||
icon_state = "plasmacutter"
|
||||
item_state = "plasmacutter"
|
||||
origin_tech = "combat=1;materials=3;magnets=2;plasmatech=3;engineering=1"
|
||||
@@ -172,8 +172,8 @@
|
||||
item_state = null
|
||||
icon_state = "wormhole_projector"
|
||||
origin_tech = "combat=4;bluespace=6;plasmatech=4;engineering=4"
|
||||
var/obj/effect/portal/blue
|
||||
var/obj/effect/portal/orange
|
||||
var/obj/effect/portal/p_blue
|
||||
var/obj/effect/portal/p_orange
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/update_icon()
|
||||
icon_state = "[initial(icon_state)][select]"
|
||||
@@ -184,36 +184,50 @@
|
||||
..()
|
||||
select_fire()
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/proc/portal_destroyed(obj/effect/portal/P)
|
||||
if(P.icon_state == "portal")
|
||||
blue = null
|
||||
if(orange)
|
||||
orange.target = null
|
||||
else
|
||||
orange = null
|
||||
if(blue)
|
||||
blue.target = null
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/proc/on_portal_destroy(obj/effect/portal/P)
|
||||
if(P == p_blue)
|
||||
p_blue = null
|
||||
else if(P == p_orange)
|
||||
p_orange = null
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/proc/create_portal(obj/item/projectile/beam/wormhole/W)
|
||||
var/obj/effect/portal/P = new /obj/effect/portal(get_turf(W), null, src)
|
||||
P.precision = 0
|
||||
if(W.name == "bluespace beam")
|
||||
qdel(blue)
|
||||
blue = P
|
||||
else
|
||||
qdel(orange)
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/proc/has_blue_portal()
|
||||
if(istype(p_blue) && !QDELETED(p_blue))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/proc/has_orange_portal()
|
||||
if(istype(p_orange) && !QDELETED(p_orange))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/proc/crosslink()
|
||||
if(!has_blue_portal() && !has_orange_portal())
|
||||
return
|
||||
if(!has_blue_portal() && has_orange_portal())
|
||||
p_orange.link_portal(null)
|
||||
return
|
||||
if(!has_orange_portal() && has_blue_portal())
|
||||
p_blue.link_portal(null)
|
||||
return
|
||||
p_orange.link_portal(p_blue)
|
||||
p_blue.link_portal(p_orange)
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/proc/create_portal(obj/item/projectile/beam/wormhole/W, turf/target)
|
||||
var/obj/effect/portal/P = new /obj/effect/portal(target, src, 300, null, FALSE, null)
|
||||
if(istype(W, /obj/item/projectile/beam/wormhole/orange))
|
||||
qdel(p_orange)
|
||||
p_orange = P
|
||||
P.icon_state = "portal1"
|
||||
orange = P
|
||||
if(orange && blue)
|
||||
blue.target = get_turf(orange)
|
||||
orange.target = get_turf(blue)
|
||||
|
||||
else
|
||||
qdel(p_blue)
|
||||
p_blue = P
|
||||
crosslink()
|
||||
|
||||
/* 3d printer 'pseudo guns' for borgs */
|
||||
|
||||
/obj/item/weapon/gun/energy/printer
|
||||
name = "cyborg lmg"
|
||||
desc = "A machinegun that fires 3d-printed flachettes slowly regenerated using a cyborg's internal power source."
|
||||
desc = "A machinegun that fires 3d-printed flechettes slowly regenerated using a cyborg's internal power source."
|
||||
icon_state = "l6closed0"
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/secborg"
|
||||
@@ -268,7 +282,7 @@
|
||||
|
||||
/obj/item/weapon/gun/energy/gravity_gun
|
||||
name = "one-point bluespace-gravitational manipulator"
|
||||
desc = "An experimental, multi-mode device that fires bolts of Zero-Point Energy, causing local distortions in gravity"
|
||||
desc = "An experimental, multi-mode device that fires bolts of Zero-Point Energy, causing local distortions in gravity."
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/gravityrepulse, /obj/item/ammo_casing/energy/gravityattract, /obj/item/ammo_casing/energy/gravitychaos)
|
||||
origin_tech = "combat=4;magnets=4;materials=6;powerstorage=4;bluespace=4"
|
||||
item_state = null
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
/obj/item/weapon/gun/energy/taser
|
||||
name = "taser gun"
|
||||
desc = "A low-capacity, energy-based stun gun used by security teams to subdue targets at range."
|
||||
icon_state = "taser"
|
||||
item_state = null //so the human update icon uses the icon_state instead.
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode)
|
||||
origin_tech = "combat=3"
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/tesla_revolver
|
||||
name = "tesla gun"
|
||||
desc = "An experimental gun based on an experimental engine, it's about as likely to kill its operator as it is the target."
|
||||
icon_state = "tesla"
|
||||
item_state = "tesla"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/tesla_revolver)
|
||||
origin_tech = "combat=4;materials=4;powerstorage=4"
|
||||
can_flashlight = 0
|
||||
pin = null
|
||||
shaded_charge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/e_gun/advtaser
|
||||
name = "hybrid taser"
|
||||
desc = "A dual-mode taser designed to fire both short-range high-power electrodes and long-range disabler beams."
|
||||
icon_state = "advtaser"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/disabler)
|
||||
origin_tech = "combat=4"
|
||||
ammo_x_offset = 2
|
||||
|
||||
/obj/item/weapon/gun/energy/e_gun/advtaser/cyborg
|
||||
name = "cyborg taser"
|
||||
desc = "An integrated hybrid taser that draws directly from a cyborg's power cell. The weapon contains a limiter to prevent the cyborg's power cell from overheating."
|
||||
can_flashlight = 0
|
||||
can_charge = 0
|
||||
use_cyborg_cell = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler
|
||||
name = "disabler"
|
||||
desc = "A self-defense weapon that exhausts organic targets, weakening them until they collapse."
|
||||
icon_state = "disabler"
|
||||
/obj/item/weapon/gun/energy/taser
|
||||
name = "taser gun"
|
||||
desc = "A low-capacity, energy-based stun gun used by security teams to subdue targets at range."
|
||||
icon_state = "taser"
|
||||
item_state = null //so the human update icon uses the icon_state instead.
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode)
|
||||
origin_tech = "combat=3"
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/tesla_revolver
|
||||
name = "tesla gun"
|
||||
desc = "An experimental gun based on an experimental engine, it's about as likely to kill its operator as it is the target."
|
||||
icon_state = "tesla"
|
||||
item_state = "tesla"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/tesla_revolver)
|
||||
origin_tech = "combat=4;materials=4;powerstorage=4"
|
||||
can_flashlight = 0
|
||||
pin = null
|
||||
shaded_charge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/e_gun/advtaser
|
||||
name = "hybrid taser"
|
||||
desc = "A dual-mode taser designed to fire both short-range high-power electrodes and long-range disabler beams."
|
||||
icon_state = "advtaser"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/disabler)
|
||||
origin_tech = "combat=4"
|
||||
ammo_x_offset = 2
|
||||
|
||||
/obj/item/weapon/gun/energy/e_gun/advtaser/cyborg
|
||||
name = "cyborg taser"
|
||||
desc = "An integrated hybrid taser that draws directly from a cyborg's power cell. The weapon contains a limiter to prevent the cyborg's power cell from overheating."
|
||||
can_flashlight = 0
|
||||
can_charge = 0
|
||||
use_cyborg_cell = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler
|
||||
name = "disabler"
|
||||
desc = "A self-defense weapon that exhausts organic targets, weakening them until they collapse."
|
||||
icon_state = "disabler"
|
||||
item_state = null
|
||||
origin_tech = "combat=3"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/disabler)
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler/cyborg
|
||||
name = "cyborg disabler"
|
||||
desc = "An integrated disabler that draws from a cyborg's power cell. This weapon contains a limiter to prevent the cyborg's power cell from overheating."
|
||||
can_charge = 0
|
||||
use_cyborg_cell = 1
|
||||
|
||||
origin_tech = "combat=3"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/disabler)
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler/cyborg
|
||||
name = "cyborg disabler"
|
||||
desc = "An integrated disabler that draws from a cyborg's power cell. This weapon contains a limiter to prevent the cyborg's power cell from overheating."
|
||||
can_charge = 0
|
||||
use_cyborg_cell = 1
|
||||
|
||||
|
||||
@@ -1,86 +1,86 @@
|
||||
/obj/item/weapon/gun/magic
|
||||
name = "staff of nothing"
|
||||
desc = "This staff is boring to watch because even though it came first you've seen everything it can do in other staves for years."
|
||||
icon = 'icons/obj/guns/magic.dmi'
|
||||
icon_state = "staffofnothing"
|
||||
item_state = "staff"
|
||||
fire_sound = 'sound/weapons/emitter.ogg'
|
||||
flags = CONDUCT
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
var/max_charges = 6
|
||||
var/charges = 0
|
||||
var/recharge_rate = 4
|
||||
var/charge_tick = 0
|
||||
var/can_charge = 1
|
||||
var/ammo_type
|
||||
var/no_den_usage
|
||||
origin_tech = null
|
||||
clumsy_check = 0
|
||||
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses magic instead
|
||||
pin = /obj/item/device/firing_pin/magic
|
||||
|
||||
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' //not really a gun and some toys use these inhands
|
||||
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
|
||||
|
||||
/obj/item/weapon/gun/magic/afterattack(atom/target, mob/living/user, flag)
|
||||
if(no_den_usage)
|
||||
var/area/A = get_area(user)
|
||||
if(istype(A, /area/wizard_station))
|
||||
to_chat(user, "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].<span>")
|
||||
return
|
||||
else
|
||||
no_den_usage = 0
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magic/can_shoot()
|
||||
return charges
|
||||
|
||||
/obj/item/weapon/gun/magic/recharge_newshot()
|
||||
if (charges && chambered && !chambered.BB)
|
||||
chambered.newshot()
|
||||
|
||||
/obj/item/weapon/gun/magic/process_chamber()
|
||||
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
|
||||
charges--//... drain a charge
|
||||
recharge_newshot()
|
||||
|
||||
/obj/item/weapon/gun/magic
|
||||
name = "staff of nothing"
|
||||
desc = "This staff is boring to watch because even though it came first you've seen everything it can do in other staves for years."
|
||||
icon = 'icons/obj/guns/magic.dmi'
|
||||
icon_state = "staffofnothing"
|
||||
item_state = "staff"
|
||||
fire_sound = 'sound/weapons/emitter.ogg'
|
||||
flags = CONDUCT
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
var/max_charges = 6
|
||||
var/charges = 0
|
||||
var/recharge_rate = 4
|
||||
var/charge_tick = 0
|
||||
var/can_charge = 1
|
||||
var/ammo_type
|
||||
var/no_den_usage
|
||||
origin_tech = null
|
||||
clumsy_check = 0
|
||||
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses magic instead
|
||||
pin = /obj/item/device/firing_pin/magic
|
||||
|
||||
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' //not really a gun and some toys use these inhands
|
||||
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
|
||||
|
||||
/obj/item/weapon/gun/magic/afterattack(atom/target, mob/living/user, flag)
|
||||
if(no_den_usage)
|
||||
var/area/A = get_area(user)
|
||||
if(istype(A, /area/wizard_station))
|
||||
to_chat(user, "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].<span>")
|
||||
return
|
||||
else
|
||||
no_den_usage = 0
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magic/can_shoot()
|
||||
return charges
|
||||
|
||||
/obj/item/weapon/gun/magic/recharge_newshot()
|
||||
if (charges && chambered && !chambered.BB)
|
||||
chambered.newshot()
|
||||
|
||||
/obj/item/weapon/gun/magic/process_chamber()
|
||||
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
|
||||
charges--//... drain a charge
|
||||
recharge_newshot()
|
||||
|
||||
/obj/item/weapon/gun/magic/Initialize()
|
||||
. = ..()
|
||||
charges = max_charges
|
||||
chambered = new ammo_type(src)
|
||||
if(can_charge)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/Destroy()
|
||||
if(can_charge)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/process()
|
||||
charge_tick++
|
||||
if(charge_tick < recharge_rate || charges >= max_charges)
|
||||
return 0
|
||||
charge_tick = 0
|
||||
charges++
|
||||
if(charges == 1)
|
||||
recharge_newshot()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/magic/update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
to_chat(user, "<span class='warning'>The [name] whizzles quietly.<span>")
|
||||
|
||||
/obj/item/weapon/gun/magic/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is twisting [src] above [user.p_their()] head, releasing a magical blast! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
playsound(loc, fire_sound, 50, 1, -1)
|
||||
return (FIRELOSS)
|
||||
|
||||
/obj/item/weapon/gun/magic/vv_edit_var(var_name, var_value)
|
||||
. = ..()
|
||||
switch (var_name)
|
||||
if ("charges")
|
||||
charges = max_charges
|
||||
chambered = new ammo_type(src)
|
||||
if(can_charge)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/Destroy()
|
||||
if(can_charge)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/process()
|
||||
charge_tick++
|
||||
if(charge_tick < recharge_rate || charges >= max_charges)
|
||||
return 0
|
||||
charge_tick = 0
|
||||
charges++
|
||||
if(charges == 1)
|
||||
recharge_newshot()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/magic/update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
to_chat(user, "<span class='warning'>The [name] whizzles quietly.<span>")
|
||||
|
||||
/obj/item/weapon/gun/magic/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is twisting [src] above [user.p_their()] head, releasing a magical blast! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
playsound(loc, fire_sound, 50, 1, -1)
|
||||
return (FIRELOSS)
|
||||
|
||||
/obj/item/weapon/gun/magic/vv_edit_var(var_name, var_value)
|
||||
. = ..()
|
||||
switch (var_name)
|
||||
if ("charges")
|
||||
recharge_newshot()
|
||||
@@ -4,7 +4,7 @@
|
||||
/obj/item/weapon/gun/magic/staff/change
|
||||
name = "staff of change"
|
||||
desc = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself"
|
||||
fire_sound = 'sound/magic/Staff_Change.ogg'
|
||||
fire_sound = 'sound/magic/staff_change.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/change
|
||||
icon_state = "staffofchange"
|
||||
item_state = "staffofchange"
|
||||
@@ -12,7 +12,7 @@
|
||||
/obj/item/weapon/gun/magic/staff/animate
|
||||
name = "staff of animation"
|
||||
desc = "An artefact that spits bolts of life-force which causes objects which are hit by it to animate and come to life! This magic doesn't affect machines."
|
||||
fire_sound = 'sound/magic/Staff_animation.ogg'
|
||||
fire_sound = 'sound/magic/staff_animation.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/animate
|
||||
icon_state = "staffofanimation"
|
||||
item_state = "staffofanimation"
|
||||
@@ -20,7 +20,7 @@
|
||||
/obj/item/weapon/gun/magic/staff/healing
|
||||
name = "staff of healing"
|
||||
desc = "An artefact that spits bolts of restoring magic which can remove ailments of all kinds and even raise the dead."
|
||||
fire_sound = 'sound/magic/Staff_Healing.ogg'
|
||||
fire_sound = 'sound/magic/staff_healing.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/heal
|
||||
icon_state = "staffofhealing"
|
||||
item_state = "staffofhealing"
|
||||
@@ -31,7 +31,7 @@
|
||||
/obj/item/weapon/gun/magic/staff/chaos
|
||||
name = "staff of chaos"
|
||||
desc = "An artefact that spits bolts of chaotic magic that can potentially do anything."
|
||||
fire_sound = 'sound/magic/Staff_Chaos.ogg'
|
||||
fire_sound = 'sound/magic/staff_chaos.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/chaos
|
||||
icon_state = "staffofchaos"
|
||||
item_state = "staffofchaos"
|
||||
@@ -49,7 +49,7 @@
|
||||
/obj/item/weapon/gun/magic/staff/door
|
||||
name = "staff of door creation"
|
||||
desc = "An artefact that spits bolts of transformative magic that can create doors in walls."
|
||||
fire_sound = 'sound/magic/Staff_Door.ogg'
|
||||
fire_sound = 'sound/magic/staff_door.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/door
|
||||
icon_state = "staffofdoor"
|
||||
item_state = "staffofdoor"
|
||||
@@ -70,7 +70,7 @@
|
||||
/obj/item/weapon/gun/magic/staff/spellblade
|
||||
name = "spellblade"
|
||||
desc = "A deadly combination of laziness and boodlust, this blade allows the user to dismember their enemies without all the hard work of actually swinging the sword."
|
||||
fire_sound = 'sound/magic/Fireball.ogg'
|
||||
fire_sound = 'sound/magic/fireball.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/spellblade
|
||||
icon_state = "spellblade"
|
||||
item_state = "spellblade"
|
||||
@@ -81,7 +81,7 @@
|
||||
sharpness = IS_SHARP
|
||||
max_charges = 4
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/spellblade/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type)
|
||||
/obj/item/weapon/gun/magic/staff/spellblade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
if(attack_type == PROJECTILE_ATTACK)
|
||||
final_block_chance = 0
|
||||
return ..()
|
||||
|
||||
@@ -1,170 +1,170 @@
|
||||
/obj/item/weapon/gun/magic/wand
|
||||
name = "wand of nothing"
|
||||
desc = "It's not just a stick, it's a MAGIC stick!"
|
||||
ammo_type = /obj/item/ammo_casing/magic
|
||||
icon_state = "nothingwand"
|
||||
item_state = "wand"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
can_charge = 0
|
||||
max_charges = 100 //100, 50, 50, 34 (max charge distribution by 25%ths)
|
||||
var/variable_charges = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand
|
||||
name = "wand of nothing"
|
||||
desc = "It's not just a stick, it's a MAGIC stick!"
|
||||
ammo_type = /obj/item/ammo_casing/magic
|
||||
icon_state = "nothingwand"
|
||||
item_state = "wand"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
can_charge = 0
|
||||
max_charges = 100 //100, 50, 50, 34 (max charge distribution by 25%ths)
|
||||
var/variable_charges = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/Initialize()
|
||||
if(prob(75) && variable_charges) //25% chance of listed max charges, 50% chance of 1/2 max charges, 25% chance of 1/3 max charges
|
||||
if(prob(33))
|
||||
max_charges = Ceiling(max_charges / 3)
|
||||
else
|
||||
max_charges = Ceiling(max_charges / 2)
|
||||
if(prob(75) && variable_charges) //25% chance of listed max charges, 50% chance of 1/2 max charges, 25% chance of 1/3 max charges
|
||||
if(prob(33))
|
||||
max_charges = Ceiling(max_charges / 3)
|
||||
else
|
||||
max_charges = Ceiling(max_charges / 2)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "Has [charges] charge\s remaining.")
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/update_icon()
|
||||
icon_state = "[initial(icon_state)][charges ? "" : "-drained"]"
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/attack(atom/target, mob/living/user)
|
||||
if(target == user)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/afterattack(atom/target, mob/living/user)
|
||||
if(!charges)
|
||||
shoot_with_empty_chamber(user)
|
||||
return
|
||||
if(target == user)
|
||||
if(no_den_usage)
|
||||
var/area/A = get_area(user)
|
||||
if(istype(A, /area/wizard_station))
|
||||
to_chat(user, "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].<span>")
|
||||
return
|
||||
else
|
||||
no_den_usage = 0
|
||||
zap_self(user)
|
||||
else
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/proc/zap_self(mob/living/user)
|
||||
user.visible_message("<span class='danger'>[user] zaps [user.p_them()]self with [src].</span>")
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
user.log_message("zapped [user.p_them()]self with a <b>[src]</b>", INDIVIDUAL_ATTACK_LOG)
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF DEATH
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/death
|
||||
name = "wand of death"
|
||||
desc = "This deadly wand overwhelms the victim's body with pure energy, slaying them without fail."
|
||||
fire_sound = 'sound/magic/WandoDeath.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/death
|
||||
icon_state = "deathwand"
|
||||
max_charges = 3 //3, 2, 2, 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/death/zap_self(mob/living/user)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>You irradiate yourself with pure energy! \
|
||||
[pick("Do not pass go. Do not collect 200 zorkmids.","You feel more confident in your spell casting skills.","You Die...","Do you want your possessions identified?")]\
|
||||
</span>")
|
||||
user.adjustOxyLoss(500)
|
||||
charges--
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF HEALING
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/resurrection
|
||||
name = "wand of healing"
|
||||
desc = "This wand uses healing magics to heal and revive. They are rarely utilized within the Wizard Federation for some reason."
|
||||
ammo_type = /obj/item/ammo_casing/magic/heal
|
||||
fire_sound = 'sound/magic/Staff_Healing.ogg'
|
||||
icon_state = "revivewand"
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/resurrection/zap_self(mob/living/user)
|
||||
user.revive(full_heal = 1)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
C.regenerate_limbs()
|
||||
C.regenerate_organs()
|
||||
to_chat(user, "<span class='notice'>You feel great!</span>")
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF POLYMORPH
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/polymorph
|
||||
name = "wand of polymorph"
|
||||
desc = "This wand is attuned to chaos and will radically alter the victim's form."
|
||||
ammo_type = /obj/item/ammo_casing/magic/change
|
||||
icon_state = "polywand"
|
||||
fire_sound = 'sound/magic/Staff_Change.ogg'
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/polymorph/zap_self(mob/living/user)
|
||||
..() //because the user mob ceases to exists by the time wabbajack fully resolves
|
||||
wabbajack(user)
|
||||
charges--
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF TELEPORTATION
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/teleport
|
||||
name = "wand of teleportation"
|
||||
desc = "This wand will wrench targets through space and time to move them somewhere else."
|
||||
ammo_type = /obj/item/ammo_casing/magic/teleport
|
||||
fire_sound = 'sound/magic/Wand_Teleport.ogg'
|
||||
icon_state = "telewand"
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/teleport/zap_self(mob/living/user)
|
||||
if(do_teleport(user, user, 10))
|
||||
var/datum/effect_system/smoke_spread/smoke = new
|
||||
smoke.set_up(3, user.loc)
|
||||
smoke.start()
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF DOOR CREATION
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/door
|
||||
name = "wand of door creation"
|
||||
desc = "This particular wand can create doors in any wall for the unscrupulous wizard who shuns teleportation magics."
|
||||
ammo_type = /obj/item/ammo_casing/magic/door
|
||||
icon_state = "doorwand"
|
||||
fire_sound = 'sound/magic/Staff_Door.ogg'
|
||||
max_charges = 20 //20, 10, 10, 7
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/door/zap_self(mob/living/user)
|
||||
to_chat(user, "<span class='notice'>You feel vaguely more open with your feelings.</span>")
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF FIREBALL
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/fireball
|
||||
name = "wand of fireball"
|
||||
desc = "This wand shoots scorching balls of fire that explode into destructive flames."
|
||||
fire_sound = 'sound/magic/Fireball.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/fireball
|
||||
icon_state = "firewand"
|
||||
max_charges = 8 //8, 4, 4, 3
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/fireball/zap_self(mob/living/user)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "Has [charges] charge\s remaining.")
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/update_icon()
|
||||
icon_state = "[initial(icon_state)][charges ? "" : "-drained"]"
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/attack(atom/target, mob/living/user)
|
||||
if(target == user)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/afterattack(atom/target, mob/living/user)
|
||||
if(!charges)
|
||||
shoot_with_empty_chamber(user)
|
||||
return
|
||||
if(target == user)
|
||||
if(no_den_usage)
|
||||
var/area/A = get_area(user)
|
||||
if(istype(A, /area/wizard_station))
|
||||
to_chat(user, "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].<span>")
|
||||
return
|
||||
else
|
||||
no_den_usage = 0
|
||||
zap_self(user)
|
||||
else
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/proc/zap_self(mob/living/user)
|
||||
user.visible_message("<span class='danger'>[user] zaps [user.p_them()]self with [src].</span>")
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
user.log_message("zapped [user.p_them()]self with a <b>[src]</b>", INDIVIDUAL_ATTACK_LOG)
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF DEATH
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/death
|
||||
name = "wand of death"
|
||||
desc = "This deadly wand overwhelms the victim's body with pure energy, slaying them without fail."
|
||||
fire_sound = 'sound/magic/wandodeath.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/death
|
||||
icon_state = "deathwand"
|
||||
max_charges = 3 //3, 2, 2, 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/death/zap_self(mob/living/user)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>You irradiate yourself with pure energy! \
|
||||
[pick("Do not pass go. Do not collect 200 zorkmids.","You feel more confident in your spell casting skills.","You Die...","Do you want your possessions identified?")]\
|
||||
</span>")
|
||||
user.adjustOxyLoss(500)
|
||||
charges--
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF HEALING
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/resurrection
|
||||
name = "wand of healing"
|
||||
desc = "This wand uses healing magics to heal and revive. They are rarely utilized within the Wizard Federation for some reason."
|
||||
ammo_type = /obj/item/ammo_casing/magic/heal
|
||||
fire_sound = 'sound/magic/staff_healing.ogg'
|
||||
icon_state = "revivewand"
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/resurrection/zap_self(mob/living/user)
|
||||
user.revive(full_heal = 1)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
C.regenerate_limbs()
|
||||
C.regenerate_organs()
|
||||
to_chat(user, "<span class='notice'>You feel great!</span>")
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF POLYMORPH
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/polymorph
|
||||
name = "wand of polymorph"
|
||||
desc = "This wand is attuned to chaos and will radically alter the victim's form."
|
||||
ammo_type = /obj/item/ammo_casing/magic/change
|
||||
icon_state = "polywand"
|
||||
fire_sound = 'sound/magic/staff_change.ogg'
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/polymorph/zap_self(mob/living/user)
|
||||
..() //because the user mob ceases to exists by the time wabbajack fully resolves
|
||||
wabbajack(user)
|
||||
charges--
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF TELEPORTATION
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/teleport
|
||||
name = "wand of teleportation"
|
||||
desc = "This wand will wrench targets through space and time to move them somewhere else."
|
||||
ammo_type = /obj/item/ammo_casing/magic/teleport
|
||||
fire_sound = 'sound/magic/wand_teleport.ogg'
|
||||
icon_state = "telewand"
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/teleport/zap_self(mob/living/user)
|
||||
if(do_teleport(user, user, 10))
|
||||
var/datum/effect_system/smoke_spread/smoke = new
|
||||
smoke.set_up(3, user.loc)
|
||||
smoke.start()
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF DOOR CREATION
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/door
|
||||
name = "wand of door creation"
|
||||
desc = "This particular wand can create doors in any wall for the unscrupulous wizard who shuns teleportation magics."
|
||||
ammo_type = /obj/item/ammo_casing/magic/door
|
||||
icon_state = "doorwand"
|
||||
fire_sound = 'sound/magic/staff_door.ogg'
|
||||
max_charges = 20 //20, 10, 10, 7
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/door/zap_self(mob/living/user)
|
||||
to_chat(user, "<span class='notice'>You feel vaguely more open with your feelings.</span>")
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF FIREBALL
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/fireball
|
||||
name = "wand of fireball"
|
||||
desc = "This wand shoots scorching balls of fire that explode into destructive flames."
|
||||
fire_sound = 'sound/magic/fireball.ogg'
|
||||
ammo_type = /obj/item/ammo_casing/magic/fireball
|
||||
icon_state = "firewand"
|
||||
max_charges = 8 //8, 4, 4, 3
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/fireball/zap_self(mob/living/user)
|
||||
..()
|
||||
explosion(user.loc, -1, 0, 2, 3, 0, flame_range = 2)
|
||||
charges--
|
||||
@@ -0,0 +1,127 @@
|
||||
/obj/item/weapon/gun/blastcannon
|
||||
name = "pipe gun"
|
||||
desc = "A pipe welded onto a gun stock, with a mechanical trigger. The pipe has an opening near the top, and there seems to be a spring loaded wheel in the hole."
|
||||
icon_state = "empty_blastcannon"
|
||||
var/icon_state_loaded = "loaded_blastcannon"
|
||||
item_state = "blastcannon_empty"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
force = 10
|
||||
fire_sound = 'sound/weapons/blastcannon.ogg'
|
||||
needs_permit = FALSE
|
||||
clumsy_check = FALSE
|
||||
randomspread = FALSE
|
||||
|
||||
var/obj/item/device/transfer_valve/bomb
|
||||
var/datum/gas_mixture/air1
|
||||
var/datum/gas_mixture/air2
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/New()
|
||||
if(!pin)
|
||||
pin = new
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/Destroy()
|
||||
if(bomb)
|
||||
qdel(bomb)
|
||||
bomb = null
|
||||
air1 = null
|
||||
air2 = null
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/attack_self(mob/user)
|
||||
if(bomb)
|
||||
bomb.forceMove(user.loc)
|
||||
user.put_in_hands(bomb)
|
||||
user.visible_message("<span class='warning'>[user] detaches the [bomb] from the [src]</span>")
|
||||
bomb = null
|
||||
update_icon()
|
||||
. = ..(user)
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/update_icon()
|
||||
if(bomb)
|
||||
icon_state = icon_state_loaded
|
||||
name = "blast cannon"
|
||||
desc = "A makeshift device used to concentrate a bomb's blast energy to a narrow wave."
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/attackby(obj/O, mob/user)
|
||||
if(istype(O, /obj/item/device/transfer_valve))
|
||||
var/obj/item/device/transfer_valve/T = O
|
||||
if(!T.tank_one || !T.tank_two)
|
||||
to_chat(user, "<span class='warning'>What good would an incomplete bomb do?</span>")
|
||||
return FALSE
|
||||
if(!user.drop_item(O))
|
||||
to_chat(user, "<span class='warning'>The [O] seems to be stuck to your hand!</span>")
|
||||
return FALSE
|
||||
user.visible_message("<span class='warning'>[user] attaches the [O] to the [src]!</span>")
|
||||
bomb = O
|
||||
O.loc = src
|
||||
update_icon()
|
||||
return TRUE
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/proc/calculate_bomb()
|
||||
if(!istype(bomb)||!istype(bomb.tank_one)||!istype(bomb.tank_two))
|
||||
return 0
|
||||
air1 = bomb.tank_one.air_contents
|
||||
air2 = bomb.tank_two.air_contents
|
||||
var/datum/gas_mixture/temp
|
||||
temp.volume = air1.volume + air2.volume
|
||||
temp.merge(air1)
|
||||
temp.merge(air2)
|
||||
for(var/i in 1 to 6)
|
||||
temp.react()
|
||||
var/pressure = temp.return_pressure()
|
||||
qdel(temp)
|
||||
if(pressure < TANK_FRAGMENT_PRESSURE)
|
||||
return 0
|
||||
return (pressure/TANK_FRAGMENT_SCALE)
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/afterattack(atom/target, mob/user, flag, params)
|
||||
if((!bomb) || (target == user) || (target.loc == user) || (!target) || (target.loc == user.loc) || (target.loc in range(user, 2)) || (target in range(user, 2)))
|
||||
return ..()
|
||||
var/power = calculate_bomb()
|
||||
qdel(bomb)
|
||||
update_icon()
|
||||
var/heavy = power * 0.2
|
||||
var/medium = power * 0.5
|
||||
var/light = power
|
||||
user.visible_message("<span class='danger'>[user] opens \the [bomb] on \his [src.name] and fires a blast wave at \the [target]!</span>","<span class='danger'>You open \the [bomb] on your [src.name] and fire a blast wave at \the [target]!</span>")
|
||||
playsound(user, "explosion", 100, 1)
|
||||
var/turf/starting = get_turf(user)
|
||||
var/area/A = get_area(user)
|
||||
var/log_str = "Blast wave fired at [ADMIN_COORDJMP(starting)] ([A.name]) by [user.name]([user.ckey]) with power [heavy]/[medium]/[light]."
|
||||
message_admins(log_str)
|
||||
log_game(log_str)
|
||||
|
||||
/obj/item/projectile/blastwave
|
||||
name = "blast wave"
|
||||
icon_state = "blastwave"
|
||||
damage = 0
|
||||
nodamage = FALSE
|
||||
forcedodge = TRUE
|
||||
var/heavyr = 0
|
||||
var/mediumr = 0
|
||||
var/lightr = 0
|
||||
range = 150
|
||||
|
||||
/obj/item/projectile/blastwave/Range()
|
||||
..()
|
||||
if(heavyr)
|
||||
loc.ex_act(1)
|
||||
else if(mediumr)
|
||||
loc.ex_act(2)
|
||||
else if(lightr)
|
||||
loc.ex_act(3)
|
||||
else
|
||||
qdel(src)
|
||||
heavyr--
|
||||
mediumr--
|
||||
lightr--
|
||||
|
||||
/obj/item/projectile/blastwave/ex_act()
|
||||
return
|
||||
Reference in New Issue
Block a user