mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
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:
@@ -214,25 +214,31 @@
|
||||
findarti++
|
||||
cur_artifact = A
|
||||
if (findarti == 1)
|
||||
cur_artifact.anchored = 1
|
||||
src.working = 1
|
||||
src.icon_state = "analyser_processing"
|
||||
var/time = rand(30,50) + max(0, 300 - scan_num * 10)
|
||||
/*for(var/i = artifact_research.starting_tier, i <= artifact_research.max_tiers, i++)
|
||||
for(var/datum/artiresearch/R in artifact_research.researched_items[i])
|
||||
if (R.bonustype == "analyser") time -= R.bonusTime*/
|
||||
time *= 10
|
||||
var/message = "<b>[src]</b> states, \"Commencing analysis.\""
|
||||
src.visible_message(message, message)
|
||||
spawn(time)
|
||||
src.working = 0
|
||||
icon_state = "analyser"
|
||||
cur_artifact.anchored = 0
|
||||
if(cur_artifact.loc == pad_turf)
|
||||
AA_Analyse()
|
||||
scan_num++
|
||||
message = "<b>[src]</b> states, \"Analysis complete.\""
|
||||
src.visible_message(message, message)
|
||||
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.being_used = 1
|
||||
src.working = 1
|
||||
src.icon_state = "analyser_processing"
|
||||
var/time = rand(30,50) + max(0, 300 - scan_num * 10)
|
||||
/*for(var/i = artifact_research.starting_tier, i <= artifact_research.max_tiers, i++)
|
||||
for(var/datum/artiresearch/R in artifact_research.researched_items[i])
|
||||
if (R.bonustype == "analyser") time -= R.bonusTime*/
|
||||
time *= 10
|
||||
var/message = "<b>[src]</b> states, \"Commencing analysis.\""
|
||||
src.visible_message(message, message)
|
||||
spawn(time)
|
||||
src.working = 0
|
||||
icon_state = "analyser"
|
||||
cur_artifact.anchored = 0
|
||||
cur_artifact.being_used = 0
|
||||
if(cur_artifact.loc == pad_turf)
|
||||
AA_Analyse()
|
||||
scan_num++
|
||||
message = "<b>[src]</b> states, \"Analysis complete.\""
|
||||
src.visible_message(message, message)
|
||||
else if (findarti > 1)
|
||||
var/message = "<b>[src]</b> states, \"Cannot analyse. Too many artifacts on pad.\""
|
||||
src.visible_message(message, message)
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
inserted_battery.stored_charge = inserted_battery.capacity
|
||||
harvesting = 0
|
||||
cur_artifact.anchored = 0
|
||||
cur_artifact.being_used = 0
|
||||
src.visible_message("<b>[name]</b> states, \"Battery is full.\"")
|
||||
icon_state = "incubator"
|
||||
return
|
||||
@@ -102,6 +103,9 @@
|
||||
else if(!articount)
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. No artifact found.\""
|
||||
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
|
||||
cur_artifact = analysed
|
||||
//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)
|
||||
harvesting = 1
|
||||
cur_artifact.anchored = 1
|
||||
cur_artifact.being_used = 1
|
||||
icon_state = "incubator_on"
|
||||
var/message = "<b>[src]</b> states, \"Beginning artifact energy harvesting.\""
|
||||
src.visible_message(message, message)
|
||||
@@ -125,6 +130,7 @@
|
||||
if(harvesting)
|
||||
harvesting = 0
|
||||
cur_artifact.anchored = 0
|
||||
cur_artifact.being_used = 0
|
||||
src.visible_message("<b>[name]</b> states, \"Harvesting interrupted.\"")
|
||||
icon_state = "incubator"
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
var/recharge = 5 // How long does it take this artifact to recharge?
|
||||
var/display_id = "" // Artifact ID to display once successfully scanned
|
||||
var/datum/artifact_effect/my_effect = null
|
||||
var/being_used = 0
|
||||
|
||||
/obj/machinery/artifact/New()
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user