Componentized acid
This commit is contained in:
@@ -204,32 +204,23 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
|
||||
//the obj's reaction when touched by acid
|
||||
/obj/acid_act(acidpwr, acid_volume)
|
||||
if(!(resistance_flags & UNACIDABLE) && acid_volume)
|
||||
|
||||
if(!acid_level)
|
||||
SSacid.processing[src] = src
|
||||
update_icon()
|
||||
var/acid_cap = acidpwr * 300 //so we cannot use huge amounts of weak acids to do as well as strong acids.
|
||||
if(acid_level < acid_cap)
|
||||
acid_level = min(acid_level + acidpwr * acid_volume, acid_cap)
|
||||
AddComponent(/datum/component/acid, acidpwr, acid_volume)
|
||||
return 1
|
||||
|
||||
//the proc called by the acid subsystem to process the acid that's on the obj
|
||||
/obj/proc/acid_processing()
|
||||
. = 1
|
||||
if(!(resistance_flags & ACID_PROOF))
|
||||
if(prob(33))
|
||||
playsound(loc, 'sound/items/welder.ogg', 150, 1)
|
||||
take_damage(min(1 + round(sqrt(acid_level)*0.3), 300), BURN, "acid", 0)
|
||||
|
||||
acid_level = max(acid_level - (5 + 3*round(sqrt(acid_level))), 0)
|
||||
if(!acid_level)
|
||||
return 0
|
||||
|
||||
//called when the obj is destroyed by acid.
|
||||
/obj/proc/acid_melt()
|
||||
SSacid.processing -= src
|
||||
var/datum/component/acid/acid = GetComponent(/datum/component/acid)
|
||||
if(acid)
|
||||
acid.RemoveComponent()
|
||||
deconstruct(FALSE)
|
||||
|
||||
/obj/proc/acid_level()
|
||||
var/datum/component/acid/acid = GetComponent(/datum/component/acid)
|
||||
if(acid)
|
||||
return acid.level
|
||||
else
|
||||
return 0
|
||||
|
||||
//// FIRE
|
||||
|
||||
/obj/fire_act(exposed_temperature, exposed_volume)
|
||||
|
||||
Reference in New Issue
Block a user