-
-
Notifications
You must be signed in to change notification settings - Fork 427
Посылки экипажу. #14406
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
base: master
Are you sure you want to change the base?
Посылки экипажу. #14406
Changes from all commits
bc8d2ad
f321e70
c2f6d60
9685a79
bd664fd
fdae062
88c3323
30dd39a
2524e6d
289fdcd
0780995
2d0479f
c71365a
6b21fca
d200a80
680ac36
a47eb81
bf1ba55
1ed4a90
2b59a56
2f56e3e
6c1c522
2afe642
7413b02
b5a90f5
862f733
50f399b
f728ac2
a729a06
c3493bd
55d1524
4f9202e
576c459
dc7bd10
1dc5ba4
20e0b8c
2b34cb1
f9dbfd6
e8ea385
9237010
28c3e3c
bc0d2a3
148876c
4b1bdc9
0667616
cb53191
4ba1b8b
bc46e97
bf1bfdf
99086a6
fdfec0e
7f39be9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ SUBSYSTEM_DEF(shuttle) | |
| var/list/shoppinglist = list() | ||
| var/list/requestlist = list() | ||
| var/list/supply_packs = list() | ||
| var/list/mail_orders = list() //list("sender", "type", "receiver") | ||
| //shuttle movement | ||
| var/at_station = TRUE | ||
| var/movetime = 1200 | ||
|
|
@@ -445,10 +446,20 @@ SUBSYSTEM_DEF(shuttle) | |
| centcom_message = msg | ||
| //log_investigate("Shuttle contents sold for [SSshuttle.points - presale_points] credits. Contents: [sold_atoms || "none."] Message: [SSshuttle.centcom_message || "none."]", INVESTIGATE_CARGO) | ||
|
|
||
| /datum/controller/subsystem/shuttle/proc/is_turf_clear(turf/T) | ||
| for(var/atom/A in T.contents) | ||
| if(!A.simulated) | ||
| continue | ||
| if(istype(A, /obj/machinery/light)) | ||
| continue | ||
|
|
||
| return FALSE | ||
|
|
||
| return TRUE | ||
|
|
||
| //Buyin | ||
| /datum/controller/subsystem/shuttle/proc/buy() | ||
| if(!shoppinglist.len) | ||
| if(!shoppinglist.len && !mail_orders.len) | ||
| return | ||
|
|
||
| var/shuttle_at | ||
|
|
@@ -466,24 +477,17 @@ SUBSYSTEM_DEF(shuttle) | |
| for(var/turf/T in shuttle) | ||
| if(T.density) | ||
| continue | ||
| var/contcount | ||
| for(var/atom/A in T.contents) | ||
| if(!A.simulated) | ||
| continue | ||
| if(istype(A, /obj/machinery/light)) | ||
| continue | ||
| contcount++ | ||
| if(contcount) | ||
|
|
||
| if(!is_turf_clear(T)) | ||
| continue | ||
|
|
||
| clear_turfs += T | ||
| CHECK_TICK | ||
|
|
||
| for(var/S in shoppinglist) | ||
| if(!clear_turfs.len) | ||
| break | ||
| var/i = rand(1,clear_turfs.len) | ||
| var/turf/pickedloc = clear_turfs[i] | ||
| clear_turfs.Cut(i,i+1) | ||
| var/turf/pickedloc = pick_n_take(clear_turfs) | ||
|
|
||
| var/datum/supply_order/SO = S | ||
|
|
||
|
|
@@ -494,9 +498,75 @@ SUBSYSTEM_DEF(shuttle) | |
| SSStatistics.score.stuffshipped++ | ||
| CHECK_TICK | ||
|
|
||
| if(mail_orders.len && clear_turfs.len) | ||
volas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| var/turf/pickedloc = pick_n_take(clear_turfs) | ||
|
|
||
| var/obj/structure/closet/crate/mailcrate/Crate = new(pickedloc) | ||
| for(var/datum/mail_order/Order in mail_orders) | ||
| var/obj/item/Item = generate_mail_item(Order, pickedloc) | ||
| if(Item) | ||
| Item.forceMove(Crate) | ||
|
|
||
| mail_orders -= Order | ||
|
|
||
| SSshuttle.shoppinglist.Cut() | ||
| return | ||
|
|
||
| /datum/mail_order | ||
| var/sender | ||
| var/itemType | ||
| var/receiver_name | ||
| var/receiver_acc | ||
|
|
||
| /datum/mail_order/New(sender, itemType, receiver_name, receiver_acc) | ||
| src.sender = sender | ||
| src.itemType = itemType | ||
| src.receiver_name = receiver_name | ||
| src.receiver_acc = receiver_acc | ||
|
|
||
| /datum/controller/subsystem/shuttle/proc/add_mail(sender, receiver_name, receiver_acc, itemType) | ||
| var/datum/mail_order/Order = new /datum/mail_order(sender, itemType, receiver_name, receiver_acc) | ||
| mail_orders += Order | ||
|
|
||
| /datum/controller/subsystem/shuttle/proc/generate_mail_item(datum/mail_order/Order, turf/pickedloc) | ||
| var/itemType = Order.itemType | ||
|
|
||
| var/sender = Order.sender | ||
| var/receiver_name = Order.receiver_name | ||
| var/receiver_number = Order.receiver_acc | ||
| var/datum/money_account/receiver_account = get_account(receiver_number) | ||
| if(!receiver_account || !sender || !itemType) | ||
| return | ||
|
|
||
| var/obj/item/Item = new itemType(pickedloc) | ||
|
|
||
| Item.add_price_tag("Отправитель - [sender]", 50, "Разное", global.cargo_account.account_number) | ||
|
|
||
| Item = object2onlineshop_package(Item, forceColor = "white", hideInfo = TRUE) | ||
|
|
||
| Item.pixel_x = rand(-10, 10) | ||
| Item.pixel_y = rand(-10, 10) | ||
|
|
||
| var/lot_number | ||
| if(istype(Item, /obj/item/smallDelivery)) | ||
| var/obj/item/smallDelivery/Delivery = Item | ||
| lot_number = Delivery.lot_number | ||
| else | ||
| var/obj/structure/bigDelivery/Delivery = Item | ||
| lot_number = Delivery.lot_number | ||
|
|
||
| if(!lot_number) | ||
| return Item | ||
|
Comment on lines
+550
to
+559
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. будто-бы где-то такое уже есть
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Убрал.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. то есть вся эта функция отличается от другой тем у кого берут цифру? сделай общее и чтобы цифра передавалась извне
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Нет, эта функция отличается тем, что в прошлой "функции" мы брали номер лота и устанавливали посылкам его, а в этой мы берём посылку и чекаем её лотовый номер.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Это абсолютно разные вещи и никак не связаны. Там мы сетаем, а тут гетаем.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Который работает только для bigPackage и smallPackage, лол. Ибо номер лота у них записан. Т.е. мы опять приходим к конструкции if(istype(item, bigPackage)) else
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| var/datum/shop_lot/Lot = global.online_shop_lots[lot_number] | ||
|
|
||
| order_onlineshop_item(receiver_name, receiver_number, Lot, station_name_ru(), forced = TRUE) | ||
| receiver_account.shopping_cart["[lot_number]"] = Lot.to_list() | ||
|
|
||
| Item.name = "Посылка для [receiver_name]" | ||
|
|
||
| return Item | ||
|
|
||
|
|
||
| /datum/controller/subsystem/shuttle/proc/incall(coeff = 1) | ||
| if(deny_shuttle && alert == 1) //crew transfer shuttle does not gets recalled by gamemode | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
интересно ломает ли это что-либо. к примеру если у нас pick_n_take из списка списков...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так наоборот, оно делает возможным pick_n_take из списка списков. До этого список списков не был возможен для pick_n_take ибо при -= список из списка удаляются элементы, а не список.