Fixes some comments, adds clarifications, removes redundant usage of src

This commit is contained in:
Migratingcocofruit
2024-10-19 20:07:42 +03:00
parent 52779fd6a6
commit 079b6416ab
7 changed files with 28 additions and 28 deletions
+3 -3
View File
@@ -545,11 +545,11 @@
if(reagents)
reagents.temperature_reagents(exposed_temperature)
/// This is the default PTL action on atoms.
/// This is the default Power Transmission Laser action on atoms. Called when an atom enters the beam and while it's in the beam.
/atom/proc/ptl_beam_act(obj/machinery/power/transmission_laser/ptl)
var/mw_power = (ptl.output_number * ptl.power_format_multi_output) / (1 MW)
fire_act(null, 3000 * mw_power, 500)
if(ptl.blocker && (ptl.blocker.UID() == src.UID())) // If this is the blocker we need to check if it was destroyed
fire_act(null, 3000 * mw_power, 2500) // Equivalent to being in a fire at a temperature of 3000 degrees kelvin per MW.
if(ptl.blocker && (ptl.blocker.UID() == UID())) // If this is the blocker we need to check if it was destroyed
ptl.check_blocker()
/// If it returns TRUE, attack chain stops
+1 -1
View File
@@ -300,5 +300,5 @@
/obj/ptl_beam_act(obj/machinery/power/transmission_laser/ptl)
var/mw_power = (ptl.output_number * ptl.power_format_multi_output) / (1 MW)
take_damage(mw_power)
if(ptl.blocker && (ptl.blocker.UID() == src.UID())) // If this is the blocker we need to check if it was destroyed
if(ptl.blocker && (ptl.blocker.UID() == UID())) // If this is the blocker we need to check if it was destroyed
ptl.check_blocker()
+5 -5
View File
@@ -265,12 +265,12 @@
return
return ..()
/// Ancient rock has a chance to be destroyed by the laser from 50 MW output and above
/// Cold ancient rock has a chance to be destroyed by the laser from 50 MW output and above
/turf/simulated/mineral/ancient/outer/ptl_beam_act(obj/machinery/power/transmission_laser/ptl)
var/mw_power = (ptl.output_number * ptl.power_format_multi_output) / (1 MW)
if(prob(mw_power - 50))
src.ChangeTurf(src.baseturf)
if(ptl.blocker && (ptl.blocker.UID() == src.UID())) // If this is the blocker we need to check if it was destroyed
var/mw_power = (ptl.output_number * ptl.power_format_multi_output) / (1 MW) // Laser output power in megawatts
if(prob(mw_power - 50))// Chance to destroy the rock increases with power output, starting at 50MW
ChangeTurf(baseturf)
if(ptl.blocker && (ptl.blocker.UID() == UID())) // If this is the blocker we need to check if it was destroyed
ptl.check_blocker()
+2 -2
View File
@@ -571,8 +571,8 @@
/// Walls take damage equivalent to power in megawatts
/turf/simulated/wall/ptl_beam_act(obj/machinery/power/transmission_laser/ptl)
var/mw_power = (ptl.output_number * ptl.power_format_multi_output) / (1 MW)
take_damage(mw_power / 5)
if(ptl.blocker && (ptl.blocker.UID() == src.UID())) // If this is the blocker we need to check if it was destroyed
take_damage(mw_power / 5) // Walls have less hp than machines, but are supposed to be harder to destroy, so we compensate by making them take less damage.
if(ptl.blocker && (ptl.blocker.UID() == UID())) // If this is the blocker we need to check if it was destroyed
ptl.check_blocker()
#undef MAX_DENT_DECALS
+4 -4
View File
@@ -658,12 +658,12 @@
/turf/return_analyzable_air()
return get_readonly_air()
/// Non dense turfs are unaffected by default so we don't destroy floors. Dense turfs have chance to be destroyed.
/// What happens to a turf when it is hit by a power transmission laser, depends on the density of the turf
/turf/ptl_beam_act(obj/machinery/power/transmission_laser/ptl)
var/mw_power = (ptl.output_number * ptl.power_format_multi_output) / (1 MW)
if(!density)
return
return // Non dense turfs are unaffected by default so we don't destroy floors. Dense turfs have chance to be destroyed.
if(prob(mw_power))
src.ChangeTurf(src.baseturf)
if(ptl.blocker && (ptl.blocker.UID() == src.UID())) // If this is the blocker we need to check if it was destroyed
ChangeTurf(baseturf)
if(ptl.blocker && (ptl.blocker.UID() == UID())) // If this is the blocker we need to check if it was destroyed
ptl.check_blocker()
@@ -15,7 +15,7 @@
pixel_x = 0
pixel_y = -64
/// Variables go below here
// Variables go below here
/// How far we shoot the beam. If it isn't blocked it should go to the end of the screen.
var/range = 0
/// Amount of power we are outputting
@@ -24,7 +24,7 @@
var/capacity = INFINITY
/// Our current charge
var/charge = 0
/// Should we try to input charge paired with the var below to check if its fully inputing
/// Are we trying to provide power to the laser
var/input_attempt = TRUE
/// Are we currently inputting
var/inputting = TRUE
@@ -60,16 +60,16 @@
/// The amount of money we haven't sent to cargo yet
var/unsent_earnings = 0
/// How much we are inputing pre multiplier
/// Gives our power input when multiplied with power_format_multi. The multiplier signifies the units of power, and this is how many of them we are inputting.
var/input_number = 0
/// How much we are outputting pre multiplier
/// Gives our power output when multiplied with power_format_multi_output. The multiplier signifies the units of power, and this is how many of them we are outputting.
var/output_number = 0
/// Our set input pulling
var/input_pulling = 0
/// Announcement configuration for updates
var/datum/announcer/announcer
/// Last direction the laser was pointing. So offset doesn't get handles when it doesn't need to
var/last_dir = 0
var/last_dir = NO_DIRECTION
/obj/machinery/power/transmission_laser/Initialize(mapload)
@@ -143,6 +143,7 @@
/obj/machinery/power/transmission_laser/Destroy()
. = ..()
qdel(announcer)
blocker = null
if(length(laser_effects))
destroy_lasers()
@@ -177,7 +178,6 @@
/// Appearance changes are here
/obj/machinery/power/transmission_laser/update_overlays()
. = ..()
if((stat & BROKEN) || !charge)
@@ -388,10 +388,10 @@
var/medium_cut = generated_cash * 0.25
var/high_cut = generated_cash * 0.75
cargo_bank_account.deposit_credits(medium_cut, "Transmission Laser Payout")
GLOB.station_money_database.credit_account(cargo_bank_account, medium_cut, "Transmission Laser Payout", "Central Command Supply Master", supress_log = FALSE)
unsent_earnings -= medium_cut
engineering_bank_account.deposit_credits(high_cut, "Transmission Laser Payout")
GLOB.station_money_database.credit_account(engineering_bank_account, high_cut, "Transmission Laser Payout", "Central Command Supply Master", supress_log = FALSE)
unsent_earnings -= high_cut
#undef A1_CURVE
@@ -403,7 +403,7 @@
/obj/machinery/power/transmission_laser/proc/setup_lasers()
var/turf/last_step = get_step(get_front_turf(), dir)
// Create new lasers from the starting point to either the blocker or the edge of the map
for(var/num = 1 to range + 1)
for(var/num in 1 to range + 1)
if(!(locate(/obj/effect/transmission_beam) in last_step))
var/obj/effect/transmission_beam/new_beam = new(last_step, src)
new_beam.host = src
+4 -4
View File
@@ -1179,13 +1179,13 @@
var/mw_power = (ptl.output_number * ptl.power_format_multi_output) / (1 MW)
switch(mw_power)
if(0 to 25)
src.adjustFireLoss(-mw_power * 15)
src.adjust_fire_stacks(mw_power)
adjustFireLoss(-mw_power * 15)
adjust_fire_stacks(mw_power)
if(26 to 50)
src.gib(FALSE)
gib(FALSE)
else
explosion(src, 3, 2, 2)
src.gib(FALSE)
gib(FALSE)
if(ptl.blocker && (ptl.blocker.UID() == src.UID())) // If this is the blocker we need to check if it was destroyed
ptl.check_blocker()