Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge upstream #732

Merged
merged 9 commits into from
Nov 18, 2023
Merged
63 changes: 35 additions & 28 deletions code/datums/helper_datums/teleport.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
if(isnull(effect_out))
effect_out = effect
if(D.start(atom_to_teleport, destination, variance_range, force_teleport, effect_in, effect_out, sound_in, sound_out, bypass_area_flag, safe_turf_pick, do_effect))
return 1
return 0
return TRUE
return FALSE

/datum/teleport
var/atom/movable/teleatom //atom to teleport
Expand All @@ -38,72 +38,73 @@
var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation)
var/ignore_area_flag = FALSE
var/safe_turf_first = FALSE //If the teleport isn't precise and this is TRUE, only non-space, non-dense turfs will be selected, unless there's no other option for teleportation.
var/static/list/blacklisted = list(/obj/machinery/teleport/perma, /obj/machinery/teleport/hub) //List of objects that the destination turf cannot contain

/datum/teleport/proc/start(ateleatom, adestination, aprecision = 0, afteleport = 1, aeffectin = null, aeffectout = null, asoundin = null, asoundout = null, bypass_area_flag = FALSE, safe_turf_pick = FALSE, do_effect = FALSE)
if(!initTeleport(arglist(args)))
return 0
return 1
return FALSE
return TRUE

/datum/teleport/proc/initTeleport(ateleatom, adestination, aprecision, afteleport, aeffectin, aeffectout, asoundin, asoundout, bypass_area_flag = FALSE, safe_turf_pick = FALSE, do_effect = FALSE)
if(!setTeleatom(ateleatom))
return 0
return FALSE
if(!setDestination(adestination))
return 0
return FALSE
safe_turf_first = safe_turf_pick //before precision for bag of holding interference
if(!setPrecision(aprecision))
return 0
return FALSE
if(do_effect)
setEffects(aeffectin, aeffectout)
setForceTeleport(afteleport)
setSounds(asoundin,asoundout)
ignore_area_flag = bypass_area_flag
return 1
return TRUE

//must succeed
/datum/teleport/proc/setPrecision(aprecision)
if(isnum(aprecision))
precision = aprecision
return 1
return 0
return TRUE
return FALSE

//must succeed
/datum/teleport/proc/setDestination(atom/adestination)
if(istype(adestination))
destination = adestination
return 1
return 0
return TRUE
return FALSE

//must succeed in most cases
/datum/teleport/proc/setTeleatom(atom/movable/ateleatom)
if(iseffect(ateleatom) && !istype(ateleatom, /obj/effect/dummy/chameleon))
qdel(ateleatom)
return 0
return FALSE
if(istype(ateleatom))
teleatom = ateleatom
return 1
return 0
return TRUE
return FALSE

//custom effects must be properly set up first for instant-type teleports
//optional
/datum/teleport/proc/setEffects(datum/effect_system/aeffectin=null,datum/effect_system/aeffectout=null)
effectin = istype(aeffectin) ? aeffectin : null
effectout = istype(aeffectout) ? aeffectout : null
return 1
return TRUE

//optional
/datum/teleport/proc/setForceTeleport(afteleport)
force_teleport = afteleport
return 1
return TRUE

//optional
/datum/teleport/proc/setSounds(asoundin=null,asoundout=null)
soundin = isfile(asoundin) ? asoundin : null
soundout = isfile(asoundout) ? asoundout : null
return 1
return TRUE

//placeholder
/datum/teleport/proc/teleportChecks()
return 1
return TRUE

/datum/teleport/proc/playSpecials(atom/location,datum/effect_system/effect,sound)
if(location)
Expand Down Expand Up @@ -141,21 +142,27 @@
destturf = safepick(posturfs)
else
destturf = get_turf(destination)

// Make sure the target tile does not contain a teleporter on it
for(var/teleporter_type in blacklisted)
var/teleporters = destturf.search_contents_for(teleporter_type)
if(length(teleporters))
return FALSE

if(!is_teleport_allowed(destturf.z) && !ignore_area_flag)
return 0
return FALSE
// Only check the destination zlevel for is_teleport_allowed. Checking origin as well breaks ERT teleporters.

var/area/destarea = get_area(destturf)

if(!ignore_area_flag)
if(curarea.tele_proof)
return 0
return FALSE
if(destarea.tele_proof)
return 0
return FALSE

if(!destturf || !curturf)
return 0
return FALSE

playSpecials(curturf,effectin,soundin)

Expand All @@ -175,18 +182,18 @@

destarea.Entered(teleatom)

return 1
return TRUE

/datum/teleport/proc/teleport()
if(teleportChecks())
return doTeleport()
return 0
return FALSE

/datum/teleport/instant/start(ateleatom, adestination, aprecision = 0, afteleport = 1, aeffectin = null, aeffectout = null, asoundin = null, asoundout = null, bypass_area_flag = FALSE, safe_turf_pick = FALSE)
if(..())
if(teleport())
return 1
return 0
return TRUE
return FALSE


/datum/teleport/instant/science
Expand All @@ -207,7 +214,7 @@
if(isliving(teleatom))
var/mob/living/MM = teleatom
to_chat(MM, "<span class='warning'>The bluespace interface on your bag of holding interferes with the teleport!</span>")
return 1
return TRUE

// Random safe location finder
/proc/find_safe_turf(zlevel, list/zlevels)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
data["chemicals"] = chemicals
return data

/obj/machinery/sleeper/ui_act(action, params)
/obj/machinery/sleeper/ui_act(action, params, datum/tgui/ui)
if(..())
return
if(!controls_inside && usr == occupant)
Expand Down Expand Up @@ -295,7 +295,7 @@
else
to_chat(usr, "<span class='danger'>This person is not in good enough condition for sleepers to be effective! Use another means of treatment, such as cryogenics!</span>")
if("removebeaker")
remove_beaker()
remove_beaker(ui.user)
if("togglefilter")
toggle_filter()
if("ejectify")
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/devices/scanners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ REAGENT SCANNER
msgs += "<span class='warning'><b>Warning: Blood Level ERROR: --% --cl.</span><span class='notice'>Type: ERROR</span>"
msgs += "<span class='notice'>Subject's pulse: <font color='red'>-- bpm.</font></span>"
to_chat(user, chat_box_healthscan(msgs.Join("<br>")))
return

var/mob/living/carbon/human/H = M
var/fake_oxy = max(rand(1,40), H.getOxyLoss(), (300 - (H.getToxLoss() + H.getFireLoss() + H.getBruteLoss())))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/crates_lockers/crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
if(Adjacent(user) && !opened)
if(HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || user.stat) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
togglelock()
togglelock(user)
return

. = ..()
Expand Down
5 changes: 4 additions & 1 deletion code/modules/antagonists/changeling/powers/chameleon_skin.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/action/changeling/chameleon_skin
name = "Chameleon Skin"
desc = "Our skin pigmentation rapidly changes to suit our current environment. Costs 25 chemicals."
helptext = "Allows us to become invisible after a few seconds of standing still. Can be toggled on and off."
helptext = "Allows us to become invisible after a few seconds of standing still. While active, it silences our footsteps. Can be toggled on and off."
button_icon_state = "chameleon_skin"
dna_cost = 4
chemical_cost = 25
Expand All @@ -14,9 +14,11 @@
if(H.dna.GetSEState(GLOB.chameleonblock))
H.dna.SetSEState(GLOB.chameleonblock, 0)
singlemutcheck(H, GLOB.chameleonblock, MUTCHK_FORCED)
REMOVE_TRAIT(user, TRAIT_SILENT_FOOTSTEPS, CHANGELING_TRAIT)
else
H.dna.SetSEState(GLOB.chameleonblock, 1)
singlemutcheck(H, GLOB.chameleonblock, MUTCHK_FORCED)
ADD_TRAIT(user, TRAIT_SILENT_FOOTSTEPS, CHANGELING_TRAIT)

SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]"))
return TRUE
Expand All @@ -26,4 +28,5 @@
if(C.dna.GetSEState(GLOB.chameleonblock))
C.dna.SetSEState(GLOB.chameleonblock, 0)
singlemutcheck(C, GLOB.chameleonblock, MUTCHK_FORCED)
REMOVE_TRAIT(user, TRAIT_SILENT_FOOTSTEPS, CHANGELING_TRAIT)
..()
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#define COMPLETION_NOTIFY_DELAY 5 SECONDS
#define RETURN_INJURY_CHANCE 85
#define RETURN_SOUVENIR_CHANCE 10
/// How long an antagonist target remains in the Syndicate jail.
#define ANTAG_CONTRACT_TIME 10 MINUTES

/**
* # Syndicate Contract
Expand All @@ -19,7 +21,6 @@
var/portal_duration = 5 MINUTES
/// How long a target remains in the Syndicate jail.
var/prison_time = 4 MINUTES
/// List of items a target can get randomly after their return.
var/list/obj/item/souvenirs = list(
/obj/item/bedsheet/syndie,
/obj/item/clothing/under/syndicate/tacticool,
Expand All @@ -41,9 +42,6 @@
var/credits_lower_mult = 25
// The upper bound of the credits reward multiplier.
var/credits_upper_mult = 40
// Implants (non cybernetic ones) that shouldn't be removed when a victim gets kidnapped.
// Typecache; initialized in New()
var/static/implants_to_keep = null
// Variables
/// The owning contractor hub.
var/datum/contractor_hub/owning_hub = null
Expand Down Expand Up @@ -88,21 +86,6 @@
var/static/nt_am_board_resigned = FALSE

/datum/syndicate_contract/New(datum/contractor_hub/hub, datum/mind/owner, list/datum/mind/target_blacklist, target_override)
// Init settings
if(!implants_to_keep)
implants_to_keep = typecacheof(list(
// These two are specifically handled in code to prevent usage, but are included here for clarity.
/obj/item/implant/storage,
/obj/item/implant/uplink,
// The rest
/obj/item/implant/adrenalin,
/obj/item/implant/emp,
/obj/item/implant/explosive,
/obj/item/implant/freedom,
/obj/item/implant/traitor,
/obj/item/implant/gorilla_rampage,
/obj/item/implant/stealth
))
// Initialize
owning_hub = hub
contract = new /datum/objective/contract(src)
Expand Down Expand Up @@ -352,7 +335,11 @@
var/mob/living/carbon/human/H = M

// Prepare their return
if(M.mind.special_role && !(M.mind.special_role in list(SPECIAL_ROLE_ERT, SPECIAL_ROLE_DEATHSQUAD)))
prison_time = ANTAG_CONTRACT_TIME

prisoner_timer_handle = addtimer(CALLBACK(src, PROC_REF(handle_target_return), M, T), prison_time, TIMER_STOPPABLE)

LAZYSET(GLOB.prisoner_belongings.prisoners, M, src)

// Shove all of the victim's items in the secure locker.
Expand Down Expand Up @@ -394,20 +381,13 @@
if(isplasmaman(H) && I == H.head)
continue

// Any kind of non-syndie implant gets potentially removed (mindshield, etc)
// Any kind of implant gets potentially removed (mindshield, freedoms, etc)
if(istype(I, /obj/item/implant))
if(istype(I, /obj/item/implant/storage)) // Storage stays, but items within get confiscated
if(istype(I, /obj/item/implant/storage)) // Storage items are removed and placed in the confiscation locker before the implant is taken.
var/obj/item/implant/storage/storage_implant = I
for(var/it in storage_implant.storage)
storage_implant.storage.remove_from_storage(it)
stuff_to_transfer += it
continue
else if(istype(I, /obj/item/implant/uplink)) // Uplink stays, but is jammed while in jail
var/obj/item/implant/uplink/uplink_implant = I
uplink_implant.hidden_uplink.is_jammed = TRUE
continue
else if(is_type_in_typecache(I, implants_to_keep))
continue
qdel(I)
continue

Expand Down Expand Up @@ -461,7 +441,9 @@
var/obj/item/reagent_containers/food/drinks/drinkingglass/drink = new(get_turf(M))
drink.reagents.add_reagent("tea", 25) // British coders beware, tea in glasses

temp_objs = list(food, drink)
var/obj/item/coin/antagtoken/passingtime = new(get_turf(M))

temp_objs = list(food, drink, passingtime)

// Narrate their kidnapping and torturing experience.
if(M.stat != DEAD)
Expand Down Expand Up @@ -658,3 +640,4 @@
#undef COMPLETION_NOTIFY_DELAY
#undef RETURN_INJURY_CHANCE
#undef RETURN_SOUVENIR_CHANCE
#undef ANTAG_CONTRACT_TIME
1 change: 0 additions & 1 deletion code/modules/paperwork/paper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
return ..()

/obj/item/paper/proc/rename(mob/user)

if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='warning'>You cut yourself on the paper.</span>")
return
Expand Down
3 changes: 1 addition & 2 deletions code/modules/surgery/organs_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -820,8 +820,7 @@
"[user] is beginning to cauterize the incision on [target]'s [zone] with \the [tool].",
"You are beginning to cauterize the incision on [target]'s [zone] with \the [tool]."
)
var/obj/item/organ/affected = target.get_organ(target_zone)
affected.custom_pain("Your [zone] is being burned!")
to_chat(user, "<span class='userdanger'>Your [zone] is being burned!</span>") // No custom pain because xenos are special
return ..()

/datum/surgery_step/generic/seal_carapace/end_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
Expand Down
Binary file modified icons/mob/human_races/r_skrell.dmi
Binary file not shown.
Binary file modified icons/mob/sprite_accessories/skrell/skrell_hair.dmi
Binary file not shown.
File renamed without changes.
Loading