mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +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++
|
findarti++
|
||||||
cur_artifact = A
|
cur_artifact = A
|
||||||
if (findarti == 1)
|
if (findarti == 1)
|
||||||
cur_artifact.anchored = 1
|
if(cur_artifact.being_used)
|
||||||
src.working = 1
|
var/message = "<b>[src]</b> states, \"Cannot analyse. Excess energy drain is disrupting signal.\""
|
||||||
src.icon_state = "analyser_processing"
|
src.visible_message(message, message)
|
||||||
var/time = rand(30,50) + max(0, 300 - scan_num * 10)
|
else
|
||||||
/*for(var/i = artifact_research.starting_tier, i <= artifact_research.max_tiers, i++)
|
cur_artifact.anchored = 1
|
||||||
for(var/datum/artiresearch/R in artifact_research.researched_items[i])
|
cur_artifact.being_used = 1
|
||||||
if (R.bonustype == "analyser") time -= R.bonusTime*/
|
src.working = 1
|
||||||
time *= 10
|
src.icon_state = "analyser_processing"
|
||||||
var/message = "<b>[src]</b> states, \"Commencing analysis.\""
|
var/time = rand(30,50) + max(0, 300 - scan_num * 10)
|
||||||
src.visible_message(message, message)
|
/*for(var/i = artifact_research.starting_tier, i <= artifact_research.max_tiers, i++)
|
||||||
spawn(time)
|
for(var/datum/artiresearch/R in artifact_research.researched_items[i])
|
||||||
src.working = 0
|
if (R.bonustype == "analyser") time -= R.bonusTime*/
|
||||||
icon_state = "analyser"
|
time *= 10
|
||||||
cur_artifact.anchored = 0
|
var/message = "<b>[src]</b> states, \"Commencing analysis.\""
|
||||||
if(cur_artifact.loc == pad_turf)
|
src.visible_message(message, message)
|
||||||
AA_Analyse()
|
spawn(time)
|
||||||
scan_num++
|
src.working = 0
|
||||||
message = "<b>[src]</b> states, \"Analysis complete.\""
|
icon_state = "analyser"
|
||||||
src.visible_message(message, message)
|
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)
|
else if (findarti > 1)
|
||||||
var/message = "<b>[src]</b> states, \"Cannot analyse. Too many artifacts on pad.\""
|
var/message = "<b>[src]</b> states, \"Cannot analyse. Too many artifacts on pad.\""
|
||||||
src.visible_message(message, message)
|
src.visible_message(message, message)
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
||||||
..()
|
..()
|
||||||
|
|||||||
Reference in New Issue
Block a user