mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
Reorganizes and splits shuttle code (#88228)
## About The Pull Request refer to title No code changes were made here, i just copypasted code around The only real difference is that I removed a pretty useless define that depended on TESTING because it got in my way of splitting emergency.dm tbh i didnt want a 50k line refactor pr that nobody is going to review so im getting it out of the way in a separate PR ## Why It's Good For The Game Shuttle code is literally all over the place please help me oh gosh ## Changelog Nothing player facing or developer facing (at least I really hope so)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
/obj/machinery/shuttle_manipulator
|
||||
name = "shuttle manipulator"
|
||||
desc = "I shall be telling this with a sigh\n\
|
||||
Somewhere ages and ages hence:\n\
|
||||
Two roads diverged in a wood, and I,\n\
|
||||
I took the one less traveled by,\n\
|
||||
And that has made all the difference."
|
||||
|
||||
icon = 'icons/obj/machines/shuttle_manipulator.dmi'
|
||||
icon_state = "holograph_on"
|
||||
|
||||
density = TRUE
|
||||
@@ -0,0 +1,18 @@
|
||||
///These are for the medisim shuttle
|
||||
|
||||
/obj/machinery/computer/reality_simulation
|
||||
name = "reality simulation computer"
|
||||
desc = "A computer calculating the medieval times. Uh, wow. Is this bad boy quantum?"
|
||||
|
||||
/obj/item/paper/crumpled/retired_designs
|
||||
name = "crumpled notes on cuirass design"
|
||||
default_raw_text = {"Yeah, you may as well just melt this crap back down into metal.<br>
|
||||
<br>
|
||||
<br>
|
||||
What else am I supposed to say? Nanotrasen thinks these authentic cuirass models are too expensive for the simulation watchers.
|
||||
That's bullshit, but my hands are tied. But you know. If one of you cargo folk up at central command take a cuirass for yourself
|
||||
instead of throwing the damn thing out, like, I'm sure nobody would notice or care. OK, but I'm sitting here on an official
|
||||
NT shuttle encouraging you to break spacelaw. Damn, I'm bored as fuck. I was kidding. Melt em. See you guys soon.
|
||||
<br>
|
||||
<br>
|
||||
<i>the rest of the page is filled with various doodles of people fighting with swords.</i>"}
|
||||
@@ -0,0 +1,21 @@
|
||||
/obj/effect/abstract/ripple
|
||||
name = "hyperspace ripple"
|
||||
desc = "Something is coming through hyperspace, you can see the \
|
||||
visual disturbances. It's probably best not to be on top of these \
|
||||
when whatever is tunneling comes through."
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "medi_holo"
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
layer = RIPPLE_LAYER
|
||||
plane = ABOVE_GAME_PLANE
|
||||
mouse_opacity = MOUSE_OPACITY_ICON
|
||||
alpha = 0
|
||||
|
||||
/obj/effect/abstract/ripple/Initialize(mapload, time_left)
|
||||
. = ..()
|
||||
animate(src, alpha=255, time=time_left)
|
||||
addtimer(CALLBACK(src, PROC_REF(stop_animation)), 8, TIMER_CLIENT_TIME)
|
||||
|
||||
/obj/effect/abstract/ripple/proc/stop_animation()
|
||||
icon_state = "medi_holo_no_anim"
|
||||
@@ -0,0 +1,109 @@
|
||||
/obj/machinery/spaceship_navigation_beacon
|
||||
name = "radio navigation gigabeacon"
|
||||
desc = "A device that constantly transmits its position over several different commonly used maritime navigation frequencies. Used to create shuttle navigation waypoints in unexplored or undeveloped areas."
|
||||
icon = 'icons/obj/machines/navigation_beacon.dmi'
|
||||
icon_state = "beacon_active"
|
||||
base_icon_state = "beacon"
|
||||
density = TRUE
|
||||
|
||||
/// Locked beacons cannot be jumped to by ships.
|
||||
var/locked = FALSE
|
||||
/// Time between automated messages.
|
||||
var/automatic_message_cooldown = 5 MINUTES
|
||||
/// Next world tick to send an automatic message.
|
||||
var/next_automatic_message_time
|
||||
/// Our internal radio.
|
||||
var/obj/item/radio/radio
|
||||
|
||||
/obj/machinery/spaceship_navigation_beacon/Initialize(mapload)
|
||||
. = ..()
|
||||
SSshuttle.beacon_list |= src
|
||||
|
||||
name = "[initial(src.name)] [z]-[rand(0, 999)]"
|
||||
|
||||
var/static/list/multitool_tips = list(
|
||||
TOOL_MULTITOOL = list(
|
||||
SCREENTIP_CONTEXT_LMB = "Edit beacon name",
|
||||
SCREENTIP_CONTEXT_RMB = "Lock/Unlock beacon",
|
||||
)
|
||||
)
|
||||
AddElement(/datum/element/contextual_screentip_tools, multitool_tips)
|
||||
|
||||
radio = new(src)
|
||||
radio.set_listening(FALSE)
|
||||
radio.set_frequency(FREQ_RADIO_NAV_BEACON)
|
||||
radio.freqlock = RADIO_FREQENCY_LOCKED
|
||||
radio.recalculateChannels()
|
||||
|
||||
START_PROCESSING(SSmachines, src)
|
||||
COOLDOWN_START(src, next_automatic_message_time, automatic_message_cooldown)
|
||||
|
||||
/obj/machinery/spaceship_navigation_beacon/emp_act(severity)
|
||||
. = ..()
|
||||
locked = TRUE
|
||||
update_appearance(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/machinery/spaceship_navigation_beacon/Destroy()
|
||||
SSshuttle.beacon_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/spaceship_navigation_beacon/update_icon_state()
|
||||
icon_state = "[base_icon_state][locked ? "_locked" : "_active"]"
|
||||
return ..()
|
||||
|
||||
/obj/machinery/spaceship_navigation_beacon/multitool_act(mob/living/user, obj/item/tool)
|
||||
..()
|
||||
|
||||
var/chosen_tag = tgui_input_text(user, "Enter the custom name for this beacon", "Beacon Reclassification", max_length = MAX_NAME_LEN)
|
||||
if(!chosen_tag)
|
||||
return
|
||||
|
||||
var/new_name = "[initial(src.name)] [chosen_tag]"
|
||||
if(new_name && Adjacent(user))
|
||||
name = new_name
|
||||
balloon_alert_to_viewers("beacon renamed")
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/spaceship_navigation_beacon/multitool_act_secondary(mob/living/user, obj/item/tool)
|
||||
..()
|
||||
|
||||
locked = !locked
|
||||
|
||||
balloon_alert_to_viewers("[!locked ? "unlocked" : "locked"]")
|
||||
update_icon_state()
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/spaceship_navigation_beacon/examine()
|
||||
.=..()
|
||||
. += span_notice("'[FREQ_RADIO_NAV_BEACON / 10] kHz' is printed on the side.")
|
||||
if(locked)
|
||||
. += span_warning("The blinking red light on the front indicates that this beacon is LOCKED.")
|
||||
else
|
||||
. += span_notice("The blinking green light on the front indicates that this beacon is operating normally.")
|
||||
|
||||
/obj/machinery/spaceship_navigation_beacon/process(seconds_per_tick)
|
||||
if(COOLDOWN_FINISHED(src, next_automatic_message_time) && radio)
|
||||
var/automatic_nav_message = "[src], Sector [z], [locked ? "Beacon Locked" : "Beacon Operational"], Grid Coordinates, [x] East, [y] North."
|
||||
|
||||
radio.talk_into(src, "[automatic_nav_message]")
|
||||
|
||||
COOLDOWN_START(src, next_automatic_message_time, automatic_message_cooldown)
|
||||
|
||||
// Item used to actually make nav beacons
|
||||
|
||||
/obj/item/folded_navigation_gigabeacon
|
||||
name = "compact radio navigation gigabeacon"
|
||||
desc = "A compact radio navigation gigabeacon, a device used to provide shuttle navigation waypoints in unexplored areas. Must be deployed before use."
|
||||
icon = 'icons/obj/machines/navigation_beacon.dmi'
|
||||
icon_state = "beacon_folded"
|
||||
|
||||
/obj/item/folded_navigation_gigabeacon/Initialize(mapload)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/deployable, 3 SECONDS, /obj/machinery/spaceship_navigation_beacon)
|
||||
|
||||
/obj/item/folded_navigation_gigabeacon/examine()
|
||||
.=..()
|
||||
. += span_notice("The backside has instructions in various galactic languages detailing how this can be deployed <b>in hand</b> without any special tools.")
|
||||
. += span_notice("'[FREQ_RADIO_NAV_BEACON / 10] kHz' is printed on the side.")
|
||||
@@ -0,0 +1,413 @@
|
||||
// Special objects for shuttle templates go here if nowhere else
|
||||
|
||||
// Wabbajack statue, a sleeping frog statue that shoots bolts of change if
|
||||
// living carbons are put on its altar/tables
|
||||
|
||||
/obj/machinery/power/emitter/energycannon
|
||||
name = "Energy Cannon"
|
||||
desc = "A heavy duty industrial laser."
|
||||
icon = 'icons/obj/machines/engine/singularity.dmi'
|
||||
icon_state = "emitter_+a"
|
||||
base_icon_state = "emitter_+a"
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
resistance_flags = INDESTRUCTIBLE | FIRE_PROOF | ACID_PROOF
|
||||
|
||||
use_power = NO_POWER_USE
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
|
||||
active = TRUE
|
||||
locked = TRUE
|
||||
welded = TRUE
|
||||
|
||||
/obj/machinery/power/emitter/energycannon/RefreshParts()
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
return
|
||||
|
||||
/obj/machinery/power/emitter/energycannon/magical
|
||||
name = "wabbajack statue"
|
||||
desc = "Who am I? What is my purpose in life? What do I mean by who am I?"
|
||||
projectile_type = /obj/projectile/magic/change
|
||||
icon = 'icons/obj/machines/magic_emitter.dmi'
|
||||
icon_state = "wabbajack_statue"
|
||||
icon_state_on = "wabbajack_statue_on"
|
||||
base_icon_state = "wabbajack_statue"
|
||||
active = FALSE
|
||||
allow_switch_interact = FALSE
|
||||
var/list/active_tables = list()
|
||||
var/tables_required = 2
|
||||
|
||||
/obj/machinery/power/emitter/energycannon/magical/Initialize(mapload)
|
||||
. = ..()
|
||||
if(prob(50))
|
||||
desc = "Oh no, not again."
|
||||
update_appearance()
|
||||
|
||||
/obj/machinery/power/emitter/energycannon/magical/update_icon_state()
|
||||
. = ..()
|
||||
icon_state = active ? icon_state_on : initial(icon_state)
|
||||
|
||||
/obj/machinery/power/emitter/energycannon/magical/process_early(seconds_per_tick)
|
||||
. = ..()
|
||||
if(active_tables.len >= tables_required)
|
||||
if(!active)
|
||||
visible_message("<span class='revenboldnotice'>\
|
||||
[src] opens its eyes.</span>")
|
||||
active = TRUE
|
||||
else
|
||||
if(active)
|
||||
visible_message("<span class='revenboldnotice'>\
|
||||
[src] closes its eyes.</span>")
|
||||
active = FALSE
|
||||
update_appearance()
|
||||
|
||||
/obj/machinery/power/emitter/energycannon/magical/attackby(obj/item/W, mob/user, params)
|
||||
return
|
||||
|
||||
/obj/machinery/power/emitter/energycannon/magical/ex_act(severity)
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/power/emitter/energycannon/magical/emag_act(mob/user, obj/item/card/emag/emag_card)
|
||||
return FALSE
|
||||
|
||||
/obj/structure/table/abductor/wabbajack
|
||||
name = "wabbajack altar"
|
||||
desc = "Whether you're sleeping or waking, it's going to be quite chaotic."
|
||||
max_integrity = 1000
|
||||
verb_say = "chants"
|
||||
var/obj/machinery/power/emitter/energycannon/magical/our_statue
|
||||
var/list/mob/living/sleepers = list()
|
||||
var/never_spoken = TRUE
|
||||
|
||||
/obj/structure/table/abductor/wabbajack/Initialize(mapload)
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/structure/table/abductor/wabbajack/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
. = ..()
|
||||
|
||||
/obj/structure/table/abductor/wabbajack/screwdriver_act(mob/living/user, obj/item/tool)
|
||||
return NONE
|
||||
|
||||
/obj/structure/table/abductor/wabbajack/wrench_act(mob/living/user, obj/item/tool)
|
||||
return NONE
|
||||
|
||||
/obj/structure/table/abductor/wabbajack/process()
|
||||
if(isnull(our_statue))
|
||||
our_statue = locate() in orange(4, src)
|
||||
|
||||
if(isnull(our_statue))
|
||||
name = "inert [initial(name)]"
|
||||
return
|
||||
|
||||
name = initial(name)
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/list/found = list()
|
||||
for(var/mob/living/carbon/C in T)
|
||||
if(C.stat != DEAD)
|
||||
found += C
|
||||
|
||||
// New sleepers
|
||||
for(var/i in found - sleepers)
|
||||
var/mob/living/L = i
|
||||
L.add_atom_colour(COLOR_PURPLE, TEMPORARY_COLOUR_PRIORITY)
|
||||
L.visible_message(span_revennotice("A strange purple glow wraps itself around [L] as [L.p_they()] suddenly fall[L.p_s()] unconscious."),
|
||||
span_revendanger("[desc]"))
|
||||
// Don't let them sit suround unconscious forever
|
||||
addtimer(CALLBACK(src, PROC_REF(sleeper_dreams), L), 10 SECONDS)
|
||||
|
||||
// Existing sleepers
|
||||
for(var/i in found)
|
||||
var/mob/living/L = i
|
||||
L.SetSleeping(200)
|
||||
|
||||
// Missing sleepers
|
||||
for(var/i in sleepers - found)
|
||||
var/mob/living/L = i
|
||||
L.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, COLOR_PURPLE)
|
||||
L.visible_message("<span class='revennotice'>The glow from [L] fades \
|
||||
away.</span>")
|
||||
L.grab_ghost()
|
||||
|
||||
sleepers = found
|
||||
|
||||
if(sleepers.len)
|
||||
our_statue.active_tables |= src
|
||||
if(never_spoken || prob(5))
|
||||
say(desc)
|
||||
never_spoken = FALSE
|
||||
else
|
||||
our_statue.active_tables -= src
|
||||
|
||||
/obj/structure/table/abductor/wabbajack/proc/sleeper_dreams(mob/living/sleeper)
|
||||
if(sleeper in sleepers)
|
||||
to_chat(sleeper, span_revennotice("While you slumber, you have the strangest dream, like you can see yourself from the outside."))
|
||||
sleeper.ghostize(TRUE)
|
||||
|
||||
/obj/structure/table/abductor/wabbajack/left
|
||||
desc = "You sleep so it may wake."
|
||||
|
||||
/obj/structure/table/abductor/wabbajack/right
|
||||
desc = "It wakes so you may sleep."
|
||||
|
||||
/**
|
||||
* Bar staff, mobs with the TRAIT_GODMODE trait (as long as they stay in the shuttle)
|
||||
* that just want to make sure people have drinks and a good shuttle time.
|
||||
*/
|
||||
/mob/living/basic/drone/snowflake/bardrone
|
||||
name = "Bardrone"
|
||||
desc = "A barkeeping drone, a robot built to tend bars."
|
||||
hacked = TRUE
|
||||
shy = FALSE
|
||||
laws = "1. Serve drinks.\n\
|
||||
2. Talk to patrons.\n\
|
||||
3. Don't get messed up in their affairs."
|
||||
unique_name = FALSE // disables the (123) number suffix
|
||||
initial_language_holder = /datum/language_holder/universal
|
||||
default_storage = null
|
||||
|
||||
/mob/living/basic/drone/snowflake/bardrone/Initialize(mapload)
|
||||
. = ..()
|
||||
AddComponentFrom(ROUNDSTART_TRAIT, /datum/component/area_based_godmode, area_type = /area/shuttle/escape, allow_area_subtypes = TRUE)
|
||||
|
||||
// Bar table, a wooden table that kicks you in a direction if you're not
|
||||
// barstaff (defined as someone who was a roundstart bartender or someone
|
||||
// with CENTCOM_BARSTAFF)
|
||||
|
||||
/obj/structure/table/wood/shuttle_bar
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
max_integrity = 1000
|
||||
var/boot_dir = 1
|
||||
|
||||
/obj/structure/table/wood/shuttle_bar/Initialize(mapload, _buildstack)
|
||||
. = ..()
|
||||
var/static/list/loc_connections = list(
|
||||
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
|
||||
)
|
||||
AddElement(/datum/element/connect_loc, loc_connections)
|
||||
|
||||
/obj/structure/table/wood/shuttle_bar/screwdriver_act(mob/living/user, obj/item/tool)
|
||||
return NONE
|
||||
|
||||
/obj/structure/table/wood/shuttle_bar/wrench_act(mob/living/user, obj/item/tool)
|
||||
return NONE
|
||||
|
||||
/obj/structure/table/wood/shuttle_bar/proc/on_entered(datum/source, atom/movable/AM)
|
||||
SIGNAL_HANDLER
|
||||
var/mob/living/M = AM
|
||||
if(istype(M) && !M.incorporeal_move && !is_barstaff(M))
|
||||
// No climbing on the bar please
|
||||
var/throwtarget = get_edge_target_turf(src, boot_dir)
|
||||
M.Paralyze(40)
|
||||
M.throw_at(throwtarget, 5, 1)
|
||||
to_chat(M, span_notice("No climbing on the bar please."))
|
||||
|
||||
/obj/structure/table/wood/shuttle_bar/proc/is_barstaff(mob/living/user)
|
||||
. = FALSE
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/human_user = user
|
||||
if(is_bartender_job(human_user.mind?.assigned_role))
|
||||
return TRUE
|
||||
|
||||
if(istype(user, /mob/living/basic/drone/snowflake/bardrone))
|
||||
return TRUE
|
||||
|
||||
var/obj/item/card/id/ID = user.get_idcard(FALSE)
|
||||
if(ID && (ACCESS_CENT_BAR in ID.access))
|
||||
return TRUE
|
||||
|
||||
//Luxury Shuttle Blockers
|
||||
|
||||
/obj/machinery/scanner_gate/luxury_shuttle
|
||||
name = "luxury shuttle ticket field"
|
||||
density = FALSE //allows shuttle airlocks to close, nothing but an approved passenger gets past CanPass
|
||||
locked = TRUE
|
||||
use_power = NO_POWER_USE
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
speech_span = SPAN_ROBOT
|
||||
var/threshold = 500
|
||||
var/static/list/approved_passengers = list()
|
||||
var/static/list/check_times = list()
|
||||
var/list/payees = list()
|
||||
|
||||
/obj/machinery/scanner_gate/luxury_shuttle/CanAllowThrough(atom/movable/mover, border_dir)
|
||||
. = ..()
|
||||
|
||||
if(mover in approved_passengers)
|
||||
set_scanline("scanning", 10)
|
||||
if(isvehicle(mover))
|
||||
var/obj/vehicle/vehicle = mover
|
||||
for(var/mob/living/rat in vehicle.occupants)
|
||||
if(!(rat in approved_passengers))
|
||||
say("Stowaway detected. Please exit the vehicle first.")
|
||||
return FALSE
|
||||
return TRUE
|
||||
if(isitem(mover))
|
||||
return TRUE
|
||||
if(isstructure(mover))
|
||||
var/obj/structure/struct = mover
|
||||
for(var/mob/living/rat in struct.contents)
|
||||
say("Stowaway detected. Please exit the structure first.")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/scanner_gate/luxury_shuttle/auto_scan(atom/movable/AM)
|
||||
return
|
||||
|
||||
/obj/machinery/scanner_gate/luxury_shuttle/attackby(obj/item/W, mob/user, params)
|
||||
return
|
||||
|
||||
/obj/machinery/scanner_gate/luxury_shuttle/emag_act(mob/user, obj/item/card/emag/emag_card)
|
||||
return FALSE
|
||||
|
||||
#define LUXURY_MESSAGE_COOLDOWN 100
|
||||
/obj/machinery/scanner_gate/luxury_shuttle/Bumped(atom/movable/AM)
|
||||
///If the atom entering the gate is a vehicle, we store it here to add to the approved list to enter/leave the scanner gate.
|
||||
var/obj/vehicle/vehicle
|
||||
///We store the driver of vehicles separately so that we can add them to the approved list once payment is fully processed.
|
||||
var/mob/living/driver_holdout
|
||||
if(!isliving(AM) && !isvehicle(AM))
|
||||
alarm_beep()
|
||||
return ..()
|
||||
|
||||
var/datum/bank_account/account
|
||||
if(istype(AM.pulling, /obj/item/card/id))
|
||||
var/obj/item/card/id/I = AM.pulling
|
||||
if(I.registered_account)
|
||||
account = I.registered_account
|
||||
else if(!check_times[AM] || check_times[AM] < world.time) //Let's not spam the message
|
||||
to_chat(AM, span_notice("This ID card doesn't have an owner associated with it!"))
|
||||
check_times[AM] = world.time + LUXURY_MESSAGE_COOLDOWN
|
||||
else if(isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
account = L.get_bank_account()
|
||||
|
||||
else if(isvehicle(AM))
|
||||
vehicle = AM
|
||||
for(var/passenger in vehicle.occupants)
|
||||
if(!isliving(passenger))
|
||||
continue
|
||||
var/mob/living/rider = passenger
|
||||
if(vehicle.is_driver(rider))
|
||||
driver_holdout = rider
|
||||
var/obj/item/card/id/id = rider.get_idcard(TRUE)
|
||||
account = id?.registered_account
|
||||
break
|
||||
|
||||
if(account)
|
||||
if(account.account_balance < threshold - payees[AM])
|
||||
account.adjust_money(-account.account_balance, "Scanner Gate: Entry Fee")
|
||||
payees[AM] += account.account_balance
|
||||
else
|
||||
var/money_owed = threshold - payees[AM]
|
||||
account.adjust_money(-money_owed, "Scanner Gate: Partial Entry Fee")
|
||||
payees[AM] += money_owed
|
||||
|
||||
//Here is all the possible paygate payment methods.
|
||||
var/list/counted_money = list()
|
||||
for(var/obj/item/coin/C in AM.get_all_contents()) //Coins.
|
||||
if(payees[AM] >= threshold)
|
||||
break
|
||||
payees[AM] += C.value
|
||||
counted_money += C
|
||||
for(var/obj/item/stack/spacecash/S in AM.get_all_contents()) //Paper Cash
|
||||
if(payees[AM] >= threshold)
|
||||
break
|
||||
payees[AM] += S.value * S.amount
|
||||
counted_money += S
|
||||
for(var/obj/item/holochip/H in AM.get_all_contents()) //Holocredits
|
||||
if(payees[AM] >= threshold)
|
||||
break
|
||||
payees[AM] += H.credits
|
||||
counted_money += H
|
||||
|
||||
if(payees[AM] < threshold && istype(AM.pulling, /obj/item/coin)) //Coins(Pulled).
|
||||
var/obj/item/coin/C = AM.pulling
|
||||
payees[AM] += C.value
|
||||
counted_money += C
|
||||
|
||||
else if(payees[AM] < threshold && istype(AM.pulling, /obj/item/stack/spacecash)) //Cash(Pulled).
|
||||
var/obj/item/stack/spacecash/S = AM.pulling
|
||||
payees[AM] += S.value * S.amount
|
||||
counted_money += S
|
||||
|
||||
else if(payees[AM] < threshold && istype(AM.pulling, /obj/item/holochip)) //Holocredits(pulled).
|
||||
var/obj/item/holochip/H = AM.pulling
|
||||
payees[AM] += H.credits
|
||||
counted_money += H
|
||||
|
||||
if(payees[AM] < threshold) //Suggestions for those with no arms/simple animals.
|
||||
var/armless
|
||||
if(!ishuman(AM) && !isslime(AM))
|
||||
armless = TRUE
|
||||
else
|
||||
var/mob/living/carbon/human/H = AM
|
||||
if(!H.get_bodypart(BODY_ZONE_L_ARM) && !H.get_bodypart(BODY_ZONE_R_ARM))
|
||||
armless = TRUE
|
||||
|
||||
if(armless)
|
||||
if(!AM.pulling || !iscash(AM.pulling) && !istype(AM.pulling, /obj/item/card/id))
|
||||
if(!check_times[AM] || check_times[AM] < world.time) //Let's not spam the message
|
||||
to_chat(AM, span_notice("Try pulling a valid ID, space cash, holochip or coin into \the [src]!"))
|
||||
check_times[AM] = world.time + LUXURY_MESSAGE_COOLDOWN
|
||||
|
||||
if(payees[AM] >= threshold)
|
||||
for(var/obj/I in counted_money)
|
||||
qdel(I)
|
||||
payees[AM] -= threshold
|
||||
|
||||
var/change = FALSE
|
||||
if(payees[AM] > 0)
|
||||
change = TRUE
|
||||
var/obj/item/holochip/holocred = new /obj/item/holochip(AM.loc, payees[AM]) //Change is made in holocredits exclusively.
|
||||
if(ishuman(AM))
|
||||
var/mob/living/carbon/human/H = AM
|
||||
if(!H.put_in_hands(holocred))
|
||||
AM.pulling = holocred
|
||||
else
|
||||
AM.pulling = holocred
|
||||
payees[AM] -= payees[AM]
|
||||
|
||||
say("Welcome to first class, [driver_holdout ? "[driver_holdout]" : "[AM]" ]![change ? " Here is your change." : ""]")
|
||||
approved_passengers |= AM
|
||||
if(vehicle)
|
||||
approved_passengers |= vehicle
|
||||
if(driver_holdout)
|
||||
approved_passengers |= driver_holdout
|
||||
|
||||
check_times -= AM
|
||||
return
|
||||
else if (payees[AM] > 0)
|
||||
for(var/obj/I in counted_money)
|
||||
qdel(I)
|
||||
if(!check_times[AM] || check_times[AM] < world.time) //Let's not spam the message
|
||||
to_chat(AM, span_notice("[payees[AM]] cr received. You need [threshold-payees[AM]] cr more."))
|
||||
check_times[AM] = world.time + LUXURY_MESSAGE_COOLDOWN
|
||||
alarm_beep()
|
||||
return ..()
|
||||
else
|
||||
alarm_beep()
|
||||
return ..()
|
||||
|
||||
/mob/living/basic/bear/fightpit
|
||||
name = "fight pit bear"
|
||||
desc = "This bear's trained through ancient Russian secrets to fear the walls of its glass prison."
|
||||
environment_smash = ENVIRONMENT_SMASH_NONE
|
||||
|
||||
/obj/effect/decal/hammerandsickle
|
||||
name = "hammer and sickle"
|
||||
desc = "Communism powerful force."
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
icon_state = "communist"
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
|
||||
/obj/effect/decal/hammerandsickle/shuttleRotate(rotation)
|
||||
setDir(angle2dir(rotation+dir2angle(dir))) // No parentcall, rest of the rotate code breaks the pixel offset.
|
||||
|
||||
#undef LUXURY_MESSAGE_COOLDOWN
|
||||
Reference in New Issue
Block a user