Skip to content

Commit

Permalink
redoes bandits to use adventurer class system
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasint committed Nov 17, 2024
1 parent 4a7e53f commit f2b4e71
Show file tree
Hide file tree
Showing 20 changed files with 396 additions and 56 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
#define COOK (1<<10)
#define GRABBER (1<<11)
#define MIGRANT (1<<16)
#define BANDIT (1<<17)

#define APPRENTICES (1<<5)

Expand Down Expand Up @@ -223,6 +224,7 @@
#define JDO_ADVENTURER 32.1
#define JDO_PILGRIM 32.2
#define JDO_MIGRANT 32.3
#define JDO_BANDIT 31.3

#define JDO_MERCENARY 33

Expand Down
8 changes: 6 additions & 2 deletions code/controllers/subsystem/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ SUBSYSTEM_DEF(job)
SetupOccupations()
return type_occupations[jobtype]

/datum/controller/subsystem/job/proc/AssignRole(mob/dead/new_player/player, rank, latejoin = FALSE)
/datum/controller/subsystem/job/proc/AssignRole(mob/player, rank, latejoin = FALSE)
JobDebug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
if(player && player.mind && rank)
var/datum/job/job = GetJob(rank)
Expand All @@ -92,6 +92,10 @@ SUBSYSTEM_DEF(job)
if(!latejoin)
position_limit = job.spawn_positions
JobDebug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
if(player.mind.assigned_role)
var/datum/job/old_job = SSjob.GetJob(player.mind.assigned_role)
if(old_job)
old_job.current_positions = max(old_job.current_positions - 1, 0)
player.mind.assigned_role = rank
unassigned -= player
job.current_positions++
Expand All @@ -106,7 +110,7 @@ SUBSYSTEM_DEF(job)
if(player.client)
player.client.prefs.lastclass = null
player.client.prefs.save_preferences()
job.greet(player)
addtimer(CALLBACK(player.client, TYPE_PROC_REF(/client, job_greet), job), 5 SECONDS)
return TRUE
JobDebug("AR has failed, Player: [player], Rank: [rank]")
return FALSE
Expand Down
1 change: 1 addition & 0 deletions code/datums/migrants/migrant_role.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
/datum/migrant_role/bandit
name = "Bandit"
antag_datum = /datum/antagonist/bandit
advclass_cat_rolls = list(CTAG_BANDIT = 20)
grant_lit_torch = TRUE
2 changes: 1 addition & 1 deletion code/datums/migrants/waves/heartfell_wave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
grant_lit_torch = TRUE
/datum/outfit/job/roguetown/heartfelt/knight/pre_equip(mob/living/carbon/human/H)
..()
head = /obj/item/clothing/head/helmet/knight
head = /obj/item/clothing/head/roguetown/helmet
gloves = /obj/item/clothing/gloves/roguetown/plate
pants = /obj/item/clothing/under/roguetown/platelegs
cloak = /obj/item/clothing/cloak/tabard/knight/guard
Expand Down
10 changes: 5 additions & 5 deletions code/game/gamemodes/roguetown/roguetown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ GLOBAL_LIST_INIT(roguegamemodes, list("Rebellion", "Vampire Lord", "Extended", "
"Priest")
var/num_bandits = 0
if(num_players() >= 10)
//num_bandits = CLAMP(round(num_players() / 2), 4, 6)
num_bandits = 0 //bandits disabled for now
//banditgoal += (num_bandits * rand(200,400))
var/datum/job/bandit_job = SSjob.GetJob("Bandit")
bandit_job.total_positions = num_bandits
bandit_job.spawn_positions = num_bandits
banditgoal += (num_bandits * rand(200,400))

if(num_bandits)
//antag_candidates = get_players_for_role(ROLE_BANDIT, pre_do=TRUE) //pre_do checks for their preferences since they don't have a job yet
Expand Down Expand Up @@ -242,8 +243,7 @@ GLOBAL_LIST_INIT(roguegamemodes, list("Rebellion", "Vampire Lord", "Extended", "
allantags -= bandaids
pre_bandits += bandaids

bandaids.assigned_role = "Bandit"
bandaids.special_role = ROLE_BANDIT
SSjob.AssignRole(bandaids.current, "Bandit")

bandaids.restricted_roles = restricted_jobs.Copy() // For posterities sake
testing("[key_name(bandaids)] has been selected as a bandit")
Expand Down
15 changes: 2 additions & 13 deletions code/modules/antagonists/roguetown/villain/bandit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
owner.special_role = "Bandit"
forge_objectives()
. = ..()
move_to_spawnpoint()
finalize_bandit()
equip_bandit()

Expand Down Expand Up @@ -64,19 +63,9 @@
owner.i_know_person(MF)
owner.person_knows_me(MF)

var/mob/living/carbon/human/H = owner.current
if(H.mobid in GLOB.character_list)
GLOB.character_list[H.mobid] = null
GLOB.chosen_names -= H.real_name
H.cmode_music = list('sound/music/combat_bandit.ogg', 'sound/music/combat_bandit2.ogg', 'sound/music/combat_bandit3.ogg')

addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living/carbon/human, choose_name_popup), "BANDIT"), 5 SECONDS)
// H.job = "Bandit"
// H.advjob = pick("Cheesemaker", "Mercenary", "Barbarian", "Ranger", "Rogue")
H.equipOutfit(/datum/outfit/job/roguetown/bandit)

return TRUE

/*
/datum/outfit/job/roguetown/bandit/pre_equip(mob/living/carbon/human/H)
..()
H.become_blind("TRAIT_GENERIC")
Expand All @@ -95,7 +84,6 @@
H.mind?.adjust_skillrank(/datum/skill/combat/knives, 1, TRUE)
H.mind?.adjust_skillrank(/datum/skill/combat/crossbows, 3, TRUE)
H.mind?.adjust_skillrank(/datum/skill/misc/athletics, 3, TRUE)
ADD_TRAIT(H, TRAIT_MEDIUMARMOR, TRAIT_GENERIC)
H.change_stat("strength", 2)
H.change_stat("endurance", 1)
H.change_stat("constitution", 1)
Expand Down Expand Up @@ -275,6 +263,7 @@
B.sellprice = rand(44, 88)
H.ambushable = FALSE
*/

/datum/antagonist/bandit/roundend_report()
if(owner?.current)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/antagonists/roguetown/villain/choosename.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
if(!stat)
if(job)
var/datum/job/j = SSjob.GetJob(job)
j.current_positions--
if(!j.antag_job)
j.current_positions--
mob_timers["mirrortime"] = world.time
var/begin_time = world.time
var/new_name = input(src, "What should your [input] name be?", "ROGUETOWN")
Expand Down
11 changes: 11 additions & 0 deletions code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
//How many players have this job
var/current_positions = 0

//Whether this job clears a slot when you get a rename prompt.
var/antag_job = FALSE

//Supervisors, who this person answers to directly
var/supervisors = ""

Expand Down Expand Up @@ -97,6 +100,8 @@

var/show_in_credits = TRUE

var/announce_latejoin = TRUE

var/give_bank_account = FALSE

var/can_random = TRUE
Expand Down Expand Up @@ -125,7 +130,13 @@
/datum/job/proc/special_job_check(mob/dead/new_player/player)
return TRUE

/client/proc/job_greet(var/datum/job/greeting_job)
if(mob.job == greeting_job.title)
greeting_job.greet(mob)

/datum/job/proc/greet(mob/player)
if(player?.mind?.assigned_role != title)
return
if(!job_greet_text)
return
to_chat(player, span_notice("You are the <b>[title]</b>"))
Expand Down
47 changes: 47 additions & 0 deletions code/modules/jobs/job_types/roguetown/adventurer/bandit.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/datum/job/roguetown/bandit //pysdon above there's like THREE bandit.dms now I'm so sorry. This one is latejoin bandits, the one in villain is the antag datum, and the one in the 'antag' folder is an old adventurer class we don't use. Good luck!
title = "Bandit"
flag = BANDIT
department_flag = PEASANTS
faction = "Station"
total_positions = 0
spawn_positions = 0
antag_job = TRUE
allowed_races = ALL_PLAYER_RACES_BY_NAME
tutorial = "Long ago you did a crime worthy of your bounty being hung on the wall outside of the local inn. You now live with your fellow freemen in the bog, and generally get up to no good."

outfit = null
outfit_female = null



display_order = JDO_BANDIT
show_in_credits = FALSE
announce_latejoin = FALSE
min_pq = 1

advclass_cat_rolls = list(CTAG_BANDIT = 20)
//PQ_boost_divider = 10

wanderer_examine = TRUE
always_show_on_latechoices = TRUE
job_reopens_slots_on_death = FALSE //no endless stream of bandits, unless the migration waves deem it so
same_job_respawn_delay = 30 MINUTES

cmode_music = 'sound/music/combat_bandit2.ogg'

/datum/job/roguetown/bandit/after_spawn(mob/living/L, mob/M, latejoin = TRUE)
..()
if(L)
var/mob/living/carbon/human/H = L
if(!H.mind)
return
H.advsetup = 1
H.invisibility = INVISIBILITY_MAXIMUM
H.become_blind("advsetup")
H.ambushable = FALSE

/datum/outfit/job/roguetown/bandit/post_equip(mob/living/carbon/human/H)
..()
var/datum/antagonist/new_antag = new /datum/antagonist/bandit()
H.mind.add_antag_datum(new_antag)
addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living/carbon/human, choose_name_popup), "BANDIT"), 5 SECONDS)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/datum/advclass/brigand //Strength class, starts with axe or flails and medium armor training
name = "Brigand"
tutorial = "Cast from society, you use your powerful physical might and endurance to take from those who are weaker from you."
allowed_sexes = list(MALE, FEMALE)
allowed_races = ALL_PLAYER_RACES_BY_NAME
outfit = /datum/outfit/job/roguetown/bandit/brigand
category_tags = list(CTAG_BANDIT)
cmode_music = 'sound/music/combat_bandit_brigand.ogg'

/datum/outfit/job/roguetown/bandit/brigand/pre_equip(mob/living/carbon/human/H)
..()
H.mind.adjust_skillrank(/datum/skill/combat/polearms, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/axesmaces, 4, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/wrestling, 4, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/unarmed, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/swords, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/whipsflails, 4, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/knives, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/bows, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/crossbows, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/crafting, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/carpentry, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/reading, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/climbing, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/sewing, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/medicine, 1, TRUE)
belt = /obj/item/storage/belt/rogue/leather
pants = /obj/item/clothing/under/roguetown/trou/leather
shirt = /obj/item/clothing/suit/roguetown/shirt/shortshirt/random
shoes = /obj/item/clothing/shoes/roguetown/boots
backr = /obj/item/storage/backpack/rogue/satchel
backpack_contents = list(/obj/item/needle/thorn = 1, /obj/item/natural/cloth = 1)
mask = /obj/item/clothing/mask/rogue/facemask/steel
neck = /obj/item/clothing/neck/roguetown/coif
head = /obj/item/clothing/head/roguetown/helmet/leather/volfhelm
armor = /obj/item/clothing/suit/roguetown/armor/leather/hide
H.change_stat("strength", 3)
H.change_stat("endurance", 2)
H.change_stat("constitution", 2)
H.change_stat("intelligence", -3)
ADD_TRAIT(H, TRAIT_MEDIUMARMOR, TRAIT_GENERIC)
H.adjust_blindness(-3)
var/weapons = list("Battleaxe & Cudgel","Flail & Shield")
var/weapon_choice = input("Choose your weapon.", "TAKE UP ARMS") as anything in weapons
H.set_blindness(0)
switch(weapon_choice)
if("Battleaxe & Cudgel") //one weapon to hurt people one weapon to kill people
backl= /obj/item/rogueweapon/axe/battle
beltr = /obj/item/rogueweapon/mace/cudgel
if("Flail & Shield") //plate users beware, you're in for a scare!
backl= /obj/item/rogueweapon/shield/wood
beltr = /obj/item/rogueweapon/flail
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/datum/advclass/hedgeknight //heavy knight class - just like black knight adventurer class. starts with heavy armor training and plate, but less weapon skills than brigand, sellsword and knave
name = "Hedge Knight"
tutorial = "A noble fallen from grace, your tarnished armor sits upon your shoulders as a heavy reminder of the life you've lost. Take back what is rightfully yours."
allowed_sexes = list(MALE, FEMALE)
allowed_races = ALL_PLAYER_RACES_BY_NAME
outfit = /datum/outfit/job/roguetown/bandit/hedgeknight
category_tags = list(CTAG_BANDIT)
cmode_music = 'sound/music/combat_bandit.ogg'

/datum/outfit/job/roguetown/bandit/hedgeknight/pre_equip(mob/living/carbon/human/H)
..()
head = /obj/item/clothing/head/roguetown/helmet
gloves = /obj/item/clothing/gloves/roguetown/chain
pants = /obj/item/clothing/under/roguetown/chainlegs
cloak = /obj/item/clothing/cloak/tabard/blkknight
neck = /obj/item/clothing/neck/roguetown/gorget
shirt = /obj/item/clothing/suit/roguetown/armor/chainmail
armor = /obj/item/clothing/suit/roguetown/armor/plate/blkknight
wrists = /obj/item/clothing/wrists/roguetown/bracers
shoes = /obj/item/clothing/shoes/roguetown/boots/armor/blkknight
belt = /obj/item/storage/belt/rogue/leather
beltr = /obj/item/rogueweapon/sword/long/death // ow the edge. it's just spraypainted. no weapon choice you MUST use a sword
backr = /obj/item/storage/backpack/rogue/satchel/black
backl = /obj/item/rogueweapon/shield/tower/metal
backpack_contents = list(/obj/item/rogueweapon/knife/dagger = 1)
H.mind.adjust_skillrank(/datum/skill/combat/polearms, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/swords, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/shields, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/axesmaces, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/wrestling, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/unarmed, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/athletics, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/swimming, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/climbing, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/reading, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/riding, 4, TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/cooking, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/labor/butchering, 1, TRUE)
H.change_stat("strength", 2)
H.change_stat("endurance", 1)
H.change_stat("constitution", 2)
H.change_stat("intelligence", 1)
H.change_stat("speed", 1)
ADD_TRAIT(H, TRAIT_MEDIUMARMOR, TRAIT_GENERIC)
ADD_TRAIT(H, TRAIT_HEAVYARMOR, TRAIT_GENERIC)
ADD_TRAIT(H, TRAIT_NOBLE, TRAIT_GENERIC) //hey buddy you hear about roleplaying
Loading

0 comments on commit f2b4e71

Please sign in to comment.