Skip to content

Commit

Permalink
Merge branch 'dev-sierra' into Translate_pref
Browse files Browse the repository at this point in the history
  • Loading branch information
YegorKandziuba authored Nov 9, 2023
2 parents a3cab04 + 743e1a0 commit 10e3419
Show file tree
Hide file tree
Showing 59 changed files with 27,851 additions and 11,592 deletions.
11 changes: 7 additions & 4 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,13 @@
//Lying animation
#define ANIM_LYING_TIME 2

//Planet habitability class
#define HABITABILITY_IDEAL 1
#define HABITABILITY_OKAY 2
#define HABITABILITY_BAD 3

//Planet habitability weight
#define HABITABILITY_LOCKED 1
#define HABITABILITY_TYPICAL 2
#define HABITABILITY_BAD 3
#define HABITABILITY_EXTREME 4


#ifndef WINDOWS_HTTP_POST_DLL_LOCATION
#define WINDOWS_HTTP_POST_DLL_LOCATION "lib/byhttp.dll"
Expand Down
1 change: 1 addition & 0 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
* resolve chain will be called.
*/
/atom/proc/use_tool(obj/item/tool, mob/living/user, list/click_params)
SHOULD_CALL_PARENT(TRUE)
return FALSE


Expand Down
2 changes: 1 addition & 1 deletion code/datums/browser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

return {"<!DOCTYPE html>
<html>
<meta charset=UTF-8">
<meta charset="UTF-8">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
[head_content]
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
icon_state = "cellconsole"
density = FALSE
interact_offline = 1
stat_immune = MACHINE_STAT_NOSCREEN | MACHINE_STAT_NOINPUT | MACHINE_STAT_NOPOWER
var/mode = null

//Used for logging people entering cryosleep and important items they are carrying.
Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@
operating = DOOR_OPERATING_YES

do_animate("opening")
icon_state = "door0"
set_opacity(0)
if(width > 1)
set_fillers_opacity(0)
Expand Down
6 changes: 4 additions & 2 deletions code/game/objects/effects/chem/water.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
if(reagents.total_volume < 1)
break
if(T == get_turf(target))
for(var/atom/A in splash_others)
reagents.splash(A, reagents.total_volume/length(splash_others)) //splash anything left
var/list/splash_targets = splash_others + splash_mobs
var/splash_amount = reagents.total_volume / length(splash_targets)
for(var/atom/atom in splash_targets)
reagents.splash(atom, splash_amount)
break

sleep(delay)
Expand Down
26 changes: 23 additions & 3 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -275,18 +275,38 @@
R.activate_module(src)
R.hud_used.update_robot_modules_display()

/obj/item/attackby(obj/item/W, mob/user)
if((. = SSfabrication.try_craft_with(src, W, user)))
return
/obj/item/use_tool(obj/item/W, mob/living/user, list/click_params)
if(SSfabrication.try_craft_with(src, W, user))
return TRUE

if(istype(W, /obj/item/storage))
var/obj/item/storage/S = W
if(S.use_to_pickup)
if(S.collection_mode) //Mode is set to collect all items
if(isturf(src.loc))
S.gather_all(src.loc, user)
return TRUE
else if (S.can_be_inserted(src, user))
S.handle_item_insertion(src)
return TRUE
return ..()

///Eventually should be deleted in favor of use_tool; keeping duplicate until downstream attackbys are replaced.
/obj/item/attackby(obj/item/W, mob/living/user, list/click_params)
if(SSfabrication.try_craft_with(src, W, user))
return TRUE

if(istype(W, /obj/item/storage))
var/obj/item/storage/S = W
if(S.use_to_pickup)
if(S.collection_mode) //Mode is set to collect all items
if(isturf(src.loc))
S.gather_all(src.loc, user)
return TRUE
else if (S.can_be_inserted(src, user))
S.handle_item_insertion(src)
return TRUE
return ..()

/obj/item/can_embed()
if (!canremove)
Expand Down
24 changes: 12 additions & 12 deletions code/game/objects/items/devices/scanners/_scanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@
return
return TRUE

/obj/item/device/scanner/afterattack(atom/A, mob/user, proximity)
if(!proximity)
return
/obj/item/device/scanner/use_after(atom/target, mob/living/user, click_parameters)
if(!can_use(user))
return
if(is_valid_scan_target(A))
if(is_valid_scan_target(target))
user.visible_message(
SPAN_NOTICE("\The [user] runs \the [src] over \the [A]."),
SPAN_NOTICE("You run \the [src] over \the [A]."),
SPAN_NOTICE("\The [user] runs \the [src] over \the [target]."),
SPAN_NOTICE("You run \the [src] over \the [target]."),
range = 2
)
if(scan_sound)
playsound(src, scan_sound, 30)
if(use_delay && !do_after(user, use_delay, A, DO_PUBLIC_UNIQUE))
to_chat(user, "You stop scanning \the [A] with \the [src].")
return
scan(A, user)
if(use_delay && !do_after(user, use_delay, target, DO_PUBLIC_UNIQUE))
to_chat(user, "You stop scanning \the [target] with \the [src].")
return TRUE
scan(target, user)
if(!scan_title)
scan_title = "[capitalize(name)] scan - [A]"
scan_title = "[capitalize(name)] scan - [target]"
return TRUE
else
to_chat(user, "You cannot get any results from \the [A] with \the [src].")
to_chat(user, "You cannot get any results from \the [target] with \the [src].")
return TRUE

/obj/item/device/scanner/proc/is_valid_scan_target(atom/O)
return FALSE
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/stacks/stack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@
if (src && user.machine == src)
interact(user)
return TRUE
return ..()

/**
* Returns a string forming a basic name of the stack. By default, this is `name`.
Expand Down
38 changes: 10 additions & 28 deletions code/game/objects/items/weapons/extinguisher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
matter = list(MATERIAL_STEEL = 90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")

var/spray_particles = 3
var/spray_amount = 120 //units of liquid per spray - 120 -> same as splashing them with a bucket per spray
var/starting_water = 2000
var/max_water = 2000
Expand Down Expand Up @@ -62,23 +61,6 @@
to_chat(user, "The safety is [safety ? "on" : "off"].")
return

/obj/item/extinguisher/use_before(mob/living/M, mob/user)
. = FALSE
if (user.a_intent == I_HELP && !safety)
if (world.time < last_use + 20)
return TRUE
if (reagents.total_volume < 1)
to_chat(user, SPAN_NOTICE("\The [src] is empty."))
return TRUE

last_use = world.time
reagents.splash(M, min(reagents.total_volume, spray_amount))

user.visible_message(SPAN_NOTICE("\The [user] sprays \the [M] with \the [src]."))
playsound(src.loc, 'sound/effects/extinguish.ogg', 75, 1, -3)

return TRUE

/obj/item/extinguisher/proc/propel_object(obj/O, mob/user, movementdirection)
if(O.anchored) return

Expand All @@ -102,7 +84,6 @@
return FALSE
return ..()


/obj/item/extinguisher/afterattack(atom/target, mob/user, flag)
var/issink = istype(target, /obj/structure/hygiene/sink)

Expand Down Expand Up @@ -145,6 +126,7 @@
if(user.buckled && isobj(user.buckled))
addtimer(new Callback(src, .proc/propel_object, user.buckled, user, direction), 0)

visible_message(SPAN_NOTICE("\The [user] sprays towards \the [target] with \the [src]."))
addtimer(new Callback(src, .proc/do_spray, target), 0)

if(!user.check_space_footing())
Expand All @@ -156,12 +138,12 @@

/obj/item/extinguisher/proc/do_spray(atom/Target)
var/turf/T = get_turf(Target)
var/per_particle = min(spray_amount, reagents.total_volume)/spray_particles
for(var/a = 1 to spray_particles)
if(!src || !reagents.total_volume) return

var/obj/effect/water/W = new /obj/effect/water(get_turf(src))
W.create_reagents(per_particle)
reagents.trans_to_obj(W, per_particle)
W.set_color()
W.set_up(T)
var/available_spray = min(spray_amount, reagents.total_volume)
if(!src || !reagents.total_volume)
return

var/obj/effect/water/W = new /obj/effect/water(get_turf(src))
W.create_reagents(available_spray)
reagents.trans_to_holder(W.reagents, available_spray, safety = 1)
W.set_color()
W.set_up(T)
10 changes: 5 additions & 5 deletions code/game/objects/items/weapons/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
/// Can this backpack be opened while worn on the back?
var/worn_access = TRUE

/obj/item/storage/backpack/attackby(obj/item/W as obj, mob/user as mob)
if (src.use_sound)
playsound(src.loc, src.use_sound, 50, 1, -5)
/obj/item/storage/backpack/use_tool(obj/item/tool, mob/living/user, list/click_params)
if (use_sound)
playsound(loc, use_sound, 50, 1, -5)
return ..()

/obj/item/storage/backpack/equipped(mob/user, slot)
Expand Down Expand Up @@ -73,11 +73,11 @@
..()
return

/obj/item/storage/backpack/holding/attackby(obj/item/W as obj, mob/user as mob)
/obj/item/storage/backpack/holding/use_tool(obj/item/W, mob/living/user, list/click_params)
if(istype(W, /obj/item/storage/backpack/holding) || istype(W, /obj/item/storage/bag/trash/bluespace))
to_chat(user, SPAN_WARNING("The Bluespace interfaces of the two devices conflict and malfunction."))
qdel(W)
return 1
return TRUE
return ..()

//Please don't clutter the parent storage item with stupid hacks.
Expand Down
23 changes: 19 additions & 4 deletions code/game/objects/items/weapons/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,34 @@
update_icon()

//This proc is called when you want to place an item into the storage item.
/obj/item/storage/attackby(obj/item/W as obj, mob/user as mob)
. = ..()
if (.) //if the item was used as a crafting component, just return
/obj/item/storage/use_tool(obj/item/W, mob/living/user, list/click_params)
if ((. = ..())) //if the item was used as a crafting component, just return
return TRUE

if(isrobot(user) && (W == user.get_active_hand()))
return //Robots can't store their modules.

if(!can_be_inserted(W, user))
return

W.add_fingerprint(user)
handle_item_insertion(W)
return TRUE

///Eventually should be deleted in favor of use_tool; keeping duplicate until downstream attackbys are replaced.
/obj/item/storage/attackby(obj/item/W, mob/living/user, click_params)
if ((. = ..())) //if the item was used as a crafting component, just return
return TRUE

if(isrobot(user) && (W == user.get_active_hand()))
return //Robots can't store their modules.

if(!can_be_inserted(W, user))
return

W.add_fingerprint(user)
return handle_item_insertion(W)
handle_item_insertion(W)
return TRUE

/obj/item/storage/attack_hand(mob/user as mob)
if(ishuman(user))
Expand Down
22 changes: 11 additions & 11 deletions code/game/objects/items/weapons/weldbackpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

. = ..()

/obj/item/storage/backpack/weldpack/attackby(obj/item/W as obj, mob/user as mob)
/obj/item/storage/backpack/weldpack/use_tool(obj/item/W, mob/living/user, list/click_params)
if(isWelder(W))
var/obj/item/weldingtool/T = W
if (!T.tank)
to_chat(user, SPAN_WARNING("\The [T] has no tank attached!"))
return
return TRUE
if (!T.tank.can_refuel)
to_chat(user, SPAN_WARNING("\The [T]'s [T.tank.name] does not have a refuelling port."))
return
return TRUE
if (T.welding)
if (user.a_intent == I_HURT)
user.visible_message(
Expand All @@ -36,30 +36,30 @@
explosion(get_turf(src), 4, EX_ACT_HEAVY)
if (!QDELETED(src))
qdel(src)
return
return TRUE
else
to_chat(user, SPAN_WARNING("You need to turn \the [T] off before you can refuel it. Or use harm intent if you're suicidal."))
return
return TRUE
if (!reagents.trans_to_obj(T.tank, T.tank.max_fuel))
to_chat(user, SPAN_WARNING("\The [T]'s [T.tank.name] is already full."))
return
return TRUE
to_chat(user, SPAN_NOTICE("You refill \the [T] with \the [src]."))
playsound(src, 'sound/effects/refill.ogg', 50, 1, -6)
return
return TRUE

else if(istype(W, /obj/item/welder_tank))
var/obj/item/welder_tank/tank = W
if (!tank.can_refuel)
to_chat(user, SPAN_WARNING("\The [tank] does not have a refuelling port."))
return
return TRUE
if (!reagents.trans_to_obj(tank, tank.max_fuel))
to_chat(user, SPAN_WARNING("\The [tank] is already full."))
return
return TRUE
to_chat(user, SPAN_NOTICE("You refuel \the [tank] with \the [src]."))
playsound(loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
return TRUE

..()
else return ..()

/obj/item/storage/backpack/weldpack/afterattack(obj/O as obj, mob/user as mob, proximity)
if(!proximity) // this replaces and improves the get_dist(src,O) <= 1 checks used previously
Expand Down
7 changes: 3 additions & 4 deletions code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,12 @@
if (damtype == DAMAGE_BURN)
. |= DAMAGE_FLAG_LASER

/obj/attackby(obj/item/O, mob/user)
if (isWrench(O) && HAS_FLAGS(obj_flags, OBJ_FLAG_ANCHORABLE))
wrench_floor_bolts(user, O)
/obj/use_tool(obj/item/tool, mob/living/user, list/click_params)
if (isWrench(tool) && HAS_FLAGS(obj_flags, OBJ_FLAG_ANCHORABLE))
wrench_floor_bolts(user, tool)
return TRUE
return ..()


/**
* Whether or not the object can be anchored in its current state/position. Assumes the anchorable flag has already been checked.
*
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/bedsheet_bin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ LINEN BINS
new /obj/item/reagent_containers/glass/rag(get_turf(src))
qdel(src)
return TRUE
return ..()

/obj/item/bedsheet/blue
icon_state = "sheetblue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,6 @@
return TRUE
return ..()

/obj/structure/closet/CtrlAltClick(mob/user)
verb_toggleopen()
return TRUE

/obj/structure/closet/emp_act(severity)
for (var/atom/A as anything in src)
A.emp_act(severity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

set_frequency(frequency)
broadcast_status()
update_icon()


/obj/machinery/atmospherics/unary/outlet_injector/Destroy()
unregister_radio(src, frequency)
Expand Down
Loading

0 comments on commit 10e3419

Please sign in to comment.