[alias]"
+ temp_html += "
[mut_desc]
"
+ if(active && !storage_slot)
+ if(HM?.can_chromosome && (HM in viable_occupant.dna.mutations))
+ var/i = viable_occupant.dna.mutations.Find(HM)
+ var/chromosome_name = "
----"
+ if(HM.chromosome_name)
+ chromosome_name = HM.chromosome_name
+ temp_html += "
Chromosome status: [chromosome_name]
"
+ temp_html += "
Sequence:
"
+ if(!scrambled)
+ for(var/block in 1 to A.blocks)
+ var/whole_sequence = get_valid_gene_string(mutation)
+ var/sequence = copytext(whole_sequence, 1+(block-1)*(DNA_SEQUENCE_LENGTH*2),(DNA_SEQUENCE_LENGTH*2*block+1))
+ temp_html += "
"
+ for(var/i in 1 to DNA_SEQUENCE_LENGTH)
+ var/num = 1+(i-1)*2
+ var/genenum = num+(DNA_SEQUENCE_LENGTH*2*(block-1))
+ temp_html += " | "
+ temp_html += "
"
+ for(var/i in 1 to DNA_SEQUENCE_LENGTH)
+ temp_html += "| | "
+ temp_html += "
"
+ for(var/i in 1 to DNA_SEQUENCE_LENGTH)
+ var/num = i*2
+ var/genenum = num+(DNA_SEQUENCE_LENGTH*2*(block-1))
+ temp_html += " | "
+ temp_html += "
"
+ temp_html += "
"
+ else
+ temp_html = "
Sequence unreadable due to unpredictable mutation.
"
+ if((active || storage_slot) && (injectorready < world.time) && !scrambled)
+ temp_html += "
Print Activator"
+ temp_html += "
Print Mutator"
+ else
+ temp_html += "
Print Activator"
+ temp_html += "
Print Mutator"
+ temp_html += "
"
+ if(storage_slot)
+ temp_html += "
Delete"
+ if((LAZYLEN(stored_mutations) < max_storage) && diskette && !diskette.read_only)
+ temp_html += "
Export"
+ else
+ temp_html += "
Export"
+ temp_html += "
Back"
+ else if(active && !scrambled)
+ temp_html += "
Store"
+ if(extra || scrambled)
+ temp_html += "
Nullify"
+ else
+ temp_html += "
Nullify"
+ temp_html += "
"
+ return temp_html
/obj/machinery/computer/scan_consolenew/Topic(href, href_list)
if(..())
@@ -340,13 +547,16 @@
radstrength = WRAP(num, 1, RADIATION_STRENGTH_MAX+1)
if("screen")
current_screen = href_list["text"]
- if("rejuv")
- if(viable_occupant && viable_occupant.reagents)
- var/potassiodide_amount = viable_occupant.reagents.get_reagent_amount("potass_iodide")
- var/can_add = max(min(REJUVENATORS_MAX - potassiodide_amount, REJUVENATORS_INJECT), 0)
- viable_occupant.reagents.add_reagent("potass_iodide", can_add)
+ if("scramble")
+ if(viable_occupant && (scrambleready < world.time))
+ viable_occupant.dna.remove_all_mutations(list(MUT_NORMAL, MUT_EXTRA))
+ viable_occupant.dna.generate_dna_blocks()
+ scrambleready = world.time + SCRAMBLE_TIMEOUT
+ to_chat(usr,"
DNA scrambled.")
+ viable_occupant.radiation += RADIATION_STRENGTH_MULTIPLIER*50/(connected.damage_coeff ** 2)
+
if("setbufferlabel")
- var/text = sanitize(input(usr, "Input a new label:", "Input an Text", null) as text|null)
+ var/text = sanitize(input(usr, "Input a new label:", "Input a Text", null) as text|null)
if(num && text)
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[num]
@@ -358,7 +568,6 @@
buffer[num] = list(
"label"="Buffer[num]:[viable_occupant.real_name]",
"UI"=viable_occupant.dna.uni_identity,
- "SE"=viable_occupant.dna.struc_enzymes,
"UE"=viable_occupant.dna.unique_enzymes,
"name"=viable_occupant.real_name,
"blood_type"=viable_occupant.dna.blood_type
@@ -372,8 +581,6 @@
if("transferbuffer")
if(num && viable_occupant)
switch(href_list["text"]) //Numbers are this high because other way upgrading laser is just not worth the hassle, and i cant think of anything better to inmrove
- if("se")
- apply_buffer(SCANNER_ACTION_SE,num)
if("ui")
apply_buffer(SCANNER_ACTION_UI,num)
if("ue")
@@ -387,28 +594,6 @@
if(istype(buffer_slot))
var/obj/item/dnainjector/timed/I
switch(href_list["text"])
- if("se")
- if(buffer_slot["SE"])
- I = new /obj/item/dnainjector/timed(loc)
- var/powers = 0
- for(var/datum/mutation/human/HM in GLOB.good_mutations + GLOB.bad_mutations + GLOB.not_good_mutations)
- if(HM.check_block_string(buffer_slot["SE"]))
- I.add_mutations.Add(HM)
- if(HM in GLOB.good_mutations)
- powers += 1
- if(HM in GLOB.bad_mutations + GLOB.not_good_mutations)
- powers -= 1 //To prevent just unlocking everything to get all powers to a syringe for max tech
- else
- I.remove_mutations.Add(HM)
- var/time_coeff
- for(var/datum/mutation/human/HM in I.add_mutations)
- if(!time_coeff)
- time_coeff = HM.time_coeff
- continue
- time_coeff = min(time_coeff,HM.time_coeff)
- if(connected)
- I.duration = I.duration * time_coeff * connected.damage_coeff
- I.damage_coeff = connected.damage_coeff
if("ui")
if(buffer_slot["UI"])
I = new /obj/item/dnainjector/timed(loc)
@@ -447,7 +632,7 @@
if("setdelayed")
if(num)
delayed_action = list("action"=text2num(href_list["delayaction"]),"buffer"=num)
- if("pulseui","pulsese")
+ if("pulseui")
if(num && viable_occupant && connected)
radduration = WRAP(radduration, 1, RADIATION_DURATION_MAX+1)
radstrength = WRAP(radstrength, 1, RADIATION_STRENGTH_MAX+1)
@@ -459,7 +644,7 @@
ui_interact(usr)
sleep(radduration*10)
- current_screen = "mainmenu"
+ current_screen = "ui"
if(viable_occupant && connected && connected.occupant==viable_occupant)
viable_occupant.radiation += (RADIATION_IRRADIATION_MULTIPLIER*radduration*radstrength)/(connected.damage_coeff ** 2) //Read comment in "transferbuffer" section above for explanation
@@ -480,35 +665,173 @@
viable_occupant.dna.uni_identity = copytext(viable_occupant.dna.uni_identity, 1, num) + hex + copytext(viable_occupant.dna.uni_identity, num+1, 0)
viable_occupant.updateappearance(mutations_overlay_update=1)
- if("pulsese")
- var/len = length(viable_occupant.dna.struc_enzymes)
- num = WRAP(num, 1, len+1)
- num = randomize_radiation_accuracy(num, radduration + (connected.precision_coeff ** 2), len)
-
- var/block = round((num-1)/DNA_BLOCK_SIZE)+1
- var/subblock = num - block*DNA_BLOCK_SIZE
- last_change = "SE #[block]-[subblock]; "
-
- var/hex = copytext(viable_occupant.dna.struc_enzymes, num, num+1)
- last_change += "[hex]"
- hex = scramble(hex, radstrength, radduration)
- last_change += "->[hex]"
-
- viable_occupant.dna.struc_enzymes = copytext(viable_occupant.dna.struc_enzymes, 1, num) + hex + copytext(viable_occupant.dna.struc_enzymes, num+1, 0)
- viable_occupant.domutcheck()
else
current_screen = "mainmenu"
if(connected)
connected.locked = locked_state
+ if("inspect")
+ if(viable_occupant)
+ var/list/mutations = get_mutation_list(TRUE)
+ if(current_mutation == mutations[num])
+ current_mutation = null
+ else
+ current_mutation = mutations[num]
+
+ if("inspectstorage")
+ current_storage = num
+ current_screen = "info"
+ if("savemut")
+ if(viable_occupant)
+ var/succes
+ if(LAZYLEN(stored_mutations) < max_storage)
+ var/mutation = text2path(href_list["path"])
+ if(ispath(mutation, /datum/mutation/human)) //sanity checks
+ var/datum/mutation/human/HM = viable_occupant.dna.get_mutation(mutation)
+ if(HM)
+ var/datum/mutation/human/A = new HM.type()
+ A.copy_mutation(HM)
+ succes = TRUE
+ stored_mutations += A
+ to_chat(usr,"
Mutation succesfully stored.")
+ if(!succes) //we can exactly return here
+ to_chat(usr,"
Mutation storage is full.")
+ if("deletemut")
+ var/datum/mutation/human/HM = stored_mutations[num]
+ if(HM)
+ stored_mutations.Remove(HM)
+ qdel(HM)
+ current_screen = "mutations"
+ if("activator")
+ if(injectorready < world.time)
+ var/mutation = text2path(href_list["path"])
+ if(ispath(mutation, /datum/mutation/human))
+ var/datum/mutation/human/HM = get_valid_mutation(mutation)
+ if(HM)
+ var/obj/item/dnainjector/activator/I = new /obj/item/dnainjector/activator(loc)
+ I.add_mutations += new HM.type (copymut = HM)
+ I.name = "[HM.name] activator"
+ I.research = TRUE
+ if(connected)
+ I.damage_coeff = connected.damage_coeff*4
+ injectorready = world.time + INJECTOR_TIMEOUT * (1 - 0.1 * connected.precision_coeff) //precision_coeff being the matter bin rating
+ else
+ injectorready = world.time + INJECTOR_TIMEOUT
+ if("mutator")
+ if(injectorready < world.time)
+ var/mutation = text2path(href_list["path"])
+ if(ispath(mutation, /datum/mutation/human))
+ var/datum/mutation/human/HM = get_valid_mutation(mutation)
+ if(HM)
+ var/obj/item/dnainjector/activator/I = new /obj/item/dnainjector/activator(loc)
+ I.add_mutations += new HM.type (copymut = HM)
+ I.doitanyway = TRUE
+ I.name = "[HM.name] injector"
+ if(connected)
+ I.damage_coeff = connected.damage_coeff
+ injectorready = world.time + INJECTOR_TIMEOUT * 5 * (1 - 0.1 * connected.precision_coeff)
+ else
+ injectorready = world.time + INJECTOR_TIMEOUT * 5
+ if("nullify")
+ if(viable_occupant)
+ var/datum/mutation/human/A = viable_occupant.dna.get_mutation(current_mutation)
+ if(A && (!viable_occupant.dna.mutation_in_sequence(current_mutation) || A.scrambled))
+ viable_occupant.dna.remove_mutation(current_mutation)
+ current_screen = "mainmenu"
+ current_mutation = null
+ if("pulsegene")
+ if(current_screen != "info")
+ var/path = text2path(href_list["path"])
+ if(viable_occupant && num && (path in viable_occupant.dna.mutation_index))
+ var/list/genes = list("A","T","G","C","X")
+ if(jokerready < world.time)
+ genes += "JOKER"
+ var/sequence = GET_GENE_STRING(path, viable_occupant.dna)
+ var/original = sequence[num]
+ var/new_gene = input("From [original] to-", "New block", original) as null|anything in genes
+ if(!new_gene)
+ new_gene = original
+ if(viable_occupant == get_viable_occupant()) //No cheesing
+ if((new_gene == "JOKER") && (jokerready < world.time))
+ var/true_genes = GET_SEQUENCE(current_mutation)
+ new_gene = true_genes[num]
+ jokerready = world.time + JOKER_TIMEOUT - (JOKER_UPGRADE * (connected.precision_coeff-1))
+ sequence = copytext(sequence, 1, num) + new_gene + copytext(sequence, num+1, length(sequence)+1)
+ viable_occupant.dna.mutation_index[path] = sequence
+ viable_occupant.radiation += RADIATION_STRENGTH_MULTIPLIER/connected.damage_coeff
+ viable_occupant.domutcheck()
+ if("exportdiskmut")
+ if(diskette && !diskette.read_only)
+ var/path = text2path(href_list["path"])
+ if(ispath(path, /datum/mutation/human))
+ var/datum/mutation/human/A = get_valid_mutation(path)
+ if(A && diskette && (LAZYLEN(diskette.mutations) < diskette.max_mutations))
+ var/datum/mutation/human/HM = new A.type()
+ diskette.mutations += HM
+ HM.copy_mutation(A)
+ to_chat(usr, "
Succesfully written [A.name] to [diskette.name].")
+ if("deletediskmut")
+ if(diskette && !diskette.read_only)
+ if(num && (LAZYLEN(diskette.mutations) >= num))
+ var/datum/mutation/human/A = diskette.mutations[num]
+ diskette.mutations.Remove(A)
+ qdel(A)
+ if("importdiskmut")
+ if(diskette && (LAZYLEN(diskette.mutations) >= num))
+ if(LAZYLEN(stored_mutations) < max_storage)
+ var/datum/mutation/human/A = diskette.mutations[num]
+ var/datum/mutation/human/HM = new A.type()
+ HM.copy_mutation(A)
+ stored_mutations += HM
+ to_chat(usr,"
Succesfully written [A.name] to storage.")
+ if("combine")
+ if(num && (LAZYLEN(stored_mutations) >= num))
+ if(LAZYLEN(stored_mutations) < max_storage)
+ var/datum/mutation/human/A = stored_mutations[num]
+ var/path = A.type
+ if(combine)
+ var/result_path = get_mixed_mutation(combine, path)
+ if(result_path)
+ stored_mutations += new result_path()
+ to_chat(usr, "Succes! New mutation has been added to storage")
+ discover(result_path)
+ combine = null
+ else
+ to_chat(usr, "Failed. No mutation could be created.")
+ combine = null
+ else
+ combine = path
+ to_chat(usr,"Selected [A.name] for combining")
+ else
+ to_chat(usr, "Not enough space to store potential mutation.")
+ if("ejectchromosome")
+ if(LAZYLEN(stored_chromosomes) <= num)
+ var/obj/item/chromosome/CM = stored_chromosomes[num]
+ CM.forceMove(drop_location())
+ adjust_item_drop_location(CM)
+ stored_chromosomes -= CM
+ if("applychromosome")
+ if(viable_occupant && (LAZYLEN(viable_occupant.dna.mutations) <= num))
+ var/datum/mutation/human/HM = viable_occupant.dna.mutations[num]
+ var/list/chromosomes = list()
+ for(var/obj/item/chromosome/CM in stored_chromosomes)
+ if(CM.can_apply(HM))
+ chromosomes += CM
+ if(chromosomes.len)
+ var/obj/item/chromosome/CM = input("Select a chromosome to apply", "Apply Chromosome") as null|anything in sortNames(chromosomes)
+ if(CM)
+ to_chat(usr, "You apply [CM] to [HM.name].")
+ stored_chromosomes -= CM
+ CM.apply(HM)
+
ui_interact(usr,last_change)
-/obj/machinery/computer/scan_consolenew/proc/scramble(input,rs,rd)
+/obj/machinery/computer/scan_consolenew/proc/scramble(input,rs,rd) //hexadecimal genetics. dont confuse with scramble button
var/length = length(input)
var/ran = gaussian(0, rs*RADIATION_STRENGTH_MULTIPLIER)
if(ran == 0)
- ran = pick(-1,1) //hacky, statistically should almost never happen. 0-change makes people mad though
+ ran = pick(-1,1) //hacky, statistically should almost never happen. 0-chance makes people mad though
else if(ran < 0)
ran = round(ran) //negative, so floor it
else
@@ -537,10 +860,6 @@
//Each laser level reduces damage by lvl^2, so no effect on 1 lvl, 4 times less damage on 2 and 9 times less damage on 3
//Numbers are this high because other way upgrading laser is just not worth the hassle, and i cant think of anything better to inmrove
switch(action)
- if(SCANNER_ACTION_SE)
- if(buffer_slot["SE"])
- viable_occupant.dna.struc_enzymes = buffer_slot["SE"]
- viable_occupant.domutcheck()
if(SCANNER_ACTION_UI)
if(buffer_slot["UI"])
viable_occupant.dna.uni_identity = buffer_slot["UI"]
@@ -562,15 +881,54 @@
viable_occupant.dna.blood_type = buffer_slot["blood_type"]
/obj/machinery/computer/scan_consolenew/proc/on_scanner_close()
- if(delayed_action && connected)
+ if(delayed_action && get_viable_occupant())
to_chat(connected.occupant, "[src] activates!")
apply_buffer(delayed_action["action"],delayed_action["buffer"])
delayed_action = null //or make it stick + reset button ?
+/obj/machinery/computer/scan_consolenew/proc/get_valid_mutation(mutation)
+ var/mob/living/carbon/C = get_viable_occupant()
+ if(C)
+ var/datum/mutation/human/HM = C.dna.get_mutation(mutation)
+ if(HM)
+ return HM
+ for(var/datum/mutation/human/A in stored_mutations)
+ if(A.type == mutation)
+ return A
+
+
+/obj/machinery/computer/scan_consolenew/proc/get_mutation_list(include_storage) //Returns a list of the mutation index types and any extra mutations
+ var/mob/living/carbon/viable_occupant = get_viable_occupant()
+ var/list/paths = list()
+ if(viable_occupant)
+ for(var/A in viable_occupant.dna.mutation_index)
+ paths += A
+ for(var/datum/mutation/human/A in viable_occupant.dna.mutations)
+ if(A.class == MUT_EXTRA)
+ paths += A.type
+ if(include_storage)
+ for(var/datum/mutation/human/A in stored_mutations)
+ paths += A.type
+ return paths
+
+/obj/machinery/computer/scan_consolenew/proc/get_valid_gene_string(mutation)
+ var/mob/living/carbon/C = get_viable_occupant()
+ if(C && (mutation in C.dna.mutation_index))
+ return GET_GENE_STRING(mutation, C.dna)
+ else if(C && (LAZYLEN(C.dna.mutations)))
+ for(var/datum/mutation/human/A in C.dna.mutations)
+ if(A.type == mutation)
+ return GET_SEQUENCE(mutation)
+ for(var/datum/mutation/human/A in stored_mutations)
+ if(A.type == mutation)
+ return GET_SEQUENCE(mutation)
+
+/obj/machinery/computer/scan_consolenew/proc/discover(mutation)
+ if(stored_research && !(mutation in stored_research.discovered_mutations))
+ stored_research.discovered_mutations += mutation
+ return TRUE
/////////////////////////// DNA MACHINES
#undef INJECTOR_TIMEOUT
-#undef REJUVENATORS_INJECT
-#undef REJUVENATORS_MAX
#undef NUMBER_OF_BUFFERS
#undef RADIATION_STRENGTH_MAX
diff --git a/code/game/machinery/exp_cloner.dm b/code/game/machinery/exp_cloner.dm
index e8364d22..ffe66e68 100644
--- a/code/game/machinery/exp_cloner.dm
+++ b/code/game/machinery/exp_cloner.dm
@@ -26,9 +26,9 @@
var/list/unclean_mutations = (GLOB.not_good_mutations|GLOB.bad_mutations)
H.dna.remove_mutation_group(unclean_mutations)
if(efficiency > 5 && prob(20))
- H.randmutvg()
+ H.easy_randmut(POSITIVE)
if(efficiency < 3 && prob(50))
- var/mob/M = H.randmutb()
+ var/mob/M = H.easy_randmut(NEGATIVE+MINOR_NEGATIVE)
if(ismob(M))
H = M
@@ -292,6 +292,6 @@
temp = "Cloning cycle already in progress."
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
else
- pod.growclone(null, mob_occupant.real_name, dna.uni_identity, dna.struc_enzymes, clone_species, dna.features, mob_occupant.faction)
+ pod.growclone(null, mob_occupant.real_name, dna.uni_identity, dna.mutation_index, clone_species, dna.features, mob_occupant.faction)
temp = "[mob_occupant.real_name] => Cloning data sent to pod."
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
diff --git a/code/game/machinery/stasis.dm b/code/game/machinery/stasis.dm
index f24b2f4f..720e3e61 100644
--- a/code/game/machinery/stasis.dm
+++ b/code/game/machinery/stasis.dm
@@ -134,4 +134,9 @@
/obj/machinery/stasis/crowbar_act(mob/living/user, obj/item/I)
return default_deconstruction_crowbar(I)
+/obj/machinery/stasis/attack_robot(mob/user)
+ if(Adjacent(user) && occupant)
+ unbuckle_mob(occupant)
+ else
+ ..()
#undef STASIS_TOGGLE_COOLDOWN
\ No newline at end of file
diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm
index b5a579f3..ef9a1374 100644
--- a/code/game/mecha/equipment/mecha_equipment.dm
+++ b/code/game/mecha/equipment/mecha_equipment.dm
@@ -11,7 +11,8 @@
var/equip_ready = 1 //whether the equipment is ready for use. (or deactivated/activated for static stuff)
var/energy_drain = 0
var/obj/mecha/chassis = null
- var/range = MELEE //bitFflags
+ ///Bitflag. Determines the range of the equipment.
+ var/range = MECHA_MELEE
var/salvageable = 1
var/selectable = 1 // Set to 0 for passive equipment such as mining scanner or armor plates
var/harmful = FALSE //Controls if equipment can be used to attack by a pacifist.
@@ -59,10 +60,10 @@
return txt
/obj/item/mecha_parts/mecha_equipment/proc/is_ranged()//add a distance restricted equipment. Why not?
- return range&RANGED
+ return range&MECHA_RANGED
/obj/item/mecha_parts/mecha_equipment/proc/is_melee()
- return range&MELEE
+ return range&MECHA_MELEE
/obj/item/mecha_parts/mecha_equipment/proc/action_checks(atom/target)
diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm
index 29a5100b..a2f8bb57 100644
--- a/code/game/mecha/equipment/tools/medical_tools.dm
+++ b/code/game/mecha/equipment/tools/medical_tools.dm
@@ -34,7 +34,7 @@
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper"
energy_drain = 20
- range = MELEE
+ range = MECHA_MELEE
equip_cooldown = 20
var/mob/living/carbon/patient = null
var/inject_amount = 10
@@ -252,7 +252,7 @@
var/synth_speed = 5 //[num] reagent units per cycle
energy_drain = 10
var/mode = 0 //0 - fire syringe, 1 - analyze reagents.
- range = MELEE|RANGED
+ range = MECHA_MELEE|MECHA_RANGED
equip_cooldown = 10
/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/Initialize()
@@ -527,7 +527,7 @@
desc = "Equipment for medical exosuits. Generates a focused beam of medical nanites."
icon_state = "mecha_medigun"
energy_drain = 10
- range = MELEE|RANGED
+ range = MECHA_MELEE|MECHA_RANGED
equip_cooldown = 0
var/obj/item/gun/medbeam/mech/medigun
materials = list(MAT_METAL = 15000, MAT_GLASS = 8000, MAT_PLASMA = 3000, MAT_GOLD = 8000, MAT_DIAMOND = 2000)
diff --git a/code/game/mecha/equipment/tools/other_tools.dm b/code/game/mecha/equipment/tools/other_tools.dm
index a8ba9850..f152b651 100644
--- a/code/game/mecha/equipment/tools/other_tools.dm
+++ b/code/game/mecha/equipment/tools/other_tools.dm
@@ -10,7 +10,7 @@
icon_state = "mecha_teleport"
equip_cooldown = 150
energy_drain = 1000
- range = RANGED
+ range = MECHA_RANGED
/obj/item/mecha_parts/mecha_equipment/teleporter/action(atom/target)
if(!action_checks(target) || is_centcom_level(loc.z))
@@ -30,7 +30,7 @@
icon_state = "mecha_wholegen"
equip_cooldown = 50
energy_drain = 300
- range = RANGED
+ range = MECHA_RANGED
/obj/item/mecha_parts/mecha_equipment/wormhole_generator/action(atom/target)
@@ -73,7 +73,7 @@
icon_state = "mecha_teleport"
equip_cooldown = 10
energy_drain = 100
- range = MELEE|RANGED
+ range = MECHA_MELEE|MECHA_RANGED
var/atom/movable/locked
var/mode = 1 //1 - gravsling 2 - gravpush
@@ -284,12 +284,12 @@
if(equip_ready) //disabled
return
var/area/A = get_area(chassis)
- var/pow_chan = get_power_channel(A)
+ var/pow_chan = GET_MUTATION_POWER_channel(A)
if(pow_chan)
return 1000 //making magic
-/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/proc/get_power_channel(var/area/A)
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/proc/GET_MUTATION_POWER_channel(var/area/A)
var/pow_chan
if(A)
for(var/c in use_channels)
@@ -350,7 +350,7 @@
name = "exosuit plasma converter"
desc = "An exosuit module that generates power using solid plasma as fuel. Pollutes the environment."
icon_state = "tesla"
- range = MELEE
+ range = MECHA_MELEE
var/coeff = 100
var/obj/item/stack/sheet/fuel
var/max_fuel = 150000
diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm
index ea946518..9ffd40b1 100644
--- a/code/game/mecha/equipment/tools/work_tools.dm
+++ b/code/game/mecha/equipment/tools/work_tools.dm
@@ -164,7 +164,7 @@
icon_state = "mecha_exting"
equip_cooldown = 5
energy_drain = 0
- range = MELEE|RANGED
+ range = MECHA_MELEE|MECHA_RANGED
/obj/item/mecha_parts/mecha_equipment/extinguisher/Initialize()
. = ..()
@@ -231,7 +231,7 @@
icon_state = "mecha_rcd"
equip_cooldown = 10
energy_drain = 250
- range = MELEE|RANGED
+ range = MECHA_MELEE|MECHA_RANGED
item_flags = NO_MAT_REDEMPTION
var/mode = 0 //0 - deconstruct, 1 - wall or floor, 2 - airlock.
diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm
index c0c3795e..bce75278 100644
--- a/code/game/mecha/equipment/weapons/weapons.dm
+++ b/code/game/mecha/equipment/weapons/weapons.dm
@@ -1,6 +1,6 @@
/obj/item/mecha_parts/mecha_equipment/weapon
name = "mecha weapon"
- range = RANGED
+ range = MECHA_RANGED
var/projectile
var/fire_sound
var/projectiles_per_shot = 1
@@ -154,7 +154,7 @@
icon_state = "mecha_honker"
energy_drain = 200
equip_cooldown = 150
- range = MELEE|RANGED
+ range = MECHA_MELEE|MECHA_RANGED
kickback = FALSE
/obj/item/mecha_parts/mecha_equipment/weapon/honker/can_attach(obj/mecha/combat/honker/M)
@@ -405,7 +405,7 @@
icon_state = "mecha_punching_glove"
energy_drain = 250
equip_cooldown = 20
- range = MELEE|RANGED
+ range = MECHA_MELEE|MECHA_RANGED
missile_range = 5
projectile = /obj/item/punching_glove
fire_sound = 'sound/items/bikehorn.ogg'
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index caac0739..2d182516 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -1,17 +1,3 @@
-#define MECHA_INT_FIRE (1<<0)
-#define MECHA_INT_TEMP_CONTROL (1<<1)
-#define MECHA_INT_SHORT_CIRCUIT (1<<2)
-#define MECHA_INT_TANK_BREACH (1<<3)
-#define MECHA_INT_CONTROL_LOST (1<<4)
-
-#define MELEE 1
-#define RANGED 2
-
-#define FRONT_ARMOUR 1
-#define SIDE_ARMOUR 2
-#define BACK_ARMOUR 3
-
-
/obj/mecha
name = "mecha"
desc = "Exosuit"
@@ -35,9 +21,9 @@
max_integrity = 300 //max_integrity is base health
var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
armor = list("melee" = 20, "bullet" = 10, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100)
- var/list/facing_modifiers = list(FRONT_ARMOUR = 1.5, SIDE_ARMOUR = 1, BACK_ARMOUR = 0.5)
+ var/list/facing_modifiers = list(MECHA_FRONT_ARMOUR = 1.5, MECHA_SIDE_ARMOUR = 1, MECHA_BACK_ARMOUR = 0.5)
var/obj/item/stock_parts/cell/cell
- var/state = 0
+ var/construction_state = MECHA_LOCKED
var/list/log = new
var/last_message = 0
var/add_req_access = 1
@@ -436,7 +422,7 @@
return
if(user.incapacitated())
return
- if(state)
+ if(construction_state)
occupant_message("Maintenance protocols in effect.")
return
if(!get_charge())
@@ -519,7 +505,7 @@
occupant_message("Unable to move while connected to the air system port!")
last_message = world.time
return 0
- if(state)
+ if(construction_state)
occupant_message("Maintenance protocols in effect.")
return
return domove(direction)
@@ -689,7 +675,7 @@
//Transfer from core or card to mech. Proc is called by mech.
switch(interaction)
if(AI_TRANS_TO_CARD) //Upload AI from mech to AI card.
- if(!state) //Mech must be in maint mode to allow carding.
+ if(construction_state) //Mech must be in maint mode to allow carding.
to_chat(user, "[name] must have maintenance protocols active in order to allow a transfer.")
return
AI = occupant
diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm
index 071fe184..ee7be296 100644
--- a/code/game/mecha/mecha_construction_paths.dm
+++ b/code/game/mecha/mecha_construction_paths.dm
@@ -116,7 +116,7 @@
//9
list(
- "key" = /obj/item/stock_parts/cell,
+ "key" = /obj/item/stock_parts/scanning_module,
"action" = ITEM_MOVE_INSIDE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "Peripherals control module is secured."
@@ -126,10 +126,40 @@
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_CROWBAR,
- "desc" = "The power cell is installed."
+ "desc" = "Scanner module is installed."
),
//11
+ list(
+ "key" = /obj/item/stock_parts/capacitor,
+ "action" = ITEM_MOVE_INSIDE,
+ "back_key" = TOOL_SCREWDRIVER,
+ "desc" = "Scanner module is secured."
+ ),
+
+ //12
+ list(
+ "key" = TOOL_SCREWDRIVER,
+ "back_key" = TOOL_CROWBAR,
+ "desc" = "Capacitor is installed."
+ ),
+
+ //13
+ list(
+ "key" = /obj/item/stock_parts/cell,
+ "action" = ITEM_MOVE_INSIDE,
+ "back_key" = TOOL_SCREWDRIVER,
+ "desc" = "Capacitor is secured."
+ ),
+
+ //14
+ list(
+ "key" = TOOL_SCREWDRIVER,
+ "back_key" = TOOL_CROWBAR,
+ "desc" = "The power cell is installed."
+ ),
+
+ //15
list(
"key" = /obj/item/stack/sheet/metal,
"amount" = 5,
@@ -137,21 +167,21 @@
"desc" = "The power cell is secured."
),
- //12
+ //16
list(
"key" = TOOL_WRENCH,
"back_key" = TOOL_CROWBAR,
"desc" = "Internal armor is installed."
),
- //13
+ //17
list(
"key" = TOOL_WELDER,
"back_key" = TOOL_WRENCH,
"desc" = "Internal armor is wrenched."
),
- //14
+ //18
list(
"key" = /obj/item/stack/sheet/plasteel,
"amount" = 5,
@@ -159,14 +189,14 @@
"desc" = "Internal armor is welded."
),
- //15
+ //19
list(
"key" = TOOL_WRENCH,
"back_key" = TOOL_CROWBAR,
"desc" = "External armor is installed."
),
- //16
+ //20
list(
"key" = TOOL_WELDER,
"back_key" = TOOL_WRENCH,
@@ -222,36 +252,56 @@
else
user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
if(10)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the scanner module.", "You secure the scanner module.")
+ else
+ user.visible_message("[user] removes the scanner module from [parent].", "You remove the scanner module from [parent].")
+ if(11)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs [I] to [parent].", "You install [I] to [parent].")
+ else
+ user.visible_message("[user] unfastens the scanner module.", "You unfasten the scanner module.")
+ if(12)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures [I].", "You secure [I].")
+ else
+ user.visible_message("[user] removes the capacitor from [parent].", "You remove the capacitor from [parent].")
+ if(13)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs [I].", "You install [I].")
+ else
+ user.visible_message("[user] unsecures the capacitor from [parent].", "You unsecure the capacitor from [parent].")
+ if(14)
if(diff==FORWARD)
user.visible_message("[user] secures the power cell.", "You secure the power cell.")
else
user.visible_message("[user] pries the power cell from [parent].", "You pry the power cell from [parent].")
- if(11)
+ if(15)
if(diff==FORWARD)
user.visible_message("[user] installs the internal armor layer to [parent].", "You install the internal armor layer to [parent].")
else
user.visible_message("[user] unfastens the power cell.", "You unfasten the power cell.")
- if(12)
+ if(16)
if(diff==FORWARD)
user.visible_message("[user] secures the internal armor layer.", "You secure the internal armor layer.")
else
user.visible_message("[user] pries internal armor layer from [parent].", "You pry internal armor layer from [parent].")
- if(13)
+ if(17)
if(diff==FORWARD)
user.visible_message("[user] welds the internal armor layer to [parent].", "You weld the internal armor layer to [parent].")
else
user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
- if(14)
+ if(18)
if(diff==FORWARD)
user.visible_message("[user] installs the external reinforced armor layer to [parent].", "You install the external reinforced armor layer to [parent].")
else
user.visible_message("[user] cuts the internal armor layer from [parent].", "You cut the internal armor layer from [parent].")
- if(15)
+ if(19)
if(diff==FORWARD)
user.visible_message("[user] secures the external armor layer.", "You secure the external reinforced armor layer.")
else
user.visible_message("[user] pries external armor layer from [parent].", "You pry external armor layer from [parent].")
- if(16)
+ if(20)
if(diff==FORWARD)
user.visible_message("[user] welds the external armor layer to [parent].", "You weld the external armor layer to [parent].")
else
@@ -629,7 +679,7 @@
//9
list(
- "key" = /obj/item/stock_parts/cell,
+ "key" = /obj/item/stock_parts/scanning_module,
"action" = ITEM_MOVE_INSIDE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "Peripherals control module is secured."
@@ -639,10 +689,40 @@
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_CROWBAR,
- "desc" = "The power cell is installed."
+ "desc" = "Scanner module is installed."
),
//11
+ list(
+ "key" = /obj/item/stock_parts/capacitor,
+ "action" = ITEM_MOVE_INSIDE,
+ "back_key" = TOOL_SCREWDRIVER,
+ "desc" = "Scanner module is secured."
+ ),
+
+ //12
+ list(
+ "key" = TOOL_SCREWDRIVER,
+ "back_key" = TOOL_CROWBAR,
+ "desc" = "Capacitor is installed."
+ ),
+
+ //13
+ list(
+ "key" = /obj/item/stock_parts/cell,
+ "action" = ITEM_MOVE_INSIDE,
+ "back_key" = TOOL_SCREWDRIVER,
+ "desc" = "Capacitor is secured."
+ ),
+
+ //14
+ list(
+ "key" = TOOL_SCREWDRIVER,
+ "back_key" = TOOL_CROWBAR,
+ "desc" = "The power cell is installed."
+ ),
+
+ //15
list(
"key" = /obj/item/stack/sheet/plasteel,
"amount" = 5,
@@ -650,21 +730,21 @@
"desc" = "The power cell is secured."
),
- //12
+ //16
list(
"key" = TOOL_WRENCH,
"back_key" = TOOL_CROWBAR,
"desc" = "Internal armor is installed."
),
- //13
+ //17
list(
"key" = TOOL_WELDER,
"back_key" = TOOL_WRENCH,
"desc" = "Internal armor is wrenched."
),
- //14
+ //18
list(
"key" = /obj/item/stack/sheet/plasteel,
"amount" = 5,
@@ -672,7 +752,7 @@
"desc" = "Internal armor is welded."
),
- //15
+ //19
list(
"key" = /obj/item/stack/sheet/plasteel,
"amount" = 5,
@@ -680,14 +760,14 @@
"desc" = "External armor is being installed."
),
- //16
+ //20
list(
"key" = TOOL_WRENCH,
"back_key" = TOOL_CROWBAR,
"desc" = "External armor is installed."
),
- //17
+ //21
list(
"key" = TOOL_WELDER,
"back_key" = TOOL_WRENCH,
@@ -744,41 +824,61 @@
else
user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
if(10)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the scanner module.", "You secure the scanner module.")
+ else
+ user.visible_message("[user] removes the scanner module from [parent].", "You remove the scanner module from [parent].")
+ if(12)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs [I] to [parent].", "You install [I] to [parent].")
+ else
+ user.visible_message("[user] unfastens the scanner module.", "You unfasten the scanner module.")
+ if(13)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the capacitor.", "You secure the capacitor.")
+ else
+ user.visible_message("[user] removes the capacitor from [parent].", "You remove the capacitor from [parent].")
+ if(14)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs [I] into [parent].", "You install [I] into [parent].")
+ else
+ user.visible_message("[user] unfastens the capacitor.", "You unfasten the capacitor.")
+ if(15)
if(diff==FORWARD)
user.visible_message("[user] secures the power cell.", "You secure the power cell.")
else
user.visible_message("[user] pries the power cell from [parent].", "You pry the power cell from [parent].")
- if(11)
+ if(16)
if(diff==FORWARD)
user.visible_message("[user] installs the internal armor layer to [parent].", "You install the internal armor layer to [parent].")
else
user.visible_message("[user] unfastens the power cell.", "You unfasten the power cell.")
- if(12)
+ if(17)
if(diff==FORWARD)
user.visible_message("[user] secures the internal armor layer.", "You secure the internal armor layer.")
else
user.visible_message("[user] pries internal armor layer from [parent].", "You pry internal armor layer from [parent].")
- if(13)
+ if(18)
if(diff==FORWARD)
user.visible_message("[user] welds the internal armor layer to [parent].", "You weld the internal armor layer to [parent].")
else
user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
- if(14)
+ if(19)
if(diff==FORWARD)
user.visible_message("[user] starts to install the external armor layer to [parent].", "You install the external armor layer to [parent].")
else
user.visible_message("[user] cuts the internal armor layer from [parent].", "You cut the internal armor layer from [parent].")
- if(15)
+ if(20)
if(diff==FORWARD)
user.visible_message("[user] installs the external reinforced armor layer to [parent].", "You install the external reinforced armor layer to [parent].")
else
user.visible_message("[user] removes the external armor from [parent].", "You remove the external armor from [parent].")
- if(16)
+ if(21)
if(diff==FORWARD)
user.visible_message("[user] secures the external armor layer.", "You secure the external reinforced armor layer.")
else
user.visible_message("[user] pries external armor layer from [parent].", "You pry external armor layer from [parent].")
- if(17)
+ if(22)
if(diff==FORWARD)
user.visible_message("[user] welds the external armor layer to [parent].", "You weld the external armor layer to [parent].")
else
@@ -825,47 +925,63 @@
list(
"key" = /obj/item/bikehorn
),
-
//6
list(
"key" = /obj/item/circuitboard/mecha/honker/targeting,
"action" = ITEM_DELETE
),
-
//7
list(
"key" = /obj/item/bikehorn
),
-
//8
list(
- "key" = /obj/item/stock_parts/cell,
+ "key" = /obj/item/stock_parts/scanning_module,
"action" = ITEM_MOVE_INSIDE
),
-
//9
list(
"key" = /obj/item/bikehorn
),
-
//10
list(
- "key" = /obj/item/clothing/mask/gas/clown_hat,
- "action" = ITEM_DELETE
+ "key" = /obj/item/stock_parts/capacitor,
+ "action" = ITEM_MOVE_INSIDE
),
-
//11
list(
"key" = /obj/item/bikehorn
),
//12
+ list(
+ "key" = /obj/item/stock_parts/cell,
+ "action" = ITEM_MOVE_INSIDE
+ ),
+
+ //13
+ list(
+ "key" = /obj/item/bikehorn
+ ),
+
+ //14
+ list(
+ "key" = /obj/item/clothing/mask/gas/clown_hat,
+ "action" = ITEM_DELETE
+ ),
+
+ //15
+ list(
+ "key" = /obj/item/bikehorn
+ ),
+
+ //16
list(
"key" = /obj/item/clothing/shoes/clown_shoes,
"action" = ITEM_DELETE
),
- //13
+ //17
list(
"key" = /obj/item/bikehorn
),
@@ -898,8 +1014,12 @@
if(8)
user.visible_message("[user] installs [I] into [parent].", "You install [I] into [parent].")
if(10)
- user.visible_message("[user] puts [I] on [parent].", "You put [I] on [parent].")
+ user.visible_message("[user] installs [I] into [parent].", "You install [I] into [parent].")
if(12)
+ user.visible_message("[user] installs [I] into [parent].", "You install [I] into [parent].")
+ if(14)
+ user.visible_message("[user] puts [I] on [parent].", "You put [I] on [parent].")
+ if(16)
user.visible_message("[user] puts [I] on [parent].", "You put [I] on [parent].")
return TRUE
@@ -1629,7 +1749,7 @@
//9
list(
- "key" = /obj/item/stock_parts/cell,
+ "key" = /obj/item/stock_parts/scanning_module,
"action" = ITEM_MOVE_INSIDE,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "Peripherals control module is secured."
@@ -1639,32 +1759,60 @@
list(
"key" = TOOL_SCREWDRIVER,
"back_key" = TOOL_CROWBAR,
- "desc" = "The power cell is installed."
+ "desc" = "Scanner module is installed."
),
//11
+ list(
+ "key" = /obj/item/stock_parts/capacitor,
+ "action" = ITEM_MOVE_INSIDE,
+ "back_key" = TOOL_SCREWDRIVER,
+ "desc" = "Scanner module is secured."
+ ),
+
+ //12
+ list(
+ "key" = TOOL_SCREWDRIVER,
+ "back_key" = TOOL_CROWBAR,
+ "desc" = "Capacitor is installed."
+ ),
+
+ //13
+ list(
+ "key" = /obj/item/stock_parts/cell,
+ "action" = ITEM_MOVE_INSIDE,
+ "back_key" = TOOL_SCREWDRIVER,
+ "desc" = "Capacitor is secured."
+ ),
+
+ //14
list(
"key" = /obj/item/stack/sheet/metal,
"amount" = 5,
"back_key" = TOOL_SCREWDRIVER,
"desc" = "The power cell is secured."
),
-
- //12
+ //15
+ list(
+ "key" = TOOL_SCREWDRIVER,
+ "back_key" = TOOL_CROWBAR,
+ "desc" = "The power cell is installed."
+ ),
+ //16
list(
"key" = TOOL_WRENCH,
"back_key" = TOOL_CROWBAR,
"desc" = "Internal armor is installed."
),
- //13
+ //17
list(
"key" = TOOL_WELDER,
"back_key" = TOOL_WRENCH,
"desc" = "Internal armor is wrenched."
),
- //14
+ //18
list(
"key" = /obj/item/stack/sheet/plasteel,
"amount" = 5,
@@ -1672,14 +1820,14 @@
"desc" = "Internal armor is welded."
),
- //15
+ //19
list(
"key" = TOOL_WRENCH,
"back_key" = TOOL_CROWBAR,
"desc" = "External armor is installed."
),
- //16
+ //20
list(
"key" = TOOL_WELDER,
"back_key" = TOOL_WRENCH,
@@ -1736,36 +1884,56 @@
else
user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
if(10)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the scanner module.", "You secure the scanner module.")
+ else
+ user.visible_message("[user] removes the scanner module from [parent].", "You remove the scanner module from [parent].")
+ if(11)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs [I] to [parent].", "You install [I] to [parent].")
+ else
+ user.visible_message("[user] unfastens the scanner module.", "You unfasten the scanner module.")
+ if(12)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the capacitor.", "You secure the capacitor.")
+ else
+ user.visible_message("[user] removes the capacitor from [parent].", "You remove the capacitor from [parent].")
+ if(13)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs [I] into [parent].", "You install [I] into [parent].")
+ else
+ user.visible_message("[user] unfastens the capacitor.", "You unfasten the capacitor.")
+ if(14)
if(diff==FORWARD)
user.visible_message("[user] secures the power cell.", "You secure the power cell.")
else
user.visible_message("[user] pries the power cell from [parent].", "You pry the power cell from [parent].")
- if(11)
+ if(15)
if(diff==FORWARD)
user.visible_message("[user] installs the internal armor layer to [parent].", "You install the internal armor layer to [parent].")
else
user.visible_message("[user] unfastens the power cell.", "You unfasten the power cell.")
- if(12)
+ if(16)
if(diff==FORWARD)
user.visible_message("[user] secures the internal armor layer.", "You secure the internal armor layer.")
else
user.visible_message("[user] pries internal armor layer from [parent].", "You pry internal armor layer from [parent].")
- if(13)
+ if(17)
if(diff==FORWARD)
user.visible_message("[user] welds the internal armor layer to [parent].", "You weld the internal armor layer to [parent].")
else
user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
- if(14)
+ if(18)
if(diff==FORWARD)
user.visible_message("[user] installs the external armor layer to [parent].", "You install the external reinforced armor layer to [parent].")
else
user.visible_message("[user] cuts the internal armor layer from [parent].", "You cut the internal armor layer from [parent].")
- if(15)
+ if(19)
if(diff==FORWARD)
user.visible_message("[user] secures the external armor layer.", "You secure the external reinforced armor layer.")
else
user.visible_message("[user] pries the external armor layer from [parent].", "You pry the external armor layer from [parent].")
- if(16)
+ if(20)
if(diff==FORWARD)
user.visible_message("[user] welds the external armor layer to [parent].", "You weld the external armor layer to [parent].")
else
diff --git a/code/game/mecha/mecha_defense.dm b/code/game/mecha/mecha_defense.dm
index 62a62b56..b7d59c6a 100644
--- a/code/game/mecha/mecha_defense.dm
+++ b/code/game/mecha/mecha_defense.dm
@@ -1,11 +1,11 @@
/obj/mecha/proc/get_armour_facing(relative_dir)
switch(relative_dir)
if(0) // BACKSTAB!
- return facing_modifiers[BACK_ARMOUR]
+ return facing_modifiers[MECHA_BACK_ARMOUR]
if(45, 90, 270, 315)
- return facing_modifiers[SIDE_ARMOUR]
+ return facing_modifiers[MECHA_SIDE_ARMOUR]
if(225, 180, 135)
- return facing_modifiers[FRONT_ARMOUR]
+ return facing_modifiers[MECHA_FRONT_ARMOUR]
return 1 //always return non-0
/obj/mecha/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
@@ -199,23 +199,23 @@
else
to_chat(user, "Maintenance protocols disabled by operator.")
else if(istype(W, /obj/item/wrench))
- if(state==1)
- state = 2
+ if(construction_state==1)
+ construction_state = 2
to_chat(user, "You undo the securing bolts.")
- else if(state==2)
- state = 1
+ else if(construction_state==2)
+ construction_state = 1
to_chat(user, "You tighten the securing bolts.")
return
else if(istype(W, /obj/item/crowbar))
- if(state==2)
- state = 3
+ if(construction_state==2)
+ construction_state = 3
to_chat(user, "You open the hatch to the power unit.")
- else if(state==3)
- state=2
+ else if(construction_state==3)
+ construction_state=2
to_chat(user, "You close the hatch to the power unit.")
return
else if(istype(W, /obj/item/stack/cable_coil))
- if(state == 3 && (internal_damage & MECHA_INT_SHORT_CIRCUIT))
+ if(construction_state == 3 && (internal_damage & MECHA_INT_SHORT_CIRCUIT))
var/obj/item/stack/cable_coil/CC = W
if(CC.use(2))
clearInternalDamage(MECHA_INT_SHORT_CIRCUIT)
@@ -227,19 +227,19 @@
if(internal_damage & MECHA_INT_TEMP_CONTROL)
clearInternalDamage(MECHA_INT_TEMP_CONTROL)
to_chat(user, "You repair the damaged temperature controller.")
- else if(state==3 && cell)
+ else if(construction_state==3 && cell)
cell.forceMove(loc)
cell = null
- state = 4
+ construction_state = 4
to_chat(user, "You unscrew and pry out the powercell.")
log_message("Powercell removed")
- else if(state==4 && cell)
- state=3
+ else if(construction_state==4 && cell)
+ construction_state=3
to_chat(user, "You screw the cell in place.")
return
else if(istype(W, /obj/item/stock_parts/cell))
- if(state==4)
+ if(construction_state==4)
if(!cell)
if(!user.transferItemToLoc(W, src))
return
diff --git a/code/game/mecha/mecha_topic.dm b/code/game/mecha/mecha_topic.dm
index 79ee7435..0bab48da 100644
--- a/code/game/mecha/mecha_topic.dm
+++ b/code/game/mecha/mecha_topic.dm
@@ -199,8 +199,8 @@
[add_req_access?"Edit operation keycodes":null]
- [maint_access?"[(state>0) ? "Terminate" : "Initiate"] maintenance protocol":null]
- [(state>0) ?"Set Cabin Air Pressure":null]
+ [maint_access?"[(construction_state > MECHA_LOCKED) ? "Terminate" : "Initiate"] maintenance protocol":null]
+ [(construction_state > MECHA_LOCKED) ?"Set Cabin Air Pressure":null]