-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
commit 7d94c6e Author: Antoonij <[email protected]> Date: Sun Oct 6 18:11:41 2024 +0300 bugfix commit 765d34a Author: Antoonij <[email protected]> Date: Sat Oct 5 17:07:18 2024 +0300 fix for blob commit ca2dfaf Merge: f051eeb 2a35223 Author: Aziz Chynaliev <[email protected]> Date: Sat Oct 5 18:39:17 2024 +0500 Merge remote-tracking branch 'origin/master220' into zweifactor commit f051eeb Merge: da23987 86ec6b6 Author: Antoonij <[email protected]> Date: Thu Oct 3 15:29:25 2024 +0200 Merge branch 'master220' into zweifactor commit da23987 Merge: ffca8c3 9ffd4c3 Author: Antoonij <[email protected]> Date: Sun Sep 29 19:09:18 2024 +0200 Merge branch 'master220' into zweifactor commit ffca8c3 Author: Antoonij <[email protected]> Date: Sat Sep 28 21:48:12 2024 +0200 fix commit c4e5894 Merge: 2fcc6c5 7b0200f Author: Antoonij <[email protected]> Date: Sat Sep 28 21:34:52 2024 +0200 Merge branch 'master220' into zweifactor commit 2fcc6c5 Author: Antoonij <[email protected]> Date: Sun Sep 22 21:46:56 2024 +0200 mor readability commit 5fcd273 Author: Antoonij <[email protected]> Date: Sun Sep 22 21:30:00 2024 +0200 some evolution go back commit 6b96b55 Author: Antoonij <[email protected]> Date: Sun Sep 22 21:28:59 2024 +0200 UPD читаемости commit ffe32f0 Author: Antoonij <[email protected]> Date: Sun Sep 22 15:57:18 2024 +0200 попытки исправить номер 3 commit d5f0ff6 Author: Antoonij <[email protected]> Date: Sun Sep 22 15:50:18 2024 +0200 ищу причины поломки карт часть 2 commit 49a2c21 Author: Antoonij <[email protected]> Date: Sun Sep 22 15:12:18 2024 +0200 попытки починить карту номер 1 commit fc4642b Author: Antoonij <[email protected]> Date: Sun Sep 22 15:01:32 2024 +0200 clrf type commit 60d28d4 Author: Antoonij <[email protected]> Date: Sun Sep 22 14:57:39 2024 +0200 опять трейлинг? commit 2c30505 Author: Antoonij <[email protected]> Date: Sun Sep 22 14:53:25 2024 +0200 thank you prefabs commit 43e34ef Author: Antoonij <[email protected]> Date: Sun Sep 22 14:49:10 2024 +0200 final???? commit 8c23cda Author: Antoonij <[email protected]> Date: Sun Sep 22 14:41:38 2024 +0200 forgotten things nr2 commit 581b1b2 Author: Antoonij <[email protected]> Date: Sun Sep 22 14:34:03 2024 +0200 fix forgotten things nr1 commit a209e91 Author: Antoonij <[email protected]> Date: Sun Sep 22 14:21:22 2024 +0200 pre pr improve commit e3a8b93 Author: Antoonij <[email protected]> Date: Sun Sep 22 14:19:56 2024 +0200 dme commit 8ec8390 Author: Antoonij <[email protected]> Date: Sun Sep 22 14:18:42 2024 +0200 final
- Loading branch information
Showing
70 changed files
with
602 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/datum/component/animal_temperature | ||
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS | ||
/// Min body temp | ||
var/minbodytemp | ||
/// Max body temp | ||
var/maxbodytemp | ||
/// Damage when below min temp | ||
var/cold_damage | ||
/// Damage when above max temp | ||
var/heat_damage | ||
/// If true - alert will be shown | ||
var/show_alert | ||
|
||
/datum/component/animal_temperature/Initialize( | ||
minbodytemp = 250, | ||
maxbodytemp = 350, | ||
cold_damage = 2, | ||
heat_damage = 2, | ||
show_alert = FALSE | ||
) | ||
if(!isanimal(parent)) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
src.minbodytemp = minbodytemp | ||
src.maxbodytemp = maxbodytemp | ||
src.cold_damage = cold_damage | ||
src.heat_damage = heat_damage | ||
src.show_alert = show_alert | ||
|
||
/datum/component/animal_temperature/RegisterWithParent() | ||
RegisterSignal(parent, COMSIG_ANIMAL_HANDLE_ENVIRONMENT, PROC_REF(handle_environment)) | ||
|
||
/datum/component/animal_temperature/UnregisterFromParent() | ||
UnregisterSignal(parent, COMSIG_ANIMAL_HANDLE_ENVIRONMENT) | ||
|
||
/datum/component/animal_temperature/proc/handle_environment(datum/source, datum/gas_mixture/environment) | ||
SIGNAL_HANDLER | ||
|
||
var/mob/living/simple_animal/animal = source | ||
|
||
INVOKE_ASYNC(src, PROC_REF(regulate_temperature), animal, environment) | ||
INVOKE_ASYNC(src, PROC_REF(check_temperature), animal) | ||
|
||
/datum/component/animal_temperature/proc/regulate_temperature(mob/living/simple_animal/animal, datum/gas_mixture/environment) | ||
var/areatemp = animal.get_temperature(environment) | ||
|
||
if(abs(areatemp - animal.bodytemperature) > 5) | ||
var/diff = areatemp - animal.bodytemperature | ||
diff = diff / 5 | ||
animal.adjust_bodytemperature(diff) | ||
|
||
return | ||
|
||
/datum/component/animal_temperature/proc/check_temperature(mob/living/simple_animal/animal) | ||
if(animal.bodytemperature < minbodytemp) | ||
animal.adjustHealth(cold_damage) | ||
|
||
if(show_alert) | ||
animal.throw_alert("temp", /atom/movable/screen/alert/cold, get_severity(animal)) | ||
|
||
return TRUE | ||
|
||
if(animal.bodytemperature > maxbodytemp) | ||
animal.adjustHealth(heat_damage) | ||
|
||
if(show_alert) | ||
animal.throw_alert("temp", /atom/movable/screen/alert/hot, get_severity(animal)) | ||
|
||
return TRUE | ||
|
||
animal.clear_alert("temp") | ||
return FALSE | ||
|
||
/datum/component/animal_temperature/proc/get_severity(mob/living/simple_animal/animal) | ||
var/multiplier = animal.bodytemperature < minbodytemp ? (1 / minbodytemp) : (1 / maxbodytemp) | ||
var/severity = CEILING(abs(animal.bodytemperature / multiplier), 1) | ||
return min(severity, 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.