Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

given_skills added to classes (attempt 2) #929

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,36 @@
else
to_chat(current, "<span class='warning'>My [S.name] has weakened!</span>")

// just scoot in right here
/datum/mind/proc/assign_experiences(list/Skills, silent, option)
ShadowLeaderJordanzo marked this conversation as resolved.
Show resolved Hide resolved
// list(skill path = num)
for(var/path in Skills)
var/truePath = text2path(path)
var/numValue
if(istext(Skills[path])) // cant assign pick when defining
numValue = textList2nums(Skills[path])
else
numValue = Skills[path]
switch(option)
if("Skills")
adjust_experience(truePath, numValue, TRUE) // change this to what i think is a rewritten proc?
if("Stats")
current.change_stat(path, numValue)


/datum/mind/proc/textList2nums(text) // needs a better name
var/list/values = splittext(text, ",")
ChungusGamer666 marked this conversation as resolved.
Show resolved Hide resolved
var/option = 0 // 0 = pick, 1 = rand
if(values[1] != "pick(") option = 1
values.Remove(values[1], values[length(values)]) // could do values[1] & values[length(values)] here
for(var/index in 1 to length(values))
if(isnull(values[index])) continue // not needed me thinks but just in case
values[index] = text2num(values[index])
//TODO: review? there's gotta b a better way to translate this text to numbers
return option ? rand(values[1], values[2]) : pick(values)
// i dont like the list[index] in rand, n im p sure pick(1,2,3) = rand(1,3) so


/datum/mind/proc/adjust_skillrank(skill, amt, silent = FALSE)
var/datum/skill/S = GetSkillRef(skill)
var/amt2gain = 0
Expand Down
2 changes: 2 additions & 0 deletions code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
if(roundstart_experience)
var/mob/living/carbon/human/experiencer = H
for(var/i in roundstart_experience)
if(istext(roundstart_experience[i]))
roundstart_experience[i] = experiencer.mind.textList2nums(roundstart_experience[i])
experiencer.mind.adjust_experience(i, roundstart_experience[i], TRUE)

if(spells)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
var/vampcompat = TRUE
var/list/traits_applied


var/list/given_skills = list()

var/list/stat_changes = list()

/datum/advclass/proc/equipme(mob/living/carbon/human/H)
if(!H)
return FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,36 @@
maxchosen = 2
traits_applied = list(RTRAIT_CRITICAL_RESISTANCE, TRAIT_NOPAINSTUN, TRAIT_STEELHEARTED)


given_skills = list(
"/datum/skill/combat/polearms" = 3, \
ShadowLeaderJordanzo marked this conversation as resolved.
Show resolved Hide resolved
"/datum/skill/combat/swords" = 1, \
"/datum/skill/combat/knives" = 1, \
"/datum/skill/combat/bows" = 3, \
"/datum/skill/combat/wrestling" = 3, \
"/datum/skill/combat/unarmed" = 2, \
"/datum/skill/craft/crafting" = 1, \
"/datum/skill/misc/swimming" = 2, \
"/datum/skill/misc/climbing" = 2, \
"/datum/skill/misc/riding" = 2, \
"/datum/skill/misc/athletics" = 2, \
"/datum/skill/misc/medicine" = 1
)
/datum/outfit/job/roguetown/adventurer/amazon/pre_equip(mob/living/carbon/human/H)
..()
H.mind.adjust_skillrank(/datum/skill/combat/polearms, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/swords, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/knives, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/bows, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/wrestling, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/unarmed, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/crafting, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/swimming, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/climbing, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/riding, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/athletics, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/medicine, 1, TRUE)
H.mind.assign_experiences(/datum/advclass/amazon::given_skills, TRUE, "Skills")
// H.mind.adjust_skillrank(/datum/skill/combat/polearms, 3, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/swords, 1, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/knives, 1, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/bows, 3, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/wrestling, 3, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/unarmed, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/craft/crafting, 1, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/swimming, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/climbing, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/riding, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/athletics, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/medicine, 1, TRUE)
belt = /obj/item/storage/belt/rogue/leather
neck = /obj/item/storage/belt/rogue/pouch/coins/poor
beltl = /obj/item/rogueweapon/huntingknife
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@
pickprob = 100
traits_applied = list(RTRAIT_NOBLE, RTRAIT_NOSEGRAB, RTRAIT_HEAVYARMOR)

given_skills = list(
"/datum/skill/combat/crossbows" = 3, \
"/datum/skill/combat/polearms" = 2, \
"/datum/skill/combat/axesmaces" = 3, \
"/datum/skill/combat/bows" = 3, \
"/datum/skill/combat/wrestling" = 2, \
"/datum/skill/combat/unarmed" = 2, \
"/datum/skill/misc/swimming" = 1, \
"/datum/skill/misc/climbing" = 2, \
"/datum/skill/misc/athletics" = 3, \
"/datum/skill/combat/swords" = 4, \
"/datum/skill/combat/knives" = 2, \
"/datum/skill/misc/reading" = 4, \
"/datum/skill/misc/sneaking" = 2, \
"/datum/skill/misc/medicine" = 1, \
"/datum/skill/misc/riding" = 3
)


/datum/outfit/job/roguetown/adventurer/heartfeltlord/pre_equip(mob/living/carbon/human/H)
..()
shirt = /obj/item/clothing/suit/roguetown/shirt/undershirt
Expand Down Expand Up @@ -50,4 +69,4 @@
ADD_TRAIT(H, RTRAIT_NOBLE, TRAIT_GENERIC)
ADD_TRAIT(H, RTRAIT_NOSEGRAB, TRAIT_GENERIC)
ADD_TRAIT(H, RTRAIT_HEAVYARMOR, TRAIT_GENERIC)
ADD_TRAIT(H, RTRAIT_MEDIUMARMOR, TRAIT_GENERIC)
ADD_TRAIT(H, RTRAIT_MEDIUMARMOR, TRAIT_GENERIC)
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,65 @@
outfit = /datum/outfit/job/roguetown/adventurer/rogue
traits_applied = list(RTRAIT_MEDIUMARMOR)

given_skills = list(
"/datum/skill/combat/swords" = 3, \
"/datum/skill/combat/axesmaces" = 2, \
"/datum/skill/combat/crossbows" = "pick(,2,3,3,)", \
"/datum/skill/misc/athletics" = 4, \
"/datum/skill/combat/bows" = 3, \
"/datum/skill/combat/wrestling" = 3, \
"/datum/skill/combat/unarmed" = 3, \
"/datum/skill/combat/knives" = 4, \
"/datum/skill/combat/polearms" = 1, \
"/datum/skill/misc/swimming" = 3, \
"/datum/skill/misc/climbing" = "pick(,5,6,)", \
"/datum/skill/craft/crafting" = 1, \
"/datum/skill/misc/reading" = "pick(,0,1,1,)", \
"/datum/skill/craft/traps" = 2, \
"/datum/skill/misc/medicine" = "pick(,0,1,)", \
"/datum/skill/misc/sneaking" = 5, \
"/datum/skill/misc/stealing" = 5, \
"/datum/skill/misc/riding" = "pick(,1,2,)", \
"/datum/skill/craft/engineering" = 1
)

stat_changes = list(
"strength" = -1,
"perception" = 2,
"speed" = "pick(,3,4,)",
"intelligence" =2,
)

/datum/outfit/job/roguetown/adventurer/rogue
allowed_patrons = list(/datum/patron/divine/xylix, /datum/patron/inhumen/matthios)

/datum/outfit/job/roguetown/adventurer/rogue/pre_equip(mob/living/carbon/human/H)
..()
shoes = /obj/item/clothing/shoes/roguetown/boots
neck = /obj/item/storage/belt/rogue/pouch/coins/poor
H.mind.adjust_skillrank(/datum/skill/combat/swords, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/axesmaces, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/crossbows, pick(2,3,3), TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/athletics, 4, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/bows, 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/combat/knives, 4, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/polearms, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/swimming, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/climbing, pick(5,6), TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/crafting, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/reading, pick(0,1,1), TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/traps, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/medicine, pick(0,1), TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/sneaking, 5, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/stealing, 5, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/riding, pick(1,2), TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/engineering, 1, TRUE)
H.mind.assign_experiences(/datum/advclass/rogue::given_skills, TRUE, "Skills")
// i don't like this, but since we'll know what datum goes here i don't see a big issue?

// temp removal
// H.mind.adjust_skillrank(/datum/skill/combat/swords, 3, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/axesmaces, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/crossbows, pick(2,3,3), TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/athletics, 4, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/bows, 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/combat/knives, 4, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/polearms, 1, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/swimming, 3, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/climbing, pick(5,6), TRUE)
// H.mind.adjust_skillrank(/datum/skill/craft/crafting, 1, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/reading, pick(0,1,1), TRUE)
// H.mind.adjust_skillrank(/datum/skill/craft/traps, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/medicine, pick(0,1), TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/sneaking, 5, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/stealing, 5, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/riding, pick(1,2), TRUE)
// H.mind.adjust_skillrank(/datum/skill/craft/engineering, 1, TRUE)
pants = /obj/item/clothing/under/roguetown/trou/leather
shirt = /obj/item/clothing/suit/roguetown/shirt/undershirt
gloves = /obj/item/clothing/gloves/roguetown/leather
Expand All @@ -56,7 +89,11 @@
beltl = /obj/item/rogueweapon/huntingknife/idagger/steel
ADD_TRAIT(H, RTRAIT_MEDIUMARMOR, TRAIT_GENERIC)
ADD_TRAIT(H, TRAIT_STEELHEARTED, TRAIT_GENERIC)
H.change_stat("strength", -1)
H.change_stat("perception", 2)
H.change_stat("speed", pick(3,4), TRUE)
H.change_stat("intelligence", 2)

H.mind.assign_experiences(/datum/advclass/rogue::stat_changes, TRUE, "Stats")

// temp removal
// H.change_stat("strength", -1)
// H.change_stat("perception", 2)
// H.change_stat("speed", pick(3,4))
// H.change_stat("intelligence", 2)
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,31 @@
outfit = /datum/outfit/job/roguetown/adventurer/sfighter
traits_applied = list(RTRAIT_HEAVYARMOR)


given_skills = list(
"/datum/skill/misc/sneaking" = "pick(,1,1,2,)", \
"/datum/skill/combat/crossbows" = "pick(,1,2,)", \
"/datum/skill/combat/polearms" = 2, \
"/datum/skill/combat/axesmaces" = 2, \
"/datum/skill/combat/bows" = "pick(,1,2,)", \
"/datum/skill/combat/wrestling" = 2, \
"/datum/skill/combat/unarmed" = 2, \
"/datum/skill/misc/athletics" = 4, \
"/datum/skill/combat/swords" = 3, \
"/datum/skill/misc/swimming" = 1, \
"/datum/skill/misc/climbing" = 2, \
"/datum/skill/misc/riding" = "pick(,2,3,)", \
"/datum/skill/misc/medicine" = 1, \
"/datum/skill/combat/knives" = "rand(,1,3,)"
)
// tempted to just change rand(1,2) to pick 1,2,3
stat_changes = list(
"strength" = 2,
"endurance" = 2,
"constitution" = 2,
"speed" = 1
)

/datum/outfit/job/roguetown/adventurer/sfighter/pre_equip(mob/living/carbon/human/H)
..()
H.adjust_blindness(-3)
Expand All @@ -29,20 +54,24 @@
if("Warrior")
H.set_blindness(0)
to_chat(H, "<span class='warning'>Warriors are well rounded fighters, experienced often in many theaters of warfare and battle they are capable of rising to any challenge that might greet them on the path.</span>")
H.mind.adjust_skillrank(/datum/skill/combat/crossbows, rand(1,2), TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/polearms, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/axesmaces, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/bows, rand(1,2), TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/wrestling, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/unarmed, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/athletics, 4, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/swords, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/knives, rand(1,3), TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/sneaking, pick(1,1,2), TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/swimming, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/climbing, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/riding, pick(2,3), TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/medicine, 1, TRUE)
H.mind.assign_experiences(/datum/advclass/sfighter::given_skills, TRUE, "Skills")
// H.mind.adjust_skillrank(/datum/skill/combat/crossbows, rand(1,2), TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/polearms, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/axesmaces, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/bows, rand(1,2), TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/wrestling, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/unarmed, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/athletics, 4, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/swords, 3, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/knives, rand(1,3), TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/sneaking, pick(1,1,2), TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/swimming, 1, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/climbing, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/riding, pick(2,3), TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/medicine, 1, TRUE)

H.mind.assign_experiences(/datum/advclass/sfighter::stat_changes, TRUE, "Stats")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh look its the funny new operator!

...does it even work with lists? i know for a fact initial() refuses to work with lists

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on children yes, on parent it throws a runtime

`
/datum/test
var/list/given_skills = list()

/datum/test/child
given_skills = list("blah" =1 , "halb" = 2)

/mob/verb/test()
world<<jointext(/datum/test/child::given_skills, " , ")
`

does result in: blah , halb


H.change_stat("strength", 2)
H.change_stat("endurance", 2) // 7 stat points total as a low-skill martial role without magic. Compared to Pally with 5 points.
H.change_stat("constitution", 2)
Expand Down
23 changes: 16 additions & 7 deletions code/modules/jobs/job_types/roguetown/serfs/blacksmith.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,29 @@
give_bank_account = 11
min_pq = 1
max_pq = null
skills = list(
"/datum/skill/combat/axesmaces" = 3, \
"/datum/skill/combat/unarmed" = 2, \
"/datum/skill/craft/crafting" = 3, \
"/datum/skill/combat/wrestling" = 3, \
"/datum/skill/craft/blacksmithing" = "pick(,3,4,)", \
"/datum/skill/craft/armorsmithing" = "pick(,3,4,)", \
"/datum/skill/misc/reading" = 2, )

/datum/outfit/job/roguetown/armorsmith/pre_equip(mob/living/carbon/human/H)
..()
head = /obj/item/clothing/head/roguetown/hatfur
if(prob(50))
head = /obj/item/clothing/head/roguetown/hatblu
if(H.mind)
H.mind.adjust_skillrank(/datum/skill/combat/axesmaces, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/unarmed, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/crafting, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/combat/wrestling, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/blacksmithing, pick(3,4), TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/armorsmithing, pick(3,4), TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/reading, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/axesmaces, 3, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/unarmed, 2, TRUE)
// H.mind.adjust_skillrank(/datum/skill/craft/crafting, 3, TRUE)
// H.mind.adjust_skillrank(/datum/skill/combat/wrestling, 3, TRUE)
// H.mind.adjust_skillrank(/datum/skill/craft/blacksmithing, pick(3,4), TRUE)
// H.mind.adjust_skillrank(/datum/skill/craft/armorsmithing, pick(3,4), TRUE)
// H.mind.adjust_skillrank(/datum/skill/misc/reading, 2, TRUE)
// assuming after_spawn() calls here
if(H.age == AGE_OLD)
H.mind.adjust_skillrank(/datum/skill/craft/blacksmithing, pick(1,2), TRUE)
H.mind.adjust_skillrank(/datum/skill/craft/armorsmithing, pick(1,2), TRUE)
Expand Down
Loading
Loading