mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
committed by
GitHub
parent
dfbe31b833
commit
80030deeef
@@ -290,29 +290,37 @@ turf/unsimulated/mineral/ChangeTurf(var/turf/N, var/tell_universe=1, var/force_l
|
||||
|
||||
P.playtoolsound(user, 20)
|
||||
|
||||
var/fail_message = ""
|
||||
var/broke_find = FALSE
|
||||
//handle any archaeological finds we might uncover
|
||||
if(finds && finds.len)
|
||||
var/datum/find/F = finds[1]
|
||||
if (finds && finds.len != 0)
|
||||
var/datum/find/top_find = finds[1]
|
||||
|
||||
if(excavation_level + P.excavation_amount > F.excavation_required)
|
||||
fail_message = "<b>[pick("There is a crunching noise","[W] collides with some different rock","Part of the rock face crumbles away","Something breaks under [W]")]</b>"
|
||||
var/exc_diff = excavation_level + P.excavation_amount - top_find.excavation_required
|
||||
|
||||
if (exc_diff > 0)
|
||||
// Digging too far, probably breaking the artifact.
|
||||
var/fail_message = "<b>[pick("There is a crunching noise","[W] collides with some different rock","Part of the rock face crumbles away","Something breaks under [W]")]</b>"
|
||||
to_chat(user, "<span class='rose'>[fail_message].</span>")
|
||||
broke_find = TRUE
|
||||
|
||||
if(fail_message && prob(90))
|
||||
if(prob(5))
|
||||
excavate_find(5, finds[1])
|
||||
else if(prob(50))
|
||||
finds.Remove(finds[1])
|
||||
if(prob(50))
|
||||
artifact_debris()
|
||||
var/destroy_prob = 50
|
||||
if (exc_diff > 5)
|
||||
destroy_prob = 95
|
||||
|
||||
if (prob(destroy_prob))
|
||||
finds.Remove(top_find)
|
||||
if (prob(40))
|
||||
artifact_debris()
|
||||
|
||||
else
|
||||
excavate_find(5, top_find)
|
||||
|
||||
busy = 1
|
||||
|
||||
if(do_after(user, src, max((MINE_DURATION * P.toolspeed),minimum_mine_time)) && user)
|
||||
busy = 0
|
||||
|
||||
if(finds && finds.len)
|
||||
if(finds && finds.len && !broke_find)
|
||||
var/datum/find/F = finds[1]
|
||||
if(round(excavation_level + P.excavation_amount) == F.excavation_required)
|
||||
excavate_find(100, F)
|
||||
|
||||
Reference in New Issue
Block a user