Ports a character customization option: Quirks (#28388)

* Makes the datum

* Initial Commit

* Gets TGUI menu not crashing

* Autodoc

* quirk menu bugged

* oh.

* Working menu + buttons

* trait defintes pt 1/?

* Moves traits around

* ACTUALLY START ON THE QUIRKS THEMSELVES

* TGUI Bundle Rebuild

* TGUI properly saves now

* Removes allergies for scope reasons, make foreigner work properly

* TGUI tweaks

* Reworks TGUI Menu

* quirks store the mob, not mind

* Adds asthma and mute

* minor tweaks

* Cloning re-adds quirks

* Adds functionality to frail

* Adds crafty

* TGUI fix

* Fixes a frail bug

* Makes sure the list is in the correct format

* TGUI size change

* Makes skittish work

* Adds glutton, removes unused traits

* Changes description and adds function to glutton

* Freerunner functioning

* Crafty buff

* Clear quirk list when changing species

* Forgot to remove light step

* Delete

* Refactor item-giving

* TGUI Bundle Rebuild

* whoops

* Apply quirks when changing species

* Removes some unneeded defines/paths

* Replaces improved charging cord with a bad charger

* coment

* Guard clause

* Changes how quirks add and remove organs

* unused var

* adding organs works, removing them doesn't yet

* oh that fixed it

* Hopefully finally once and for all fix the json issues

* Buffs asthma

* switches the processor to ssobj since it's slower

* actually spawns the items whoops

* maybe actually fixes json issues I really hope this doesn't come up again?

* moves sql to the right directory

* CULPRIT FOUND, JSON ISSUES ACTUALLY SOLVED

* adds admin tooling for quirks

* Ups the cost of lungs

* Adds removal for the drinking ones

* Fixes some duplicate code

* Removing foreigner works

* wops

* bumps sql version to 65

* prettier

* semicolon

* Foreigners can understand galcomm but not speak it, as per headmin request

* Different solution was agreed upon

* CC announcements now get auto-translated

* Apply suggestions from code review

Lewc quick suggestions

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Move alcohol tolerance basetype

* accomodates for reset_styles

* Swap to species flags, and being dead is a universal process stopper

* adds a foreigner trait

* Xenos and the like can't understand CC's translated announcements

* TGUI Bundle Rebuild

* Lewc quick fixes

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* i forgor

* i forgor pt 2

* process properly returns true

* TGUI Bundle Rebuild

* sql update for fixing merge conflicts

* bundle changes

* actual sql fix

* Not test tiny in prod

* sql fix?

* tgui update, first pass

* Adds schema changes to main quirk branch

* persistent data works now

* TGUI Bundle Rebuild

* Fixes conflict with job assignment datumization

* TGUI Bundle Rebuild

* Adds pacifism by request, -3 points

* gives skittish a small cd

* Makes the lunch randomizer  I was thinking about doing

* GC returns a qdel hint now

* Removes hard refs

* SQL save fix

* Fixes admin tools

* Fixes wizards getting quirked up

* ragin too

* Lightweight is more lightweight

* Adds admin logging for when someone makes a languagesless character

* TGUI Bundle Rebuild

* Adds colorblind, hungry, and buffs asthma

* fixed vv post-merge conflict

* behold, my monster

* rebuild and merge master

* Adds more positive quirks, and makes monochrome give more points

* adds nearsighted, and no whispering

* sorry linter

* Adds the cool quirk, thanks to pumpkin312

* Oh dear that signal gets sent to everyone every time someone spawns in

* i forgot that slimes dont have eyes

* tgui fix

* bundle rebuild probably

* prettier

* prettier

* Skittish package fix

* force add bundle

* Makes plasmemes be unable to take foreigner

* Makes advanced lungs respect the owner's species

* makes breaking open wrapped crates/lockers a do_after_once

* Makes plasmeme/vox advanced lungs actually help

* You get glasses anyway whoops

* bundle rebuild

---------

Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
This commit is contained in:
BiancaWilkson
2025-11-03 19:18:52 -05:00
committed by GitHub
parent 99d57fd35d
commit d558a69583
49 changed files with 971 additions and 78 deletions
@@ -515,6 +515,7 @@
/obj/item/apc_powercord/proc/powerdraw_loop(obj/machinery/power/apc/A, mob/living/carbon/human/H)
H.visible_message("<span class='notice'>[H] inserts a power connector into \the [A].</span>", "<span class='notice'>You begin to draw power from \the [A].</span>")
drawing_power = TRUE
var/can_safely_charge = HAS_TRAIT(H, TRAIT_NO_APC_CHARGING) ? FALSE : TRUE
while(do_after(H, 10, target = A))
if(loc != H)
to_chat(H, "<span class='warning'>You must keep your connector out while charging!</span>")
@@ -524,6 +525,8 @@
break
A.charging = APC_IS_CHARGING
if(A.cell.charge >= 500)
if(!can_safely_charge)
H.adjust_bodytemperature(60) // Don't overcharge your batteries
H.adjust_nutrition(50)
A.cell.charge -= 500
to_chat(H, "<span class='notice'>You siphon off some of the stored charge for your own use.</span>")
@@ -537,6 +540,14 @@
break
H.visible_message("<span class='notice'>[H] unplugs from \the [A].</span>", "<span class='notice'>You unplug from \the [A].</span>")
drawing_power = FALSE
if(can_safely_charge)
return
if(H.bodytemperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
H.fire_stacks += 10
H.IgniteMob()
var/datum/organ/battery/microbattery = H.get_int_organ_datum(ORGAN_DATUM_BATTERY)
microbattery.linked_organ.receive_damage(H.bodytemperature / 50)
H.visible_message("<span class='warning'>...Then immediately bursts into flame!</span>", "<span class='userdanger'>Something inside you combusts!</span>")
/datum/action/item_action/organ_action/toggle/telebaton
button_icon = 'icons/obj/items.dmi'
+6 -6
View File
@@ -46,6 +46,7 @@
origin_tech = "biotech=4"
status = ORGAN_ROBOT
var/species_state = "default"
var/list/possible = list("default" = /datum/organ/lungs, "vox" = /datum/organ/lungs/vox, "plasmamen" = /datum/organ/lungs/plasmamen)
/obj/item/organ/internal/lungs/cybernetic/examine(mob/user)
. = ..()
@@ -55,15 +56,15 @@
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
var/possible = list("default" = /datum/organ/lungs, "vox" = /datum/organ/lungs/vox, "plasmamen" = /datum/organ/lungs/plasmamen)
var/chosen = input(user, "Select lung type", "What kind of lung settings?") as null|anything in possible
if(isnull(chosen) || chosen == species_state || !Adjacent(user) || !I.use_tool(src, user, 0, volume = I.tool_volume))
return
species_state = chosen
to_chat(user, "<span class='notice'>You configure [src] to [chosen] settings.</span>")
configure_species(chosen)
var/typepath = possible[chosen]
/obj/item/organ/internal/lungs/cybernetic/proc/configure_species(new_species_state)
species_state = new_species_state
var/typepath = possible[new_species_state]
var/datum/organ/lungs/lungs = new typepath(src)
qdel(organ_datums[lungs.organ_tag])
organ_datums[lungs.organ_tag] = lungs
@@ -75,10 +76,9 @@
desc = "A more advanced version of the stock cybernetic lungs. They are capable of filtering out lower levels of toxins and carbon dioxide."
icon_state = "lungs-c-u"
origin_tech = "biotech=5"
organ_datums = list(/datum/organ/lungs/advanced_cyber)
/obj/item/organ/internal/lungs/cybernetic/upgraded/multitool_act(mob/user, obj/item/I)
/obj/item/organ/internal/lungs/cybernetic/upgraded/configure_species(new_species_state)
. = ..()
var/datum/organ/lungs/lungs = organ_datums[ORGAN_DATUM_LUNGS]
lungs.make_advanced()
@@ -78,6 +78,7 @@
if(H.health < HEALTH_THRESHOLD_CRIT)
return FALSE
var/asthma_multiplier = HAS_TRAIT(H, TRAIT_ASTHMATIC) ? 0.5 : 1
//Partial pressures in our breath
var/O2_pp = breath.get_breath_partial_pressure(breath.oxygen())
var/N2_pp = breath.get_breath_partial_pressure(breath.nitrogen())
@@ -103,7 +104,7 @@
handle_too_little_breath(H, O2_pp, safe_oxygen_min, breath.oxygen())
H.throw_alert("not_enough_oxy", /atom/movable/screen/alert/not_enough_oxy)
else
H.adjustOxyLoss(-HUMAN_MAX_OXYLOSS)
H.adjustOxyLoss(-HUMAN_MAX_OXYLOSS * asthma_multiplier)
H.clear_alert("not_enough_oxy")
// Exhale
@@ -127,7 +128,7 @@
handle_too_little_breath(H, N2_pp, safe_nitro_min, breath.nitrogen())
H.throw_alert("not_enough_nitro", /atom/movable/screen/alert/not_enough_nitro)
else
H.adjustOxyLoss(-HUMAN_MAX_OXYLOSS)
H.adjustOxyLoss(-HUMAN_MAX_OXYLOSS * asthma_multiplier)
H.clear_alert("not_enough_nitro")
// Exhale
@@ -160,7 +161,7 @@
handle_too_little_breath(H, CO2_pp, safe_co2_min, breath.carbon_dioxide())
H.throw_alert("not_enough_co2", /atom/movable/screen/alert/not_enough_co2)
else
H.adjustOxyLoss(-HUMAN_MAX_OXYLOSS)
H.adjustOxyLoss(-HUMAN_MAX_OXYLOSS * asthma_multiplier)
H.clear_alert("not_enough_co2")
// Exhale
@@ -186,7 +187,7 @@
handle_too_little_breath(H, Toxins_pp, safe_toxins_min, breath.toxins())
H.throw_alert("not_enough_tox", /atom/movable/screen/alert/not_enough_tox)
else
H.adjustOxyLoss(-HUMAN_MAX_OXYLOSS)
H.adjustOxyLoss(-HUMAN_MAX_OXYLOSS * asthma_multiplier)
H.clear_alert("not_enough_tox")
// Exhale
@@ -366,3 +367,13 @@
cold_level_1_threshold = 200
cold_level_2_threshold = 140
cold_level_3_threshold = 100
/datum/organ/lungs/vox/make_advanced()
. = ..()
safe_oxygen_max = 20
/datum/organ/lungs/plasmamen/make_advanced()
. = ..()
safe_oxygen_max = 20
safe_toxins_max = 0
+20 -6
View File
@@ -224,6 +224,8 @@
var/max_limb_damage = max_damage
if(owner && fragile)
max_limb_damage -= (HAS_TRAIT(owner, TRAIT_IPC_JOINTS_MAG) ? max_damage * 0.25 : 0)
if(owner && HAS_TRAIT(owner, TRAIT_FRAIL))
max_limb_damage /= 2
if(tough && !ignore_resists)
brute = max(0, brute - 5)
burn = max(0, burn - 4)
@@ -319,9 +321,9 @@
//If limb took enough damage, try to cut or tear it off
if(owner)
if(sharp && !(limb_flags & CANNOT_DISMEMBER))
if(limb_brute + limb_burn >= max_damage && prob(original_brute / 2))
if(limb_brute + limb_burn >= max_limb_damage && prob(original_brute / 2))
droplimb(0, DROPLIMB_SHARP)
if(limb_brute + limb_burn >= max_damage && prob(original_burn / 2))
if(limb_brute + limb_burn >= max_limb_damage && prob(original_burn / 2))
droplimb(0, DROPLIMB_BURN)
if(owner_old)
@@ -529,21 +531,33 @@ Note that amputating the affected organ does in fact remove the infection from t
//Updates brute_damn and burn_damn from wound damages. Updates BLEEDING status.
/obj/item/organ/external/proc/check_fracture(damage_inflicted)
if(GLOB.configuration.general.breakable_bones && brute_dam > min_broken_damage && !is_robotic())
if(prob(damage_inflicted))
var/frail_multiplier = 1
if(owner)
frail_multiplier = HAS_TRAIT(owner, TRAIT_FRAIL) ? 2 : 1
var/adjusted_broken_damage = min_broken_damage / frail_multiplier
if(GLOB.configuration.general.breakable_bones && brute_dam > adjusted_broken_damage && !is_robotic())
if(prob(damage_inflicted * frail_multiplier))
fracture()
/obj/item/organ/external/proc/check_for_internal_bleeding(damage)
var/frail_multiplier = 1
if(owner && (NO_BLOOD in owner.dna.species.species_traits))
return
if(owner)
frail_multiplier = HAS_TRAIT(owner, TRAIT_FRAIL) ? 2 : 1
var/adjusted_broken_damage = min_broken_damage / frail_multiplier
var/local_damage = brute_dam + damage
if(damage > 15 && local_damage > min_broken_damage && prob(damage))
if(damage > 15 && local_damage > adjusted_broken_damage && prob(damage * frail_multiplier))
cause_internal_bleeding()
/obj/item/organ/external/proc/check_for_burn_wound(damage, update_health = TRUE)
var/frail_multiplier = 1
if(is_robotic())
return
if(burn_dam >= min_broken_damage && prob(damage * max(owner.bodytemperature / BODYTEMP_HEAT_DAMAGE_LIMIT, 1)))
if(owner)
frail_multiplier = HAS_TRAIT(owner, TRAIT_FRAIL) ? 2 : 1
var/adjusted_broken_damage = min_broken_damage / frail_multiplier
if(burn_dam >= adjusted_broken_damage && prob(damage * frail_multiplier * max(owner.bodytemperature / BODYTEMP_HEAT_DAMAGE_LIMIT, 1)))
cause_burn_wound(update_health)
/obj/item/organ/external/proc/check_skin_covers(brute, burn)