Merge branch 'master' into wounds-part-2

This commit is contained in:
Timothy Teakettle
2020-07-29 15:47:44 +01:00
committed by GitHub
482 changed files with 3887 additions and 2657 deletions
@@ -16,7 +16,8 @@
var/variance = 0 //Variance for inaccuracy fundamental to the casing
var/randomspread = 0 //Randomspread for automatics
var/delay = 0 //Delay for energy weapons
var/click_cooldown_override = 0 //Override this to make your gun have a faster fire rate, in tenths of a second. 4 is the default gun cooldown.
/// Override this to make the gun check for a different cooldown rather than CLICK_CD_RANGE, which is 4 deciseconds.
var/click_cooldown_override
var/firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect //the visual effect appearing when the ammo is fired.
var/heavy_metal = TRUE
var/harmful = TRUE //pacifism check for boolet, set to FALSE if bullet is non-lethal
@@ -16,10 +16,7 @@
AddComponent(/datum/component/pellet_cloud, projectile_type, pellets)
SEND_SIGNAL(src, COMSIG_PELLET_CLOUD_INIT, target, user, fired_from, randomspread, spread, zone_override, params, distro)
if(click_cooldown_override)
user.changeNext_move(click_cooldown_override)
else
user.changeNext_move(CLICK_CD_RANGE)
user.DelayNextAction(considered_action = TRUE, immediate = FALSE)
user.newtonian_move(get_dir(target, user))
update_icon()
return 1
+25 -8
View File
@@ -17,6 +17,7 @@
force = 5
item_flags = NEEDS_PERMIT
attack_verb = list("struck", "hit", "bashed")
attack_speed = CLICK_CD_RANGE
var/fire_sound = "gunshot"
var/suppressed = null //whether or not a message is displayed when fired
@@ -28,6 +29,13 @@
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_off = FALSE
/// can we be put into a turret
var/can_turret = TRUE
/// can we be put in a circuit
var/can_circuit = TRUE
/// can we be put in an emitter
var/can_emitter = TRUE
/// Weapon is burst fire if this is above 1
var/burst_size = 1
@@ -166,6 +174,8 @@
/obj/item/gun/afterattack(atom/target, mob/living/user, flag, params)
. = ..()
if(!CheckAttackCooldown(user, target))
return
process_afterattack(target, user, flag, params)
/obj/item/gun/proc/process_afterattack(atom/target, mob/living/user, flag, params)
@@ -174,15 +184,12 @@
if(firing)
return
var/stamloss = user.getStaminaLoss()
if(stamloss >= STAMINA_NEAR_SOFTCRIT) //The more tired you are, the less damage you do.
var/penalty = (stamloss - STAMINA_NEAR_SOFTCRIT)/(STAMINA_NEAR_CRIT - STAMINA_NEAR_SOFTCRIT)*STAM_CRIT_GUN_DELAY
user.changeNext_move(CLICK_CD_RANGE+(CLICK_CD_RANGE*penalty))
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 != BODY_ZONE_PRECISE_MOUTH) //so we can't shoot ourselves (unless mouth selected)
if(target == user && user.zone_selected != BODY_ZONE_PRECISE_MOUTH && (user.a_intent != INTENT_DISARM)) //so we can't shoot ourselves (unless mouth selected or disarm intent)
return
if(iscarbon(target))
var/mob/living/carbon/C = target
@@ -219,6 +226,8 @@
to_chat(user, "<span class='userdanger'>You need both hands free to fire \the [src]!</span>")
return
user.DelayNextAction()
//DUAL (or more!) WIELDING
var/bonus_spread = 0
var/loop_counter = 0
@@ -249,6 +258,17 @@
to_chat(user, "<span class='notice'> [src] is lethally chambered! You don't want to risk harming anyone...</span>")
return FALSE
/obj/item/gun/CheckAttackCooldown(mob/user, atom/target)
if((user.a_intent == INTENT_HARM) && user.Adjacent(target)) //melee
return user.CheckActionCooldown(CLICK_CD_MELEE)
return user.CheckActionCooldown(get_clickcd())
/obj/item/gun/proc/get_clickcd()
return isnull(chambered?.click_cooldown_override)? CLICK_CD_RANGE : chambered.click_cooldown_override
/obj/item/gun/GetEstimatedAttackSpeed()
return get_clickcd()
/obj/item/gun/proc/handle_pins(mob/living/user)
if(no_pin_required)
return TRUE
@@ -363,17 +383,14 @@
if(user.a_intent == INTENT_HARM) //Flogging
if(bayonet)
M.attackby(bayonet, user)
attack_delay_done = TRUE
return
else
return ..()
attack_delay_done = TRUE //we are firing the gun, not bashing people with its butt.
/obj/item/gun/attack_obj(obj/O, mob/user)
if(user.a_intent == INTENT_HARM)
if(bayonet)
O.attackby(bayonet, user)
return TRUE
return O.attackby(bayonet, user)
return ..()
/obj/item/gun/attackby(obj/item/I, mob/user, params)
+2 -5
View File
@@ -97,8 +97,7 @@
w_class += S.w_class //so pistols do not fit in pockets when suppressed
update_icon()
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/gun/ballistic/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
/obj/item/gun/ballistic/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
if(loc == user)
if(suppressed && can_unsuppress)
var/obj/item/suppressor/S = suppressed
@@ -180,13 +179,11 @@
#undef BRAINS_BLOWN_THROW_SPEED
#undef BRAINS_BLOWN_THROW_RANGE
/obj/item/gun/ballistic/proc/sawoff(mob/user)
if(sawn_off)
to_chat(user, "<span class='warning'>\The [src] is already shortened!</span>")
return
user.changeNext_move(CLICK_CD_MELEE)
user.DelayNextAction(CLICK_CD_MELEE)
user.visible_message("[user] begins to shorten \the [src].", "<span class='notice'>You begin to shorten \the [src]...</span>")
//if there's any live ammo inside the gun, makes it go off
@@ -327,8 +327,7 @@
. = ..()
update_icon()
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/gun/ballistic/automatic/l6_saw/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
/obj/item/gun/ballistic/automatic/l6_saw/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
if(loc != user)
..()
return //let them pick it up
@@ -29,8 +29,7 @@
/obj/item/minigunpack/process()
overheat = max(0, overheat - heat_diffusion)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/minigunpack/attack_hand(var/mob/living/carbon/user)
/obj/item/minigunpack/on_attack_hand(var/mob/living/carbon/user)
if(src.loc == user)
if(!armed)
if(user.get_item_by_slot(SLOT_BACK) == src)
+1 -1
View File
@@ -24,7 +24,7 @@
ammo_x_offset = 2
// Not enough guns have altfire systems like this yet for this to be a universal framework.
var/last_altfire = 0
var/altfire_delay = 15
var/altfire_delay = CLICK_CD_RANGE
/obj/item/gun/energy/e_gun/advtaser/altafterattack(atom/target, mob/user, proximity_flag, params)
. = TRUE
@@ -29,6 +29,8 @@
ammo_type = list(/obj/item/ammo_casing/energy/beam_rifle/hitscan)
cell_type = /obj/item/stock_parts/cell/beam_rifle
canMouseDown = TRUE
can_turret = FALSE
can_circuit = FALSE
//Cit changes: beam rifle stats.
slowdown = 1
item_flags = NO_MAT_REDEMPTION | SLOWS_WHILE_IN_HAND | NEEDS_PERMIT
@@ -418,10 +420,10 @@
var/wall_devastate = 0
var/aoe_structure_range = 0
var/aoe_structure_damage = 0
var/aoe_fire_range = 0
var/aoe_fire_chance = 0
var/aoe_mob_range = 0
var/aoe_mob_damage = 0
var/aoe_fire_range = 2
var/aoe_fire_chance = 100
var/aoe_mob_range = 2
var/aoe_mob_damage = 30
var/impact_structure_damage = 0
var/impact_direct_damage = 0
var/turf/cached
@@ -47,7 +47,7 @@
if(current_target)
LoseTarget()
if(!isliving(target))
if(!isliving(target) || (user == target))
return
current_target = target
+1 -1
View File
@@ -634,7 +634,7 @@
pixel_x = trajectory.return_px()
pixel_y = trajectory.return_py()
else if(T != loc)
var/safety = CEILING(pixel_increment_amount / world.icon_size, 1) * 2 + 1
var/safety = CEILING(pixel_increment_amount / world.icon_size, 1) * 5 + 1
while(T != loc)
if(!--safety)
CRASH("[type] took too long (allowed: [CEILING(pixel_increment_amount/world.icon_size,1)*2] moves) to get to its location.")