mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 22:47:59 +01:00
Removes heist mode & associated code (#17256)
This commit is contained in:
@@ -1,316 +0,0 @@
|
||||
/*
|
||||
VOX HEIST ROUNDTYPE
|
||||
*/
|
||||
GLOBAL_LIST_EMPTY(raider_spawn)
|
||||
GLOBAL_LIST_EMPTY(cortical_stacks) //Stacks for 'leave nobody behind' objective. Clumsy, rewrite sometime.
|
||||
|
||||
/datum/game_mode/
|
||||
var/list/datum/mind/raiders = list() //Antags.
|
||||
var/list/raid_objectives = list() //Raid objectives
|
||||
|
||||
/datum/game_mode/heist
|
||||
name = "heist"
|
||||
config_tag = "heist"
|
||||
required_players = 25
|
||||
required_enemies = 4
|
||||
recommended_enemies = 5
|
||||
votable = 0
|
||||
|
||||
var/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind' objective.
|
||||
var/win_button_triggered = 0
|
||||
|
||||
/datum/game_mode/heist/announce()
|
||||
to_chat(world, "<B>The current game mode is - Heist!</B>")
|
||||
to_chat(world, "<B>An unidentified bluespace signature has slipped past the Icarus and is approaching [station_name()]!</B>")
|
||||
to_chat(world, "Whoever they are, they're likely up to no good. Protect the crew and station resources against this dastardly threat!")
|
||||
to_chat(world, "<B>Raiders:</B> Loot [station_name()] for anything and everything you need, or choose the peaceful route and attempt to trade with them.")
|
||||
to_chat(world, "<B>Personnel:</B> Trade with the raiders, or repel them and their low, low prices and/or crossbows.")
|
||||
|
||||
/datum/game_mode/heist/can_start()
|
||||
|
||||
if(!..())
|
||||
return 0
|
||||
|
||||
var/list/candidates = get_players_for_role(ROLE_RAIDER)
|
||||
var/raider_num = 0
|
||||
|
||||
//Check that we have enough vox.
|
||||
if(candidates.len < required_enemies)
|
||||
return 0
|
||||
else if(candidates.len < recommended_enemies)
|
||||
raider_num = candidates.len
|
||||
else
|
||||
raider_num = recommended_enemies
|
||||
|
||||
//Grab candidates randomly until we have enough.
|
||||
while(raider_num > 0)
|
||||
var/datum/mind/new_raider = pick(candidates)
|
||||
raiders += new_raider
|
||||
candidates -= new_raider
|
||||
raider_num--
|
||||
|
||||
for(var/datum/mind/raider in raiders)
|
||||
raider.assigned_role = SPECIAL_ROLE_RAIDER
|
||||
raider.special_role = SPECIAL_ROLE_RAIDER
|
||||
raider.offstation_role = TRUE
|
||||
..()
|
||||
return 1
|
||||
|
||||
/datum/game_mode/heist/pre_setup()
|
||||
return 1
|
||||
|
||||
/datum/game_mode/heist/post_setup()
|
||||
|
||||
//Generate objectives for the group.
|
||||
raid_objectives = forge_vox_objectives()
|
||||
|
||||
var/index = 1
|
||||
|
||||
//Spawn the vox!
|
||||
for(var/datum/mind/raider in raiders)
|
||||
|
||||
if(index > GLOB.raider_spawn.len)
|
||||
index = 1
|
||||
|
||||
raider.current.loc = GLOB.raider_spawn[index]
|
||||
index++
|
||||
|
||||
create_vox(raider)
|
||||
greet_vox(raider)
|
||||
|
||||
if(raid_objectives)
|
||||
raider.objectives = raid_objectives
|
||||
|
||||
return ..()
|
||||
|
||||
/datum/game_mode/proc/create_vox(datum/mind/newraider)
|
||||
|
||||
var/sounds = rand(2,8)
|
||||
var/i = 0
|
||||
var/newname = ""
|
||||
|
||||
while(i<=sounds)
|
||||
i++
|
||||
newname += pick(list("ti","hi","ki","ya","ta","ha","ka","ya","chi","cha","kah"))
|
||||
|
||||
var/mob/living/carbon/human/vox = newraider.current
|
||||
var/obj/item/organ/external/head/head_organ = vox.get_organ("head")
|
||||
|
||||
vox.real_name = capitalize(newname)
|
||||
vox.dna.real_name = vox.real_name
|
||||
vox.name = vox.real_name
|
||||
newraider.name = vox.name
|
||||
vox.age = rand(12,20)
|
||||
vox.set_species(/datum/species/vox)
|
||||
vox.s_tone = rand(1, 6)
|
||||
vox.languages = list() // Removing language from chargen.
|
||||
vox.flavor_text = ""
|
||||
vox.add_language("Vox-pidgin")
|
||||
vox.add_language("Galactic Common")
|
||||
vox.add_language("Tradeband")
|
||||
head_organ.h_style = "Short Vox Quills"
|
||||
head_organ.f_style = "Shaved"
|
||||
vox.change_hair_color(97, 79, 25) //Same as the species default colour.
|
||||
vox.change_eye_color(rand(1, 255), rand(1, 255), rand(1, 255))
|
||||
vox.underwear = "Nude"
|
||||
vox.undershirt = "Nude"
|
||||
vox.socks = "Nude"
|
||||
|
||||
// Do the initial caching of the player's body icons.
|
||||
vox.force_update_limbs()
|
||||
vox.update_dna()
|
||||
vox.update_eyes()
|
||||
|
||||
for(var/obj/item/organ/external/limb in vox.bodyparts)
|
||||
limb.status &= ~ORGAN_ROBOT
|
||||
|
||||
//Now apply cortical stack.
|
||||
var/obj/item/implant/cortical/I = new(vox)
|
||||
I.implant(vox)
|
||||
GLOB.cortical_stacks += I
|
||||
|
||||
vox.equip_vox_raider()
|
||||
vox.regenerate_icons()
|
||||
|
||||
/datum/game_mode/proc/is_raider_crew_safe()
|
||||
if(GLOB.cortical_stacks.len == 0)
|
||||
return 0
|
||||
|
||||
for(var/obj/stack in GLOB.cortical_stacks)
|
||||
if(get_area(stack) != locate(/area/shuttle/vox) && get_area(stack) != locate(/area/vox_station))
|
||||
return 0 //this is stupid as fuck
|
||||
return 1
|
||||
|
||||
/datum/game_mode/proc/is_raider_crew_alive()
|
||||
for(var/datum/mind/raider in raiders)
|
||||
if(raider.current)
|
||||
if(istype(raider.current,/mob/living/carbon/human) && raider.current.stat != DEAD)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/game_mode/proc/forge_vox_objectives()
|
||||
var/i = 1
|
||||
var/max_objectives = pick(2,2,2,2,3,3,3,4)
|
||||
var/list/objs = list()
|
||||
var/list/goals = list("kidnap","loot","salvage")
|
||||
while(i<= max_objectives)
|
||||
var/goal = pick(goals)
|
||||
var/datum/objective/heist/O
|
||||
|
||||
if(goal == "kidnap")
|
||||
goals -= "kidnap"
|
||||
O = new /datum/objective/heist/kidnap()
|
||||
else if(goal == "loot")
|
||||
O = new /datum/objective/heist/loot()
|
||||
else
|
||||
O = new /datum/objective/heist/salvage()
|
||||
O.choose_target()
|
||||
objs += O
|
||||
|
||||
i++
|
||||
|
||||
//-All- vox raids have these two objectives. Failing them loses the game.
|
||||
objs += new /datum/objective/heist/inviolate_crew
|
||||
objs += new /datum/objective/heist/inviolate_death
|
||||
|
||||
return objs
|
||||
|
||||
/datum/game_mode/proc/greet_vox(datum/mind/raider)
|
||||
to_chat(raider.current, "<span class='boldnotice'>You are a Vox Raider, fresh from the Shoal!</span>")
|
||||
to_chat(raider.current, "<span class='notice'>The Vox are a race of cunning, sharp-eyed nomadic raiders and traders endemic to the frontier and much of the unexplored galaxy. You and the crew have come to the [station_name()] for plunder, trade or both.</span>")
|
||||
to_chat(raider.current, "<span class='notice'>Vox are cowardly and will flee from larger groups, but corner one or find them en masse and they are vicious.</span>")
|
||||
to_chat(raider.current, "<span class='notice'>Use :V to voxtalk, :H to talk on your encrypted channel, and don't forget to turn on your nitrogen internals!</span>")
|
||||
to_chat(raider.current, "<span class='notice'>Choose to accomplish your objectives by either raiding the crew and taking what you need, or by attempting to trade with them.</span>")
|
||||
to_chat(raider.current, "<span class='motd'>For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Vox_Raider)</span>")
|
||||
spawn(25)
|
||||
show_objectives(raider)
|
||||
|
||||
/datum/game_mode/heist/declare_completion()
|
||||
//No objectives, go straight to the feedback.
|
||||
if(!(raid_objectives.len)) return ..()
|
||||
|
||||
var/win_type = "Major"
|
||||
var/win_group = "Crew"
|
||||
var/win_msg = ""
|
||||
|
||||
var/success = raid_objectives.len
|
||||
|
||||
//Decrease success for failed objectives.
|
||||
for(var/datum/objective/O in raid_objectives)
|
||||
if(!(O.check_completion())) success--
|
||||
|
||||
//Set result by objectives.
|
||||
if(success == raid_objectives.len)
|
||||
win_type = "Major"
|
||||
win_group = "Vox"
|
||||
else if(success > 2)
|
||||
win_type = "Minor"
|
||||
win_group = "Vox"
|
||||
else
|
||||
win_type = "Minor"
|
||||
win_group = "Crew"
|
||||
|
||||
//Now we modify that result by the state of the vox crew.
|
||||
if(!is_raider_crew_alive())
|
||||
|
||||
win_type = "Major"
|
||||
win_group = "Crew"
|
||||
win_msg += "<B>The Vox Raiders have been wiped out!</B>"
|
||||
|
||||
else if(!is_raider_crew_safe())
|
||||
|
||||
if(win_group == "Crew" && win_type == "Minor")
|
||||
win_type = "Major"
|
||||
|
||||
win_group = "Crew"
|
||||
win_msg += "<B>The Vox Raiders have left someone behind!</B>"
|
||||
|
||||
else
|
||||
|
||||
if(win_group == "Vox")
|
||||
if(win_type == "Minor")
|
||||
|
||||
win_type = "Major"
|
||||
win_msg += "<B>The Vox Raiders escaped the station!</B>"
|
||||
else
|
||||
win_msg += "<B>The Vox Raiders were repelled!</B>"
|
||||
|
||||
to_chat(world, "<span class='warning'><FONT size = 3><B>[win_type] [win_group] victory!</B></FONT></span>")
|
||||
to_chat(world, "[win_msg]")
|
||||
SSticker.mode_result = "heist - [win_type] [win_group]"
|
||||
|
||||
var/count = 1
|
||||
for(var/datum/objective/objective in raid_objectives)
|
||||
if(objective.check_completion())
|
||||
to_chat(world, "<br><B>Objective #[count]</B>: [objective.explanation_text] <font color='green'><B>Success!</B></font>")
|
||||
SSblackbox.record_feedback("nested tally", "traitor_objective", 1, list("[objective.type]", "SUCCESS"))
|
||||
else
|
||||
to_chat(world, "<br><B>Objective #[count]</B>: [objective.explanation_text] <font color='red'>Fail.</font>")
|
||||
SSblackbox.record_feedback("nested tally", "traitor_objective", 1, list("[objective.type]", "FAIL"))
|
||||
count++
|
||||
|
||||
..()
|
||||
|
||||
/datum/game_mode/proc/auto_declare_completion_heist()
|
||||
if(raiders.len)
|
||||
var/check_return = 0
|
||||
if(GAMEMODE_IS_HEIST)
|
||||
check_return = 1
|
||||
var/text = "<FONT size = 2><B>The Vox raiders were:</B></FONT>"
|
||||
|
||||
for(var/datum/mind/vox in raiders)
|
||||
text += "<br>[vox.key] was [vox.name] ("
|
||||
if(check_return)
|
||||
var/obj/stack = raiders[vox]
|
||||
if(get_area(stack.loc) != locate(/area/shuttle/vox))
|
||||
text += "left behind)"
|
||||
continue
|
||||
if(vox.current)
|
||||
if(vox.current.stat == DEAD)
|
||||
text += "died"
|
||||
else
|
||||
text += "survived"
|
||||
if(vox.current.real_name != vox.name)
|
||||
text += " as [vox.current.real_name]"
|
||||
else
|
||||
text += "body destroyed"
|
||||
text += ")"
|
||||
|
||||
to_chat(world, text)
|
||||
|
||||
return 1
|
||||
|
||||
/datum/game_mode/heist/check_finished()
|
||||
if(!(is_raider_crew_alive()))
|
||||
return 1
|
||||
if(win_button_triggered)
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/vox_win_button
|
||||
name = "shoal contact computer"
|
||||
desc = "Used to contact the Vox Shoal, generally to arrange for pickup."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "tcstation"
|
||||
|
||||
/obj/machinery/vox_win_button/New()
|
||||
. = ..()
|
||||
overlays += icon('icons/obj/computer.dmi', "syndie")
|
||||
|
||||
/obj/machinery/vox_win_button/attack_hand(mob/user)
|
||||
if(!GAMEMODE_IS_HEIST || (world.time < 10 MINUTES)) //has to be heist, and at least ten minutes into the round
|
||||
to_chat(user, "<span class='warning'>\The [src] does not appear to have a connection.</span>")
|
||||
return 0
|
||||
|
||||
if(alert(user, "Warning: This will end the round. Are you sure you wish to end the round?", "Vox End", "Yes", "No") == "No")
|
||||
return 0
|
||||
|
||||
if(alert(user, "Are you *absolutely* sure you want to end the round?", "!!WARNING!!", "Yes", "No") == "No")
|
||||
return 0
|
||||
|
||||
message_admins("[key_name_admin(user)] has pressed the vox win button.")
|
||||
log_admin("[key_name(user)] pressed the vox win button during a vox round.")
|
||||
|
||||
var/datum/game_mode/heist/H = SSticker.mode
|
||||
H.win_button_triggered = 1
|
||||
@@ -619,219 +619,6 @@ GLOBAL_LIST_INIT(potential_theft_objectives, (subtypesof(/datum/theft_objective)
|
||||
else
|
||||
return 0
|
||||
|
||||
// /vg/; Vox Inviolate for humans :V
|
||||
/datum/objective/minimize_casualties
|
||||
explanation_text = "Minimise casualties."
|
||||
|
||||
/datum/objective/minimize_casualties/check_completion()
|
||||
return TRUE
|
||||
|
||||
|
||||
//Vox heist objectives.
|
||||
|
||||
/datum/objective/heist
|
||||
/datum/objective/heist/proc/choose_target()
|
||||
return
|
||||
|
||||
/datum/objective/heist/kidnap
|
||||
/datum/objective/heist/kidnap/choose_target()
|
||||
var/list/roles = list("Chief Engineer","Research Director","Roboticist","Chemist","Station Engineer")
|
||||
var/list/possible_targets = list()
|
||||
var/list/priority_targets = list()
|
||||
|
||||
for(var/datum/mind/possible_target in SSticker.minds)
|
||||
if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != DEAD) && (possible_target.assigned_role != possible_target.special_role) && !possible_target.offstation_role)
|
||||
possible_targets += possible_target
|
||||
for(var/role in roles)
|
||||
if(possible_target.assigned_role == role)
|
||||
priority_targets += possible_target
|
||||
continue
|
||||
|
||||
if(priority_targets.len > 0)
|
||||
target = pick(priority_targets)
|
||||
else if(possible_targets.len > 0)
|
||||
target = pick(possible_targets)
|
||||
|
||||
if(target && target.current)
|
||||
explanation_text = "The Shoal has a need for [target.current.real_name], the [target.assigned_role]. Take [target.current.p_them()] alive."
|
||||
else
|
||||
explanation_text = "Free Objective"
|
||||
return target
|
||||
|
||||
/datum/objective/heist/kidnap/check_completion()
|
||||
if(target && target.current)
|
||||
if(target.current.stat == DEAD)
|
||||
return 0
|
||||
|
||||
var/area/shuttle/vox/A = locate() //stupid fucking hardcoding
|
||||
var/area/vox_station/B = locate() //but necessary
|
||||
|
||||
for(var/mob/living/carbon/human/M in A)
|
||||
if(target.current == M)
|
||||
return 1
|
||||
for(var/mob/living/carbon/human/M in B)
|
||||
if(target.current == M)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/datum/objective/heist/loot
|
||||
/datum/objective/heist/loot/choose_target()
|
||||
var/loot = "an object"
|
||||
switch(rand(1,8))
|
||||
if(1)
|
||||
target = /obj/structure/particle_accelerator
|
||||
target_amount = 6
|
||||
loot = "a complete particle accelerator"
|
||||
if(2)
|
||||
target = /obj/machinery/the_singularitygen
|
||||
target_amount = 1
|
||||
loot = "a gravitational singularity generator"
|
||||
if(3)
|
||||
target = /obj/machinery/power/emitter
|
||||
target_amount = 4
|
||||
loot = "four emitters"
|
||||
if(4)
|
||||
target = /obj/machinery/nuclearbomb
|
||||
target_amount = 1
|
||||
loot = "a nuclear bomb"
|
||||
if(5)
|
||||
target = /obj/item/gun
|
||||
target_amount = 6
|
||||
loot = "six guns. Tasers and other non-lethal guns are acceptable"
|
||||
if(6)
|
||||
target = /obj/item/gun/energy
|
||||
target_amount = 4
|
||||
loot = "four energy guns"
|
||||
if(7)
|
||||
target = /obj/item/gun/energy/laser
|
||||
target_amount = 2
|
||||
loot = "two laser guns"
|
||||
if(8)
|
||||
target = /obj/item/gun/energy/ionrifle
|
||||
target_amount = 1
|
||||
loot = "an ion gun"
|
||||
|
||||
explanation_text = "We are lacking in hardware. Steal or trade [loot]."
|
||||
|
||||
/datum/objective/heist/loot/check_completion()
|
||||
var/total_amount = 0
|
||||
|
||||
for(var/obj/O in locate(/area/shuttle/vox))
|
||||
if(istype(O, target))
|
||||
total_amount++
|
||||
for(var/obj/I in O.contents)
|
||||
if(istype(I, target))
|
||||
total_amount++
|
||||
if(total_amount >= target_amount)
|
||||
return 1
|
||||
|
||||
for(var/obj/O in locate(/area/vox_station))
|
||||
if(istype(O, target))
|
||||
total_amount++
|
||||
for(var/obj/I in O.contents)
|
||||
if(istype(I, target))
|
||||
total_amount++
|
||||
if(total_amount >= target_amount)
|
||||
return 1
|
||||
|
||||
var/datum/game_mode/heist/H = SSticker.mode
|
||||
for(var/datum/mind/raider in H.raiders)
|
||||
if(raider.current)
|
||||
for(var/obj/O in raider.current.get_contents())
|
||||
if(istype(O,target))
|
||||
total_amount++
|
||||
if(total_amount >= target_amount)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/datum/objective/heist/salvage
|
||||
/datum/objective/heist/salvage/choose_target()
|
||||
switch(rand(1,8))
|
||||
if(1)
|
||||
target = "metal"
|
||||
target_amount = 300
|
||||
if(2)
|
||||
target = "glass"
|
||||
target_amount = 200
|
||||
if(3)
|
||||
target = "plasteel"
|
||||
target_amount = 100
|
||||
if(4)
|
||||
target = "solid plasma"
|
||||
target_amount = 100
|
||||
if(5)
|
||||
target = "silver"
|
||||
target_amount = 50
|
||||
if(6)
|
||||
target = "gold"
|
||||
target_amount = 20
|
||||
if(7)
|
||||
target = "uranium"
|
||||
target_amount = 20
|
||||
if(8)
|
||||
target = "diamond"
|
||||
target_amount = 20
|
||||
|
||||
explanation_text = "Ransack or trade with the station and escape with [target_amount] [target]."
|
||||
|
||||
/datum/objective/heist/salvage/check_completion()
|
||||
var/total_amount = 0
|
||||
|
||||
for(var/obj/item/O in locate(/area/shuttle/vox))
|
||||
var/obj/item/stack/sheet/S
|
||||
if(istype(O,/obj/item/stack/sheet))
|
||||
if(O.name == target)
|
||||
S = O
|
||||
total_amount += S.get_amount()
|
||||
|
||||
for(var/obj/I in O.contents)
|
||||
if(istype(I,/obj/item/stack/sheet))
|
||||
if(I.name == target)
|
||||
S = I
|
||||
total_amount += S.get_amount()
|
||||
|
||||
for(var/obj/item/O in locate(/area/vox_station))
|
||||
var/obj/item/stack/sheet/S
|
||||
if(istype(O,/obj/item/stack/sheet))
|
||||
if(O.name == target)
|
||||
S = O
|
||||
total_amount += S.get_amount()
|
||||
|
||||
for(var/obj/I in O.contents)
|
||||
if(istype(I,/obj/item/stack/sheet))
|
||||
if(I.name == target)
|
||||
S = I
|
||||
total_amount += S.get_amount()
|
||||
|
||||
var/datum/game_mode/heist/H = SSticker.mode
|
||||
for(var/datum/mind/raider in H.raiders)
|
||||
if(raider.current)
|
||||
for(var/obj/item/O in raider.current.get_contents())
|
||||
if(istype(O,/obj/item/stack/sheet))
|
||||
if(O.name == target)
|
||||
var/obj/item/stack/sheet/S = O
|
||||
total_amount += S.get_amount()
|
||||
|
||||
if(total_amount >= target_amount) return 1
|
||||
return 0
|
||||
|
||||
|
||||
/datum/objective/heist/inviolate_crew
|
||||
explanation_text = "Do not leave any Vox behind, alive or dead."
|
||||
|
||||
/datum/objective/heist/inviolate_crew/check_completion()
|
||||
var/datum/game_mode/heist/H = SSticker.mode
|
||||
if(H.is_raider_crew_safe())
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/objective/heist/inviolate_death
|
||||
explanation_text = "Follow the Inviolate. Minimise death and loss of resources."
|
||||
|
||||
/datum/objective/heist/inviolate_death/check_completion()
|
||||
return TRUE
|
||||
|
||||
// Traders
|
||||
// These objectives have no check_completion, they exist only to tell Sol Traders what to aim for.
|
||||
|
||||
Reference in New Issue
Block a user