Skip to content

Commit

Permalink
Work
Browse files Browse the repository at this point in the history
  • Loading branch information
IroquoisLou committed Dec 2, 2024
1 parent 63182ed commit 9afee9c
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

//=================================================

Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ DEFINE_BITFIELD(mob_flags, list(
"MUTINEER" = MUTINEER,
"GIVING" = GIVING,
"NOBIOSCAN" = NOBIOSCAN,
"INSURGENT" = INSURGENT
))

DEFINE_BITFIELD(mobility_flags, list(
Expand Down
4 changes: 4 additions & 0 deletions code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
20 changes: 20 additions & 0 deletions code/modules/admin/player_panel/actions/antag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions code/modules/admin/topic/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions code/modules/gear_presets/other.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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("<hr>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.<hr>"))

/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("<hr>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.<hr>"))
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"

Expand Down
32 changes: 32 additions & 0 deletions code/modules/mob/living/carbon/human/human_abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 20 additions & 0 deletions tgui/packages/tgui/interfaces/PlayerPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,26 @@ const AntagActions = (props) => {
Make Mutineering Leader
</Button>
</Stack>
<Stack align="right" grow={1}>
<Button
width="100%"
icon="chess-pawn"
color="orange"
disabled={!hasPermission(data, 'make_mutineer')}
onClick={() => act('make_insurgent')}
>
Make insurgent
</Button>
<Button
width="100%"
icon="crown"
color="orange"
disabled={!hasPermission(data, 'make_mutineer')}
onClick={() => act('make_insurgent', { leader: true })}
>
Make insurgent Leader
</Button>
</Stack>
</Section>
)}
<Section
Expand Down

0 comments on commit 9afee9c

Please sign in to comment.