This commit is contained in:
Ghommie
2020-04-21 01:53:41 +02:00
332 changed files with 1368 additions and 761 deletions
@@ -200,39 +200,3 @@
to_chat(resident, "<span class='notice'>You fix the mechanism and lock it.</span>")
broken = FALSE
locked = TRUE
// Look up recipes.dm OR pneumaticCannon.dm
/datum/crafting_recipe/bloodsucker/blackcoffin
name = "Black Coffin"
result = /obj/structure/closet/crate/coffin/blackcoffin
tools = list(/obj/item/weldingtool,
/obj/item/screwdriver)
reqs = list(/obj/item/stack/sheet/cloth = 1,
/obj/item/stack/sheet/mineral/wood = 5,
/obj/item/stack/sheet/metal = 1)
///obj/item/stack/packageWrap = 8,
///obj/item/pipe = 2)
time = 150
category = CAT_MISC
always_availible = TRUE
/datum/crafting_recipe/bloodsucker/meatcoffin
name = "Meat Coffin"
result =/obj/structure/closet/crate/coffin/meatcoffin
tools = list(/obj/item/kitchen/knife,
/obj/item/kitchen/rollingpin)
reqs = list(/obj/item/reagent_containers/food/snacks/meat/slab = 5,
/obj/item/restraints/handcuffs/cable = 1)
time = 150
category = CAT_MISC
always_availible = TRUE
/datum/crafting_recipe/bloodsucker/metalcoffin
name = "Metal Coffin"
result =/obj/structure/closet/crate/coffin/metalcoffin
tools = list(/obj/item/weldingtool,
/obj/item/screwdriver)
reqs = list(/obj/item/stack/sheet/metal = 5)
time = 100
category = CAT_MISC
always_availible = TRUE
@@ -16,3 +16,6 @@
/datum/traitor_class/human/hijack/finalize_traitor(datum/antagonist/traitor/T)
T.hijack_speed=1
return TRUE
/datum/traitor_class/human/hijack/clean_up_traitor(datum/antagonist/traitor/T)
T.hijack_speed = 0.5
@@ -38,3 +38,7 @@ GLOBAL_LIST_EMPTY(traitor_classes)
/datum/traitor_class/proc/finalize_traitor(datum/antagonist/traitor/T)
// Finalization. Return TRUE if should play standard traitor sound/equip, return FALSE if both are special case
return TRUE
/datum/traitor_class/proc/clean_up_traitor(datum/antagonist/traitor/T)
// Any effects that need to be cleaned up if traitor class is being swapped.
@@ -15,36 +15,53 @@
threat = 5
/datum/antagonist/traitor/New()
..()
if(!GLOB.traitor_classes.len)//Only need to fill the list when it's needed.
for(var/I in subtypesof(/datum/traitor_class))
new I
..()
/datum/antagonist/traitor/proc/set_traitor_kind(var/kind)
/datum/antagonist/traitor/proc/set_traitor_kind(kind)
var/swap_from_old = FALSE
if(traitor_kind)
traitor_kind.remove_innate_effects(owner.current)
traitor_kind.clean_up_traitor(src)
swap_from_old = TRUE
traitor_kind = GLOB.traitor_classes[kind]
traitor_kind.apply_innate_effects(owner.current)
if(give_objectives)
for(var/O in objectives)
qdel(O)
traitor_kind.forge_objectives(src)
if(swap_from_old)
traitor_kind.finalize_traitor(src)
traitor_kind.greet(src)
owner.announce_objectives()
/proc/get_random_traitor_kind(var/list/blacklist = list())
var/chaos_weight = 0
if(istype(SSticker.mode,/datum/game_mode/dynamic))
var/datum/game_mode/dynamic/mode = SSticker.mode
chaos_weight = (mode.threat - 50)/50
var/list/weights = list()
for(var/C in GLOB.traitor_classes)
if(!(C in blacklist))
var/datum/traitor_class/class = GLOB.traitor_classes[C]
var/weight = LOGISTIC_FUNCTION(1.5*class.weight,chaos_weight,class.chaos,0)
weights[C] = weight * 1000
var/choice = pickweightAllowZero(weights)
if(!choice)
choice = TRAITOR_HUMAN // it's an "easter egg"
var/datum/traitor_class/actual_class = GLOB.traitor_classes[choice]
actual_class.weight *= 0.8 // less likely this round
return choice
/datum/antagonist/traitor/on_gain()
if(owner.current && isAI(owner.current))
set_traitor_kind(TRAITOR_AI)
else
var/chaos_weight = 0
if(istype(SSticker.mode,/datum/game_mode/dynamic))
var/datum/game_mode/dynamic/mode = SSticker.mode
chaos_weight = (mode.threat - 50)/50
var/list/weights = list()
for(var/C in GLOB.traitor_classes)
var/datum/traitor_class/class = GLOB.traitor_classes[C]
var/weight = LOGISTIC_FUNCTION(1.5*class.weight,chaos_weight,class.chaos,0)
weights[C] = weight
var/choice = pickweightAllowZero(weights)
if(!choice)
choice = GLOB.traitor_classes[TRAITOR_HUMAN] // it's an "easter egg"
set_traitor_kind(choice)
traitor_kind.weight *= 0.8 // less likely this round
set_traitor_kind(get_random_traitor_kind())
SSticker.mode.traitors += owner
owner.special_role = special_role
if(give_objectives)
traitor_kind.forge_objectives(src)
finalize_traitor()
..()
@@ -97,7 +114,8 @@
owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/tatoralert.ogg', 100, FALSE, pressure_affected = FALSE)
/datum/antagonist/traitor/antag_panel_objectives()
. = ..()
. += "<i><b>Traitor class:</b></i> <a href='?src=[REF(owner)];traitor_class=1;target_antag=[REF(src)]'>[traitor_kind.employer]</a><br>"
. += ..()
if(contractor_hub?.assigned_targets && length(contractor_hub.assigned_targets))
. += "<i><b>Contract Targets</b></i>:<br>"
for(var/datum/mind/M in contractor_hub.assigned_targets)