|
20 | 20 | <a href='?src=[REF(src)];[HrefToken()];makeAntag=blob'>Make Blob</a><br> |
21 | 21 | <a href='?src=[REF(src)];[HrefToken()];makeAntag=wizard'>Make Wizard (Requires Ghosts)</a><br> |
22 | 22 | <a href='?src=[REF(src)];[HrefToken()];makeAntag=nukeops'>Make Nuke Team (Requires Ghosts)</a><br> |
| 23 | + <a href='?src=[REF(src)];[HrefToken()];makeAntag=centcom_custom'>Make Uplink CentCom Response Team (Requires Ghosts)</a><br> |
23 | 24 | <a href='?src=[REF(src)];[HrefToken()];makeAntag=centcom'>Make CentCom Response Team (Requires Ghosts)</a><br> |
24 | 25 | <a href='?src=[REF(src)];[HrefToken()];makeAntag=abductors'>Make Abductor Team (Requires Ghosts)</a><br> |
25 | 26 | <a href='?src=[REF(src)];[HrefToken()];makeAntag=revenant'>Make Revenant (Requires Ghost)</a><br> |
|
491 | 492 |
|
492 | 493 | return |
493 | 494 |
|
| 495 | +// Uplink-equipped Centcom Response Team |
| 496 | +/datum/admins/proc/makeUplinkEmergencyResponseTeam(var/datum/ert/ertemplate = null) |
| 497 | + if (ertemplate) |
| 498 | + ertemplate = new ertemplate |
| 499 | + else |
| 500 | + ertemplate = new /datum/ert/uplinked |
| 501 | + |
| 502 | + var/list/settings = list( |
| 503 | + "preview_callback" = CALLBACK(src, .proc/makeERTPreviewIcon), |
| 504 | + "mainsettings" = list( |
| 505 | + "template" = list("desc" = "Template", "type" = "datum", "path" = "/datum/ert/uplinked", "value" = "/datum/ert/uplinked"), |
| 506 | + "uplink" = list("desc" = "Uplink Type", "type" = "datum", "path" = "/obj/item/ntuplink", "subtypesonly" = TRUE, "value" = ertemplate.uplinktype), |
| 507 | + "teamsize" = list("desc" = "Team Size", "type" = "number", "value" = ertemplate.teamsize), |
| 508 | + "mission" = list("desc" = "Mission", "type" = "string", "value" = ertemplate.mission), |
| 509 | + "polldesc" = list("desc" = "Ghost poll description", "type" = "string", "value" = ertemplate.polldesc), |
| 510 | + "enforce_human" = list("desc" = "Enforce human authority", "type" = "boolean", "value" = "[(CONFIG_GET(flag/enforce_human_authority) ? "Yes" : "No")]"), |
| 511 | + "open_armory" = list("desc" = "Open armory doors", "type" = "boolean", "value" = "[(ertemplate.opendoors ? "Yes" : "No")]"), |
| 512 | + "open_mechbay" = list("desc" = "Open Mech Bay", "type" = "boolean", "value" = "[(ertemplate.openmech ? "Yes" : "No")]"), |
| 513 | + ) |
| 514 | + ) |
| 515 | + |
| 516 | + var/list/prefreturn = presentpreflikepicker(usr,"Customize ERT", "Customize ERT", Button1="Ok", width = 600, StealFocus = 1,Timeout = 0, settings=settings) |
| 517 | + |
| 518 | + if (isnull(prefreturn)) |
| 519 | + return FALSE |
| 520 | + |
| 521 | + if (prefreturn["button"] == 1) |
| 522 | + var/list/prefs = settings["mainsettings"] |
| 523 | + |
| 524 | + ertemplate.uplinktype = prefs["uplink"]["value"] |
| 525 | + ertemplate.teamsize = prefs["teamsize"]["value"] |
| 526 | + ertemplate.mission = prefs["mission"]["value"] |
| 527 | + ertemplate.polldesc = prefs["polldesc"]["value"] |
| 528 | + ertemplate.enforce_human = prefs["enforce_human"]["value"] == "Yes" ? TRUE : FALSE |
| 529 | + ertemplate.opendoors = prefs["open_armory"]["value"] == "Yes" ? TRUE : FALSE |
| 530 | + ertemplate.openmech = prefs["open_mechbay"]["value"] == "Yes" ? TRUE : FALSE |
| 531 | + |
| 532 | + var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you wish to be considered for [ertemplate.polldesc] ?", "deathsquad", null) |
| 533 | + var/teamSpawned = FALSE |
| 534 | + |
| 535 | + if(candidates.len > 0) |
| 536 | + //Pick the (un)lucky players |
| 537 | + var/numagents = min(ertemplate.teamsize,candidates.len) |
| 538 | + |
| 539 | + //Create team |
| 540 | + var/datum/team/ert/ert_team = new ertemplate.team |
| 541 | + if(ertemplate.rename_team) |
| 542 | + ert_team.name = ertemplate.rename_team |
| 543 | + |
| 544 | + //Asign team objective |
| 545 | + var/datum/objective/missionobj = new |
| 546 | + missionobj.team = ert_team |
| 547 | + missionobj.explanation_text = ertemplate.mission |
| 548 | + missionobj.completed = TRUE |
| 549 | + ert_team.objectives += missionobj |
| 550 | + ert_team.mission = missionobj |
| 551 | + |
| 552 | + var/list/spawnpoints = GLOB.emergencyresponseteamspawn |
| 553 | + while(numagents && candidates.len) |
| 554 | + if (numagents > spawnpoints.len) |
| 555 | + numagents-- |
| 556 | + continue // This guy's unlucky, not enough spawn points, we skip him. |
| 557 | + var/spawnloc = spawnpoints[numagents] |
| 558 | + var/mob/dead/observer/chosen_candidate = pick(candidates) |
| 559 | + candidates -= chosen_candidate |
| 560 | + if(!chosen_candidate.key) |
| 561 | + continue |
| 562 | + |
| 563 | + //Spawn the body |
| 564 | + var/mob/living/carbon/human/ERTOperative = new ertemplate.mobtype(spawnloc) |
| 565 | + chosen_candidate.client.prefs.copy_to(ERTOperative) |
| 566 | + ERTOperative.key = chosen_candidate.key |
| 567 | + |
| 568 | + if(ertemplate.enforce_human || !(ERTOperative.dna.species.changesource_flags & ERT_SPAWN)) // Don't want any exploding plasmemes |
| 569 | + ERTOperative.set_species(/datum/species/human) |
| 570 | + |
| 571 | + //Give antag datum |
| 572 | + var/datum/antagonist/ert/ert_antag |
| 573 | + |
| 574 | + if(numagents == 1) |
| 575 | + ert_antag = new ertemplate.leader_role |
| 576 | + else |
| 577 | + ert_antag = ertemplate.roles[WRAP(numagents,1,length(ertemplate.roles) + 1)] |
| 578 | + ert_antag = new ert_antag |
| 579 | + |
| 580 | + ERTOperative.mind.add_antag_datum(ert_antag,ert_team) |
| 581 | + ERTOperative.mind.assigned_role = ert_antag.name |
| 582 | + |
| 583 | + // Equip uplink |
| 584 | + var/obj/item/upl = new ertemplate.uplinktype |
| 585 | + if(istype(upl)) |
| 586 | + ERTOperative.equip_to_slot_or_del(upl, SLOT_IN_BACKPACK) |
| 587 | + |
| 588 | + //Logging and cleanup |
| 589 | + //log_game("[key_name(ERTOperative)] has been selected as an [ert_antag.name]") | yogs - redundant |
| 590 | + numagents-- |
| 591 | + teamSpawned++ |
| 592 | + |
| 593 | + if (teamSpawned) |
| 594 | + message_admins("[ertemplate.polldesc] has spawned with the mission: [ertemplate.mission]") |
| 595 | + |
| 596 | + //Open the Armory doors |
| 597 | + if(ertemplate.opendoors) |
| 598 | + for(var/obj/machinery/door/poddoor/ert/door in GLOB.airlocks) |
| 599 | + INVOKE_ASYNC(door, /obj/machinery/door/poddoor.proc/open) |
| 600 | + |
| 601 | + //Open the Mech Bay |
| 602 | + if(ertemplate.openmech) |
| 603 | + for(var/obj/machinery/door/poddoor/deathsquad/door in GLOB.airlocks) |
| 604 | + INVOKE_ASYNC(door, /obj/machinery/door/poddoor.proc/open) |
| 605 | + return TRUE |
| 606 | + |
| 607 | + return FALSE |
| 608 | + |
494 | 609 | //Abductors |
495 | 610 | /datum/admins/proc/makeAbductorTeam() |
496 | 611 | new /datum/round_event/ghost_role/abductor |
|
0 commit comments