mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Adds abductor event
Adds event gamemode white/blacklist Moves and renames some helper procs Some QoL for baton
This commit is contained in:
@@ -380,3 +380,53 @@
|
||||
|
||||
return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y)
|
||||
|
||||
/proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck)
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/time_passed = world.time
|
||||
if (!Question)
|
||||
Question = "Would you like to be a special role?"
|
||||
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(!G.key || !G.client)
|
||||
continue
|
||||
if (gametypeCheck)
|
||||
if(!gametypeCheck.age_check(G.client))
|
||||
continue
|
||||
if (jobbanType)
|
||||
if(jobban_isbanned(G, jobbanType) || jobban_isbanned(G, "Syndicate"))
|
||||
continue
|
||||
spawn(0)
|
||||
G << 'sound/misc/notice2.ogg' //Alerting them to their consideration
|
||||
switch(alert(G,Question,"Please answer in 30 seconds!","Yes","No"))
|
||||
if("Yes")
|
||||
G << "<span class='notice'>Choice registered: Yes.</span>"
|
||||
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
|
||||
G << "<span class='danger'>Sorry, you were too late for the consideration!</span>"
|
||||
G << 'sound/machines/buzz-sigh.ogg'
|
||||
return
|
||||
candidates += G
|
||||
if("No")
|
||||
G << "<span class='danger'>Choice registered: No.</span>"
|
||||
return
|
||||
else
|
||||
return
|
||||
sleep(300)
|
||||
|
||||
//Check all our candidates, to make sure they didn't log off during the 30 second wait period.
|
||||
for(var/mob/dead/observer/G in candidates)
|
||||
if(!G.key || !G.client)
|
||||
candidates.Remove(G)
|
||||
|
||||
return candidates
|
||||
|
||||
/proc/makeBody(mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
|
||||
if(!G_found || !G_found.key) return
|
||||
|
||||
//First we spawn a dude.
|
||||
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
|
||||
|
||||
G_found.client.prefs.copy_to(new_character)
|
||||
ready_dna(new_character)
|
||||
new_character.key = G_found.key
|
||||
|
||||
return new_character
|
||||
@@ -64,6 +64,8 @@ var/datum/subsystem/events/SSevent
|
||||
for(var/datum/round_event_control/E in control)
|
||||
if(E.occurrences >= E.max_occurrences) continue
|
||||
if(E.earliest_start >= world.time) continue
|
||||
if(ticker.mode.config_tag in E.gamemode_blacklist) continue
|
||||
if(E.gamemode_whitelist && !(ticker.mode.config_tag in E.gamemode_whitelist)) continue
|
||||
if(E.holidayID)
|
||||
if(!holidays || !holidays[E.holidayID]) continue
|
||||
if(E.weight < 0) //for round-start events etc.
|
||||
|
||||
@@ -460,11 +460,16 @@ Congratulations! You are now trained for xenobiology research!"}
|
||||
/obj/item/weapon/abductor_baton/proc/SleepAttack(mob/living/L,mob/living/user)
|
||||
if(L.stunned)
|
||||
L.SetSleeping(60)
|
||||
L.visible_message("<span class='danger'>[user] has induced sleep in [L] with [src]!</span>", \
|
||||
L.visible_message("<span class='danger'>[user] has induced sleep in [L] with [src]!</span>", \
|
||||
"<span class='userdanger'>You suddenly feel very drowsy!</span>")
|
||||
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
|
||||
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
|
||||
|
||||
add_logs(user, L, "put to sleep")
|
||||
add_logs(user, L, "put to sleep")
|
||||
else
|
||||
L.drowsyness += 1
|
||||
user << "<span class='warning'>Sleep inducement works fully only on stunned specimens! </span>"
|
||||
L.visible_message("<span class='danger'>[user] tried to induce sleep in [L] with [src]!</span>", \
|
||||
"<span class='userdanger'>You suddenly feel drowsy!</span>")
|
||||
return
|
||||
|
||||
/obj/item/weapon/abductor_baton/proc/CuffAttack(mob/living/L,mob/living/user)
|
||||
@@ -490,13 +495,22 @@ Congratulations! You are now trained for xenobiology research!"}
|
||||
"<span class='userdanger'>[user] probes you!</span>")
|
||||
|
||||
var/species = "<span class='warning'>Unknown species</span>"
|
||||
var/helptext = "<span class='warning'>Species unsuitable for experiments.</span>"
|
||||
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
if(H.dna && H.dna.species)
|
||||
species = "<span clas=='notice'>[H.dna.species.name]</span>"
|
||||
if(L.mind && L.mind.changeling)
|
||||
species = "<span class='warning'>Changeling lifeform</span>"
|
||||
var/obj/item/organ/internal/gland/temp = locate() in H.internal_organs
|
||||
if(temp)
|
||||
helptext = "<span class='warning'>Experimental gland detected!</span>"
|
||||
else
|
||||
helptext = "<span class='notice'>Subject suitable for experiments.</span>"
|
||||
|
||||
user << "<span class='notice'>Probing result:</span>[species]"
|
||||
user << "[helptext]"
|
||||
|
||||
/obj/item/weapon/restraints/handcuffs/energy
|
||||
name = "hard-light energy field"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
GrantActions(user)
|
||||
current_user = user
|
||||
eyeobj.user = user
|
||||
eyeobj.name = "Camere Eye ([user.name])"
|
||||
eyeobj.name = "Camera Eye ([user.name])"
|
||||
L.remote_view = 1
|
||||
L.remote_control = eyeobj
|
||||
L.client.perspective = EYE_PERSPECTIVE
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
/datum/admins/proc/makeNukeTeam()
|
||||
|
||||
var/datum/game_mode/nuclear/temp = new
|
||||
var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for a nuke team being sent in?", "operative", temp)
|
||||
var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for a nuke team being sent in?", "operative", temp)
|
||||
var/list/mob/dead/observer/chosen = list()
|
||||
var/mob/dead/observer/theghost = null
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
// DEATH SQUADS
|
||||
/datum/admins/proc/makeDeathsquad()
|
||||
var/mission = input("Assign a mission to the deathsquad", "Assign Mission", "Leave no witnesses.")
|
||||
var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for an elite Nanotrasen Strike Team?", "deathsquad", null)
|
||||
var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for an elite Nanotrasen Strike Team?", "deathsquad", null)
|
||||
var/squadSpawned = 0
|
||||
|
||||
if(candidates.len >= 2) //Minimum 2 to be considered a squad
|
||||
@@ -413,7 +413,7 @@
|
||||
|
||||
/datum/admins/proc/makeOfficial()
|
||||
var/mission = input("Assign a task for the official", "Assign Task", "Conduct a routine preformance review of [station_name()] and its Captain.")
|
||||
var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered to be a Centcom Official?", "pAI")
|
||||
var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered to be a Centcom Official?", "pAI")
|
||||
|
||||
if(candidates.len)
|
||||
var/mob/dead/observer/chosen_candidate = pick(candidates)
|
||||
@@ -466,7 +466,7 @@
|
||||
return makeOfficial()
|
||||
var/teamsize = min(7,input("Maximum size of team? (7 max)", "Select Team Size",4) as null|num)
|
||||
var/mission = input("Assign a mission to the Emergency Response Team", "Assign Mission", "Assist the station.")
|
||||
var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for a Code [alert] Nanotrasen Emergency Response Team?", "deathsquad", null)
|
||||
var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for a Code [alert] Nanotrasen Emergency Response Team?", "deathsquad", null)
|
||||
var/teamSpawned = 0
|
||||
|
||||
if(candidates.len > 0)
|
||||
@@ -559,50 +559,11 @@
|
||||
|
||||
//Abductors
|
||||
/datum/admins/proc/makeAbductorTeam()
|
||||
var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for an Abductor Team?", "abductor", null)
|
||||
|
||||
if(candidates.len >= 2)
|
||||
//Oh god why we can't have static functions
|
||||
var/number = ticker.mode.abductor_teams + 1
|
||||
|
||||
var/datum/game_mode/abduction/temp
|
||||
if(ticker.mode.config_tag == "abduction")
|
||||
temp = ticker.mode
|
||||
else
|
||||
temp = new
|
||||
|
||||
var/agent_mind = pick(candidates)
|
||||
candidates -= agent_mind
|
||||
var/scientist_mind = pick(candidates)
|
||||
|
||||
var/mob/living/carbon/human/agent=makeBody(agent_mind)
|
||||
var/mob/living/carbon/human/scientist=makeBody(scientist_mind)
|
||||
|
||||
agent_mind = agent.mind
|
||||
scientist_mind = scientist.mind
|
||||
|
||||
temp.scientists.len = number
|
||||
temp.agents.len = number
|
||||
temp.abductors.len = 2*number
|
||||
temp.team_objectives.len = number
|
||||
temp.team_names.len = number
|
||||
temp.scientists[number] = scientist_mind
|
||||
temp.agents[number] = agent_mind
|
||||
temp.abductors |= list(agent_mind,scientist_mind)
|
||||
temp.make_abductor_team(number,preset_scientist=scientist_mind,preset_agent=agent_mind)
|
||||
temp.post_setup_team(number)
|
||||
|
||||
ticker.mode.abductor_teams++
|
||||
|
||||
if(ticker.mode.config_tag != "abduction")
|
||||
ticker.mode.abductors |= temp.abductors
|
||||
|
||||
return 1
|
||||
else
|
||||
return
|
||||
new /datum/round_event/abductor
|
||||
return 1
|
||||
|
||||
/datum/admins/proc/makeRevenant()
|
||||
var/list/mob/dead/observer/candidates = getCandidates("Do you wish to be considered for becoming a revenant?", "revenant", null)
|
||||
var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for becoming a revenant?", "revenant", null)
|
||||
if(candidates.len >= 1)
|
||||
var/spook_op = pick(candidates)
|
||||
var/mob/dead/observer/O = spook_op
|
||||
@@ -644,54 +605,3 @@
|
||||
candidates.Remove(H)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/admins/proc/getCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck)
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/time_passed = world.time
|
||||
if (!Question)
|
||||
Question = "Would you like to be a special role?"
|
||||
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(!G.key || !G.client)
|
||||
continue
|
||||
if (gametypeCheck)
|
||||
if(!gametypeCheck.age_check(G.client))
|
||||
continue
|
||||
if (jobbanType)
|
||||
if(jobban_isbanned(G, jobbanType) || jobban_isbanned(G, "Syndicate"))
|
||||
continue
|
||||
spawn(0)
|
||||
G << 'sound/misc/notice2.ogg' //Alerting them to their consideration
|
||||
switch(alert(G,Question,"Please answer in 30 seconds!","Yes","No"))
|
||||
if("Yes")
|
||||
G << "<span class='notice'>Choice registered: Yes.</span>"
|
||||
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
|
||||
G << "<span class='danger'>Sorry, you were too late for the consideration!</span>"
|
||||
G << 'sound/machines/buzz-sigh.ogg'
|
||||
return
|
||||
candidates += G
|
||||
if("No")
|
||||
G << "<span class='danger'>Choice registered: No.</span>"
|
||||
return
|
||||
else
|
||||
return
|
||||
sleep(300)
|
||||
|
||||
//Check all our candidates, to make sure they didn't log off during the 30 second wait period.
|
||||
for(var/mob/dead/observer/G in candidates)
|
||||
if(!G.key || !G.client)
|
||||
candidates.Remove(G)
|
||||
|
||||
return candidates
|
||||
|
||||
/datum/admins/proc/makeBody(mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
|
||||
if(!G_found || !G_found.key) return
|
||||
|
||||
//First we spawn a dude.
|
||||
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
|
||||
|
||||
G_found.client.prefs.copy_to(new_character)
|
||||
ready_dna(new_character)
|
||||
new_character.key = G_found.key
|
||||
|
||||
return new_character
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
var/alertadmins = 1 //should we let the admins know this event is firing
|
||||
//should be disabled on events that fire a lot
|
||||
|
||||
var/gamemode_blacklist = list() // Event won't happen in these gamemodes
|
||||
var/gamemode_whitelist = list() // Event will happen ONLY in these gamemodes if not empty
|
||||
|
||||
/datum/round_event_control/wizard
|
||||
wizardevent = 1
|
||||
|
||||
|
||||
@@ -950,6 +950,7 @@
|
||||
#include "code\modules\detectivework\footprints_and_rag.dm"
|
||||
#include "code\modules\detectivework\scanner.dm"
|
||||
#include "code\modules\emoji\emoji_parse.dm"
|
||||
#include "code\modules\events\abductor.dm"
|
||||
#include "code\modules\events\alien_infestation.dm"
|
||||
#include "code\modules\events\anomaly.dm"
|
||||
#include "code\modules\events\anomaly_bluespace.dm"
|
||||
|
||||
Reference in New Issue
Block a user