Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes randomspread #3095

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions code/datums/components/pellet_cloud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
//The arguments really don't matter, this proc is triggered by COMSIG_PELLET_CLOUD_INIT which is only for this really, it's just a big mess of the state vars we need for doing the stuff over here.


/datum/component/pellet_cloud/proc/create_casing_pellets(obj/item/ammo_casing/shell, atom/target, mob/living/user, fired_from, randomspread, spread, zone_override, params, distro)
/datum/component/pellet_cloud/proc/create_casing_pellets(obj/item/ammo_casing/shell, atom/target, mob/living/user, fired_from, spread, zone_override, params, distro)
shooter = user
var/targloc = get_turf(target)
if(!zone_override)
Expand All @@ -98,10 +98,7 @@
for(var/i in 1 to num_pellets)
shell.ready_proj(target, user, SUPPRESSED_VERY, zone_override, fired_from)
if(distro)
if(randomspread)
spread = round((rand() - 0.5) * distro)
else //Smart spread
spread = round((i / num_pellets - 0.5) * distro)
spread = round((i / num_pellets - 0.5) * distro)

RegisterSignal(shell.BB, COMSIG_PROJECTILE_SELF_ON_HIT, PROC_REF(pellet_hit))
RegisterSignal(shell.BB, list(COMSIG_PROJECTILE_RANGE_OUT, COMSIG_PARENT_QDELETING), PROC_REF(pellet_range))
Expand Down
7 changes: 1 addition & 6 deletions code/game/mecha/equipment/weapons/weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
var/fire_sound
var/projectiles_per_shot = 1
var/variance = 0
var/randomspread = 0 //use random spread for machineguns, instead of shotgun scatter
var/projectile_delay = 0
var/firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect //the visual effect appearing when the weapon is fired.
var/kickback = TRUE //Will using this weapon in no grav push mecha back.
Expand Down Expand Up @@ -44,10 +43,7 @@

var/spread = 0
if(variance)
if(randomspread)
spread = round((rand() - 0.5) * variance)
else
spread = round((i / projectiles_per_shot - 0.5) * variance)
spread = round((i / projectiles_per_shot - 0.5) * variance)
A.preparePixelProjectile(target, chassis.occupant, params, spread)

A.fire()
Expand Down Expand Up @@ -347,7 +343,6 @@
projectiles_cache_max = 1200
projectiles_per_shot = 3
variance = 6
randomspread = 1
projectile_delay = 2
harmful = TRUE
ammo_type = "lmg"
Expand Down
1 change: 0 additions & 1 deletion code/modules/projectiles/ammunition/_ammunition.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

var/pellets = 1 //Pellets for spreadshot
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.

Expand Down
7 changes: 2 additions & 5 deletions code/modules/projectiles/ammunition/_firing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
ready_proj(target, user, quiet, zone_override, fired_from)
if(pellets == 1)
if(distro) //We have to spread a pixel-precision bullet. throw_proj was called before so angles should exist by now...
if(randomspread)
spread = round((rand() - 0.5) * distro)
else //Smart spread
spread = round(1 - 0.5) * distro
spread = round(1 - 0.5) * distro
if(!throw_proj(target, targloc, user, params, spread))
return FALSE
else
if(isnull(BB))
return FALSE
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)
SEND_SIGNAL(src, COMSIG_PELLET_CLOUD_INIT, target, user, fired_from, spread, zone_override, params, distro)

if(click_cooldown_override)
user.changeNext_move(click_cooldown_override)
Expand Down
1 change: 0 additions & 1 deletion code/modules/projectiles/ammunition/ballistic/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
desc = "A 5.45x39mm bullet casing."
icon_state = "rifle-brass"
caliber = "5.45x39mm"
randomspread = TRUE
projectile_type = /obj/projectile/bullet/a545_39
bullet_per_box = 80

Expand Down
14 changes: 1 addition & 13 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
///If dual wielding, add this to the spread
var/dual_wield_spread = 24
/// ???, no clue what this is. Original desc: //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.
var/randomspread = 1

///Alters projectile damage multiplicatively based on this value. Use it for "better" or "worse" weapons that use the same ammo.
var/projectile_damage_multiplier = 1
Expand Down Expand Up @@ -460,18 +459,7 @@
currently_firing_burst = FALSE
return FALSE

// we hold the total spread in this var
var/sprd
// if we ARE burst firing and don't have "randomspread", we add the burst's penalty on top of it.
if(burst_firing && !randomspread)
bonus_spread += burst_size * iteration

//override spread? usually happens only in bursts
if(spread_override && !randomspread)
sprd = spread_override
else
//Calculate spread
sprd = calculate_spread(user, bonus_spread)
var/sprd = calculate_spread(user, bonus_spread)

before_firing(target,user)
//If we cant fire the round, just end the proc here. Otherwise, continue
Expand Down
1 change: 0 additions & 1 deletion code/modules/projectiles/guns/misc/blastcannon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
force = 10
fire_sound = 'sound/weapons/blastcannon.ogg'
item_flags = NONE
randomspread = FALSE

var/hugbox = TRUE
var/max_power = INFINITY
Expand Down
Loading