From 1bf10c0435507ac1a9d5b440e23f780fd508d9cd Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 2 Nov 2019 15:50:54 +0100
Subject: [PATCH 1/6] Improving Jacqueen's teleportation area selection.
---
code/modules/holiday/halloween/jacqueen.dm | 54 +++++++++++-----------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm
index ed9254c295..0180f083a3 100644
--- a/code/modules/holiday/halloween/jacqueen.dm
+++ b/code/modules/holiday/halloween/jacqueen.dm
@@ -95,45 +95,45 @@
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("[src] 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
+ var/list/areas = list()
+ for(var/A in GLOB.teleportlocs)
+ if(findtextEx(A, "AI")
+ continue
+ areas += GLOB.teleportlocs[A]
- var/nono_areas = list("AI ")
+ //Try to go to populated areas
+ var/list/pop_areas = list()
+ for(var/M in GLOB.player_list)
+ var/area/A = get_area(M)
+ pop_areas += A
- 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/list/cool_places = uniquemergelist(areas, pop_areas)
- 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(!cool_places)
+ cool_places = areas
- if(jacq_please_no)
- i-=1
+ for(var/i in 1 to 6) //Attempts a jump up to 6 times.
+ var/area/A = pick(cool_places)
+ var/list/L = list()
+
+ if(i != 6) // We need to teleport away, no matter what.
+ for(var/turf/T in get_area_turfs(A.type))
+ if(!is_blocked_turf(T))
+ L += T
+ if(!L.len)
+ cool_places -= A
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
-
-
+ if(!do_teleport(src, pick(L), channel = TELEPORT_CHANNEL_MAGIC))
+ return TRUE
+ cool_places -= A
return FALSE
/mob/living/simple_animal/jacq/proc/gender_check(mob/living/carbon/C)
From a949f84557e922d26b9db802528f80de2e3171f0 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 2 Nov 2019 16:00:48 +0100
Subject: [PATCH 2/6] missing bits.
---
code/modules/holiday/halloween/jacqueen.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm
index 0180f083a3..c77de912f9 100644
--- a/code/modules/holiday/halloween/jacqueen.dm
+++ b/code/modules/holiday/halloween/jacqueen.dm
@@ -104,7 +104,7 @@
var/list/areas = list()
for(var/A in GLOB.teleportlocs)
- if(findtextEx(A, "AI")
+ if(findtextEx(A, "AI"))
continue
areas += GLOB.teleportlocs[A]
@@ -116,7 +116,7 @@
var/list/cool_places = uniquemergelist(areas, pop_areas)
- if(!cool_places)
+ if(!cool_places.len)
cool_places = areas
for(var/i in 1 to 6) //Attempts a jump up to 6 times.
From 3193e3ce20544f22546db9f3b27e0538f4d34aed Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 2 Nov 2019 16:12:37 +0100
Subject: [PATCH 3/6] fix.
---
code/modules/holiday/halloween/jacqueen.dm | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm
index c77de912f9..4b5874d3e5 100644
--- a/code/modules/holiday/halloween/jacqueen.dm
+++ b/code/modules/holiday/halloween/jacqueen.dm
@@ -121,15 +121,16 @@
for(var/i in 1 to 6) //Attempts a jump up to 6 times.
var/area/A = pick(cool_places)
- var/list/L = list()
+ var/list/area_turfs = list(get_area_turfs(A.type))
if(i != 6) // We need to teleport away, no matter what.
- for(var/turf/T in get_area_turfs(A.type))
+ for(var/t in area_turfs)
+ var/turf/T = t
if(!is_blocked_turf(T))
- L += T
- if(!L.len)
- cool_places -= A
- continue
+ L -= T
+ if(!L.len)
+ cool_places -= A
+ continue
if(!do_teleport(src, pick(L), channel = TELEPORT_CHANNEL_MAGIC))
return TRUE
From 50fc1004bace7d480599f9d3a38a148baa676a91 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 2 Nov 2019 16:46:02 +0100
Subject: [PATCH 4/6] Actually holopads, so they won't end up in maintenance...
---
code/game/machinery/hologram.dm | 11 +++----
code/modules/holiday/halloween/jacqueen.dm | 34 +++++++---------------
2 files changed, 17 insertions(+), 28 deletions(-)
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index 893f36acb3..79aef8ba7b 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -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 += "Main Menu"
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
diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm
index 4b5874d3e5..3ad4149700 100644
--- a/code/modules/holiday/halloween/jacqueen.dm
+++ b/code/modules/holiday/halloween/jacqueen.dm
@@ -102,39 +102,27 @@
canmove = TRUE
health = 25
- var/list/areas = list()
- for(var/A in GLOB.teleportlocs)
- if(findtextEx(A, "AI"))
- continue
- areas += GLOB.teleportlocs[A]
-
//Try to go to populated areas
var/list/pop_areas = list()
for(var/M in GLOB.player_list)
var/area/A = get_area(M)
pop_areas += A
- var/list/cool_places = uniquemergelist(areas, pop_areas)
+ 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(!cool_places.len)
- cool_places = areas
+ if(!targets)
+ targets = GLOB.generic_event_spawns
for(var/i in 1 to 6) //Attempts a jump up to 6 times.
- var/area/A = pick(cool_places)
- var/list/area_turfs = list(get_area_turfs(A.type))
-
- if(i != 6) // We need to teleport away, no matter what.
- for(var/t in area_turfs)
- var/turf/T = t
- if(!is_blocked_turf(T))
- L -= T
- if(!L.len)
- cool_places -= A
- continue
-
- if(!do_teleport(src, pick(L), channel = TELEPORT_CHANNEL_MAGIC))
+ var/atom/A = pick(targets)
+ if(!do_teleport(src, A, channel = TELEPORT_CHANNEL_MAGIC))
return TRUE
- cool_places -= A
+ targets -= A
return FALSE
/mob/living/simple_animal/jacq/proc/gender_check(mob/living/carbon/C)
From f4587b4260bebfb45350dff74a102b9dcd93a072 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 2 Nov 2019 16:47:25 +0100
Subject: [PATCH 5/6] This is very unprofessional. Yet I'm no google architect.
---
code/modules/holiday/halloween/jacqueen.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm
index 3ad4149700..a8111a3e3d 100644
--- a/code/modules/holiday/halloween/jacqueen.dm
+++ b/code/modules/holiday/halloween/jacqueen.dm
@@ -120,7 +120,7 @@
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))
+ if(do_teleport(src, A, channel = TELEPORT_CHANNEL_MAGIC))
return TRUE
targets -= A
return FALSE
From 2653a2965dc630cb76c5a3e1d30fa3aa0eb4aa1d Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 2 Nov 2019 20:46:33 +0100
Subject: [PATCH 6/6] How about we only check the living?
---
code/modules/holiday/halloween/jacqueen.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm
index a8111a3e3d..f67c099309 100644
--- a/code/modules/holiday/halloween/jacqueen.dm
+++ b/code/modules/holiday/halloween/jacqueen.dm
@@ -104,8 +104,8 @@
//Try to go to populated areas
var/list/pop_areas = list()
- for(var/M in GLOB.player_list)
- var/area/A = get_area(M)
+ for(var/mob/living/L in GLOB.player_list)
+ var/area/A = get_area(L)
pop_areas += A
var/list/targets = list()