added the funny. Also adds balloon_alert to more stuff (primarily atmos)

This commit is contained in:
LetterN
2021-11-16 16:10:12 +08:00
parent cca584b2df
commit fa6946fae4
24 changed files with 304 additions and 213 deletions
+71 -38
View File
@@ -247,61 +247,94 @@ Class Procs:
/obj/machinery/proc/auto_use_power()
if(!powered(power_channel))
return 0
return FALSE
if(use_power == 1)
use_power(idle_power_usage,power_channel)
else if(use_power >= 2)
use_power(active_power_usage,power_channel)
return 1
return TRUE
/obj/machinery/proc/is_operational()
return !(stat & (NOPOWER|BROKEN|MAINT))
/obj/machinery/can_interact(mob/user)
var/silicon = hasSiliconAccessInArea(user) || IsAdminGhost(user)
if((stat & (NOPOWER|BROKEN)) && !(interaction_flags_machine & INTERACT_MACHINE_OFFLINE))
if((stat & (NOPOWER|BROKEN)) && !(interaction_flags_machine & INTERACT_MACHINE_OFFLINE)) // Check if the machine is broken, and if we can still interact with it if so
return FALSE
if(panel_open && !(interaction_flags_machine & INTERACT_MACHINE_OPEN))
if(!silicon || !(interaction_flags_machine & INTERACT_MACHINE_OPEN_SILICON))
return FALSE
if(silicon)
if(IsAdminGhost(user))
return TRUE //if you're an admin, you probably know what you're doing (or at least have permission to do what you're doing)
if(!isliving(user))
return FALSE //no ghosts in the machine allowed, sorry
// if(SEND_SIGNAL(user, COMSIG_TRY_USE_MACHINE, src) & COMPONENT_CANT_USE_MACHINE_INTERACT)
// return FALSE
var/mob/living/living_user = user
var/is_dextrous = FALSE
if(isanimal(user))
var/mob/living/simple_animal/user_as_animal = user
if (user_as_animal.dextrous)
is_dextrous = TRUE
if(!issilicon(user) && !is_dextrous && !user.can_hold_items())
return FALSE //spiders gtfo
if(issilicon(user)) // If we are a silicon, make sure the machine allows silicons to interact with it
if(!(interaction_flags_machine & INTERACT_MACHINE_ALLOW_SILICON))
return FALSE
else
if(interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SILICON)
if(panel_open && !(interaction_flags_machine & INTERACT_MACHINE_OPEN) && !(interaction_flags_machine & INTERACT_MACHINE_OPEN_SILICON))
return FALSE
if(!Adjacent(user))
var/mob/living/carbon/H = user
if(!(istype(H) && H.has_dna() && H.dna.check_mutation(TK)))
return FALSE
return TRUE
return TRUE //silicons don't care about petty mortal concerns like needing to be next to a machine to use it
if(living_user.incapacitated()) //idk why silicons aren't supposed to care about incapacitation when interacting with machines, but it was apparently like this before
return FALSE
// TODO: nerf blind people
// if((interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SIGHT) && user.is_blind())
// to_chat(user, span_warning("This machine requires sight to use."))
// return FALSE
if(panel_open && !(interaction_flags_machine & INTERACT_MACHINE_OPEN))
return FALSE
if(interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SILICON) //if the user was a silicon, we'd have returned out earlier, so the user must not be a silicon
return FALSE
if(!Adjacent(user)) // Next make sure we are next to the machine unless we have telekinesis
var/mob/living/carbon/carbon_user = living_user
if(!istype(carbon_user) || !carbon_user.has_dna() || !carbon_user.dna.check_mutation(TK))
return FALSE
return TRUE // If we passed all of those checks, woohoo! We can interact with this machine.
/obj/machinery/proc/check_nap_violations()
if(!SSeconomy.full_ancap)
return TRUE
if(occupant && !state_open)
if(ishuman(occupant))
var/mob/living/carbon/human/H = occupant
var/obj/item/card/id/I = H.get_idcard()
if(I)
var/datum/bank_account/insurance = I.registered_account
if(!insurance)
say("[market_verb] NAP Violation: No bank account found.")
nap_violation()
return FALSE
else
if(!insurance.adjust_money(-fair_market_price))
say("[market_verb] NAP Violation: Unable to pay.")
nap_violation()
return FALSE
var/datum/bank_account/D = SSeconomy.get_dep_account(payment_department)
if(D)
D.adjust_money(fair_market_price)
else
say("[market_verb] NAP Violation: No ID card found.")
nap_violation()
var/mob/living/L = occupant
var/obj/item/card/id/I = L.get_idcard(TRUE)
if(I)
var/datum/bank_account/insurance = I.registered_account
if(!insurance)
say("[market_verb] NAP Violation: No bank account found.")
nap_violation(L)
return FALSE
else
if(!insurance.adjust_money(-fair_market_price))
say("[market_verb] NAP Violation: Unable to pay.")
nap_violation(L)
return FALSE
var/datum/bank_account/D = SSeconomy.get_dep_account(payment_department)
if(D)
D.adjust_money(fair_market_price)
else
say("[market_verb] NAP Violation: No ID card found.")
nap_violation(L)
return FALSE
return TRUE
/obj/machinery/proc/nap_violation(mob/violator)
@@ -322,11 +355,11 @@ Class Procs:
/obj/machinery/Topic(href, href_list)
..()
if(!can_interact(usr))
return 1
return TRUE
if(!usr.canUseTopic(src))
return 1
return TRUE
add_fingerprint(usr)
return 0
return FALSE
////////////////////////////////////////////////////////////////////////////////////////////
@@ -173,7 +173,7 @@
return
if (!authenticated_as_silicon_or_captain(usr))
return
// emergency_meeting(usr)
emergency_meeting(usr)
if ("makePriorityAnnouncement")
if (!authenticated_as_silicon_or_captain(usr))
return
@@ -531,11 +531,11 @@
* * user - Mob who called the meeting
*/
/obj/machinery/computer/communications/proc/emergency_meeting(mob/living/user)
// if(!SScommunications.can_make_emergency_meeting(user))
// to_chat(user, span_alert("The emergency meeting button doesn't seem to work right now. Please stand by."))
// return
// SScommunications.emergency_meeting(user)
// deadchat_broadcast(" called an emergency meeting from [span_name("[get_area_name(usr, TRUE)]")].", span_name("[user.real_name]"), user, message_type=DEADCHAT_ANNOUNCEMENT)
if(!SScommunications.can_make_emergency_meeting(user))
to_chat(user, span_alert("The emergency meeting button doesn't seem to work right now. Please stand by."))
return
SScommunications.emergency_meeting(user)
deadchat_broadcast(" called an emergency meeting from [span_name("[get_area_name(usr, TRUE)]")].", span_name("[user.real_name]"), user, message_type=DEADCHAT_ANNOUNCEMENT)
/obj/machinery/computer/communications/proc/make_announcement(mob/living/user)
var/is_ai = issilicon(user)
@@ -25,7 +25,7 @@
/obj/machinery/manned_turret/Destroy()
target = null
target_turf = null
..()
return ..()
//BUCKLE HOOKS
@@ -34,11 +34,11 @@
/turf/open/floor/plating/catwalk_floor/screwdriver_act(mob/living/user, obj/item/tool)
. = ..()
covered = !covered
to_chat(user, span_notice("[!covered ? "You removed the cover!" : "You added the cover!"]"))
user.balloon_alert(user, "[!covered ? "cover removed" : "cover added"]")
update_icon(UPDATE_OVERLAYS)
/turf/open/floor/plating/catwalk_floor/pry_tile(obj/item/crowbar, mob/user, silent)
if(covered)
to_chat(user, span_notice("You need to remove the cover first!"))
user.balloon_alert(user, "remove cover first!")
return FALSE
. = ..()