Minor refactor of spawners, fixed rogue drone and carp events not spawning mobs (#17849)

* lessens the use of GLOB.landmarks_list

* delete redundant blob icon

* Apply suggestions from code review

Co-authored-by: moxian <moxian@users.noreply.github.com>

* review part 2

* aa review

Co-authored-by: moxian <moxian@users.noreply.github.com>
This commit is contained in:
S34N
2022-05-24 14:26:36 +01:00
committed by GitHub
parent 27f72f078d
commit 83e228cbcb
17 changed files with 130 additions and 192 deletions
@@ -66,15 +66,12 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0)
var/list/sit_spawns = list()
var/list/sit_spawns_leader = list()
var/list/sit_spawns_mgmt = list()
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(L.name == "Syndicate-Infiltrator")
if(istype(L, /obj/effect/landmark/spawner/syndicate_infiltrator))
sit_spawns += L
if(L.name == "Syndicate-Infiltrator-Leader")
if(istype(L, /obj/effect/landmark/spawner/syndicate_infiltrator_leader))
sit_spawns_leader += L
if(L.name == "Syndicate-Infiltrator-Admin")
sit_spawns_mgmt += L
var/num_spawned = 1
var/team_leader = null
+30 -44
View File
@@ -473,51 +473,37 @@
var/teamTwoMembers = 5
var/datum/character_save/S = new
S.randomise()
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(L.name == "tdome1")
if(teamOneMembers<=0)
break
for(var/obj/effect/landmark/L in GLOB.tdome1)
if(!teamOneMembers)
break
var/mob/living/carbon/human/newMember = new(get_turf(L))
S.copy_to(newMember)
newMember.dna.ready_dna(newMember)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
qdel(newMember)
break
newMember.key = theghost.key
teamOneMembers--
to_chat(newMember, "You are a member of the <font color='green'><b>GREEN</b></font> Thunderdome team! Gear up and help your team destroy the red team!")
var/mob/living/carbon/human/newMember = new(L.loc)
S.copy_to(newMember)
newMember.dna.ready_dna(newMember)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
qdel(newMember)
break
newMember.key = theghost.key
teamOneMembers--
to_chat(newMember, "You are a member of the <font color = 'green'><b>GREEN</b></font> Thunderdome team! Gear up and help your team destroy the red team!")
if(L.name == "tdome2")
if(teamTwoMembers<=0)
break
var/mob/living/carbon/human/newMember = new(L.loc)
S.copy_to(newMember)
newMember.dna.ready_dna(newMember)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
qdel(newMember)
break
newMember.key = theghost.key
teamTwoMembers--
to_chat(newMember, "You are a member of the <font color = 'red'><b>RED</b></font> Thunderdome team! Gear up and help your team destroy the green team!")
for(var/obj/effect/landmark/L in GLOB.tdome2)
if(!teamTwoMembers)
break
var/mob/living/carbon/human/newMember = new(get_turf(L))
S.copy_to(newMember)
newMember.dna.ready_dna(newMember)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
qdel(newMember)
break
newMember.key = theghost.key
teamTwoMembers--
to_chat(newMember, "You are a member of the <font color='red'><b>RED</b></font> Thunderdome team! Gear up and help your team destroy the green team!")
else
return 0
return 1
+57 -63
View File
@@ -39,7 +39,7 @@ GLOBAL_VAR_INIT(sent_strike_team, 0)
// Find ghosts willing to be DS
var/image/source = image('icons/obj/cardboard_cutout.dmi', "cutout_deathsquad")
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, COMMANDOS_POSSIBLE, "Join the DeathSquad?",, 21, 60 SECONDS, TRUE, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE, source = source)
if(!commando_ghosts.len)
if(!length(commando_ghosts))
to_chat(usr, "<span class='userdanger'>Nobody volunteered to join the DeathSquad.</span>")
return
@@ -49,79 +49,73 @@ GLOBAL_VAR_INIT(sent_strike_team, 0)
var/commando_number = COMMANDOS_POSSIBLE //for selecting a leader
var/is_leader = TRUE // set to FALSE after leader is spawned
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
for(var/obj/effect/landmark/spawner/syndicate_commando/L in GLOB.landmarks_list)
if(commando_number <= 0)
break
if(L.name == "Commando")
if(!length(commando_ghosts))
break
if(!commando_ghosts.len)
break
var/use_ds_borg = FALSE
var/mob/ghost_mob = pick(commando_ghosts)
commando_ghosts -= ghost_mob
if(!ghost_mob || !ghost_mob.key || !ghost_mob.client)
continue
var/use_ds_borg = FALSE
var/mob/ghost_mob = pick(commando_ghosts)
commando_ghosts -= ghost_mob
if(!ghost_mob || !ghost_mob.key || !ghost_mob.client)
continue
if(!is_leader)
var/new_dstype = alert(ghost_mob.client, "Select Deathsquad Type.", "DS Character Generation", "Organic", "Cyborg")
if(new_dstype == "Cyborg")
use_ds_borg = TRUE
if(!is_leader)
var/new_dstype = alert(ghost_mob.client, "Select Deathsquad Type.", "DS Character Generation", "Organic", "Cyborg")
if(new_dstype == "Cyborg")
use_ds_borg = TRUE
if(!ghost_mob || !ghost_mob.key || !ghost_mob.client) // Have to re-check this due to the above alert() call
continue
if(!ghost_mob || !ghost_mob.key || !ghost_mob.client) // Have to re-check this due to the above alert() call
continue
if(use_ds_borg)
var/mob/living/silicon/robot/deathsquad/R = new(get_turf(L))
var/rnum = rand(1, 1000)
var/borgname = "Epsilon [rnum]"
R.name = borgname
R.custom_name = borgname
R.real_name = R.name
R.mind = new
R.mind.current = R
R.mind.set_original_mob(R)
R.mind.assigned_role = SPECIAL_ROLE_DEATHSQUAD
R.mind.special_role = SPECIAL_ROLE_DEATHSQUAD
R.mind.offstation_role = TRUE
if(!(R.mind in SSticker.minds))
SSticker.minds += R.mind
SSticker.mode.traitors += R.mind
R.key = ghost_mob.key
if(nuke_code)
R.mind.store_memory("<B>Nuke Code:</B> <span class='warning'>[nuke_code].</span>")
R.mind.store_memory("<B>Mission:</B> <span class='warning'>[input].</span>")
to_chat(R, "<span class='userdanger'>You are a Special Operations cyborg, in the service of Central Command. \nYour current mission is: <span class='danger'>[input]</span></span>")
else
var/mob/living/carbon/human/new_commando = create_death_commando(L, is_leader)
new_commando.mind.key = ghost_mob.key
new_commando.key = ghost_mob.key
new_commando.internal = new_commando.s_store
new_commando.update_action_buttons_icon()
if(nuke_code)
new_commando.mind.store_memory("<B>Nuke Code:</B> <span class='warning'>[nuke_code].</span>")
new_commando.mind.store_memory("<B>Mission:</B> <span class='warning'>[input].</span>")
to_chat(new_commando, "<span class='userdanger'>You are a Special Ops [is_leader ? "<B>TEAM LEADER</B>" : "commando"] in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: <span class='danger'>[input]</span></span>")
if(use_ds_borg)
var/mob/living/silicon/robot/deathsquad/R = new()
R.forceMove(get_turf(L))
var/rnum = rand(1,1000)
var/borgname = "Epsilon [rnum]"
R.name = borgname
R.custom_name = borgname
R.real_name = R.name
R.mind = new
R.mind.current = R
R.mind.set_original_mob(R)
R.mind.assigned_role = SPECIAL_ROLE_DEATHSQUAD
R.mind.special_role = SPECIAL_ROLE_DEATHSQUAD
R.mind.offstation_role = TRUE
if(!(R.mind in SSticker.minds))
SSticker.minds += R.mind
SSticker.mode.traitors += R.mind
R.key = ghost_mob.key
if(nuke_code)
R.mind.store_memory("<B>Nuke Code:</B> <span class='warning'>[nuke_code].</span>")
R.mind.store_memory("<B>Mission:</B> <span class='warning'>[input].</span>")
to_chat(R, "<span class='userdanger'>You are a Special Operations cyborg, in the service of Central Command. \nYour current mission is: <span class='danger'>[input]</span></span>")
else
var/mob/living/carbon/human/new_commando = create_death_commando(L, is_leader)
new_commando.mind.key = ghost_mob.key
new_commando.key = ghost_mob.key
new_commando.internal = new_commando.s_store
new_commando.update_action_buttons_icon()
if(nuke_code)
new_commando.mind.store_memory("<B>Nuke Code:</B> <span class='warning'>[nuke_code].</span>")
new_commando.mind.store_memory("<B>Mission:</B> <span class='warning'>[input].</span>")
to_chat(new_commando, "<span class='userdanger'>You are a Special Ops [is_leader ? "<B>TEAM LEADER</B>" : "commando"] in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: <span class='danger'>[input]</span></span>")
is_leader = FALSE
commando_number--
is_leader = FALSE
commando_number--
//Spawns the rest of the commando gear.
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
if(L.name == "Commando_Manual")
//new /obj/item/gun/energy/pulse_rifle(L.loc)
var/obj/item/paper/P = new(L.loc)
P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
P.name = "Spec. Ops Manual"
P.icon = "pamphlet-ds"
var/obj/item/stamp/centcom/stamp = new
P.stamp(stamp)
qdel(stamp)
for(var/obj/effect/landmark/spawner/commando_manual/L in GLOB.landmarks_list)
//new /obj/item/gun/energy/pulse_rifle(L.loc)
var/obj/item/paper/P = new(L.loc)
P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
P.name = "Spec. Ops Manual"
P.icon = "pamphlet-ds"
var/obj/item/stamp/centcom/stamp = new
P.stamp(stamp)
qdel(stamp)
for(var/thing in GLOB.landmarks_list)
var/obj/effect/landmark/L = thing
@@ -47,7 +47,7 @@ GLOBAL_VAR_INIT(sent_syndicate_strike_team, 0)
// Find ghosts willing to be SST
var/image/I = new('icons/obj/cardboard_cutout.dmi', "cutout_commando")
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 60 SECONDS, TRUE, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE, source = I)
if(!commando_ghosts.len)
if(!length(commando_ghosts))
to_chat(usr, "<span class='userdanger'>Nobody volunteered to join the SST.</span>")
return
@@ -62,7 +62,7 @@ GLOBAL_VAR_INIT(sent_syndicate_strike_team, 0)
if(L.name == "Syndicate-Commando")
if(!commando_ghosts.len)
if(!length(commando_ghosts))
break
var/mob/ghost_mob = pick(commando_ghosts)