Original Port
This commit is contained in:
@@ -242,6 +242,69 @@
|
||||
log_game("DYNAMIC: [key_name(M)] was selected by the [name] ruleset and has been made into a midround traitor.")
|
||||
return TRUE
|
||||
|
||||
//////////////////////////////////////////////
|
||||
// //
|
||||
// FAMILIES //
|
||||
// //
|
||||
//////////////////////////////////////////////
|
||||
|
||||
/datum/dynamic_ruleset/midround/families
|
||||
name = "Family Head Aspirants"
|
||||
persistent = TRUE
|
||||
antag_datum = /datum/antagonist/gang
|
||||
antag_flag = ROLE_FAMILY_HEAD_ASPIRANT
|
||||
antag_flag_override = ROLE_FAMILIES
|
||||
protected_roles = list("Prisoner", "Head of Personnel")
|
||||
restricted_roles = list("Cyborg", "AI", "Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Research Director")
|
||||
required_candidates = 9
|
||||
weight = 2
|
||||
cost = 19
|
||||
requirements = list(101,101,40,40,30,20,10,10,10,10)
|
||||
flags = HIGH_IMPACT_RULESET
|
||||
blocking_rules = list(/datum/dynamic_ruleset/roundstart/families)
|
||||
/// A reference to the handler that is used to run pre_execute(), execute(), etc..
|
||||
var/datum/gang_handler/handler
|
||||
|
||||
/datum/dynamic_ruleset/midround/families/trim_candidates()
|
||||
..()
|
||||
candidates = living_players
|
||||
for(var/mob/living/player in candidates)
|
||||
if(issilicon(player))
|
||||
candidates -= player
|
||||
else if(is_centcom_level(player.z))
|
||||
candidates -= player
|
||||
else if(player.mind && (player.mind.special_role || player.mind.antag_datums?.len > 0))
|
||||
candidates -= player
|
||||
else if(HAS_TRAIT(player, TRAIT_MINDSHIELD))
|
||||
candidates -= player
|
||||
|
||||
|
||||
/datum/dynamic_ruleset/midround/families/ready(forced = FALSE)
|
||||
if (required_candidates > living_players.len)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/dynamic_ruleset/midround/families/pre_execute()
|
||||
..()
|
||||
handler = new /datum/gang_handler(candidates,restricted_roles)
|
||||
handler.gang_balance_cap = clamp((indice_pop - 3), 2, 5) // gang_balance_cap by indice_pop: (2,2,2,2,2,3,4,5,5,5)
|
||||
handler.midround_ruleset = TRUE
|
||||
handler.use_dynamic_timing = TRUE
|
||||
return handler.pre_setup_analogue()
|
||||
|
||||
/datum/dynamic_ruleset/midround/families/execute()
|
||||
return handler.post_setup_analogue(TRUE)
|
||||
|
||||
/datum/dynamic_ruleset/midround/families/clean_up()
|
||||
QDEL_NULL(handler)
|
||||
..()
|
||||
|
||||
/datum/dynamic_ruleset/midround/families/rule_process()
|
||||
return handler.process_analogue()
|
||||
|
||||
/datum/dynamic_ruleset/midround/families/round_result()
|
||||
return handler.set_round_result_analogue()
|
||||
|
||||
//////////////////////////////////////////////
|
||||
// //
|
||||
// Malfunctioning AI //
|
||||
|
||||
@@ -1227,6 +1227,74 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/// Gangster secret handshakes.
|
||||
/obj/item/slapper/secret_handshake
|
||||
name = "Secret Handshake"
|
||||
icon_state = "recruit"
|
||||
icon = 'icons/obj/gang/actions.dmi'
|
||||
/// References the active families gamemode handler (if one exists), for adding new family members to.
|
||||
var/datum/gang_handler/handler
|
||||
/// The typepath of the gang antagonist datum that the person who uses the package should have added to them -- remember that the distinction between e.g. Ballas and Grove Street is on the antag datum level, not the team datum level.
|
||||
var/gang_to_use
|
||||
/// The team datum that the person who uses this package should be added to.
|
||||
var/datum/team/gang/team_to_use
|
||||
|
||||
|
||||
/// Adds the user to the family that this package corresponds to, dispenses the free_clothes of that family, and adds them to the handler if it exists.
|
||||
/obj/item/slapper/secret_handshake/proc/add_to_gang(mob/living/user, original_name)
|
||||
var/datum/antagonist/gang/swappin_sides = new gang_to_use()
|
||||
swappin_sides.original_name = original_name
|
||||
swappin_sides.handler = handler
|
||||
user.mind.add_antag_datum(swappin_sides, team_to_use)
|
||||
var/policy = get_policy(ROLE_FAMILIES)
|
||||
if(policy)
|
||||
to_chat(user, policy)
|
||||
team_to_use.add_member(user.mind)
|
||||
swappin_sides.equip_gangster_in_inventory()
|
||||
if (!isnull(handler) && !handler.gangbangers.Find(user.mind)) // if we have a handler and they're not tracked by it
|
||||
handler.gangbangers += user.mind
|
||||
|
||||
/// Checks if the user is trying to use the package of the family they are in, and if not, adds them to the family, with some differing processing depending on whether the user is already a family member.
|
||||
/obj/item/slapper/secret_handshake/proc/attempt_join_gang(mob/living/user)
|
||||
if(!user?.mind)
|
||||
return
|
||||
var/datum/antagonist/gang/is_gangster = user.mind.has_antag_datum(/datum/antagonist/gang)
|
||||
var/real_name_backup = user.real_name
|
||||
if(is_gangster)
|
||||
if(is_gangster.my_gang == team_to_use)
|
||||
return
|
||||
real_name_backup = is_gangster.original_name
|
||||
is_gangster.my_gang.remove_member(user.mind)
|
||||
user.mind.remove_antag_datum(/datum/antagonist/gang)
|
||||
add_to_gang(user, real_name_backup)
|
||||
|
||||
/obj/item/slapper/secret_handshake/on_offer_taken(mob/living/carbon/offerer, mob/living/carbon/taker)
|
||||
. = TRUE
|
||||
if (!(null in taker.held_items))
|
||||
to_chat(taker, span_warning("You can't get taught the secret handshake if [offerer] has no free hands!"))
|
||||
return
|
||||
|
||||
if(HAS_TRAIT(taker, TRAIT_MINDSHIELD))
|
||||
to_chat(taker, "You attended a seminar on not signing up for a gang and are not interested.")
|
||||
return
|
||||
|
||||
var/datum/antagonist/gang/is_gangster = taker.mind.has_antag_datum(/datum/antagonist/gang)
|
||||
if(is_gangster?.starter_gangster)
|
||||
if(is_gangster.my_gang == team_to_use)
|
||||
to_chat(taker, "You started your family. You don't need to join it.")
|
||||
return
|
||||
to_chat(taker, "You started your family. You can't turn your back on it now.")
|
||||
return
|
||||
|
||||
offerer.visible_message(span_notice("[taker] is taught the secret handshake by [offerer]!"), span_nicegreen("All right! You've taught the secret handshake to [taker]!"), span_hear("You hear a bunch of weird shuffling and flesh slapping sounds!"), ignored_mobs=taker)
|
||||
to_chat(taker, span_nicegreen("You get taught the secret handshake by [offerer]!"))
|
||||
var/datum/antagonist/gang/owner_gang_datum = offerer.mind.has_antag_datum(/datum/antagonist/gang)
|
||||
handler = owner_gang_datum.handler
|
||||
gang_to_use = owner_gang_datum.type
|
||||
team_to_use = owner_gang_datum.my_gang
|
||||
attempt_join_gang(taker)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/extendohand
|
||||
name = "extendo-hand"
|
||||
desc = "Futuristic tech has allowed these classic spring-boxing toys to essentially act as a fully functional hand-operated hand prosthetic."
|
||||
@@ -1261,7 +1329,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
// attack_verb_simple = list("whack", "thwack", "wallop", "sock")
|
||||
// icon = 'icons/obj/items_and_weapons.dmi'
|
||||
// icon_state = "gohei"
|
||||
// inhand_icon_state = "gohei"
|
||||
// item_state = "gohei"
|
||||
// lefthand_file = 'icons/mob/inhands/weapons/staves_lefthand.dmi'
|
||||
// righthand_file = 'icons/mob/inhands/weapons/staves_righthand.dmi'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user