Merge pull request #9687 from Ghommie/Ghommie-cit305
Refactoring how Jacqueen teleportation destination is selected.
This commit is contained in:
@@ -24,6 +24,8 @@ Possible to do for anyone motivated enough:
|
||||
* Holopad
|
||||
*/
|
||||
|
||||
GLOBAL_LIST_EMPTY(network_holopads)
|
||||
|
||||
#define HOLOPAD_PASSIVE_POWER_USAGE 1
|
||||
#define HOLOGRAM_POWER_USAGE 2
|
||||
|
||||
@@ -55,7 +57,6 @@ Possible to do for anyone motivated enough:
|
||||
var/record_user //user that inititiated the recording
|
||||
var/obj/effect/overlay/holo_pad_hologram/replay_holo //replay hologram
|
||||
var/static/force_answer_call = FALSE //Calls will be automatically answered after a couple rings, here for debugging
|
||||
var/static/list/holopads = list()
|
||||
var/obj/effect/overlay/holoray/ray
|
||||
var/ringing = FALSE
|
||||
var/offset = FALSE
|
||||
@@ -96,7 +97,7 @@ Possible to do for anyone motivated enough:
|
||||
/obj/machinery/holopad/Initialize()
|
||||
. = ..()
|
||||
if(on_network)
|
||||
holopads += src
|
||||
GLOB.network_holopads += src
|
||||
|
||||
/obj/machinery/holopad/Destroy()
|
||||
if(outgoing_call)
|
||||
@@ -116,7 +117,7 @@ Possible to do for anyone motivated enough:
|
||||
|
||||
QDEL_NULL(disk)
|
||||
|
||||
holopads -= src
|
||||
GLOB.network_holopads -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/holopad/power_change()
|
||||
@@ -260,7 +261,7 @@ Possible to do for anyone motivated enough:
|
||||
temp += "<A href='?src=[REF(src)];mainmenu=1'>Main Menu</A>"
|
||||
if(usr.loc == loc)
|
||||
var/list/callnames = list()
|
||||
for(var/I in holopads)
|
||||
for(var/I in GLOB.network_holopads)
|
||||
var/area/A = get_area(I)
|
||||
if(A)
|
||||
LAZYADD(callnames[A], I)
|
||||
@@ -474,7 +475,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
|
||||
var/obj/effect/overlay/holo_pad_hologram/h = masters[holo_owner]
|
||||
if(!h || h.HC) //Holocalls can't change source.
|
||||
return FALSE
|
||||
for(var/pad in holopads)
|
||||
for(var/pad in GLOB.network_holopads)
|
||||
var/obj/machinery/holopad/another = pad
|
||||
if(another == src)
|
||||
continue
|
||||
|
||||
@@ -95,45 +95,34 @@
|
||||
last_poof = world.realtime
|
||||
var/datum/reagents/R = new/datum/reagents(100)//Hey, just in case.
|
||||
var/datum/effect_system/smoke_spread/chem/s = new()
|
||||
R.add_reagent("secretcatchem", (10))
|
||||
R.add_reagent("secretcatchem", 10)
|
||||
s.set_up(R, 0, loc)
|
||||
s.start()
|
||||
visible_message("<b>[src]</b> disappears in a puff of smoke!")
|
||||
canmove = TRUE
|
||||
health = 25
|
||||
|
||||
var/hp_list = list()
|
||||
for(var/obj/machinery/holopad/hp in world)
|
||||
hp_list += hp
|
||||
//Try to go to populated areas
|
||||
var/list/pop_areas = list()
|
||||
for(var/mob/living/L in GLOB.player_list)
|
||||
var/area/A = get_area(L)
|
||||
pop_areas += A
|
||||
|
||||
var/nono_areas = list("AI ")
|
||||
|
||||
for(var/i = 0, i <= 6, i+=1) //Attempts a jump 6 times.
|
||||
var/obj/machinery/holopad/hp = pick(hp_list)
|
||||
if(forceMove(pick(hp.loc)))
|
||||
|
||||
var/jacq_please_no = FALSE
|
||||
for(var/no_area in nono_areas)
|
||||
var/turf/L1 = hp.loc
|
||||
if(!L1) //Incase the area isn't a turf (i.e. in a locker)
|
||||
continue
|
||||
var/area/L2 = L1.loc
|
||||
if(L2)
|
||||
if(findtext(L2.name, no_area))
|
||||
jacq_please_no = TRUE
|
||||
|
||||
if(jacq_please_no)
|
||||
i-=1
|
||||
continue
|
||||
|
||||
//Try to go to populated areas
|
||||
var/list/seen = viewers(8, get_turf(src))
|
||||
for(var/victim in seen)
|
||||
if(ishuman(victim))
|
||||
if(z == cached_z)
|
||||
return TRUE
|
||||
var/list/targets = list()
|
||||
for(var/H in GLOB.network_holopads)
|
||||
var/area/A = get_area(H)
|
||||
if(findtextEx(A, "AI") || !(A in pop_areas) || !is_station_level(H))
|
||||
continue
|
||||
targets += H
|
||||
|
||||
if(!targets)
|
||||
targets = GLOB.generic_event_spawns
|
||||
|
||||
for(var/i in 1 to 6) //Attempts a jump up to 6 times.
|
||||
var/atom/A = pick(targets)
|
||||
if(do_teleport(src, A, channel = TELEPORT_CHANNEL_MAGIC))
|
||||
return TRUE
|
||||
targets -= A
|
||||
return FALSE
|
||||
|
||||
/mob/living/simple_animal/jacq/proc/gender_check(mob/living/carbon/C)
|
||||
|
||||
Reference in New Issue
Block a user