|
5 | 5 | var/list/treatments_item = list() // list(/obj/item = amount) |
6 | 6 | var/list/treatments_tool = list() // list(QUALITY_TOOL = FAILCHANCE) |
7 | 7 | var/list/treatments_chem = list() // list(CE_CHEMEFFECT = strength) |
| 8 | + var/list/stabilizers_chem = list() // like the above, but for stabilizing the wound. |
| 9 | + var/list/firstaid_type = list() //list(WE_TREATMENTTYPE = TREATEFFECT) |
8 | 10 | var/datum/internal_wound/scar // If defined, applies this wound type when successfully treated |
9 | 11 |
|
10 | 12 | var/diagnosis_stat // BIO for organic, MEC for robotic |
|
17 | 19 | // IWOUND_SPREAD - Allows the wound to spread to another organ |
18 | 20 | // IWOUND_HALLUCINATE - Causes hallucinations |
19 | 21 | // IWOUND_AGGRAVATION - inheritance increases severity gradually if progress IW flag is not present |
| 22 | + //IWOUND_RECOVER - recovers over time |
| 23 | + //IWOUND_STASIS - disables certain automatic changes |
20 | 24 | var/characteristic_flag = IWOUND_CAN_DAMAGE|IWOUND_PROGRESS |
21 | 25 |
|
22 | 26 | var/severity = 0 // How much the wound contributes to internal organ damage |
|
92 | 96 | if((!parent || O.status & ORGAN_DEAD) && !(characteristic_flag & IWOUND_PROGRESS_DEATH)) |
93 | 97 | return PROCESS_KILL |
94 | 98 |
|
95 | | - // Progress if not in a cryo tube or in stasis |
96 | | - if(characteristic_flag & IWOUND_PROGRESS && (H && !(H.bodytemperature < 170 || H.in_stasis))) |
| 99 | + // Progress if not recovering or in a cryo tube or in stasis |
| 100 | + if(characteristic_flag & IWOUND_RECOVER) |
| 101 | + treatment_slow() |
| 102 | + else if(characteristic_flag & IWOUND_PROGRESS && (H && !(H.bodytemperature < 170 || H.in_stasis))) |
97 | 103 | ++current_progression_tick |
98 | 104 | if(current_progression_tick >= progression_threshold) |
99 | 105 | current_progression_tick = 0 |
|
102 | 108 | if(!H) |
103 | 109 | return |
104 | 110 |
|
| 111 | + var/stabilized = characteristic_flag & IWOUND_STASIS |
105 | 112 | // Chemical treatment handling |
106 | 113 | var/list/owner_ce = H.chem_effects |
107 | 114 | for(var/chem_effect in owner_ce) |
|
110 | 117 | owner_ce[chem_effect] -= treatment_threshold |
111 | 118 | treatment(FALSE) |
112 | 119 | return |
| 120 | + if(chem_effect in stabilizers_chem) |
| 121 | + stabilized = TRUE |
| 122 | + if(stabilized) |
| 123 | + characteristic_flag &= ~(IWOUND_PROGRESS|IWOUND_PROGRESS_DEATH) // gotta do this somehow |
| 124 | + else if(severity < severity_max) |
| 125 | + characteristic_flag |= (initial(characteristic_flag) & (IWOUND_PROGRESS|IWOUND_PROGRESS_DEATH)) // re-add if not stabilized/stasis |
113 | 126 |
|
114 | 127 | // Spread once |
115 | 128 | if(characteristic_flag & IWOUND_SPREAD) |
|
153 | 166 | var/obj/item/organ/O = parent |
154 | 167 | var/obj/item/organ/external/E = parent ? O.parent : null |
155 | 168 | var/mob/living/carbon/human/H = parent ? O.owner : null |
156 | | - if(((characteristic_flag & IWOUND_CAN_DAMAGE) || hal_damage) && H) |
157 | | - H.custom_pain("Something inside your [E.name] hurts a lot.", 0) |
158 | 169 | if(severity < severity_max) |
159 | 170 | ++severity |
| 171 | + if(((characteristic_flag & IWOUND_CAN_DAMAGE) || hal_damage) && H) |
| 172 | + H.custom_pain("Something inside your [E.name] hurts a lot.", 0) |
160 | 173 | else |
161 | 174 | characteristic_flag &= ~(IWOUND_PROGRESS|IWOUND_PROGRESS_DEATH) // Lets us remove the wound from processing |
162 | 175 | if(next_wound && ispath(next_wound, /datum/internal_wound)) |
|
227 | 240 | if(severity > 0 && !used_tool) |
228 | 241 | --severity |
229 | 242 | // If it was turned off by reaching the max, turn it on again. |
230 | | - if(initial(characteristic_flag) & IWOUND_PROGRESS) |
231 | | - characteristic_flag |= IWOUND_PROGRESS |
| 243 | + characteristic_flag |= (initial(characteristic_flag) & (IWOUND_PROGRESS|IWOUND_PROGRESS_DEATH)) |
232 | 244 | else |
233 | 245 | if(!used_autodoc && scar && ispath(scar, /datum/internal_wound)) |
234 | 246 | SEND_SIGNAL_OLD(parent, COMSIG_IORGAN_ADD_WOUND, pick(subtypesof(scar))) |
|
243 | 255 | if(!QDELING(src) && treatmentamount < amount) |
244 | 256 | treatment_slow(amount - treatmentamount) |
245 | 257 |
|
| 258 | +/datum/internal_wound/proc/first_aid(list/aideffects = list()) |
| 259 | + parent?.owner.visible_message("aid attempt") |
| 260 | + for(var/totest in aideffects) |
| 261 | + if(firstaid_type[totest]) |
| 262 | + switch(firstaid_type[totest]) |
| 263 | + if(WOUND_STABLE) |
| 264 | + characteristic_flag &= ~(IWOUND_PROGRESS|IWOUND_PROGRESS_DEATH) |
| 265 | + characteristic_flag |= IWOUND_STASIS |
| 266 | + if(WOUND_RECOVER) |
| 267 | + characteristic_flag |= IWOUND_RECOVER |
| 268 | + break // most potent effect should end the loop |
| 269 | + |
| 270 | + |
246 | 271 | /datum/internal_wound/proc/apply_effects() |
247 | 272 | var/obj/item/organ/internal/O = parent |
248 | 273 |
|
|
0 commit comments