Skip to content

Commit

Permalink
Merge pull request #396 from dwasint/oshan-qes
Browse files Browse the repository at this point in the history
more oshan stuff
  • Loading branch information
dwasint authored Sep 27, 2023
2 parents c39d43b + 2999822 commit cf1218b
Show file tree
Hide file tree
Showing 33 changed files with 1,285 additions and 642 deletions.
15 changes: 3 additions & 12 deletions _maps/map_files/Oshan/oshan.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,8 @@
pixel_y = 5;
pixel_x = 7;
id = "cargo";
name = "Launch Cargo"
name = "Launch Cargo";
looping_time = 1
},
/turf/closed/wall/r_wall,
/area/station/cargo/storage)
Expand Down Expand Up @@ -9847,16 +9848,6 @@
},
/turf/open/floor/iron,
/area/station/engineering/atmos)
"eZq" = (
/obj/structure/disposalpipe/segment{
dir = 4;
invisibility = 101
},
/obj/docking_port/stationary/escape_pod{
dir = 4
},
/turf/open/floor/engine,
/area/station/cargo/miningoffice)
"eZx" = (
/obj/effect/decal/cleanable/dirt/dust,
/obj/structure/rack,
Expand Down Expand Up @@ -67302,7 +67293,7 @@ iLH
ont
dGk
hcx
eZq
hcx
dGk
nip
qRY
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/power.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ GLOBAL_VAR_INIT(CHARGELEVEL, 0.001) // Cap for how fast cells charge, as a perce
#define KW * 1000
#define MW * 1000000
#define GW * 1000000000
#define TW * 1000000000000
#define PW * 1000000000000000
5 changes: 4 additions & 1 deletion code/game/machinery/computer/pod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
if(COOLDOWN_FINISHED(src, massdriver_countdown))
timing = FALSE
// alarm() sleeps, so we want to end processing first and can't rely on return PROCESS_KILL
end_processing()
if(!looping_time)
end_processing()
else
COOLDOWN_START(src, massdriver_countdown, time SECONDS)
alarm()

/**
Expand Down
5 changes: 5 additions & 0 deletions code/modules/cargo/order.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
var/manifest_can_fail = TRUE
///Boolean on whether the manifest can be cancelled through cargo consoles.
var/can_be_cancelled = TRUE
///the account we charge for this purchase
var/account_to_charge = ACCOUNT_CAR

/datum/supply_order/New(
datum/supply_pack/pack,
Expand All @@ -70,6 +72,7 @@
manifest_can_fail = TRUE,
cost_type = "cr",
can_be_cancelled = TRUE,
account_to_charge = ACCOUNT_CAR,
)
id = SSshuttle.order_number++
src.cost_type = cost_type
Expand All @@ -84,6 +87,7 @@
src.charge_on_purchase = charge_on_purchase
src.manifest_can_fail = manifest_can_fail
src.can_be_cancelled = can_be_cancelled
src.account_to_charge = account_to_charge

//returns the total cost of this order. Its not the total price paid by cargo but the total value of this order
/datum/supply_order/proc/get_final_cost()
Expand Down Expand Up @@ -128,6 +132,7 @@
manifest_paper.name += " - Purchased by [owner]"
manifest_text += "Order[packname?"":"s"]: [id]<br/>"
manifest_text += "Destination: [station_name]<br/>"
manifest_text += "Paid For By: [account_to_charge]<br/>"
if(packname)
manifest_text += "Item: [packname]<br/>"
manifest_text += "Contents: <br/>"
Expand Down
25 changes: 20 additions & 5 deletions code/modules/cargo/orderconsole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
/// are we currently_sending to an ocean point?
var/currently_sending = FALSE

///department specific locks
var/can_send_shuttle = TRUE
var/can_remove_orders = TRUE

/obj/machinery/computer/cargo/request
name = "supply request console"
desc = "Used to request supplies from cargo."
Expand Down Expand Up @@ -248,7 +252,7 @@
applied_coupon = coupon_check
break

var/datum/supply_order/SO = new(pack = pack ,orderer = name, orderer_rank = rank, orderer_ckey = ckey, reason = reason, paying_account = account, coupon = applied_coupon)
var/datum/supply_order/SO = new(pack = pack ,orderer = name, orderer_rank = rank, orderer_ckey = ckey, reason = reason, paying_account = account, coupon = applied_coupon, account_to_charge = params["account_to_charge"])
if(requestonly && !self_paid)
SSshuttle.request_list += SO
else
Expand All @@ -271,6 +275,9 @@
for(var/datum/supply_order/order in SSshuttle.shopping_list)
if(order.id != id)
continue
if(!can_remove_orders && order.account_to_charge != cargo_account)
say("ERROR: This console lacks permission to remove orders not added by them!")
return
if(order.department_destination)
say("Only the department that ordered this item may cancel it.")
return
Expand Down Expand Up @@ -298,6 +305,9 @@
return
switch(action)
if("send")
if(!can_send_shuttle)
say("ERROR: This console lacks permission to call or send the Shuttle")
return
if(currently_sending)
say("Contents are already on their way")
return
Expand Down Expand Up @@ -341,7 +351,7 @@
else
usr.investigate_log("called the supply shuttle.", INVESTIGATE_CARGO)
say("The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.")
SSshuttle.moveShuttle(cargo_shuttle, docking_home, TRUE)
SSshuttle.moveShuttle(cargo_shuttle, docking_home, TRUE, cargo_account)
else
if(!length(GLOB.cargo_launch_points))
stack_trace("Erm, we are attempting to launch cargo crates on a map with no cargo landing points")
Expand All @@ -364,7 +374,10 @@
price += 700
paying_for_this.bank_card_talk("Goody order size exceeds free shipping limit: Assessing 700 credit S&H fee.")
else
paying_for_this = SSeconomy.get_dep_account(ACCOUNT_CAR)
paying_for_this = SSeconomy.get_dep_account(order.account_to_charge)
if(order.account_to_charge != ACCOUNT_CAR)
var/datum/bank_account/department/cargo = SSeconomy.get_dep_account(ACCOUNT_CAR)
cargo.adjust_money(order.pack.get_cost() * 0.1) // give some back for actually getting the crates
if(paying_for_this)
if(!paying_for_this.adjust_money(-price, "Cargo: [order.pack.name]"))
if(order.paying_account)
Expand Down Expand Up @@ -412,12 +425,14 @@
usr.log_message("accepted a shuttle loan event.", LOG_GAME)
. = TRUE
if("add")
params += "account_to_charge"
params["account_to_charge"] = cargo_account
return add_item(params)
if("add_by_name")
var/supply_pack_id = name_to_id(params["order_name"])
if(!supply_pack_id)
return
return add_item(list("id" = supply_pack_id, "amount" = 1))
return add_item(list("id" = supply_pack_id, "amount" = 1, "account_to_charge" = cargo_account))
if("remove")
var/order_name = params["order_name"]
//try removing atleast one item with the specified name. An order may not be removed if it was from the department
Expand Down Expand Up @@ -446,7 +461,7 @@
var/supply_pack_id = name_to_id(order_name) //map order name to supply pack id for adding
if(!supply_pack_id)
return
return add_item(list("id" = supply_pack_id, "amount" = amount))
return add_item(list("id" = supply_pack_id, "amount" = amount, "account_to_charge" = cargo_account))
if("clear")
//create copy of list else we will get runtimes when iterating & removing items on the same list SSshuttle.shopping_list
var/list/shopping_cart = SSshuttle.shopping_list.Copy()
Expand Down
1 change: 1 addition & 0 deletions code/modules/events/anomaly/anomaly_vortex.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
start_when = ANOMALY_START_DANGEROUS_TIME
announce_when = ANOMALY_ANNOUNCE_DANGEROUS_TIME
anomaly_path = /obj/effect/anomaly/bhole
oshan_blocked = TRUE

/datum/round_event/anomaly/anomaly_vortex/announce(fake)
priority_announce("Localized high-intensity vortex anomaly detected on [ANOMALY_ANNOUNCE_DANGEROUS_TEXT] [impact_area.name]", "Anomaly Alert")
7 changes: 5 additions & 2 deletions code/modules/shuttle/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
return 2
return ..()

/obj/docking_port/mobile/supply/initiate_docking()
/obj/docking_port/mobile/supply/initiate_docking(obj/docking_port/stationary/new_dock, movement_direction, force=FALSE)
if(getDockedId() == "cargo_away") // Buy when we leave home.
buy()
create_mail()
Expand Down Expand Up @@ -139,7 +139,10 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
price += CRATE_TAX
paying_for_this.bank_card_talk("Goody order size exceeds free shipping limit: Assessing [CRATE_TAX] credit S&H fee.")
else
paying_for_this = SSeconomy.get_dep_account(ACCOUNT_CAR)
paying_for_this = SSeconomy.get_dep_account(spawning_order.account_to_charge)
if(spawning_order.account_to_charge != ACCOUNT_CAR)
var/datum/bank_account/department/cargo = SSeconomy.get_dep_account(ACCOUNT_CAR)
cargo.adjust_money(spawning_order.pack.get_cost() * 0.1) // give some back for actually getting the crates
if(paying_for_this)
if(!paying_for_this.adjust_money(-price, "Cargo: [spawning_order.pack.name]"))
if(spawning_order.paying_account)
Expand Down
Loading

0 comments on commit cf1218b

Please sign in to comment.