diff --git a/code/datums/ammo/rocket.dm b/code/datums/ammo/rocket.dm index 66a9f65bdcdd..7581d434c4b4 100644 --- a/code/datums/ammo/rocket.dm +++ b/code/datums/ammo/rocket.dm @@ -28,26 +28,26 @@ smoke = null . = ..() -/datum/ammo/rocket/on_hit_mob(mob/M, obj/projectile/P) - cell_explosion(get_turf(M), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - smoke.set_up(1, get_turf(M)) - if(ishuman_strict(M)) // No yautya or synths. Makes humans gib on direct hit. - M.ex_act(350, P.dir, P.weapon_cause_data, 100) +/datum/ammo/rocket/on_hit_mob(mob/mob, obj/projectile/projectile) + cell_explosion(get_turf(mob), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + smoke.set_up(1, get_turf(mob)) + if(ishuman_strict(mob)) // No yautya or synths. Makes humans gib on direct hit. + mob.ex_act(350, projectile.dir, projectile.weapon_cause_data, 100) smoke.start() -/datum/ammo/rocket/on_hit_obj(obj/O, obj/projectile/P) - cell_explosion(get_turf(O), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - smoke.set_up(1, get_turf(O)) +/datum/ammo/rocket/on_hit_obj(obj/object, obj/projectile/projectile) + cell_explosion(get_turf(object), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + smoke.set_up(1, get_turf(object)) smoke.start() -/datum/ammo/rocket/on_hit_turf(turf/T, obj/projectile/P) - cell_explosion(T, 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - smoke.set_up(1, T) +/datum/ammo/rocket/on_hit_turf(turf/turf, obj/projectile/projectile) + cell_explosion(turf, 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + smoke.set_up(1, turf) smoke.start() -/datum/ammo/rocket/do_at_max_range(obj/projectile/P) - cell_explosion(get_turf(P), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - smoke.set_up(1, get_turf(P)) +/datum/ammo/rocket/do_at_max_range(obj/projectile/projectile) + cell_explosion(get_turf(projectile), 150, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + smoke.set_up(1, get_turf(projectile)) smoke.start() /datum/ammo/rocket/ap @@ -62,62 +62,65 @@ damage = 10 penetration= ARMOR_PENETRATION_TIER_10 -/datum/ammo/rocket/ap/on_hit_mob(mob/M, obj/projectile/P) - var/turf/T = get_turf(M) - M.ex_act(150, P.dir, P.weapon_cause_data, 100) - M.apply_effect(2, PARALYZE) - if(ishuman_strict(M)) // No yautya or synths. Makes humans gib on direct hit. - M.ex_act(300, P.dir, P.weapon_cause_data, 100) - cell_explosion(T, 100, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - smoke.set_up(1, T) + +/datum/ammo/rocket/ap/on_hit_mob(mob/mob, obj/projectile/projectile) + var/turf/turf = get_turf(mob) + mob.ex_act(150, projectile.dir, projectile.weapon_cause_data, 100) + mob.apply_effect(3, WEAKEN) + mob.apply_effect(3, PARALYZE) + if(ishuman_strict(mob)) // No yautya or synths. Makes humans gib on direct hit. + mob.ex_act(300, projectile.dir, projectile.weapon_cause_data, 100) + cell_explosion(turf, 100, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + smoke.set_up(1, turf) smoke.start() -/datum/ammo/rocket/ap/on_hit_obj(obj/O, obj/projectile/P) - var/turf/T = get_turf(O) - O.ex_act(150, P.dir, P.weapon_cause_data, 100) - cell_explosion(T, 100, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - smoke.set_up(1, T) +/datum/ammo/rocket/ap/on_hit_obj(obj/object, obj/projectile/projectile) + var/turf/turf = get_turf(object) + object.ex_act(150, projectile.dir, projectile.weapon_cause_data, 100) + cell_explosion(turf, 100, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + smoke.set_up(1, turf) smoke.start() -/datum/ammo/rocket/ap/on_hit_turf(turf/T, obj/projectile/P) +/datum/ammo/rocket/ap/on_hit_turf(turf/turf, obj/projectile/projectile) var/hit_something = 0 - for(var/mob/M in T) - M.ex_act(150, P.dir, P.weapon_cause_data, 100) - M.apply_effect(4, PARALYZE) + for(var/mob/mob in turf) + mob.ex_act(150, projectile.dir, projectile.weapon_cause_data, 100) + mob.apply_effect(3, WEAKEN) + mob.apply_effect(3, PARALYZE) hit_something = 1 continue if(!hit_something) - for(var/obj/O in T) - if(O.density) - O.ex_act(150, P.dir, P.weapon_cause_data, 100) + for(var/obj/object in turf) + if(object.density) + object.ex_act(150, projectile.dir, projectile.weapon_cause_data, 100) hit_something = 1 continue if(!hit_something) - T.ex_act(150, P.dir, P.weapon_cause_data, 200) + turf.ex_act(150, projectile.dir, projectile.weapon_cause_data, 200) - cell_explosion(T, 100, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - smoke.set_up(1, T) + cell_explosion(turf, 100, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + smoke.set_up(1, turf) smoke.start() -/datum/ammo/rocket/ap/do_at_max_range(obj/projectile/P) - var/turf/T = get_turf(P) +/datum/ammo/rocket/ap/do_at_max_range(obj/projectile/projectile) + var/turf/turf = get_turf(projectile) var/hit_something = 0 - for(var/mob/M in T) - M.ex_act(250, P.dir, P.weapon_cause_data, 100) - M.apply_effect(2, WEAKEN) - M.apply_effect(2, PARALYZE) + for(var/mob/mob in turf) + mob.ex_act(150, projectile.dir, projectile.weapon_cause_data, 100) + mob.apply_effect(3, WEAKEN) + mob.apply_effect(3, PARALYZE) hit_something = 1 - continue + break if(!hit_something) - for(var/obj/O in T) - if(O.density) - O.ex_act(250, P.dir, P.weapon_cause_data, 100) + for(var/obj/object in turf) + if(object.density) + object.ex_act(150, projectile.dir, projectile.weapon_cause_data, 100) hit_something = 1 - continue + break if(!hit_something) - T.ex_act(250, P.dir, P.weapon_cause_data) - cell_explosion(T, 100, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - smoke.set_up(1, T) + turf.ex_act(150, projectile.dir, projectile.weapon_cause_data) + cell_explosion(turf, 100, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + smoke.set_up(1, turf) smoke.start() /datum/ammo/rocket/ap/anti_tank @@ -127,16 +130,16 @@ shrapnel_chance = 5 shrapnel_type = /obj/item/large_shrapnel/at_rocket_dud -/datum/ammo/rocket/ap/anti_tank/on_hit_obj(obj/O, obj/projectile/P) - if(istype(O, /obj/vehicle/multitile)) - var/obj/vehicle/multitile/M = O - M.next_move = world.time + vehicle_slowdown_time - playsound(M, 'sound/effects/meteorimpact.ogg', 35) - M.at_munition_interior_explosion_effect(cause_data = create_cause_data("Anti-Tank Rocket")) - M.interior_crash_effect() - var/turf/T = get_turf(M.loc) - M.ex_act(150, P.dir, P.weapon_cause_data, 100) - smoke.set_up(1, T) +/datum/ammo/rocket/ap/anti_tank/on_hit_obj(obj/object, obj/projectile/projectile) + if(istype(object, /obj/vehicle/multitile)) + var/obj/vehicle/multitile/mob = object + mob.next_move = world.time + vehicle_slowdown_time + playsound(mob, 'sound/effects/meteorimpact.ogg', 35) + mob.at_munition_interior_explosion_effect(cause_data = create_cause_data("Anti-Tank Rocket")) + mob.interior_crash_effect() + var/turf/turf = get_turf(mob.loc) + mob.ex_act(150, projectile.dir, projectile.weapon_cause_data, 100) + smoke.set_up(1, turf) smoke.start() return return ..() @@ -153,21 +156,21 @@ damage = 25 shell_speed = AMMO_SPEED_TIER_3 -/datum/ammo/rocket/ltb/on_hit_mob(mob/M, obj/projectile/P) - cell_explosion(get_turf(M), 220, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - cell_explosion(get_turf(M), 200, 100, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) +/datum/ammo/rocket/ltb/on_hit_mob(mob/mob, obj/projectile/projectile) + cell_explosion(get_turf(mob), 220, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + cell_explosion(get_turf(mob), 200, 100, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) -/datum/ammo/rocket/ltb/on_hit_obj(obj/O, obj/projectile/P) - cell_explosion(get_turf(O), 220, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - cell_explosion(get_turf(O), 200, 100, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) +/datum/ammo/rocket/ltb/on_hit_obj(obj/object, obj/projectile/projectile) + cell_explosion(get_turf(object), 220, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + cell_explosion(get_turf(object), 200, 100, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) -/datum/ammo/rocket/ltb/on_hit_turf(turf/T, obj/projectile/P) - cell_explosion(get_turf(T), 220, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - cell_explosion(get_turf(T), 200, 100, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) +/datum/ammo/rocket/ltb/on_hit_turf(turf/turf, obj/projectile/projectile) + cell_explosion(get_turf(turf), 220, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + cell_explosion(get_turf(turf), 200, 100, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) -/datum/ammo/rocket/ltb/do_at_max_range(obj/projectile/P) - cell_explosion(get_turf(P), 220, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) - cell_explosion(get_turf(P), 200, 100, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, P.weapon_cause_data) +/datum/ammo/rocket/ltb/do_at_max_range(obj/projectile/projectile) + cell_explosion(get_turf(projectile), 220, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) + cell_explosion(get_turf(projectile), 200, 100, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, projectile.weapon_cause_data) /datum/ammo/rocket/wp name = "white phosphorous rocket" @@ -185,30 +188,30 @@ BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_incendiary) )) -/datum/ammo/rocket/wp/drop_flame(turf/T, datum/cause_data/cause_data) - playsound(T, 'sound/weapons/gun_flamethrower3.ogg', 75, 1, 7) - if(!istype(T)) return - smoke.set_up(1, T) +/datum/ammo/rocket/wp/drop_flame(turf/turf, datum/cause_data/cause_data) + playsound(turf, 'sound/weapons/gun_flamethrower3.ogg', 75, 1, 7) + if(!istype(turf)) return + smoke.set_up(1, turf) smoke.start() - var/datum/reagent/napalm/blue/R = new() - new /obj/flamer_fire(T, cause_data, R, 3) + var/datum/reagent/napalm/blue/reagent = new() + new /obj/flamer_fire(turf, cause_data, reagent, 3) var/datum/effect_system/smoke_spread/phosphorus/landingSmoke = new /datum/effect_system/smoke_spread/phosphorus - landingSmoke.set_up(3, 0, T, null, 6, cause_data) + landingSmoke.set_up(3, 0, turf, null, 6, cause_data) landingSmoke.start() landingSmoke = null -/datum/ammo/rocket/wp/on_hit_mob(mob/M, obj/projectile/P) - drop_flame(get_turf(M), P.weapon_cause_data) +/datum/ammo/rocket/wp/on_hit_mob(mob/mob, obj/projectile/projectile) + drop_flame(get_turf(mob), projectile.weapon_cause_data) -/datum/ammo/rocket/wp/on_hit_obj(obj/O, obj/projectile/P) - drop_flame(get_turf(O), P.weapon_cause_data) +/datum/ammo/rocket/wp/on_hit_obj(obj/object, obj/projectile/projectile) + drop_flame(get_turf(object), projectile.weapon_cause_data) -/datum/ammo/rocket/wp/on_hit_turf(turf/T, obj/projectile/P) - drop_flame(T, P.weapon_cause_data) +/datum/ammo/rocket/wp/on_hit_turf(turf/turf, obj/projectile/projectile) + drop_flame(turf, projectile.weapon_cause_data) -/datum/ammo/rocket/wp/do_at_max_range(obj/projectile/P) - drop_flame(get_turf(P), P.weapon_cause_data) +/datum/ammo/rocket/wp/do_at_max_range(obj/projectile/projectile) + drop_flame(get_turf(projectile), projectile.weapon_cause_data) /datum/ammo/rocket/wp/upp name = "extreme-intensity incendiary rocket" @@ -226,25 +229,25 @@ BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_incendiary) )) -/datum/ammo/rocket/wp/upp/drop_flame(turf/T, datum/cause_data/cause_data) - playsound(T, 'sound/weapons/gun_flamethrower3.ogg', 75, 1, 7) - if(!istype(T)) return - smoke.set_up(1, T) +/datum/ammo/rocket/wp/upp/drop_flame(turf/turf, datum/cause_data/cause_data) + playsound(turf, 'sound/weapons/gun_flamethrower3.ogg', 75, 1, 7) + if(!istype(turf)) return + smoke.set_up(1, turf) smoke.start() - var/datum/reagent/napalm/upp/R = new() - new /obj/flamer_fire(T, cause_data, R, 3) + var/datum/reagent/napalm/upp/reagent = new() + new /obj/flamer_fire(turf, cause_data, reagent, 3) -/datum/ammo/rocket/wp/upp/on_hit_mob(mob/M, obj/projectile/P) - drop_flame(get_turf(M), P.weapon_cause_data) +/datum/ammo/rocket/wp/upp/on_hit_mob(mob/mob, obj/projectile/projectile) + drop_flame(get_turf(mob), projectile.weapon_cause_data) -/datum/ammo/rocket/wp/upp/on_hit_obj(obj/O, obj/projectile/P) - drop_flame(get_turf(O), P.weapon_cause_data) +/datum/ammo/rocket/wp/upp/on_hit_obj(obj/object, obj/projectile/projectile) + drop_flame(get_turf(object), projectile.weapon_cause_data) -/datum/ammo/rocket/wp/upp/on_hit_turf(turf/T, obj/projectile/P) - drop_flame(T, P.weapon_cause_data) +/datum/ammo/rocket/wp/upp/on_hit_turf(turf/turf, obj/projectile/projectile) + drop_flame(turf, projectile.weapon_cause_data) -/datum/ammo/rocket/wp/upp/do_at_max_range(obj/projectile/P) - drop_flame(get_turf(P), P.weapon_cause_data) +/datum/ammo/rocket/wp/upp/do_at_max_range(obj/projectile/projectile) + drop_flame(get_turf(projectile), projectile.weapon_cause_data) /datum/ammo/rocket/wp/quad name = "thermobaric rocket" @@ -254,45 +257,45 @@ max_range = 32 shell_speed = AMMO_SPEED_TIER_3 -/datum/ammo/rocket/wp/quad/on_hit_mob(mob/M, obj/projectile/P) - drop_flame(get_turf(M), P.weapon_cause_data) - explosion(P.loc, -1, 2, 4, 5, , , ,P.weapon_cause_data) +/datum/ammo/rocket/wp/quad/on_hit_mob(mob/mob, obj/projectile/projectile) + drop_flame(get_turf(mob), projectile.weapon_cause_data) + explosion(projectile.loc, -1, 2, 4, 5, , , ,projectile.weapon_cause_data) -/datum/ammo/rocket/wp/quad/on_hit_obj(obj/O, obj/projectile/P) - drop_flame(get_turf(O), P.weapon_cause_data) - explosion(P.loc, -1, 2, 4, 5, , , ,P.weapon_cause_data) +/datum/ammo/rocket/wp/quad/on_hit_obj(obj/object, obj/projectile/projectile) + drop_flame(get_turf(object), projectile.weapon_cause_data) + explosion(projectile.loc, -1, 2, 4, 5, , , ,projectile.weapon_cause_data) -/datum/ammo/rocket/wp/quad/on_hit_turf(turf/T, obj/projectile/P) - drop_flame(T, P.weapon_cause_data) - explosion(P.loc, -1, 2, 4, 5, , , ,P.weapon_cause_data) +/datum/ammo/rocket/wp/quad/on_hit_turf(turf/turf, obj/projectile/projectile) + drop_flame(turf, projectile.weapon_cause_data) + explosion(projectile.loc, -1, 2, 4, 5, , , ,projectile.weapon_cause_data) -/datum/ammo/rocket/wp/quad/do_at_max_range(obj/projectile/P) - drop_flame(get_turf(P), P.weapon_cause_data) - explosion(P.loc, -1, 2, 4, 5, , , ,P.weapon_cause_data) +/datum/ammo/rocket/wp/quad/do_at_max_range(obj/projectile/projectile) + drop_flame(get_turf(projectile), projectile.weapon_cause_data) + explosion(projectile.loc, -1, 2, 4, 5, , , ,projectile.weapon_cause_data) /datum/ammo/rocket/custom name = "custom rocket" -/datum/ammo/rocket/custom/proc/prime(atom/A, obj/projectile/P) - var/obj/item/weapon/gun/launcher/rocket/launcher = P.shot_from +/datum/ammo/rocket/custom/proc/prime(atom/atom, obj/projectile/projectile) + var/obj/item/weapon/gun/launcher/rocket/launcher = projectile.shot_from var/obj/item/ammo_magazine/rocket/custom/rocket = launcher.current_mag if(rocket.locked && rocket.warhead && rocket.warhead.detonator) if(rocket.fuel && rocket.fuel.reagents.get_reagent_amount(rocket.fuel_type) >= rocket.fuel_requirement) - rocket.forceMove(P.loc) - rocket.warhead.cause_data = P.weapon_cause_data + rocket.forceMove(projectile.loc) + rocket.warhead.cause_data = projectile.weapon_cause_data rocket.warhead.prime() qdel(rocket) - smoke.set_up(1, get_turf(A)) + smoke.set_up(1, get_turf(atom)) smoke.start() -/datum/ammo/rocket/custom/on_hit_mob(mob/M, obj/projectile/P) - prime(M, P) +/datum/ammo/rocket/custom/on_hit_mob(mob/mob, obj/projectile/projectile) + prime(mob, projectile) -/datum/ammo/rocket/custom/on_hit_obj(obj/O, obj/projectile/P) - prime(O, P) +/datum/ammo/rocket/custom/on_hit_obj(obj/object, obj/projectile/projectile) + prime(object, projectile) -/datum/ammo/rocket/custom/on_hit_turf(turf/T, obj/projectile/P) - prime(T, P) +/datum/ammo/rocket/custom/on_hit_turf(turf/turf, obj/projectile/projectile) + prime(turf, projectile) -/datum/ammo/rocket/custom/do_at_max_range(obj/projectile/P) - prime(null, P) +/datum/ammo/rocket/custom/do_at_max_range(obj/projectile/projectile) + prime(null, projectile)