forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a new Fungal Growth event, makes fungus re-harvestable (Paradise…
…SS13#21928) * the fungus is amongus * us -> al * Update code/game/objects/effects/decals/Cleanable/misc_cleanables.dm Co-authored-by: JimKil3 <[email protected]> * Update code/game/objects/effects/decals/Cleanable/misc_cleanables.dm Co-authored-by: JimKil3 <[email protected]> * Update code/game/objects/effects/decals/Cleanable/misc_cleanables.dm fineeee Co-authored-by: JimKil3 <[email protected]> --------- Co-authored-by: JimKil3 <[email protected]>
- Loading branch information
Showing
4 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
/datum/event/wallrot/start() | ||
INVOKE_ASYNC(src, PROC_REF(spawn_wallrot)) | ||
|
||
/datum/event/wallrot/proc/apply_to_turf(turf/T) | ||
var/turf/simulated/wall/W = T | ||
W.rot() | ||
|
||
/datum/event/wallrot/proc/is_valid_candidate(turf/T) | ||
return TRUE | ||
|
||
/datum/event/wallrot/proc/spawn_wallrot() | ||
var/turf/simulated/wall/center = null | ||
|
||
// 100 attempts | ||
for(var/i in 0 to 100) | ||
var/turf/candidate = locate(rand(1, world.maxx), rand(1, world.maxy), level_name_to_num(MAIN_STATION)) | ||
if(iswallturf(candidate)) | ||
if(iswallturf(candidate) && is_valid_candidate(candidate)) | ||
center = candidate | ||
break | ||
|
||
if(!center) | ||
return | ||
// Make sure at least one piece of wall rots! | ||
center.rot() | ||
apply_to_turf(center) | ||
|
||
// Have a chance to rot lots of other walls. | ||
var/rotcount = 0 | ||
var/actual_severity = severity * rand(5, 10) | ||
for(var/turf/simulated/wall/W in range(5, center)) | ||
if(prob(50)) | ||
W.rot() | ||
apply_to_turf(W) | ||
rotcount++ | ||
|
||
// Only rot up to severity walls | ||
if(rotcount >= actual_severity) | ||
break | ||
|
||
/datum/event/wallrot/fungus | ||
|
||
/datum/event/wallrot/fungus/is_valid_candidate(turf/T) | ||
return istype(get_area(T), /area/maintenance) | ||
|
||
/datum/event/wallrot/fungus/apply_to_turf(turf/T) | ||
new /obj/effect/decal/cleanable/fungus(T) |