prevent an artifact from being analysed and harvested at the same time

Signed-off-by: caelaislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
caelaislinn
2012-06-23 16:51:51 +10:00
parent 39b4041bec
commit 97f8bcffff
3 changed files with 32 additions and 19 deletions

View File

@@ -214,7 +214,12 @@
findarti++ findarti++
cur_artifact = A cur_artifact = A
if (findarti == 1) if (findarti == 1)
if(cur_artifact.being_used)
var/message = "<b>[src]</b> states, \"Cannot analyse. Excess energy drain is disrupting signal.\""
src.visible_message(message, message)
else
cur_artifact.anchored = 1 cur_artifact.anchored = 1
cur_artifact.being_used = 1
src.working = 1 src.working = 1
src.icon_state = "analyser_processing" src.icon_state = "analyser_processing"
var/time = rand(30,50) + max(0, 300 - scan_num * 10) var/time = rand(30,50) + max(0, 300 - scan_num * 10)
@@ -228,6 +233,7 @@
src.working = 0 src.working = 0
icon_state = "analyser" icon_state = "analyser"
cur_artifact.anchored = 0 cur_artifact.anchored = 0
cur_artifact.being_used = 0
if(cur_artifact.loc == pad_turf) if(cur_artifact.loc == pad_turf)
AA_Analyse() AA_Analyse()
scan_num++ scan_num++

View File

@@ -43,6 +43,7 @@
inserted_battery.stored_charge = inserted_battery.capacity inserted_battery.stored_charge = inserted_battery.capacity
harvesting = 0 harvesting = 0
cur_artifact.anchored = 0 cur_artifact.anchored = 0
cur_artifact.being_used = 0
src.visible_message("<b>[name]</b> states, \"Battery is full.\"") src.visible_message("<b>[name]</b> states, \"Battery is full.\"")
icon_state = "incubator" icon_state = "incubator"
return return
@@ -102,6 +103,9 @@
else if(!articount) else if(!articount)
var/message = "<b>[src]</b> states, \"Cannot harvest. No artifact found.\"" var/message = "<b>[src]</b> states, \"Cannot harvest. No artifact found.\""
src.visible_message(message, message) src.visible_message(message, message)
else if (cur_artifact.being_used)
var/message = "<b>[src]</b> states, \"Cannot harvest. Too much interferance from energy scan.\""
src.visible_message(message, message)
else else
cur_artifact = analysed cur_artifact = analysed
//check to see if the battery is compatible //check to see if the battery is compatible
@@ -109,6 +113,7 @@
if(inserted_battery.battery_effect.artifact_id == cur_artifact.my_effect.artifact_id || inserted_battery.stored_charge == 0) if(inserted_battery.battery_effect.artifact_id == cur_artifact.my_effect.artifact_id || inserted_battery.stored_charge == 0)
harvesting = 1 harvesting = 1
cur_artifact.anchored = 1 cur_artifact.anchored = 1
cur_artifact.being_used = 1
icon_state = "incubator_on" icon_state = "incubator_on"
var/message = "<b>[src]</b> states, \"Beginning artifact energy harvesting.\"" var/message = "<b>[src]</b> states, \"Beginning artifact energy harvesting.\""
src.visible_message(message, message) src.visible_message(message, message)
@@ -125,6 +130,7 @@
if(harvesting) if(harvesting)
harvesting = 0 harvesting = 0
cur_artifact.anchored = 0 cur_artifact.anchored = 0
cur_artifact.being_used = 0
src.visible_message("<b>[name]</b> states, \"Harvesting interrupted.\"") src.visible_message("<b>[name]</b> states, \"Harvesting interrupted.\"")
icon_state = "incubator" icon_state = "incubator"

View File

@@ -15,6 +15,7 @@
var/recharge = 5 // How long does it take this artifact to recharge? var/recharge = 5 // How long does it take this artifact to recharge?
var/display_id = "" // Artifact ID to display once successfully scanned var/display_id = "" // Artifact ID to display once successfully scanned
var/datum/artifact_effect/my_effect = null var/datum/artifact_effect/my_effect = null
var/being_used = 0
/obj/machinery/artifact/New() /obj/machinery/artifact/New()
..() ..()