This commit is contained in:
Ghommie
2019-09-03 21:08:09 +02:00
1529 changed files with 21814 additions and 7632 deletions
+19 -17
View File
@@ -267,7 +267,7 @@
to_chat(user, "<span class='brass'>There is an integration cog installed!</span>")
to_chat(user, "<span class='notice'>Alt-Click the APC to [ locked ? "unlock" : "lock"] the interface.</span>")
if(issilicon(user))
to_chat(user, "<span class='notice'>Ctrl-Click the APC to switch the breaker [ operating ? "off" : "on"].</span>")
@@ -747,7 +747,7 @@
if(damage_flag == "melee" && damage_amount < damage_deflection)
return 0
. = ..()
/obj/machinery/power/apc/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(stat & BROKEN))
@@ -759,21 +759,23 @@
update_icon()
/obj/machinery/power/apc/emag_act(mob/user)
if(!(obj_flags & EMAGGED) && !malfhack)
if(opened)
to_chat(user, "<span class='warning'>You must close the cover to swipe an ID card!</span>")
else if(panel_open)
to_chat(user, "<span class='warning'>You must close the panel first!</span>")
else if(stat & (BROKEN|MAINT))
to_chat(user, "<span class='warning'>Nothing happens!</span>")
else
flick("apc-spark", src)
playsound(src, "sparks", 75, 1)
obj_flags |= EMAGGED
locked = FALSE
to_chat(user, "<span class='notice'>You emag the APC interface.</span>")
update_icon()
. = ..()
if(obj_flags & EMAGGED || malfhack)
return
if(opened)
to_chat(user, "<span class='warning'>You must close the cover to swipe an ID card!</span>")
else if(panel_open)
to_chat(user, "<span class='warning'>You must close the panel first!</span>")
else if(stat & (BROKEN|MAINT))
to_chat(user, "<span class='warning'>Nothing happens!</span>")
else
flick("apc-spark", src)
playsound(src, "sparks", 75, 1)
obj_flags |= EMAGGED
locked = FALSE
to_chat(user, "<span class='notice'>You emag the APC interface.</span>")
update_icon()
return TRUE
// attack with hand - remove cell (if cover open) or interact with the APC
+2
View File
@@ -194,10 +194,12 @@
return ..()
/obj/machinery/power/port_gen/pacman/emag_act(mob/user)
. = ..()
if(obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
emp_act(EMP_HEAVY)
return TRUE
/obj/machinery/power/port_gen/pacman/attack_ai(mob/user)
interact(user)
+3 -2
View File
@@ -339,12 +339,13 @@
projectile_sound = initial(projectile_sound)
/obj/machinery/power/emitter/emag_act(mob/user)
. = ..()
if(obj_flags & EMAGGED)
return
locked = FALSE
obj_flags |= EMAGGED
if(user)
user.visible_message("[user.name] emags [src].","<span class='notice'>You short out the lock.</span>")
user?.visible_message("[user.name] emags [src].","<span class='notice'>You short out the lock.</span>")
return TRUE
/obj/machinery/power/emitter/prototype
+31 -8
View File
@@ -5,12 +5,21 @@
#define PLASMA_HEAT_PENALTY 15 // Higher == Bigger heat and waste penalty from having the crystal surrounded by this gas. Negative numbers reduce penalty.
#define OXYGEN_HEAT_PENALTY 1
#define CO2_HEAT_PENALTY 0.1
#define NITROGEN_HEAT_MODIFIER -1.5
#define PLUOXIUM_HEAT_PENALTY -1
#define TRITIUM_HEAT_PENALTY 10
#define NITROGEN_HEAT_PENALTY -1.5
#define BZ_HEAT_PENALTY 5
#define OXYGEN_TRANSMIT_MODIFIER 1.5 //Higher == Bigger bonus to power generation.
#define PLASMA_TRANSMIT_MODIFIER 4
#define BZ_TRANSMIT_MODIFIER -2
#define TRITIUM_RADIOACTIVITY_MODIFIER 3 //Higher == Crystal spews out more radiation
#define BZ_RADIOACTIVITY_MODIFIER 5
#define PLUOXIUM_RADIOACTIVITY_MODIFIER -2
#define N2O_HEAT_RESISTANCE 6 //Higher == Gas makes the crystal more resistant against heat damage.
#define PLUOXIUM_HEAT_RESISTANCE 3
#define POWERLOSS_INHIBITION_GAS_THRESHOLD 0.20 //Higher == Higher percentage of inhibitor gas needed before the charge inertia chain reaction effect starts.
#define POWERLOSS_INHIBITION_MOLE_THRESHOLD 20 //Higher == More moles of the gas are needed before the charge inertia chain reaction effect starts. //Scales powerloss inhibition down until this amount of moles is reached
@@ -53,6 +62,7 @@
#define SUPERMATTER_EMERGENCY_PERCENT 25
#define SUPERMATTER_DANGER_PERCENT 50
#define SUPERMATTER_WARNING_PERCENT 100
#define CRITICAL_TEMPERATURE 10000
#define SUPERMATTER_COUNTDOWN_TIME 30 SECONDS
@@ -102,6 +112,11 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
var/o2comp = 0
var/co2comp = 0
var/n2ocomp = 0
var/pluoxiumcomp = 0
var/tritiumcomp = 0
var/bzcomp = 0
var/pluoxiumbonus = 0
var/combined_gas = 0
var/gasmix_power_ratio = 0
@@ -184,8 +199,6 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
to_chat(H, "<span class='danger'>You get headaches just from looking at it.</span>")
return
#define CRITICAL_TEMPERATURE 10000
/obj/machinery/power/supermatter_crystal/proc/get_status()
var/turf/T = get_turf(src)
if(!T)
@@ -354,16 +367,24 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
plasmacomp = max(removed.gases[/datum/gas/plasma]/combined_gas, 0)
o2comp = max(removed.gases[/datum/gas/oxygen]/combined_gas, 0)
co2comp = max(removed.gases[/datum/gas/carbon_dioxide]/combined_gas, 0)
pluoxiumcomp = max(removed.gases[/datum/gas/pluoxium]/combined_gas, 0)
tritiumcomp = max(removed.gases[/datum/gas/tritium]/combined_gas, 0)
bzcomp = max(removed.gases[/datum/gas/bz]/combined_gas, 0)
n2ocomp = max(removed.gases[/datum/gas/nitrous_oxide]/combined_gas, 0)
n2comp = max(removed.gases[/datum/gas/nitrogen]/combined_gas, 0)
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp - n2comp, 0), 1)
if(pluoxiumcomp >= 0.15)
pluoxiumbonus = 1 //makes pluoxium only work at 15%+
else
pluoxiumbonus = 0
dynamic_heat_modifier = max((plasmacomp * PLASMA_HEAT_PENALTY)+(o2comp * OXYGEN_HEAT_PENALTY)+(co2comp * CO2_HEAT_PENALTY)+(n2comp * NITROGEN_HEAT_MODIFIER), 0.5)
dynamic_heat_resistance = max(n2ocomp * N2O_HEAT_RESISTANCE, 1)
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp + tritiumcomp + bzcomp - pluoxiumcomp - n2comp, 0), 1)
power_transmission_bonus = max((plasmacomp * PLASMA_TRANSMIT_MODIFIER) + (o2comp * OXYGEN_TRANSMIT_MODIFIER), 0)
dynamic_heat_modifier = max((plasmacomp * PLASMA_HEAT_PENALTY) + (o2comp * OXYGEN_HEAT_PENALTY) + (co2comp * CO2_HEAT_PENALTY) + (tritiumcomp * TRITIUM_HEAT_PENALTY) + ((pluoxiumcomp * PLUOXIUM_HEAT_PENALTY) * pluoxiumbonus) + (n2comp * NITROGEN_HEAT_PENALTY) + (bzcomp * BZ_HEAT_PENALTY), 0.5)
dynamic_heat_resistance = max((n2ocomp * N2O_HEAT_RESISTANCE) + ((pluoxiumcomp * PLUOXIUM_HEAT_RESISTANCE) * pluoxiumbonus), 1)
power_transmission_bonus = max((plasmacomp * PLASMA_TRANSMIT_MODIFIER) + (o2comp * OXYGEN_TRANSMIT_MODIFIER) + (bzcomp * BZ_TRANSMIT_MODIFIER), 0)
//more moles of gases are harder to heat than fewer, so let's scale heat damage around them
mole_heat_penalty = max(combined_gas / MOLE_HEAT_PENALTY, 0.25)
@@ -392,7 +413,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
power = max( (removed.temperature * temp_factor / T0C) * gasmix_power_ratio + power, 0) //Total laser power plus an overload
if(prob(50))
radiation_pulse(src, power * (1 + power_transmission_bonus/10))
radiation_pulse(src, power * (1 + (tritiumcomp * TRITIUM_RADIOACTIVITY_MODIFIER) + ((pluoxiumcomp * PLUOXIUM_RADIOACTIVITY_MODIFIER) * pluoxiumbonus) * (power_transmission_bonus/(10-(bzcomp * BZ_RADIOACTIVITY_MODIFIER))))) // Rad Modifiers BZ(500%), Tritium(300%), and Pluoxium(-200%)
if(bzcomp >= 0.4 && prob(30 * bzcomp))
src.fire_nuclear_particles() // Start to emit radballs at a maximum of 30% chance per tick
var/device_energy = power * REACTION_POWER_MODIFIER