mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 12:29:23 +01:00
c25c8b6a37
* one * two * three * fsdsdf
14 lines
520 B
Plaintext
14 lines
520 B
Plaintext
/proc/get_value(atom/A) // A can be either type *or* instance; ie get_value(/obj) is valid, as is get_value(new /obj)
|
|
var/atom/t = ispath(A) ? A : A.type
|
|
while(!(t in worths)) // Find the first parent that is in the list
|
|
t = PARENT(t)
|
|
if(!t)
|
|
return 0
|
|
var/value = worths[t]
|
|
if(value >= 0) // Value zero or greater than zero, all instances have same value
|
|
return value
|
|
else // Negative. If it's a path, use -x, otherwise call Value() on the instance
|
|
if(ispath(A))
|
|
return -value
|
|
return A.Value(-value)
|