mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-29 16:18:35 +01:00
Merge branch 'master' into swordsandbow
This commit is contained in:
@@ -241,10 +241,10 @@
|
||||
if(!homing_target)
|
||||
return FALSE
|
||||
var/datum/point/PT = RETURN_PRECISE_POINT(homing_target)
|
||||
PT.x += CLAMP(homing_offset_x, 1, world.maxx)
|
||||
PT.y += CLAMP(homing_offset_y, 1, world.maxy)
|
||||
PT.x += clamp(homing_offset_x, 1, world.maxx)
|
||||
PT.y += clamp(homing_offset_y, 1, world.maxy)
|
||||
var/angle = closer_angle_difference(Angle, angle_between_points(RETURN_PRECISE_POINT(src), PT))
|
||||
setAngle(Angle + CLAMP(angle, -homing_turn_speed, homing_turn_speed))
|
||||
setAngle(Angle + clamp(angle, -homing_turn_speed, homing_turn_speed))
|
||||
|
||||
/obj/item/projectile/proc/set_homing_target(atom/A)
|
||||
if(!A || (!isturf(A) && !isturf(A.loc)))
|
||||
@@ -322,7 +322,7 @@
|
||||
crash_with("WARNING: Projectile [type] deleted due to being unable to resolve a target after angle was null!")
|
||||
qdel(src)
|
||||
return
|
||||
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(dispersion)
|
||||
setAngle(Angle + rand(-dispersion, dispersion))
|
||||
@@ -427,7 +427,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 = arctan(y - oy, x - ox)
|
||||
return list(angle, p_x, p_y)
|
||||
|
||||
/obj/item/projectile/proc/redirect(x, y, starting, source)
|
||||
@@ -464,7 +464,7 @@
|
||||
// Multiply projectile damage by 1.2, then CLAMP the value between 30 and 100.
|
||||
// This was 0.67 but in practice it made all projectiles that did 45 or less damage play at 30,
|
||||
// which is hard to hear over the gunshots, and is rather rare for a projectile to do that much.
|
||||
return CLAMP((value_to_use) * 1.2, 30, 100)
|
||||
return clamp((value_to_use) * 1.2, 30, 100)
|
||||
else
|
||||
return 50 //if the projectile doesn't do damage or agony, play its hitsound at 50% volume.
|
||||
|
||||
@@ -812,7 +812,7 @@
|
||||
|
||||
/obj/item/projectile/proc/impact_sounds(atom/A)
|
||||
if(hitsound_wall && !ismob(A)) // Mob sounds are handled in attack_mob().
|
||||
var/volume = CLAMP(vol_by_damage() + 20, 0, 100)
|
||||
var/volume = clamp(vol_by_damage() + 20, 0, 100)
|
||||
if(silenced)
|
||||
volume = 5
|
||||
playsound(A, hitsound_wall, volume, 1, -1)
|
||||
|
||||
@@ -103,4 +103,21 @@
|
||||
damage = 17
|
||||
armor_penetration = 10
|
||||
range_step = 5 //controls damage falloff with distance. projectiles lose a "pellet" each time they travel this distance. Can be a non-integer.
|
||||
pellets = 1
|
||||
pellets = 1
|
||||
|
||||
/obj/item/projectile/bullet/pellet/fragment/meteor
|
||||
name = "meteor fragment"
|
||||
damage = 10
|
||||
armor_penetration = 30
|
||||
range_step = 6
|
||||
pellets = 2
|
||||
|
||||
no_attack_log = 1
|
||||
muzzle_type = null
|
||||
|
||||
/obj/item/projectile/bullet/pellet/fragment/meteor/small
|
||||
damage = 5
|
||||
|
||||
/obj/item/projectile/bullet/pellet/fragment/meteor/incendiary
|
||||
name = "molten meteor fragment"
|
||||
damage_type = SEARING
|
||||
|
||||
Reference in New Issue
Block a user