diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index dc6c8d0d7bc..500553e1f28 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -20,7 +20,7 @@ init_datum_subtypes(/datum/job, joblist, list(/datum/job/ai, /datum/job/cyborg), "title") init_datum_subtypes(/datum/superheroes, all_superheroes, null, "name") - init_datum_subtypes(/datum/nations, all_nations, null, "name") + init_datum_subtypes(/datum/nations, all_nations, null, "default_name") init_datum_subtypes(/datum/language, all_languages, null, "name") for (var/language_name in all_languages) diff --git a/code/game/dna/genes/goon_disabilities.dm b/code/game/dna/genes/goon_disabilities.dm index 14e25c4ef69..2db8f3e08f0 100644 --- a/code/game/dna/genes/goon_disabilities.dm +++ b/code/game/dna/genes/goon_disabilities.dm @@ -37,9 +37,10 @@ block=RADBLOCK OnMobLife(var/mob/living/owner) - owner.apply_effect(max(owner.radiation, 20), IRRADIATE) + var/radiation_amount = abs(min(owner.radiation - 20,0)) + owner.apply_effect(radiation_amount, IRRADIATE) for(var/mob/living/L in range(1, owner)) - if(L == owner) + if(L == owner) continue L << "You are enveloped by a soft green glow emanating from [owner]." L.apply_effect(5, IRRADIATE) diff --git a/code/game/gamemodes/nations/nations.dm b/code/game/gamemodes/nations/nations.dm index 24c7bc1e82b..9adbc849c51 100644 --- a/code/game/gamemodes/nations/nations.dm +++ b/code/game/gamemodes/nations/nations.dm @@ -13,6 +13,7 @@ datum/game_mode/nations kickoff=1 send_intercept() split_teams() + assign_leaders() set_ai() // remove_access() for(var/mob/M in player_list) @@ -39,7 +40,12 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudatmosia") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + if(H.mind.assigned_role == H.mind.nation.default_leader) + H.mind.nation.current_leader = H.mind.current + H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!" + continue + H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!" continue if(H.mind.assigned_role in medical_positions) @@ -47,7 +53,12 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudmedistan") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + if(H.mind.assigned_role == H.mind.nation.default_leader) + H.mind.nation.current_leader = H.mind.current + H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!" + continue + H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!" continue if(H.mind.assigned_role in science_positions) @@ -55,7 +66,12 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudscientopia") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + if(H.mind.assigned_role == H.mind.nation.default_leader) + H.mind.nation.current_leader = H.mind.current + H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!" + continue + H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!" continue if(H.mind.assigned_role in security_positions) @@ -63,7 +79,12 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudbrigston") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + if(H.mind.assigned_role == H.mind.nation.default_leader) + H.mind.nation.current_leader = H.mind.current + H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!" + continue + H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!" continue if(H.mind.assigned_role in cargonians) @@ -71,7 +92,12 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcargonia") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + if(H.mind.assigned_role == H.mind.nation.default_leader) + H.mind.nation.current_leader = H.mind.current + H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!" + continue + H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!" continue if(H.mind.assigned_role in servicion) @@ -79,7 +105,12 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudservice") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + if(H.mind.assigned_role == H.mind.nation.default_leader) + H.mind.nation.current_leader = H.mind.current + H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!" + continue + H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!" continue if(H.mind.assigned_role in support_positions) @@ -87,7 +118,12 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcommand") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + if(H.mind.assigned_role == H.mind.nation.default_leader) + H.mind.nation.current_leader = H.mind.current + H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!" + continue + H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!" continue if(H.mind.assigned_role in command_positions) @@ -95,7 +131,12 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcommand") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + if(H.mind.assigned_role == H.mind.nation.default_leader) + H.mind.nation.current_leader = H.mind.current + H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!" + continue + H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!" continue if(H.mind.assigned_role in civilian_positions) @@ -129,6 +170,20 @@ datum/game_mode/nations if(W.z in config.station_levels) W.req_access = list() + +/datum/game_mode/nations/proc/assign_leaders() + for(var/datum/nations/N in all_nations) + if(!N.current_name) + N.current_name = N.default_name + if(!N.current_leader) + N.current_leader = pick(N.membership) + N.current_leader << "You have been chosen to lead the nation of [N.current_name]!" + var/mob/living/carbon/human/H = N.current_leader + H.verbs += /datum/game_mode/nations/proc/set_nation_name + H.verbs += /datum/game_mode/nations/proc/set_ranks + H.verbs += /datum/game_mode/nations/proc/choose_heir + N.update_nation_id() + /** * LateSpawn hook. * Called in newplayer.dm when a humanoid character joins the round after it started. @@ -148,7 +203,8 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudatmosia") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!" return 1 if(H.mind.assigned_role in medical_positions) @@ -156,7 +212,8 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudmedistan") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!" return 1 if(H.mind.assigned_role in science_positions) @@ -164,7 +221,8 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudscientopia") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!" return 1 if(H.mind.assigned_role in security_positions) @@ -172,7 +230,8 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudbrigston") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!" return 1 if(H.mind.assigned_role in cargonians) @@ -180,7 +239,8 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcargonia") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!" return 1 if(H.mind.assigned_role in servicion) @@ -188,7 +248,8 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudservice") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!" return 1 if(H.mind.assigned_role in support_positions) @@ -196,7 +257,8 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcommand") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!" return 1 if(H.mind.assigned_role in command_positions) @@ -204,7 +266,8 @@ datum/game_mode/nations H.hud_updateflag |= 1 << NATIONS_HUD var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcommand") H.client.images += I - H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + H.mind.nation.membership += H.mind.current + H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!" return 1 if(H.mind.assigned_role in civilian_positions) diff --git a/code/game/gamemodes/nations/nationsdatums.dm b/code/game/gamemodes/nations/nationsdatums.dm index 64067acb041..0e94ac28e8a 100644 --- a/code/game/gamemodes/nations/nationsdatums.dm +++ b/code/game/gamemodes/nations/nationsdatums.dm @@ -1,23 +1,37 @@ /datum/nations - var/name + var/default_name + var/current_name + var/default_leader + var/current_leader + var/list/membership = list() + var/leader_rank = "Leader" + var/member_rank = "Member" + var/heir /datum/nations/atmosia - name = "Atmosia" + default_name = "Atmosia" + default_leader = "Chief Engineer" /datum/nations/brigston - name = "Brigston" + default_name = "Brigston" + default_leader = "Head of Security" /datum/nations/cargonia - name = "Cargonia" + default_name = "Cargonia" + default_leader = "Quartermaster" /datum/nations/command - name = "People's Republic of Commandzakstan" + default_name = "People's Republic of Commandzakstan" + default_leader = "Captain" /datum/nations/medistan - name = "Medistan" + default_name = "Medistan" + default_leader = "Chief Medical Officer" /datum/nations/scientopia - name = "Scientopia" + default_name = "Scientopia" + default_leader = "Research Director" /datum/nations/service - name = "Servicion" \ No newline at end of file + default_name = "Servicion" + default_leader = "Bartender" \ No newline at end of file diff --git a/code/game/gamemodes/nations/nationsprocs.dm b/code/game/gamemodes/nations/nationsprocs.dm new file mode 100644 index 00000000000..020d05f8480 --- /dev/null +++ b/code/game/gamemodes/nations/nationsprocs.dm @@ -0,0 +1,104 @@ +/datum/game_mode/nations/proc/set_nation_name() + set name = "Rename Nation" + set category = "Nations" + set desc = "Click to rename your nation. You are only able to do this once." + + if(!kickoff) return 1 + + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + if(H.mind && H.mind.nation && H.mind.nation.current_leader == H) + var/input = stripped_input(H,"What do you want to name your nation?", ,"", MAX_NAME_LEN) + + if(input) + H.mind.nation.current_name = input + H.mind.nation.update_nation_id() + H << "You rename your nation to [input]." + H.verbs -= /datum/game_mode/nations/proc/set_nation_name + return 1 + + +/datum/game_mode/nations/proc/set_ranks() + set name = "Set Ranks" + set category = "Nations" + set desc = "Click to set a rank for Leaders and Members." + + if(!kickoff) return 1 + + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + if(H.mind && H.mind.nation && H.mind.nation.current_leader == H) + var/type = input(H, "What rank do you want to change?", "Rename Rank", "") in list("Leader","Member") + var/input = stripped_input(H,"What rank do you want?", ,"", MAX_NAME_LEN) + if(input) + if(type == "Leader") + H.mind.nation.leader_rank = input + H.mind.nation.update_nation_id() + + if(type == "Member") + H.mind.nation.member_rank = input + H.mind.nation.update_nation_id() + H << "You changed the [type] rank of your nation to [input]." + return 1 + +/datum/game_mode/nations/proc/choose_heir() + set name = "Choose Heir" + set category = "Nations" + set desc = "Click to pick a Heir. Note that the Heir has the ability to take over your role at ANY TIME. Choose carefully." + + if(!kickoff) return 1 + + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + if(H.mind && H.mind.nation && H.mind.nation.current_leader == H) + var/heir = input(H, "Who do you wish to make your heir?", "Choose Heir", "") as null|anything in H.mind.nation.membership + if(heir) + if(H.mind.nation.heir) + var/mob/living/carbon/human/oldheir = H.mind.nation.heir + oldheir << "You are no longer the heir to your nation!" + oldheir.verbs -= /datum/game_mode/nations/proc/takeover + var/mob/living/carbon/human/newheir = heir + H.mind.nation.heir = newheir + newheir.verbs += /datum/game_mode/nations/proc/takeover + newheir << "You have been selected to be the heir to your nation's leadership!" + H << "You have selected [heir] to be your heir!" + + +/datum/game_mode/nations/proc/takeover() + set name = "Become Leader" + set category = "Nations" + set desc = "Click to replace your current nation's leader with yourself." + + if(!kickoff) return 1 + + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + if(H.mind && H.mind.nation && H.mind.nation.heir == H) + var/confirmation = input(H, "Are you sure you want to take over leadership?", "Become Leader", "") as null|anything in list("Yes", "No") + if(confirmation == "Yes") + var/mob/living/carbon/human/oldleader = H.mind.nation.current_leader + oldleader << "You have been replaced by [H.name] as the leader of [H.mind.nation.current_name]!" + oldleader.verbs -= /datum/game_mode/nations/proc/set_nation_name + oldleader.verbs -= /datum/game_mode/nations/proc/set_ranks + oldleader.verbs -= /datum/game_mode/nations/proc/choose_heir + H.mind.nation.current_leader = H + H.mind.nation.heir = null + H.verbs -= /datum/game_mode/nations/proc/takeover + H.verbs += /datum/game_mode/nations/proc/set_nation_name + H.verbs += /datum/game_mode/nations/proc/set_ranks + H.verbs += /datum/game_mode/nations/proc/choose_heir + H << "You have replaced [oldleader.name] as the leader of [H.mind.nation.current_name]!" + H.mind.nation.update_nation_id() + + +/datum/nations/proc/update_nation_id() + for(var/mob/living/carbon/human/M in membership) + for(var/obj/item/weapon/card/id/I in M.contents) + if(I.registered_name == M.real_name) + if(M == current_leader) + I.name = "[I.registered_name]'s ID Card ([current_name] [leader_rank])" + I.assignment = "[current_name] [leader_rank]" + else + I.name = "[I.registered_name]'s ID Card ([current_name] [member_rank])" + I.assignment = "[current_name] [member_rank]" + diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 61a4ac39c68..b9a8991e5af 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -537,11 +537,11 @@ Traitors and the like can also be revived with the previous role mostly intact. /client/proc/cmd_admin_create_centcom_report() set category = "Event" set name = "Create Communications Report" - + var/list/MsgType = list("Centcom Report","Enemy Communications") if(!check_rights(R_SERVER|R_EVENT)) return - var/type = input(usr, "Pick a type of report to send", "Report Type", "") in list("Centcom Report","Enemy Communications") + var/type = input(usr, "Pick a type of report to send", "Report Type", "") as anything in MsgType var/input = input(usr, "Please enter anything you want. Anything. Serious.", "What?", "") as message|null var/customname = input(usr, "Pick a title for the report.", "Title") as text|null if(!input) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f3a376ee180..fa1d21e3bd5 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -245,6 +245,9 @@ stat(null, "Intent: [a_intent]") stat(null, "Move Mode: [m_intent]") + + stat(null, "Station Time: [worldtime2text()]") + if(ticker && ticker.mode && ticker.mode.name == "AI malfunction") if(ticker.mode:malf_mode_declared) stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]") @@ -275,7 +278,12 @@ if(mind.changeling) stat("Chemical Storage", "[mind.changeling.chem_charges]/[mind.changeling.chem_storage]") stat("Absorbed DNA", mind.changeling.absorbedcount) - stat(null, "Station Time: [worldtime2text()]") + + if(mind.nation) + stat("Nation Name", "[mind.nation.current_name ? "[mind.nation.current_name]" : "[mind.nation.default_name]"]") + stat("Nation Leader", "[mind.nation.current_leader ? "[mind.nation.current_leader]" : "None"]") + stat("Nation Heir", "[mind.nation.heir ? "[mind.nation.heir]" : "None"]") + if(istype(loc, /obj/spacepod)) // Spacdpods! var/obj/spacepod/S = loc diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 74832646851..fe373bf3280 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -821,112 +821,67 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc return //TODO: DEFERRED /mob/living/carbon/human/handle_regular_status_updates() - if(status_flags & GODMODE) return 0 + . = ..() + //SSD check, if a logged player is awake put them back to sleep! if(player_logged && sleeping < 2) sleeping = 2 - if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP - blinded = 1 - silent = 0 - else //ALIVE. LIGHTS ARE ON - + if(.) //alive if(REGEN in mutations) if(nutrition) if(prob(10)) - var/randumb = rand(1,5) + var/randumb = rand(1, 5) nutrition -= randumb - heal_overall_damage(randumb,randumb) + heal_overall_damage(randumb, randumb) if(nutrition < 0) nutrition = 0 - // Sobering multiplier. - // Sober block grants quadruple the alcohol metabolism. -// var/sober_str=!(SOBER in mutations)?1:4 - - updatehealth() //TODO if(!in_stasis) - handle_organs() //Optimized. + handle_organs() handle_blood() - if(health <= config.health_threshold_dead || brain_op_stage == 4.0) - death() - blinded = 1 - silent = 0 - return 1 - - // the analgesic effect wears off slowly + //the analgesic effect wears off slowly analgesic = max(0, analgesic - 1) - //UNCONSCIOUS. NO-ONE IS HOME - if( (getOxyLoss() > 50) || (config.health_threshold_crit >= health) ) - Paralyse(3) - - /* Done by handle_breath() - if( health <= 20 && prob(1) ) - spawn(0) - emote("gasp") - if(!reagents.has_reagent("epinephrine")) - adjustOxyLoss(1)*/ - if(hallucination && !(species.flags & NO_DNA_RAD)) - spawn handle_hallucinations() + spawn() + handle_hallucinations() - if(hallucination<=2) + if(hallucination <= 2) hallucination = 0 halloss = 0 else hallucination -= 2 - - if(halloss > 100) - src << "You're in too much pain to keep going..." - for(var/mob/O in oviewers(src, null)) - O.show_message("[src] slumps to the ground, too weak to continue fighting.", 1) - Paralyse(10) - setHalLoss(99) - if(paralysis) blinded = 1 stat = UNCONSCIOUS - if(halloss > 0) - adjustHalLoss(-3) + else if(sleeping) speech_problem_flag = 1 - handle_dreams() - adjustStaminaLoss(-10) - adjustHalLoss(-3) - if (mind) + + if(mind) //Are they SSD? If so we'll keep them asleep but work off some of that sleep var in case of ether or similar. if(player_logged) - sleeping = max(sleeping-1, 2) - else - sleeping = max(sleeping-1, 0) + sleeping = max(sleeping - 1, 2) + blinded = 1 stat = UNCONSCIOUS - if( prob(2) && health && !hal_crit ) - spawn(0) - emote("snore") + if(mind) if(mind.vampire) if(istype(loc, /obj/structure/closet/coffin)) adjustBruteLoss(-1) adjustFireLoss(-1) adjustToxLoss(-1) + else if(status_flags & FAKEDEATH) blinded = 1 stat = UNCONSCIOUS - else if(resting) - if(halloss > 0) - adjustHalLoss(-3) - //CONSCIOUS - else - stat = CONSCIOUS - if(halloss > 0) - adjustHalLoss(-1) if(embedded_flag && !(mob_master.current_cycle % 10)) var/list/E @@ -934,7 +889,8 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(!E.len) embedded_flag = 0 - //Vision + + //Vision //god knows why this is here var/obj/item/organ/vision if(species.vision_organ) vision = internal_organs_by_name[species.vision_organ] @@ -943,17 +899,21 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc eye_blind = 0 blinded = 0 eye_blurry = 0 + else if(!vision || vision.is_broken()) // Vision organs cut out or broken? Permablind. eye_blind = 1 blinded = 1 eye_blurry = 1 + else //blindness if(sdisabilities & BLIND) // Disabled-blind, doesn't get better on its own blinded = 1 + else if(eye_blind) // Blindness, heals slowly over time eye_blind = max(eye_blind-1,0) blinded = 1 + else if(istype(glasses, /obj/item/clothing/glasses/sunglasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster eye_blurry = max(eye_blurry-3, 0) blinded = 1 @@ -961,59 +921,26 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc //blurry sight if(vision.is_bruised()) // Vision organs impaired? Permablurry. eye_blurry = 1 + if(eye_blurry) // Blurry eyes heal slowly eye_blurry = max(eye_blurry-1, 0) + //Ears if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own ear_deaf = max(ear_deaf, 1) + else if(ear_deaf) //deafness, heals slowly over time - ear_deaf = max(ear_deaf-1, 0) + ear_deaf = max(ear_deaf - 1, 0) + else if(istype(l_ear, /obj/item/clothing/ears/earmuffs) || istype(r_ear, /obj/item/clothing/ears/earmuffs)) //resting your ears with earmuffs heals ear damage faster - ear_damage = max(ear_damage-0.15, 0) + ear_damage = max(ear_damage - 0.15, 0) ear_deaf = max(ear_deaf, 1) + else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs - ear_damage = max(ear_damage-0.05, 0) + ear_damage = max(ear_damage - 0.05, 0) - //Dizziness - if(dizziness) - var/client/C = client - var/pixel_x_diff = 0 - var/pixel_y_diff = 0 - var/temp - var/saved_dizz = dizziness - dizziness = max(dizziness-1, 0) - if(C) - var/oldsrc = src - var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70 // This shit is annoying at high strength - src = null - spawn(0) - if(C) - temp = amplitude * sin(0.008 * saved_dizz * world.time) - pixel_x_diff += temp - C.pixel_x += temp - temp = amplitude * cos(0.008 * saved_dizz * world.time) - pixel_y_diff += temp - C.pixel_y += temp - sleep(3) - if(C) - temp = amplitude * sin(0.008 * saved_dizz * world.time) - pixel_x_diff += temp - C.pixel_x += temp - temp = amplitude * cos(0.008 * saved_dizz * world.time) - pixel_y_diff += temp - C.pixel_y += temp - sleep(3) - if(C) - C.pixel_x -= pixel_x_diff - C.pixel_y -= pixel_y_diff - src = oldsrc - //Jitteryness - if(jitteriness) - do_jitter_animation(jitteriness) - - //Flying if(flying) spawn() animate(src, pixel_y = pixel_y + 5 , time = 10, loop = 1, easing = SINE_EASING) @@ -1025,9 +952,11 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(gloves && germ_level > gloves.germ_level && prob(10)) gloves.germ_level += 1 - CheckStamina() - return 1 + else //dead + blinded = 1 + silent = 0 + /mob/living/carbon/human/handle_vision() client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) @@ -1488,7 +1417,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc holder.icon_state = "hudblank" if(mind && mind.nation) - switch(mind.nation.name) + switch(mind.nation.default_name) if("Atmosia") holder.icon_state = "hudatmosia" if("Brigston") diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index ee7dcedec56..33af21120de 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -296,8 +296,8 @@ if(sleeping) handle_dreams() adjustStaminaLoss(-10) - sleeping = max(sleeping-1, 0) - if( prob(10) && health && !hal_crit ) + sleeping = max(sleeping - 1, 0) + if(prob(10) && health && !hal_crit) spawn(0) emote("snore") diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 4d572377700..d16e52ee597 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -19,12 +19,9 @@ SetWeakened(min(weakened, 20)) sleeping = 0 ear_deaf = 0 - adjustBruteLoss(0) - adjustToxLoss(0) - adjustOxyLoss(0) - adjustFireLoss(0) -/mob/living/silicon/robot/proc/use_power() + +/mob/living/silicon/robot/proc/use_power() if (is_component_functioning("power cell") && cell) if(module) for(var/obj/item/borg/B in module.modules) @@ -32,26 +29,26 @@ if((cell.charge * 100 / cell.maxcharge) < B.powerneeded) src << "Deactivating [B.name] due to lack of power!" unEquip(B) - if(src.cell.charge <= 0) + if(cell.charge <= 0) uneq_all() update_headlamp(1) - src.stat = UNCONSCIOUS + stat = UNCONSCIOUS has_power = 0 for(var/V in components) var/datum/robot_component/C = components[V] if(C.name == "actuator") // Let drained robots move, disable the rest continue C.consume_power() - else if (src.cell.charge <= 100) + else if(cell.charge <= 100) uneq_all() - src.cell.use(1) + cell.use(1) else - if(src.module_state_1) - src.cell.use(4) - if(src.module_state_2) - src.cell.use(4) - if(src.module_state_3) - src.cell.use(4) + if(module_state_1) + cell.use(4) + if(module_state_2) + cell.use(4) + if(module_state_3) + cell.use(4) for(var/V in components) var/datum/robot_component/C = components[V] @@ -62,130 +59,116 @@ if(!is_component_functioning("actuator")) Paralyse(3) - src.eye_blind = 0 - src.stat = 0 + eye_blind = 0 + stat = 0 has_power = 1 else uneq_all() - src.stat = UNCONSCIOUS + stat = UNCONSCIOUS update_headlamp(1) Paralyse(3) -/mob/living/silicon/robot/handle_regular_status_updates() - - if(src.camera && !scrambledcodes) - if(src.stat == 2 || wires.IsCameraCut()) - src.camera.status = 0 - else - src.camera.status = 1 - +/mob/living/silicon/robot/updatehealth() + if(status_flags & GODMODE) + health = maxHealth + stat = CONSCIOUS + return health = maxHealth - (getOxyLoss() + getFireLoss() + getBruteLoss()) - if(getOxyLoss() > 50) Paralyse(3) +/mob/living/silicon/robot/handle_regular_status_updates() - if(src.sleeping) + . = ..() + + if(camera && !scrambledcodes) + if(stat == DEAD || wires.IsCameraCut()) + camera.status = 0 + else + camera.status = 1 + + if(getOxyLoss() > 50) Paralyse(3) - src.sleeping-- - if(src.resting) + if(sleeping) + Paralyse(3) + sleeping-- + + if(resting) Weaken(5) - if(health <= config.health_threshold_dead && src.stat != 2) //die only once - death() + if(.) //alive + if(health <= config.health_threshold_dead) + death() + return - if (src.stat != 2) //Alive. - if(!istype(src,/mob/living/silicon/robot/drone)) + if(!istype(src, /mob/living/silicon/robot/drone)) if(health < 50) //Gradual break down of modules as more damage is sustained if(uneq_module(module_state_3)) src << "SYSTEM ERROR: Module 3 OFFLINE." + if(health < 0) if(uneq_module(module_state_2)) src << "SYSTEM ERROR: Module 2 OFFLINE." + if(health < -50) if(uneq_module(module_state_1)) src << "CRITICAL ERROR: All modules OFFLINE." - if (src.paralysis || src.stunned || src.weakened) //Stunned etc. - src.stat = 1 - if (src.stunned > 0) - AdjustStunned(-1) - if (src.weakened > 0) - AdjustWeakened(-1) - if (src.paralysis > 0) - AdjustParalysis(-1) - src.eye_blind = max(eye_blind, 1) - else - src.eye_blind = 0 + if(paralysis || stunned || weakened) + stat = UNCONSCIOUS - else //Not stunned. - src.stat = 0 + if(!paralysis > 0) + eye_blind = 0 - else //Dead. - src.eye_blind = 1 + else + stat = CONSCIOUS - if (src.stuttering) src.stuttering-- - - if (src.eye_blind) - src.eye_blind-- - - src.density = !( src.lying ) - - if (src.disabilities & BLIND) - src.eye_blind = max(1, eye_blind) - - if (src.eye_blurry > 0) - src.eye_blurry-- - src.eye_blurry = max(0, src.eye_blurry) - - if (src.druggy > 0) - src.druggy-- - src.druggy = max(0, src.druggy) + else //dead + eye_blind = 1 //update the state of modules and components here - if (src.stat != 0) + if(stat != CONSCIOUS) uneq_all() - if(!is_component_functioning("radio") || src.stat == 1) + if(!is_component_functioning("radio") || stat == UNCONSCIOUS) radio.on = 0 else radio.on = 1 - if(is_component_functioning("camera") && src.stat == 0) - src.blinded = 0 + if(is_component_functioning("camera") && stat == CONSCIOUS) + blinded = 0 else - src.blinded = 1 + blinded = 1 if(!is_component_functioning("actuator")) - src.Paralyse(3) + Paralyse(3) return 1 /mob/living/silicon/robot/update_sight() - - if (src.stat == 2 || src.sight_mode & BORGXRAY) - src.sight |= SEE_TURFS - src.sight |= SEE_MOBS - src.sight |= SEE_OBJS - src.see_in_dark = 8 - src.see_invisible = SEE_INVISIBLE_LEVEL_TWO + if(stat == DEAD || sight_mode & BORGXRAY) + sight |= SEE_TURFS + sight |= SEE_MOBS + sight |= SEE_OBJS + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_LEVEL_TWO else - src.see_in_dark = 8 - if (src.sight_mode & BORGMESON && src.sight_mode & BORGTHERM) - src.sight |= SEE_TURFS - src.sight |= SEE_MOBS - src.see_invisible = SEE_INVISIBLE_MINIMUM - else if (src.sight_mode & BORGMESON) - src.sight |= SEE_TURFS - src.see_invisible = SEE_INVISIBLE_MINIMUM - src.see_in_dark = 1 - else if (src.sight_mode & BORGTHERM) - src.sight |= SEE_MOBS - src.see_invisible = SEE_INVISIBLE_LEVEL_TWO - else if (src.stat != 2) - src.sight &= ~SEE_MOBS - src.sight &= ~SEE_TURFS - src.sight &= ~SEE_OBJS - src.see_invisible = SEE_INVISIBLE_LEVEL_TWO + see_in_dark = 8 + if(sight_mode & BORGMESON && sight_mode & BORGTHERM) + sight |= SEE_TURFS + sight |= SEE_MOBS + see_invisible = SEE_INVISIBLE_MINIMUM + else if(sight_mode & BORGMESON) + sight |= SEE_TURFS + see_invisible = SEE_INVISIBLE_MINIMUM + see_in_dark = 1 + else if(sight_mode & BORGTHERM) + sight |= SEE_MOBS + see_invisible = SEE_INVISIBLE_LEVEL_TWO + else if(stat != DEAD) + sight &= ~SEE_MOBS + sight &= ~SEE_TURFS + sight &= ~SEE_OBJS + see_invisible = SEE_INVISIBLE_LEVEL_TWO if(see_override) see_invisible = see_override @@ -199,11 +182,11 @@ if(stat != DEAD) if(health >= maxHealth) healths.icon_state = "health0" - else if(health > maxHealth*0.5) + else if(health > maxHealth * 0.5) healths.icon_state = "health2" else if(health > 0) healths.icon_state = "health3" - else if(health > -maxHealth*0.5) + else if(health > -maxHealth * 0.5) healths.icon_state = "health4" else if(health > -maxHealth) healths.icon_state = "health5" diff --git a/code/modules/nano/modules/atmos_control.dm b/code/modules/nano/modules/atmos_control.dm index 52da17c2c82..e43585243ae 100644 --- a/code/modules/nano/modules/atmos_control.dm +++ b/code/modules/nano/modules/atmos_control.dm @@ -3,7 +3,7 @@ var/obj/access = new() var/emagged = 0 var/ui_ref - var/list/monitored_alarms = list() + var/list/monitored_alarms = null /datum/nano_module/atmos_control/New(atmos_computer, req_access, req_one_access, monitored_alarm_ids) ..() @@ -23,7 +23,7 @@ if(href_list["alarm"]) if(ui_ref) - var/obj/machinery/alarm/alarm = locate(href_list["alarm"]) in (monitored_alarms.len ? monitored_alarms : machines) + var/obj/machinery/alarm/alarm = locate(href_list["alarm"]) in (monitored_alarms ? monitored_alarms : machines) if(alarm) var/datum/topic_state/TS = generate_state(alarm) alarm.ui_interact(usr, master_ui = ui_ref, state = TS) diff --git a/nano/css/layout_default.css b/nano/css/layout_default.css index 109beb2c72e..2493aca3bb0 100644 --- a/nano/css/layout_default.css +++ b/nano/css/layout_default.css @@ -87,7 +87,7 @@ body { #uiMapContent { position: absolute; - bottom: 0px; + bottom: -13.5px; left: 0px; width: 256px; height: 256px; diff --git a/nano/templates/atmos_control_map_content.tmpl b/nano/templates/atmos_control_map_content.tmpl index ab5319460d1..e1a513ba9f2 100644 --- a/nano/templates/atmos_control_map_content.tmpl +++ b/nano/templates/atmos_control_map_content.tmpl @@ -1,6 +1,6 @@ {{for data.alarms}} {{if value.z == 1}} -