Skip to content

Commit

Permalink
organizing spelllist
Browse files Browse the repository at this point in the history
  • Loading branch information
tioluko authored Sep 5, 2024
1 parent 40ddacd commit 285f3c5
Showing 1 changed file with 0 additions and 88 deletions.
88 changes: 0 additions & 88 deletions code/modules/jobs/job_types/roguetown/nobility/sheriff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,91 +91,3 @@
ADD_TRAIT(H, TRAIT_MEDIUMARMOR, TRAIT_GENERIC)
ADD_TRAIT(H, TRAIT_STEELHEARTED, TRAIT_GENERIC)
H.verbs |= /mob/proc/haltyell

/obj/effect/proc_holder/spell/self/convertrole
name = "Recruit Beggar"
desc = "Recruit someone to your cause."
antimagic_allowed = TRUE
charge_max = 100
/// Role given if recruitment is accepted
var/new_role = "Beggar"
/// Faction shown to the user in the recruitment prompt
var/recruitment_faction = "Beggars"
/// Message the recruiter gives
var/recruitment_message = "Serve the beggars, %RECRUIT!"
/// Range to search for potential recruits
var/recruitment_range = 3
/// Say message when the recruit accepts
var/accept_message = "I will serve!"
/// Say message when the recruit refuses
var/refuse_message = "I refuse."

/obj/effect/proc_holder/spell/self/convertrole/cast(list/targets,mob/user = usr)
. = ..()
var/list/recruitment = list()
for(var/mob/living/carbon/human/recruit in (get_hearers_in_view(recruitment_range, user) - user))
//not allowed
if(!can_convert(recruit))
continue
recruitment[recruit.name] = recruit
if(!length(recruitment))
to_chat(user, span_warning("There are no potential recruits in range."))
return
var/inputty = input(user, "Select a potential recruit!", "[name]") as anything in recruitment
if(inputty)
var/mob/living/carbon/human/recruit = recruitment[inputty]
if(!QDELETED(recruit) && (recruit in get_hearers_in_view(recruitment_range, user)))
INVOKE_ASYNC(src, PROC_REF(convert), recruit, user)
else
to_chat(user, span_warning("Recruitment failed!"))
else
to_chat(user, span_warning("Recruitment cancelled."))

/obj/effect/proc_holder/spell/self/convertrole/proc/can_convert(mob/living/carbon/human/recruit)
//wtf
if(QDELETED(recruit))
return FALSE
//need a mind
if(!recruit.mind)
return FALSE
//only migrants and peasants
if(!(recruit.job in GLOB.peasant_positions) && \
!(recruit.job in GLOB.yeoman_positions) && \
!(recruit.job in GLOB.allmig_positions) && \
!(recruit.job in GLOB.mercenary_positions))
return FALSE
//need to see their damn face
if(!recruit.get_face_name(null))
return FALSE
return TRUE

/obj/effect/proc_holder/spell/self/convertrole/proc/convert(mob/living/carbon/human/recruit, mob/living/carbon/human/recruiter)
if(QDELETED(recruit) || QDELETED(recruiter))
return FALSE
recruiter.say(replacetext(recruitment_message, "%RECRUIT", "[recruit]"), forced = "[name]")
var/prompt = alert(recruit, "Do you wish to become a [new_role]?", "[recruitment_faction] Recruitment", "Yes", "No")
if(QDELETED(recruit) || QDELETED(recruiter) || !(recruiter in get_hearers_in_view(recruitment_range, recruit)))
return FALSE
if(prompt != "Yes")
if(refuse_message)
recruit.say(refuse_message, forced = "[name]")
return FALSE
if(accept_message)
recruit.say(accept_message, forced = "[name]")
if(new_role)
recruit.job = new_role
return TRUE

/obj/effect/proc_holder/spell/self/convertrole/guard
name = "Recruit Guardsmen"
new_role = "Watchman"
recruitment_faction = "Watchman"
recruitment_message = "Serve the town guard, %RECRUIT!"
accept_message = "FOR THE KING!"
refuse_message = "I refuse."

/obj/effect/proc_holder/spell/self/convertrole/guard/convert(mob/living/carbon/human/recruit, mob/living/carbon/human/recruiter)
. = ..()
if(!.)
return
recruit.verbs |= /mob/proc/haltyell

0 comments on commit 285f3c5

Please sign in to comment.