Skip to content

Commit

Permalink
Merge pull request #1037 from HeroWithYay/RGtraining
Browse files Browse the repository at this point in the history
Adds new trait that allows a character to train others to match their own skill level. Adds that trait to Royal Guard.
  • Loading branch information
Lutowski authored Dec 20, 2024
2 parents 07954ba + c7933aa commit 8e055c1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
4 changes: 3 additions & 1 deletion code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#define TRAIT_KNIGHTSMAN "Royal Defiance"
#define TRAIT_WOODSMAN "Talented Woodsman"
#define TRAIT_INQUISITION "Member of the Otavan Inquisition"
#define TRAIT_GOODTRAINER "Good Trainer"

//Hearthstone port (Tracking)
#define TRAIT_PERFECT_TRACKER "Perfect Tracker" //Will always find any tracks and analyzes them perfectly.
Expand Down Expand Up @@ -171,7 +172,8 @@ GLOBAL_LIST_INIT(roguetraits, list(
TRAIT_FORTITUDE = span_info("The typical drain I feel from day to day life is lessened, my athleticism greater."),
TRAIT_GUIDANCE = span_info("Arcyne assistance guides my weapons."),
TRAIT_DEPRAVED = span_info("The languid scent of Her debauchery is known to me, and I can detect its sordid presence upon others."),
TRAIT_SILVER_BLESSED = span_info("I am anointed with holy silver, which preserves me from curses that bite.")
TRAIT_SILVER_BLESSED = span_info("I am anointed with holy silver, which preserves me from curses that bite."),
TRAIT_GOODTRAINER = span_info("I am a good teacher, and when it comes to weaponry I can train others to be just as skilled as I am.")
))

// trait accessor defines
Expand Down
3 changes: 3 additions & 0 deletions code/modules/jobs/job_types/roguetown/nobility/knight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
ADD_TRAIT(H, TRAIT_STEELHEARTED, TRAIT_GENERIC) //Knights should be used to the horrors of war if they're tride-and-true.
ADD_TRAIT(H, TRAIT_NOBLE, TRAIT_GENERIC) //Knights are /technically/ nobles? But they are of the lower-tiers; mainly that a non-blue-blood could become a knight
ADD_TRAIT(H, TRAIT_KNIGHTSMAN, TRAIT_GENERIC) //if they can't figure out how to win vs someone in leather armor with this i literally can not help them anymore
ADD_TRAIT(H, TRAIT_GOODTRAINER, TRAIT_GENERIC) //Knights can train their squires.
H.dna.species.soundpack_m = new /datum/voicepack/male/knight() //For knightly voices; even though I despise them.
H.verbs |= /mob/proc/haltyell

Expand Down Expand Up @@ -159,6 +160,7 @@
ADD_TRAIT(H, TRAIT_STEELHEARTED, TRAIT_GENERIC) //Knights should be used to the horrors of war if they're tride-and-true.
ADD_TRAIT(H, TRAIT_NOBLE, TRAIT_GENERIC) //Knights are /technically/ nobles? But they are of the lower-tiers; mainly that a non-blue-blood could become a knight.
ADD_TRAIT(H, TRAIT_KNIGHTSMAN, TRAIT_GENERIC) //if they can't figure out how to win vs someone in leather armor with this i literally can not help them anymore
ADD_TRAIT(H, TRAIT_GOODTRAINER, TRAIT_GENERIC) //Knights can train their squires.
H.dna.species.soundpack_m = new /datum/voicepack/male/knight() //For knightly voices; even though I despise them.
H.verbs |= /mob/proc/haltyell

Expand Down Expand Up @@ -216,6 +218,7 @@
ADD_TRAIT(H, TRAIT_STEELHEARTED, TRAIT_GENERIC) //Knights should be used to the horrors of war if they're tride-and-true.
ADD_TRAIT(H, TRAIT_NOBLE, TRAIT_GENERIC) //Knights are /technically/ nobles? But they are of the lower-tiers; mainly that a non-blue-blood could become a knight.
ADD_TRAIT(H, TRAIT_KNIGHTSMAN, TRAIT_GENERIC) //if they can't figure out how to win vs someone in leather armor with this i literally can not help them anymore
ADD_TRAIT(H, TRAIT_GOODTRAINER, TRAIT_GENERIC) //Knights can train their squires.
H.dna.species.soundpack_m = new /datum/voicepack/male/knight() //For knightly voices; even though I despise them.
H.verbs |= /mob/proc/haltyell

Expand Down
24 changes: 18 additions & 6 deletions code/modules/mob/living/roguetownprocs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,13 @@

if(weapon_parry == TRUE)
if(do_parry(used_weapon, drained, user)) //show message
if ((mobility_flags & MOBILITY_STAND))
var/skill_target = attacker_skill
if(!HAS_TRAIT(U, TRAIT_GOODTRAINER))
skill_target -= SKILL_LEVEL_NOVICE
if (can_train_combat_skill(src, used_weapon.associated_skill, skill_target))
mind.add_sleep_experience(used_weapon.associated_skill, max(round(STAINT*exp_multi), 0), FALSE)

if((mobility_flags & MOBILITY_STAND) && can_train_combat_skill(src, used_weapon.associated_skill, attacker_skill - SKILL_LEVEL_NOVICE))
mind.add_sleep_experience(used_weapon.associated_skill, max(round(STAINT*exp_multi), 0), FALSE)
var/obj/item/AB = intenty.masteritem

//attacker skill gain
Expand All @@ -230,8 +234,12 @@
attacker_skill_type = AB.associated_skill
else
attacker_skill_type = /datum/skill/combat/unarmed
if((U.mobility_flags & MOBILITY_STAND) && can_train_combat_skill(U, attacker_skill_type, defender_skill - SKILL_LEVEL_NOVICE))
U.mind.add_sleep_experience(attacker_skill_type, max(round(STAINT*exp_multi), 0), FALSE)
if ((mobility_flags & MOBILITY_STAND))
var/skill_target = defender_skill
if(!HAS_TRAIT(src, TRAIT_GOODTRAINER))
skill_target -= SKILL_LEVEL_NOVICE
if (can_train_combat_skill(U, attacker_skill_type, skill_target))
U.mind.add_sleep_experience(attacker_skill_type, max(round(STAINT*exp_multi), 0), FALSE)

if(prob(66) && AB)
if((used_weapon.flags_1 & CONDUCT_1) && (AB.flags_1 & CONDUCT_1))
Expand All @@ -255,8 +263,12 @@

if(weapon_parry == FALSE)
if(do_unarmed_parry(drained, user))
if((mobility_flags & MOBILITY_STAND) && can_train_combat_skill(H, /datum/skill/combat/unarmed, attacker_skill - SKILL_LEVEL_NOVICE))
H.mind?.add_sleep_experience(/datum/skill/combat/unarmed, max(round(STAINT*exp_multi), 0), FALSE)
if((mobility_flags & MOBILITY_STAND))
var/skill_target = attacker_skill
if(!HAS_TRAIT(U, TRAIT_GOODTRAINER))
skill_target -= SKILL_LEVEL_NOVICE
if(can_train_combat_skill(H, /datum/skill/combat/unarmed, skill_target))
H.mind?.add_sleep_experience(/datum/skill/combat/unarmed, max(round(STAINT*exp_multi), 0), FALSE)
flash_fullscreen("blackflash2")
return TRUE
else
Expand Down

0 comments on commit 8e055c1

Please sign in to comment.