Merge branch 'master' into revenant_TK

This commit is contained in:
Artur
2021-01-20 18:27:11 +02:00
414 changed files with 6097 additions and 2811 deletions
+17 -2
View File
@@ -18,6 +18,8 @@
item_flags = NEEDS_PERMIT
attack_verb = list("struck", "hit", "bashed")
attack_speed = CLICK_CD_RANGE
var/ranged_attack_speed = CLICK_CD_RANGE
var/melee_attack_speed = CLICK_CD_MELEE
var/fire_sound = "gunshot"
var/suppressed = null //whether or not a message is displayed when fired
@@ -159,7 +161,7 @@
user.UseStaminaBuffer(safe_cost)
if(suppressed)
playsound(user, fire_sound, 10, 1)
playsound(user, fire_sound, 10, TRUE, ignore_walls = FALSE, extrarange = SILENCED_SOUND_EXTRARANGE, falloff_distance = 0)
else
playsound(user, fire_sound, 50, 1)
if(message)
@@ -174,12 +176,25 @@
for(var/obj/O in contents)
O.emp_act(severity)
/obj/item/gun/attack(mob/living/M, mob/user)
. = ..()
if(!(. & DISCARD_LAST_ACTION))
user.DelayNextAction(melee_attack_speed)
/obj/item/gun/attack_obj(obj/O, mob/user)
. = ..()
if(!(. & DISCARD_LAST_ACTION))
user.DelayNextAction(melee_attack_speed)
/obj/item/gun/afterattack(atom/target, mob/living/user, flag, params)
. = ..()
if(user && !CheckAttackCooldown(user, target))
if(user && !CheckAttackCooldown(user, target, TRUE))
return
process_afterattack(target, user, flag, params)
/obj/item/gun/CheckAttackCooldown(mob/user, atom/target, shooting = FALSE)
return user.CheckActionCooldown(shooting? ranged_attack_speed : attack_speed, clickdelay_from_next_action, clickdelay_mod_bypass, clickdelay_ignores_next_action)
/obj/item/gun/proc/process_afterattack(atom/target, mob/living/user, flag, params)
if(!target)
return
@@ -373,7 +373,6 @@
sawn_off = TRUE
slot_flags = ITEM_SLOT_BELT
/obj/item/gun/ballistic/revolver/reverse //Fires directly at its user... unless the user is a clown, of course.
clumsy_check = 0
@@ -318,7 +318,7 @@
pump()
return TRUE
// DOUBLE BARRELED SHOTGUN and IMPROVISED SHOTGUN are in revolver.dm
//due to code weirdness, and the fact that a refactor is coming soon anyway, the barman's shotgun and maint shotgun are in revolver.dm
/obj/item/gun/ballistic/shotgun/doublebarrel/hook
name = "hook modified sawn-off shotgun"
+47 -14
View File
@@ -173,18 +173,60 @@
force = 15
ammo_type = list(/obj/item/ammo_casing/energy/plasma/adv)
//Sci guns
/obj/item/gun/energy/gravity_gun
name = "one-point gravitational manipulator"
desc = "An experimental, multi-mode device that fires bolts of Zero-Point Energy, causing local distortions in gravity. Requires an anomaly core to function."
ammo_type = list(/obj/item/ammo_casing/energy/gravity/repulse, /obj/item/ammo_casing/energy/gravity/attract, /obj/item/ammo_casing/energy/gravity/chaos)
item_state = "gravity_gun"
icon_state = "gravity_gun"
var/power = 4
var/firing_core = FALSE
/obj/item/gun/energy/gravity_gun/attackby(obj/item/C, mob/user)
if(istype(C, /obj/item/assembly/signaler/anomaly))
to_chat(user, "<span class='notice'>You insert [C] into the gravitational manipulator and the weapon gently hums to life.</span>")
firing_core = TRUE
playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE)
qdel(C)
return
return ..()
/obj/item/gun/energy/gravity_gun/can_shoot()
if(!firing_core)
return FALSE
return ..()
/obj/item/gun/energy/wormhole_projector
name = "bluespace wormhole projector"
desc = "A projector that emits high density quantum-coupled bluespace beams."
desc = "A projector that emits high density quantum-coupled bluespace beams. Requires an anomaly core to function."
ammo_type = list(/obj/item/ammo_casing/energy/wormhole, /obj/item/ammo_casing/energy/wormhole/orange)
item_state = null
icon_state = "wormhole_projector"
pin = null
inaccuracy_modifier = 0.25
automatic_charge_overlays = FALSE
var/obj/effect/portal/p_blue
var/obj/effect/portal/p_orange
var/atmos_link = FALSE
var/firing_core = FALSE
/obj/item/gun/energy/wormhole_projector/attackby(obj/item/C, mob/user)
if(istype(C, /obj/item/assembly/signaler/anomaly))
to_chat(user, "<span class='notice'>You insert [C] into the wormhole projector and the weapon gently hums to life.</span>")
firing_core = TRUE
playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE)
qdel(C)
return
/obj/item/gun/energy/wormhole_projector/can_shoot()
if(!firing_core)
return FALSE
return ..()
/obj/item/gun/energy/wormhole_projector/shoot_with_empty_chamber(mob/living/user)
. = ..()
to_chat(user, "<span class='danger'>The display says, 'NO CORE INSTALLED'.</span>")
/obj/item/gun/energy/wormhole_projector/update_icon_state()
icon_state = "[initial(icon_state)][current_firemode_index]"
@@ -243,6 +285,9 @@
p_blue = P
crosslink()
/obj/item/gun/energy/wormhole_projector/core_inserted
firing_core = TRUE
/* 3d printer 'pseudo guns' for borgs */
/obj/item/gun/energy/printer
@@ -298,18 +343,6 @@
/obj/item/gun/energy/laser/instakill/emp_act() //implying you could stop the instagib
return
/obj/item/gun/energy/gravity_gun
name = "one-point bluespace-gravitational manipulator"
desc = "An experimental, multi-mode device that fires bolts of Zero-Point Energy, causing local distortions in gravity."
ammo_type = list(/obj/item/ammo_casing/energy/gravity/repulse, /obj/item/ammo_casing/energy/gravity/attract, /obj/item/ammo_casing/energy/gravity/chaos)
item_state = "gravity_gun"
icon_state = "gravity_gun"
pin = null
var/power = 4
/obj/item/gun/energy/gravity_gun/security
pin = /obj/item/firing_pin
//Emitter Gun
/obj/item/gun/energy/emitter
+4 -5
View File
@@ -471,11 +471,10 @@
if(paused || !isturf(loc))
return
var/ds = (SSprojectiles.flags & SS_TICKER)? (wait * world.tick_lag) : wait
var/required_pixels = (pixels_per_second * ds * 0.1) + pixels_tick_leftover
var/required_pixels = (pixels_per_second * wait) + pixels_tick_leftover
if(required_pixels >= pixel_increment_amount)
pixels_tick_leftover = MODULUS(required_pixels, pixel_increment_amount)
pixel_move(FLOOR(required_pixels / pixel_increment_amount, 1), FALSE, ds, SSprojectiles.global_projectile_speed_multiplier)
pixel_move(FLOOR(required_pixels / pixel_increment_amount, 1), FALSE, wait, SSprojectiles.global_projectile_speed_multiplier)
else
pixels_tick_leftover = required_pixels
@@ -603,7 +602,7 @@
* Trajectory multiplier directly modifies the factor of pixel_increment_amount to go per time.
* It's complicated, so probably just don't mess with this unless you know what you're doing.
*/
/obj/item/projectile/proc/pixel_move(times, hitscanning = FALSE, deciseconds_equivalent = world.tick_lag, trajectory_multiplier = 1, allow_animation = TRUE)
/obj/item/projectile/proc/pixel_move(times, hitscanning = FALSE, seconds_equivalent = world.tick_lag * 0.1, trajectory_multiplier = 1, allow_animation = TRUE)
if(!loc || !trajectory)
return
if(!nondirectional_sprite && !hitscanning)
@@ -620,7 +619,7 @@
if(homing_target)
// No datum/points, too expensive.
var/angle = closer_angle_difference(Angle, get_projectile_angle(src, homing_target))
var/max_turn = homing_turn_speed * deciseconds_equivalent * 0.1
var/max_turn = homing_turn_speed * seconds_equivalent
setAngle(Angle + clamp(angle, -max_turn, max_turn))
// HOMING END
trajectory.increment(trajectory_multiplier)
@@ -20,8 +20,9 @@
newcasing.modified = modified
var/obj/item/projectile/bullet/reusable/foam_dart/newdart = newcasing.BB
newdart.modified = modified
newdart.damage = damage
newdart.nodamage = nodamage
if(modified)
newdart.damage = 5
newdart.nodamage = FALSE
newdart.damage_type = damage_type
if(pen)
newdart.pen = pen