Merge remote-tracking branch 'upstream/master' into rnd-tgui-rebase

This commit is contained in:
nicetoolbox
2020-10-03 20:02:53 -07:00
25 changed files with 215 additions and 152 deletions
+2 -2
View File
@@ -443,8 +443,8 @@
if(pressure <= LAVALAND_EQUIPMENT_EFFECT_PRESSURE)
. = TRUE
/proc/pollCandidatesWithVeto(adminclient, adminusr, max_slots, Question, be_special_type, antag_age_check = FALSE, poll_time = 300, ignore_respawnability = FALSE, min_hours = FALSE, flashwindow = TRUE, check_antaghud = TRUE, source)
var/list/willing_ghosts = SSghost_spawns.poll_candidates(Question, be_special_type, antag_age_check, poll_time, ignore_respawnability, min_hours, flashwindow, check_antaghud, source)
/proc/pollCandidatesWithVeto(adminclient, adminusr, max_slots, Question, be_special_type, antag_age_check = FALSE, poll_time = 300, ignore_respawnability = FALSE, min_hours = FALSE, flashwindow = TRUE, check_antaghud = TRUE, source, role_cleanname)
var/list/willing_ghosts = SSghost_spawns.poll_candidates(Question, be_special_type, antag_age_check, poll_time, ignore_respawnability, min_hours, flashwindow, check_antaghud, source, role_cleanname)
var/list/selected_ghosts = list()
if(!willing_ghosts.len)
return selected_ghosts
+1 -4
View File
@@ -570,10 +570,7 @@ so as to remain in compliance with the most up-to-date laws."
G.ManualFollow(target)
/obj/screen/alert/notify_action/Topic(href, href_list)
if(..())
return TRUE
if(href_list["signup"] && isobserver(usr) && poll?.sign_up(usr))
if(href_list["signup"] && poll?.sign_up(usr))
display_signed_up()
/obj/screen/alert/notify_action/proc/display_signed_up()
+4 -3
View File
@@ -41,9 +41,10 @@ SUBSYSTEM_DEF(ghost_spawns)
* * flash_window - Whether the poll should flash a potential candidate's game window
* * check_antaghud - Whether to filter out potential candidates who enabled AntagHUD
* * source - The atom, atom prototype, icon or mutable appearance to display as an icon in the alert
* * role_cleanname - The name override to display to clients
*/
/datum/controller/subsystem/ghost_spawns/proc/poll_candidates(question = "Would you like to play a special role?", role, antag_age_check = FALSE, poll_time = 30 SECONDS, ignore_respawnability = FALSE, min_hours = 0, flash_window = TRUE, check_antaghud = TRUE, source)
log_debug("Polling candidates [role ? "for [get_roletext(role)]" : "\"[question]\""] for [poll_time / 10] seconds")
/datum/controller/subsystem/ghost_spawns/proc/poll_candidates(question = "Would you like to play a special role?", role, antag_age_check = FALSE, poll_time = 30 SECONDS, ignore_respawnability = FALSE, min_hours = 0, flash_window = TRUE, check_antaghud = TRUE, source, role_cleanname)
log_debug("Polling candidates [role ? "for [role_cleanname || get_roletext(role)]" : "\"[question]\""] for [poll_time / 10] seconds")
// Start firing
polls_active = TRUE
@@ -130,7 +131,7 @@ SUBSYSTEM_DEF(ghost_spawns)
if(isatom(source))
act_jump = "<a href='?src=[M.UID()];jump=\ref[source]'>\[Teleport]</a>"
var/act_signup = "<a href='?src=[A.UID()];signup=1'>\[Sign Up]</a>"
to_chat(M, "<big><span class='boldnotice'>Now looking for candidates [role ? "to play as \an [get_roletext(role)]" : "\"[question]\""]. [act_jump] [act_signup]</span></big>")
to_chat(M, "<big><span class='boldnotice'>Now looking for candidates [role ? "to play as \an [role_cleanname || get_roletext(role)]" : "\"[question]\""]. [act_jump] [act_signup]</span></big>")
// Start processing it so it updates visually the timer
START_PROCESSING(SSprocessing, A)
+5
View File
@@ -113,6 +113,11 @@
A.on_body_transfer(old_current, current)
transfer_antag_huds(hud_to_transfer) //inherit the antag HUD
transfer_actions(new_character)
if(martial_art)
if(martial_art.temporary)
martial_art.remove(current)
else
martial_art.teach(current)
if(active)
new_character.key = key //now transfer the key to link the client to our new body
+8 -6
View File
@@ -571,20 +571,22 @@
event = null
else if(href_list["killcrew"]) //shoot a crewmember
if(length(settlers) <= 0 || alive <= 0)
return
var/sheriff = remove_crewmember() //I shot the sheriff
playsound(loc,'sound/weapons/gunshots/gunshot.ogg', 100, 1)
playsound(loc, 'sound/weapons/gunshots/gunshot.ogg', 100, 1)
if(settlers.len == 0 || alive == 0)
if(length(settlers) == 0 || alive == 0)
atom_say("The last crewmember [sheriff], shot themselves, GAME OVER!")
if(emagged)
usr.death(0)
emagged = 0
gameover = 1
usr.death(FALSE)
emagged = FALSE
gameover = TRUE
event = null
else if(emagged)
if(usr.name == sheriff)
atom_say("The crew of the ship chose to kill [usr.name]!")
usr.death(0)
usr.death(FALSE)
if(event == ORION_TRAIL_LING) //only ends the ORION_TRAIL_LING event, since you can do this action in multiple places
event = null
+54 -45
View File
@@ -15,7 +15,6 @@
var/decalinpool = list() // List containing all of the cleanable decals in pool
var/linked_area = null
var/temperature = NORMAL //The temperature of the pool, starts off on normal, which has no effects.
var/temperaturecolor = "" //used for nanoUI fancyness
var/srange = 5 //The range of the search for pool turfs, change this for bigger or smaller pools.
var/list/linkedmist = list() //Used to keep track of created mist
var/deep_water = FALSE //set to 1 to drown even standing people
@@ -67,8 +66,8 @@
else
to_chat(user, "<span class='warning'>Nothing happens.</span>")//If not emagged, don't do anything, and don't tell the user that it can be emagged.
/obj/machinery/poolcontroller/attack_hand(mob/user as mob)
ui_interact(user)
/obj/machinery/poolcontroller/attack_hand(mob/user)
tgui_interact(user)
/obj/machinery/poolcontroller/process()
processMob() //Call the mob affecting proc
@@ -151,64 +150,74 @@
linkedmist.Cut()
/obj/machinery/poolcontroller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/machinery/poolcontroller/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "poolcontroller.tmpl", "Pool Controller Interface", 520, 410)
ui = new(user, src, ui_key, "PoolController", "Pool Controller Interface", 520, 410)
ui.open()
/obj/machinery/poolcontroller/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
var/currenttemp
switch(temperature) //So we can output nice things like "Cool" to nanoUI
/obj/machinery/poolcontroller/proc/temp_to_str(temp)
switch(temp) //So we can output nice things like "Cool" to tgUI
if(FRIGID)
currenttemp = "frigid"
return "frigid"
if(COOL)
currenttemp = "cool"
return "cool"
if(NORMAL)
currenttemp = "normal"
return "normal"
if(WARM)
currenttemp = "warm"
return "warm"
if(SCALDING)
currenttemp = "scalding"
data["currentTemp"] = currenttemp
return "scalding"
/obj/machinery/poolcontroller/proc/set_temp(val)
if (val != WARM && val != NORMAL && val != COOL && !(emagged && (val == SCALDING || val == FRIGID)))
return
if(val == SCALDING)
miston()
else
mistoff()
temperature = val
/obj/machinery/poolcontroller/proc/str_to_temp(str)
switch(str)
if("frigid")
return FRIGID
if("cool")
return COOL
if("normal")
return NORMAL
if("warm")
return WARM
if("scalding")
return SCALDING
/obj/machinery/poolcontroller/proc/set_temp_str(target)
var/temp = str_to_temp(target)
if(temp)
set_temp(temp)
/obj/machinery/poolcontroller/tgui_data(mob/user)
var/list/data = list()
data["currentTemp"] = temp_to_str(temperature)
data["emagged"] = emagged
data["TempColor"] = temperaturecolor
return data
/obj/machinery/poolcontroller/Topic(href, href_list)
/obj/machinery/poolcontroller/tgui_act(action, list/params)
if(..())
return 1
return
switch(href_list["temp"])
if("Scalding")
if(!emagged)
return 0
temperature = SCALDING
temperaturecolor = "#FF0000"
miston()
if("Frigid")
if(!emagged)
return 0
temperature = FRIGID
temperaturecolor = "#00CCCC"
mistoff()
if("Warm")
temperature = WARM
temperaturecolor = "#990000"
mistoff()
if("Cool")
temperature = COOL
temperaturecolor = "#009999"
mistoff()
if("Normal")
temperature = NORMAL
temperaturecolor = ""
mistoff()
switch(action)
if("setTemp")
set_temp_str(params["temp"])
return TRUE
return 1
return FALSE
#undef FRIGID
#undef COOL
@@ -10,11 +10,16 @@
throw_range = 20
origin_tech = "syndicate=1;engineering=3"
/// Integrated camera console to serve UI data
var/obj/machinery/computer/security/integrated_console
var/obj/machinery/computer/security/camera_bug/integrated_console
/obj/machinery/computer/security/camera_bug
name = "invasive camera utility"
desc = "How did this get here?! Please report this as a bug to github"
use_power = NO_POWER_USE
/obj/item/camera_bug/Initialize(mapload)
. = ..()
integrated_console = new
integrated_console = new(src)
integrated_console.parent = src
integrated_console.network = list("SS13")
+1 -1
View File
@@ -3577,7 +3577,7 @@
var/datum/outfit/O = hunter_outfits[dresscode]
message_admins("[key_name_admin(mob)] is sending a ([dresscode]) to [killthem ? "assassinate" : "protect"] [key_name_admin(H)]...")
var/image/source = image('icons/obj/cardboard_cutout.dmi', "cutout_traitor")
var/list/candidates = SSghost_spawns.poll_candidates("Play as a [killthem ? "murderous" : "protective"] [dresscode]?", ROLE_TRAITOR, TRUE, source = source)
var/list/candidates = SSghost_spawns.poll_candidates("Play as a [killthem ? "murderous" : "protective"] [dresscode]?", ROLE_TRAITOR, TRUE, source = source, role_cleanname = "[killthem ? "murderous" : "protective"] [dresscode]")
if(!candidates.len)
to_chat(usr, "<span class='warning'>ERROR: Could not create eventmob. No valid candidates.</span>")
return
+1 -2
View File
@@ -53,7 +53,7 @@
players_to_spawn += candidate
else
to_chat(src, "Polling candidates...")
players_to_spawn = SSghost_spawns.poll_candidates("Do you want to play as \a [O.name]?")
players_to_spawn = SSghost_spawns.poll_candidates("Do you want to play as \a [initial(O.name)]?")
if(!players_to_spawn.len)
to_chat(src, "Nobody volunteered.")
@@ -93,4 +93,3 @@
feedback_add_details("admin_verb","SPAWNGIM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
// ---------------------------------------------------------------------------------------------------------
@@ -55,8 +55,8 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0)
infiltrators += candidate
else
to_chat(src, "Polling candidates...")
var/mutable_appearance/ma = new('icons/mob/simple_human.dmi', "syndicate")
infiltrators = SSghost_spawns.poll_candidates("Do you want to play as a SYNDICATE INFILTRATOR?", ROLE_TRAITOR, TRUE, source = ma)
var/image/I = new('icons/obj/cardboard_cutout.dmi', "cutout_sit")
infiltrators = SSghost_spawns.poll_candidates("Do you want to play as a Syndicate infiltrator?", ROLE_TRAITOR, TRUE, source = I, role_cleanname = "Syndicate infiltrator")
if(!infiltrators.len)
to_chat(src, "Nobody volunteered.")
+2 -2
View File
@@ -137,8 +137,8 @@
var/confirm = alert("Are you sure?", "Confirm creation", "Yes", "No")
if(confirm != "Yes")
return 0
var/mutable_appearance/ma = new('icons/mob/simple_human.dmi', "wizard")
var/list/candidates = SSghost_spawns.poll_candidates("Do you wish to be considered for the position of a Wizard Foundation 'diplomat'?", "wizard", source = ma)
var/image/I = new('icons/mob/simple_human.dmi', "wizard")
var/list/candidates = SSghost_spawns.poll_candidates("Do you wish to be considered for the position of a Wizard Foundation 'diplomat'?", "wizard", source = I)
log_admin("[key_name(owner)] tried making a Wizard with One-Click-Antag")
message_admins("[key_name_admin(owner)] tried making a Wizard with One-Click-Antag")
@@ -45,7 +45,8 @@ GLOBAL_VAR_INIT(sent_syndicate_strike_team, 0)
break
// Find ghosts willing to be SST
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 60 SECONDS, TRUE, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE)
var/image/I = new('icons/obj/cardboard_cutout.dmi', "cutout_commando")
var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 60 SECONDS, TRUE, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE, source = I)
if(!commando_ghosts.len)
to_chat(usr, "<span class='userdanger'>Nobody volunteered to join the SST.</span>")
return
@@ -46,8 +46,8 @@
checking = TRUE
to_chat(user, "<span class='notice'>You activate [src] and wait for confirmation.</span>")
var/mutable_appearance/ma = new('icons/mob/simple_human.dmi', "syndicate_space_sword")
var/list/nuke_candidates = SSghost_spawns.poll_candidates("Do you want to play as a [rolename]?", ROLE_OPERATIVE, TRUE, 15 SECONDS, source = ma)
var/image/I = new('icons/mob/simple_human.dmi', "syndicate_space_sword")
var/list/nuke_candidates = SSghost_spawns.poll_candidates("Do you want to play as a [rolename]?", ROLE_OPERATIVE, TRUE, 15 SECONDS, source = I)
if(LAZYLEN(nuke_candidates))
checking = FALSE
if(QDELETED(src) || !check_usability(user))
+4 -3
View File
@@ -140,9 +140,10 @@
return
if(H.mind.martial_art != src)
return
H.mind.martial_art = base
if(has_explaination_verb && !(base && base.has_explaination_verb))
H.verbs -= /mob/living/carbon/human/proc/martial_arts_help
H.mind.martial_art = null // Remove reference
H.verbs -= /mob/living/carbon/human/proc/martial_arts_help
if(base)
base.teach(H)
/mob/living/carbon/human/proc/martial_arts_help()
set name = "Show Info"
+3 -2
View File
@@ -220,8 +220,9 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
var/datum/wires/explosive/gibtonite/wires
/obj/item/twohanded/required/gibtonite/Destroy()
SStgui.close_uis(wires)
QDEL_NULL(wires)
if(wires)
SStgui.close_uis(wires)
QDEL_NULL(wires)
return ..()
/obj/item/twohanded/required/gibtonite/attackby(obj/item/I, mob/user, params)
@@ -14,19 +14,20 @@ emp_act
return FALSE
if(P.is_reflectable)
var/can_reflect = check_reflect(def_zone)
if(!can_reflect)
return (..(P , def_zone)) //Bad luck
else
if(can_reflect == 2) //If target is holding a toy sword
var/list/safe_list = list(/obj/item/projectile/beam/lasertag, /obj/item/projectile/beam/practice)
if(!is_type_in_list(P, safe_list)) //And it's not safe
return (..(P , def_zone)) //Bad luck
visible_message("<span class='danger'>The [P.name] gets reflected by [src]!</span>", \
if(can_reflect == 1) // proper reflection
visible_message("<span class='danger'>The [P.name] gets reflected by [src]!</span>", \
"<span class='userdanger'>The [P.name] gets reflected by [src]!</span>")
P.reflect_back(src)
return -1 // complete projectile permutation
P.reflect_back(src)
else if(can_reflect == 2) //If target is holding a toy sword
var/list/safe_list = list(/obj/item/projectile/beam/lasertag, /obj/item/projectile/beam/practice)
if(is_type_in_list(P, safe_list)) //And it's safe
visible_message("<span class='danger'>The [P.name] gets reflected by [src]!</span>", \
"<span class='userdanger'>The [P.name] gets reflected by [src]!</span>")
P.reflect_back(src)
return -1 // complete projectile permutation
return -1 // complete projectile permutation
//Shields
if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration))
@@ -85,9 +85,8 @@
return ..()
/datum/species/diona/handle_life(mob/living/carbon/human/H)
if(H.stat == DEAD)
return
var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing
var/is_vamp = H.mind?.vampire != null
if(isturf(H.loc)) //else, there's considered to be no light
var/turf/T = H.loc
light_amount = min(1, T.get_lumcount()) - 0.5
@@ -95,9 +94,12 @@
H.clear_alert("nolight")
else
H.throw_alert("nolight", /obj/screen/alert/nolight)
H.adjust_nutrition(light_amount * 10)
if(H.nutrition > NUTRITION_LEVEL_ALMOST_FULL)
H.set_nutrition(NUTRITION_LEVEL_ALMOST_FULL)
if(!is_vamp)
H.adjust_nutrition(light_amount * 10)
if(H.nutrition > NUTRITION_LEVEL_ALMOST_FULL)
H.set_nutrition(NUTRITION_LEVEL_ALMOST_FULL)
if(light_amount > 0.2 && !H.suiciding) //if there's enough light, heal
if(!pod && H.health <= 0)
return
@@ -106,7 +108,7 @@
H.adjustToxLoss(-1)
H.adjustOxyLoss(-1)
if(H.nutrition < NUTRITION_LEVEL_STARVING + 50)
if(!is_vamp && H.nutrition < NUTRITION_LEVEL_STARVING + 50)
H.adjustBruteLoss(2)
..()
@@ -366,3 +366,7 @@
/obj/structure/spider/terrorweb/queen/CanAtmosPass(turf/T)
return FALSE
/obj/structure/spider/terrorweb/queen/Destroy()
var/turf/T = get_turf(src)
. = ..()
T.air_update_turf(TRUE)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB

-55
View File
@@ -1,55 +0,0 @@
<!--
Title: Pool Controller UI.
Used In File(s): \code\game\machinery\poolcontroller.dm
-->
<div class="item">
<div class="itemLabel">
<b>Current Temperature</b>:
</div>
<div class="itemContent">
<font color={{:data.TempColor}}>{{:helper.capitalizeFirstLetter(data.currentTemp)}}</font>
</div>
</div>
<div class="item">
<div class="itemLabel">
Safety Status:
</div>
<div class="itemContent">
{{if data.emagged}}
<b><font color='red'>WARNING: OVERRIDDEN</font></b>
{{else}}
<b><font color='green'>Nominal</font></b>
{{/if}}
</div>
</div>
<div class="item">
<div class="itemContent">
<b>Temperature Selection:</b>
</div>
{{if data.emagged}}
<div class="itemContentWide" style="width: 100%;">
{{:helper.link('Scalding', 'arrow-circle-up', { 'temp' : 'Scalding' }, data.currentTemp == "scalding" ? 'selected' : null)}}
</div>
{{/if}}
<div class="itemContentWide" style="width: 100%;">
{{:helper.link('Warm', 'arrow-circle-up', { 'temp' : 'Warm' }, data.currentTemp == "warm" ? 'selected' : null)}}
</div>
<div class="itemContentWide" style="width: 100%;">
{{:helper.link('Normal', 'arrow-circle-right', { 'temp' : 'Normal' }, data.currentTemp == "normal" ? 'selected' : null)}}
</div>
<div class="itemContentWide" style="width: 100%;">
{{:helper.link('Cool', 'arrow-circle-down', { 'temp' : 'Cool' }, data.currentTemp == "cool" ? 'selected' : null)}}
</div>
{{if data.emagged}}
<div class="itemContentWide" style="width: 100%;">
{{:helper.link('Frigid', 'arrow-circle-down', { 'temp' : 'Frigid' }, data.currentTemp == "frigid" ? 'selected' : null)}}
</div>
{{/if}}
</div>
@@ -0,0 +1,82 @@
import { useBackend } from "../backend";
import { Button, Flex, LabeledList, Section, Box, Icon } from '../components';
import { Window } from "../layouts";
const TEMPS = {
scalding: { label: 'Scalding', color: '#FF0000', icon: 'fa fa-arrow-circle-up', requireEmag: true },
warm: { label: 'Warm', color: '#990000', icon: 'fa fa-arrow-circle-up' },
normal: { label: 'Normal', color: null, icon: 'fa fa-arrow-circle-right' },
cool: { label: 'Cool', color: '#009999', icon: 'fa fa-arrow-circle-down' },
frigid: { label: 'Frigid', color: '#00CCCC', icon: 'fa fa-arrow-circle-down', requireEmag: true },
};
const TempButton = (properties, context) => {
const { tempKey, ...buttonProps } = properties;
const temp = TEMPS[tempKey];
if (!temp) {
return null;
}
const { data, act } = useBackend(context);
const { currentTemp } = data;
const { label, icon } = temp;
const selected = tempKey === currentTemp;
const setTemp = () => {
act('setTemp', { temp: tempKey });
};
return (
<Button selected={selected} onClick={setTemp} {...buttonProps}>
<Icon name={icon} />
{label}
</Button>
);
};
export const PoolController = (properties, context) => {
const { data } = useBackend(context);
const { emagged, currentTemp } = data;
const { label: currentLabel, color: currentColor } = TEMPS[currentTemp] || TEMPS.normal;
const visibleTempKeys = [];
for (const [tempKey, { requireEmag }] of Object.entries(TEMPS)) {
if (!requireEmag || requireEmag && emagged) {
visibleTempKeys.push(tempKey);
}
}
return (
<Window>
<Window.Content>
<Section title="Status">
<LabeledList>
<LabeledList.Item label="Current Temperature">
<Box color={currentColor}>
{currentLabel}
</Box>
</LabeledList.Item>
<LabeledList.Item label="Safety Status">
{emagged ? (
<Box color="red">
WARNING: OVERRIDDEN
</Box>
) : (
<Box color="good">
Nominal
</Box>
)}
</LabeledList.Item>
</LabeledList>
</Section>
<Section title="Temperature Selection">
<Flex className="PoolController__Buttons" direction="column" align="flex-start">
{visibleTempKeys.map(tempKey => (
<TempButton key={tempKey} tempKey={tempKey} />
))}
</Flex>
</Section>
</Window.Content>
</Window>
);
};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
.PoolController__Buttons {
.Button:not(:last-child) {
margin-bottom: 8px;
}
}
+1
View File
@@ -43,6 +43,7 @@
@include meta.load-css('./interfaces/CameraConsole.scss');
@include meta.load-css('./interfaces/NuclearBomb.scss');
@include meta.load-css('./interfaces/PDA.scss');
@include meta.load-css('./interfaces/PoolController.scss');
@include meta.load-css('./interfaces/RndConsole.scss');
@include meta.load-css('./interfaces/Roulette.scss');
@include meta.load-css('./interfaces/SecurityRecords.scss');