Merge branch 'master' into upstream-merge-33055
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
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.
|
||||
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
|
||||
|
||||
|
||||
/obj/item/ammo_casing/New()
|
||||
@@ -58,3 +59,47 @@
|
||||
to_chat(user, "<span class='warning'>You fail to collect anything!</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/ammo_casing/throw_impact(atom/A)
|
||||
if(heavy_metal)
|
||||
bounce_away(FALSE, NONE)
|
||||
. = ..()
|
||||
|
||||
/obj/item/ammo_casing/proc/bounce_away(still_warm = FALSE, delay = 3)
|
||||
SpinAnimation(10, 1)
|
||||
update_icon()
|
||||
var/turf/T = get_turf(src)
|
||||
if(still_warm && T && (is_type_in_typecache(T, GLOB.bullet_bounce_away_sizzle)))
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, src, 'sound/items/welder.ogg', 20, 1), delay)
|
||||
else if(T && (!is_type_in_typecache(T, GLOB.bullet_bounce_away_blacklist)))
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, src, 'sound/weapons/bulletremove.ogg', 60, 1), delay)
|
||||
|
||||
GLOBAL_LIST_INIT(bullet_bounce_away_sizzle, typecacheof(list(
|
||||
/turf/closed/indestructible/rock/snow,
|
||||
/turf/closed/wall/ice,
|
||||
/turf/closed/wall/mineral/snow,
|
||||
/turf/open/floor/grass/snow,
|
||||
/turf/open/floor/holofloor/snow,
|
||||
/turf/open/floor/plating/asteroid/snow,
|
||||
/turf/open/floor/plating/ice,
|
||||
/turf/open/water)))
|
||||
|
||||
GLOBAL_LIST_INIT(bullet_bounce_away_blacklist, typecacheof(list(
|
||||
/turf/closed/indestructible/rock/snow,
|
||||
/turf/closed/indestructible/splashscreen,
|
||||
/turf/closed/wall/mineral/snow,
|
||||
/turf/open/chasm,
|
||||
/turf/open/floor/carpet,
|
||||
/turf/open/floor/grass,
|
||||
/turf/open/floor/holofloor/beach,
|
||||
/turf/open/floor/holofloor/carpet,
|
||||
/turf/open/floor/holofloor/grass,
|
||||
/turf/open/floor/holofloor/hyperspace,
|
||||
/turf/open/floor/holofloor/snow,
|
||||
/turf/open/floor/plating/asteroid/snow,
|
||||
/turf/open/floor/plating/beach,
|
||||
/turf/open/indestructible/reebe_void,
|
||||
/turf/open/lava,
|
||||
/turf/open/space,
|
||||
/turf/open/water,
|
||||
/turf/template_noop)))
|
||||
|
||||
@@ -284,9 +284,9 @@
|
||||
icon_state = "cshell"
|
||||
projectile_type = /obj/item/projectile/bullet/dart
|
||||
|
||||
/obj/item/ammo_casing/shotgun/dart/New()
|
||||
..()
|
||||
container_type |= OPENCONTAINER_1
|
||||
/obj/item/ammo_casing/shotgun/dart/Initialize()
|
||||
. = ..()
|
||||
container_type |= OPENCONTAINER
|
||||
create_reagents(30)
|
||||
reagents.set_reacting(TRUE)
|
||||
|
||||
@@ -302,4 +302,4 @@
|
||||
reagents.add_reagent("spore", 6)
|
||||
reagents.add_reagent("mutetoxin", 6) //;HELP OPS IN MAINT
|
||||
reagents.add_reagent("coniine", 6)
|
||||
reagents.add_reagent("sodium_thiopental", 6)
|
||||
reagents.add_reagent("sodium_thiopental", 6)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
/obj/item/ammo_casing/caseless
|
||||
desc = "A caseless bullet casing."
|
||||
firing_effect_type = null
|
||||
heavy_metal = FALSE
|
||||
|
||||
/obj/item/ammo_casing/caseless/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread)
|
||||
if (..()) //successfully firing
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
var/select_name = "energy"
|
||||
fire_sound = 'sound/weapons/laser.ogg'
|
||||
firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/energy
|
||||
heavy_metal = FALSE
|
||||
|
||||
/obj/item/ammo_casing/energy/chameleon
|
||||
projectile_type = /obj/item/projectile/energy/chameleon
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
desc = "I didn't even know magic needed ammo..."
|
||||
projectile_type = /obj/item/projectile/magic
|
||||
firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/magic
|
||||
heavy_metal = FALSE
|
||||
|
||||
/obj/item/ammo_casing/magic/change
|
||||
projectile_type = /obj/item/projectile/magic/change
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
if(num_loaded)
|
||||
if(!silent)
|
||||
to_chat(user, "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>")
|
||||
playsound(user, 'sound/weapons/bulletinsert.ogg', 60, 1)
|
||||
playsound(src, 'sound/weapons/bulletinsert.ogg', 60, 1)
|
||||
A.update_icon()
|
||||
update_icon()
|
||||
|
||||
@@ -96,9 +96,10 @@
|
||||
/obj/item/ammo_box/attack_self(mob/user)
|
||||
var/obj/item/ammo_casing/A = get_round()
|
||||
if(A)
|
||||
user.put_in_hands(A)
|
||||
if(!user.put_in_hands(A))
|
||||
A.bounce_away(FALSE, NONE)
|
||||
playsound(src, 'sound/weapons/bulletinsert.ogg', 60, 1)
|
||||
to_chat(user, "<span class='notice'>You remove a round from \the [src]!</span>")
|
||||
playsound(user, 'sound/weapons/bulletremove.ogg', 60, 1)
|
||||
update_icon()
|
||||
|
||||
/obj/item/ammo_box/update_icon()
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)]-[Ceiling(ammo_count(0)/8)*8]"
|
||||
icon_state = "[initial(icon_state)]-[CEILING(ammo_count(0)/8, 1)*8]"
|
||||
|
||||
/obj/item/ammo_box/magazine/m12g/buckshot
|
||||
name = "shotgun magazine (12g buckshot slugs)"
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
/obj/item/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
to_chat(user, "<span class='danger'>*click*</span>")
|
||||
playsound(src, "gun_dry_fire", 50, 1)
|
||||
playsound(src, "gun_dry_fire", 30, 1)
|
||||
|
||||
|
||||
/obj/item/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
var/obj/item/ammo_casing/AC = chambered //Find chambered round
|
||||
if(istype(AC)) //there's a chambered round
|
||||
if(casing_ejector)
|
||||
AC.forceMove(get_turf(src)) //Eject casing onto ground.
|
||||
AC.SpinAnimation(10, 1) //next gen special effects
|
||||
AC.forceMove(drop_location()) //Eject casing onto ground.
|
||||
AC.bounce_away(TRUE)
|
||||
chambered = null
|
||||
else if(empty_chamber)
|
||||
chambered = null
|
||||
@@ -58,7 +58,13 @@
|
||||
if(user.transferItemToLoc(AM, src))
|
||||
magazine = AM
|
||||
to_chat(user, "<span class='notice'>You load a new magazine into \the [src].</span>")
|
||||
chamber_round()
|
||||
if(magazine.ammo_count())
|
||||
playsound(src, "gun_insert_full_magazine", 70, 1)
|
||||
if(!chambered)
|
||||
chamber_round()
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, src, 'sound/weapons/gun_chamber_round.ogg', 100, 1), 3)
|
||||
else
|
||||
playsound(src, "gun_insert_empty_magazine", 70, 1)
|
||||
A.update_icon()
|
||||
update_icon()
|
||||
return 1
|
||||
@@ -110,13 +116,18 @@
|
||||
magazine.forceMove(drop_location())
|
||||
user.put_in_hands(magazine)
|
||||
magazine.update_icon()
|
||||
if(magazine.ammo_count())
|
||||
playsound(src, "sound/weapons/gun_magazine_remove_full.ogg", 70, 1)
|
||||
else
|
||||
playsound(src, "gun_remove_empty_magazine", 70, 1)
|
||||
magazine = null
|
||||
to_chat(user, "<span class='notice'>You pull the magazine out of \the [src].</span>")
|
||||
else if(chambered)
|
||||
AC.forceMove(drop_location())
|
||||
AC.SpinAnimation(10, 1)
|
||||
AC.bounce_away()
|
||||
chambered = null
|
||||
to_chat(user, "<span class='notice'>You unload the round from \the [src]'s chamber.</span>")
|
||||
playsound(src, "gun_slide_lock", 70, 1)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There's no magazine in \the [src].</span>")
|
||||
update_icon()
|
||||
@@ -162,7 +173,7 @@
|
||||
return(OXYLOSS)
|
||||
else
|
||||
user.visible_message("<span class='suicide'>[user] is pretending to blow [user.p_their()] brain[user.p_s()] out with [src]! It looks like [user.p_theyre()] trying to commit suicide!</b></span>")
|
||||
playsound(src, "gun_dry_fire", 50, 1)
|
||||
playsound(src, "gun_dry_fire", 30, 1)
|
||||
return (OXYLOSS)
|
||||
#undef BRAINS_BLOWN_THROW_SPEED
|
||||
#undef BRAINS_BLOWN_THROW_RANGE
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
/obj/item/gun/ballistic/automatic/c20r/update_icon()
|
||||
..()
|
||||
icon_state = "c20r[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
icon_state = "c20r[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/wt550
|
||||
name = "security auto rifle"
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
/obj/item/gun/ballistic/automatic/wt550/update_icon()
|
||||
..()
|
||||
icon_state = "wt550[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
|
||||
icon_state = "wt550[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/mini_uzi
|
||||
name = "\improper Type U3 Uzi"
|
||||
@@ -304,7 +304,7 @@
|
||||
|
||||
|
||||
/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" : ""]"
|
||||
icon_state = "l6[cover_open ? "open" : "closed"][magazine ? CEILING(get_ammo(0)/12.5, 1)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
|
||||
item_state = "l6[cover_open ? "openmag" : "closedmag"]"
|
||||
|
||||
|
||||
@@ -415,5 +415,5 @@
|
||||
|
||||
/obj/item/gun/ballistic/automatic/laser/update_icon()
|
||||
..()
|
||||
icon_state = "oldrifle[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
|
||||
icon_state = "oldrifle[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""]"
|
||||
return
|
||||
|
||||
@@ -40,12 +40,10 @@
|
||||
CB = magazine.get_round(0)
|
||||
if(CB)
|
||||
CB.forceMove(drop_location())
|
||||
CB.SpinAnimation(10, 1)
|
||||
CB.update_icon()
|
||||
CB.bounce_away(FALSE, NONE)
|
||||
num_unloaded++
|
||||
if (num_unloaded)
|
||||
to_chat(user, "<span class='notice'>You unload [num_unloaded] shell\s from [src].</span>")
|
||||
playsound(user, 'sound/weapons/bulletremove.ogg', 60, 1)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is empty!</span>")
|
||||
|
||||
@@ -229,7 +227,7 @@
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>*click*</span>")
|
||||
playsound(src, "gun_dry_fire", 50, 1)
|
||||
playsound(src, "gun_dry_fire", 30, 1)
|
||||
|
||||
/obj/item/gun/ballistic/revolver/russian/proc/shoot_self(mob/living/carbon/human/user, affecting = "head")
|
||||
user.apply_damage(300, BRUTE, affecting)
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
/obj/item/gun/ballistic/shotgun/proc/pump_unload(mob/M)
|
||||
if(chambered)//We have a shell in the chamber
|
||||
chambered.forceMove(drop_location())//Eject casing
|
||||
chambered.SpinAnimation(5, 1)
|
||||
chambered.bounce_away()
|
||||
chambered = null
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/proc/pump_reload(mob/M)
|
||||
|
||||
@@ -365,7 +365,7 @@
|
||||
AC.sync_stats()
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/proc/delay_penalty(amount)
|
||||
aiming_time_left = Clamp(aiming_time_left + amount, 0, aiming_time)
|
||||
aiming_time_left = CLAMP(aiming_time_left + amount, 0, aiming_time)
|
||||
|
||||
/obj/item/ammo_casing/energy/beam_rifle
|
||||
name = "particle acceleration lens"
|
||||
@@ -416,11 +416,11 @@
|
||||
HS_BB.stun = projectile_stun
|
||||
HS_BB.impact_structure_damage = impact_structure_damage
|
||||
HS_BB.aoe_mob_damage = aoe_mob_damage
|
||||
HS_BB.aoe_mob_range = Clamp(aoe_mob_range, 0, 15) //Badmin safety lock
|
||||
HS_BB.aoe_mob_range = CLAMP(aoe_mob_range, 0, 15) //Badmin safety lock
|
||||
HS_BB.aoe_fire_chance = aoe_fire_chance
|
||||
HS_BB.aoe_fire_range = aoe_fire_range
|
||||
HS_BB.aoe_structure_damage = aoe_structure_damage
|
||||
HS_BB.aoe_structure_range = Clamp(aoe_structure_range, 0, 15) //Badmin safety lock
|
||||
HS_BB.aoe_structure_range = CLAMP(aoe_structure_range, 0, 15) //Badmin safety lock
|
||||
HS_BB.wall_devastate = wall_devastate
|
||||
HS_BB.wall_pierce_amount = wall_pierce_amount
|
||||
HS_BB.structure_pierce_amount = structure_piercing
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
..()
|
||||
if(!automatic_charge_overlays)
|
||||
return
|
||||
var/ratio = Ceiling((cell.charge / cell.maxcharge) * charge_sections)
|
||||
var/ratio = CEILING((cell.charge / cell.maxcharge) * charge_sections, 1)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
var/iconState = "[icon_state]_charge"
|
||||
var/itemState = null
|
||||
@@ -175,7 +175,7 @@
|
||||
return(OXYLOSS)
|
||||
else
|
||||
user.visible_message("<span class='suicide'>[user] is pretending to blow [user.p_their()] brains out with [src]! It looks like [user.p_theyre()] trying to commit suicide!</b></span>")
|
||||
playsound(src, "gun_dry_fire", 50, 1)
|
||||
playsound(src, "gun_dry_fire", 30, 1)
|
||||
return (OXYLOSS)
|
||||
|
||||
|
||||
|
||||
@@ -121,7 +121,6 @@
|
||||
item_state = "plasmacutter"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/plasma)
|
||||
flags_1 = CONDUCT_1
|
||||
container_type = OPENCONTAINER_1
|
||||
attack_verb = list("attacked", "slashed", "cut", "sliced")
|
||||
force = 12
|
||||
sharpness = IS_SHARP
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
/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)
|
||||
max_charges = CEILING(max_charges / 3, 1)
|
||||
else
|
||||
max_charges = Ceiling(max_charges / 2)
|
||||
max_charges = CEILING(max_charges / 2, 1)
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/magic/wand/examine(mob/user)
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
|
||||
/obj/item/projectile/proc/vol_by_damage()
|
||||
if(src.damage)
|
||||
return Clamp((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then clamp the value between 30 and 100
|
||||
return CLAMP((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then clamp the value between 30 and 100
|
||||
else
|
||||
return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
|
||||
|
||||
if(isturf(A) && hitsound_wall)
|
||||
var/volume = Clamp(vol_by_damage() + 20, 0, 100)
|
||||
var/volume = CLAMP(vol_by_damage() + 20, 0, 100)
|
||||
if(suppressed)
|
||||
volume = 5
|
||||
playsound(loc, hitsound_wall, volume, 1, -1)
|
||||
@@ -259,7 +259,7 @@
|
||||
return
|
||||
var/elapsed_time_deciseconds = (world.time - last_projectile_move) + time_offset
|
||||
time_offset = 0
|
||||
var/required_moves = speed > 0? Floor(elapsed_time_deciseconds / speed) : MOVES_HITSCAN //Would be better if a 0 speed made hitscan but everyone hates those so I can't make it a universal system :<
|
||||
var/required_moves = speed > 0? FLOOR(elapsed_time_deciseconds / speed, 1) : MOVES_HITSCAN //Would be better if a 0 speed made hitscan but everyone hates those so I can't make it a universal system :<
|
||||
if(required_moves == MOVES_HITSCAN)
|
||||
required_moves = SSprojectiles.global_max_tick_moves
|
||||
else
|
||||
@@ -267,7 +267,7 @@
|
||||
var/overrun = required_moves - SSprojectiles.global_max_tick_moves
|
||||
required_moves = SSprojectiles.global_max_tick_moves
|
||||
time_offset += overrun * speed
|
||||
time_offset += Modulus(elapsed_time_deciseconds, speed)
|
||||
time_offset += MODULUS(elapsed_time_deciseconds, speed)
|
||||
|
||||
for(var/i in 1 to required_moves)
|
||||
pixel_move(required_moves)
|
||||
@@ -287,7 +287,7 @@
|
||||
setAngle(Angle + ((rand() - 0.5) * spread))
|
||||
if(isnull(Angle)) //Try to resolve through offsets if there's no angle set.
|
||||
var/turf/starting = get_turf(src)
|
||||
var/turf/target = locate(Clamp(starting + xo, 1, world.maxx), Clamp(starting + yo, 1, world.maxy), starting.z)
|
||||
var/turf/target = locate(CLAMP(starting + xo, 1, world.maxx), CLAMP(starting + yo, 1, world.maxy), starting.z)
|
||||
setAngle(Get_Angle(src, target))
|
||||
if(!nondirectional_sprite)
|
||||
var/matrix/M = new
|
||||
@@ -403,7 +403,7 @@
|
||||
|
||||
var/ox = round(screenviewX/2) - user.client.pixel_x //"origin" x
|
||||
var/oy = round(screenviewY/2) - user.client.pixel_y //"origin" y
|
||||
angle = Atan2(y - oy, x - ox)
|
||||
angle = ATAN2(y - oy, x - ox)
|
||||
return list(angle, p_x, p_y)
|
||||
|
||||
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.
|
||||
|
||||
Reference in New Issue
Block a user