sync
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
desc = "A bullet casing."
|
||||
icon = 'icons/obj/ammo.dmi'
|
||||
icon_state = "s-casing"
|
||||
flags = CONDUCT
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = SLOT_BELT
|
||||
throwforce = 0
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
|
||||
/obj/item/ammo_casing/shotgun/dart/New()
|
||||
..()
|
||||
container_type |= OPENCONTAINER
|
||||
container_type |= OPENCONTAINER_1
|
||||
create_reagents(30)
|
||||
reagents.set_reacting(FALSE)
|
||||
|
||||
|
||||
@@ -78,13 +78,13 @@
|
||||
|
||||
/obj/item/ammo_casing/caseless/foam_dart/attackby(obj/item/A, mob/user, params)
|
||||
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
|
||||
if (istype(A, /obj/item/weapon/screwdriver) && !modified)
|
||||
if (istype(A, /obj/item/screwdriver) && !modified)
|
||||
modified = 1
|
||||
FD.modified = 1
|
||||
FD.damage_type = BRUTE
|
||||
to_chat(user, "<span class='notice'>You pop the safety cap off [src].</span>")
|
||||
update_icon()
|
||||
else if (istype(A, /obj/item/weapon/pen))
|
||||
else if (istype(A, /obj/item/pen))
|
||||
if(modified)
|
||||
if(!FD.pen)
|
||||
if(!user.transferItemToLoc(A, FD))
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
projectile_type = /obj/item/projectile/beam/wormhole
|
||||
e_cost = 0
|
||||
fire_sound = 'sound/weapons/pulse3.ogg'
|
||||
var/obj/item/weapon/gun/energy/wormhole_projector/gun = null
|
||||
var/obj/item/gun/energy/wormhole_projector/gun = null
|
||||
select_name = "blue"
|
||||
|
||||
/obj/item/ammo_casing/energy/wormhole/orange
|
||||
@@ -211,9 +211,9 @@
|
||||
fire_sound = 'sound/weapons/wave.ogg'
|
||||
select_name = "repulse"
|
||||
delay = 50
|
||||
var/obj/item/weapon/gun/energy/gravity_gun/gun = null
|
||||
var/obj/item/gun/energy/gravity_gun/gun = null
|
||||
|
||||
/obj/item/ammo_casing/energy/gravityrepulse/New(var/obj/item/weapon/gun/energy/gravity_gun/G)
|
||||
/obj/item/ammo_casing/energy/gravityrepulse/New(var/obj/item/gun/energy/gravity_gun/G)
|
||||
gun = G
|
||||
|
||||
/obj/item/ammo_casing/energy/gravityattract
|
||||
@@ -222,10 +222,10 @@
|
||||
fire_sound = 'sound/weapons/wave.ogg'
|
||||
select_name = "attract"
|
||||
delay = 50
|
||||
var/obj/item/weapon/gun/energy/gravity_gun/gun = null
|
||||
var/obj/item/gun/energy/gravity_gun/gun = null
|
||||
|
||||
|
||||
/obj/item/ammo_casing/energy/gravityattract/New(var/obj/item/weapon/gun/energy/gravity_gun/G)
|
||||
/obj/item/ammo_casing/energy/gravityattract/New(var/obj/item/gun/energy/gravity_gun/G)
|
||||
gun = G
|
||||
|
||||
/obj/item/ammo_casing/energy/gravitychaos
|
||||
@@ -234,9 +234,9 @@
|
||||
fire_sound = 'sound/weapons/wave.ogg'
|
||||
select_name = "chaos"
|
||||
delay = 50
|
||||
var/obj/item/weapon/gun/energy/gravity_gun/gun = null
|
||||
var/obj/item/gun/energy/gravity_gun/gun = null
|
||||
|
||||
/obj/item/ammo_casing/energy/gravitychaos/New(var/obj/item/weapon/gun/energy/gravity_gun/G)
|
||||
/obj/item/ammo_casing/energy/gravitychaos/New(var/obj/item/gun/energy/gravity_gun/G)
|
||||
gun = G
|
||||
|
||||
/obj/item/ammo_casing/energy/plasma
|
||||
|
||||
@@ -49,12 +49,12 @@
|
||||
/obj/item/ammo_casing/syringegun/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
|
||||
if(!BB)
|
||||
return
|
||||
if(istype(loc, /obj/item/weapon/gun/syringe))
|
||||
var/obj/item/weapon/gun/syringe/SG = loc
|
||||
if(istype(loc, /obj/item/gun/syringe))
|
||||
var/obj/item/gun/syringe/SG = loc
|
||||
if(!SG.syringes.len)
|
||||
return
|
||||
|
||||
var/obj/item/weapon/reagent_containers/syringe/S = SG.syringes[1]
|
||||
var/obj/item/reagent_containers/syringe/S = SG.syringes[1]
|
||||
|
||||
S.reagents.trans_to(BB, S.reagents.total_volume)
|
||||
BB.name = S.name
|
||||
@@ -73,12 +73,12 @@
|
||||
/obj/item/ammo_casing/dnainjector/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
|
||||
if(!BB)
|
||||
return
|
||||
if(istype(loc, /obj/item/weapon/gun/syringe/dna))
|
||||
var/obj/item/weapon/gun/syringe/dna/SG = loc
|
||||
if(istype(loc, /obj/item/gun/syringe/dna))
|
||||
var/obj/item/gun/syringe/dna/SG = loc
|
||||
if(!SG.syringes.len)
|
||||
return
|
||||
|
||||
var/obj/item/weapon/dnainjector/S = popleft(SG.syringes)
|
||||
var/obj/item/dnainjector/S = popleft(SG.syringes)
|
||||
var/obj/item/projectile/bullet/dnainjector/D = BB
|
||||
S.forceMove(D)
|
||||
D.injector = S
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
desc = "A box of ammo."
|
||||
icon_state = "357"
|
||||
icon = 'icons/obj/ammo.dmi'
|
||||
flags = CONDUCT
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = SLOT_BELT
|
||||
item_state = "syringe_kit"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
materials = list(MAT_METAL=30000)
|
||||
throwforce = 2
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
#define DUALWIELD_PENALTY_EXTRA_MULTIPLIER 1.4
|
||||
|
||||
/obj/item/weapon/gun
|
||||
/obj/item/gun
|
||||
name = "gun"
|
||||
desc = "It's a gun. It's pretty terrible, though."
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
icon_state = "detective"
|
||||
item_state = "gun"
|
||||
flags = CONDUCT
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = SLOT_BELT
|
||||
materials = list(MAT_METAL=2000)
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
@@ -27,7 +27,7 @@
|
||||
var/recoil = 0 //boom boom shake the room
|
||||
var/clumsy_check = 1
|
||||
var/obj/item/ammo_casing/chambered = null
|
||||
var/trigger_guard = TRIGGER_GUARD_NORMAL //trigger guard on the weapon, hulks can't fire them with their big meaty fingers
|
||||
trigger_guard = TRIGGER_GUARD_NORMAL //trigger guard on the weapon, hulks can't fire them with their big meaty fingers
|
||||
var/sawn_desc = null //description change if weapon is sawn-off
|
||||
var/sawn_state = SAWN_INTACT
|
||||
var/burst_size = 1 //how large a burst is
|
||||
@@ -38,14 +38,14 @@
|
||||
var/spread = 0 //Spread induced by the gun itself.
|
||||
var/randomspread = 1 //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.
|
||||
|
||||
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
|
||||
lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi'
|
||||
|
||||
var/obj/item/device/firing_pin/pin = /obj/item/device/firing_pin //standard firing pin for most guns
|
||||
|
||||
var/obj/item/device/flashlight/gun_light
|
||||
var/can_flashlight = 0
|
||||
var/obj/item/weapon/kitchen/knife/bayonet
|
||||
var/obj/item/kitchen/knife/bayonet
|
||||
var/can_bayonet = FALSE
|
||||
var/datum/action/item_action/toggle_gunlight/alight
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
var/zoom_out_amt = 0
|
||||
var/datum/action/toggle_scope_zoom/azoom
|
||||
|
||||
/obj/item/weapon/gun/Initialize()
|
||||
/obj/item/gun/Initialize()
|
||||
. = ..()
|
||||
if(pin)
|
||||
pin = new pin(src)
|
||||
@@ -74,9 +74,9 @@
|
||||
build_zooming()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/CheckParts(list/parts_list)
|
||||
/obj/item/gun/CheckParts(list/parts_list)
|
||||
..()
|
||||
var/obj/item/weapon/gun/G = locate(/obj/item/weapon/gun) in contents
|
||||
var/obj/item/gun/G = locate(/obj/item/gun) in contents
|
||||
if(G)
|
||||
G.loc = loc
|
||||
qdel(G.pin)
|
||||
@@ -84,35 +84,35 @@
|
||||
visible_message("[G] can now fit a new pin, but the old one was destroyed in the process.", null, null, 3)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/gun/examine(mob/user)
|
||||
/obj/item/gun/examine(mob/user)
|
||||
..()
|
||||
if(pin)
|
||||
to_chat(user, "It has [pin] installed.")
|
||||
else
|
||||
to_chat(user, "It doesn't have a firing pin installed, and won't fire.")
|
||||
|
||||
/obj/item/weapon/gun/equipped(mob/living/user, slot)
|
||||
/obj/item/gun/equipped(mob/living/user, slot)
|
||||
. = ..()
|
||||
if(zoomable && user.get_active_held_item() != src)
|
||||
zoom(user, FALSE) //we can only stay zoomed in if it's in our hands
|
||||
|
||||
//called after the gun has successfully fired its chambered ammo.
|
||||
/obj/item/weapon/gun/proc/process_chamber()
|
||||
/obj/item/gun/proc/process_chamber()
|
||||
return 0
|
||||
|
||||
|
||||
//check if there's enough ammo/energy/whatever to shoot one time
|
||||
//i.e if clicking would make it shoot
|
||||
/obj/item/weapon/gun/proc/can_shoot()
|
||||
/obj/item/gun/proc/can_shoot()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
/obj/item/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
to_chat(user, "<span class='danger'>*click*</span>")
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
|
||||
/obj/item/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
|
||||
if(recoil)
|
||||
shake_camera(user, recoil + 1, recoil)
|
||||
|
||||
@@ -126,12 +126,12 @@
|
||||
else
|
||||
user.visible_message("<span class='danger'>[user] fires [src]!</span>", null, null, COMBAT_MESSAGE_RANGE)
|
||||
|
||||
/obj/item/weapon/gun/emp_act(severity)
|
||||
/obj/item/gun/emp_act(severity)
|
||||
for(var/obj/O in contents)
|
||||
O.emp_act(severity)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/afterattack(atom/target, mob/living/user, flag, params)
|
||||
/obj/item/gun/afterattack(atom/target, mob/living/user, flag, params)
|
||||
if(firing_burst)
|
||||
return
|
||||
if(flag) //It's adjacent, is the user, or is on the user's person
|
||||
@@ -176,26 +176,24 @@
|
||||
var/loop_counter = 0
|
||||
if(ishuman(user) && user.a_intent == INTENT_HARM)
|
||||
var/mob/living/carbon/human/H = user
|
||||
for(var/obj/item/weapon/gun/G in H.held_items)
|
||||
for(var/obj/item/gun/G in H.held_items)
|
||||
if(G == src || G.weapon_weight >= WEAPON_MEDIUM)
|
||||
continue
|
||||
else if(G.can_trigger_gun(user))
|
||||
bonus_spread += 24 * G.weapon_weight
|
||||
loop_counter++
|
||||
addtimer(CALLBACK(G, /obj/item/weapon/gun.proc/process_fire, target, user, 1, params, null, bonus_spread), loop_counter)
|
||||
addtimer(CALLBACK(G, /obj/item/gun.proc/process_fire, target, user, 1, params, null, bonus_spread), loop_counter)
|
||||
|
||||
process_fire(target,user,1,params, null, bonus_spread)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/can_trigger_gun(var/mob/living/user)
|
||||
/obj/item/gun/can_trigger_gun(mob/living/user)
|
||||
. = ..()
|
||||
if(!handle_pins(user))
|
||||
return FALSE
|
||||
|
||||
if(!handle_pins(user) || !user.can_use_guns(src))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/proc/handle_pins(mob/living/user)
|
||||
/obj/item/gun/proc/handle_pins(mob/living/user)
|
||||
if(pin)
|
||||
if(pin.pin_auth(user) || pin.emagged)
|
||||
return 1
|
||||
@@ -206,10 +204,10 @@
|
||||
to_chat(user, "<span class='warning'>[src]'s trigger is locked. This weapon doesn't have a firing pin installed!</span>")
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/gun/proc/recharge_newshot()
|
||||
/obj/item/gun/proc/recharge_newshot()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/proc/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override, bonus_spread = 0)
|
||||
/obj/item/gun/proc/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override, bonus_spread = 0)
|
||||
add_fingerprint(user)
|
||||
|
||||
if(semicd)
|
||||
@@ -276,7 +274,7 @@
|
||||
SSblackbox.add_details("gun_fired","[src.type]")
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/update_icon()
|
||||
/obj/item/gun/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
if(gun_light && can_flashlight)
|
||||
@@ -296,7 +294,7 @@
|
||||
knife_overlay.pixel_y = knife_y_offset
|
||||
add_overlay(knife_overlay)
|
||||
|
||||
/obj/item/weapon/gun/attack(mob/M as mob, mob/user)
|
||||
/obj/item/gun/attack(mob/M as mob, mob/user)
|
||||
if(user.a_intent == INTENT_HARM) //Flogging
|
||||
if(bayonet)
|
||||
M.attackby(bayonet, user)
|
||||
@@ -305,14 +303,14 @@
|
||||
return ..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/attack_obj(obj/O, mob/user)
|
||||
/obj/item/gun/attack_obj(obj/O, mob/user)
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
if(bayonet)
|
||||
O.attackby(bayonet, user)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/attackby(obj/item/I, mob/user, params)
|
||||
/obj/item/gun/attackby(obj/item/I, mob/user, params)
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
return ..()
|
||||
else if(istype(I, /obj/item/device/flashlight/seclite))
|
||||
@@ -331,17 +329,17 @@
|
||||
alight = new /datum/action/item_action/toggle_gunlight(src)
|
||||
if(loc == user)
|
||||
alight.Grant(user)
|
||||
else if(istype(I, /obj/item/weapon/kitchen/knife))
|
||||
else if(istype(I, /obj/item/kitchen/knife))
|
||||
if(!can_bayonet)
|
||||
return ..()
|
||||
var/obj/item/weapon/kitchen/knife/K = I
|
||||
var/obj/item/kitchen/knife/K = I
|
||||
if(!bayonet)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You attach \the [K] to the front of \the [src].</span>")
|
||||
bayonet = K
|
||||
update_icon()
|
||||
else if(istype(I, /obj/item/weapon/screwdriver))
|
||||
else if(istype(I, /obj/item/screwdriver))
|
||||
if(gun_light)
|
||||
var/obj/item/device/flashlight/seclite/S = gun_light
|
||||
to_chat(user, "<span class='notice'>You unscrew the seclite from \the [src].</span>")
|
||||
@@ -352,14 +350,14 @@
|
||||
update_icon()
|
||||
QDEL_NULL(alight)
|
||||
if(bayonet)
|
||||
var/obj/item/weapon/kitchen/knife/K = bayonet
|
||||
var/obj/item/kitchen/knife/K = bayonet
|
||||
K.forceMove(get_turf(user))
|
||||
bayonet = null
|
||||
update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/proc/toggle_gunlight()
|
||||
/obj/item/gun/proc/toggle_gunlight()
|
||||
if(!gun_light)
|
||||
return
|
||||
|
||||
@@ -371,7 +369,7 @@
|
||||
update_gunlight(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/proc/update_gunlight(mob/user = null)
|
||||
/obj/item/gun/proc/update_gunlight(mob/user = null)
|
||||
if(gun_light)
|
||||
if(gun_light.on)
|
||||
set_light(gun_light.brightness_on)
|
||||
@@ -385,14 +383,14 @@
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/pickup(mob/user)
|
||||
/obj/item/gun/pickup(mob/user)
|
||||
..()
|
||||
if(azoom)
|
||||
azoom.Grant(user)
|
||||
if(alight)
|
||||
alight.Grant(user)
|
||||
|
||||
/obj/item/weapon/gun/dropped(mob/user)
|
||||
/obj/item/gun/dropped(mob/user)
|
||||
..()
|
||||
zoom(user,FALSE)
|
||||
if(azoom)
|
||||
@@ -400,7 +398,7 @@
|
||||
if(alight)
|
||||
alight.Remove(user)
|
||||
|
||||
/obj/item/weapon/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params)
|
||||
/obj/item/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params)
|
||||
if(!ishuman(user) || !ishuman(target))
|
||||
return
|
||||
|
||||
@@ -434,7 +432,7 @@
|
||||
|
||||
process_fire(target, user, 1, params)
|
||||
|
||||
/obj/item/weapon/gun/proc/unlock() //used in summon guns and as a convience for admins
|
||||
/obj/item/gun/proc/unlock() //used in summon guns and as a convience for admins
|
||||
if(pin)
|
||||
qdel(pin)
|
||||
pin = new /obj/item/device/firing_pin
|
||||
@@ -446,8 +444,9 @@
|
||||
/datum/action/toggle_scope_zoom
|
||||
name = "Toggle Scope"
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_LYING
|
||||
icon_icon = 'icons/mob/actions/actions_items.dmi'
|
||||
button_icon_state = "sniper_zoom"
|
||||
var/obj/item/weapon/gun/gun = null
|
||||
var/obj/item/gun/gun = null
|
||||
|
||||
/datum/action/toggle_scope_zoom/Trigger()
|
||||
gun.zoom(owner)
|
||||
@@ -462,7 +461,7 @@
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/zoom(mob/living/user, forced_zoom)
|
||||
/obj/item/gun/proc/zoom(mob/living/user, forced_zoom)
|
||||
if(!user || !user.client)
|
||||
return
|
||||
|
||||
@@ -487,17 +486,17 @@
|
||||
if(WEST)
|
||||
_x = -zoom_amt
|
||||
|
||||
user.client.view = zoom_out_amt
|
||||
user.client.change_view(zoom_out_amt)
|
||||
user.client.pixel_x = world.icon_size*_x
|
||||
user.client.pixel_y = world.icon_size*_y
|
||||
else
|
||||
user.client.view = world.view
|
||||
user.client.change_view(world.view)
|
||||
user.client.pixel_x = 0
|
||||
user.client.pixel_y = 0
|
||||
return zoomed
|
||||
|
||||
//Proc, so that gun accessories/scopes/etc. can easily add zooming.
|
||||
/obj/item/weapon/gun/proc/build_zooming()
|
||||
/obj/item/gun/proc/build_zooming()
|
||||
if(azoom)
|
||||
return
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/ballistic
|
||||
/obj/item/gun/ballistic
|
||||
desc = "Now comes in flavors like GUN. Uses 10mm ammo, for some reason"
|
||||
name = "projectile gun"
|
||||
icon_state = "pistol"
|
||||
@@ -9,7 +9,7 @@
|
||||
var/obj/item/ammo_box/magazine/magazine
|
||||
var/casing_ejector = 1 //whether the gun ejects the chambered casing
|
||||
|
||||
/obj/item/weapon/gun/ballistic/Initialize()
|
||||
/obj/item/gun/ballistic/Initialize()
|
||||
. = ..()
|
||||
if(!spawnwithmagazine)
|
||||
update_icon()
|
||||
@@ -19,7 +19,7 @@
|
||||
chamber_round()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/update_icon()
|
||||
/obj/item/gun/ballistic/update_icon()
|
||||
..()
|
||||
if(current_skin)
|
||||
icon_state = "[unique_reskin[current_skin]][suppressed ? "-suppressed" : ""][sawn_state ? "-sawn" : ""]"
|
||||
@@ -27,7 +27,7 @@
|
||||
icon_state = "[initial(icon_state)][suppressed ? "-suppressed" : ""][sawn_state ? "-sawn" : ""]"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/process_chamber(empty_chamber = 1)
|
||||
/obj/item/gun/ballistic/process_chamber(empty_chamber = 1)
|
||||
var/obj/item/ammo_casing/AC = chambered //Find chambered round
|
||||
if(istype(AC)) //there's a chambered round
|
||||
if(casing_ejector)
|
||||
@@ -39,19 +39,19 @@
|
||||
chamber_round()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/proc/chamber_round()
|
||||
/obj/item/gun/ballistic/proc/chamber_round()
|
||||
if (chambered || !magazine)
|
||||
return
|
||||
else if (magazine.ammo_count())
|
||||
chambered = magazine.get_round()
|
||||
chambered.forceMove(src)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/can_shoot()
|
||||
/obj/item/gun/ballistic/can_shoot()
|
||||
if(!magazine || !magazine.ammo_count(0))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/ballistic/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if (istype(A, /obj/item/ammo_box/magazine))
|
||||
var/obj/item/ammo_box/magazine/AM = A
|
||||
@@ -68,8 +68,8 @@
|
||||
return
|
||||
else if (magazine)
|
||||
to_chat(user, "<span class='notice'>There's already a magazine in \the [src].</span>")
|
||||
if(istype(A, /obj/item/weapon/suppressor))
|
||||
var/obj/item/weapon/suppressor/S = A
|
||||
if(istype(A, /obj/item/suppressor))
|
||||
var/obj/item/suppressor/S = A
|
||||
if(can_suppress)
|
||||
if(!suppressed)
|
||||
if(!user.transferItemToLoc(A, src))
|
||||
@@ -90,10 +90,10 @@
|
||||
return
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/attack_hand(mob/user)
|
||||
/obj/item/gun/ballistic/attack_hand(mob/user)
|
||||
if(loc == user)
|
||||
if(suppressed && can_unsuppress)
|
||||
var/obj/item/weapon/suppressor/S = suppressed
|
||||
var/obj/item/suppressor/S = suppressed
|
||||
if(!user.is_holding(src))
|
||||
..()
|
||||
return
|
||||
@@ -106,7 +106,7 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/attack_self(mob/living/user)
|
||||
/obj/item/gun/ballistic/attack_self(mob/living/user)
|
||||
var/obj/item/ammo_casing/AC = chambered //Find chambered round
|
||||
if(magazine)
|
||||
magazine.loc = get_turf(src.loc)
|
||||
@@ -125,11 +125,11 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/examine(mob/user)
|
||||
/obj/item/gun/ballistic/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "Has [get_ammo()] round\s remaining.")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/proc/get_ammo(countchambered = 1)
|
||||
/obj/item/gun/ballistic/proc/get_ammo(countchambered = 1)
|
||||
var/boolets = 0 //mature var names for mature people
|
||||
if (chambered && countchambered)
|
||||
boolets++
|
||||
@@ -137,7 +137,7 @@
|
||||
boolets += magazine.ammo_count()
|
||||
return boolets
|
||||
|
||||
/obj/item/weapon/gun/ballistic/suicide_act(mob/user)
|
||||
/obj/item/gun/ballistic/suicide_act(mob/user)
|
||||
if (chambered && chambered.BB && can_trigger_gun(user) && !chambered.BB.nodamage)
|
||||
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)
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/proc/sawoff(mob/user)
|
||||
/obj/item/gun/ballistic/proc/sawoff(mob/user)
|
||||
if(sawn_state == SAWN_OFF)
|
||||
to_chat(user, "<span class='warning'>\The [src] is already shortened!</span>")
|
||||
return
|
||||
@@ -182,7 +182,7 @@
|
||||
return 1
|
||||
|
||||
// Sawing guns related proc
|
||||
/obj/item/weapon/gun/ballistic/proc/blow_up(mob/user)
|
||||
/obj/item/gun/ballistic/proc/blow_up(mob/user)
|
||||
. = 0
|
||||
for(var/obj/item/ammo_casing/AC in magazine.stored_ammo)
|
||||
if(AC.BB)
|
||||
@@ -190,7 +190,7 @@
|
||||
. = 1
|
||||
|
||||
|
||||
/obj/item/weapon/suppressor
|
||||
/obj/item/suppressor
|
||||
name = "suppressor"
|
||||
desc = "A universal syndicate small-arms suppressor for maximum espionage."
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
@@ -200,7 +200,7 @@
|
||||
var/initial_w_class = null
|
||||
|
||||
|
||||
/obj/item/weapon/suppressor/specialoffer
|
||||
/obj/item/suppressor/specialoffer
|
||||
name = "cheap suppressor"
|
||||
desc = "A foreign knock-off suppressor, it feels flimsy, cheap, and brittle. Still fits all weapons."
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/ballistic/automatic
|
||||
/obj/item/gun/ballistic/automatic
|
||||
origin_tech = "combat=4;materials=2"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
var/alarmed = 0
|
||||
@@ -8,17 +8,17 @@
|
||||
fire_delay = 2
|
||||
actions_types = list(/datum/action/item_action/toggle_firemode)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/proto
|
||||
/obj/item/gun/ballistic/automatic/proto
|
||||
name = "\improper NanoTrasen Saber SMG"
|
||||
desc = "A prototype three-round burst 9mm submachine gun, designated 'SABR'. Has a threaded barrel for suppressors."
|
||||
icon_state = "saber"
|
||||
mag_type = /obj/item/ammo_box/magazine/smgm9mm
|
||||
pin = null
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/proto/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/proto/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
if(!select)
|
||||
@@ -27,7 +27,7 @@
|
||||
add_overlay("[initial(icon_state)]burst")
|
||||
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/automatic/attackby(obj/item/A, mob/user, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -53,10 +53,10 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You cannot seem to get \the [src] out of your hands!</span>")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/ui_action_click()
|
||||
/obj/item/gun/ballistic/automatic/ui_action_click()
|
||||
burst_select()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/proc/burst_select()
|
||||
/obj/item/gun/ballistic/automatic/proc/burst_select()
|
||||
var/mob/living/carbon/human/user = usr
|
||||
select = !select
|
||||
if(!select)
|
||||
@@ -74,17 +74,17 @@
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/can_shoot()
|
||||
/obj/item/gun/ballistic/automatic/can_shoot()
|
||||
return get_ammo()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/proc/empty_alarm()
|
||||
/obj/item/gun/ballistic/automatic/proc/empty_alarm()
|
||||
if(!chambered && !get_ammo() && !alarmed)
|
||||
playsound(src.loc, 'sound/weapons/smg_empty_alarm.ogg', 40, 1)
|
||||
update_icon()
|
||||
alarmed = 1
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/c20r
|
||||
/obj/item/gun/ballistic/automatic/c20r
|
||||
name = "\improper C-20r SMG"
|
||||
desc = "A bullpup two-round burst .45 SMG, designated 'C-20r'. Has a 'Scarborough Arms - Per falcis, per pravitas' buttstamp."
|
||||
icon_state = "c20r"
|
||||
@@ -96,23 +96,23 @@
|
||||
burst_size = 2
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/c20r/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/c20r/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/c20r/Initialize()
|
||||
/obj/item/gun/ballistic/automatic/c20r/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/c20r/afterattack()
|
||||
/obj/item/gun/ballistic/automatic/c20r/afterattack()
|
||||
..()
|
||||
empty_alarm()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/c20r/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/c20r/update_icon()
|
||||
..()
|
||||
icon_state = "c20r[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/wt550
|
||||
/obj/item/gun/ballistic/automatic/wt550
|
||||
name = "security auto rifle"
|
||||
desc = "An outdated personal defence weapon. Uses 4.6x30mm rounds and is designated the WT-550 Automatic Rifle."
|
||||
icon_state = "wt550"
|
||||
@@ -123,11 +123,11 @@
|
||||
burst_size = 0
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/wt550/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/wt550/update_icon()
|
||||
..()
|
||||
icon_state = "wt550[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/mini_uzi
|
||||
/obj/item/gun/ballistic/automatic/mini_uzi
|
||||
name = "\improper Type U3 Uzi"
|
||||
desc = "A lightweight, burst-fire submachine gun, for when you really want someone dead. Uses 9mm rounds."
|
||||
icon_state = "mini-uzi"
|
||||
@@ -135,7 +135,7 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/uzim9mm
|
||||
burst_size = 2
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/m90
|
||||
/obj/item/gun/ballistic/automatic/m90
|
||||
name = "\improper M-90gl Carbine"
|
||||
desc = "A three-round burst 5.56 toploading carbine, designated 'M-90gl'. Has an attached underbarrel grenade launcher which can be toggled on and off."
|
||||
icon_state = "m90"
|
||||
@@ -144,38 +144,38 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/m556
|
||||
fire_sound = 'sound/weapons/gunshot_smg.ogg'
|
||||
can_suppress = 0
|
||||
var/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/underbarrel
|
||||
var/obj/item/gun/ballistic/revolver/grenadelauncher/underbarrel
|
||||
burst_size = 3
|
||||
fire_delay = 2
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/m90/Initialize()
|
||||
/obj/item/gun/ballistic/automatic/m90/Initialize()
|
||||
. = ..()
|
||||
underbarrel = new /obj/item/weapon/gun/ballistic/revolver/grenadelauncher(src)
|
||||
underbarrel = new /obj/item/gun/ballistic/revolver/grenadelauncher(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/m90/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/m90/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/m90/unrestricted/Initialize()
|
||||
/obj/item/gun/ballistic/automatic/m90/unrestricted/Initialize()
|
||||
. = ..()
|
||||
underbarrel = new /obj/item/weapon/gun/ballistic/revolver/grenadelauncher/unrestricted(src)
|
||||
underbarrel = new /obj/item/gun/ballistic/revolver/grenadelauncher/unrestricted(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/m90/afterattack(atom/target, mob/living/user, flag, params)
|
||||
/obj/item/gun/ballistic/automatic/m90/afterattack(atom/target, mob/living/user, flag, params)
|
||||
if(select == 2)
|
||||
underbarrel.afterattack(target, user, flag, params)
|
||||
else
|
||||
..()
|
||||
return
|
||||
/obj/item/weapon/gun/ballistic/automatic/m90/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/automatic/m90/attackby(obj/item/A, mob/user, params)
|
||||
if(istype(A, /obj/item/ammo_casing))
|
||||
if(istype(A, underbarrel.magazine.ammo_type))
|
||||
underbarrel.attack_self()
|
||||
underbarrel.attackby(A, user, params)
|
||||
else
|
||||
..()
|
||||
/obj/item/weapon/gun/ballistic/automatic/m90/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/m90/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
switch(select)
|
||||
@@ -187,7 +187,7 @@
|
||||
add_overlay("[initial(icon_state)]gren")
|
||||
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
|
||||
return
|
||||
/obj/item/weapon/gun/ballistic/automatic/m90/burst_select()
|
||||
/obj/item/gun/ballistic/automatic/m90/burst_select()
|
||||
var/mob/living/carbon/human/user = usr
|
||||
switch(select)
|
||||
if(0)
|
||||
@@ -207,7 +207,7 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/tommygun
|
||||
/obj/item/gun/ballistic/automatic/tommygun
|
||||
name = "\improper Thompson SMG"
|
||||
desc = "Based on the classic 'Chicago Typewriter'."
|
||||
icon_state = "tommygun"
|
||||
@@ -221,7 +221,7 @@
|
||||
burst_size = 4
|
||||
fire_delay = 1
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/ar
|
||||
/obj/item/gun/ballistic/automatic/ar
|
||||
name = "\improper NT-ARG 'Boarder'"
|
||||
desc = "A robust assault rile used by Nanotrasen fighting forces."
|
||||
icon_state = "arg"
|
||||
@@ -236,7 +236,7 @@
|
||||
|
||||
// Bulldog shotgun //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog
|
||||
name = "\improper Bulldog Shotgun"
|
||||
desc = "A semi-auto, mag-fed shotgun for combat in narrow corridors, nicknamed 'Bulldog' by boarding parties. Compatible only with specialized 8-round drum magazines."
|
||||
icon_state = "bulldog"
|
||||
@@ -252,20 +252,20 @@
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/Initialize()
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/update_icon()
|
||||
cut_overlays()
|
||||
if(magazine)
|
||||
add_overlay("[magazine.icon_state]")
|
||||
icon_state = "bulldog[chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/afterattack()
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/afterattack()
|
||||
..()
|
||||
empty_alarm()
|
||||
return
|
||||
@@ -274,7 +274,7 @@
|
||||
|
||||
// L6 SAW //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/l6_saw
|
||||
/obj/item/gun/ballistic/automatic/l6_saw
|
||||
name = "\improper L6 SAW"
|
||||
desc = "A heavily modified 1.95x129mm light machine gun, designated 'L6 SAW'. Has 'Aussec Armoury - 2531' engraved on the receiver below the designation."
|
||||
icon_state = "l6closed100"
|
||||
@@ -291,11 +291,11 @@
|
||||
fire_delay = 1
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/l6_saw/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/l6_saw/attack_self(mob/user)
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/attack_self(mob/user)
|
||||
cover_open = !cover_open
|
||||
to_chat(user, "<span class='notice'>You [cover_open ? "open" : "close"] [src]'s cover.</span>")
|
||||
if(cover_open)
|
||||
@@ -305,12 +305,12 @@
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/l6_saw/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/update_icon()
|
||||
icon_state = "l6[cover_open ? "open" : "closed"][magazine ? Ceiling(get_ammo(0)/12.5)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
|
||||
item_state = "l6[cover_open ? "openmag" : "closedmag"]"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/l6_saw/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params) //what I tried to do here is just add a check to see if the cover is open or not and add an icon_state change because I can't figure out how c-20rs do it with overlays
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params) //what I tried to do here is just add a check to see if the cover is open or not and add an icon_state change because I can't figure out how c-20rs do it with overlays
|
||||
if(cover_open)
|
||||
to_chat(user, "<span class='warning'>[src]'s cover is open! Close it before firing!</span>")
|
||||
else
|
||||
@@ -318,7 +318,7 @@
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/l6_saw/attack_hand(mob/user)
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/attack_hand(mob/user)
|
||||
if(loc != user)
|
||||
..()
|
||||
return //let them pick it up
|
||||
@@ -335,7 +335,7 @@
|
||||
playsound(user, 'sound/weapons/magout.ogg', 60, 1)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/l6_saw/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/attackby(obj/item/A, mob/user, params)
|
||||
if(!cover_open && istype(A, mag_type))
|
||||
to_chat(user, "<span class='warning'>[src]'s cover is closed! You can't insert a new mag.</span>")
|
||||
return
|
||||
@@ -345,7 +345,7 @@
|
||||
|
||||
// SNIPER //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/sniper_rifle
|
||||
/obj/item/gun/ballistic/automatic/sniper_rifle
|
||||
name = "sniper rifle"
|
||||
desc = "A long ranged weapon that does significant damage. No, you can't quickscope."
|
||||
icon_state = "sniper"
|
||||
@@ -365,27 +365,27 @@
|
||||
actions_types = list()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/sniper_rifle/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/sniper_rifle/update_icon()
|
||||
if(magazine)
|
||||
icon_state = "sniper-mag"
|
||||
else
|
||||
icon_state = "sniper"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/sniper_rifle/syndicate
|
||||
/obj/item/gun/ballistic/automatic/sniper_rifle/syndicate
|
||||
name = "syndicate sniper rifle"
|
||||
desc = "An illegally modified .50 cal sniper rifle with supression compatibility. Quickscoping still doesn't work."
|
||||
desc = "An illegally modified .50 cal sniper rifle with suppression compatibility. Quickscoping still doesn't work."
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
origin_tech = "combat=7;syndicate=6"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/sniper_rifle/gang
|
||||
/obj/item/gun/ballistic/automatic/sniper_rifle/gang
|
||||
name = "black market sniper rifle"
|
||||
desc = "A long ranged weapon that does significant damage. It is well worn from years of service."
|
||||
mag_type = /obj/item/ammo_box/magazine/sniper_rounds/gang
|
||||
|
||||
// Old Semi-Auto Rifle //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/surplus
|
||||
/obj/item/gun/ballistic/automatic/surplus
|
||||
name = "Surplus Rifle"
|
||||
desc = "One of countless obsolete ballistic rifles that still sees use as a cheap deterrent. Uses 10mm ammo and its bulky frame prevents one-hand firing."
|
||||
origin_tech = "combat=3;materials=2"
|
||||
@@ -401,7 +401,7 @@
|
||||
slot_flags = SLOT_BACK
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/surplus/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/surplus/update_icon()
|
||||
if(magazine)
|
||||
icon_state = "surplus"
|
||||
else
|
||||
@@ -410,7 +410,7 @@
|
||||
|
||||
// Laser rifle (rechargeable magazine) //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/laser
|
||||
/obj/item/gun/ballistic/automatic/laser
|
||||
name = "laser rifle"
|
||||
desc = "Though sometimes mocked for the relatively weak firepower of their energy weapons, the logistic miracle of rechargeable ammunition has given Nanotrasen a decisive edge over many a foe."
|
||||
icon_state = "oldrifle"
|
||||
@@ -423,7 +423,7 @@
|
||||
fire_sound = 'sound/weapons/laser.ogg'
|
||||
casing_ejector = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/laser/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/laser/update_icon()
|
||||
..()
|
||||
icon_state = "oldrifle[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
|
||||
return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
//The ammo/gun is stored in a back slot item
|
||||
/obj/item/weapon/minigunpack
|
||||
/obj/item/minigunpack
|
||||
name = "backpack power source"
|
||||
desc = "The massive external power source for the laser gatling gun"
|
||||
icon = 'icons/obj/guns/minigun.dmi'
|
||||
@@ -9,25 +9,25 @@
|
||||
item_state = "backpack"
|
||||
slot_flags = SLOT_BACK
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
var/obj/item/weapon/gun/ballistic/minigun/gun
|
||||
var/obj/item/gun/ballistic/minigun/gun
|
||||
var/armed = 0 //whether the gun is attached, 0 is attached, 1 is the gun is wielded.
|
||||
var/overheat = 0
|
||||
var/overheat_max = 40
|
||||
var/heat_diffusion = 1
|
||||
|
||||
/obj/item/weapon/minigunpack/Initialize()
|
||||
/obj/item/minigunpack/Initialize()
|
||||
. = ..()
|
||||
gun = new(src)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/weapon/minigunpack/Destroy()
|
||||
/obj/item/minigunpack/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/minigunpack/process()
|
||||
/obj/item/minigunpack/process()
|
||||
overheat = max(0, overheat - heat_diffusion)
|
||||
|
||||
/obj/item/weapon/minigunpack/attack_hand(var/mob/living/carbon/user)
|
||||
/obj/item/minigunpack/attack_hand(var/mob/living/carbon/user)
|
||||
if(src.loc == user)
|
||||
if(!armed)
|
||||
if(user.get_item_by_slot(slot_back) == src)
|
||||
@@ -44,17 +44,17 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/minigunpack/attackby(obj/item/weapon/W, mob/user, params)
|
||||
/obj/item/minigunpack/attackby(obj/item/W, mob/user, params)
|
||||
if(W == gun) //Don't need armed check, because if you have the gun assume its armed.
|
||||
user.dropItemToGround(gun, TRUE)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/minigunpack/dropped(mob/user)
|
||||
/obj/item/minigunpack/dropped(mob/user)
|
||||
if(armed)
|
||||
user.dropItemToGround(gun, TRUE)
|
||||
|
||||
/obj/item/weapon/minigunpack/MouseDrop(atom/over_object)
|
||||
/obj/item/minigunpack/MouseDrop(atom/over_object)
|
||||
if(armed)
|
||||
return
|
||||
if(iscarbon(usr))
|
||||
@@ -70,13 +70,13 @@
|
||||
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
|
||||
|
||||
|
||||
/obj/item/weapon/minigunpack/update_icon()
|
||||
/obj/item/minigunpack/update_icon()
|
||||
if(armed)
|
||||
icon_state = "notholstered"
|
||||
else
|
||||
icon_state = "holstered"
|
||||
|
||||
/obj/item/weapon/minigunpack/proc/attach_gun(var/mob/user)
|
||||
/obj/item/minigunpack/proc/attach_gun(var/mob/user)
|
||||
if(!gun)
|
||||
gun = new(src)
|
||||
gun.forceMove(src)
|
||||
@@ -89,14 +89,14 @@
|
||||
user.update_inv_back()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/minigun
|
||||
/obj/item/gun/ballistic/minigun
|
||||
name = "laser gatling gun"
|
||||
desc = "An advanced laser cannon with an incredible rate of fire. Requires a bulky backpack power source to use."
|
||||
icon = 'icons/obj/guns/minigun.dmi'
|
||||
icon_state = "minigun_spin"
|
||||
item_state = "minigun"
|
||||
origin_tech = "combat=6;powerstorage=5;magnets=4"
|
||||
flags = CONDUCT
|
||||
flags_1 = CONDUCT_1
|
||||
slowdown = 1
|
||||
slot_flags = null
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
@@ -108,28 +108,27 @@
|
||||
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
|
||||
flags_2 = SLOWS_WHILE_IN_HAND_2
|
||||
var/obj/item/minigunpack/ammo_pack
|
||||
|
||||
/obj/item/weapon/gun/ballistic/minigun/Initialize()
|
||||
SET_SECONDARY_FLAG(src, SLOWS_WHILE_IN_HAND)
|
||||
|
||||
if(istype(loc, /obj/item/weapon/minigunpack)) //We should spawn inside a ammo pack so let's use that one.
|
||||
/obj/item/gun/ballistic/minigun/Initialize()
|
||||
if(istype(loc, /obj/item/minigunpack)) //We should spawn inside a ammo pack so let's use that one.
|
||||
ammo_pack = loc
|
||||
else
|
||||
return INITIALIZE_HINT_QDEL //No pack, no gun
|
||||
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/minigun/attack_self(mob/living/user)
|
||||
/obj/item/gun/ballistic/minigun/attack_self(mob/living/user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/minigun/dropped(mob/user)
|
||||
/obj/item/gun/ballistic/minigun/dropped(mob/user)
|
||||
if(ammo_pack)
|
||||
ammo_pack.attach_gun(user)
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/minigun/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
|
||||
/obj/item/gun/ballistic/minigun/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
|
||||
if(ammo_pack)
|
||||
if(ammo_pack.overheat < ammo_pack.overheat_max)
|
||||
ammo_pack.overheat += burst_size
|
||||
@@ -137,12 +136,12 @@
|
||||
else
|
||||
to_chat(user, "The gun's heat sensor locked the trigger to prevent lens damage.")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/minigun/afterattack(atom/target, mob/living/user, flag, params)
|
||||
/obj/item/gun/ballistic/minigun/afterattack(atom/target, mob/living/user, flag, params)
|
||||
if(!ammo_pack || ammo_pack.loc != user)
|
||||
to_chat(user, "You need the backpack power source to fire the gun!")
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/minigun/dropped(mob/living/user)
|
||||
/obj/item/gun/ballistic/minigun/dropped(mob/living/user)
|
||||
ammo_pack.attach_gun(user)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//KEEP IN MIND: These are different from gun/grenadelauncher. These are designed to shoot premade rocket and grenade projectiles, not flashbangs or chemistry casings etc.
|
||||
//Put handheld rocket launchers here if someone ever decides to make something so hilarious ~Paprika
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher//this is only used for underbarrel grenade launchers at the moment, but admins can still spawn it if they feel like being assholes
|
||||
/obj/item/gun/ballistic/revolver/grenadelauncher//this is only used for underbarrel grenade launchers at the moment, but admins can still spawn it if they feel like being assholes
|
||||
desc = "A break-operated grenade launcher."
|
||||
name = "grenade launcher"
|
||||
icon_state = "dshotgun-sawn"
|
||||
@@ -11,15 +11,15 @@
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/unrestricted
|
||||
/obj/item/gun/ballistic/revolver/grenadelauncher/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/revolver/grenadelauncher/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing))
|
||||
chamber_round()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/cyborg
|
||||
/obj/item/gun/ballistic/revolver/grenadelauncher/cyborg
|
||||
desc = "A 6-shot grenade launcher."
|
||||
name = "multi grenade launcher"
|
||||
icon = 'icons/mecha/mecha_equipment.dmi'
|
||||
@@ -27,10 +27,10 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/grenademulti
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/grenadelauncher/cyborg/attack_self()
|
||||
/obj/item/gun/ballistic/revolver/grenadelauncher/cyborg/attack_self()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/gyropistol
|
||||
/obj/item/gun/ballistic/automatic/gyropistol
|
||||
name = "gyrojet pistol"
|
||||
desc = "A prototype pistol designed to fire self propelled rockets."
|
||||
icon_state = "gyropistol"
|
||||
@@ -42,11 +42,11 @@
|
||||
actions_types = list()
|
||||
casing_ejector = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/gyropistol/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/gyropistol/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)][magazine ? "loaded" : ""]"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/speargun
|
||||
/obj/item/gun/ballistic/automatic/speargun
|
||||
name = "kinetic speargun"
|
||||
desc = "A weapon favored by carp hunters. Fires specialized spears using kinetic energy."
|
||||
icon_state = "speargun"
|
||||
@@ -63,20 +63,20 @@
|
||||
actions_types = list()
|
||||
casing_ejector = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/speargun/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/speargun/update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/speargun/attack_self()
|
||||
/obj/item/gun/ballistic/automatic/speargun/attack_self()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/speargun/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/automatic/speargun/attackby(obj/item/A, mob/user, params)
|
||||
var/num_loaded = magazine.attackby(A, user, params, 1)
|
||||
if(num_loaded)
|
||||
to_chat(user, "<span class='notice'>You load [num_loaded] spear\s into \the [src].</span>")
|
||||
update_icon()
|
||||
chamber_round()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/atlauncher
|
||||
/obj/item/gun/ballistic/automatic/atlauncher
|
||||
desc = "A pre-loaded, single shot anti-armour launcher."
|
||||
name = "anti-armour grenade launcher"
|
||||
icon_state = "rocketlauncher"
|
||||
@@ -92,9 +92,9 @@
|
||||
casing_ejector = 0
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/atlauncher/attack_self()
|
||||
/obj/item/gun/ballistic/automatic/atlauncher/attack_self()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/atlauncher/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/atlauncher/update_icon()
|
||||
..()
|
||||
icon_state = "rocketlauncher[magazine ? "-[get_ammo(1)]" : ""]"
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol
|
||||
/obj/item/gun/ballistic/automatic/pistol
|
||||
name = "stechkin pistol"
|
||||
desc = "A small, easily concealable 10mm handgun. Has a threaded barrel for suppressors."
|
||||
icon_state = "pistol"
|
||||
@@ -10,12 +10,12 @@
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/pistol/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol/m1911
|
||||
/obj/item/gun/ballistic/automatic/pistol/m1911
|
||||
name = "\improper M1911"
|
||||
desc = "A classic .45 handgun with a small magazine capacity."
|
||||
icon_state = "m1911"
|
||||
@@ -23,7 +23,7 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/m45
|
||||
can_suppress = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol/deagle
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle
|
||||
name = "desert eagle"
|
||||
desc = "A robust .50 AE handgun."
|
||||
icon_state = "deagle"
|
||||
@@ -31,7 +31,7 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/m50
|
||||
can_suppress = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol/deagle/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/update_icon()
|
||||
..()
|
||||
if(magazine)
|
||||
cut_overlays()
|
||||
@@ -40,17 +40,17 @@
|
||||
cut_overlays()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol/deagle/gold
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/gold
|
||||
desc = "A gold plated desert eagle folded over a million times by superior martian gunsmiths. Uses .50 AE ammo."
|
||||
icon_state = "deagleg"
|
||||
item_state = "deagleg"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol/deagle/camo
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/camo
|
||||
desc = "A Deagle brand Deagle for operators operating operationally. Uses .50 AE ammo."
|
||||
icon_state = "deaglecamo"
|
||||
item_state = "deagleg"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol/APS
|
||||
/obj/item/gun/ballistic/automatic/pistol/APS
|
||||
name = "stechkin APS pistol"
|
||||
desc = "The original russian version of a widely used Syndicate sidearm. Uses 9mm ammo."
|
||||
icon_state = "aps"
|
||||
@@ -62,13 +62,13 @@
|
||||
fire_delay = 2
|
||||
actions_types = list(/datum/action/item_action/toggle_firemode)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol/stickman
|
||||
/obj/item/gun/ballistic/automatic/pistol/stickman
|
||||
name = "flat gun"
|
||||
desc = "A 2 dimensional gun.. what?"
|
||||
icon_state = "flatgun"
|
||||
origin_tech = "combat=3;materials=2;abductor=3"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/pistol/stickman/pickup(mob/living/user)
|
||||
/obj/item/gun/ballistic/automatic/pistol/stickman/pickup(mob/living/user)
|
||||
to_chat(user, "<span class='notice'>As you try to pick up [src], it slips out of your grip..</span>")
|
||||
if(prob(50))
|
||||
to_chat(user, "<span class='notice'>..and vanishes from your vision! Where the hell did it go?</span>")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/ballistic/revolver
|
||||
/obj/item/gun/ballistic/revolver
|
||||
name = "\improper .357 revolver"
|
||||
desc = "A suspicious revolver. Uses .357 ammo." //usually used by syndicates
|
||||
icon_state = "revolver"
|
||||
@@ -6,22 +6,22 @@
|
||||
origin_tech = "combat=3;materials=2"
|
||||
casing_ejector = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/Initialize()
|
||||
/obj/item/gun/ballistic/revolver/Initialize()
|
||||
. = ..()
|
||||
if(!istype(magazine, /obj/item/ammo_box/magazine/internal/cylinder))
|
||||
verbs -= /obj/item/weapon/gun/ballistic/revolver/verb/spin
|
||||
verbs -= /obj/item/gun/ballistic/revolver/verb/spin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/chamber_round(spin = 1)
|
||||
/obj/item/gun/ballistic/revolver/chamber_round(spin = 1)
|
||||
if(spin)
|
||||
chambered = magazine.get_round(1)
|
||||
else
|
||||
chambered = magazine.stored_ammo[1]
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
/obj/item/gun/ballistic/revolver/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
..()
|
||||
chamber_round(1)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/revolver/attackby(obj/item/A, mob/user, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -33,7 +33,7 @@
|
||||
update_icon()
|
||||
chamber_round(0)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/attack_self(mob/living/user)
|
||||
/obj/item/gun/ballistic/revolver/attack_self(mob/living/user)
|
||||
var/num_unloaded = 0
|
||||
chambered = null
|
||||
while (get_ammo() > 0)
|
||||
@@ -50,7 +50,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/verb/spin()
|
||||
/obj/item/gun/ballistic/revolver/verb/spin()
|
||||
set name = "Spin Chamber"
|
||||
set category = "Object"
|
||||
set desc = "Click to spin your revolver's chamber."
|
||||
@@ -63,19 +63,19 @@
|
||||
if(do_spin())
|
||||
usr.visible_message("[usr] spins [src]'s chamber.", "<span class='notice'>You spin [src]'s chamber.</span>")
|
||||
else
|
||||
verbs -= /obj/item/weapon/gun/ballistic/revolver/verb/spin
|
||||
verbs -= /obj/item/gun/ballistic/revolver/verb/spin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/proc/do_spin()
|
||||
/obj/item/gun/ballistic/revolver/proc/do_spin()
|
||||
var/obj/item/ammo_box/magazine/internal/cylinder/C = magazine
|
||||
. = istype(C)
|
||||
if(.)
|
||||
C.spin()
|
||||
chamber_round(0)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/can_shoot()
|
||||
/obj/item/gun/ballistic/revolver/can_shoot()
|
||||
return get_ammo(0,0)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/get_ammo(countchambered = 0, countempties = 1)
|
||||
/obj/item/gun/ballistic/revolver/get_ammo(countchambered = 0, countempties = 1)
|
||||
var/boolets = 0 //mature var names for mature people
|
||||
if (chambered && countchambered)
|
||||
boolets++
|
||||
@@ -83,11 +83,11 @@
|
||||
boolets += magazine.ammo_count(countempties)
|
||||
return boolets
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/examine(mob/user)
|
||||
/obj/item/gun/ballistic/revolver/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "[get_ammo(0,0)] of those are live rounds.")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/detective
|
||||
/obj/item/gun/ballistic/revolver/detective
|
||||
name = "\improper .38 Mars Special"
|
||||
desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds."
|
||||
icon_state = "detective"
|
||||
@@ -100,7 +100,7 @@
|
||||
"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 = "")
|
||||
/obj/item/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))
|
||||
if(prob(70 - (magazine.ammo_count() * 10))) //minimum probability of 10, maximum of 60
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
@@ -110,9 +110,9 @@
|
||||
return 0
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/detective/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/revolver/detective/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/weapon/screwdriver))
|
||||
if(istype(A, /obj/item/screwdriver))
|
||||
if(magazine.caliber == "38")
|
||||
to_chat(user, "<span class='notice'>You begin to reinforce the barrel of [src]...</span>")
|
||||
if(magazine.ammo_count())
|
||||
@@ -141,12 +141,12 @@
|
||||
to_chat(user, "<span class='notice'>You remove the modifications on [src]. Now it will fire .38 rounds.</span>")
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/mateba
|
||||
/obj/item/gun/ballistic/revolver/mateba
|
||||
name = "\improper Unica 6 auto-revolver"
|
||||
desc = "A retro high-powered autorevolver typically used by officers of the New Russia military. Uses .357 ammo."
|
||||
icon_state = "mateba"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/golden
|
||||
/obj/item/gun/ballistic/revolver/golden
|
||||
name = "\improper Golden revolver"
|
||||
desc = "This ain't no game, ain't never been no show, And I'll gladly gun down the oldest lady you know. Uses .357 ammo."
|
||||
icon_state = "goldrevolver"
|
||||
@@ -154,7 +154,7 @@
|
||||
recoil = 8
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/nagant
|
||||
/obj/item/gun/ballistic/revolver/nagant
|
||||
name = "nagant revolver"
|
||||
desc = "An old model of revolver that originated in Russia. Able to be suppressed. Uses 7.62x38mmR ammo."
|
||||
icon_state = "nagant"
|
||||
@@ -166,20 +166,20 @@
|
||||
// A gun to play Russian Roulette!
|
||||
// You can spin the chamber to randomize the position of the bullet.
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian
|
||||
/obj/item/gun/ballistic/revolver/russian
|
||||
name = "\improper russian revolver"
|
||||
desc = "A Russian-made revolver for drinking games. Uses .357 ammo, and has a mechanism requiring you to spin the chamber before each trigger pull."
|
||||
origin_tech = "combat=2;materials=2"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rus357
|
||||
var/spun = FALSE
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/Initialize()
|
||||
/obj/item/gun/ballistic/revolver/russian/Initialize()
|
||||
. = ..()
|
||||
do_spin()
|
||||
spun = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/revolver/russian/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(get_ammo() > 0)
|
||||
spin()
|
||||
@@ -188,14 +188,14 @@
|
||||
A.update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/attack_self(mob/user)
|
||||
/obj/item/gun/ballistic/revolver/russian/attack_self(mob/user)
|
||||
if(!spun && can_shoot())
|
||||
spin()
|
||||
spun = TRUE
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/afterattack(atom/target, mob/living/user, flag, params)
|
||||
/obj/item/gun/ballistic/revolver/russian/afterattack(atom/target, mob/living/user, flag, params)
|
||||
if(flag)
|
||||
if(!(target in user.contents) && ismob(target))
|
||||
if(user.a_intent == INTENT_HARM) // Flogging action
|
||||
@@ -233,27 +233,27 @@
|
||||
user.visible_message("<span class='danger'>*click*</span>")
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/proc/shoot_self(mob/living/carbon/human/user, affecting = "head")
|
||||
/obj/item/gun/ballistic/revolver/russian/proc/shoot_self(mob/living/carbon/human/user, affecting = "head")
|
||||
user.apply_damage(300, BRUTE, affecting)
|
||||
user.visible_message("<span class='danger'>[user.name] fires [src] at [user.p_their()] head!</span>", "<span class='userdanger'>You fire [src] at your head!</span>", "<span class='italics'>You hear a gunshot!</span>")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/soul
|
||||
/obj/item/gun/ballistic/revolver/russian/soul
|
||||
name = "cursed russian revolver"
|
||||
desc = "To play with this revolver requires wagering your very soul."
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/russian/soul/shoot_self(mob/living/user)
|
||||
/obj/item/gun/ballistic/revolver/russian/soul/shoot_self(mob/living/user)
|
||||
..()
|
||||
var/obj/item/device/soulstone/anybody/SS = new /obj/item/device/soulstone/anybody(get_turf(src))
|
||||
if(!SS.transfer_soul("FORCE", user)) //Something went wrong
|
||||
qdel(SS)
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user.name]'s soul is captured by \the [src]!</span>", "<span class='userdanger'>You've lost the gamble! Your soul is forfiet!</span>")
|
||||
user.visible_message("<span class='danger'>[user.name]'s soul is captured by \the [src]!</span>", "<span class='userdanger'>You've lost the gamble! Your soul is forfeit!</span>")
|
||||
|
||||
/////////////////////////////
|
||||
// DOUBLE BARRELED SHOTGUN //
|
||||
/////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel
|
||||
name = "double-barreled shotgun"
|
||||
desc = "A true classic."
|
||||
icon_state = "dshotgun"
|
||||
@@ -261,7 +261,7 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
force = 10
|
||||
flags = CONDUCT
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = SLOT_BACK
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/dual
|
||||
sawn_desc = "Omar's coming!"
|
||||
@@ -274,18 +274,18 @@
|
||||
"Rosewood" = "dshotgun-p"
|
||||
)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing))
|
||||
chamber_round()
|
||||
if(istype(A, /obj/item/weapon/melee/transforming/energy))
|
||||
var/obj/item/weapon/melee/transforming/energy/W = A
|
||||
if(istype(A, /obj/item/melee/transforming/energy))
|
||||
var/obj/item/melee/transforming/energy/W = A
|
||||
if(W.active)
|
||||
sawoff(user)
|
||||
if(istype(A, /obj/item/weapon/circular_saw) || istype(A, /obj/item/weapon/gun/energy/plasmacutter))
|
||||
if(istype(A, /obj/item/circular_saw) || istype(A, /obj/item/gun/energy/plasmacutter))
|
||||
sawoff(user)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/attack_self(mob/living/user)
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/attack_self(mob/living/user)
|
||||
var/num_unloaded = 0
|
||||
while (get_ammo() > 0)
|
||||
var/obj/item/ammo_casing/CB
|
||||
@@ -301,7 +301,7 @@
|
||||
|
||||
// IMPROVISED SHOTGUN //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised
|
||||
name = "improvised shotgun"
|
||||
desc = "Essentially a tube that aims shotgun shells."
|
||||
icon_state = "ishotgun"
|
||||
@@ -315,7 +315,7 @@
|
||||
unique_reskin = null
|
||||
var/slung = FALSE
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/stack/cable_coil) && !sawn_state)
|
||||
var/obj/item/stack/cable_coil/C = A
|
||||
@@ -327,19 +327,19 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised/update_icon()
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/update_icon()
|
||||
..()
|
||||
if(slung)
|
||||
icon_state += "sling"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised/sawoff(mob/user)
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/sawoff(mob/user)
|
||||
. = ..()
|
||||
if(. && slung) //sawing off the gun removes the sling
|
||||
new /obj/item/stack/cable_coil(get_turf(src), 10)
|
||||
slung = 0
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/doublebarrel/improvised/sawn
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/sawn
|
||||
name = "sawn-off improvised shotgun"
|
||||
desc = "A single-shot shotgun, better not miss"
|
||||
icon_state = "ishotgun"
|
||||
@@ -349,10 +349,10 @@
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/reverse //Fires directly at its user... unless the user is a clown, of course.
|
||||
/obj/item/gun/ballistic/revolver/reverse //Fires directly at its user... unless the user is a clown, of course.
|
||||
clumsy_check = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/revolver/reverse/can_trigger_gun(mob/living/user)
|
||||
/obj/item/gun/ballistic/revolver/reverse/can_trigger_gun(mob/living/user)
|
||||
if((user.disabilities & CLUMSY) || (user.mind && user.mind.assigned_role == "Clown"))
|
||||
return ..()
|
||||
if(process_fire(user, user, 0, zone_override = "head"))
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/obj/item/weapon/gun/ballistic/shotgun
|
||||
/obj/item/gun/ballistic/shotgun
|
||||
name = "shotgun"
|
||||
desc = "A traditional shotgun with wood furniture and a four-shell capacity underneath."
|
||||
icon_state = "shotgun"
|
||||
item_state = "shotgun"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 10
|
||||
flags = CONDUCT
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = SLOT_BACK
|
||||
origin_tech = "combat=4;materials=2"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot
|
||||
@@ -13,7 +13,7 @@
|
||||
var/recentpump = 0 // to prevent spammage
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/shotgun/attackby(obj/item/A, mob/user, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -24,73 +24,73 @@
|
||||
A.update_icon()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/process_chamber(empty_chamber = 0)
|
||||
/obj/item/gun/ballistic/shotgun/process_chamber(empty_chamber = 0)
|
||||
return ..() //changed argument value
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/chamber_round()
|
||||
/obj/item/gun/ballistic/shotgun/chamber_round()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/can_shoot()
|
||||
/obj/item/gun/ballistic/shotgun/can_shoot()
|
||||
if(!chambered)
|
||||
return 0
|
||||
return (chambered.BB ? 1 : 0)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/attack_self(mob/living/user)
|
||||
/obj/item/gun/ballistic/shotgun/attack_self(mob/living/user)
|
||||
if(recentpump > world.time)
|
||||
return
|
||||
pump(user)
|
||||
recentpump = world.time + 10
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/blow_up(mob/user)
|
||||
/obj/item/gun/ballistic/shotgun/blow_up(mob/user)
|
||||
. = 0
|
||||
if(chambered && chambered.BB)
|
||||
process_fire(user, user,0)
|
||||
. = 1
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/proc/pump(mob/M)
|
||||
/obj/item/gun/ballistic/shotgun/proc/pump(mob/M)
|
||||
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
|
||||
pump_unload(M)
|
||||
pump_reload(M)
|
||||
update_icon() //I.E. fix the desc
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/proc/pump_unload(mob/M)
|
||||
/obj/item/gun/ballistic/shotgun/proc/pump_unload(mob/M)
|
||||
if(chambered)//We have a shell in the chamber
|
||||
chambered.loc = get_turf(src)//Eject casing
|
||||
chambered.SpinAnimation(5, 1)
|
||||
chambered = null
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/proc/pump_reload(mob/M)
|
||||
/obj/item/gun/ballistic/shotgun/proc/pump_reload(mob/M)
|
||||
if(!magazine.ammo_count())
|
||||
return 0
|
||||
var/obj/item/ammo_casing/AC = magazine.get_round() //load next casing.
|
||||
chambered = AC
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/examine(mob/user)
|
||||
/obj/item/gun/ballistic/shotgun/examine(mob/user)
|
||||
..()
|
||||
if (chambered)
|
||||
to_chat(user, "A [chambered.BB ? "live" : "spent"] one is in the chamber.")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/lethal
|
||||
/obj/item/gun/ballistic/shotgun/lethal
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/lethal
|
||||
|
||||
// RIOT SHOTGUN //
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/riot //for spawn in the armory
|
||||
/obj/item/gun/ballistic/shotgun/riot //for spawn in the armory
|
||||
name = "riot shotgun"
|
||||
desc = "A sturdy shotgun with a longer magazine and a fixed tactical stock designed for non-lethal riot control."
|
||||
icon_state = "riotshotgun"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/riot
|
||||
sawn_desc = "Come with me if you want to live."
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/riot/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/shotgun/riot/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/weapon/circular_saw) || istype(A, /obj/item/weapon/gun/energy/plasmacutter))
|
||||
if(istype(A, /obj/item/circular_saw) || istype(A, /obj/item/gun/energy/plasmacutter))
|
||||
sawoff(user)
|
||||
if(istype(A, /obj/item/weapon/melee/transforming/energy))
|
||||
var/obj/item/weapon/melee/transforming/energy/W = A
|
||||
if(istype(A, /obj/item/melee/transforming/energy))
|
||||
var/obj/item/melee/transforming/energy/W = A
|
||||
if(W.active)
|
||||
sawoff(user)
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
// BOLT ACTION RIFLE //
|
||||
///////////////////////
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction
|
||||
/obj/item/gun/ballistic/shotgun/boltaction
|
||||
name = "\improper Mosin Nagant"
|
||||
desc = "This piece of junk looks like something that could have been used 700 years ago. It feels slightly moist."
|
||||
icon_state = "moistnugget"
|
||||
@@ -107,7 +107,7 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/boltaction
|
||||
var/bolt_open = FALSE
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/pump(mob/M)
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/pump(mob/M)
|
||||
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
|
||||
if(bolt_open)
|
||||
pump_reload(M)
|
||||
@@ -117,25 +117,25 @@
|
||||
update_icon() //I.E. fix the desc
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/attackby(obj/item/A, mob/user, params)
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/attackby(obj/item/A, mob/user, params)
|
||||
if(!bolt_open)
|
||||
to_chat(user, "<span class='notice'>The bolt is closed!</span>")
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/examine(mob/user)
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "The bolt is [bolt_open ? "open" : "closed"].")
|
||||
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted
|
||||
name = "enchanted bolt action rifle"
|
||||
desc = "Careful not to lose your head."
|
||||
var/guns_left = 30
|
||||
var/gun_type
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/arcane_barrage
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted/arcane_barrage
|
||||
name = "arcane barrage"
|
||||
desc = "Pew Pew Pew"
|
||||
fire_sound = 'sound/weapons/emitter.ogg'
|
||||
@@ -143,34 +143,34 @@
|
||||
icon_state = "arcane_barrage"
|
||||
item_state = "arcane_barrage"
|
||||
|
||||
flags = DROPDEL
|
||||
flags_1 = DROPDEL_1
|
||||
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/Initialize()
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted/Initialize()
|
||||
. = ..()
|
||||
bolt_open = TRUE
|
||||
pump()
|
||||
gun_type = type
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/dropped()
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted/dropped()
|
||||
..()
|
||||
guns_left = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/proc/discard_gun(mob/user)
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted/proc/discard_gun(mob/user)
|
||||
throw_at(pick(oview(7,get_turf(user))),1,1)
|
||||
user.visible_message("<span class='warning'>[user] tosses aside the spent rifle!</span>")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/arcane_barrage/discard_gun(mob/user)
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted/arcane_barrage/discard_gun(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/attack_self()
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted/attack_self()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
|
||||
..()
|
||||
if(guns_left)
|
||||
var/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/GUN = new gun_type
|
||||
var/obj/item/gun/ballistic/shotgun/boltaction/enchanted/GUN = new gun_type
|
||||
GUN.guns_left = guns_left - 1
|
||||
user.drop_item()
|
||||
user.swap_hand()
|
||||
@@ -181,11 +181,11 @@
|
||||
|
||||
// Automatic Shotguns//
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/automatic/shoot_live_shot(mob/living/user as mob|obj)
|
||||
/obj/item/gun/ballistic/shotgun/automatic/shoot_live_shot(mob/living/user as mob|obj)
|
||||
..()
|
||||
src.pump(user)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/automatic/combat
|
||||
/obj/item/gun/ballistic/shotgun/automatic/combat
|
||||
name = "combat shotgun"
|
||||
desc = "A semi automatic shotgun with tactical furniture and a six-shell capacity underneath."
|
||||
icon_state = "cshotgun"
|
||||
@@ -193,7 +193,7 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/com
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/automatic/combat/compact
|
||||
/obj/item/gun/ballistic/shotgun/automatic/combat/compact
|
||||
name = "compact combat shotgun"
|
||||
desc = "A compact version of the semi automatic combat shotgun. For close encounters."
|
||||
icon_state = "cshotgunc"
|
||||
@@ -203,7 +203,7 @@
|
||||
|
||||
//Dual Feed Shotgun
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube
|
||||
/obj/item/gun/ballistic/shotgun/automatic/dual_tube
|
||||
name = "cycler shotgun"
|
||||
desc = "An advanced shotgun with two separate magazine tubes, allowing you to quickly toggle between ammo types."
|
||||
icon_state = "cycler"
|
||||
@@ -213,18 +213,18 @@
|
||||
var/toggled = FALSE
|
||||
var/obj/item/ammo_box/magazine/internal/shot/alternate_magazine
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube/Initialize()
|
||||
/obj/item/gun/ballistic/shotgun/automatic/dual_tube/Initialize()
|
||||
. = ..()
|
||||
if (!alternate_magazine)
|
||||
alternate_magazine = new mag_type(src)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube/attack_self(mob/living/user)
|
||||
/obj/item/gun/ballistic/shotgun/automatic/dual_tube/attack_self(mob/living/user)
|
||||
if(!chambered && magazine.contents.len)
|
||||
pump()
|
||||
else
|
||||
toggle_tube(user)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube/proc/toggle_tube(mob/living/user)
|
||||
/obj/item/gun/ballistic/shotgun/automatic/dual_tube/proc/toggle_tube(mob/living/user)
|
||||
var/current_mag = magazine
|
||||
var/alt_mag = alternate_magazine
|
||||
magazine = alt_mag
|
||||
@@ -235,7 +235,7 @@
|
||||
else
|
||||
to_chat(user, "You switch to tube A.")
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube/AltClick(mob/living/user)
|
||||
/obj/item/gun/ballistic/shotgun/automatic/dual_tube/AltClick(mob/living/user)
|
||||
if(user.incapacitated() || !Adjacent(user) || !istype(user))
|
||||
return
|
||||
pump()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/ballistic/automatic/toy
|
||||
/obj/item/gun/ballistic/automatic/toy
|
||||
name = "foam force SMG"
|
||||
desc = "A prototype three-round burst toy submachine gun. Ages 8 and up."
|
||||
icon = 'icons/obj/guns/toy.dmi'
|
||||
@@ -14,10 +14,10 @@
|
||||
needs_permit = 0
|
||||
casing_ejector = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/toy/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/toy/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/toy/pistol
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol
|
||||
name = "foam force pistol"
|
||||
desc = "A small, easily concealable toy handgun. Ages 8 and up."
|
||||
icon_state = "pistol"
|
||||
@@ -28,24 +28,24 @@
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/riot
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/riot
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/pistol/riot
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/riot/Initialize()
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/riot/Initialize()
|
||||
magazine = new /obj/item/ammo_box/magazine/toy/pistol/riot(src)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/toy/pistol/riot/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/riot/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/toy
|
||||
/obj/item/gun/ballistic/shotgun/toy
|
||||
name = "foam force shotgun"
|
||||
desc = "A toy shotgun with wood furniture and a four-shell capacity underneath. Ages 8 and up."
|
||||
icon = 'icons/obj/guns/toy.dmi'
|
||||
@@ -58,15 +58,15 @@
|
||||
casing_ejector = 0
|
||||
can_suppress = FALSE
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/toy/process_chamber(empty_chamber = 0)
|
||||
/obj/item/gun/ballistic/shotgun/toy/process_chamber(empty_chamber = 0)
|
||||
..()
|
||||
if(chambered && !chambered.BB)
|
||||
qdel(chambered)
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/toy/unrestricted
|
||||
/obj/item/gun/ballistic/shotgun/toy/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/toy/crossbow
|
||||
/obj/item/gun/ballistic/shotgun/toy/crossbow
|
||||
name = "foam force crossbow"
|
||||
desc = "A weapon favored by many overactive children. Ages 8 and up."
|
||||
icon = 'icons/obj/toy.dmi'
|
||||
@@ -77,7 +77,7 @@
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/c20r/toy
|
||||
/obj/item/gun/ballistic/automatic/c20r/toy
|
||||
name = "donksoft SMG"
|
||||
desc = "A bullpup two-round burst toy SMG, designated 'C-20r'. Ages 8 and up."
|
||||
icon = 'icons/obj/guns/toy.dmi'
|
||||
@@ -86,10 +86,10 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/smgm45
|
||||
casing_ejector = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/c20r/toy/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/c20r/toy/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/l6_saw/toy
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/toy
|
||||
name = "donksoft LMG"
|
||||
desc = "A heavily modified toy light machine gun, designated 'L6 SAW'. Ages 8 and up."
|
||||
icon = 'icons/obj/guns/toy.dmi'
|
||||
@@ -98,5 +98,5 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/m762
|
||||
casing_ejector = 0
|
||||
|
||||
/obj/item/weapon/gun/ballistic/automatic/l6_saw/toy/unrestricted
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/toy/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
@@ -1,5 +1,17 @@
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle
|
||||
#define ZOOM_LOCK_AUTOZOOM_FREEMOVE 0
|
||||
#define ZOOM_LOCK_AUTOZOOM_ANGLELOCK 1
|
||||
#define ZOOM_LOCK_CENTER_VIEW 2
|
||||
#define ZOOM_LOCK_OFF 3
|
||||
|
||||
#define ZOOM_SPEED_STEP 0
|
||||
#define ZOOM_SPEED_INSTANT 1
|
||||
|
||||
#define AUTOZOOM_PIXEL_STEP_FACTOR 48
|
||||
|
||||
#define AIMING_BEAM_ANGLE_CHANGE_THRESHOLD 0.1
|
||||
|
||||
/obj/item/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 \
|
||||
@@ -12,23 +24,14 @@
|
||||
force = 15
|
||||
materials = list()
|
||||
origin_tech = ""
|
||||
recoil = 5
|
||||
recoil = 4
|
||||
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
|
||||
cell_type = /obj/item/stock_parts/cell/beam_rifle
|
||||
canMouseDown = TRUE
|
||||
pin = null
|
||||
var/aiming = FALSE
|
||||
@@ -37,13 +40,14 @@
|
||||
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/aiming_time_increase_angle_multiplier = 0.3
|
||||
|
||||
var/lastangle = 0
|
||||
var/aiming_lastangle = 0
|
||||
var/mob/current_user = null
|
||||
var/list/obj/effect/temp_visual/current_tracers = list()
|
||||
var/obj/effect/projectile_beam/current_tracer
|
||||
|
||||
var/structure_piercing = 2 //This doesn't always work!
|
||||
var/structure_piercing = 2 //Amount * 2. For some reason structures aren't respecting this unless you have it doubled. Probably with the objects in question's Bump() code instead of this but I'll deal with this later.
|
||||
var/structure_bleed_coeff = 0.7
|
||||
var/wall_pierce_amount = 0
|
||||
var/wall_devastate = 0
|
||||
@@ -60,21 +64,124 @@
|
||||
var/delay = 65
|
||||
var/lastfire = 0
|
||||
|
||||
//ZOOMING
|
||||
var/zoom_current_view_increase = 0
|
||||
var/zoom_target_view_increase = 10
|
||||
var/zoom_speed = ZOOM_SPEED_STEP
|
||||
var/zooming = FALSE
|
||||
var/zoom_lock = ZOOM_LOCK_AUTOZOOM_FREEMOVE
|
||||
var/zooming_angle
|
||||
var/current_zoom_x = 0
|
||||
var/current_zoom_y = 0
|
||||
var/zoom_animating = 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
|
||||
var/datum/action/item_action/zoom_speed_action/zoom_speed_action
|
||||
var/datum/action/item_action/zoom_lock_action/zoom_lock_action
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/debug
|
||||
delay = 0
|
||||
cell_type = /obj/item/weapon/stock_parts/cell/infinite
|
||||
cell_type = /obj/item/stock_parts/cell/infinite
|
||||
aiming_time = 0
|
||||
recoil = 0
|
||||
scoped_recoil = 0
|
||||
hipfire_recoil = 0
|
||||
hipfire_inaccuracy = 0
|
||||
scoped_inaccuracy = 0
|
||||
noscope = 1
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/update_icon()
|
||||
/obj/item/gun/energy/beam_rifle/equipped(mob/user)
|
||||
set_user(user)
|
||||
. = ..()
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/pickup(mob/user)
|
||||
set_user(user)
|
||||
. = ..()
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/dropped()
|
||||
set_user()
|
||||
. = ..()
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/ui_action_click(owner, action)
|
||||
if(istype(action, /datum/action/item_action/zoom_speed_action))
|
||||
zoom_speed++
|
||||
if(zoom_speed > 1)
|
||||
zoom_speed = ZOOM_SPEED_STEP
|
||||
switch(zoom_speed)
|
||||
if(ZOOM_SPEED_STEP)
|
||||
to_chat(owner, "<span class='boldnotice'>You switch [src]'s digital zoom to stepper mode.</span>")
|
||||
if(ZOOM_SPEED_INSTANT)
|
||||
to_chat(owner, "<span class='boldnotice'>You switch [src]'s digital zoom to instant mode.</span>")
|
||||
if(istype(action, /datum/action/item_action/zoom_lock_action))
|
||||
zoom_lock++
|
||||
if(zoom_lock > 3)
|
||||
zoom_lock = 0
|
||||
switch(zoom_lock)
|
||||
if(ZOOM_LOCK_AUTOZOOM_FREEMOVE)
|
||||
to_chat(owner, "<span class='boldnotice'>You switch [src]'s zooming processor to free directional.</span>")
|
||||
if(ZOOM_LOCK_AUTOZOOM_ANGLELOCK)
|
||||
to_chat(owner, "<span class='boldnotice'>You switch [src]'s zooming processor to locked directional.</span>")
|
||||
if(ZOOM_LOCK_CENTER_VIEW)
|
||||
to_chat(owner, "<span class='boldnotice'>You switch [src]'s zooming processor to center mode.</span>")
|
||||
if(ZOOM_LOCK_OFF)
|
||||
to_chat(owner, "<span class='boldnotice'>You disable [src]'s zooming system.</span>")
|
||||
reset_zooming()
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/proc/smooth_zooming(delay_override = null)
|
||||
if(!check_user() || !zooming || zoom_lock == ZOOM_LOCK_OFF || zoom_lock == ZOOM_LOCK_CENTER_VIEW)
|
||||
return
|
||||
if(zoom_animating && delay_override != 0)
|
||||
return smooth_zooming(zoom_animating + delay_override) //Automatically compensate for ongoing zooming actions.
|
||||
var/total_time = SSfastprocess.wait
|
||||
if(delay_override)
|
||||
total_time = delay_override
|
||||
if(zoom_speed == ZOOM_SPEED_INSTANT)
|
||||
total_time = 0
|
||||
zoom_animating = total_time
|
||||
animate(current_user.client, pixel_x = current_zoom_x, pixel_y = current_zoom_y , total_time, SINE_EASING, ANIMATION_PARALLEL)
|
||||
zoom_animating = 0
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/proc/set_autozoom_pixel_offsets_immediate(current_angle)
|
||||
if(zoom_lock == ZOOM_LOCK_CENTER_VIEW || zoom_lock == ZOOM_LOCK_OFF)
|
||||
return
|
||||
current_zoom_x = sin(current_angle) + sin(current_angle) * AUTOZOOM_PIXEL_STEP_FACTOR * zoom_current_view_increase
|
||||
current_zoom_y = cos(current_angle) + cos(current_angle) * AUTOZOOM_PIXEL_STEP_FACTOR * zoom_current_view_increase
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/proc/handle_zooming()
|
||||
if(!zooming || !check_user())
|
||||
return
|
||||
if(zoom_speed == ZOOM_SPEED_INSTANT)
|
||||
current_user.client.change_view(world.view + zoom_target_view_increase)
|
||||
zoom_current_view_increase = zoom_target_view_increase
|
||||
set_autozoom_pixel_offsets_immediate(zooming_angle)
|
||||
smooth_zooming()
|
||||
return
|
||||
if(zoom_current_view_increase > zoom_target_view_increase)
|
||||
return
|
||||
zoom_current_view_increase++
|
||||
current_user.client.change_view(zoom_current_view_increase + world.view)
|
||||
set_autozoom_pixel_offsets_immediate(zooming_angle)
|
||||
smooth_zooming(SSfastprocess.wait * zoom_target_view_increase * zoom_speed)
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/proc/start_zooming()
|
||||
if(zoom_lock == ZOOM_LOCK_OFF)
|
||||
return
|
||||
zooming = TRUE
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/proc/stop_zooming()
|
||||
zooming = FALSE
|
||||
reset_zooming()
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/proc/reset_zooming()
|
||||
if(!check_user(FALSE))
|
||||
return
|
||||
zoom_animating = 0
|
||||
animate(current_user.client, pixel_x = 0, pixel_y = 0, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW)
|
||||
zoom_current_view_increase = 0
|
||||
current_user.client.change_view(world.view)
|
||||
zooming_angle = 0
|
||||
current_zoom_x = 0
|
||||
current_zoom_y = 0
|
||||
|
||||
/obj/item/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)
|
||||
@@ -82,159 +189,180 @@
|
||||
else
|
||||
add_overlay(drained_overlay)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/attack_self(mob/user)
|
||||
/obj/item/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>")
|
||||
aiming_beam()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/update_slowdown()
|
||||
if(scoped)
|
||||
/obj/item/gun/energy/beam_rifle/proc/update_slowdown()
|
||||
if(aiming)
|
||||
slowdown = scoped_slow
|
||||
else
|
||||
slowdown = initial(slowdown)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/Initialize()
|
||||
/obj/item/gun/energy/beam_rifle/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
zoom_speed_action = new(src)
|
||||
zoom_lock_action = new(src)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/Destroy()
|
||||
/obj/item/gun/energy/beam_rifle/Destroy()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
..()
|
||||
set_user(null)
|
||||
QDEL_NULL(current_tracer)
|
||||
return ..()
|
||||
|
||||
/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)
|
||||
/obj/item/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))
|
||||
/obj/item/gun/energy/beam_rifle/proc/aiming_beam(force_update = FALSE)
|
||||
var/diff = abs(aiming_lastangle - lastangle)
|
||||
check_user()
|
||||
if(diff < AIMING_BEAM_ANGLE_CHANGE_THRESHOLD && !force_update)
|
||||
return
|
||||
aiming_lastangle = lastangle
|
||||
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()
|
||||
var/turf/curloc = get_turf(src)
|
||||
var/turf/targloc = get_turf(current_user.client.mouseObject)
|
||||
if(!istype(targloc))
|
||||
if(!istype(curloc))
|
||||
return
|
||||
targloc = get_turf_in_angle(lastangle, curloc, 10)
|
||||
P.preparePixelProjectile(targloc, targloc, current_user, current_user.client.mouseParams, 0)
|
||||
P.fire(lastangle)
|
||||
|
||||
/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()
|
||||
/obj/item/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
|
||||
check_user()
|
||||
handle_zooming()
|
||||
if(aiming_time_left > 0)
|
||||
aiming_time_left--
|
||||
aiming_beam()
|
||||
process_aim()
|
||||
aiming_beam(TRUE)
|
||||
|
||||
/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/gun/energy/beam_rifle/proc/check_user(automatic_cleanup = TRUE)
|
||||
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!
|
||||
if(automatic_cleanup)
|
||||
stop_aiming()
|
||||
set_user(null)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/on_mob_move()
|
||||
delay_penalty(aiming_time_increase_user_movement)
|
||||
/obj/item/gun/energy/beam_rifle/proc/process_aim()
|
||||
if(istype(current_user) && current_user.client && current_user.client.mouseParams)
|
||||
var/angle = mouse_angle_from_client(current_user.client)
|
||||
switch(angle)
|
||||
if(316 to 360)
|
||||
current_user.setDir(NORTH)
|
||||
if(0 to 45)
|
||||
current_user.setDir(NORTH)
|
||||
if(46 to 135)
|
||||
current_user.setDir(EAST)
|
||||
if(136 to 225)
|
||||
current_user.setDir(SOUTH)
|
||||
if(226 to 315)
|
||||
current_user.setDir(WEST)
|
||||
var/difference = abs(lastangle - angle)
|
||||
if(difference > 350) //Too lazy to properly math, detects 360 --> 0 changes.
|
||||
difference = (lastangle > 350? ((360 - lastangle) + angle) : ((360 - angle) + lastangle))
|
||||
delay_penalty(difference * aiming_time_increase_angle_multiplier)
|
||||
lastangle = angle
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/start_aiming()
|
||||
/obj/item/gun/energy/beam_rifle/on_mob_move()
|
||||
check_user()
|
||||
if(aiming)
|
||||
delay_penalty(aiming_time_increase_user_movement)
|
||||
process_aim()
|
||||
aiming_beam(TRUE)
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/proc/start_aiming()
|
||||
aiming_time_left = aiming_time
|
||||
aiming = TRUE
|
||||
process_aim()
|
||||
aiming_beam(TRUE)
|
||||
zooming_angle = lastangle
|
||||
start_zooming()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/stop_aiming()
|
||||
/obj/item/gun/energy/beam_rifle/proc/stop_aiming()
|
||||
set waitfor = FALSE
|
||||
aiming_time_left = aiming_time
|
||||
aiming = FALSE
|
||||
QDEL_NULL(current_tracer)
|
||||
stop_zooming()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/onMouseDrag(src_object, over_object, src_location, over_location, params, mob)
|
||||
current_user = mob
|
||||
/obj/item/gun/energy/beam_rifle/proc/set_user(mob/user)
|
||||
if(user == current_user)
|
||||
return
|
||||
stop_aiming()
|
||||
if(istype(current_user))
|
||||
LAZYREMOVE(current_user.mousemove_intercept_objects, src)
|
||||
current_user = null
|
||||
if(istype(user))
|
||||
current_user = user
|
||||
LAZYADD(current_user.mousemove_intercept_objects, src)
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/onMouseDown(object, location, params, mob)
|
||||
/obj/item/gun/energy/beam_rifle/onMouseDrag(src_object, over_object, src_location, over_location, params, mob)
|
||||
if(aiming)
|
||||
process_aim()
|
||||
aiming_beam()
|
||||
if(zoom_lock == ZOOM_LOCK_AUTOZOOM_FREEMOVE)
|
||||
zooming_angle = lastangle
|
||||
set_autozoom_pixel_offsets_immediate(zooming_angle)
|
||||
smooth_zooming(2)
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/onMouseDown(object, location, params, mob/mob)
|
||||
if(istype(mob))
|
||||
set_user(mob)
|
||||
if(istype(object, /obj/screen) && !istype(object, /obj/screen/click_catcher))
|
||||
return
|
||||
if((object in mob.contents) || (object == mob))
|
||||
return
|
||||
start_aiming()
|
||||
current_user = mob
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/onMouseUp(object, location, params, mob/M)
|
||||
/obj/item/gun/energy/beam_rifle/onMouseUp(object, location, params, mob/M)
|
||||
if(istype(object, /obj/screen) && !istype(object, /obj/screen/click_catcher))
|
||||
return
|
||||
process_aim()
|
||||
if(aiming_time_left <= aiming_time_fire_threshold)
|
||||
if(aiming_time_left <= aiming_time_fire_threshold && check_user())
|
||||
sync_ammo()
|
||||
afterattack(M.client.mouseObject, M, FALSE, M.client.mouseParams, passthrough = TRUE)
|
||||
stop_aiming()
|
||||
clear_tracers()
|
||||
QDEL_NULL(current_tracer)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/afterattack(atom/target, mob/living/user, flag, params, passthrough = FALSE)
|
||||
/obj/item/gun/energy/beam_rifle/afterattack(atom/target, mob/living/user, flag, params, passthrough = FALSE)
|
||||
if(flag) //It's adjacent, is the user, or is on the user's person
|
||||
if(target in user.contents) //can't shoot stuff inside us.
|
||||
return
|
||||
if(!ismob(target) || user.a_intent == INTENT_HARM) //melee attack
|
||||
return
|
||||
if(target == user && user.zone_selected != "mouth") //so we can't shoot ourselves (unless mouth selected)
|
||||
return
|
||||
if(!passthrough && (aiming_time > aiming_time_fire_threshold))
|
||||
return
|
||||
if(lastfire > world.time + delay)
|
||||
return
|
||||
lastfire = world.time
|
||||
. = ..()
|
||||
stop_aiming()
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/beam_rifle/proc/sync_ammo()
|
||||
/obj/item/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)
|
||||
/obj/item/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
|
||||
@@ -254,10 +382,10 @@
|
||||
var/structure_piercing = 2
|
||||
var/structure_bleed_coeff = 0.7
|
||||
var/do_pierce = TRUE
|
||||
var/obj/item/weapon/gun/energy/beam_rifle/host
|
||||
var/obj/item/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
|
||||
var/obj/item/gun/energy/beam_rifle/BR = loc
|
||||
if(!istype(BR))
|
||||
stack_trace("Beam rifle syncing error")
|
||||
host = BR
|
||||
@@ -298,6 +426,25 @@
|
||||
HS_BB.do_pierce = do_pierce
|
||||
HS_BB.gun = host
|
||||
|
||||
/obj/item/ammo_casing/energy/beam_rifle/throw_proj(atom/target, turf/targloc, mob/living/user, params, spread)
|
||||
var/turf/curloc = get_turf(user)
|
||||
if(!istype(curloc) || !BB)
|
||||
return FALSE
|
||||
var/obj/item/gun/energy/beam_rifle/gun = loc
|
||||
if(!targloc && gun)
|
||||
targloc = get_turf_in_angle(gun.lastangle, curloc, 10)
|
||||
else if(!targloc)
|
||||
return FALSE
|
||||
var/firing_dir
|
||||
if(BB.firer)
|
||||
firing_dir = BB.firer.dir
|
||||
if(!BB.suppressed && firing_effect_type)
|
||||
new firing_effect_type(get_turf(src), firing_dir)
|
||||
BB.preparePixelProjectile(target, targloc, user, params, spread)
|
||||
BB.fire(gun? gun.lastangle : null, null)
|
||||
BB = null
|
||||
return TRUE
|
||||
|
||||
/obj/item/ammo_casing/energy/beam_rifle/hitscan
|
||||
projectile_type = /obj/item/projectile/beam/beam_rifle/hitscan
|
||||
select_name = "beam"
|
||||
@@ -313,7 +460,7 @@
|
||||
flag = "energy"
|
||||
range = 150
|
||||
jitter = 10
|
||||
var/obj/item/weapon/gun/energy/beam_rifle/gun
|
||||
var/obj/item/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
|
||||
@@ -330,6 +477,7 @@
|
||||
var/impact_structure_damage = 0
|
||||
var/impact_direct_damage = 0
|
||||
var/turf/cached
|
||||
var/list/pierced = list()
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/proc/AOE(turf/epicenter)
|
||||
set waitfor = FALSE
|
||||
@@ -351,20 +499,29 @@
|
||||
/obj/item/projectile/beam/beam_rifle/proc/check_pierce(atom/target)
|
||||
if(!do_pierce)
|
||||
return FALSE
|
||||
if(pierced[target]) //we already pierced them go away
|
||||
loc = get_turf(target)
|
||||
return TRUE
|
||||
if(isclosedturf(target))
|
||||
if(wall_pierce++ < wall_pierce_amount)
|
||||
loc = target
|
||||
if(prob(wall_devastate))
|
||||
target.ex_act(EXPLODE_HEAVY)
|
||||
if(istype(target, /turf/closed/wall))
|
||||
var/turf/closed/wall/W = target
|
||||
W.dismantle_wall(TRUE, TRUE)
|
||||
else
|
||||
target.ex_act(EXPLODE_HEAVY)
|
||||
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(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)
|
||||
pierced[AM] = TRUE
|
||||
loc = get_turf(AM)
|
||||
structure_pierce++
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -396,22 +553,69 @@
|
||||
handle_impact(target)
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/Collide(atom/target)
|
||||
paused = TRUE
|
||||
if(check_pierce(target))
|
||||
permutated += target
|
||||
return FALSE
|
||||
if(!QDELETED(target))
|
||||
cached = get_turf(target)
|
||||
paused = FALSE
|
||||
. = ..()
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/on_hit(atom/target, blocked = FALSE)
|
||||
paused = TRUE
|
||||
if(!QDELETED(target))
|
||||
cached = get_turf(target)
|
||||
handle_hit(target)
|
||||
paused = FALSE
|
||||
. = ..()
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan
|
||||
icon_state = ""
|
||||
var/tracer_type = /obj/effect/temp_visual/projectile_beam/tracer
|
||||
var/tracer_type = /obj/effect/projectile_beam/tracer
|
||||
var/starting_z
|
||||
var/starting_p_x
|
||||
var/starting_p_y
|
||||
var/constant_tracer = FALSE
|
||||
var/travelled_p_x = 0
|
||||
var/travelled_p_y = 0
|
||||
var/tracer_spawned = FALSE
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/Destroy()
|
||||
paused = TRUE //STOP HITTING WHEN YOU'RE ALREADY BEING DELETED!
|
||||
spawn_tracer(constant_tracer)
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/proc/spawn_tracer(put_in_rifle = FALSE)
|
||||
if(tracer_spawned)
|
||||
return
|
||||
tracer_spawned = TRUE
|
||||
//Remind me to port baystation trajectories so this shit isn't needed...
|
||||
var/pixels_travelled = round(sqrt(travelled_p_x**2 + travelled_p_y**2),1)
|
||||
var/scaling = pixels_travelled/world.icon_size
|
||||
var/midpoint_p_x = round(starting_p_x + (travelled_p_x / 2))
|
||||
var/midpoint_p_y = round(starting_p_y + (travelled_p_y / 2))
|
||||
var/tracer_px = midpoint_p_x % world.icon_size
|
||||
var/tracer_py = midpoint_p_y % world.icon_size
|
||||
var/tracer_lx = (midpoint_p_x - tracer_px) / world.icon_size
|
||||
var/tracer_ly = (midpoint_p_y - tracer_py) / world.icon_size
|
||||
var/obj/effect/projectile_beam/PB = new tracer_type(src)
|
||||
PB.apply_vars(Angle, tracer_px, tracer_py, color, scaling, locate(tracer_lx,tracer_ly,starting_z))
|
||||
if(put_in_rifle && istype(gun))
|
||||
if(gun.current_tracer)
|
||||
QDEL_NULL(gun.current_tracer)
|
||||
gun.current_tracer = PB
|
||||
else
|
||||
QDEL_IN(PB, 5)
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/proc/check_for_turf_edge(turf/T)
|
||||
if(!istype(T))
|
||||
return TRUE
|
||||
var/tx = T.x
|
||||
var/ty = T.y
|
||||
if(tx < 10 || tx > (world.maxx - 10) || ty < 10 || ty > (world.maxy-10))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/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
|
||||
@@ -423,6 +627,12 @@
|
||||
var/old_pixel_x = pixel_x
|
||||
var/old_pixel_y = pixel_y
|
||||
var/safety = 0 //The code works fine, but... just in case...
|
||||
var/turf/c2
|
||||
var/starting_x = loc.x
|
||||
var/starting_y = loc.y
|
||||
starting_z = loc.z
|
||||
starting_p_x = starting_x * world.icon_size + pixel_x
|
||||
starting_p_y = starting_y * world.icon_size + pixel_y
|
||||
while(loc)
|
||||
if(++safety > (range * 3)) //If it's looping for way, way too long...
|
||||
return //Kill!
|
||||
@@ -437,6 +647,8 @@
|
||||
transform = M
|
||||
var/Pixel_x=sin(Angle)+16*sin(Angle)*2
|
||||
var/Pixel_y=cos(Angle)+16*cos(Angle)*2
|
||||
travelled_p_x += Pixel_x
|
||||
travelled_p_y += Pixel_y
|
||||
var/pixel_x_offset = old_pixel_x + Pixel_x
|
||||
var/pixel_y_offset = old_pixel_y + Pixel_y
|
||||
var/new_x = x
|
||||
@@ -466,30 +678,26 @@
|
||||
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)
|
||||
animate(src, pixel_x = pixel_x_offset, pixel_y = pixel_y_offset, time = max(1, (delay <= 3 ? delay - 1 : delay)), flags_1 = 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))
|
||||
Collide(original)
|
||||
if(can_hit_target(original, permutated))
|
||||
Collide(original)
|
||||
c2 = loc
|
||||
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)
|
||||
if(check_for_turf_edge(loc))
|
||||
spawn_tracer(constant_tracer)
|
||||
if(istype(c2))
|
||||
cached = c2
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam
|
||||
tracer_type = /obj/effect/temp_visual/projectile_beam/tracer/aiming
|
||||
tracer_type = /obj/effect/projectile_beam/tracer/aiming
|
||||
name = "aiming beam"
|
||||
hitsound = null
|
||||
hitsound_wall = null
|
||||
nodamage = TRUE
|
||||
damage = 0
|
||||
constant_tracer = TRUE
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/prehit(atom/target)
|
||||
qdel(src)
|
||||
@@ -499,37 +707,69 @@
|
||||
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
|
||||
/obj/effect/projectile_beam
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
layer = ABOVE_MOB_LAYER
|
||||
anchored = TRUE
|
||||
duration = 5
|
||||
randomdir = FALSE
|
||||
light_power = 1
|
||||
light_range = 2
|
||||
light_color = "#00ffff"
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
flags_1 = ABSTRACT_1
|
||||
appearance_flags = 0
|
||||
|
||||
/obj/effect/temp_visual/projectile_beam/New(time = 5, angle_override, p_x, p_y, color_override)
|
||||
duration = time
|
||||
/obj/effect/projectile_beam/proc/scale_to(nx,ny,override=TRUE)
|
||||
var/matrix/M
|
||||
if(!override)
|
||||
M = transform
|
||||
else
|
||||
M = new
|
||||
M.Scale(nx,ny)
|
||||
transform = M
|
||||
|
||||
/obj/effect/projectile_beam/proc/turn_to(angle,override=TRUE)
|
||||
var/matrix/M
|
||||
if(!override)
|
||||
M = transform
|
||||
else
|
||||
M = new
|
||||
M.Turn(angle)
|
||||
transform = M
|
||||
|
||||
/obj/effect/projectile_beam/New(angle_override, p_x, p_y, color_override, scaling = 1)
|
||||
if(angle_override && p_x && p_y && color_override && scaling)
|
||||
apply_vars(angle_override, p_x, p_y, color_override, scaling)
|
||||
return ..()
|
||||
|
||||
/obj/effect/projectile_beam/proc/apply_vars(angle_override, p_x, p_y, color_override, scaling = 1, new_loc, increment = 0)
|
||||
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
|
||||
..()
|
||||
scale_to(1,scaling, FALSE)
|
||||
turn_to(angle_override, FALSE)
|
||||
if(!isnull(new_loc)) //If you want to null it just delete it...
|
||||
forceMove(new_loc)
|
||||
for(var/i in 1 to increment)
|
||||
pixel_x += round((sin(angle_override)+16*sin(angle_override)*2), 1)
|
||||
pixel_y += round((cos(angle_override)+16*cos(angle_override)*2), 1)
|
||||
|
||||
/obj/effect/temp_visual/projectile_beam/tracer
|
||||
/obj/effect/projectile_beam/tracer
|
||||
icon_state = "tracer_beam"
|
||||
|
||||
/obj/effect/temp_visual/projectile_beam/tracer/aiming
|
||||
/obj/effect/projectile_beam/tracer/aiming
|
||||
icon_state = "gbeam"
|
||||
duration = 1
|
||||
|
||||
/datum/action/item_action/zoom_speed_action
|
||||
name = "Toggle Zooming Speed"
|
||||
icon_icon = 'icons/mob/actions/actions_spells.dmi'
|
||||
button_icon_state = "projectile"
|
||||
background_icon_state = "bg_tech"
|
||||
|
||||
/datum/action/item_action/zoom_lock_action
|
||||
name = "Switch Zoom Mode"
|
||||
icon_icon = 'icons/mob/actions/actions_items.dmi'
|
||||
button_icon_state = "zoom_mode"
|
||||
background_icon_state = "bg_tech"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
diff a/code/modules/projectiles/guns/beam_rifle.dm b/code/modules/projectiles/guns/beam_rifle.dm (rejected hunks)
|
||||
@@ -715,7 +715,7 @@
|
||||
light_range = 2
|
||||
light_color = "#00ffff"
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
- flags = ABSTRACT
|
||||
+ flags_1 = ABSTRACT_1
|
||||
appearance_flags = 0
|
||||
|
||||
/obj/effect/projectile_beam/proc/scale_to(nx,ny,override=TRUE)
|
||||
@@ -1,11 +1,11 @@
|
||||
/obj/item/weapon/gun/energy
|
||||
/obj/item/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/obj/item/stock_parts/cell/cell //What type of power cell this uses
|
||||
var/cell_type = /obj/item/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.
|
||||
@@ -19,16 +19,16 @@
|
||||
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)
|
||||
/obj/item/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()
|
||||
/obj/item/gun/energy/get_cell()
|
||||
return cell
|
||||
|
||||
/obj/item/weapon/gun/energy/Initialize()
|
||||
/obj/item/gun/energy/Initialize()
|
||||
. = ..()
|
||||
if(cell_type)
|
||||
cell = new cell_type(src)
|
||||
@@ -41,7 +41,7 @@
|
||||
START_PROCESSING(SSobj, src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/proc/update_ammo_types()
|
||||
/obj/item/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]
|
||||
@@ -51,12 +51,12 @@
|
||||
fire_sound = shot.fire_sound
|
||||
fire_delay = shot.delay
|
||||
|
||||
/obj/item/weapon/gun/energy/Destroy()
|
||||
/obj/item/gun/energy/Destroy()
|
||||
QDEL_NULL(cell)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/process()
|
||||
/obj/item/gun/energy/process()
|
||||
if(selfcharge)
|
||||
charge_tick++
|
||||
if(charge_tick < charge_delay)
|
||||
@@ -69,16 +69,16 @@
|
||||
recharge_newshot(1)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/attack_self(mob/living/user as mob)
|
||||
/obj/item/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()
|
||||
/obj/item/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)
|
||||
/obj/item/gun/energy/recharge_newshot(no_cyborg_drain)
|
||||
if (!ammo_type || !cell)
|
||||
return
|
||||
if(use_cyborg_cell && !no_cyborg_drain)
|
||||
@@ -95,14 +95,14 @@
|
||||
if(!chambered.BB)
|
||||
chambered.newshot()
|
||||
|
||||
/obj/item/weapon/gun/energy/process_chamber()
|
||||
/obj/item/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)
|
||||
/obj/item/gun/energy/proc/select_fire(mob/living/user)
|
||||
select++
|
||||
if (select > ammo_type.len)
|
||||
select = 1
|
||||
@@ -116,7 +116,7 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/update_icon()
|
||||
/obj/item/gun/energy/update_icon()
|
||||
..()
|
||||
if(!automatic_charge_overlays)
|
||||
return
|
||||
@@ -146,10 +146,10 @@
|
||||
itemState += "[ratio]"
|
||||
item_state = itemState
|
||||
|
||||
/obj/item/weapon/gun/energy/ui_action_click()
|
||||
/obj/item/gun/energy/ui_action_click()
|
||||
toggle_gunlight()
|
||||
|
||||
/obj/item/weapon/gun/energy/suicide_act(mob/user)
|
||||
/obj/item/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)
|
||||
@@ -169,7 +169,7 @@
|
||||
return (OXYLOSS)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/vv_edit_var(var_name, var_value)
|
||||
/obj/item/gun/energy/vv_edit_var(var_name, var_value)
|
||||
switch(var_name)
|
||||
if("selfcharge")
|
||||
if(var_value)
|
||||
@@ -179,7 +179,7 @@
|
||||
. = ..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/ignition_effect(atom/A, mob/living/user)
|
||||
/obj/item/gun/energy/ignition_effect(atom/A, mob/living/user)
|
||||
if(!can_shoot() || !ammo_type[select])
|
||||
shoot_with_empty_chamber()
|
||||
. = ""
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator
|
||||
/obj/item/gun/energy/kinetic_accelerator
|
||||
name = "proto-kinetic accelerator"
|
||||
desc = "A self recharging, ranged mining tool that does increased damage in low pressure."
|
||||
icon_state = "kineticgun"
|
||||
item_state = "kineticgun"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/kinetic)
|
||||
cell_type = /obj/item/weapon/stock_parts/cell/emproof
|
||||
cell_type = /obj/item/stock_parts/cell/emproof
|
||||
needs_permit = 0
|
||||
unique_rename = 1
|
||||
origin_tech = "combat=3;powerstorage=3;engineering=3"
|
||||
@@ -26,7 +26,7 @@
|
||||
var/empty_state = "kineticgun_empty"
|
||||
var/recharge_timerid
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/examine(mob/user)
|
||||
/obj/item/gun/energy/kinetic_accelerator/examine(mob/user)
|
||||
..()
|
||||
if(max_mod_capacity)
|
||||
to_chat(user, "<b>[get_remaining_mod_capacity()]%</b> mod capacity remaining.")
|
||||
@@ -34,8 +34,8 @@
|
||||
var/obj/item/borg/upgrade/modkit/M = A
|
||||
to_chat(user, "<span class='notice'>There is a [M.name] mod installed, using <b>[M.cost]%</b> capacity.</span>")
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/attackby(obj/item/A, mob/user)
|
||||
if(istype(A, /obj/item/weapon/crowbar))
|
||||
/obj/item/gun/energy/kinetic_accelerator/attackby(obj/item/A, mob/user)
|
||||
if(istype(A, /obj/item/crowbar))
|
||||
if(modkits.len)
|
||||
to_chat(user, "<span class='notice'>You pry the modifications out.</span>")
|
||||
playsound(loc, A.usesound, 100, 1)
|
||||
@@ -49,59 +49,59 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/get_remaining_mod_capacity()
|
||||
/obj/item/gun/energy/kinetic_accelerator/proc/get_remaining_mod_capacity()
|
||||
var/current_capacity_used = 0
|
||||
for(var/A in get_modkits())
|
||||
var/obj/item/borg/upgrade/modkit/M = A
|
||||
current_capacity_used += M.cost
|
||||
return max_mod_capacity - current_capacity_used
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/get_modkits()
|
||||
/obj/item/gun/energy/kinetic_accelerator/proc/get_modkits()
|
||||
. = list()
|
||||
for(var/A in modkits)
|
||||
. += A
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/modify_projectile(obj/item/projectile/kinetic/K)
|
||||
/obj/item/gun/energy/kinetic_accelerator/proc/modify_projectile(obj/item/projectile/kinetic/K)
|
||||
K.kinetic_gun = src //do something special on-hit, easy!
|
||||
for(var/A in get_modkits())
|
||||
var/obj/item/borg/upgrade/modkit/M = A
|
||||
M.modify_projectile(K)
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg
|
||||
/obj/item/gun/energy/kinetic_accelerator/cyborg
|
||||
holds_charge = TRUE
|
||||
unique_frequency = TRUE
|
||||
max_mod_capacity = 80
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/Initialize()
|
||||
/obj/item/gun/energy/kinetic_accelerator/Initialize()
|
||||
. = ..()
|
||||
if(!holds_charge)
|
||||
empty()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/shoot_live_shot()
|
||||
/obj/item/gun/energy/kinetic_accelerator/shoot_live_shot()
|
||||
. = ..()
|
||||
attempt_reload()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/equipped(mob/user)
|
||||
/obj/item/gun/energy/kinetic_accelerator/equipped(mob/user)
|
||||
. = ..()
|
||||
if(!can_shoot())
|
||||
attempt_reload()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/dropped()
|
||||
/obj/item/gun/energy/kinetic_accelerator/dropped()
|
||||
. = ..()
|
||||
if(!holds_charge)
|
||||
// Put it on a delay because moving item from slot to hand
|
||||
// calls dropped().
|
||||
addtimer(CALLBACK(src, .proc/empty_if_not_held), 2)
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty_if_not_held()
|
||||
/obj/item/gun/energy/kinetic_accelerator/proc/empty_if_not_held()
|
||||
if(!ismob(loc))
|
||||
empty()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty()
|
||||
/obj/item/gun/energy/kinetic_accelerator/proc/empty()
|
||||
cell.use(cell.charge)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/attempt_reload(recharge_time)
|
||||
/obj/item/gun/energy/kinetic_accelerator/proc/attempt_reload(recharge_time)
|
||||
if(overheat)
|
||||
return
|
||||
if(!recharge_time)
|
||||
@@ -110,7 +110,7 @@
|
||||
|
||||
var/carried = 0
|
||||
if(!unique_frequency)
|
||||
for(var/obj/item/weapon/gun/energy/kinetic_accelerator/K in loc.GetAllContents())
|
||||
for(var/obj/item/gun/energy/kinetic_accelerator/K in loc.GetAllContents())
|
||||
|
||||
carried++
|
||||
|
||||
@@ -121,10 +121,10 @@
|
||||
deltimer(recharge_timerid)
|
||||
recharge_timerid = addtimer(CALLBACK(src, .proc/reload), recharge_time * carried, TIMER_STOPPABLE)
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/emp_act(severity)
|
||||
/obj/item/gun/energy/kinetic_accelerator/emp_act(severity)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
|
||||
/obj/item/gun/energy/kinetic_accelerator/proc/reload()
|
||||
cell.give(cell.maxcharge)
|
||||
recharge_newshot(1)
|
||||
if(!suppressed)
|
||||
@@ -134,7 +134,7 @@
|
||||
update_icon()
|
||||
overheat = FALSE
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/update_icon()
|
||||
/obj/item/gun/energy/kinetic_accelerator/update_icon()
|
||||
..()
|
||||
|
||||
if(empty_state && !can_shoot())
|
||||
@@ -149,8 +149,8 @@
|
||||
|
||||
/obj/item/ammo_casing/energy/kinetic/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
|
||||
..()
|
||||
if(loc && istype(loc, /obj/item/weapon/gun/energy/kinetic_accelerator))
|
||||
var/obj/item/weapon/gun/energy/kinetic_accelerator/KA = loc
|
||||
if(loc && istype(loc, /obj/item/gun/energy/kinetic_accelerator))
|
||||
var/obj/item/gun/energy/kinetic_accelerator/KA = loc
|
||||
KA.modify_projectile(BB)
|
||||
|
||||
//Projectiles
|
||||
@@ -165,7 +165,7 @@
|
||||
|
||||
var/pressure_decrease_active = FALSE
|
||||
var/pressure_decrease = 0.25
|
||||
var/obj/item/weapon/gun/energy/kinetic_accelerator/kinetic_gun
|
||||
var/obj/item/gun/energy/kinetic_accelerator/kinetic_gun
|
||||
|
||||
/obj/item/projectile/kinetic/Destroy()
|
||||
kinetic_gun = null
|
||||
@@ -217,7 +217,7 @@
|
||||
origin_tech = "programming=2;materials=2;magnets=4"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
require_module = 1
|
||||
module_type = /obj/item/weapon/robot_module/miner
|
||||
module_type = /obj/item/robot_module/miner
|
||||
var/denied_type = null
|
||||
var/maximum_of_type = 1
|
||||
var/cost = 30
|
||||
@@ -228,7 +228,7 @@
|
||||
to_chat(user, "<span class='notice'>Occupies <b>[cost]%</b> of mod capacity.</span>")
|
||||
|
||||
/obj/item/borg/upgrade/modkit/attackby(obj/item/A, mob/user)
|
||||
if(istype(A, /obj/item/weapon/gun/energy/kinetic_accelerator) && !issilicon(user))
|
||||
if(istype(A, /obj/item/gun/energy/kinetic_accelerator) && !issilicon(user))
|
||||
install(A, user)
|
||||
else
|
||||
..()
|
||||
@@ -237,10 +237,10 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
for(var/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg/H in R.module.modules)
|
||||
for(var/obj/item/gun/energy/kinetic_accelerator/cyborg/H in R.module.modules)
|
||||
return install(H, usr)
|
||||
|
||||
/obj/item/borg/upgrade/modkit/proc/install(obj/item/weapon/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
/obj/item/borg/upgrade/modkit/proc/install(obj/item/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
. = TRUE
|
||||
if(denied_type)
|
||||
var/number_of_denied = 0
|
||||
@@ -264,18 +264,18 @@
|
||||
to_chat(user, "<span class='notice'>You don't have room(<b>[KA.get_remaining_mod_capacity()]%</b> remaining, [cost]% needed) to install this modkit. Use a crowbar to remove existing modkits.</span>")
|
||||
. = FALSE
|
||||
|
||||
/obj/item/borg/upgrade/modkit/proc/uninstall(obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/proc/uninstall(obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
forceMove(get_turf(KA))
|
||||
KA.modkits -= src
|
||||
|
||||
/obj/item/borg/upgrade/modkit/proc/modify_projectile(obj/item/projectile/kinetic/K)
|
||||
|
||||
//use this one for effects you want to trigger before any damage is done at all and before damage is decreased by pressure
|
||||
/obj/item/borg/upgrade/modkit/proc/projectile_prehit(obj/item/projectile/kinetic/K, atom/target, obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/proc/projectile_prehit(obj/item/projectile/kinetic/K, atom/target, obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
//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)
|
||||
/obj/item/borg/upgrade/modkit/proc/projectile_strike_predamage(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/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)
|
||||
/obj/item/borg/upgrade/modkit/proc/projectile_strike(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
|
||||
//Range
|
||||
/obj/item/borg/upgrade/modkit/range
|
||||
@@ -304,12 +304,12 @@
|
||||
desc = "Decreases the cooldown of a kinetic accelerator."
|
||||
modifier = 2.5
|
||||
|
||||
/obj/item/borg/upgrade/modkit/cooldown/install(obj/item/weapon/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
/obj/item/borg/upgrade/modkit/cooldown/install(obj/item/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
KA.overheat_time -= modifier
|
||||
|
||||
/obj/item/borg/upgrade/modkit/cooldown/uninstall(obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/cooldown/uninstall(obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
KA.overheat_time += modifier
|
||||
..()
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
var/turf_aoe = FALSE
|
||||
var/stats_stolen = FALSE
|
||||
|
||||
/obj/item/borg/upgrade/modkit/aoe/install(obj/item/weapon/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
/obj/item/borg/upgrade/modkit/aoe/install(obj/item/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
for(var/obj/item/borg/upgrade/modkit/aoe/AOE in KA.modkits) //make sure only one of the aoe modules has values if somebody has multiple
|
||||
@@ -332,7 +332,7 @@
|
||||
AOE.turf_aoe = FALSE
|
||||
AOE.stats_stolen = TRUE
|
||||
|
||||
/obj/item/borg/upgrade/modkit/aoe/uninstall(obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/aoe/uninstall(obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
..()
|
||||
modifier = initial(modifier) //get our modifiers back
|
||||
turf_aoe = initial(turf_aoe)
|
||||
@@ -341,7 +341,7 @@
|
||||
/obj/item/borg/upgrade/modkit/aoe/modify_projectile(obj/item/projectile/kinetic/K)
|
||||
K.name = "kinetic explosion"
|
||||
|
||||
/obj/item/borg/upgrade/modkit/aoe/projectile_strike(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/aoe/projectile_strike(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
if(stats_stolen)
|
||||
return
|
||||
new /obj/effect/temp_visual/explosion/fast(target_turf)
|
||||
@@ -381,7 +381,7 @@
|
||||
modifier = -14 //Makes the cooldown 3 seconds(with no cooldown mods) if you miss. Don't miss.
|
||||
cost = 50
|
||||
|
||||
/obj/item/borg/upgrade/modkit/cooldown/repeater/projectile_strike_predamage(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/cooldown/repeater/projectile_strike_predamage(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
var/valid_repeat = FALSE
|
||||
if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
@@ -401,7 +401,7 @@
|
||||
cost = 20
|
||||
var/static/list/damage_heal_order = list(BRUTE, BURN, OXY)
|
||||
|
||||
/obj/item/borg/upgrade/modkit/lifesteal/projectile_prehit(obj/item/projectile/kinetic/K, atom/target, obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/lifesteal/projectile_prehit(obj/item/projectile/kinetic/K, atom/target, obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
if(isliving(target) && isliving(K.firer))
|
||||
var/mob/living/L = target
|
||||
if(L.stat == DEAD)
|
||||
@@ -416,7 +416,7 @@
|
||||
cost = 30
|
||||
modifier = 0.25 //A bonus 15 damage if you burst the field on a target, 60 if you lure them into it.
|
||||
|
||||
/obj/item/borg/upgrade/modkit/resonator_blasts/projectile_strike(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/resonator_blasts/projectile_strike(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
if(target_turf && !ismineralturf(target_turf)) //Don't make fields on mineral turfs.
|
||||
var/obj/effect/temp_visual/resonance/R = locate(/obj/effect/temp_visual/resonance) in target_turf
|
||||
if(R)
|
||||
@@ -427,14 +427,14 @@
|
||||
|
||||
/obj/item/borg/upgrade/modkit/bounty
|
||||
name = "death syphon"
|
||||
desc = "Killing or assisting in killing a creature permenantly increases your damage against that type of creature."
|
||||
desc = "Killing or assisting in killing a creature permanently increases your damage against that type of creature."
|
||||
denied_type = /obj/item/borg/upgrade/modkit/bounty
|
||||
modifier = 1.25
|
||||
cost = 30
|
||||
var/maximum_bounty = 25
|
||||
var/list/bounties_reaped = list()
|
||||
|
||||
/obj/item/borg/upgrade/modkit/bounty/projectile_prehit(obj/item/projectile/kinetic/K, atom/target, obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/bounty/projectile_prehit(obj/item/projectile/kinetic/K, atom/target, obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
var/list/existing_marks = L.has_status_effect_list(STATUS_EFFECT_SYPHONMARK)
|
||||
@@ -445,7 +445,7 @@
|
||||
qdel(SM)
|
||||
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)
|
||||
/obj/item/borg/upgrade/modkit/bounty/projectile_strike(obj/item/projectile/kinetic/K, turf/target_turf, atom/target, obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
if(bounties_reaped[L.type])
|
||||
@@ -484,12 +484,12 @@
|
||||
cost = 20
|
||||
denied_type = /obj/item/borg/upgrade/modkit/trigger_guard
|
||||
|
||||
/obj/item/borg/upgrade/modkit/trigger_guard/install(obj/item/weapon/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
/obj/item/borg/upgrade/modkit/trigger_guard/install(obj/item/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
KA.trigger_guard = TRIGGER_GUARD_ALLOW_ALL
|
||||
|
||||
/obj/item/borg/upgrade/modkit/trigger_guard/uninstall(obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/trigger_guard/uninstall(obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
KA.trigger_guard = TRIGGER_GUARD_NORMAL
|
||||
..()
|
||||
|
||||
@@ -504,13 +504,13 @@
|
||||
var/chassis_icon = "kineticgun_u"
|
||||
var/chassis_name = "super-kinetic accelerator"
|
||||
|
||||
/obj/item/borg/upgrade/modkit/chassis_mod/install(obj/item/weapon/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
/obj/item/borg/upgrade/modkit/chassis_mod/install(obj/item/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
KA.icon_state = chassis_icon
|
||||
KA.name = chassis_name
|
||||
|
||||
/obj/item/borg/upgrade/modkit/chassis_mod/uninstall(obj/item/weapon/gun/energy/kinetic_accelerator/KA)
|
||||
/obj/item/borg/upgrade/modkit/chassis_mod/uninstall(obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
KA.icon_state = initial(KA.icon_state)
|
||||
KA.name = initial(KA.name)
|
||||
..()
|
||||
@@ -534,7 +534,7 @@
|
||||
|
||||
/obj/item/borg/upgrade/modkit/tracer/adjustable
|
||||
name = "adjustable tracer bolts"
|
||||
desc = "Causes kinetic accelerator bolts to have a adjustably-colored tracer trail and explosion. Use in-hand to change color."
|
||||
desc = "Causes kinetic accelerator bolts to have a adjustable-colored tracer trail and explosion. Use in-hand to change color."
|
||||
|
||||
/obj/item/borg/upgrade/modkit/tracer/adjustable/attack_self(mob/user)
|
||||
bolt_color = input(user,"Choose Color") as color
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/energy/laser
|
||||
/obj/item/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"
|
||||
@@ -10,7 +10,7 @@
|
||||
ammo_x_offset = 1
|
||||
shaded_charge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/practice
|
||||
/obj/item/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"
|
||||
@@ -18,20 +18,20 @@
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/retro
|
||||
/obj/item/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
|
||||
/obj/item/gun/energy/laser/retro/old
|
||||
name ="laser gun"
|
||||
icon_state = "retro"
|
||||
desc = "First generation lasergun, developed by Nanotrasen. Suffers from ammo issues but its unique ability to recharge its ammo without the need of a magazine helps compensate. You really hope someone has developed a better lasergun while you were in cyro."
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/lasergun/old)
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain
|
||||
/obj/item/gun/energy/laser/captain
|
||||
name = "antique laser gun"
|
||||
icon_state = "caplaser"
|
||||
item_state = "caplaser"
|
||||
@@ -42,29 +42,29 @@
|
||||
selfcharge = 1
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain/scattershot
|
||||
/obj/item/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."
|
||||
desc = "An industrial-grade heavy-duty laser rifle with a modified laser lens to scatter its shot into multiple smaller lasers. The inner-core can self-charge for theoretically 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
|
||||
/obj/item/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()
|
||||
/obj/item/gun/energy/laser/cyborg/emp_act()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/scatter
|
||||
/obj/item/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
|
||||
/obj/item/gun/energy/laser/scatter/shotty
|
||||
name = "energy shotgun"
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
icon_state = "cshotgun"
|
||||
@@ -76,14 +76,14 @@
|
||||
|
||||
///Laser Cannon
|
||||
|
||||
/obj/item/weapon/gun/energy/lasercannon
|
||||
/obj/item/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
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = SLOT_BACK
|
||||
origin_tech = "combat=4;magnets=4;powerstorage=3"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/accelerator)
|
||||
@@ -106,9 +106,9 @@
|
||||
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"
|
||||
/obj/item/gun/energy/xray
|
||||
name = "x-ray laser gun"
|
||||
desc = "A high-power laser gun capable of expelling concentrated x-ray 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"
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
////////Laser Tag////////////////////
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/bluetag
|
||||
/obj/item/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!"
|
||||
@@ -130,7 +130,7 @@
|
||||
ammo_x_offset = 2
|
||||
selfcharge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/redtag
|
||||
/obj/item/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!"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/energy/megabuster
|
||||
/obj/item/gun/energy/megabuster
|
||||
name = "Mega-buster"
|
||||
desc = "An arm-mounted buster toy!"
|
||||
icon_state = "megabuster"
|
||||
@@ -9,12 +9,12 @@
|
||||
needs_permit = 0
|
||||
selfcharge = 1
|
||||
icon = 'icons/obj/guns/VGguns.dmi'
|
||||
/obj/item/weapon/gun/energy/megabuster/proto
|
||||
/obj/item/gun/energy/megabuster/proto
|
||||
name = "Proto-buster"
|
||||
icon_state = "protobuster"
|
||||
item_state = "protobuster"
|
||||
|
||||
/obj/item/weapon/gun/energy/mmlbuster
|
||||
/obj/item/gun/energy/mmlbuster
|
||||
name = "Buster Cannon"
|
||||
desc = "An antique arm-mounted buster cannon."
|
||||
icon = 'icons/obj/guns/VGguns.dmi'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/energy/plasma //Not intended to be used, use its children instead.
|
||||
/obj/item/gun/energy/plasma //Not intended to be used, use its children instead.
|
||||
name = "plasma gun"
|
||||
desc = "A high-power plasma gun. You shouldn't ever see this."
|
||||
icon_state = "xray"
|
||||
@@ -8,7 +8,7 @@
|
||||
shaded_charge = 1
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/plasma/rifle
|
||||
/obj/item/gun/energy/plasma/rifle
|
||||
name = "plasma cannon"
|
||||
desc = "A state of the art cannon utilizing plasma in a uranium-235 lined core to output hi-power, radiating bolts of energy."
|
||||
icon_state = "alienrifle"
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/plasma/light
|
||||
/obj/item/gun/energy/plasma/light
|
||||
name = "plasma rifle"
|
||||
desc = "A state of the art rifle utilizing plasma in a uranium-235 lined core to output radiating bolts of energy."
|
||||
icon_state = "lightalienrifle"
|
||||
@@ -30,7 +30,7 @@
|
||||
ammo_x_offset = 2
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/plasma/MP40k
|
||||
/obj/item/gun/energy/plasma/MP40k
|
||||
name = "Plasma MP40k"
|
||||
desc = "A plasma MP40k. Ich liebe den geruch von plasma am morgen."
|
||||
icon_state = "PlasMP"
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
//Laser rifles, technically lazer, but w/e
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/rifle
|
||||
/obj/item/gun/energy/laser/rifle
|
||||
name = "laser rifle"
|
||||
desc = "A laser rifle issued to high ranking members of a certain shadow corporation."
|
||||
icon_state = "xcomlasergun"
|
||||
@@ -50,7 +50,7 @@
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/lasergun)
|
||||
ammo_x_offset = 4
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/LaserAK
|
||||
/obj/item/gun/energy/laser/LaserAK
|
||||
name = "Laser AK470"
|
||||
desc = "A laser AK. Death solves all problems -- No man, no problem."
|
||||
icon_state = "LaserAK"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/energy/pulse
|
||||
/obj/item/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"
|
||||
@@ -6,18 +6,18 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 10
|
||||
modifystate = TRUE
|
||||
flags = CONDUCT
|
||||
flags_1 = CONDUCT_1
|
||||
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"
|
||||
cell_type = "/obj/item/stock_parts/cell/pulse"
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/emp_act(severity)
|
||||
/obj/item/gun/energy/pulse/emp_act(severity)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize
|
||||
/obj/item/gun/energy/pulse/prize
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize/Initialize()
|
||||
/obj/item/gun/energy/pulse/prize/Initialize()
|
||||
. = ..()
|
||||
GLOB.poi_list += src
|
||||
var/msg = "A pulse rifle prize has been created at [ADMIN_COORDJMP(src)]"
|
||||
@@ -27,52 +27,52 @@
|
||||
|
||||
notify_ghosts("Someone won a pulse rifle as a prize!", source = src, action = NOTIFY_ORBIT)
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize/Destroy()
|
||||
/obj/item/gun/energy/pulse/prize/Destroy()
|
||||
GLOB.poi_list -= src
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/loyalpin
|
||||
/obj/item/gun/energy/pulse/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/carbine
|
||||
/obj/item/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"
|
||||
cell_type = "/obj/item/stock_parts/cell/pulse/carbine"
|
||||
can_flashlight = 1
|
||||
flight_x_offset = 18
|
||||
flight_y_offset = 12
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/carbine/loyalpin
|
||||
/obj/item/gun/energy/pulse/carbine/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol
|
||||
/obj/item/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"
|
||||
cell_type = "/obj/item/stock_parts/cell/pulse/pistol"
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol/loyalpin
|
||||
/obj/item/gun/energy/pulse/pistol/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/destroyer
|
||||
/obj/item/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"
|
||||
cell_type = "/obj/item/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)
|
||||
/obj/item/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
|
||||
/obj/item/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"
|
||||
cell_type = "/obj/item/stock_parts/cell/infinite"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
diff a/code/modules/projectiles/guns/energy/pulse.dm b/code/modules/projectiles/guns/energy/pulse.dm (rejected hunks)
|
||||
@@ -6,7 +6,7 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 10
|
||||
modifystate = TRUE
|
||||
- flags = CONDUCT
|
||||
+ flags_1 = CONDUCT_1
|
||||
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/stock_parts/cell/pulse"
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/energy/taser
|
||||
/obj/item/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"
|
||||
@@ -7,7 +7,7 @@
|
||||
origin_tech = "combat=3"
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/tesla_revolver
|
||||
/obj/item/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"
|
||||
@@ -18,7 +18,7 @@
|
||||
pin = null
|
||||
shaded_charge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/e_gun/advtaser
|
||||
/obj/item/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"
|
||||
@@ -26,14 +26,14 @@
|
||||
origin_tech = "combat=4"
|
||||
ammo_x_offset = 2
|
||||
|
||||
/obj/item/weapon/gun/energy/e_gun/advtaser/cyborg
|
||||
/obj/item/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
|
||||
/obj/item/gun/energy/disabler
|
||||
name = "disabler"
|
||||
desc = "A self-defense weapon that exhausts organic targets, weakening them until they collapse."
|
||||
icon_state = "disabler"
|
||||
@@ -42,7 +42,7 @@
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/disabler)
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler/cyborg
|
||||
/obj/item/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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/grenadelauncher
|
||||
/obj/item/gun/grenadelauncher
|
||||
name = "grenade launcher"
|
||||
desc = "a terrible, terrible thing. it's really awful!"
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
@@ -12,13 +12,13 @@
|
||||
var/max_grenades = 3
|
||||
materials = list(MAT_METAL=2000)
|
||||
|
||||
/obj/item/weapon/gun/grenadelauncher/examine(mob/user)
|
||||
/obj/item/gun/grenadelauncher/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "[grenades.len] / [max_grenades] grenades loaded.")
|
||||
|
||||
/obj/item/weapon/gun/grenadelauncher/attackby(obj/item/I, mob/user, params)
|
||||
/obj/item/gun/grenadelauncher/attackby(obj/item/I, mob/user, params)
|
||||
|
||||
if((istype(I, /obj/item/weapon/grenade)))
|
||||
if((istype(I, /obj/item/grenade)))
|
||||
if(grenades.len < max_grenades)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
@@ -28,7 +28,7 @@
|
||||
else
|
||||
to_chat(usr, "<span class='danger'>The grenade launcher cannot hold more grenades.</span>")
|
||||
|
||||
/obj/item/weapon/gun/grenadelauncher/afterattack(obj/target, mob/user , flag)
|
||||
/obj/item/gun/grenadelauncher/afterattack(obj/target, mob/user , flag)
|
||||
if(target == user)
|
||||
return
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
else
|
||||
to_chat(user, "<span class='danger'>The grenade launcher is empty.</span>")
|
||||
|
||||
/obj/item/weapon/gun/grenadelauncher/proc/fire_grenade(atom/target, mob/user)
|
||||
/obj/item/gun/grenadelauncher/proc/fire_grenade(atom/target, mob/user)
|
||||
user.visible_message("<span class='danger'>[user] fired a grenade!</span>", \
|
||||
"<span class='danger'>You fire the grenade launcher!</span>")
|
||||
var/obj/item/weapon/grenade/F = grenades[1] //Now with less copypasta!
|
||||
var/obj/item/grenade/F = grenades[1] //Now with less copypasta!
|
||||
grenades -= F
|
||||
F.loc = user.loc
|
||||
F.throw_at(target, 30, 2, user)
|
||||
@@ -49,4 +49,4 @@
|
||||
F.active = 1
|
||||
F.icon_state = initial(F.icon_state) + "_active"
|
||||
playsound(user.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
addtimer(CALLBACK(F, /obj/item/weapon/grenade.proc/prime), 15)
|
||||
addtimer(CALLBACK(F, /obj/item/grenade.proc/prime), 15)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/obj/item/weapon/gun/magic
|
||||
/obj/item/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
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
var/max_charges = 6
|
||||
var/charges = 0
|
||||
@@ -22,7 +22,7 @@
|
||||
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)
|
||||
/obj/item/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))
|
||||
@@ -32,19 +32,19 @@
|
||||
no_den_usage = 0
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magic/can_shoot()
|
||||
/obj/item/gun/magic/can_shoot()
|
||||
return charges
|
||||
|
||||
/obj/item/weapon/gun/magic/recharge_newshot()
|
||||
/obj/item/gun/magic/recharge_newshot()
|
||||
if (charges && chambered && !chambered.BB)
|
||||
chambered.newshot()
|
||||
|
||||
/obj/item/weapon/gun/magic/process_chamber()
|
||||
/obj/item/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()
|
||||
/obj/item/gun/magic/Initialize()
|
||||
. = ..()
|
||||
charges = max_charges
|
||||
chambered = new ammo_type(src)
|
||||
@@ -52,13 +52,13 @@
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/Destroy()
|
||||
/obj/item/gun/magic/Destroy()
|
||||
if(can_charge)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/process()
|
||||
/obj/item/gun/magic/process()
|
||||
charge_tick++
|
||||
if(charge_tick < recharge_rate || charges >= max_charges)
|
||||
return 0
|
||||
@@ -68,18 +68,18 @@
|
||||
recharge_newshot()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/magic/update_icon()
|
||||
/obj/item/gun/magic/update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
/obj/item/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)
|
||||
/obj/item/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)
|
||||
/obj/item/gun/magic/vv_edit_var(var_name, var_value)
|
||||
. = ..()
|
||||
switch (var_name)
|
||||
if ("charges")
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/obj/item/weapon/gun/magic/staff
|
||||
/obj/item/gun/magic/staff
|
||||
slot_flags = SLOT_BACK
|
||||
lefthand_file = 'icons/mob/inhands/weapons/staves_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/weapons/staves_righthand.dmi'
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/change
|
||||
/obj/item/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'
|
||||
@@ -9,7 +11,7 @@
|
||||
icon_state = "staffofchange"
|
||||
item_state = "staffofchange"
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/animate
|
||||
/obj/item/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'
|
||||
@@ -17,7 +19,7 @@
|
||||
icon_state = "staffofanimation"
|
||||
item_state = "staffofanimation"
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/healing
|
||||
/obj/item/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'
|
||||
@@ -25,10 +27,10 @@
|
||||
icon_state = "staffofhealing"
|
||||
item_state = "staffofhealing"
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/healing/handle_suicide() //Stops people trying to commit suicide to heal themselves
|
||||
/obj/item/gun/magic/staff/healing/handle_suicide() //Stops people trying to commit suicide to heal themselves
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/chaos
|
||||
/obj/item/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'
|
||||
@@ -42,11 +44,11 @@
|
||||
/obj/item/projectile/magic/death, /obj/item/projectile/magic/teleport, /obj/item/projectile/magic/door, /obj/item/projectile/magic/aoe/fireball,
|
||||
/obj/item/projectile/magic/spellblade, /obj/item/projectile/magic/arcane_barrage)
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/chaos/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override, bonus_spread = 0)
|
||||
/obj/item/gun/magic/staff/chaos/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override, bonus_spread = 0)
|
||||
chambered.projectile_type = pick(allowed_projectile_types)
|
||||
. = ..(target, user, message, params, zone_override, bonus_spread)
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/door
|
||||
/obj/item/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'
|
||||
@@ -57,7 +59,7 @@
|
||||
recharge_rate = 2
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/honk
|
||||
/obj/item/gun/magic/staff/honk
|
||||
name = "staff of the honkmother"
|
||||
desc = "Honk"
|
||||
fire_sound = 'sound/items/airhorn.ogg'
|
||||
@@ -67,13 +69,15 @@
|
||||
max_charges = 4
|
||||
recharge_rate = 8
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/spellblade
|
||||
/obj/item/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'
|
||||
ammo_type = /obj/item/ammo_casing/magic/spellblade
|
||||
icon_state = "spellblade"
|
||||
item_state = "spellblade"
|
||||
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
|
||||
hitsound = 'sound/weapons/rapierhit.ogg'
|
||||
force = 20
|
||||
armour_penetration = 75
|
||||
@@ -81,7 +85,7 @@
|
||||
sharpness = IS_SHARP
|
||||
max_charges = 4
|
||||
|
||||
/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)
|
||||
/obj/item/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,4 +1,4 @@
|
||||
/obj/item/weapon/gun/magic/wand
|
||||
/obj/item/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
|
||||
@@ -9,7 +9,7 @@
|
||||
max_charges = 100 //100, 50, 50, 34 (max charge distribution by 25%ths)
|
||||
var/variable_charges = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/Initialize()
|
||||
/obj/item/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)
|
||||
@@ -17,19 +17,19 @@
|
||||
max_charges = Ceiling(max_charges / 2)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/examine(mob/user)
|
||||
/obj/item/gun/magic/wand/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "Has [charges] charge\s remaining.")
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/update_icon()
|
||||
/obj/item/gun/magic/wand/update_icon()
|
||||
icon_state = "[initial(icon_state)][charges ? "" : "-drained"]"
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/attack(atom/target, mob/living/user)
|
||||
/obj/item/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)
|
||||
/obj/item/gun/magic/wand/afterattack(atom/target, mob/living/user)
|
||||
if(!charges)
|
||||
shoot_with_empty_chamber(user)
|
||||
return
|
||||
@@ -47,7 +47,7 @@
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/proc/zap_self(mob/living/user)
|
||||
/obj/item/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)
|
||||
@@ -57,7 +57,7 @@
|
||||
//WAND OF DEATH
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/death
|
||||
/obj/item/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'
|
||||
@@ -65,7 +65,7 @@
|
||||
icon_state = "deathwand"
|
||||
max_charges = 3 //3, 2, 2, 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/death/zap_self(mob/living/user)
|
||||
/obj/item/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?")]\
|
||||
@@ -78,7 +78,7 @@
|
||||
//WAND OF HEALING
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/resurrection
|
||||
/obj/item/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
|
||||
@@ -86,7 +86,7 @@
|
||||
icon_state = "revivewand"
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/resurrection/zap_self(mob/living/user)
|
||||
/obj/item/gun/magic/wand/resurrection/zap_self(mob/living/user)
|
||||
user.revive(full_heal = 1)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
@@ -100,7 +100,7 @@
|
||||
//WAND OF POLYMORPH
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/polymorph
|
||||
/obj/item/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
|
||||
@@ -108,7 +108,7 @@
|
||||
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)
|
||||
/obj/item/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--
|
||||
@@ -117,7 +117,7 @@
|
||||
//WAND OF TELEPORTATION
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/teleport
|
||||
/obj/item/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
|
||||
@@ -126,7 +126,7 @@
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/teleport/zap_self(mob/living/user)
|
||||
/obj/item/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)
|
||||
@@ -138,7 +138,7 @@
|
||||
//WAND OF DOOR CREATION
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/door
|
||||
/obj/item/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
|
||||
@@ -147,7 +147,7 @@
|
||||
max_charges = 20 //20, 10, 10, 7
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/door/zap_self(mob/living/user)
|
||||
/obj/item/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--
|
||||
..()
|
||||
@@ -156,7 +156,7 @@
|
||||
//WAND OF FIREBALL
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/fireball
|
||||
/obj/item/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'
|
||||
@@ -164,7 +164,7 @@
|
||||
icon_state = "firewand"
|
||||
max_charges = 8 //8, 4, 4, 3
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/fireball/zap_self(mob/living/user)
|
||||
/obj/item/gun/magic/wand/fireball/zap_self(mob/living/user)
|
||||
..()
|
||||
explosion(user.loc, -1, 0, 2, 3, 0, flame_range = 2)
|
||||
charges--
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/medbeam
|
||||
/obj/item/gun/medbeam
|
||||
name = "Medical Beamgun"
|
||||
desc = "Don't cross the streams!"
|
||||
icon = 'icons/obj/chronos.dmi'
|
||||
@@ -16,24 +16,24 @@
|
||||
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
|
||||
/obj/item/weapon/gun/medbeam/Initialize()
|
||||
/obj/item/gun/medbeam/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/weapon/gun/medbeam/Destroy(mob/user)
|
||||
/obj/item/gun/medbeam/Destroy(mob/user)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
LoseTarget()
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/medbeam/dropped(mob/user)
|
||||
/obj/item/gun/medbeam/dropped(mob/user)
|
||||
..()
|
||||
LoseTarget()
|
||||
|
||||
/obj/item/weapon/gun/medbeam/equipped(mob/user)
|
||||
/obj/item/gun/medbeam/equipped(mob/user)
|
||||
..()
|
||||
LoseTarget()
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/LoseTarget()
|
||||
/obj/item/gun/medbeam/proc/LoseTarget()
|
||||
if(active)
|
||||
qdel(current_beam)
|
||||
current_beam = null
|
||||
@@ -41,7 +41,7 @@
|
||||
on_beam_release(current_target)
|
||||
current_target = null
|
||||
|
||||
/obj/item/weapon/gun/medbeam/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
|
||||
/obj/item/gun/medbeam/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
|
||||
if(isliving(user))
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
SSblackbox.add_details("gun_fired","[src.type]")
|
||||
|
||||
/obj/item/weapon/gun/medbeam/process()
|
||||
/obj/item/gun/medbeam/process()
|
||||
|
||||
var/source = loc
|
||||
if(!mounted && !isliving(source))
|
||||
@@ -82,7 +82,7 @@
|
||||
if(current_target)
|
||||
on_beam_tick(current_target)
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/los_check(atom/movable/user, mob/target)
|
||||
/obj/item/gun/medbeam/proc/los_check(atom/movable/user, mob/target)
|
||||
var/turf/user_turf = user.loc
|
||||
if(mounted)
|
||||
user_turf = get_turf(user)
|
||||
@@ -101,33 +101,33 @@
|
||||
qdel(dummy)
|
||||
return 0
|
||||
for(var/obj/effect/ebeam/medical/B in turf)// Don't cross the str-beams!
|
||||
if(B.owner != current_beam)
|
||||
if(B.owner.origin != current_beam.origin)
|
||||
explosion(B.loc,0,3,5,8)
|
||||
qdel(dummy)
|
||||
return 0
|
||||
qdel(dummy)
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/on_beam_hit(var/mob/living/target)
|
||||
/obj/item/gun/medbeam/proc/on_beam_hit(var/mob/living/target)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/on_beam_tick(var/mob/living/target)
|
||||
/obj/item/gun/medbeam/proc/on_beam_tick(var/mob/living/target)
|
||||
if(target.health != target.maxHealth)
|
||||
new /obj/effect/temp_visual/heal(get_turf(target), "#80F5FF")
|
||||
target.adjustBruteLoss(-4)
|
||||
target.adjustFireLoss(-4)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/on_beam_release(var/mob/living/target)
|
||||
/obj/item/gun/medbeam/proc/on_beam_release(var/mob/living/target)
|
||||
return
|
||||
|
||||
/obj/effect/ebeam/medical
|
||||
name = "medical beam"
|
||||
|
||||
//////////////////////////////Mech Version///////////////////////////////
|
||||
/obj/item/weapon/gun/medbeam/mech
|
||||
/obj/item/gun/medbeam/mech
|
||||
mounted = 1
|
||||
|
||||
/obj/item/weapon/gun/medbeam/mech/Initialize()
|
||||
/obj/item/gun/medbeam/mech/Initialize()
|
||||
. = ..()
|
||||
STOP_PROCESSING(SSobj, src) //Mech mediguns do not process until installed, and are controlled by the holder obj
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/blastcannon
|
||||
/obj/item/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"
|
||||
@@ -15,12 +15,12 @@
|
||||
var/datum/gas_mixture/air1
|
||||
var/datum/gas_mixture/air2
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/New()
|
||||
/obj/item/gun/blastcannon/New()
|
||||
if(!pin)
|
||||
pin = new
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/Destroy()
|
||||
/obj/item/gun/blastcannon/Destroy()
|
||||
if(bomb)
|
||||
qdel(bomb)
|
||||
bomb = null
|
||||
@@ -28,7 +28,7 @@
|
||||
air2 = null
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/attack_self(mob/user)
|
||||
/obj/item/gun/blastcannon/attack_self(mob/user)
|
||||
if(bomb)
|
||||
bomb.forceMove(user.loc)
|
||||
user.put_in_hands(bomb)
|
||||
@@ -37,7 +37,7 @@
|
||||
update_icon()
|
||||
. = ..(user)
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/update_icon()
|
||||
/obj/item/gun/blastcannon/update_icon()
|
||||
if(bomb)
|
||||
icon_state = icon_state_loaded
|
||||
name = "blast cannon"
|
||||
@@ -48,7 +48,7 @@
|
||||
desc = initial(desc)
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/attackby(obj/O, mob/user)
|
||||
/obj/item/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)
|
||||
@@ -64,7 +64,7 @@
|
||||
return TRUE
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/proc/calculate_bomb()
|
||||
/obj/item/gun/blastcannon/proc/calculate_bomb()
|
||||
if(!istype(bomb)||!istype(bomb.tank_one)||!istype(bomb.tank_two))
|
||||
return 0
|
||||
air1 = bomb.tank_one.air_contents
|
||||
@@ -81,7 +81,7 @@
|
||||
return 0
|
||||
return (pressure/TANK_FRAGMENT_SCALE)
|
||||
|
||||
/obj/item/weapon/gun/blastcannon/afterattack(atom/target, mob/user, flag, params)
|
||||
/obj/item/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()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/energy/e_gun/advtaser/mounted
|
||||
/obj/item/gun/energy/e_gun/advtaser/mounted
|
||||
name = "mounted taser"
|
||||
desc = "An arm mounted dual-mode weapon that fires electrodes and disabler shots."
|
||||
icon = 'icons/obj/items_cyborg.dmi'
|
||||
@@ -9,10 +9,10 @@
|
||||
can_flashlight = 0
|
||||
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses neural signals instead
|
||||
|
||||
/obj/item/weapon/gun/energy/e_gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow...
|
||||
/obj/item/gun/energy/e_gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow...
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/mounted
|
||||
/obj/item/gun/energy/laser/mounted
|
||||
name = "mounted laser"
|
||||
desc = "An arm mounted cannon that fires lethal lasers."
|
||||
icon = 'icons/obj/items_cyborg.dmi'
|
||||
@@ -22,5 +22,5 @@
|
||||
selfcharge = 1
|
||||
trigger_guard = TRIGGER_GUARD_ALLOW_ALL
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/mounted/dropped()
|
||||
/obj/item/gun/energy/laser/mounted/dropped()
|
||||
..()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/item/weapon/gun/syringe
|
||||
/obj/item/gun/syringe
|
||||
name = "syringe gun"
|
||||
desc = "A spring loaded rifle designed to fit syringes, used to incapacitate unruly patients from a distance."
|
||||
icon_state = "syringegun"
|
||||
@@ -14,32 +14,32 @@
|
||||
var/list/syringes = list()
|
||||
var/max_syringes = 1
|
||||
|
||||
/obj/item/weapon/gun/syringe/Initialize()
|
||||
/obj/item/gun/syringe/Initialize()
|
||||
. = ..()
|
||||
chambered = new /obj/item/ammo_casing/syringegun(src)
|
||||
|
||||
/obj/item/weapon/gun/syringe/recharge_newshot()
|
||||
/obj/item/gun/syringe/recharge_newshot()
|
||||
if(!syringes.len)
|
||||
return
|
||||
chambered.newshot()
|
||||
|
||||
/obj/item/weapon/gun/syringe/can_shoot()
|
||||
/obj/item/gun/syringe/can_shoot()
|
||||
return syringes.len
|
||||
|
||||
/obj/item/weapon/gun/syringe/process_chamber()
|
||||
/obj/item/gun/syringe/process_chamber()
|
||||
if(chambered && !chambered.BB) //we just fired
|
||||
recharge_newshot()
|
||||
|
||||
/obj/item/weapon/gun/syringe/examine(mob/user)
|
||||
/obj/item/gun/syringe/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "Can hold [max_syringes] syringe\s. Has [syringes.len] syringe\s remaining.")
|
||||
|
||||
/obj/item/weapon/gun/syringe/attack_self(mob/living/user)
|
||||
/obj/item/gun/syringe/attack_self(mob/living/user)
|
||||
if(!syringes.len)
|
||||
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
||||
return 0
|
||||
|
||||
var/obj/item/weapon/reagent_containers/syringe/S = syringes[syringes.len]
|
||||
var/obj/item/reagent_containers/syringe/S = syringes[syringes.len]
|
||||
|
||||
if(!S) return 0
|
||||
S.loc = user.loc
|
||||
@@ -49,8 +49,8 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/syringe/attackby(obj/item/A, mob/user, params, show_msg = TRUE)
|
||||
if(istype(A, /obj/item/weapon/reagent_containers/syringe))
|
||||
/obj/item/gun/syringe/attackby(obj/item/A, mob/user, params, show_msg = TRUE)
|
||||
if(istype(A, /obj/item/reagent_containers/syringe))
|
||||
if(syringes.len < max_syringes)
|
||||
if(!user.transferItemToLoc(A, src))
|
||||
return FALSE
|
||||
@@ -62,13 +62,13 @@
|
||||
to_chat(user, "<span class='warning'>[src] cannot hold more syringes!</span>")
|
||||
return FALSE
|
||||
|
||||
/obj/item/weapon/gun/syringe/rapidsyringe
|
||||
/obj/item/gun/syringe/rapidsyringe
|
||||
name = "rapid syringe gun"
|
||||
desc = "A modification of the syringe gun design, using a rotating cylinder to store up to six syringes."
|
||||
icon_state = "rapidsyringegun"
|
||||
max_syringes = 6
|
||||
|
||||
/obj/item/weapon/gun/syringe/syndicate
|
||||
/obj/item/gun/syringe/syndicate
|
||||
name = "dart pistol"
|
||||
desc = "A small spring-loaded sidearm that functions identically to a syringe gun."
|
||||
icon_state = "syringe_pistol"
|
||||
@@ -79,18 +79,18 @@
|
||||
suppressed = 1 //Softer fire sound
|
||||
can_unsuppress = 0 //Permanently silenced
|
||||
|
||||
/obj/item/weapon/gun/syringe/dna
|
||||
/obj/item/gun/syringe/dna
|
||||
name = "modified syringe gun"
|
||||
desc = "A syringe gun that has been modified to fit DNA injectors instead of normal syringes."
|
||||
origin_tech = "combat=2;syndicate=2;biotech=3"
|
||||
|
||||
/obj/item/weapon/gun/syringe/dna/Initialize()
|
||||
/obj/item/gun/syringe/dna/Initialize()
|
||||
. = ..()
|
||||
chambered = new /obj/item/ammo_casing/dnainjector(src)
|
||||
|
||||
/obj/item/weapon/gun/syringe/dna/attackby(obj/item/A, mob/user, params, show_msg = TRUE)
|
||||
if(istype(A, /obj/item/weapon/dnainjector))
|
||||
var/obj/item/weapon/dnainjector/D = A
|
||||
/obj/item/gun/syringe/dna/attackby(obj/item/A, mob/user, params, show_msg = TRUE)
|
||||
if(istype(A, /obj/item/dnainjector))
|
||||
var/obj/item/dnainjector/D = A
|
||||
if(D.used)
|
||||
to_chat(user, "<span class='warning'>This injector is used up!</span>")
|
||||
return
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icon_state = "firing_pin"
|
||||
item_state = "pen"
|
||||
origin_tech = "materials=2;combat=4"
|
||||
flags = CONDUCT
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
attack_verb = list("poked")
|
||||
var/emagged = FALSE
|
||||
@@ -13,18 +13,18 @@
|
||||
var/selfdestruct = 0 // Explode when user check is failed.
|
||||
var/force_replace = 0 // Can forcefully replace other pins.
|
||||
var/pin_removeable = 0 // Can be replaced by any pin.
|
||||
var/obj/item/weapon/gun/gun
|
||||
var/obj/item/gun/gun
|
||||
|
||||
|
||||
/obj/item/device/firing_pin/New(newloc)
|
||||
..()
|
||||
if(istype(newloc, /obj/item/weapon/gun))
|
||||
if(istype(newloc, /obj/item/gun))
|
||||
gun = newloc
|
||||
|
||||
/obj/item/device/firing_pin/afterattack(atom/target, mob/user, proximity_flag)
|
||||
if(proximity_flag)
|
||||
if(istype(target, /obj/item/weapon/gun))
|
||||
var/obj/item/weapon/gun/G = target
|
||||
if(istype(target, /obj/item/gun))
|
||||
var/obj/item/gun/G = target
|
||||
if(G.pin && (force_replace || G.pin.pin_removeable))
|
||||
G.pin.loc = get_turf(G)
|
||||
G.pin.gun_remove(user)
|
||||
@@ -44,7 +44,7 @@
|
||||
emagged = TRUE
|
||||
to_chat(user, "<span class='notice'>You override the authentication mechanism.</span>")
|
||||
|
||||
/obj/item/device/firing_pin/proc/gun_insert(mob/living/user, obj/item/weapon/gun/G)
|
||||
/obj/item/device/firing_pin/proc/gun_insert(mob/living/user, obj/item/gun/G)
|
||||
gun = G
|
||||
forceMove(gun)
|
||||
gun.pin = src
|
||||
@@ -93,11 +93,11 @@
|
||||
name = "implant-keyed firing pin"
|
||||
desc = "This is a security firing pin which only authorizes users who are implanted with a certain device."
|
||||
fail_message = "<span class='warning'>IMPLANT CHECK FAILED.</span>"
|
||||
var/obj/item/weapon/implant/req_implant = null
|
||||
var/obj/item/implant/req_implant = null
|
||||
|
||||
/obj/item/device/firing_pin/implant/pin_auth(mob/living/user)
|
||||
if(istype(user))
|
||||
for(var/obj/item/weapon/implant/I in user.implants)
|
||||
for(var/obj/item/implant/I in user.implants)
|
||||
if(req_implant && I.type == req_implant)
|
||||
return 1
|
||||
return 0
|
||||
@@ -106,12 +106,12 @@
|
||||
name = "mindshield firing pin"
|
||||
desc = "This Security firing pin authorizes the weapon for only mindshield-implanted users."
|
||||
icon_state = "firing_pin_loyalty"
|
||||
req_implant = /obj/item/weapon/implant/mindshield
|
||||
req_implant = /obj/item/implant/mindshield
|
||||
|
||||
/obj/item/device/firing_pin/implant/pindicate
|
||||
name = "syndicate firing pin"
|
||||
icon_state = "firing_pin_pindi"
|
||||
req_implant = /obj/item/weapon/implant/weapons_auth
|
||||
req_implant = /obj/item/implant/weapons_auth
|
||||
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/device/firing_pin/clown/ultra/gun_insert(mob/living/user, obj/item/weapon/gun/G)
|
||||
/obj/item/device/firing_pin/clown/ultra/gun_insert(mob/living/user, obj/item/gun/G)
|
||||
..()
|
||||
G.clumsy_check = 0
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
icon_state = "bullet"
|
||||
density = FALSE
|
||||
anchored = TRUE
|
||||
flags = ABSTRACT
|
||||
flags_1 = ABSTRACT_1
|
||||
pass_flags = PASSTABLE
|
||||
mouse_opacity = 0
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
hitsound = 'sound/weapons/pierce.ogg'
|
||||
var/hitsound_wall = ""
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
permutated.Add(A)
|
||||
return FALSE
|
||||
else
|
||||
if(A && A.density && !ismob(A) && !(A.flags & ON_BORDER)) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs on that tile.
|
||||
if(A && A.density && !ismob(A) && !(A.flags_1 & ON_BORDER_1)) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs on that tile.
|
||||
var/list/mobs_list = list()
|
||||
for(var/mob/living/L in target_turf)
|
||||
mobs_list += L
|
||||
@@ -188,7 +188,7 @@
|
||||
return FALSE
|
||||
|
||||
/obj/item/projectile/proc/check_ricochet_flag(atom/A)
|
||||
if(A.flags & CHECK_RICOCHET)
|
||||
if(A.flags_1 & CHECK_RICOCHET_1)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
direct_target.bullet_act(src, def_zone)
|
||||
qdel(src)
|
||||
return
|
||||
if(setAngle)
|
||||
if(isnum(setAngle))
|
||||
Angle = setAngle
|
||||
var/old_pixel_x = pixel_x
|
||||
var/old_pixel_y = pixel_y
|
||||
@@ -264,11 +264,8 @@
|
||||
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 >= PROJECTILE_HIT_THRESHHOLD_LAYER) || ismob(original))
|
||||
if(loc == get_turf(original))
|
||||
if(!(original in permutated))
|
||||
Collide(original)
|
||||
if(can_hit_target(original, permutated))
|
||||
Collide(original)
|
||||
Range()
|
||||
if (delay > 0)
|
||||
sleep(delay)
|
||||
@@ -280,13 +277,19 @@
|
||||
if((!( current ) || loc == current))
|
||||
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
|
||||
step_towards(src, current)
|
||||
if(original && (original.layer >= PROJECTILE_HIT_THRESHHOLD_LAYER) || ismob(original))
|
||||
if(loc == get_turf(original))
|
||||
if(!(original in permutated))
|
||||
Collide(original)
|
||||
if(can_hit_target(original, permutated))
|
||||
Collide(original)
|
||||
Range()
|
||||
sleep(config.run_speed * 0.9)
|
||||
|
||||
//Returns true if the target atom is on our current turf and above the right layer
|
||||
/obj/item/projectile/proc/can_hit_target(atom/target, var/list/passthrough)
|
||||
if(target && (target.layer >= PROJECTILE_HIT_THRESHHOLD_LAYER) || ismob(target))
|
||||
if(loc == get_turf(target))
|
||||
if(!(target in passthrough))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/projectile/proc/preparePixelProjectile(atom/target, var/turf/targloc, mob/living/user, params, spread)
|
||||
var/turf/curloc = get_turf(user)
|
||||
forceMove(get_turf(user))
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
diff a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm (rejected hunks)
|
||||
@@ -4,7 +4,7 @@
|
||||
icon_state = "bullet"
|
||||
density = FALSE
|
||||
anchored = TRUE
|
||||
- flags = ABSTRACT
|
||||
+ flags_1 = ABSTRACT_1
|
||||
pass_flags = PASSTABLE
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
hitsound = 'sound/weapons/pierce.ogg'
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
/obj/item/projectile/beam/pulse/on_hit(atom/target, blocked = FALSE)
|
||||
. = ..()
|
||||
if(isturf(target) || istype(target,/obj/structure/))
|
||||
if(isturf(target) || istype(target, /obj/structure/))
|
||||
target.ex_act(EXPLODE_HEAVY)
|
||||
|
||||
/obj/item/projectile/beam/pulse/shot
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
/obj/item/projectile/bullet/dnainjector
|
||||
name = "\improper DNA injector"
|
||||
icon_state = "syringeproj"
|
||||
var/obj/item/weapon/dnainjector/injector
|
||||
var/obj/item/dnainjector/injector
|
||||
damage = 5
|
||||
hitsound_wall = "shatter"
|
||||
|
||||
@@ -356,7 +356,7 @@
|
||||
|
||||
/obj/item/projectile/bullet/saw/hollow
|
||||
damage = 60
|
||||
armour_penetration = -10
|
||||
armour_penetration = -60
|
||||
|
||||
/obj/item/projectile/bullet/saw/ap
|
||||
damage = 40
|
||||
|
||||
@@ -97,14 +97,14 @@
|
||||
|
||||
/obj/item/projectile/energy/trap/on_hit(atom/target, blocked = FALSE)
|
||||
if(!ismob(target) || blocked >= 100) //Fully blocked by mob or collided with dense object - drop a trap
|
||||
new/obj/item/weapon/restraints/legcuffs/beartrap/energy(get_turf(loc))
|
||||
new/obj/item/restraints/legcuffs/beartrap/energy(get_turf(loc))
|
||||
else if(iscarbon(target))
|
||||
var/obj/item/weapon/restraints/legcuffs/beartrap/B = new /obj/item/weapon/restraints/legcuffs/beartrap/energy(get_turf(target))
|
||||
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy(get_turf(target))
|
||||
B.Crossed(target)
|
||||
..()
|
||||
|
||||
/obj/item/projectile/energy/trap/on_range()
|
||||
new /obj/item/weapon/restraints/legcuffs/beartrap/energy(loc)
|
||||
new /obj/item/restraints/legcuffs/beartrap/energy(loc)
|
||||
..()
|
||||
|
||||
/obj/item/projectile/energy/trap/cyborg
|
||||
@@ -120,7 +120,7 @@
|
||||
do_sparks(1, TRUE, src)
|
||||
qdel(src)
|
||||
if(iscarbon(target))
|
||||
var/obj/item/weapon/restraints/legcuffs/beartrap/B = new /obj/item/weapon/restraints/legcuffs/beartrap/energy/cyborg(get_turf(target))
|
||||
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(target))
|
||||
B.Crossed(target)
|
||||
QDEL_IN(src, 10)
|
||||
..()
|
||||
|
||||
@@ -68,10 +68,7 @@
|
||||
damage = 0
|
||||
damage_type = OXY
|
||||
nodamage = 1
|
||||
var/list/door_types = list(/obj/structure/mineral_door/wood,/obj/structure/mineral_door/iron,/obj/structure/mineral_door/silver,\
|
||||
/obj/structure/mineral_door/gold,/obj/structure/mineral_door/uranium,/obj/structure/mineral_door/sandstone,/obj/structure/mineral_door/transparent/plasma,\
|
||||
/obj/structure/mineral_door/transparent/diamond)
|
||||
|
||||
var/list/door_types = list(/obj/structure/mineral_door/wood, /obj/structure/mineral_door/iron, /obj/structure/mineral_door/silver, /obj/structure/mineral_door/gold, /obj/structure/mineral_door/uranium, /obj/structure/mineral_door/sandstone, /obj/structure/mineral_door/transparent/plasma, /obj/structure/mineral_door/transparent/diamond)
|
||||
|
||||
/obj/item/projectile/magic/door/on_hit(atom/target)
|
||||
. = ..()
|
||||
@@ -89,7 +86,7 @@
|
||||
D.Open()
|
||||
|
||||
/obj/item/projectile/magic/door/proc/OpenDoor(var/obj/machinery/door/D)
|
||||
if(istype(D,/obj/machinery/door/airlock))
|
||||
if(istype(D, /obj/machinery/door/airlock))
|
||||
var/obj/machinery/door/airlock/A = D
|
||||
A.locked = FALSE
|
||||
D.open()
|
||||
@@ -168,7 +165,7 @@
|
||||
if("animal")
|
||||
var/path
|
||||
if(prob(50))
|
||||
var/beast = pick("carp","bear","mushroom","statue", "bat", "goat","killertomato", "spiderbase", "spiderhunter", "blobbernaut", "magicarp", "chaosmagicarp", "watcher", "goliath", "headcrab", "morph", "stickman", "stickdog", "lesserdragon")
|
||||
var/beast = pick("carp","bear","mushroom","statue", "bat", "goat","killertomato", "spiderbase", "spiderhunter", "blobbernaut", "magicarp", "chaosmagicarp", "watcher", "goliath", "headcrab", "morph", "stickman", "stickdog", "lesserdragon", "gorilla")
|
||||
switch(beast)
|
||||
if("carp")
|
||||
path = /mob/living/simple_animal/hostile/carp
|
||||
@@ -208,6 +205,8 @@
|
||||
path = /mob/living/simple_animal/hostile/stickman/dog
|
||||
if("lesserdragon")
|
||||
path = /mob/living/simple_animal/hostile/megafauna/dragon/lesser
|
||||
if("gorilla")
|
||||
path = /mob/living/simple_animal/hostile/gorilla
|
||||
else
|
||||
var/animal = pick("parrot","corgi","crab","pug","cat","mouse","chicken","cow","lizard","chick","fox","butterfly","cak")
|
||||
switch(animal)
|
||||
@@ -262,7 +261,7 @@
|
||||
if(!new_mob)
|
||||
return
|
||||
new_mob.grant_language(/datum/language/common)
|
||||
SET_SECONDARY_FLAG(new_mob, OMNITONGUE)
|
||||
new_mob.flags_2 |= OMNITONGUE_2
|
||||
new_mob.logging = M.logging
|
||||
|
||||
// Some forms can still wear some items
|
||||
@@ -316,7 +315,7 @@
|
||||
return
|
||||
else
|
||||
var/obj/O = src
|
||||
if(istype(O, /obj/item/weapon/gun))
|
||||
if(istype(O, /obj/item/gun))
|
||||
new /mob/living/simple_animal/hostile/mimic/copy/ranged(loc, src, owner)
|
||||
else
|
||||
new /mob/living/simple_animal/hostile/mimic/copy(loc, src, owner)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
ammo_type = /obj/item/ammo_casing/caseless/foam_dart
|
||||
range = 10
|
||||
var/modified = 0
|
||||
var/obj/item/weapon/pen/pen = null
|
||||
var/obj/item/pen/pen = null
|
||||
|
||||
/obj/item/projectile/bullet/reusable/foam_dart/handle_drop()
|
||||
if(dropped)
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
icon_state = "spark"
|
||||
hitsound = "sparks"
|
||||
damage = 3
|
||||
var/obj/item/weapon/gun/energy/wormhole_projector/gun
|
||||
var/obj/item/gun/energy/wormhole_projector/gun
|
||||
color = "#33CCFF"
|
||||
|
||||
/obj/item/projectile/beam/wormhole/orange
|
||||
@@ -172,7 +172,7 @@
|
||||
if(casing)
|
||||
gun = casing.gun
|
||||
|
||||
/obj/item/ammo_casing/energy/wormhole/New(var/obj/item/weapon/gun/energy/wormhole_projector/wh)
|
||||
/obj/item/ammo_casing/energy/wormhole/New(var/obj/item/gun/energy/wormhole_projector/wh)
|
||||
gun = wh
|
||||
|
||||
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
|
||||
@@ -387,3 +387,232 @@
|
||||
var/obj/effect/ebeam/B = b
|
||||
animate(B, alpha = 0, time = 32)
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/hallucination
|
||||
name = "bullet"
|
||||
icon = null
|
||||
icon_state = null
|
||||
hitsound = ""
|
||||
suppressed = TRUE
|
||||
ricochets_max = 0
|
||||
ricochet_chance = 0
|
||||
damage = 0
|
||||
nodamage = TRUE
|
||||
projectile_type = /obj/item/projectile/hallucination
|
||||
log_override = TRUE
|
||||
var/hal_icon_state
|
||||
var/image/fake_icon
|
||||
var/mob/living/carbon/hal_target
|
||||
var/hal_fire_sound
|
||||
var/hal_hitsound
|
||||
var/hal_hitsound_wall
|
||||
var/hal_impact_effect
|
||||
var/hal_impact_effect_wall
|
||||
var/hit_duration
|
||||
var/hit_duration_wall
|
||||
|
||||
/obj/item/projectile/hallucination/fire()
|
||||
..()
|
||||
fake_icon = image('icons/obj/projectiles.dmi', src, hal_icon_state, ABOVE_MOB_LAYER)
|
||||
if(hal_target.client)
|
||||
hal_target.client.images += fake_icon
|
||||
|
||||
/obj/item/projectile/hallucination/Destroy()
|
||||
if(hal_target.client)
|
||||
hal_target.client.images -= fake_icon
|
||||
QDEL_NULL(fake_icon)
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/hallucination/Collide(atom/A)
|
||||
if(!ismob(A))
|
||||
if(hal_hitsound_wall)
|
||||
hal_target.playsound_local(loc, hal_hitsound_wall, 40, 1)
|
||||
if(hal_impact_effect_wall)
|
||||
spawn_hit(A, TRUE)
|
||||
else if(A == hal_target)
|
||||
if(hal_hitsound)
|
||||
hal_target.playsound_local(A, hal_hitsound, 100, 1)
|
||||
target_on_hit(A)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/obj/item/projectile/hallucination/proc/target_on_hit(mob/M)
|
||||
if(M == hal_target)
|
||||
to_chat(hal_target, "<span class='userdanger'>[M] is hit by \a [src] in the chest!</span>")
|
||||
hal_apply_effect()
|
||||
else if(M in view(hal_target))
|
||||
to_chat(hal_target, "<span class='danger'>[M] is hit by \a [src] in the chest!!</span>")
|
||||
if(damage_type == BRUTE)
|
||||
var/splatter_dir = dir
|
||||
if(starting)
|
||||
splatter_dir = get_dir(starting, get_turf(M))
|
||||
spawn_blood(M, splatter_dir)
|
||||
else if(hal_impact_effect)
|
||||
spawn_hit(M, FALSE)
|
||||
|
||||
/obj/item/projectile/hallucination/proc/spawn_blood(mob/M, set_dir)
|
||||
set waitfor = 0
|
||||
if(!hal_target.client)
|
||||
return
|
||||
|
||||
var/splatter_icon_state
|
||||
if(set_dir in GLOB.diagonals)
|
||||
splatter_icon_state = "splatter[pick(1, 2, 6)]"
|
||||
else
|
||||
splatter_icon_state = "splatter[pick(3, 4, 5)]"
|
||||
|
||||
var/image/blood = image('icons/effects/blood.dmi', M, splatter_icon_state, ABOVE_MOB_LAYER)
|
||||
var/target_pixel_x = 0
|
||||
var/target_pixel_y = 0
|
||||
switch(set_dir)
|
||||
if(NORTH)
|
||||
target_pixel_y = 16
|
||||
if(SOUTH)
|
||||
target_pixel_y = -16
|
||||
layer = ABOVE_MOB_LAYER
|
||||
if(EAST)
|
||||
target_pixel_x = 16
|
||||
if(WEST)
|
||||
target_pixel_x = -16
|
||||
if(NORTHEAST)
|
||||
target_pixel_x = 16
|
||||
target_pixel_y = 16
|
||||
if(NORTHWEST)
|
||||
target_pixel_x = -16
|
||||
target_pixel_y = 16
|
||||
if(SOUTHEAST)
|
||||
target_pixel_x = 16
|
||||
target_pixel_y = -16
|
||||
layer = ABOVE_MOB_LAYER
|
||||
if(SOUTHWEST)
|
||||
target_pixel_x = -16
|
||||
target_pixel_y = -16
|
||||
layer = ABOVE_MOB_LAYER
|
||||
hal_target.client.images += blood
|
||||
animate(blood, pixel_x = target_pixel_x, pixel_y = target_pixel_y, alpha = 0, time = 5)
|
||||
sleep(5)
|
||||
hal_target.client.images -= blood
|
||||
qdel(blood)
|
||||
|
||||
/obj/item/projectile/hallucination/proc/spawn_hit(atom/A, is_wall)
|
||||
set waitfor = 0
|
||||
if(!hal_target.client)
|
||||
return
|
||||
|
||||
var/image/hit_effect = image('icons/effects/blood.dmi', A, is_wall ? hal_impact_effect_wall : hal_impact_effect, ABOVE_MOB_LAYER)
|
||||
hit_effect.pixel_x = A.pixel_x + rand(-4,4)
|
||||
hit_effect.pixel_y = A.pixel_y + rand(-4,4)
|
||||
hal_target.client.images += hit_effect
|
||||
sleep(is_wall ? hit_duration_wall : hit_duration)
|
||||
hal_target.client.images -= hit_effect
|
||||
qdel(hit_effect)
|
||||
|
||||
|
||||
/obj/item/projectile/hallucination/proc/hal_apply_effect()
|
||||
return
|
||||
|
||||
/obj/item/projectile/hallucination/bullet
|
||||
name = "bullet"
|
||||
hal_icon_state = "bullet"
|
||||
hal_fire_sound = "gunshot"
|
||||
hal_hitsound = 'sound/weapons/pierce.ogg'
|
||||
hal_hitsound_wall = "ricochet"
|
||||
hal_impact_effect = "impact_bullet"
|
||||
hal_impact_effect_wall = "impact_bullet"
|
||||
hit_duration = 5
|
||||
hit_duration_wall = 5
|
||||
|
||||
/obj/item/projectile/hallucination/bullet/hal_apply_effect()
|
||||
hal_target.adjustStaminaLoss(60)
|
||||
|
||||
/obj/item/projectile/hallucination/laser
|
||||
name = "laser"
|
||||
damage_type = BURN
|
||||
hal_icon_state = "laser"
|
||||
hal_fire_sound = 'sound/weapons/laser.ogg'
|
||||
hal_hitsound = 'sound/weapons/sear.ogg'
|
||||
hal_hitsound_wall = 'sound/weapons/effects/searwall.ogg'
|
||||
hal_impact_effect = "impact_laser"
|
||||
hal_impact_effect_wall = "impact_laser_wall"
|
||||
hit_duration = 4
|
||||
hit_duration_wall = 10
|
||||
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
||||
|
||||
/obj/item/projectile/hallucination/laser/hal_apply_effect()
|
||||
hal_target.adjustStaminaLoss(20)
|
||||
hal_target.blur_eyes(2)
|
||||
|
||||
/obj/item/projectile/hallucination/taser
|
||||
name = "electrode"
|
||||
damage_type = BURN
|
||||
hal_icon_state = "spark"
|
||||
color = "#FFFF00"
|
||||
hal_fire_sound = 'sound/weapons/taser.ogg'
|
||||
hal_hitsound = 'sound/weapons/taserhit.ogg'
|
||||
hal_hitsound_wall = null
|
||||
hal_impact_effect = null
|
||||
hal_impact_effect_wall = null
|
||||
|
||||
/obj/item/projectile/hallucination/taser/hal_apply_effect()
|
||||
hal_target.Knockdown(100)
|
||||
hal_target.stuttering += 20
|
||||
if(hal_target.dna && hal_target.dna.check_mutation(HULK))
|
||||
hal_target.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
|
||||
else if(hal_target.status_flags & CANKNOCKDOWN)
|
||||
addtimer(CALLBACK(hal_target, /mob/living/carbon.proc/do_jitter_animation, 20), 5)
|
||||
|
||||
/obj/item/projectile/hallucination/disabler
|
||||
name = "disabler beam"
|
||||
damage_type = STAMINA
|
||||
hal_icon_state = "omnilaser"
|
||||
hal_fire_sound = 'sound/weapons/taser2.ogg'
|
||||
hal_hitsound = 'sound/weapons/tap.ogg'
|
||||
hal_hitsound_wall = 'sound/weapons/effects/searwall.ogg'
|
||||
hal_impact_effect = "impact_laser_blue"
|
||||
hal_impact_effect_wall = null
|
||||
hit_duration = 4
|
||||
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
||||
|
||||
/obj/item/projectile/hallucination/disabler/hal_apply_effect()
|
||||
hal_target.adjustStaminaLoss(25)
|
||||
|
||||
/obj/item/projectile/hallucination/ebow
|
||||
name = "bolt"
|
||||
damage_type = TOX
|
||||
hal_icon_state = "cbbolt"
|
||||
hal_fire_sound = 'sound/weapons/genhit.ogg'
|
||||
hal_hitsound = null
|
||||
hal_hitsound_wall = null
|
||||
hal_impact_effect = null
|
||||
hal_impact_effect_wall = null
|
||||
|
||||
/obj/item/projectile/hallucination/ebow/hal_apply_effect()
|
||||
hal_target.Knockdown(100)
|
||||
hal_target.stuttering += 5
|
||||
hal_target.adjustStaminaLoss(8)
|
||||
|
||||
/obj/item/projectile/hallucination/change
|
||||
name = "bolt of change"
|
||||
damage_type = BURN
|
||||
hal_icon_state = "ice_1"
|
||||
hal_fire_sound = 'sound/magic/staff_change.ogg'
|
||||
hal_hitsound = null
|
||||
hal_hitsound_wall = null
|
||||
hal_impact_effect = null
|
||||
hal_impact_effect_wall = null
|
||||
|
||||
/obj/item/projectile/hallucination/change/hal_apply_effect()
|
||||
new /datum/hallucination/self_delusion(hal_target, TRUE, wabbajack = FALSE)
|
||||
|
||||
/obj/item/projectile/hallucination/death
|
||||
name = "bolt of death"
|
||||
damage_type = BURN
|
||||
hal_icon_state = "pulse1_bl"
|
||||
hal_fire_sound = 'sound/magic/wandodeath.ogg'
|
||||
hal_hitsound = null
|
||||
hal_hitsound_wall = null
|
||||
hal_impact_effect = null
|
||||
hal_impact_effect_wall = null
|
||||
|
||||
/obj/item/projectile/hallucination/death/hal_apply_effect()
|
||||
new /datum/hallucination/death(hal_target, TRUE)
|
||||
|
||||
Reference in New Issue
Block a user