diff --git a/code/modules/projectiles/guns/misc/blastcannon.dm b/code/modules/projectiles/guns/misc/blastcannon.dm index 603f8843ca..5ee2ecec05 100644 --- a/code/modules/projectiles/guns/misc/blastcannon.dm +++ b/code/modules/projectiles/guns/misc/blastcannon.dm @@ -12,21 +12,17 @@ randomspread = FALSE var/obj/item/device/transfer_valve/bomb - var/datum/gas_mixture/air1 - var/datum/gas_mixture/air2 /obj/item/gun/blastcannon/New() if(!pin) pin = new - . = ..() + return ..() /obj/item/gun/blastcannon/Destroy() if(bomb) qdel(bomb) bomb = null - air1 = null - air2 = null - . = ..() + return ..() /obj/item/gun/blastcannon/attack_self(mob/user) if(bomb) @@ -35,7 +31,7 @@ user.visible_message("[user] detaches the [bomb] from the [src]") bomb = null update_icon() - . = ..(user) + return ..() /obj/item/gun/blastcannon/update_icon() if(bomb) @@ -46,7 +42,6 @@ icon_state = initial(icon_state) name = initial(name) desc = initial(desc) - . = ..() /obj/item/gun/blastcannon/attackby(obj/O, mob/user) if(istype(O, /obj/item/device/transfer_valve)) @@ -59,20 +54,17 @@ return FALSE user.visible_message("[user] attaches the [O] to the [src]!") bomb = O - O.loc = src + O.forceMove(src) update_icon() return TRUE - . = ..() + return ..() /obj/item/gun/blastcannon/proc/calculate_bomb() if(!istype(bomb)||!istype(bomb.tank_one)||!istype(bomb.tank_two)) return 0 - air1 = bomb.tank_one.air_contents - air2 = bomb.tank_two.air_contents - var/datum/gas_mixture/temp - temp.volume = air1.volume + air2.volume - temp.merge(air1) - temp.merge(air2) + var/datum/gas_mixture/temp = new(60) //directional buff. + temp.merge(bomb.tank_one.air_contents.remove_ratio(1)) + temp.merge(bomb.tank_two.air_contents.remove_ratio(2)) for(var/i in 1 to 6) temp.react() var/pressure = temp.return_pressure() @@ -82,7 +74,7 @@ return (pressure/TANK_FRAGMENT_SCALE) /obj/item/gun/blastcannon/afterattack(atom/target, mob/user, flag, params) - if((!bomb) || (target == user) || (target.loc == user) || (!target) || (target.loc == user.loc) || (target.loc in range(user, 2)) || (target in range(user, 2))) + if((!bomb) || (!target) || (get_dist(get_turf(target), get_turf(user)) <= 2)) return ..() var/power = calculate_bomb() qdel(bomb) @@ -90,13 +82,17 @@ var/heavy = power * 0.2 var/medium = power * 0.5 var/light = power - user.visible_message("[user] opens \the [bomb] on \his [src.name] and fires a blast wave at \the [target]!","You open \the [bomb] on your [src.name] and fire a blast wave at \the [target]!") + user.visible_message("[user] opens \the [bomb] on \his [name] and fires a blast wave at \the [target]!","You open \the [bomb] on your [name] and fire a blast wave at \the [target]!") playsound(user, "explosion", 100, 1) var/turf/starting = get_turf(user) + var/turf/targturf = get_turf(target) var/area/A = get_area(user) - var/log_str = "Blast wave fired at [ADMIN_COORDJMP(starting)] ([A.name]) by [user.name]([user.ckey]) with power [heavy]/[medium]/[light]." + var/log_str = "Blast wave fired from [ADMIN_COORDJMP(starting)] ([A.name]) at [ADMIN_COORDJMP(targturf)] ([target.name]) by [user.name]([user.ckey]) with power [heavy]/[medium]/[light]." message_admins(log_str) log_game(log_str) + var/obj/item/projectile/blastwave/BW = new(loc, heavy, medium, light) + BW.preparePixelProjectile(target, get_turf(target), user, params, 0) + BW.fire() /obj/item/projectile/blastwave name = "blast wave" @@ -109,6 +105,12 @@ var/lightr = 0 range = 150 +/obj/item/projectile/blastwave/Initialize(mapload, _h, _m, _l) + heavyr = _h + mediumr = _m + lightr = _l + return ..() + /obj/item/projectile/blastwave/Range() ..() if(heavyr)