Merge pull request #19317 from GunHog/Xeno_Queen_Finder_For_Mista_Jay

Adds Queen Finder for Xenos
This commit is contained in:
oranges
2016-07-16 12:02:33 +12:00
committed by GitHub
11 changed files with 55 additions and 11 deletions
@@ -36,7 +36,7 @@
if(!isturf(user.loc))
user << "<span class='notice'>You can't evolve here!</span>"
return 0
if(!alien_type_present(/mob/living/carbon/alien/humanoid/royal))
if(!get_alien_type(/mob/living/carbon/alien/humanoid/royal))
var/mob/living/carbon/alien/humanoid/royal/praetorian/new_xeno = new (user.loc)
user.alien_evolve(new_xeno)
return 1
@@ -38,7 +38,7 @@
if(node.recent_queen_death)
user << "<span class='danger'>You are still too burdened with guilt to evolve into a queen.</span>"
return 0
if(!alien_type_present(/mob/living/carbon/alien/humanoid/royal/queen))
if(!get_alien_type(/mob/living/carbon/alien/humanoid/royal/queen))
var/mob/living/carbon/alien/humanoid/royal/queen/new_xeno = new (user.loc)
user.alien_evolve(new_xeno)
if(new_xeno.client.prefs.unlock_content)
@@ -162,15 +162,15 @@
A.loc = new_xeno
..()
//For alien evolution/promotion procs. Checks for
proc/alien_type_present(var/alienpath)
//For alien evolution/promotion/queen finder procs. Checks for an active alien of that type
proc/get_alien_type(var/alienpath)
for(var/mob/living/carbon/alien/humanoid/A in living_mob_list)
if(!istype(A, alienpath))
continue
if(!A.key || A.stat == DEAD) //Only living aliens with a ckey are valid.
continue
return 1
return 0
return A
return FALSE
/mob/living/carbon/alien/humanoid/check_breath(datum/gas_mixture/breath)
@@ -78,7 +78,7 @@
/obj/effect/proc_holder/alien/royal/queen/promote/fire(mob/living/carbon/alien/user)
var/obj/item/queenpromote/prom
if(alien_type_present(/mob/living/carbon/alien/humanoid/royal/praetorian/))
if(get_alien_type(/mob/living/carbon/alien/humanoid/royal/praetorian/))
user << "<span class='noticealien'>You already have a Praetorian!</span>"
return 0
else
@@ -106,7 +106,7 @@
if(!isalienadult(M) || istype(M, /mob/living/carbon/alien/humanoid/royal))
user << "<span class='noticealien'>You may only use this with your adult, non-royal children!</span>"
return
if(alien_type_present(/mob/living/carbon/alien/humanoid/royal/praetorian/))
if(get_alien_type(/mob/living/carbon/alien/humanoid/royal/praetorian/))
user << "<span class='noticealien'>You already have a Praetorian!</span>"
return
@@ -1,3 +1,6 @@
/mob/living/carbon/alien/Life()
findQueen()
return..()
/mob/living/carbon/alien/check_breath(datum/gas_mixture/breath)
if(status_flags & GODMODE)
+28 -1
View File
@@ -4,4 +4,31 @@
hud_used.alien_plasma_display.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='magenta'>[round(getPlasma())]</font></div>"
/mob/living/carbon/alien/larva/updatePlasmaDisplay()
return
return
/mob/living/carbon/alien/proc/findQueen()
if(hud_used)
hud_used.alien_queen_finder.cut_overlays()
var/mob/queen = get_alien_type(/mob/living/carbon/alien/humanoid/royal/queen)
if(!queen)
return
var/turf/Q = get_turf(queen)
var/turf/A = get_turf(src)
if(Q.z != A.z) //The queen is on a different Z level, we cannot sense that far.
return
var/Qdir = get_dir(src, Q)
var/Qdist = get_dist(src, Q)
image(icon,loc,icon_state,layer,dir)
var/finder_icon = "finder_center" //Overlay showed when adjacent to or on top of the queen!
switch(Qdist)
if(2 to 7)
finder_icon = "finder_near"
if(8 to 20)
finder_icon = "finder_med"
if(21 to INFINITY)
finder_icon = "finder_far"
var/image/finder_eye = image('icons/mob/screen_alien.dmi', icon_state = finder_icon, dir = Qdir)
hud_used.alien_queen_finder.add_overlay(finder_eye)
/mob/living/carbon/alien/humanoid/royal/queen/findQueen()
return //Queen already knows where she is. Hopefully.