Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Restrict Flockmind rift placement #54

Merged
merged 2 commits into from
Mar 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions code/datums/abilities/flock/flockmind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,39 @@

/datum/targetable/flockmindAbility/spawnEgg/cast(atom/target)
if(..())
return 1
return TRUE

var/mob/living/intangible/flock/flockmind/F = holder.owner
if(F)
F.spawnEgg()

var/turf/T = get_turf(F)

if (istype(T, /turf/space/) || istype(T.loc, /area/station/solar) || istype(T.loc, /area/station/mining/magnet))
boutput(F, "<span class='alert'>Space and exposed areas are unsuitable for rift placement!</span>")
return TRUE

if (!isadmin(F))
if(IS_ARRIVALS(T.loc))
boutput(F, "<spawn class='alert'>Your rift can't be placed inside arrivals!</span>")
return TRUE

if (!istype(T.loc, /area/station/))
boutput(F, "<spawn class='alert'>Your rift needs to be placed on the [station_or_ship()]!</span>")
return TRUE

if (istype(T, /turf/unsimulated/))
boutput(F, "<span class='alert'>This kind of tile cannot support rift placement.</span>")
return TRUE

if (T.density)
boutput(F, "<span class='alert'>Your rift cannot be placed inside a wall!</span>")
return TRUE

for (var/atom/O in T.contents)
if (O.density)
boutput(F, "<span class='alert'>That tile is blocked by [O].</span>")
return TRUE

F.spawnEgg()

/////////////////////////////////////////

Expand Down