From 67c2443cb0e4fc1777cb6e27e1dd480dbefe1c0f Mon Sep 17 00:00:00 2001 From: MalorMorfin <95427566+MalorMorfin@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:34:04 +1000 Subject: [PATCH] Assault crewman can't controll mech (#827) * fastfix * uh --- code/__DEFINES/skills.dm | 5 ++++ code/datums/skills.dm | 24 +++++++++++++------ code/game/objects/items/pamphlets.dm | 3 ++- .../mecha/combat/greyscale/greyscale.dm | 2 +- .../combat/greyscale/greyscale_constructor.dm | 2 +- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/skills.dm b/code/__DEFINES/skills.dm index 33d03067ff4..a02eb420297 100644 --- a/code/__DEFINES/skills.dm +++ b/code/__DEFINES/skills.dm @@ -21,6 +21,7 @@ #define SKILL_POLICE "police" #define SKILL_POWERLOADER "powerloader" #define SKILL_LARGE_VEHICLE "large_vehicle" +#define SKILL_MECH_PILOT "mech_pilot" #define SKILL_STAMINA "stamina" #define SKILL_SWORDPLAY "swordplay" //////////////////////////////////////////////// @@ -159,6 +160,10 @@ #define SKILL_LARGE_VEHICLE_EXPERIENCED 2 //transport crew #define SKILL_LARGE_VEHICLE_VETERAN 3 //mech pilot and assault crew +//Allow mech pilot use mechs +#define SKILL_MECH_PILOT_DEFAULT 0 +#define SKILL_MECH_PILOT_TRAINED 1 + //stamina skill - you do cardio, right? //buff stamina related things #define SKILL_STAMINA_WEAK -1 diff --git a/code/datums/skills.dm b/code/datums/skills.dm index ff9d1d6f2e5..9a3f64b913e 100644 --- a/code/datums/skills.dm +++ b/code/datums/skills.dm @@ -1,23 +1,23 @@ #define SKILLSID "skills-[cqc]-[melee_weapons]\ -[firearms]-[pistols]-[shotguns]-[rifles]-[smgs]-[heavy_weapons]-[smartgun]\ -[swordplay]\ --[engineer]-[construction]-[leadership]-[medical]-[surgery]-[pilot]-[police]-[powerloader]-[large_vehicle]-[stamina]" +-[engineer]-[construction]-[leadership]-[medical]-[surgery]-[pilot]-[police]-[powerloader]-[large_vehicle]-[mech_pilot]-[stamina]" #define SKILLSIDSRC(S) "skills-[S.cqc]-[S.melee_weapons]\ -[S.firearms]-[S.pistols]-[S.shotguns]-[S.rifles]-[S.smgs]-[S.heavy_weapons]-[S.smartgun]\ -[S.swordplay]\ --[S.engineer]-[S.construction]-[S.leadership]-[S.medical]-[S.surgery]-[S.pilot]-[S.police]-[S.powerloader]-[S.large_vehicle]-[S.stamina]" +-[S.engineer]-[S.construction]-[S.leadership]-[S.medical]-[S.surgery]-[S.pilot]-[S.police]-[S.powerloader]-[S.large_vehicle]-[mech_pilot]-[S.stamina]" /proc/getSkills(cqc = 0, melee_weapons = 0,\ firearms = 0, pistols = 0, shotguns = 0, rifles = 0, smgs = 0, heavy_weapons = 0, smartgun = 0,\ swordplay = 0,\ -engineer = 0, construction = 0, leadership = 0, medical = 0, surgery = 0, pilot = 0, police = 0, powerloader = 0, large_vehicle = 0, stamina = 0) +engineer = 0, construction = 0, leadership = 0, medical = 0, surgery = 0, pilot = 0, police = 0, powerloader = 0, large_vehicle = 0, mech_pilot = 0, stamina = 0) . = locate(SKILLSID) if(!.) . = new /datum/skills(cqc, melee_weapons,\ firearms, pistols, shotguns, rifles, smgs, heavy_weapons, smartgun,\ swordplay,\ - engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, stamina) + engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, mech_pilot, stamina) /proc/getSkillsType(skills_type = /datum/skills) var/datum/skills/new_skill = skills_type @@ -39,6 +39,7 @@ engineer = 0, construction = 0, leadership = 0, medical = 0, surgery = 0, pilot var/police = initial(new_skill.police) var/powerloader = initial(new_skill.powerloader) var/large_vehicle = initial(new_skill.large_vehicle) + var/mech_pilot = initial(new_skill.mech_pilot) var/stamina = initial(new_skill.stamina) //RUTGMC EDIT ADDITION BEGIN - SWORDS var/swordplay = initial(new_skill.swordplay) @@ -70,6 +71,7 @@ engineer = 0, construction = 0, leadership = 0, medical = 0, surgery = 0, pilot var/police = SKILL_POLICE_DEFAULT var/powerloader = SKILL_POWERLOADER_DEFAULT var/large_vehicle = SKILL_LARGE_VEHICLE_DEFAULT + var/mech_pilot = SKILL_MECH_PILOT_DEFAULT ///Effects stamina regen rate and regen delay var/stamina = SKILL_STAMINA_DEFAULT //RUTGMC EDIT ADDITION BEGIN - SWORDS @@ -79,7 +81,7 @@ engineer = 0, construction = 0, leadership = 0, medical = 0, surgery = 0, pilot /datum/skills/New(cqc, melee_weapons,\ firearms, pistols, shotguns, rifles, smgs, heavy_weapons, swordplay, smartgun,\ -engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, stamina) +engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, mech_pilot, stamina) if(!isnull(cqc)) src.cqc = cqc if(!isnull(melee_weapons)) @@ -116,6 +118,8 @@ engineer, construction, leadership, medical, surgery, pilot, police, powerloader src.powerloader = powerloader if(!isnull(large_vehicle)) src.large_vehicle = large_vehicle + if(!isnull(mech_pilot)) + src.mech_pilot = mech_pilot if(!isnull(stamina)) src.stamina = stamina //RUTGMC EDIT ADDITION BEGIN - SWORDS @@ -127,7 +131,7 @@ engineer, construction, leadership, medical, surgery, pilot, police, powerloader /// returns/gets a new skills datum with values changed according to the args passed /datum/skills/proc/modifyRating(cqc, melee_weapons,\ firearms, pistols, shotguns, rifles, smgs, heavy_weapons, swordplay, smartgun,\ -engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, stamina) +engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, mech_pilot, stamina) return getSkills(src.cqc+cqc,\ src.melee_weapons+melee_weapons,\ src.firearms+firearms,\ @@ -147,6 +151,7 @@ engineer, construction, leadership, medical, surgery, pilot, police, powerloader src.police+police,\ src.powerloader+powerloader,\ src.large_vehicle+large_vehicle,\ + src.mech_pilot+mech_pilot,\ src.stamina+stamina) /// acts as [/proc/modifyRating] but instead modifies all values rather than several specific ones @@ -170,12 +175,13 @@ engineer, construction, leadership, medical, surgery, pilot, police, powerloader src.police+difference,\ src.powerloader+difference,\ src.large_vehicle+difference,\ + src.mech_pilot+difference,\ src.stamina+difference) /// acts as [/proc/modifyRating] but sets the rating directly rather than modify it /datum/skills/proc/setRating(cqc, melee_weapons,\ firearms, pistols, shotguns, rifles, smgs, heavy_weapons, swordplay, smartgun,\ -engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, stamina) +engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, mech_pilot, stamina) return getSkills((isnull(cqc) ? src.cqc : cqc),\ (isnull(melee_weapons) ? src.melee_weapons : melee_weapons),\ (isnull(firearms) ? src.firearms : firearms),\ @@ -195,6 +201,7 @@ engineer, construction, leadership, medical, surgery, pilot, police, powerloader (isnull(police) ? src.police : police),\ (isnull(powerloader) ? src.powerloader : powerloader),\ (isnull(large_vehicle) ? src.large_vehicle : large_vehicle),\ + (isnull(mech_pilot) ? src.mech_pilot : mech_pilot),\ (isnull(stamina) ? src.stamina : stamina)) /datum/skills/vv_edit_var(var_name, var_value) @@ -235,6 +242,7 @@ engineer, construction, leadership, medical, surgery, pilot, police, powerloader SKILL_POLICE = police, SKILL_POWERLOADER = powerloader, SKILL_LARGE_VEHICLE = large_vehicle, + SKILL_MECH_PILOT = mech_pilot, SKILL_STAMINA = stamina, ) @@ -434,6 +442,7 @@ engineer, construction, leadership, medical, surgery, pilot, police, powerloader construction = SKILL_CONSTRUCTION_METAL powerloader = SKILL_POWERLOADER_PRO large_vehicle = SKILL_LARGE_VEHICLE_VETERAN + mech_pilot = SKILL_MECH_PILOT_TRAINED /datum/skills/assault_crewman name = ASSAULT_CREWMAN @@ -646,6 +655,7 @@ engineer, construction, leadership, medical, surgery, pilot, police, powerloader police = SKILL_POLICE_MP powerloader = SKILL_POWERLOADER_MASTER large_vehicle = SKILL_LARGE_VEHICLE_VETERAN + mech_pilot = SKILL_MECH_PILOT_TRAINED swordplay = SKILL_SWORDPLAY_TRAINED /* Deathsquad */ diff --git a/code/game/objects/items/pamphlets.dm b/code/game/objects/items/pamphlets.dm index 5ee4f164f8a..3e08bb2a782 100644 --- a/code/game/objects/items/pamphlets.dm +++ b/code/game/objects/items/pamphlets.dm @@ -24,6 +24,7 @@ var/police var/powerloader var/large_vehicle + var/mech_pilot var/stamina ///assoc list list(SKILL = MAXIMUM_INT) for when we dont want to let them read this @@ -38,7 +39,7 @@ if(!do_after(user, 5 SECONDS, NONE, user)) return user.set_skills(user.skills.modifyRating(cqc, melee_weapons, firearms, pistols, shotguns, rifles, smgs, heavy_weapons, swordplay, smartgun,\ - engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, stamina)) + engineer, construction, leadership, medical, surgery, pilot, police, powerloader, large_vehicle, mech_pilot, stamina)) user.temporarilyRemoveItemFromInventory(src) qdel(src) diff --git a/code/modules/vehicles/mecha/combat/greyscale/greyscale.dm b/code/modules/vehicles/mecha/combat/greyscale/greyscale.dm index 7482af329bc..edd7cddd48d 100644 --- a/code/modules/vehicles/mecha/combat/greyscale/greyscale.dm +++ b/code/modules/vehicles/mecha/combat/greyscale/greyscale.dm @@ -66,7 +66,7 @@ /obj/vehicle/sealed/mecha/combat/greyscale/mob_try_enter(mob/entering_mob, mob/user, loc_override = FALSE) - if((mecha_flags & MECHA_SKILL_LOCKED) && entering_mob.skills.getRating(SKILL_LARGE_VEHICLE) < SKILL_LARGE_VEHICLE_VETERAN) + if((mecha_flags & MECHA_SKILL_LOCKED) && entering_mob.skills.getRating(SKILL_MECH_PILOT) < SKILL_MECH_PILOT_TRAINED) balloon_alert(entering_mob, "You don't know how to pilot this") return FALSE return ..() diff --git a/code/modules/vehicles/mecha/combat/greyscale/greyscale_constructor.dm b/code/modules/vehicles/mecha/combat/greyscale/greyscale_constructor.dm index 032633edb19..40400a3555d 100644 --- a/code/modules/vehicles/mecha/combat/greyscale/greyscale_constructor.dm +++ b/code/modules/vehicles/mecha/combat/greyscale/greyscale_constructor.dm @@ -175,7 +175,7 @@ GLOBAL_LIST_INIT(greyscale_weapons_data, generate_greyscale_weapons_data()) . = ..() if(!.) return - if(user.skills.getRating(SKILL_LARGE_VEHICLE) < SKILL_LARGE_VEHICLE_VETERAN) + if(user.skills.getRating(SKILL_MECH_PILOT) < SKILL_MECH_PILOT_TRAINED) return FALSE /obj/machinery/computer/mech_builder/ui_interact(mob/user, datum/tgui/ui)