What they said

This commit is contained in:
Exxion
2015-05-01 18:07:15 -04:00
parent ecedb9f78a
commit 7e137d1ab0
2 changed files with 14 additions and 8 deletions

View File

@@ -14,6 +14,9 @@
#define Co_NEXTSTEP "nextstep"
#define Co_BACKSTEP "backstep"
#define Co_CON_SPEED "construct" //For tools. See tools.dm
#define Co_DECON_SPEED "deconstruct" //For tools. See tools.dm
/datum/construction
var/list/steps
var/atom/holder
@@ -130,7 +133,7 @@
return
/datum/construction/proc/try_consume(mob/user as mob, atom/movable/used_atom, given_step)
if(!used_atom.construction_delay_mult[1])
if(!used_atom.construction_delay_mult[Co_CON_SPEED])
user << "<span class='warning'>This tool only works for deconstruction!</span>" //It doesn't technically have to be a tool to cause this message, but it wouldn't make sense for anything else to do so.
return 0
@@ -140,7 +143,7 @@
var/delay = 0
if(Co_DELAY in given_step)
delay = given_step[Co_DELAY] * used_atom.construction_delay_mult[1] //I know, I know. Magic numbers bad. See tools.dm.
delay = given_step[Co_DELAY] * used_atom.construction_delay_mult[Co_CON_SPEED]
if(delay > 0)
start_construct_message(given_step, user, used_atom)
if(!do_after(user, delay, needhand = 1))
@@ -286,7 +289,7 @@
/datum/construction/reversible/try_consume(mob/user as mob, atom/movable/used_atom, given_step, index, diff)
//if we've made some progress on a step, we want to drop it
var/current_step = (diff == BACKWARD ? get_forward_step(index) : get_backward_step(index))
if(!used_atom.construction_delay_mult[(diff > 0) + 1])
if(!used_atom.construction_delay_mult[diff == FORWARD ? Co_CON_SPEED : Co_DECON_SPEED])
user << "<span class='warning'>This tool only works for [diff == FORWARD ? "de" : ""]construction!</span>" //It doesn't technically have to be a tool to cause this message, but it wouldn't make sense for anything else to do so.
return 0
if(current_step && (Co_AMOUNT in current_step) && (Co_MAX_AMOUNT in current_step) && (current_step[Co_AMOUNT] < current_step[Co_MAX_AMOUNT]))
@@ -308,7 +311,7 @@
var/delay = 0
if(Co_DELAY in given_step)
delay = given_step[Co_DELAY] * used_atom.construction_delay_mult[(diff > 0) + 1] //Yay for loose typing. The part in the brackets converts -1 to 1 and 1 to 2. See tools.dm for why.
delay = given_step[Co_DELAY] * used_atom.construction_delay_mult[diff == FORWARD ? Co_CON_SPEED : Co_DECON_SPEED]
if(delay > 0)
start_construct_message(given_step, user, used_atom)
if(!do_after(user, delay, needhand = 1))