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 Apr 13, 2024
2 parents d19d907 + d39d966 commit 0f609d4
Show file tree
Hide file tree
Showing 37 changed files with 576 additions and 314 deletions.
2 changes: 1 addition & 1 deletion code/ATMOSPHERICS/_atmos_setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// atmospherics devices.
//--------------------------------------------

var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "black" = PIPE_COLOR_BLACK, "purple" = PIPE_COLOR_PURPLE)
var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "black" = PIPE_COLOR_BLACK, "orange" = PIPE_COLOR_ORANGE, "white" = PIPE_COLOR_WHITE, "purple" = PIPE_COLOR_PURPLE)

/proc/pipe_color_lookup(var/color)
for(var/C in pipe_colors)
Expand Down
16 changes: 7 additions & 9 deletions code/game/machinery/cell_charger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,10 @@
var/newlevel = round(charging.percent() * 4.0 / 99)
//to_world("nl: [newlevel]")

if(chargelevel != newlevel)

cut_overlays()
add_overlay("ccharger-o[newlevel]")

chargelevel = newlevel
cut_overlays()
add_overlay("ccharger-o[newlevel]")

chargelevel = newlevel
add_overlay(image(charging.icon, charging.icon_state))
add_overlay("ccharger-[charging.connector_type]-on")

Expand Down Expand Up @@ -126,15 +123,16 @@
return

if(charging && !charging.fully_charged())
var/newlevel = round(charging.percent() * 4.0 / 99)
charging.give(efficiency*CELLRATE)
update_use_power(USE_POWER_ACTIVE)

update_icon()
if(chargelevel != newlevel)
update_icon()
else
update_use_power(USE_POWER_IDLE)

/obj/machinery/cell_charger/RefreshParts()
var/E = 0
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
E += C.rating
efficiency = active_power_usage * (1+ (E - 1)*0.5)
efficiency = active_power_usage * (1+ (E - 1)*0.5)
8 changes: 6 additions & 2 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,11 @@ About the new airlock wires panel:
if(istype(C, /mob/living))
..()
return
if(!repairing && C.has_tool_quality(TOOL_WELDER) && !( src.operating > 0 ) && src.density)
//VOREstation Edit: Removing material cost from repair requirements
if(C.has_tool_quality(TOOL_WELDER) && !( src.operating > 0 ) && src.density)
if(health < maxhealth && user.a_intent == I_HELP)
..()
return
var/obj/item/weapon/weldingtool/W = C.get_welder()
if(W.remove_fuel(0,user))
if(!src.welded)
Expand Down Expand Up @@ -1176,7 +1180,7 @@ About the new airlock wires panel:
else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE
var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user)
else if(!repairing && C.has_tool_quality(TOOL_CROWBAR))
else if(C.has_tool_quality(TOOL_CROWBAR))
if(can_remove_electronics())
playsound(src, C.usesound, 75, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.")
Expand Down
54 changes: 6 additions & 48 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
var/destroy_hits = 10 //How many strong hits it takes to destroy the door
var/min_force = 10 //minimum amount of force needed to damage the door with a melee weapon
var/hitsound = 'sound/weapons/smash.ogg' //sound door makes when hit with a weapon
var/repairing = 0
//var/repairing = 0 //VOREstation Edit: We're not using materials anymore
var/block_air_zones = 1 //If set, air zones cannot merge across the door even when it is opened.
var/close_door_at = 0 //When to automatically close the door, if possible

Expand Down Expand Up @@ -226,63 +226,21 @@
if(istype(I))
if(attackby_vr(I, user)) //VOREStation begin: Fireproofing
return //VOREStation begin: Fireproofing
if(istype(I, /obj/item/stack/material) && I.get_material_name() == src.get_material_name())
if(stat & BROKEN)
to_chat(user, "<span class='notice'>It looks like \the [src] is pretty busted. It's going to need more than just patching up now.</span>")
return
if(health >= maxhealth)
to_chat(user, "<span class='notice'>Nothing to fix!</span>")
return
if(!density)
to_chat(user, "<span class='warning'>\The [src] must be closed before you can repair it.</span>")
return

//figure out how much metal we need
var/amount_needed = (maxhealth - health) / DOOR_REPAIR_AMOUNT
amount_needed = (round(amount_needed) == amount_needed)? amount_needed : round(amount_needed) + 1 //Why does BYOND not have a ceiling proc?

var/obj/item/stack/stack = I
var/amount_given = amount_needed - repairing
var/mats_given = stack.get_amount()
if(repairing && amount_given <= 0)
to_chat(user, "<span class='warning'>You must weld or remove \the [get_material_name()] from \the [src] before you can add anything else.</span>")
else
if(mats_given >= amount_given)
if(stack.use(amount_given))
repairing += amount_given
else
if(stack.use(mats_given))
repairing += mats_given
amount_given = mats_given
if(amount_given)
to_chat(user, "<span class='notice'>You fit [amount_given] [stack.singular_name]\s to damaged and broken parts on \the [src].</span>")

return

if(repairing && I.has_tool_quality(TOOL_WELDER))
if(health < maxhealth && I.has_tool_quality(TOOL_WELDER))
if(!density)
to_chat(user, "<span class='warning'>\The [src] must be closed before you can repair it.</span>")
return

var/obj/item/weapon/weldingtool/welder = I.get_welder()
if(welder.remove_fuel(0,user))
to_chat(user, "<span class='notice'>You start to fix dents and weld \the [get_material_name()] into place.</span>")
to_chat(user, "<span class='notice'>You start to fix dents and repair \the [src].</span>")
playsound(src, welder.usesound, 50, 1)
if(do_after(user, (5 * repairing) * welder.toolspeed) && welder && welder.isOn())
var/repairtime = maxhealth - health //Since we're not using materials anymore... We'll just calculate how much damage there is to repair.
if(do_after(user, repairtime * welder.toolspeed) && welder && welder.isOn())
to_chat(user, "<span class='notice'>You finish repairing the damage to \the [src].</span>")
health = between(health, health + repairing*DOOR_REPAIR_AMOUNT, maxhealth)
health = maxhealth
update_icon()
repairing = 0
return

if(repairing && I.has_tool_quality(TOOL_CROWBAR))
var/datum/material/mat = get_material()
var/obj/item/stack/material/repairing_sheet = mat.place_sheet(loc, repairing)
repairing = 0
to_chat(user, "<span class='notice'>You remove \the [repairing_sheet].</span>")
playsound(src, I.usesound, 100, 1)
return

//psa to whoever coded this, there are plenty of objects that need to call attack() on doors without bludgeoning them.
if(src.density && istype(I, /obj/item/weapon) && user.a_intent == I_HURT && !istype(I, /obj/item/weapon/card))
var/obj/item/weapon/W = I
Expand Down
9 changes: 7 additions & 2 deletions code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,12 @@
return //Don't open the door if we're putting tape on it to tell people 'don't open the door'.
if(operating)
return//Already doing something.
if(C.has_tool_quality(TOOL_WELDER) && !repairing)
if(C.has_tool_quality(TOOL_WELDER))
//VOREstation Edit: Removing Material requirements on repairs
if(health < maxhealth)
..()
return
//VOREstation Edit End
if(prying)
to_chat(user, "<span class='notice'>Someone's busy prying that [density ? "open" : "closed"]!</span>")
var/obj/item/weapon/weldingtool/W = C.get_welder()
Expand All @@ -269,7 +274,7 @@
update_icon()
return

if(blocked && C.has_tool_quality(TOOL_CROWBAR) && !repairing)
if(blocked && C.has_tool_quality(TOOL_CROWBAR))
if(!hatch_open)
to_chat(user, "<span class='danger'>You must open the maintenance hatch first!</span>")
else
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/effects/semirandom_mobs_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ var/global/list/semirandom_mob_spawner_decisions = list()
overwrite_hostility = 1
mob_hostile = 0
mob_retaliate = 0
mob_ghostjoin = 25 //25% chance to be ghost joinable

/obj/random/mob/semirandom_mob_spawner/vore/passive/b
mob_faction = "pasvoreb"
Expand All @@ -1030,6 +1031,7 @@ var/global/list/semirandom_mob_spawner_decisions = list()
overwrite_hostility = 1
mob_hostile = 0
mob_retaliate = 1
mob_ghostjoin = 25 //25% chance to be ghost joinable

/obj/random/mob/semirandom_mob_spawner/vore/retaliate/b
mob_faction = "retvoreb"
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/random/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
var/mob_wander_distance = 3
var/mob_hostile = 0
var/mob_retaliate = 0
var/mob_ghostjoin = 0 //Should be a number between 0 and 100, dictates the probability of that mob being ghost joinable.

/obj/random/mob/item_to_spawn()
return pick(prob(10);/mob/living/simple_mob/animal/passive/lizard,
Expand Down Expand Up @@ -62,7 +63,9 @@
if(mob_faction)
M.faction = mob_faction


if(mob_ghostjoin)
if(prob(mob_ghostjoin))
M.ghostjoin = 1

/obj/random/mob/sif
name = "Random Sif Animal"
Expand Down
13 changes: 7 additions & 6 deletions code/game/objects/structures/catwalk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
/obj/structure/catwalk/ex_act(severity)
switch(severity)
if(1)
new /obj/item/stack/rods(src.loc)
new /obj/item/stack/rods(src.loc, 2) //VOREstation Edit: Conservation of mass
qdel(src)
if(2)
new /obj/item/stack/rods(src.loc)
new /obj/item/stack/rods(src.loc, 2) //VOREstation Edit: Conservation of mass
qdel(src)

/obj/structure/catwalk/attack_robot(var/mob/user)
Expand All @@ -77,11 +77,12 @@
/obj/structure/catwalk/proc/deconstruct(mob/user)
playsound(src, 'sound/items/Welder.ogg', 100, 1)
to_chat(user, "<span class='notice'>Slicing \the [src] joints ...</span>")
new /obj/item/stack/rods(src.loc)
new /obj/item/stack/rods(src.loc)
//Lattice would delete itself, but let's save ourselves a new obj
if(isspace(loc) || isopenspace(loc))
if(isopenspace(loc) && user.a_intent == I_HELP)
new /obj/structure/lattice/(src.loc)
new /obj/item/stack/rods(src.loc, 1)
else
new /obj/item/stack/rods(src.loc, 2)
if(plated_tile)
new plated_tile(src.loc)
qdel(src)
Expand Down Expand Up @@ -200,4 +201,4 @@
/obj/effect/catwalk_plated/techfloor
icon_state = "catwalk_techfloor"
tile = /obj/item/stack/tile/floor/techgrey
platecolor = "#363f43"
platecolor = "#363f43"
12 changes: 12 additions & 0 deletions code/game/objects/structures/ghost_pods/event_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,15 @@

/obj/structure/ghost_pod/ghost_activated/morphspawn/no_announce
announce_prob = 0

/obj/structure/ghost_pod/ghost_activated/maintpred/redgate //For ghostpods placed in the redgate that aren't spawned via an event
name = "creature hole"
desc = "Looks like some creature dug is hiding in the redgate..."
announce_prob = 0
icon_state = "redgate_hole"
icon_state_opened = "redgate_hole"

/obj/structure/ghost_pod/ghost_activated/maintpred/redgate/Initialize()
..()
if(!(src in active_ghost_pods))
active_ghost_pods += src
2 changes: 1 addition & 1 deletion code/game/objects/structures/girders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
reinforcing = 0

/obj/structure/girder/proc/dismantle()
girder_material.place_dismantled_product(get_turf(src))
girder_material.place_dismantled_product(get_turf(src), 2) //VOREstation Edit: Conservation of mass
qdel(src)

/obj/structure/girder/attack_hand(mob/user as mob)
Expand Down
24 changes: 12 additions & 12 deletions code/game/objects/structures/lattice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,12 @@
if(WT.welding == 1)
if(WT.remove_fuel(0, user))
to_chat(user, "<span class='notice'>Slicing lattice joints ...</span>")
new /obj/item/stack/rods(src.loc)
new /obj/item/stack/rods(src.loc, 1) //VOREstation Edit: Return the same amount of rods used to build this.
qdel(src)
return
if(istype(C, /obj/item/stack/rods))
var/obj/item/stack/rods/R = C
if(R.get_amount() < 2)
to_chat(user, "<span class='notice'>You need at least two rods to form a catwalk here.</span>")
else
to_chat(user, "<span class='notice'>You start connecting \the [R.name] to \the [src.name] ...</span>")
if(do_after(user, 5 SECONDS))
R.use(2) //2023-02-27 bugfix to prevent rods being used without catwalk creation
src.alpha = 0 // Note: I don't know why this is set, Eris did it, just trusting for now. ~Leshana
new /obj/structure/catwalk(src.loc)
qdel(src)
if(istype(C, /obj/item/stack/rods)) //VOREstation Edit: Modernizes upgrading lattices into catwalks.
upgrade(C, user)
//VOREstation Edit End
return
return

Expand All @@ -98,3 +90,11 @@

icon_state = "lattice[dir_sum]"
return

//Vorestation Edit: Moves upgrading lattices to their own proc for other stuff to call. Also makes them instant.
/obj/structure/lattice/proc/upgrade(obj/item/stack/rods/R, mob/user)
to_chat(user, "<span class='notice'>You start connecting \the [R.name] to \the [src.name] ...</span>")
R.use(1)
src.alpha = 0 // Note: I don't know why this is set, Eris did it, just trusting for now. ~Leshana
new /obj/structure/catwalk(src.loc)
qdel(src)
4 changes: 2 additions & 2 deletions code/game/turfs/simulated/floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
if(!is_plating()) // Flooring -> Plating
swap_decals()
if(flooring.build_type && place_product)
new flooring.build_type(src)
new flooring.build_type(src, flooring.build_cost) //VOREstation Edit: conservation of mass
var/newtype = flooring.get_plating_type()
if(newtype) // Has a custom plating type to become
set_flooring(get_flooring_data(newtype))
Expand Down Expand Up @@ -182,4 +182,4 @@
var/mob/living/livingUser = user
if(try_graffiti(livingUser, livingUser.get_active_hand()))
return
. = ..()
. = ..()
5 changes: 3 additions & 2 deletions code/game/turfs/simulated/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,10 @@
else
material.place_dismantled_girder(src, null, girder_material)
if(!devastated)
material.place_dismantled_product(src)
if (!reinf_material)
if (reinf_material)
material.place_dismantled_product(src)
else
material.place_dismantled_product(src, 2)

for(var/obj/O in src.contents) //Eject contents!
if(istype(O,/obj/structure/sign/poster))
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/space/space.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
if(istype(C, /obj/item/stack/rods))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
L.upgrade(C, user)
return
var/obj/item/stack/rods/R = C
if (R.use(1))
Expand Down
16 changes: 7 additions & 9 deletions code/modules/ai/ai_holder_combat_unseen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// Used when a target is out of sight or invisible.
/datum/ai_holder/proc/engage_unseen_enemy()
ai_log("engage_unseen_enemy() : Entering.", AI_LOG_TRACE)

// Also handled in strategic updates but handling it here allows for more fine resolution timeouts
if((lose_target_time+lose_target_timeout) <= world.time)
return find_target()

// Lets do some last things before giving up.
if(conserve_ammo || !holder.ICheckRangedAttack(target_last_seen_turf))
// We conserve ammo (or can't shoot) so walk closer
Expand All @@ -29,7 +29,7 @@
on_engagement(T)
if(firing_lanes && !test_projectile_safety(T))
step_rand(holder)
holder.face_atom(T)
holder?.face_atom(T)
return ATTACK_FAILED

return ranged_attack(T)
Expand Down Expand Up @@ -60,7 +60,7 @@
/obj/structure/stairs/top,
/obj/structure/stairs/bottom
)

if(intelligence_level >= AI_SMART)
possible_escape_types += /obj/structure/ladder

Expand All @@ -69,18 +69,18 @@
continue // Not something they could have escaped through
if(turn(holder.dir, 180) & get_dir(get_turf(holder), get_turf(A)))
continue // Surely, they couldn't have escaped *behind* us!

if(istype(A, /obj/machinery/door))
var/obj/machinery/door/D = A
if(D.glass) // Surely, they couldn't hide behind a transparent door!
continue
if(D.density && intelligence_level < AI_SMART) // Surely, they couldn't have escaped through a *closed* door
continue

var/dist = get_dist(holder, A)
if(dist == closest_dist)
closest_escape += A

else if(dist < closest_dist)
closest_escape.Cut()
closest_escape += A
Expand All @@ -89,5 +89,3 @@
if(closest_escape.len)
return pick(closest_escape)
return null


Loading

0 comments on commit 0f609d4

Please sign in to comment.