PEAC Stuff (#16274)

This commit is contained in:
Geeves
2023-06-09 12:09:45 +02:00
committed by GitHub
parent 61ee7b8fb5
commit 391a9043ec
6 changed files with 103 additions and 12 deletions

View File

@@ -46,3 +46,14 @@
name = "science gun cabinet"
req_access = list(access_tox_storage)
icon_state = "sci"
/obj/structure/closet/secure_closet/guncabinet/peac
name = "anti-materiel weapons platform cabinet"
/obj/structure/closet/secure_closet/guncabinet/peac/fill()
new /obj/item/gun/projectile/peac(src)
for(var/i = 1 to 2)
new /obj/item/ammo_casing/peac(src)
new /obj/item/ammo_casing/peac/he(src)
for(var/i = 1 to 3)
new /obj/item/ammo_casing/peac/shrapnel(src)

View File

@@ -333,6 +333,9 @@ var/list/global/organ_rel_size = list(
if(point_blank)
return zone //Point blank shots don't miss.
return target.calculate_zone_with_miss_chance(zone, miss_chance_mod)
/mob/proc/calculate_zone_with_miss_chance(var/zone, var/miss_chance_mod)
var/miss_chance = 10
if (zone in base_miss_chance)
miss_chance = base_miss_chance[zone]
@@ -343,6 +346,15 @@ var/list/global/organ_rel_size = list(
return pick(base_miss_chance)
return zone
// never a chance to miss, but you might not hit what you want to hit
/mob/living/heavy_vehicle/calculate_zone_with_miss_chance(zone, miss_chance_mod)
var/miss_chance = 10
if(zone in base_miss_chance)
miss_chance = base_miss_chance[zone]
miss_chance = max(miss_chance + miss_chance_mod, 0)
if(prob(miss_chance))
return pick(base_miss_chance)
return zone
/proc/stars(n, pr)
if (pr == null)

View File

@@ -401,16 +401,26 @@
max_stack = 1
/obj/item/ammo_casing/peac
name = "anti-materiel cannon cartridge"
name = "anti-materiel AP cannon cartridge"
icon_state = "peac"
spent_icon = "peac-spent"
caliber = "peac"
w_class = ITEMSIZE_NORMAL
slot_flags = null
projectile_type = /obj/item/projectile/bullet/recoilless_rifle/peac
projectile_type = /obj/item/projectile/bullet/peac
drop_sound = 'sound/items/drop/shell_drop.ogg'
pickup_sound = 'sound/items/pickup/weldingtool.ogg'
reload_sound = 'sound/weapons/railgun_insert_emp.ogg'
max_stack = 1
/obj/item/ammo_casing/peac/he
name = "anti-materiel HE cannon cartridge"
projectile_type = /obj/item/projectile/bullet/peac/he
/obj/item/ammo_casing/peac/shrapnel
name = "anti-materiel FRAG cannon cartridge"
projectile_type = /obj/item/projectile/bullet/peac/shrapnel
/obj/item/ammo_casing/kumar_super
name =".599 kumar super casing"
icon_state = "rifle-casing"

View File

@@ -442,11 +442,66 @@
explosion(A, -1, heavy_impact_range, 2)
..()
/obj/item/projectile/bullet/recoilless_rifle/peac
/obj/item/projectile/bullet/peac
name = "anti-tank missile"
icon_state = "peac"
damage = 25
armor_penetration = 35
anti_materiel_potential = 6
penetrating = TRUE
heavy_impact_range = -1
embed = FALSE
penetrating = 1
var/devastation_range = -1
var/heavy_impact_range = -1
var/light_impact_range = 2
/obj/item/projectile/bullet/peac/check_penetrate(atom/hit_atom)
if(hit_atom == original)
return FALSE
return ..()
/obj/item/projectile/bullet/peac/on_impact(var/atom/hit_atom)
explosion(hit_atom, devastation_range, heavy_impact_range, light_impact_range)
/obj/item/projectile/bullet/peac/he
name = "high-explosive missile"
armor_penetration = 0
anti_materiel_potential = 3
devastation_range = 1
heavy_impact_range = 2
light_impact_range = 4
/obj/item/projectile/bullet/peac/shrapnel
name = "fragmentation missile"
armor_penetration = 0
anti_materiel_potential = 2
light_impact_range = 1
/obj/item/projectile/bullet/peac/shrapnel/preparePixelProjectile()
. = ..()
range = get_dist(firer, original)
/obj/item/projectile/bullet/peac/shrapnel/on_impact(var/atom/hit_atom)
..()
spawn_shrapnel(starting ? get_dir(starting, original) : dir)
/obj/item/projectile/bullet/peac/shrapnel/proc/spawn_shrapnel(var/shrapnel_dir)
set waitfor = FALSE
var/turf/O = get_turf(src)
var/list/target_turfs = list()
target_turfs += get_step(O, shrapnel_dir)
target_turfs += get_step(O, turn(shrapnel_dir, -45))
target_turfs += get_step(O, turn(shrapnel_dir, 45))
for(var/turf/T in target_turfs)
var/obj/item/projectile/bullet/pellet/fragment/P = new(O)
P.damage = 30
P.pellets = 4
P.range_step = 3
P.shot_from = src
P.range = 15
P.name = "shrapnel"
P.launch_projectile(T)