Merge branch 'master' into mirror-38933
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
/obj/item/gun/energy/beam_rifle
|
||||
name = "particle acceleration rifle"
|
||||
desc = "An energy-based anti material marksman rifle that uses highly charged particle beams moving at extreme velocities to decimate whatever is unfortunate enough to be targetted by one. \
|
||||
desc = "An energy-based anti material marksman rifle that uses highly charged particle beams moving at extreme velocities to decimate whatever is unfortunate enough to be targeted by one. \
|
||||
<span class='boldnotice'>Hold down left click while scoped to aim, when weapon is fully aimed (Tracer goes from red to green as it charges), release to fire. Moving while aiming or \
|
||||
changing where you're pointing at while aiming will delay the aiming process depending on how much you changed.</span>"
|
||||
icon = 'icons/obj/guns/energy.dmi'
|
||||
@@ -195,6 +195,9 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
chambered = null
|
||||
recharge_newshot()
|
||||
|
||||
@@ -510,8 +513,6 @@
|
||||
return 0.4
|
||||
if(istype(target, /obj/structure/window))
|
||||
return 0.5
|
||||
if(istype(target, /obj/structure/blob)) //CIT CHANGE - Blobs are getting ggnore'd too hard and people need to GIT GUD
|
||||
return 0.2
|
||||
return 1
|
||||
|
||||
/obj/item/projectile/beam/beam_rifle/proc/handle_impact(atom/target)
|
||||
|
||||
@@ -11,8 +11,21 @@
|
||||
clumsy_check = FALSE
|
||||
randomspread = FALSE
|
||||
|
||||
var/hugbox = TRUE
|
||||
var/max_power = INFINITY
|
||||
var/reaction_volume_mod = 0
|
||||
var/reaction_cycles = 3 //How many times gases react() before calculation. Very finnicky value, do not mess with without good reason.
|
||||
var/prereaction = TRUE
|
||||
|
||||
var/bombcheck = TRUE
|
||||
var/debug_power = 0
|
||||
|
||||
var/obj/item/transfer_valve/bomb
|
||||
|
||||
/obj/item/gun/blastcannon/debug
|
||||
debug_power = 80
|
||||
bombcheck = FALSE
|
||||
|
||||
/obj/item/gun/blastcannon/Initialize()
|
||||
. = ..()
|
||||
if(!pin)
|
||||
@@ -56,38 +69,45 @@
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
//returns the third value of a bomb blast
|
||||
/obj/item/gun/blastcannon/proc/calculate_bomb()
|
||||
if(!istype(bomb) || !istype(bomb.tank_one) || !istype(bomb.tank_two))
|
||||
return 0
|
||||
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)
|
||||
var/datum/gas_mixture/temp = new(max(reaction_volume_mod, 0))
|
||||
bomb.merge_gases(temp)
|
||||
if(prereaction)
|
||||
temp.react(src)
|
||||
var/prereaction_pressure = temp.return_pressure()
|
||||
if(prereaction_pressure < TANK_FRAGMENT_PRESSURE)
|
||||
return 0
|
||||
for(var/i in 1 to reaction_cycles)
|
||||
temp.react(src)
|
||||
var/pressure = temp.return_pressure()
|
||||
qdel(temp)
|
||||
if(pressure < TANK_FRAGMENT_PRESSURE)
|
||||
return 0
|
||||
return (pressure / TANK_FRAGMENT_SCALE)
|
||||
return ((pressure - TANK_FRAGMENT_PRESSURE) / TANK_FRAGMENT_SCALE)
|
||||
|
||||
/obj/item/gun/blastcannon/afterattack(atom/target, mob/user, flag, params)
|
||||
if((!bomb) || (!target) || (get_dist(get_turf(target), get_turf(user)) <= 2))
|
||||
if((!bomb && bombcheck) || (!target) || (get_dist(get_turf(target), get_turf(user)) <= 2))
|
||||
return ..()
|
||||
var/power = calculate_bomb()
|
||||
var/power = bomb? calculate_bomb() : debug_power
|
||||
power = min(power, max_power)
|
||||
QDEL_NULL(bomb)
|
||||
update_icon()
|
||||
var/heavy = power * 0.2
|
||||
var/heavy = power * 0.25
|
||||
var/medium = power * 0.5
|
||||
var/light = power
|
||||
user.visible_message("<span class='danger'>[user] opens [bomb] on [user.p_their()] [name] and fires a blast wave at [target]!</span>","<span class='danger'>You open [bomb] on your [name] and fire a blast wave at [target]!</span>")
|
||||
playsound(user, "explosion", 100, 1)
|
||||
var/turf/starting = get_turf(user)
|
||||
var/turf/targturf = get_turf(target)
|
||||
var/log_str = "Blast wave fired from [ADMIN_COORDJMP(starting)] ([get_area_name(user, TRUE)]) at [ADMIN_COORDJMP(targturf)] ([target.name]) by [user.name]([user.ckey]) with power [heavy]/[medium]/[light]."
|
||||
var/log_str = "Blast wave fired from [ADMIN_VERBOSEJMP(starting)] ([get_area_name(user, TRUE)]) at [ADMIN_VERBOSEJMP(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.hugbox = hugbox
|
||||
BW.preparePixelProjectile(target, get_turf(src), params, 0)
|
||||
BW.fire()
|
||||
|
||||
/obj/item/projectile/blastwave
|
||||
@@ -99,6 +119,7 @@
|
||||
var/heavyr = 0
|
||||
var/mediumr = 0
|
||||
var/lightr = 0
|
||||
var/hugbox = TRUE
|
||||
range = 150
|
||||
|
||||
/obj/item/projectile/blastwave/Initialize(mapload, _h, _m, _l)
|
||||
@@ -110,14 +131,25 @@
|
||||
/obj/item/projectile/blastwave/Range()
|
||||
..()
|
||||
var/amount_destruction = EXPLODE_NONE
|
||||
var/wallbreak_chance = 0
|
||||
if(heavyr)
|
||||
amount_destruction = EXPLODE_DEVASTATE
|
||||
wallbreak_chance = 99
|
||||
else if(mediumr)
|
||||
amount_destruction = EXPLODE_HEAVY
|
||||
wallbreak_chance = 66
|
||||
else if(lightr)
|
||||
amount_destruction = EXPLODE_LIGHT
|
||||
wallbreak_chance = 33
|
||||
if(amount_destruction)
|
||||
loc.ex_act(amount_destruction)
|
||||
if(hugbox)
|
||||
loc.contents_explosion(EXPLODE_HEAVY, loc)
|
||||
if(istype(loc, /turf/closed/wall))
|
||||
var/turf/closed/wall/W = loc
|
||||
if(prob(wallbreak_chance))
|
||||
W.dismantle_wall(TRUE, TRUE)
|
||||
else
|
||||
loc.ex_act(amount_destruction)
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
grenades -= F
|
||||
F.forceMove(user.loc)
|
||||
F.throw_at(target, 30, 2, user)
|
||||
message_admins("[key_name_admin(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
|
||||
log_game("[key_name(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] fired a grenade ([F.name]) from a grenade launcher ([src]) from [AREACOORD(user)] at [target] [AREACOORD(target)].")
|
||||
log_game("[key_name(user)] fired a grenade ([F.name]) with a grenade launcher ([src]) from [AREACOORD(user)] at [target] [AREACOORD(target)].")
|
||||
F.active = 1
|
||||
F.icon_state = initial(F.icon_state) + "_active"
|
||||
playsound(user.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
|
||||
Reference in New Issue
Block a user