From 9afee9cae73fb9a1e2c3c79486501ef7a1a11054 Mon Sep 17 00:00:00 2001 From: IroquoisLou Date: Mon, 2 Dec 2024 20:56:46 +0000 Subject: [PATCH] Work --- code/__DEFINES/mobs.dm | 1 + code/_globalvars/bitfields.dm | 1 + code/datums/mob_hud.dm | 4 +++ .../admin/player_panel/actions/antag.dm | 20 ++++++++++++ code/modules/admin/topic/topic.dm | 21 ++++++++++++ code/modules/gear_presets/other.dm | 30 +++++++++++++++++ .../living/carbon/human/human_abilities.dm | 32 +++++++++++++++++++ tgui/packages/tgui/interfaces/PlayerPanel.jsx | 20 ++++++++++++ 8 files changed, 129 insertions(+) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 54546a6f046e..3034efb3e7de 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -190,6 +190,7 @@ #define MUTINEER (1<<4) // Part of the Mutiny Gang #define GIVING (1<<5) // Is currently trying to give an item to someone #define NOBIOSCAN (1<<6) +#define INSURGENT (1<<7) //================================================= diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index f08585846879..cd968315a787 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -376,6 +376,7 @@ DEFINE_BITFIELD(mob_flags, list( "MUTINEER" = MUTINEER, "GIVING" = GIVING, "NOBIOSCAN" = NOBIOSCAN, + "INSURGENT" = INSURGENT )) DEFINE_BITFIELD(mobility_flags, list( diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index c2cb0d8791f0..8a043627d46f 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -673,6 +673,10 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( holder.overlays += image('icons/mob/hud/marine_hud.dmi', src, "hudmutineer") return + if(mob_flags & INSURGENT) + holder.overlays += image('icons/mob/hud/marine_hud.dmi', src, "hudCLF") + return + hud_set_new_player() F.modify_hud_holder(holder, src) diff --git a/code/modules/admin/player_panel/actions/antag.dm b/code/modules/admin/player_panel/actions/antag.dm index b1c2da6be123..caba1b48dea0 100644 --- a/code/modules/admin/player_panel/actions/antag.dm +++ b/code/modules/admin/player_panel/actions/antag.dm @@ -19,6 +19,26 @@ var/title = params["leader"]? "mutineer leader" : "mutineer" message_admins("[key_name_admin(user)] has made [key_name_admin(H)] into a [title].") +// INSURGENT +/datum/player_action/make_insurgent + action_tag = "make_insurgent" + name = "Make Insurgent" + +/datum/player_action/make_insurgent/act(client/user, mob/target, list/params) + if(!ishuman(target)) + to_chat(user, SPAN_WARNING("This can only be done to instances of type /mob/living/carbon/human")) + return + + var/mob/living/carbon/human/human = target + var/datum/equipment_preset/preset = GLOB.gear_path_presets_list[/datum/equipment_preset/other/insurgent] + if(params["leader"]) + preset = GLOB.gear_path_presets_list[/datum/equipment_preset/other/insurgent/leader] + + preset.load_status(human) + var/title = params["leader"]? "insurgent leader" : "insurgent" + message_admins("[key_name_admin(user)] has made [key_name_admin(human)] into a [title].") + + // XENO /datum/player_action/change_hivenumber action_tag = "xeno_change_hivenumber" diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index 6f660323f8e3..99e1a0859aa4 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -858,6 +858,27 @@ message_admins("[key_name_admin(usr)] has made [key_name_admin(H)] into a mutineer leader.") + else if(href_list["makeinsurgent"]) + if(!check_rights(R_DEBUG|R_SPAWN)) + return + + var/mob/living/carbon/human/human = locate(href_list["makeinsurgent"]) + if(!istype(human)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") + return + + if(human.faction != FACTION_SURVIVOR) + to_chat(usr, "This player's faction must equal '[FACTION_SURVIVOR]' to make them a insurgent.") + return + + var/datum/equipment_preset/other/insurgent/leader/leader_preset = new() + leader_preset.load_status(human) + + message_admins("[key_name_admin(usr)] has made [key_name_admin(human)] into a insurgent leader.") + + + + else if(href_list["makecultist"] || href_list["makecultistleader"]) if(!check_rights(R_DEBUG|R_SPAWN)) return diff --git a/code/modules/gear_presets/other.dm b/code/modules/gear_presets/other.dm index fc2ebe3d0e63..10caf448f6f9 100644 --- a/code/modules/gear_presets/other.dm +++ b/code/modules/gear_presets/other.dm @@ -28,6 +28,36 @@ for(var/type in abilities) give_action(new_human, type) +/datum/equipment_preset/other/insurgent + name = "insurgent" + flags = EQUIPMENT_PRESET_EXTRA + +/datum/equipment_preset/other/insurgent/load_status(mob/living/carbon/human/new_human) + . = ..() + new_human.mob_flags |= INSURGENT + new_human.hud_set_squad() + + to_chat(new_human, SPAN_HIGHDANGER("
You are now a CLF Insurgent!")) + to_chat(new_human, SPAN_DANGER("Please check the rules to see what you can and can't do as a insurgent.
")) + +/datum/equipment_preset/other/insurgent/leader + name = "Cell Leader" + flags = EQUIPMENT_PRESET_EXTRA + +/datum/equipment_preset/other/insurgent/leader/load_status(mob/living/carbon/human/new_human) + new_human.mob_flags |= INSURGENT + new_human.hud_set_squad() + + to_chat(new_human, SPAN_HIGHDANGER("
You are now a insurgent Leader!")) + to_chat(new_human, SPAN_DANGER("Please check the rules to see what you can and can't do as a insurgent.
")) + for(var/datum/action/human_action/activable/insurgent/insurgent in new_human.actions) + insurgent.remove_from(new_human) + + var/list/abilities = subtypesof(/datum/action/human_action/activable/insurgent) + for(var/type in abilities) + give_action(new_human, type) + + /datum/equipment_preset/other/freelancer name = "Freelancer" diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index ae5917664738..d7dd72b2e653 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -601,6 +601,38 @@ CULT remove_from(H) +/datum/action/human_action/activable/insurgent + name = "insurgent abilities" + +/datum/action/human_action/activable/insurgent/insurgent_convert + name = "Convert" + action_icon_state = "mutineer_convert" //need someone to sprite icon + + +/datum/action/human_action/activable/insurgent/insurgent_convert/use_ability(mob/mob) + if(!can_use_action()) + return + + var/mob/living/carbon/human/human = owner + var/mob/living/carbon/human/chosen = mob + + if(!istype(chosen)) + return + + to_chat(human, SPAN_NOTICE("insurgent join request sent to [chosen]!")) + + if(tgui_alert(chosen, "Do you want to be a insurgent?", "Become insurgent", list("Yes", "No")) != "Yes") + return + var/datum/equipment_preset/other/insurgent/loudout = new() + loudout.load_status(chosen) + to_chat(chosen, SPAN_WARNING("You are now an insurgent. Follow the orders of your cell Leader.")) + + message_admins("[key_name_admin(chosen)] has been converted into a insurgent by [key_name_admin(human)].") + + + + + /datum/action/human_action/cancel_view // cancel-camera-view, but a button name = "Cancel View" action_icon_state = "cancel_view" diff --git a/tgui/packages/tgui/interfaces/PlayerPanel.jsx b/tgui/packages/tgui/interfaces/PlayerPanel.jsx index 099c0950a3bc..ea6724564765 100644 --- a/tgui/packages/tgui/interfaces/PlayerPanel.jsx +++ b/tgui/packages/tgui/interfaces/PlayerPanel.jsx @@ -717,6 +717,26 @@ const AntagActions = (props) => { Make Mutineering Leader + + + + )}