From 538e18acb2c548ef2f1a79224ff318410cc6e53e Mon Sep 17 00:00:00 2001 From: alex-gh Date: Fri, 20 Jun 2014 21:27:51 +0200 Subject: [PATCH 1/4] Fixed missing bracket --- code/modules/virus2/effect.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index 5b2d5b891dc..2471573b979 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -785,7 +785,7 @@ var/list/compatible_mobs = list(/mob/living/carbon/human, /mob/living/carbon/mon name = "Watery Eyes" stage = 1 activate(var/mob/living/carbon/mob,var/multiplier) - mob << "" + mob << "Your eyes sting and water!" /datum/disease2/effect/wheeze name = "Wheezing" From e78c90e1638401318f9e591034830d3e2a1d62ce Mon Sep 17 00:00:00 2001 From: alex-gh Date: Sat, 21 Jun 2014 06:38:19 +0200 Subject: [PATCH 2/4] Fixed supermatter runtime by updating the file to the latest BS12 version --- code/modules/supermatter/supermatter.dm | 103 ++++++++++++++++-------- 1 file changed, 71 insertions(+), 32 deletions(-) diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index 09cddef7db9..122da9f2361 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -1,10 +1,19 @@ #define NITROGEN_RETARDATION_FACTOR 4 //Higher == N2 slows reaction more #define THERMAL_RELEASE_MODIFIER 10 //Higher == less heat released during reaction -#define PLASMA_RELEASE_MODIFIER 1500 //Higher == less plasma released by reaction +#define PHORON_RELEASE_MODIFIER 1500 //Higher == less phoron released by reaction #define OXYGEN_RELEASE_MODIFIER 750 //Higher == less oxygen released at high temperature/power +#define THERMAL_RELEASE_MODIFIER 750 //Higher == more heat released during reaction +#define PLASMA_RELEASE_MODIFIER 1500 //Higher == less plasma released by reaction +#define OXYGEN_RELEASE_MODIFIER 1500 //Higher == less oxygen released at high temperature/power #define REACTION_POWER_MODIFIER 1.1 //Higher == more overall power -#define DAMAGE_RATE_LIMIT 5 //damage rate cap at power = 900, scales linearly with power + +//Controls how much power is produced by each collector in range - this is the main parameter for tweaking SM balance, as it basically controls how the power variable relates to the rest of the game. +#define POWER_FACTOR 0.35 //Obtained from testing. Aiming to make the ideal running output (600 kW) run the SM to ~85% of the safety level. + +#define CHARGING_FACTOR 0.55 +#define DAMAGE_RATE_LIMIT 5 //damage rate cap at power = 900, scales linearly with power + //These would be what you would get at point blank, decreases with distance #define DETONATION_RADS 200 @@ -73,6 +82,7 @@ gasefficency = 0.125 + pull_radius = 5 explosion_power = 3 //3,6,9,12? Or is that too small? @@ -81,11 +91,14 @@ radio = new (src) -/obj/machinery/power/supermatter/Destroy() +/obj/machinery/power/supermatter/Del() del radio . = ..() /obj/machinery/power/supermatter/proc/explode() + anchored = 1 + grav_pulling = 1 + spawn(100) explosion(get_turf(src), explosion_power, explosion_power * 2, explosion_power * 3, explosion_power * 4, 1) del src return @@ -147,53 +160,78 @@ //ensure that damage doesn't increase too quickly due to super high temperatures resulting from no coolant, for example. We dont want the SM exploding before anyone can react. //We want the cap to scale linearly with power (and explosion_point). Let's aim for a cap of 5 at power = 900 (based on testing, equals roughly 5% per SM alert announcement). + var/damage_inc_limit = (power/900)*(explosion_point/1000)*DAMAGE_RATE_LIMIT - var/temp_factor = 100 + if(!istype(L, /turf/space)) + env = L.return_air() + removed = env.remove(gasefficency * env.total_moles) //Remove gas from surrounding area - if(oxygen > 0.8) - // with a perfect gas mix, make the power less based on heat - icon_state = "[base_icon_state]_glow" + if(!env || !removed || !removed.total_moles) + damage += max(((power-(1600*POWER_FACTOR)))/10, 0) //exciting the supermatter in a vacuum means the internal energy is mostly locked inside. + else if (grav_pulling) //If supermatter is detonating, remove all air from the zone + env.remove(env.total_moles) else - // in normal mode, base the produced energy around the heat - temp_factor = 60 - icon_state = base_icon_state + damage_archived = damage - power = max( (removed.temperature * temp_factor / T0C) * oxygen + power, 0) //Total laser power plus an overload + damage = max( damage + min( ( (removed.temperature - 800) / 150 ), damage_inc_limit ) , 0 ) + //Ok, 100% oxygen atmosphere = best reaction + //Maxes out at 100% oxygen pressure + oxygen = max(min((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 1), 0) - //We've generated power, now let's transfer it to the collectors for storing/usage - transfer_energy() + var/temp_factor = 100 - var/device_energy = power * REACTION_POWER_MODIFIER + if(oxygen > 0.8) + // with a perfect gas mix, make the power less based on heat + icon_state = "[base_icon_state]_glow" + else + // in normal mode, base the produced energy around the heat + temp_factor = 60 + icon_state = base_icon_state - //To figure out how much temperature to add each tick, consider that at one atmosphere's worth - //of pure oxygen, with all four lasers firing at standard energy and no N2 present, at room temperature - //that the device energy is around 2140. At that stage, we don't want too much heat to be put out - //Since the core is effectively "cold" + power = max( (removed.temperature * temp_factor / T0C) * oxygen + power, 0) //Total laser power plus an overload - //Also keep in mind we are only adding this temperature to (efficiency)% of the one tile the rock - //is on. An increase of 4*C @ 25% efficiency here results in an increase of 1*C / (#tilesincore) overall. - removed.temperature += (device_energy / THERMAL_RELEASE_MODIFIER) + //We've generated power, now let's transfer it to the collectors for storing/usage + transfer_energy() - removed.temperature = max(0, min(removed.temperature, 2500)) + var/device_energy = power * REACTION_POWER_MODIFIER - //Calculate how much gas to release - removed.toxins += max(device_energy / PLASMA_RELEASE_MODIFIER, 0) + //To figure out how much temperature to add each tick, consider that at one atmosphere's worth + //of pure oxygen, with all four lasers firing at standard energy and no N2 present, at room temperature + //that the device energy is around 2140. At that stage, we don't want too much heat to be put out + //Since the core is effectively "cold" - removed.oxygen += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0) + //Also keep in mind we are only adding this temperature to (efficiency)% of the one tile the rock + //is on. An increase of 4*C @ 25% efficiency here results in an increase of 1*C / (#tilesincore) overall. - removed.update_values() + var/thermal_power = THERMAL_RELEASE_MODIFIER - env.merge(removed) + //This shouldn't be necessary. If the number of moles is low, then heat_capacity should be tiny. + //if(removed.total_moles < 35) thermal_power += 750 //If you don't add coolant, you are going to have a bad time. + + removed.temperature += ((device_energy * thermal_power) / removed.heat_capacity()) + + removed.temperature = max(0, min(removed.temperature, 10000)) + + //Calculate how much gas to release + removed.phoron += max(device_energy / PHORON_RELEASE_MODIFIER, 0) + + removed.oxygen += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0) + + removed.update_values() + + env.merge(removed) for(var/mob/living/carbon/human/l in view(src, min(7, round(power ** 0.25)))) // If they can see it without mesons on. Bad on them. if(!istype(l.glasses, /obj/item/clothing/glasses/meson)) l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1,get_dist(l, src)) ) ) ) - for(var/mob/living/l in range(src, round((power / 100) ** 0.25))) + //adjusted range so that a power of 600 (pretty high) results in 8 tiles, roughly the distance from the core to the engine monitoring room. + //at power of 1210 this becomes 9 tiles --> increases very very slowly. + for(var/mob/living/l in range(src, round((power / 0.146484375) ** 0.25))) var/rads = (power / 10) * sqrt( 1 / get_dist(l, src) ) l.apply_effect(rads, IRRADIATE) - power -= (power/500)**3 + power -= (power/500)**3 //energy losses due to radiation return 1 @@ -206,7 +244,7 @@ if(Proj.flag != "bullet") - power += Proj.damage * config_bullet_energy + power += Proj.damage * config_bullet_energy * CHARGING_FACTOR else damage += Proj.damage * config_bullet_energy return 0 @@ -236,7 +274,7 @@ /obj/machinery/power/supermatter/proc/transfer_energy() for(var/obj/machinery/power/rad_collector/R in rad_collectors) if(get_dist(R, src) <= 15) // Better than using orange() every process - R.receive_pulse(power) + R.receive_pulse(power * POWER_FACTOR) return /obj/machinery/power/supermatter/attackby(obj/item/weapon/W as obj, mob/living/user as mob) @@ -255,7 +293,7 @@ AM.visible_message("\The [AM] slams into \the [src] inducing a resonance... \his body starts to glow and catch flame before flashing into ash.",\ "You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"",\ "You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.") - else + else if(!grav_pulling) //To prevent spam, detonating supermatter does not indicate non-mobs being destroyed AM.visible_message("\The [AM] smacks into \the [src] and rapidly flashes to ash.",\ "You hear a loud crack as you are washed with a wave of heat.") @@ -281,6 +319,7 @@ var/rads = 500 * sqrt( 1 / (get_dist(l, src) + 1) ) l.apply_effect(rads, IRRADIATE) + /obj/machinery/power/supermatter/proc/supermatter_pull() //following is adapted from singulo code From d75d335f9bddd4712232eb5707c32eeb63b68ed4 Mon Sep 17 00:00:00 2001 From: alex-gh Date: Sat, 21 Jun 2014 07:31:05 +0200 Subject: [PATCH 3/4] Goddamn phoron in my plasma --- code/modules/supermatter/supermatter.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index 122da9f2361..1f11063c011 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -213,7 +213,7 @@ removed.temperature = max(0, min(removed.temperature, 10000)) //Calculate how much gas to release - removed.phoron += max(device_energy / PHORON_RELEASE_MODIFIER, 0) + removed.toxins += max(device_energy / PLASMA_RELEASE_MODIFIER, 0) removed.oxygen += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0) From c187ed88c7982d36f04257837f86acf8f2d75572 Mon Sep 17 00:00:00 2001 From: alex-gh Date: Sat, 21 Jun 2014 07:36:19 +0200 Subject: [PATCH 4/4] Deduplicating code --- code/game/gamemodes/autotraitor/autotraitor.dm | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm index 70105d2264d..fc9359cb53f 100644 --- a/code/game/gamemodes/autotraitor/autotraitor.dm +++ b/code/game/gamemodes/autotraitor/autotraitor.dm @@ -183,16 +183,7 @@ //message_admins("The probability of a new traitor is [traitor_prob]%") if(prob(traitor_prob)) message_admins("New traitor roll passed. Making a new Traitor.") - forge_traitor_objectives(character.mind) - equip_traitor(character) - traitors += character.mind - character << "\red You are the traitor." - character.mind.special_role = "traitor" - var/obj_count = 1 - character << "\blue Your current objectives:" - for(var/datum/objective/objective in character.mind.objectives) - character << "Objective #[obj_count]: [objective.explanation_text]" - obj_count++ + character.mind.make_Tratior() //TEMP: Add proper checks for loyalty here. uc_guy //else //message_admins("New traitor roll failed. No new traitor.") //else