Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
SatinIsle committed Mar 23, 2024
2 parents acb6031 + dd38a1c commit 723fb7b
Show file tree
Hide file tree
Showing 23 changed files with 468 additions and 18 deletions.
1 change: 1 addition & 0 deletions code/__defines/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define MESSAGE_TYPE_SYSTEM "system"
#define MESSAGE_TYPE_LOCALCHAT "localchat"
#define MESSAGE_TYPE_NPCEMOTE "npcemote"
#define MESSAGE_TYPE_MULTIZCHAT "multizsay"
#define MESSAGE_TYPE_PLOCALCHAT "plocalchat"
#define MESSAGE_TYPE_HIVEMIND "hivemind"
#define MESSAGE_TYPE_RADIO "radio"
Expand Down
2 changes: 2 additions & 0 deletions code/datums/outfits/jobs/civilian_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@

/decl/hierarchy/outfit/job/assistant/entrepreneur
id_type = /obj/item/weapon/card/id/civilian/entrepreneur
l_hand = /obj/item/device/ticket_printer/train

88 changes: 88 additions & 0 deletions code/game/machinery/computer/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
idle_power_usage = 300
active_power_usage = 300
blocks_emissive = FALSE
var/climbable = TRUE
var/list/climbers
var/climb_delay = 3.5 SECONDS
var/processing = 0

var/icon_keyboard = "generic_key"
Expand All @@ -22,6 +25,8 @@
. = ..()
power_change()
update_icon()
if(climbable)
verbs += /obj/structure/proc/climb_on

/obj/machinery/computer/process()
if(stat & (NOPOWER|BROKEN))
Expand Down Expand Up @@ -132,3 +137,86 @@
return
attack_hand(user)
return

/obj/machinery/computer/proc/climb_on()
set name = "Climb structure"
set desc = "Climbs onto a structure."
set category = "Object"
set src in oview(1)

do_climb(usr)

/obj/machinery/computer/MouseDrop_T(mob/target, mob/user)
var/mob/living/H = user
if(istype(H) && can_climb(H) && target == user)
do_climb(target)
else
return ..()

/obj/machinery/computer/proc/can_climb(var/mob/living/user, post_climb_check=0)
if (!climbable || !can_touch(user) || (!post_climb_check && (user in climbers)))
return 0

if (!user.Adjacent(src))
to_chat(user, "<span class='danger'>You can't climb there, the way is blocked.</span>")
return 0

var/obj/occupied = turf_is_crowded()
if(occupied)
to_chat(user, "<span class='danger'>There's \a [occupied] in the way.</span>")
return 0
return 1

/obj/machinery/computer/proc/turf_is_crowded()
var/turf/T = get_turf(src)
if(!T || !istype(T))
return "empty void"
if(T.density)
return T
for(var/obj/O in T.contents)
if(istype(O,/obj/machinery/computer))
var/obj/machinery/computer/S = O
if(S.climbable) continue
if(O && O.density && !(O.flags & ON_BORDER)) //ON_BORDER structures are handled by the Adjacent() check.
return O
return 0

/obj/machinery/computer/proc/do_climb(var/mob/living/user)
if (!can_climb(user))
return

usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
LAZYDISTINCTADD(climbers, user)

if(!do_after(user,(issmall(user) ? climb_delay * 0.6 : climb_delay)))
LAZYREMOVE(climbers, user)
return

if (!can_climb(user, post_climb_check=1))
LAZYREMOVE(climbers, user)
return

usr.forceMove(climb_to(user))

if (get_turf(user) == get_turf(src))
usr.visible_message("<span class='warning'>[user] climbs onto \the [src]!</span>")
LAZYREMOVE(climbers, user)

/obj/machinery/computer/proc/climb_to(var/mob/living/user)
return get_turf(src)


/obj/machinery/computer/proc/can_touch(var/mob/user)
if (!user)
return 0
if(!Adjacent(user))
return 0
if (user.restrained() || user.buckled)
to_chat(user, "<span class='notice'>You need your hands and legs free for this.</span>")
return 0
if (user.stat || user.paralysis || user.sleeping || user.lying || user.weakened)
return 0
if (isAI(user))
to_chat(user, "<span class='notice'>You need hands for this.</span>")
return 0
return 1
2 changes: 2 additions & 0 deletions code/modules/emotes/emote_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@
if(M)
if(isobserver(M))
message = "<span class='emote'><B>[src]</B> ([ghost_follow_link(src, M)]) [input]</span>"
if(usr && usr.client && M && !(get_z(usr) == get_z(M)))
message = "<span class='multizsay'>[message]</span>"
M.show_message(message, m_type)
M.create_chat_message(src, "[runemessage]", FALSE, list("emote"), (m_type == AUDIBLE_MESSAGE))

Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/hear_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@
message = "<span class='game say'>[message]</span>"
if(speaker && !speaker.client)
message = "<span class='npcsay'>[message]</span>"
else if(speaker && !(get_z(src) == get_z(speaker)))
message = "<span class='multizsay'>[message]</span>"
to_chat(src, message)
else if(teleop)
to_chat(teleop, "<span class='game say'>[create_text_tag("body", "BODY:", teleop.client)][message]</span>")
Expand All @@ -159,6 +161,8 @@
message = "<span class='game say'>[message]</span>"
if(speaker && !speaker.client)
message = "<span class='npcsay'>[message]</span>"
else if(speaker && !(get_z(src) == get_z(speaker)))
message = "<span class='multizsay'>[message]</span>"
to_chat(src, message)
else if(teleop)
to_chat(teleop, "<span class='game say'>[create_text_tag("body", "BODY:", teleop.client)][message]</span>")
Expand Down Expand Up @@ -333,4 +337,6 @@
var/rendered = "<span class='game say'><span class='name'>[name]</span> [message]</span>"
if(!speaker.client)
rendered = "<span class='npcsay'>[rendered]</span>"
else if(speaker && !(get_z(src) == get_z(speaker)))
rendered = "<span class='multizsay'>[message]</span>"
to_chat(src, rendered)
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -548,3 +548,9 @@
if(src.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags
if(src.wear_mask.clean_blood())
src.update_inv_wear_mask(0)

/mob/living/carbon/proc/food_preference(var/allergen_type) //RS edit

if(allergen_type in species.food_preference)
return species.food_preference_bonus
return 0
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/human/species/species_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
var/can_climb = FALSE
var/climbing_delay = 1.5 // We climb with a quarter delay

var/list/food_preference = list() //RS edit
var/food_preference_bonus = 0

/datum/species/proc/give_numbing_bite() //Holy SHIT this is hacky, but it works. Updating a mob's attacks mid game is insane.
unarmed_attacks = list()
Expand Down
Loading

0 comments on commit 723fb7b

Please sign in to comment.