Merge pull request #12488 from Ghommie/Ghommie-cit813
Porting Cargo small-order support, cargo goodies packs, beating vendors for loot/squish.
This commit is contained in:
@@ -32,4 +32,8 @@
|
||||
list("", "\improper S.T.E.A.L.T.H. pod MKVII", "A supply pod that, under normal circumstances, is completely invisible to conventional methods of detection. How are you even seeing this?"),\
|
||||
list("gondolapod", "gondola", "The silent walker. This one seems to be part of a delivery agency."),\
|
||||
list("", "", "")\
|
||||
)
|
||||
)
|
||||
|
||||
#define PACK_GOODY_NONE 0
|
||||
#define PACK_GOODY_PUBLIC 1 //can be bought by both privates and cargo
|
||||
#define PACK_GOODY_PRIVATE 2 //can be bought only by privates
|
||||
74
code/datums/components/omen.dm
Normal file
74
code/datums/components/omen.dm
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* omen.dm: For when you want someone to have a really bad day
|
||||
*
|
||||
* When you attach an omen component to someone, they start running the risk of all sorts of bad environmental injuries, like nearby vending machines randomly falling on you,
|
||||
* or hitting your head really hard when you slip and fall, or... well, for now those two are all I have. More will come.
|
||||
*
|
||||
* Omens are removed once the victim is either maimed by one of the possible injuries, or if they receive a blessing (read: bashing with a bible) from the chaplain.
|
||||
*/
|
||||
/datum/component/omen
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
|
||||
/// Whatever's causing the omen, if there is one. Destroying the vessel won't stop the omen, but we destroy the vessel (if one exists) upon the omen ending
|
||||
var/obj/vessel
|
||||
|
||||
/datum/component/omen/Initialize(silent=FALSE, vessel)
|
||||
if(!isliving(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
var/mob/person = parent
|
||||
if(!silent)
|
||||
to_chat(person, "<span class='warning'>You get a bad feeling...</span>")
|
||||
src.vessel = vessel
|
||||
|
||||
/datum/component/omen/Destroy(force, silent)
|
||||
if(vessel)
|
||||
vessel.visible_message("<span class='warning'>[vessel] burns up in a sinister flash, taking an evil energy with it...</span>")
|
||||
vessel = null
|
||||
return ..()
|
||||
|
||||
/datum/component/omen/RegisterWithParent()
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_MOVED, .proc/check_accident)
|
||||
RegisterSignal(parent, COMSIG_LIVING_STATUS_KNOCKDOWN, .proc/check_slip)
|
||||
RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT, .proc/check_bless)
|
||||
|
||||
/datum/component/omen/UnregisterFromParent()
|
||||
UnregisterSignal(parent, list(COMSIG_LIVING_STATUS_KNOCKDOWN, COMSIG_MOVABLE_MOVED, COMSIG_ADD_MOOD_EVENT))
|
||||
|
||||
/**
|
||||
* check_accident() is called each step we take
|
||||
*
|
||||
* While we're walking around, roll to see if there's any environmental hazards (currently only vending machines) on one of the adjacent tiles we can trigger.
|
||||
* We do the prob() at the beginning to A. add some tension for /when/ it will strike, and B. (more importantly) ameliorate the fact that we're checking up to 5 turfs's contents each time
|
||||
*/
|
||||
/datum/component/omen/proc/check_accident(atom/movable/our_guy)
|
||||
if(!prob(15))
|
||||
return
|
||||
for(var/t in get_adjacent_open_turfs(our_guy))
|
||||
var/turf/the_turf = t
|
||||
for(var/obj/machinery/vending/darth_vendor in the_turf)
|
||||
if(darth_vendor.tiltable)
|
||||
darth_vendor.tilt(our_guy)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/// If we get knocked down, see if we have a really bad slip and bash our head hard
|
||||
/datum/component/omen/proc/check_slip(mob/living/our_guy, amount)
|
||||
if(amount <= 0 || prob(50)) // 50% chance to bonk our head
|
||||
return
|
||||
|
||||
var/obj/item/bodypart/the_head = our_guy.get_bodypart(BODY_ZONE_HEAD)
|
||||
if(!the_head)
|
||||
return
|
||||
|
||||
playsound(get_turf(our_guy), "sound/effects/tableheadsmash.ogg", 90, TRUE)
|
||||
our_guy.visible_message("<span class='danger'>[our_guy] hits [our_guy.p_their()] head really badly falling down!</span>", "<span class='userdanger'>You hit your head really badly falling down!</span>")
|
||||
the_head.receive_damage(75)
|
||||
our_guy.adjustOrganLoss(ORGAN_SLOT_BRAIN, 100)
|
||||
qdel(src)
|
||||
|
||||
/// Hijack the mood system to see if we get the blessing mood event to cancel the omen
|
||||
/datum/component/omen/proc/check_bless(mob/living/our_guy, category)
|
||||
if(category != "blessing")
|
||||
return
|
||||
to_chat(our_guy, "<span class='nicegreen'>You feel a horrible omen lifted off your shoulders!</span>")
|
||||
qdel(src)
|
||||
@@ -72,8 +72,8 @@
|
||||
|
||||
|
||||
/// Checking to see if we're gonna embed into a human
|
||||
/datum/element/embed/proc/checkEmbedMob(obj/item/weapon, mob/living/carbon/victim, hit_zone, datum/thrownthing/throwingdatum, forced=FALSE)
|
||||
if(!istype(victim) || HAS_TRAIT(victim, TRAIT_PIERCEIMMUNE))
|
||||
/datum/element/embed/proc/checkEmbedMob(obj/item/weapon, mob/living/carbon/victim, hit_zone, datum/thrownthing/throwingdatum, blocked = FALSE, forced = FALSE)
|
||||
if(blocked || !istype(victim) || HAS_TRAIT(victim, TRAIT_PIERCEIMMUNE))
|
||||
return
|
||||
|
||||
var/actual_chance = embed_chance
|
||||
@@ -89,7 +89,7 @@
|
||||
return
|
||||
|
||||
var/roll_embed = prob(actual_chance)
|
||||
var/pass = forced || ((((throwingdatum ? throwingdatum.speed : weapon.throw_speed) >= EMBED_THROWSPEED_THRESHOLD) || ignore_throwspeed_threshold) && roll_embed)
|
||||
var/pass = forced || ((((throwingdatum ? throwingdatum.speed : weapon.throw_speed) >= EMBED_THROWSPEED_THRESHOLD) || ignore_throwspeed_threshold) && roll_embed && (!HAS_TRAIT(victim, TRAIT_AUTO_CATCH_ITEM) || victim.incapacitated() || victim.get_active_held_item()))
|
||||
if(!pass)
|
||||
return
|
||||
|
||||
|
||||
@@ -413,8 +413,8 @@
|
||||
// shock user with probability prb (if all connections & power are working)
|
||||
// returns TRUE if shocked, FALSE otherwise
|
||||
// The preceding comment was borrowed from the grille's shock script
|
||||
/obj/machinery/door/airlock/proc/shock(mob/user, prb)
|
||||
if(!hasPower()) // unpowered, no shock
|
||||
/obj/machinery/door/airlock/proc/shock(mob/living/user, prb)
|
||||
if(!istype(user) || !hasPower()) // unpowered, no shock
|
||||
return FALSE
|
||||
if(shockCooldown > world.time)
|
||||
return FALSE //Already shocked someone recently?
|
||||
|
||||
@@ -257,7 +257,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
|
||||
. += "[src] is made of cold-resistant materials."
|
||||
if(resistance_flags & FIRE_PROOF)
|
||||
. += "[src] is made of fire-retardant materials."
|
||||
|
||||
|
||||
if(item_flags & (ITEM_CAN_BLOCK | ITEM_CAN_PARRY))
|
||||
var/datum/block_parry_data/data = return_block_parry_datum(block_parry_data)
|
||||
. += "[src] has the capacity to be used to block and/or parry. <a href='?src=[REF(data)];name=[name];block=[item_flags & ITEM_CAN_BLOCK];parry=[item_flags & ITEM_CAN_PARRY];render=1'>\[Show Stats\]</a>"
|
||||
@@ -635,6 +635,18 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
|
||||
var/itempush = 1
|
||||
if(w_class < 4)
|
||||
itempush = 0 //too light to push anything
|
||||
if(isliving(hit_atom)) //Living mobs handle hit sounds differently.
|
||||
var/volume = get_volume_by_throwforce_and_or_w_class()
|
||||
if (throwforce > 0)
|
||||
if (throwhitsound)
|
||||
playsound(hit_atom, throwhitsound, volume, TRUE, -1)
|
||||
else if(hitsound)
|
||||
playsound(hit_atom, hitsound, volume, TRUE, -1)
|
||||
else
|
||||
playsound(hit_atom, 'sound/weapons/genhit.ogg',volume, TRUE, -1)
|
||||
else
|
||||
playsound(hit_atom, 'sound/weapons/throwtap.ogg', 1, volume, -1)
|
||||
|
||||
return hit_atom.hitby(src, 0, itempush, throwingdatum=throwingdatum)
|
||||
|
||||
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force, messy_throw = TRUE)
|
||||
|
||||
@@ -779,6 +779,9 @@ GLOBAL_LIST_INIT(plastic_recipes, list(
|
||||
/obj/item/stack/sheet/plastic/fifty
|
||||
amount = 50
|
||||
|
||||
/obj/item/stack/sheet/plastic/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/sheet/plastic/five
|
||||
amount = 5
|
||||
|
||||
|
||||
@@ -266,6 +266,9 @@
|
||||
/obj/item/stack/tile/carpet/blackred/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/blackred/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/blackred/fifty
|
||||
amount = 50
|
||||
|
||||
@@ -275,6 +278,9 @@
|
||||
/obj/item/stack/tile/carpet/monochrome/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/monochrome/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/monochrome/fifty
|
||||
amount = 50
|
||||
|
||||
@@ -284,6 +290,9 @@
|
||||
/obj/item/stack/tile/carpet/blue/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/blue/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/blue/fifty
|
||||
amount = 50
|
||||
|
||||
@@ -293,6 +302,9 @@
|
||||
/obj/item/stack/tile/carpet/cyan/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/cyan/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/cyan/fifty
|
||||
amount = 50
|
||||
|
||||
@@ -302,6 +314,9 @@
|
||||
/obj/item/stack/tile/carpet/green/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/green/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/green/fifty
|
||||
amount = 50
|
||||
|
||||
@@ -311,6 +326,9 @@
|
||||
/obj/item/stack/tile/carpet/orange/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/orange/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/orange/fifty
|
||||
amount = 50
|
||||
|
||||
@@ -320,6 +338,9 @@
|
||||
/obj/item/stack/tile/carpet/purple/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/purple/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/purple/fifty
|
||||
amount = 50
|
||||
|
||||
@@ -329,6 +350,9 @@
|
||||
/obj/item/stack/tile/carpet/red/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/red/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/red/fifty
|
||||
amount = 50
|
||||
|
||||
@@ -338,6 +362,9 @@
|
||||
/obj/item/stack/tile/carpet/royalblack/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/royalblack/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/royalblack/fifty
|
||||
amount = 50
|
||||
|
||||
@@ -347,6 +374,9 @@
|
||||
/obj/item/stack/tile/carpet/royalblue/twenty
|
||||
amount = 20
|
||||
|
||||
/obj/item/stack/tile/carpet/royalblue/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/tile/carpet/royalblue/fifty
|
||||
amount = 50
|
||||
|
||||
|
||||
@@ -138,6 +138,22 @@
|
||||
icon_type = "cigarette"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
|
||||
custom_price = PRICE_ALMOST_CHEAP
|
||||
var/spawn_coupon = TRUE
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/attack_self(mob/user)
|
||||
if(contents.len == 0 && spawn_coupon)
|
||||
to_chat(user, "<span class='notice'>You rip the back off \the [src] and get a coupon!</span>")
|
||||
var/obj/item/coupon/attached_coupon = new
|
||||
user.put_in_hands(attached_coupon)
|
||||
attached_coupon.generate()
|
||||
attached_coupon = null
|
||||
spawn_coupon = FALSE
|
||||
name = "discarded cigarette packet"
|
||||
desc = "An old cigarette packet with the back torn off, worth less than nothing now."
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 0
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/ComponentInitialize()
|
||||
. = ..()
|
||||
@@ -148,6 +164,8 @@
|
||||
/obj/item/storage/fancy/cigarettes/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to extract contents.</span>"
|
||||
if(spawn_coupon)
|
||||
. += "<span class='notice'>There's a coupon on the back of the pack! You can tear it off once it's empty.</span>"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/AltClick(mob/living/carbon/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
@@ -308,6 +326,7 @@
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
icon_type = "premium cigar"
|
||||
spawn_type = /obj/item/clothing/mask/cigarette/cigar
|
||||
spawn_coupon = FALSE
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/cigars/ComponentInitialize()
|
||||
. = ..()
|
||||
|
||||
@@ -188,19 +188,52 @@
|
||||
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/engineering
|
||||
name = "engineering medal box"
|
||||
desc = "A locked box used to store medals to be given to the members of the engineering department."
|
||||
req_access = list(ACCESS_CE)
|
||||
name = "engineering medal box"
|
||||
desc = "A locked box used to store medals to be given to the members of the engineering department."
|
||||
req_access = list(ACCESS_CE)
|
||||
|
||||
/obj/item/storage/lockbox/medal/engineering/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/engineer(src)
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/engineer(src)
|
||||
|
||||
/obj/item/storage/lockbox/medal/medical
|
||||
name = "medical medal box"
|
||||
desc = "A locked box used to store medals to be given to the members of the medical department."
|
||||
req_access = list(ACCESS_CMO)
|
||||
name = "medical medal box"
|
||||
desc = "A locked box used to store medals to be given to the members of the medical department."
|
||||
req_access = list(ACCESS_CMO)
|
||||
|
||||
/obj/item/storage/lockbox/medal/medical/PopulateContents()
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/ribbon/medical_doctor(src)
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/clothing/accessory/medal/ribbon/medical_doctor(src)
|
||||
|
||||
/obj/item/storage/lockbox/order
|
||||
name = "order lockbox"
|
||||
desc = "A box used to secure small cargo orders from being looted by those who didn't order it. Yeah, cargo tech, that means you."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "secure"
|
||||
item_state = "sec-case"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
var/datum/bank_account/buyer_account
|
||||
var/privacy_lock = TRUE
|
||||
|
||||
/obj/item/storage/lockbox/order/Initialize(datum/bank_account/_buyer_account)
|
||||
. = ..()
|
||||
buyer_account = _buyer_account
|
||||
|
||||
/obj/item/storage/lockbox/order/attackby(obj/item/W, mob/user, params)
|
||||
if(!istype(W, /obj/item/card/id))
|
||||
return ..()
|
||||
|
||||
var/obj/item/card/id/id_card = W
|
||||
if(iscarbon(user))
|
||||
add_fingerprint(user)
|
||||
|
||||
if(id_card.registered_account != buyer_account)
|
||||
to_chat(user, "<span class='notice'>Bank account does not match with buyer!</span")
|
||||
return
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, !privacy_lock)
|
||||
privacy_lock = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
user.visible_message("<span class='notice'>[user] [privacy_lock ? "" : "un"]locks [src]'s privacy lock.</span>",
|
||||
"<span class='notice'>You [privacy_lock ? "" : "un"]lock [src]'s privacy lock.</span>")
|
||||
|
||||
@@ -6,8 +6,16 @@
|
||||
max_integrity = 250
|
||||
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
|
||||
secure = TRUE
|
||||
var/melee_min_damage = 20
|
||||
|
||||
/obj/structure/closet/secure_closet/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
|
||||
if(damage_flag == "melee" && damage_amount < 20)
|
||||
if(damage_flag == "melee" && damage_amount < melee_min_damage)
|
||||
return 0
|
||||
. = ..()
|
||||
. = ..()
|
||||
|
||||
// Exists to work around the minimum 700 cr price for goodies / small items
|
||||
/obj/structure/closet/secure_closet/goodies
|
||||
icon_state = "goodies"
|
||||
desc = "A sturdier card-locked storage unit used for bulky shipments."
|
||||
max_integrity = 500 // Same as crates.
|
||||
melee_min_damage = 25 // Idem.
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
var/obj/item/radio/headset/radio
|
||||
/// var that tracks message cooldown
|
||||
var/message_cooldown
|
||||
var/list/loaded_coupons
|
||||
|
||||
light_color = "#E2853D"//orange
|
||||
|
||||
@@ -134,6 +135,8 @@
|
||||
"cost" = P.cost,
|
||||
"id" = pack,
|
||||
"desc" = P.desc || P.name, // If there is a description, use it. Otherwise use the pack's name.
|
||||
"private_goody" = P.goody == PACK_GOODY_PRIVATE,
|
||||
"goody" = P.goody == PACK_GOODY_PUBLIC,
|
||||
"access" = P.access,
|
||||
"can_private_buy" = P.can_private_buy
|
||||
))
|
||||
@@ -215,8 +218,22 @@
|
||||
if(isnull(reason) || ..())
|
||||
return
|
||||
|
||||
if(pack.goody == PACK_GOODY_PRIVATE && !self_paid)
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, FALSE)
|
||||
say("ERROR: Private small crates may only be purchased by private accounts.")
|
||||
return
|
||||
|
||||
var/obj/item/coupon/applied_coupon
|
||||
for(var/i in loaded_coupons)
|
||||
var/obj/item/coupon/coupon_check = i
|
||||
if(pack.type == coupon_check.discounted_pack)
|
||||
say("Coupon found! [round(coupon_check.discount_pct_off * 100)]% off applied!")
|
||||
coupon_check.moveToNullspace()
|
||||
applied_coupon = coupon_check
|
||||
break
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/datum/supply_order/SO = new(pack, name, rank, ckey, reason, account)
|
||||
var/datum/supply_order/SO = new(pack, name, rank, ckey, reason, account, applied_coupon)
|
||||
SO.generateRequisition(T)
|
||||
if(requestonly && !self_paid)
|
||||
SSshuttle.requestlist += SO
|
||||
@@ -229,6 +246,9 @@
|
||||
var/id = text2num(params["id"])
|
||||
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
|
||||
if(SO.id == id)
|
||||
if(SO.applied_coupon)
|
||||
say("Coupon refunded.")
|
||||
SO.applied_coupon.forceMove(get_turf(src))
|
||||
SSshuttle.shoppinglist -= SO
|
||||
. = TRUE
|
||||
break
|
||||
|
||||
50
code/modules/cargo/coupon.dm
Normal file
50
code/modules/cargo/coupon.dm
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
#define COUPON_OMEN "omen"
|
||||
|
||||
/obj/item/coupon
|
||||
name = "coupon"
|
||||
desc = "It doesn't matter if you didn't want it before, what matters now is that you've got a coupon for it!"
|
||||
icon_state = "data_1"
|
||||
icon = 'icons/obj/card.dmi'
|
||||
item_flags = NOBLUDGEON
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/datum/supply_pack/discounted_pack
|
||||
var/discount_pct_off = 0.05
|
||||
var/obj/machinery/computer/cargo/inserted_console
|
||||
|
||||
/// Choose what our prize is :D
|
||||
/obj/item/coupon/proc/generate()
|
||||
discounted_pack = pick(subtypesof(/datum/supply_pack/goody))
|
||||
var/list/chances = list("0.10" = 4, "0.15" = 8, "0.20" = 10, "0.25" = 8, "0.50" = 4, COUPON_OMEN = 1)
|
||||
discount_pct_off = pickweight(chances)
|
||||
if(discount_pct_off == COUPON_OMEN)
|
||||
name = "coupon - fuck you"
|
||||
desc = "The small text reads, 'You will be slaughtered'... That doesn't sound right, does it?"
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
to_chat(M, "<span class='warning'>The coupon reads '<b>fuck you</b>' in large, bold text... is- is that a prize, or?</span>")
|
||||
M.AddComponent(/datum/component/omen, TRUE, src)
|
||||
else
|
||||
discount_pct_off = text2num(discount_pct_off)
|
||||
name = "coupon - [round(discount_pct_off * 100)]% off [initial(discounted_pack.name)]"
|
||||
|
||||
/obj/item/coupon/attack_obj(obj/O, mob/living/user)
|
||||
if(!istype(O, /obj/machinery/computer/cargo))
|
||||
return ..()
|
||||
if(discount_pct_off == COUPON_OMEN)
|
||||
to_chat(user, "<span class='warning'>\The [O] validates the coupon as authentic, but refuses to accept it...</span>")
|
||||
O.say("Coupon fulfillment already in progress...")
|
||||
return
|
||||
|
||||
inserted_console = O
|
||||
LAZYADD(inserted_console.loaded_coupons, src)
|
||||
inserted_console.say("Coupon for [initial(discounted_pack.name)] applied!")
|
||||
forceMove(inserted_console)
|
||||
|
||||
/obj/item/coupon/Destroy()
|
||||
if(inserted_console)
|
||||
LAZYREMOVE(inserted_console.loaded_coupons, src)
|
||||
inserted_console = null
|
||||
. = ..()
|
||||
|
||||
#undef COUPON_OMEN
|
||||
@@ -27,10 +27,12 @@
|
||||
var/orderer_rank
|
||||
var/orderer_ckey
|
||||
var/reason
|
||||
var/discounted_pct
|
||||
var/datum/supply_pack/pack
|
||||
var/datum/bank_account/paying_account
|
||||
var/obj/item/coupon/applied_coupon
|
||||
|
||||
/datum/supply_order/New(datum/supply_pack/pack, orderer, orderer_rank, orderer_ckey, reason, paying_account)
|
||||
/datum/supply_order/New(datum/supply_pack/pack, orderer, orderer_rank, orderer_ckey, reason, paying_account, coupon)
|
||||
id = SSshuttle.ordernum++
|
||||
src.pack = pack
|
||||
src.orderer = orderer
|
||||
@@ -38,6 +40,7 @@
|
||||
src.orderer_ckey = orderer_ckey
|
||||
src.reason = reason
|
||||
src.paying_account = paying_account
|
||||
src.applied_coupon = coupon
|
||||
|
||||
/datum/supply_order/proc/generateRequisition(turf/T)
|
||||
var/obj/item/paper/P = new(T)
|
||||
@@ -57,58 +60,64 @@
|
||||
P.update_icon()
|
||||
return P
|
||||
|
||||
/datum/supply_order/proc/generateManifest(obj/structure/closet/crate/C)
|
||||
var/obj/item/paper/fluff/jobs/cargo/manifest/P = new(C, id, pack.cost)
|
||||
/datum/supply_order/proc/generateManifest(obj/container, owner, packname) //generates-the-manifests.
|
||||
var/obj/item/paper/fluff/jobs/cargo/manifest/P = new(container, id, 0)
|
||||
|
||||
var/station_name = (P.errors & MANIFEST_ERROR_NAME) ? new_station_name() : station_name()
|
||||
|
||||
P.name = "shipping manifest - #[id] ([pack.name])"
|
||||
P.name = "shipping manifest - [packname?"#[id] ([pack.name])":"(Grouped Item Crate)"]"
|
||||
P.info += "<h2>[command_name()] Shipping Manifest</h2>"
|
||||
P.info += "<hr/>"
|
||||
if(paying_account)
|
||||
P.info += "Direct purchase from [paying_account.account_holder]<br/>"
|
||||
P.name += " - Purchased by [paying_account.account_holder]"
|
||||
if(id && !(id == "Cargo"))
|
||||
P.info += "Direct purchase from [owner]<br/>"
|
||||
P.name += " - Purchased by [owner]"
|
||||
P.info += "Order #[id]<br/>"
|
||||
P.info += "Destination: [station_name]<br/>"
|
||||
P.info += "Item: [pack.name]<br/>"
|
||||
if(packname)
|
||||
P.info += "Item: [packname]<br/>"
|
||||
P.info += "Contents: <br/>"
|
||||
P.info += "<ul>"
|
||||
for(var/atom/movable/AM in C.contents - P - C.lockerelectronics)
|
||||
var/list/ignore_this = list(P)
|
||||
if(istype(container, /obj/structure/closet))
|
||||
var/obj/structure/closet/C = container
|
||||
ignore_this += C.lockerelectronics
|
||||
for(var/atom/movable/AM in container.contents - ignore_this)
|
||||
if((P.errors & MANIFEST_ERROR_CONTENTS) && prob(50))
|
||||
continue
|
||||
P.info += "<li>[AM.name]</li>"
|
||||
P.info += "</ul>"
|
||||
P.info += "<h4>Stamp below to confirm receipt of goods:</h4>"
|
||||
|
||||
if(P.errors & MANIFEST_ERROR_ITEM)
|
||||
var/static/list/blacklisted_error = typecacheof(list(
|
||||
/obj/structure/closet/crate/secure,
|
||||
/obj/structure/closet/crate/large,
|
||||
/obj/structure/closet/secure_closet/goodies
|
||||
))
|
||||
if(blacklisted_error[container.type])
|
||||
P.errors &= ~MANIFEST_ERROR_ITEM
|
||||
else
|
||||
var/lost = max(round(container.contents.len / 10), 1)
|
||||
while(--lost >= 0)
|
||||
qdel(pick(container.contents))
|
||||
|
||||
P.update_icon()
|
||||
P.forceMove(C)
|
||||
C.manifest = P
|
||||
C.update_icon()
|
||||
P.forceMove(container)
|
||||
|
||||
if(istype(container, /obj/structure/closet/crate))
|
||||
var/obj/structure/closet/crate/C = container
|
||||
C.manifest = P
|
||||
C.update_icon()
|
||||
|
||||
return P
|
||||
|
||||
/datum/supply_order/proc/generate(atom/A)
|
||||
var/obj/structure/closet/crate/C = pack.generate(A, paying_account)
|
||||
var/obj/item/paper/fluff/jobs/cargo/manifest/M = generateManifest(C)
|
||||
|
||||
if(M.errors & MANIFEST_ERROR_ITEM)
|
||||
if(istype(C, /obj/structure/closet/crate/secure) || istype(C, /obj/structure/closet/crate/large))
|
||||
M.errors &= ~MANIFEST_ERROR_ITEM
|
||||
else
|
||||
var/lost = max(round(C.contents.len / 10), 1)
|
||||
while(--lost >= 0)
|
||||
qdel(pick(C.contents))
|
||||
generateManifest(C, paying_account, pack)
|
||||
return C
|
||||
|
||||
//Paperwork for NT
|
||||
/obj/item/folder/paperwork
|
||||
name = "Incomplete Paperwork"
|
||||
desc = "These should've been filled out four months ago! Unfinished grant papers issued by Nanotrasen's finance department. Complete this page for additional funding."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "docs_generic"
|
||||
|
||||
/obj/item/folder/paperwork_correct
|
||||
name = "Finished Paperwork"
|
||||
desc = "A neat stack of filled-out forms, in triplicate and signed. Is there anything more satisfying? Make sure they get stamped."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "docs_verified"
|
||||
/datum/supply_order/proc/generateCombo(var/miscbox, var/misc_own, var/misc_contents)
|
||||
for (var/I in misc_contents)
|
||||
new I(miscbox)
|
||||
generateManifest(miscbox, misc_own, "")
|
||||
return
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
var/special_enabled = FALSE
|
||||
var/DropPodOnly = FALSE //only usable by the Bluespace Drop Pod via the express cargo console
|
||||
var/admin_spawned = FALSE //Can only an admin spawn this crate?
|
||||
var/goody = PACK_GOODY_NONE //Small items can be grouped into a single crate.They also come in a closet/lockbox instead of a full crate, so the 700 min doesn't apply
|
||||
var/can_private_buy = TRUE //Can it be purchased privately by each crewmember?
|
||||
|
||||
/datum/supply_pack/proc/generate(atom/A, datum/bank_account/paying_account)
|
||||
|
||||
@@ -37,15 +37,6 @@
|
||||
contains = list(/obj/item/storage/box/chemimp)
|
||||
crate_name = "chemical implant crate"
|
||||
|
||||
/datum/supply_pack/security/armory/combatknives
|
||||
name = "Combat Knives Crate"
|
||||
desc = "Contains three sharpened combat knives. Each knife guaranteed to fit snugly inside any Nanotrasen-standard boot. Requires Armory access to open."
|
||||
cost = 3200
|
||||
contains = list(/obj/item/kitchen/knife/combat,
|
||||
/obj/item/kitchen/knife/combat,
|
||||
/obj/item/kitchen/knife/combat)
|
||||
crate_name = "combat knife crate"
|
||||
|
||||
/datum/supply_pack/security/armory/ballistic
|
||||
name = "Combat Shotguns Crate"
|
||||
desc = "For when the enemy absolutely needs to be replaced with lead. Contains three Aussec-designed Combat Shotguns, with three Shotgun Bandoliers, as well as seven buchshot and 12g shotgun slugs. Requires Armory access to open."
|
||||
|
||||
@@ -90,16 +90,6 @@
|
||||
crate_name = "industrial rcd"
|
||||
crate_type = /obj/structure/closet/crate/secure/engineering
|
||||
|
||||
/datum/supply_pack/engineering/powergamermitts
|
||||
name = "Insulated Gloves Crate"
|
||||
desc = "The backbone of modern society. Barely ever ordered for actual engineering. Contains three insulated gloves."
|
||||
cost = 2300 //Made of pure-grade bullshittinium
|
||||
contains = list(/obj/item/clothing/gloves/color/yellow,
|
||||
/obj/item/clothing/gloves/color/yellow,
|
||||
/obj/item/clothing/gloves/color/yellow)
|
||||
crate_name = "insulated gloves crate"
|
||||
crate_type = /obj/structure/closet/crate/engineering/electrical
|
||||
|
||||
/datum/supply_pack/engineering/inducers
|
||||
name = "NT-75 Electromagnetic Power Inducers Crate"
|
||||
desc = "No rechargers? No problem, with the NT-75 EPI, you can recharge any standard cell-based equipment anytime, anywhere. Contains two Inducers."
|
||||
@@ -162,6 +152,7 @@
|
||||
/obj/item/storage/toolbox/mechanical)
|
||||
cost = 1200
|
||||
crate_name = "toolbox crate"
|
||||
special = TRUE //Department resupply shuttle loan event.
|
||||
|
||||
/datum/supply_pack/engineering/bsa
|
||||
name = "Bluespace Artillery Parts"
|
||||
|
||||
77
code/modules/cargo/packs/goodies.dm
Normal file
77
code/modules/cargo/packs/goodies.dm
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
/datum/supply_pack/goody
|
||||
access = NONE
|
||||
group = "Goodies"
|
||||
goody = PACK_GOODY_PRIVATE
|
||||
|
||||
/datum/supply_pack/goody/combatknives_single
|
||||
name = "Combat Knife Single-Pack"
|
||||
desc = "Contains one sharpened combat knive. Guaranteed to fit snugly inside any Nanotrasen-standard boot."
|
||||
cost = 800
|
||||
contains = list(/obj/item/kitchen/knife/combat)
|
||||
|
||||
/datum/supply_pack/goody/sologamermitts
|
||||
name = "Insulated Gloves Single-Pack"
|
||||
desc = "The backbone of modern society. Barely ever ordered for actual engineering."
|
||||
cost = 800
|
||||
contains = list(/obj/item/clothing/gloves/color/yellow)
|
||||
|
||||
/datum/supply_pack/goody/firstaidbruises_single
|
||||
name = "Bruise Treatment Kit Single-Pack"
|
||||
desc = "A single brute first-aid kit, perfect for recovering from being crushed in an airlock. Did you know people get crushed in airlocks all the time? Interesting..."
|
||||
cost = 330
|
||||
contains = list(/obj/item/storage/firstaid/brute)
|
||||
|
||||
/datum/supply_pack/goody/firstaidburns_single
|
||||
name = "Burn Treatment Kit Single-Pack"
|
||||
desc = "A single burn first-aid kit. The advertisement displays a winking atmospheric technician giving a thumbs up, saying \"Mistakes happen!\""
|
||||
cost = 330
|
||||
contains = list(/obj/item/storage/firstaid/fire)
|
||||
|
||||
/datum/supply_pack/goody/firstaid_single
|
||||
name = "First Aid Kit Single-Pack"
|
||||
desc = "A single first-aid kit, fit for healing most types of bodily harm."
|
||||
cost = 250
|
||||
contains = list(/obj/item/storage/firstaid/regular)
|
||||
|
||||
/datum/supply_pack/goody/firstaidoxygen_single
|
||||
name = "Oxygen Deprivation Kit Single-Pack"
|
||||
desc = "A single oxygen deprivation first-aid kit, marketed heavily to those with crippling fears of asphyxiation."
|
||||
cost = 330
|
||||
contains = list(/obj/item/storage/firstaid/o2)
|
||||
|
||||
/datum/supply_pack/goody/firstaidtoxins_single
|
||||
name = "Toxin Treatment Kit Single-Pack"
|
||||
desc = "A single first aid kit focused on healing damage dealt by heavy toxins."
|
||||
cost = 330
|
||||
contains = list(/obj/item/storage/firstaid/toxin)
|
||||
|
||||
/datum/supply_pack/goody/toolbox // mostly just to water down coupon probability
|
||||
name = "Mechanical Toolbox"
|
||||
desc = "A fully stocked mechanical toolbox, for when you're too lazy to just print them out."
|
||||
cost = 300
|
||||
contains = list(/obj/item/storage/toolbox/mechanical)
|
||||
|
||||
/datum/supply_pack/goody/electrical_toolbox // mostly just to water down coupon probability
|
||||
name = "Mechanical Toolbox"
|
||||
desc = "A fully stocked electrical toolbox, for when you're too lazy to just print them out."
|
||||
cost = 300
|
||||
contains = list(/obj/item/storage/toolbox/electrical)
|
||||
|
||||
/datum/supply_pack/goody/valentine
|
||||
name = "Valentine Card"
|
||||
desc = "Make an impression on that special someone! Comes with one valentine card and a free candy heart!"
|
||||
cost = 150
|
||||
contains = list(/obj/item/valentine, /obj/item/reagent_containers/food/snacks/candyheart)
|
||||
|
||||
/datum/supply_pack/goody/beeplush
|
||||
name = "Bee Plushie"
|
||||
desc = "The most important thing you could possibly spend your hard-earned money on."
|
||||
cost = 1500
|
||||
contains = list(/obj/item/toy/plush/beeplushie)
|
||||
|
||||
/datum/supply_pack/goody/beach_ball
|
||||
name = "Beach Ball"
|
||||
desc = "The simple beach ball is one of Nanotrasen's most popular products. 'Why do we make beach balls? Because we can! (TM)' - Nanotrasen"
|
||||
cost = 200
|
||||
contains = list(/obj/item/toy/beach_ball)
|
||||
@@ -14,53 +14,60 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/supply_pack/materials/cardboard50
|
||||
goody = PACK_GOODY_PUBLIC
|
||||
name = "50 Cardboard Sheets"
|
||||
desc = "Create a bunch of boxes."
|
||||
cost = 1000
|
||||
cost = 300 //thrice their export value
|
||||
contains = list(/obj/item/stack/sheet/cardboard/fifty)
|
||||
crate_name = "cardboard sheets crate"
|
||||
|
||||
/datum/supply_pack/materials/glass50
|
||||
goody = PACK_GOODY_PUBLIC
|
||||
name = "50 Glass Sheets"
|
||||
desc = "Let some nice light in with fifty glass sheets!"
|
||||
cost = 850
|
||||
cost = 300 //double their export value
|
||||
contains = list(/obj/item/stack/sheet/glass/fifty)
|
||||
crate_name = "glass sheets crate"
|
||||
|
||||
/datum/supply_pack/materials/metal50
|
||||
goody = PACK_GOODY_PUBLIC
|
||||
name = "50 Metal Sheets"
|
||||
desc = "Any construction project begins with a good stack of fifty metal sheets!"
|
||||
cost = 850
|
||||
cost = 300 //double their export value
|
||||
contains = list(/obj/item/stack/sheet/metal/fifty)
|
||||
crate_name = "metal sheets crate"
|
||||
|
||||
/datum/supply_pack/materials/plasteel20
|
||||
goody = PACK_GOODY_PUBLIC
|
||||
name = "20 Plasteel Sheets"
|
||||
desc = "Reinforce the station's integrity with twenty plasteel sheets!"
|
||||
cost = 4700
|
||||
cost = 4000
|
||||
contains = list(/obj/item/stack/sheet/plasteel/twenty)
|
||||
crate_name = "plasteel sheets crate"
|
||||
|
||||
/datum/supply_pack/materials/plasteel50
|
||||
name = "50 Plasteel Sheets"
|
||||
desc = "For when you REALLY have to reinforce something."
|
||||
cost = 9050
|
||||
contains = list(/obj/item/stack/sheet/plasteel/fifty)
|
||||
crate_name = "plasteel sheets crate"
|
||||
|
||||
/datum/supply_pack/materials/plastic50
|
||||
goody = PACK_GOODY_PUBLIC
|
||||
name = "50 Plastic Sheets"
|
||||
desc = "Build a limitless amount of toys with fifty plastic sheets!"
|
||||
cost = 950
|
||||
contains = list(/obj/item/stack/sheet/plastic/fifty)
|
||||
crate_name = "plastic sheets crate"
|
||||
cost = 200 // double their export
|
||||
contains = list(/obj/item/stack/sheet/plastic/twenty)
|
||||
|
||||
/datum/supply_pack/materials/sandstone30
|
||||
goody = PACK_GOODY_PUBLIC
|
||||
name = "30 Sandstone Blocks"
|
||||
desc = "Neither sandy nor stoney, these thirty blocks will still get the job done."
|
||||
cost = 800
|
||||
cost = 150 // five times their export
|
||||
contains = list(/obj/item/stack/sheet/mineral/sandstone/thirty)
|
||||
crate_name = "sandstone blocks crate"
|
||||
|
||||
/datum/supply_pack/materials/wood50
|
||||
goody = PACK_GOODY_PUBLIC
|
||||
name = "50 Wood Planks"
|
||||
desc = "Turn cargo's boring metal groundwork into beautiful panelled flooring and much more with fifty wooden planks!"
|
||||
cost = 400 // 6-7 planks shy from having equal import/export prices
|
||||
contains = list(/obj/item/stack/sheet/mineral/wood/twenty)
|
||||
|
||||
/datum/supply_pack/materials/rcdammo
|
||||
goody = PACK_GOODY_PUBLIC
|
||||
name = "Large RCD ammo Single-Pack"
|
||||
desc = "A single large compressed RCD matter pack, to help with any holes or projects people might be working on."
|
||||
cost = 600
|
||||
contains = list(/obj/item/rcd_ammo/large)
|
||||
|
||||
/datum/supply_pack/materials/rawlumber
|
||||
name = "50 Towercap Logs"
|
||||
@@ -74,35 +81,6 @@
|
||||
for(var/i in 1 to 49)
|
||||
new /obj/item/grown/log(.)
|
||||
|
||||
/datum/supply_pack/materials/wood50
|
||||
name = "50 Wood Planks"
|
||||
desc = "Turn cargo's boring metal groundwork into beautiful panelled flooring and much more with fifty wooden planks!"
|
||||
cost = 1450
|
||||
contains = list(/obj/item/stack/sheet/mineral/wood/fifty)
|
||||
crate_name = "wood planks crate"
|
||||
|
||||
/datum/supply_pack/materials/rcdammo
|
||||
name = "Spare RCD ammo"
|
||||
desc = "This crate contains sixteen RCD compressed matter packs, to help with any holes or projects people might be working on."
|
||||
cost = 3750
|
||||
contains = list(/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo,
|
||||
/obj/item/rcd_ammo)
|
||||
crate_name = "rcd ammo"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////// Canisters //////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -141,34 +141,6 @@
|
||||
///////////////////////////// Medical Kits ///////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/supply_pack/medical/firstaidbruises
|
||||
name = "Bruise Treatment Kit Crate"
|
||||
desc = "Contains three first aid kits focused on healing bruises and broken bones."
|
||||
cost = 1000
|
||||
contains = list(/obj/item/storage/firstaid/brute,
|
||||
/obj/item/storage/firstaid/brute,
|
||||
/obj/item/storage/firstaid/brute)
|
||||
crate_name = "brute treatment kit crate"
|
||||
|
||||
/datum/supply_pack/medical/firstaidburns
|
||||
name = "Burn Treatment Kit Crate"
|
||||
desc = "Contains three first aid kits focused on healing severe burns."
|
||||
cost = 1000
|
||||
contains = list(/obj/item/storage/firstaid/fire,
|
||||
/obj/item/storage/firstaid/fire,
|
||||
/obj/item/storage/firstaid/fire)
|
||||
crate_name = "burn treatment kit crate"
|
||||
|
||||
/datum/supply_pack/medical/firstaid
|
||||
name = "First Aid Kit Crate"
|
||||
desc = "Contains four first aid kits for healing most types of wounds."
|
||||
cost = 1000
|
||||
contains = list(/obj/item/storage/firstaid/regular,
|
||||
/obj/item/storage/firstaid/regular,
|
||||
/obj/item/storage/firstaid/regular,
|
||||
/obj/item/storage/firstaid/regular)
|
||||
crate_name = "first aid kit crate"
|
||||
|
||||
/datum/supply_pack/medical/sprays
|
||||
name = "Medical Sprays"
|
||||
desc = "Contains two cans of Styptic Spray, Silver Sulfadiazine Spray, Synthflesh Spray and Sterilizer Compound Spray."
|
||||
@@ -183,35 +155,6 @@
|
||||
/obj/item/reagent_containers/medspray/sterilizine)
|
||||
crate_name = "medical supplies crate"
|
||||
|
||||
/datum/supply_pack/medical/firstaidmixed
|
||||
name = "Mixed Medical Kits"
|
||||
desc = "Contains one of each medical kits for dealing with a variety of injured crewmembers."
|
||||
cost = 1250
|
||||
contains = list(/obj/item/storage/firstaid/toxin,
|
||||
/obj/item/storage/firstaid/o2,
|
||||
/obj/item/storage/firstaid/brute,
|
||||
/obj/item/storage/firstaid/fire,
|
||||
/obj/item/storage/firstaid/regular)
|
||||
crate_name = "medical supplies crate"
|
||||
|
||||
/datum/supply_pack/medical/firstaidoxygen
|
||||
name = "Oxygen Deprivation Kit Crate"
|
||||
desc = "Contains three first aid kits focused on helping oxygen deprivation victims."
|
||||
cost = 1000
|
||||
contains = list(/obj/item/storage/firstaid/o2,
|
||||
/obj/item/storage/firstaid/o2,
|
||||
/obj/item/storage/firstaid/o2)
|
||||
crate_name = "oxygen deprivation kit crate"
|
||||
|
||||
/datum/supply_pack/medical/firstaidtoxins
|
||||
name = "Toxin Treatment Kit Crate"
|
||||
desc = "Contains three first aid kits focused on healing damage dealt by heavy toxins."
|
||||
cost = 1000
|
||||
contains = list(/obj/item/storage/firstaid/toxin,
|
||||
/obj/item/storage/firstaid/toxin,
|
||||
/obj/item/storage/firstaid/toxin)
|
||||
crate_name = "toxin treatment kit crate"
|
||||
|
||||
/datum/supply_pack/medical/advrad
|
||||
name = "Radiation Treatment Crate Deluxe"
|
||||
desc = "A crate for when radiation is out of hand... Contains two rad-b-gone kits, one bottle of anti radiation deluxe pills, as well as a radiation treatment deluxe pill bottle!"
|
||||
|
||||
@@ -333,45 +333,58 @@
|
||||
//////////////////////////// Misc + Decor ////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/supply_pack/misc/carpet_exotic
|
||||
name = "Exotic Carpet Crate"
|
||||
desc = "Exotic carpets straight from Space Russia, for all your decorating needs. Contains 100 tiles each of 10 different flooring patterns."
|
||||
cost = 7000
|
||||
contains = list(/obj/item/stack/tile/carpet/blue/fifty,
|
||||
/obj/item/stack/tile/carpet/blue/fifty,
|
||||
/obj/item/stack/tile/carpet/cyan/fifty,
|
||||
/obj/item/stack/tile/carpet/cyan/fifty,
|
||||
/obj/item/stack/tile/carpet/green/fifty,
|
||||
/obj/item/stack/tile/carpet/green/fifty,
|
||||
/obj/item/stack/tile/carpet/orange/fifty,
|
||||
/obj/item/stack/tile/carpet/orange/fifty,
|
||||
/obj/item/stack/tile/carpet/purple/fifty,
|
||||
/obj/item/stack/tile/carpet/purple/fifty,
|
||||
/obj/item/stack/tile/carpet/red/fifty,
|
||||
/obj/item/stack/tile/carpet/red/fifty,
|
||||
/obj/item/stack/tile/carpet/royalblue/fifty,
|
||||
/obj/item/stack/tile/carpet/royalblue/fifty,
|
||||
/obj/item/stack/tile/carpet/royalblack/fifty,
|
||||
/obj/item/stack/tile/carpet/royalblack/fifty,
|
||||
/obj/item/stack/tile/carpet/blackred/fifty,
|
||||
/obj/item/stack/tile/carpet/blackred/fifty,
|
||||
/obj/item/stack/tile/carpet/monochrome/fifty,
|
||||
/obj/item/stack/tile/carpet/monochrome/fifty)
|
||||
crate_name = "exotic carpet crate"
|
||||
|
||||
/datum/supply_pack/misc/carpet
|
||||
name = "Premium Carpet Crate"
|
||||
desc = "Plasteel floor tiles getting on your nerves? These stacks of extra soft carpet will tie any room together. Contains some classic carpet, along with black, red, and monochrome varients."
|
||||
cost = 1350
|
||||
contains = list(/obj/item/stack/tile/carpet/fifty,
|
||||
/obj/item/stack/tile/carpet/fifty,
|
||||
/obj/item/stack/tile/carpet/black/fifty,
|
||||
/obj/item/stack/tile/carpet/black/fifty,
|
||||
/obj/item/stack/tile/carpet/blackred/fifty,
|
||||
/obj/item/stack/tile/carpet/blackred/fifty,
|
||||
/obj/item/stack/tile/carpet/monochrome/fifty,
|
||||
/obj/item/stack/tile/carpet/monochrome/fifty)
|
||||
crate_name = "premium carpet crate"
|
||||
goody = PACK_GOODY_PUBLIC
|
||||
name = "Classic Carpet Single-Pack"
|
||||
desc = "Plasteel floor tiles getting on your nerves? This 50 units stack of extra soft carpet will tie any room together."
|
||||
cost = 200
|
||||
contains = list(/obj/item/stack/tile/carpet/fifty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/black
|
||||
name = "Black Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/black/fifty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium
|
||||
name = "Monochrome Carpet Single-Pack"
|
||||
desc = "Exotic carpets for all your decorating needs. This 30 units stack of extra soft carpet will tie any room together."
|
||||
cost = 250
|
||||
contains = list(/obj/item/stack/tile/carpet/monochrome/thirty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium/blackred
|
||||
name = "Black-Red Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/blackred/thirty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium/royalblack
|
||||
name = "Royal Black Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/royalblack/thirty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium/royalblue
|
||||
name = "Royal Blue Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/royalblue/thirty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium/red
|
||||
name = "Red Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/red/thirty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium/purple
|
||||
name = "Purple Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/purple/thirty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium/orange
|
||||
name = "Orange Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/orange/thirty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium/green
|
||||
name = "Green Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/green/thirty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium/cyan
|
||||
name = "Cyan Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/cyan/thirty)
|
||||
|
||||
/datum/supply_pack/misc/carpet/premium/blue
|
||||
name = "Blue Carpet Single-Pack"
|
||||
contains = list(/obj/item/stack/tile/carpet/blue/thirty)
|
||||
|
||||
/datum/supply_pack/misc/noslipfloor
|
||||
name = "High-traction Floor Tiles"
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
/mob/living/carbon/alien/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
|
||||
return ..(AM, skipcatch = TRUE, hitpush = FALSE)
|
||||
|
||||
/mob/living/carbon/alien/can_embed(obj/item/I)
|
||||
return FALSE
|
||||
|
||||
/*Code for aliens attacking aliens. Because aliens act on a hivemind, I don't see them as very aggressive with each other.
|
||||
As such, they can either help or harm other aliens. Help works like the human help command while harm is a simple nibble.
|
||||
In all, this is a lot like the monkey code. /N
|
||||
|
||||
@@ -65,17 +65,6 @@
|
||||
throw_mode_off()
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/embed_item(obj/item/I)
|
||||
throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
|
||||
var/obj/item/bodypart/L = pick(bodyparts)
|
||||
L.embedded_objects |= I
|
||||
I.add_mob_blood(src)//it embedded itself in you, of course it's bloody!
|
||||
I.forceMove(src)
|
||||
I.embedded()
|
||||
L.receive_damage(I.w_class*I.embedding["impact_pain_mult"])
|
||||
visible_message("<span class='danger'>[I] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>[I] embeds itself in your [L.name]!</span>")
|
||||
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "embedded", /datum/mood_event/embedded)
|
||||
|
||||
/mob/living/carbon/attacked_by(obj/item/I, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1)
|
||||
var/totitemdamage = pre_attacked_by(I, user) * damage_multiplier
|
||||
var/impacting_zone = (user == src)? check_zone(user.zone_selected) : ran_zone(user.zone_selected)
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
|
||||
|
||||
/mob/living/carbon/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE)
|
||||
/mob/living/carbon/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, spread_damage = FALSE)
|
||||
SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMGE, damage, damagetype, def_zone)
|
||||
var/hit_percent = (100-blocked)/100
|
||||
if(!forced && hit_percent <= 0)
|
||||
return 0
|
||||
|
||||
var/obj/item/bodypart/BP = null
|
||||
if(isbodypart(def_zone)) //we specified a bodypart object
|
||||
BP = def_zone
|
||||
else
|
||||
if(!def_zone)
|
||||
def_zone = ran_zone(def_zone)
|
||||
BP = get_bodypart(check_zone(def_zone))
|
||||
if(!BP)
|
||||
BP = bodyparts[1]
|
||||
if(!spread_damage)
|
||||
if(isbodypart(def_zone)) //we specified a bodypart object
|
||||
BP = def_zone
|
||||
else
|
||||
if(!def_zone)
|
||||
def_zone = ran_zone(def_zone)
|
||||
BP = get_bodypart(check_zone(def_zone))
|
||||
if(!BP)
|
||||
BP = bodyparts[1]
|
||||
|
||||
var/damage_amount = forced ? damage : damage * hit_percent
|
||||
switch(damagetype)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
|
||||
/mob/living/carbon/human/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE)
|
||||
/mob/living/carbon/human/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, spread_damage)
|
||||
// depending on the species, it will run the corresponding apply_damage code there
|
||||
return dna.species.apply_damage(damage, damagetype, def_zone, blocked, src, forced)
|
||||
return dna.species.apply_damage(damage, damagetype, def_zone, blocked, src, forced, spread_damage)
|
||||
|
||||
@@ -1939,7 +1939,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
append_message += ", causing them to drop [target_held_item]"
|
||||
log_combat(user, target, "shoved", append_message)
|
||||
|
||||
/datum/species/proc/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H, forced = FALSE)
|
||||
/datum/species/proc/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H, forced = FALSE, spread_damage = FALSE)
|
||||
SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMGE, damage, damagetype, def_zone)
|
||||
var/hit_percent = (100-(blocked+armor))/100
|
||||
hit_percent = (hit_percent * (100-H.physiology.damage_resistance))/100
|
||||
@@ -1947,20 +1947,20 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
|
||||
return 0
|
||||
|
||||
var/obj/item/bodypart/BP = null
|
||||
if(isbodypart(def_zone))
|
||||
if(damagetype == STAMINA && istype(def_zone, /obj/item/bodypart/head))
|
||||
BP = H.get_bodypart(check_zone(BODY_ZONE_CHEST))
|
||||
if(!spread_damage)
|
||||
if(isbodypart(def_zone))
|
||||
if(damagetype == STAMINA && istype(def_zone, /obj/item/bodypart/head))
|
||||
BP = H.get_bodypart(check_zone(BODY_ZONE_CHEST))
|
||||
else
|
||||
BP = def_zone
|
||||
else
|
||||
BP = def_zone
|
||||
else
|
||||
if(!def_zone)
|
||||
def_zone = ran_zone(def_zone)
|
||||
if(damagetype == STAMINA && def_zone == BODY_ZONE_HEAD)
|
||||
def_zone = BODY_ZONE_CHEST
|
||||
BP = H.get_bodypart(check_zone(def_zone))
|
||||
|
||||
if(!BP)
|
||||
BP = H.bodyparts[1]
|
||||
if(!def_zone)
|
||||
def_zone = ran_zone(def_zone)
|
||||
if(damagetype == STAMINA && def_zone == BODY_ZONE_HEAD)
|
||||
def_zone = BODY_ZONE_CHEST
|
||||
BP = H.get_bodypart(check_zone(def_zone))
|
||||
if(!BP)
|
||||
BP = H.bodyparts[1]
|
||||
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
|
||||
/*
|
||||
apply_damage(a,b,c)
|
||||
args
|
||||
a:damage - How much damage to take
|
||||
b:damage_type - What type of damage to take, brute, burn
|
||||
c:def_zone - Where to take the damage if its brute or burn
|
||||
Returns
|
||||
standard 0 if fail
|
||||
*/
|
||||
/mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE)
|
||||
/**
|
||||
* Applies damage to this mob
|
||||
*
|
||||
* Sends [COMSIG_MOB_APPLY_DAMGE]
|
||||
*
|
||||
* Arguuments:
|
||||
* * damage - amount of damage
|
||||
* * damagetype - one of [BRUTE], [BURN], [TOX], [OXY], [CLONE], [STAMINA]
|
||||
* * def_zone - zone that is being hit if any
|
||||
* * blocked - armor value applied
|
||||
* * forced - bypass hit percentage
|
||||
* * spread_damage - used in overrides
|
||||
*
|
||||
* Returns TRUE if damage applied
|
||||
*/
|
||||
/mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, spread_damage = FALSE)
|
||||
var/hit_percent = (100-blocked)/100
|
||||
if(!damage || (hit_percent <= 0))
|
||||
return 0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/mob/living/proc/run_armor_check(def_zone = null, attack_flag = "melee", absorb_text = "Your armor absorbs the blow!", soften_text = "Your armor softens the blow!", armour_penetration, penetrated_text = "Your armor was penetrated!", silent=FALSE)
|
||||
var/armor = getarmor(def_zone, attack_flag)
|
||||
|
||||
|
||||
if(silent)
|
||||
return max(0, armor - armour_penetration)
|
||||
|
||||
@@ -108,12 +108,6 @@
|
||||
/mob/living/proc/catch_item(obj/item/I, skip_throw_mode_check = FALSE)
|
||||
return FALSE
|
||||
|
||||
/mob/living/proc/embed_item(obj/item/I)
|
||||
return
|
||||
|
||||
/mob/living/proc/can_embed(obj/item/I)
|
||||
return FALSE
|
||||
|
||||
/mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
|
||||
// Throwingdatum can be null if someone had an accident() while slipping with an item in hand.
|
||||
var/obj/item/I
|
||||
@@ -129,30 +123,17 @@
|
||||
skipcatch = TRUE
|
||||
blocked = TRUE
|
||||
total_damage = block_calculate_resultant_damage(total_damage, block_return)
|
||||
else if(I && I.throw_speed >= EMBED_THROWSPEED_THRESHOLD && can_embed(I, src) && prob(I.embedding["embed_chance"]) && !HAS_TRAIT(src, TRAIT_PIERCEIMMUNE) && (!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) || incapacitated() || get_active_held_item()))
|
||||
embed_item(I)
|
||||
hitpush = FALSE
|
||||
skipcatch = TRUE //can't catch the now embedded item
|
||||
if(I)
|
||||
var/nosell_hit = SEND_SIGNAL(I, COMSIG_MOVABLE_IMPACT_ZONE, src, impacting_zone, throwingdatum, FALSE, blocked)
|
||||
if(nosell_hit)
|
||||
skipcatch = TRUE
|
||||
hitpush = FALSE
|
||||
if(!skipcatch && isturf(I.loc) && catch_item(I))
|
||||
return TRUE
|
||||
var/dtype = BRUTE
|
||||
var/volume = I.get_volume_by_throwforce_and_or_w_class()
|
||||
SEND_SIGNAL(I, COMSIG_MOVABLE_IMPACT_ZONE, src, impacting_zone)
|
||||
|
||||
dtype = I.damtype
|
||||
|
||||
if (I.throwforce > 0) //If the weapon's throwforce is greater than zero...
|
||||
if (I.throwhitsound) //...and throwhitsound is defined...
|
||||
playsound(loc, I.throwhitsound, volume, 1, -1) //...play the weapon's throwhitsound.
|
||||
else if(I.hitsound) //Otherwise, if the weapon's hitsound is defined...
|
||||
playsound(loc, I.hitsound, volume, 1, -1) //...play the weapon's hitsound.
|
||||
else if(!I.throwhitsound) //Otherwise, if throwhitsound isn't defined...
|
||||
playsound(loc, 'sound/weapons/genhit.ogg',volume, 1, -1) //...play genhit.ogg.
|
||||
|
||||
else if(!I.throwhitsound && I.throwforce > 0) //Otherwise, if the item doesn't have a throwhitsound and has a throwforce greater than zero...
|
||||
playsound(loc, 'sound/weapons/genhit.ogg', volume, 1, -1)//...play genhit.ogg
|
||||
if(!I.throwforce)// Otherwise, if the item's throwforce is 0...
|
||||
playsound(loc, 'sound/weapons/throwtap.ogg', 1, volume, -1)//...play throwtap.ogg.
|
||||
if(!blocked)
|
||||
visible_message("<span class='danger'>[src] has been hit by [I].</span>", \
|
||||
"<span class='userdanger'>You have been hit by [I].</span>")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
/mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE)
|
||||
/mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, spread_damage = FALSE)
|
||||
var/hit_percent = (100-blocked)/100
|
||||
if(!damage || (!forced && hit_percent <= 0))
|
||||
return 0
|
||||
|
||||
@@ -299,8 +299,8 @@
|
||||
//siemens_coeff - layman's terms, conductivity
|
||||
//dist_check - set to only shock mobs within 1 of source (vendors, airlocks, etc.)
|
||||
//No animations will be performed by this proc.
|
||||
/proc/electrocute_mob(mob/living/carbon/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE)
|
||||
if(!M || ismecha(M.loc))
|
||||
/proc/electrocute_mob(mob/living/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE)
|
||||
if(!istype(M) || ismecha(M.loc))
|
||||
return 0 //feckin mechs are dumb
|
||||
if(dist_check)
|
||||
if(!in_range(source,M))
|
||||
|
||||
@@ -101,6 +101,10 @@ GLOBAL_LIST_INIT(cargo_shuttle_leave_behind_typecache, typecacheof(list(
|
||||
if(!SSshuttle.shoppinglist.len)
|
||||
return
|
||||
|
||||
var/list/obj/miscboxes = list() //miscboxes are combo boxes that contain all goody orders grouped
|
||||
var/list/misc_order_num = list() //list of strings of order numbers, so that the manifest can show all orders in a box
|
||||
var/list/misc_contents = list() //list of lists of items that each box will contain
|
||||
|
||||
var/list/empty_turfs = list()
|
||||
for(var/place in shuttle_areas)
|
||||
var/area/shuttle/shuttle_area = place
|
||||
@@ -117,10 +121,13 @@ GLOBAL_LIST_INIT(cargo_shuttle_leave_behind_typecache, typecacheof(list(
|
||||
break
|
||||
|
||||
var/price = SO.pack.cost
|
||||
if(SO.applied_coupon)
|
||||
price *= (1 - SO.applied_coupon.discount_pct_off)
|
||||
var/datum/bank_account/D
|
||||
if(SO.paying_account) //Someone paid out of pocket
|
||||
D = SO.paying_account
|
||||
price *= 1.1 //TODO make this customizable by the quartermaster
|
||||
if(!SO.pack.goody)
|
||||
price *= 1.1 //TODO make this customizable by the quartermaster
|
||||
else
|
||||
D = cargo_budget
|
||||
if(D)
|
||||
@@ -136,14 +143,46 @@ GLOBAL_LIST_INIT(cargo_shuttle_leave_behind_typecache, typecacheof(list(
|
||||
value += SO.pack.cost
|
||||
SSshuttle.shoppinglist -= SO
|
||||
SSshuttle.orderhistory += SO
|
||||
QDEL_NULL(SO.applied_coupon)
|
||||
|
||||
if(SO.pack.goody) //goody means it gets piled in the miscbox
|
||||
if(SO.paying_account)
|
||||
if(!miscboxes.len || !miscboxes[D.account_holder]) //if there's no miscbox for this person
|
||||
miscboxes[D.account_holder] = new /obj/item/storage/lockbox/order(pick_n_take(empty_turfs))
|
||||
var/obj/item/storage/lockbox/order/our_box = miscboxes[D.account_holder]
|
||||
our_box.buyer_account = SO.paying_account
|
||||
miscboxes[D.account_holder].name = "small items case - purchased by [D.account_holder]"
|
||||
misc_contents[D.account_holder] = list()
|
||||
for (var/item in SO.pack.contains)
|
||||
misc_contents[D.account_holder] += item
|
||||
misc_order_num[D.account_holder] = "[misc_order_num[D.account_holder]]#[SO.id] "
|
||||
else //No private payment, so we just stuff it all into a generic crate
|
||||
if(!miscboxes.len || !miscboxes["Cargo"])
|
||||
miscboxes["Cargo"] = new /obj/structure/closet/secure_closet/goodies(pick_n_take(empty_turfs))
|
||||
miscboxes["Cargo"].name = "small items closet"
|
||||
misc_contents["Cargo"] = list()
|
||||
miscboxes["Cargo"].req_access = list()
|
||||
for (var/item in SO.pack.contains)
|
||||
misc_contents["Cargo"] += item
|
||||
//new item(miscboxes["Cargo"])
|
||||
if(SO.pack.access)
|
||||
miscboxes["Cargo"].req_access += SO.pack.access
|
||||
misc_order_num["Cargo"] = "[misc_order_num["Cargo"]]#[SO.id] "
|
||||
else
|
||||
SO.generate(pick_n_take(empty_turfs))
|
||||
|
||||
SO.generate(pick_n_take(empty_turfs))
|
||||
SSblackbox.record_feedback("nested tally", "cargo_imports", 1, list("[SO.pack.cost]", "[SO.pack.name]"))
|
||||
investigate_log("Order #[SO.id] ([SO.pack.name], placed by [key_name(SO.orderer_ckey)]), paid by [D.account_holder] has shipped.", INVESTIGATE_CARGO)
|
||||
if(SO.pack.dangerous)
|
||||
message_admins("\A [SO.pack.name] ordered by [ADMIN_LOOKUPFLW(SO.orderer_ckey)], paid by [D.account_holder] has shipped.")
|
||||
purchases++
|
||||
|
||||
for(var/I in miscboxes)
|
||||
var/datum/supply_order/SO = new/datum/supply_order()
|
||||
SO.id = misc_order_num[I]
|
||||
SO.generateCombo(miscboxes[I], I, misc_contents[I])
|
||||
qdel(SO)
|
||||
|
||||
investigate_log("[purchases] orders in this shipment, worth [value] credits. [cargo_budget.account_balance] credits left.", INVESTIGATE_CARGO)
|
||||
|
||||
/obj/docking_port/mobile/supply/proc/sell()
|
||||
|
||||
@@ -105,6 +105,12 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
|
||||
///Last world tick we sent a slogan message out
|
||||
var/last_slogan
|
||||
var/last_shopper
|
||||
var/tilted = FALSE
|
||||
var/tiltable = TRUE
|
||||
var/squish_damage = 75
|
||||
var/forcecrit = 0
|
||||
var/num_shards = 7
|
||||
var/list/pinned_mobs = list()
|
||||
///How many ticks until we can send another
|
||||
var/slogan_delay = 6000
|
||||
///Icon when vending an item to the user
|
||||
@@ -372,6 +378,7 @@ GLOBAL_LIST_EMPTY(vending_products)
|
||||
..()
|
||||
if(panel_open)
|
||||
default_unfasten_wrench(user, I, time = 60)
|
||||
unbuckle_all_mobs(TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/vending/screwdriver_act(mob/living/user, obj/item/I)
|
||||
@@ -435,6 +442,133 @@ GLOBAL_LIST_EMPTY(vending_products)
|
||||
updateUsrDialog()
|
||||
else
|
||||
. = ..()
|
||||
if(tiltable && !tilted && I.force)
|
||||
switch(rand(1, 100))
|
||||
if(1 to 5)
|
||||
freebie(user, 3)
|
||||
if(6 to 15)
|
||||
freebie(user, 2)
|
||||
if(16 to 25)
|
||||
freebie(user, 1)
|
||||
if(76 to 90)
|
||||
tilt(user)
|
||||
if(91 to 100)
|
||||
tilt(user, crit=TRUE)
|
||||
|
||||
/obj/machinery/vending/proc/freebie(mob/fatty, freebies)
|
||||
visible_message("<span class='notice'>[src] yields [freebies > 1 ? "several free goodies" : "a free goody"]!</span>")
|
||||
|
||||
for(var/i in 1 to freebies)
|
||||
playsound(src, 'sound/machines/machine_vend.ogg', 50, TRUE, extrarange = -3)
|
||||
for(var/datum/data/vending_product/R in shuffle(product_records))
|
||||
|
||||
if(R.amount <= 0) //Try to use a record that actually has something to dump.
|
||||
continue
|
||||
var/dump_path = R.product_path
|
||||
if(!dump_path)
|
||||
continue
|
||||
|
||||
R.amount--
|
||||
new dump_path(get_turf(src))
|
||||
break
|
||||
|
||||
/obj/machinery/vending/proc/tilt(mob/fatty, crit=FALSE)
|
||||
visible_message("<span class='danger'>[src] tips over!</span>")
|
||||
tilted = TRUE
|
||||
layer = ABOVE_MOB_LAYER
|
||||
|
||||
var/crit_case
|
||||
if(crit)
|
||||
crit_case = rand(1,5)
|
||||
|
||||
if(forcecrit)
|
||||
crit_case = forcecrit
|
||||
|
||||
if(in_range(fatty, src))
|
||||
for(var/mob/living/L in get_turf(fatty))
|
||||
var/mob/living/carbon/C = L
|
||||
|
||||
if(istype(C))
|
||||
var/crit_rebate = 0 // lessen the normal damage we deal for some of the crits
|
||||
|
||||
if(crit_case != 5) // the head asplode case has its own description
|
||||
C.visible_message("<span class='danger'>[C] is crushed by [src]!</span>", \
|
||||
"<span class='userdanger'>You are crushed by [src]!</span>")
|
||||
|
||||
switch(crit_case) // only carbons can have the fun crits
|
||||
if(1) // shatter their legs and bleed 'em
|
||||
crit_rebate = 60
|
||||
C.bleed(150)
|
||||
var/obj/item/bodypart/l_leg/l = C.get_bodypart(BODY_ZONE_L_LEG)
|
||||
if(l)
|
||||
l.receive_damage(brute=200, updating_health=TRUE)
|
||||
var/obj/item/bodypart/r_leg/r = C.get_bodypart(BODY_ZONE_R_LEG)
|
||||
if(r)
|
||||
r.receive_damage(brute=200, updating_health=TRUE)
|
||||
if(l || r)
|
||||
C.visible_message("<span class='danger'>[C]'s legs shatter with a sickening crunch!</span>", \
|
||||
"<span class='userdanger'>Your legs shatter with a sickening crunch!</span>")
|
||||
if(2) // pin them beneath the machine until someone untilts it
|
||||
forceMove(get_turf(C))
|
||||
buckle_mob(C, force=TRUE)
|
||||
C.visible_message("<span class='danger'>[C] is pinned underneath [src]!</span>", \
|
||||
"<span class='userdanger'>You are pinned down by [src]!</span>")
|
||||
if(3) // glass candy
|
||||
crit_rebate = 50
|
||||
for(var/i = 0, i < num_shards, i++)
|
||||
var/obj/item/shard/shard = new /obj/item/shard(get_turf(C))
|
||||
shard.embedding = list(embed_chance = 100, ignore_throwspeed_threshold = TRUE, impact_pain_mult=1, pain_chance=5)
|
||||
shard.updateEmbedding()
|
||||
C.hitby(shard, skipcatch = TRUE, hitpush = FALSE)
|
||||
shard.embedding = list()
|
||||
shard.updateEmbedding()
|
||||
if(4) // paralyze this binch
|
||||
// the new paraplegic gets like 4 lines of losing their legs so skip them
|
||||
visible_message("<span class='danger'>[C]'s spinal cord is obliterated with a sickening crunch!</span>", ignored_mobs = list(C))
|
||||
C.gain_trauma(/datum/brain_trauma/severe/paralysis/paraplegic)
|
||||
if(5) // skull squish!
|
||||
var/obj/item/bodypart/head/O = C.get_bodypart(BODY_ZONE_HEAD)
|
||||
if(O)
|
||||
C.visible_message("<span class='danger'>[O] explodes in a shower of gore beneath [src]!</span>", \
|
||||
"<span class='userdanger'>Oh f-</span>")
|
||||
O.dismember()
|
||||
O.drop_organs()
|
||||
qdel(O)
|
||||
new /obj/effect/gibspawner/human/bodypartless(get_turf(C))
|
||||
|
||||
C.apply_damage(max(0, squish_damage - crit_rebate), forced=TRUE, spread_damage=TRUE)
|
||||
C.AddElement(/datum/element/squish, 18 SECONDS)
|
||||
else
|
||||
L.visible_message("<span class='danger'>[L] is crushed by [src]!</span>", \
|
||||
"<span class='userdanger'>You are crushed by [src]!</span>")
|
||||
L.apply_damage(squish_damage, forced=TRUE)
|
||||
if(crit_case)
|
||||
L.apply_damage(squish_damage, forced=TRUE)
|
||||
|
||||
L.Paralyze(60)
|
||||
L.emote("scream")
|
||||
playsound(L, 'sound/effects/blobattack.ogg', 40, TRUE)
|
||||
playsound(L, 'sound/effects/splat.ogg', 50, TRUE)
|
||||
|
||||
var/matrix/M = matrix()
|
||||
M.Turn(pick(90, 270))
|
||||
transform = M
|
||||
|
||||
if(get_turf(fatty) != get_turf(src))
|
||||
throw_at(get_turf(fatty), 1, 1, spin=FALSE)
|
||||
|
||||
/obj/machinery/vending/proc/untilt(mob/user)
|
||||
user.visible_message("<span class='notice'>[user] rights [src].", \
|
||||
"<span class='notice'>You right [src].")
|
||||
|
||||
unbuckle_all_mobs(TRUE)
|
||||
|
||||
tilted = FALSE
|
||||
layer = initial(layer)
|
||||
|
||||
var/matrix/M = matrix()
|
||||
M.Turn(0)
|
||||
transform = M
|
||||
|
||||
/obj/machinery/vending/proc/loadingAttempt(obj/item/I, mob/user)
|
||||
. = TRUE
|
||||
@@ -447,6 +581,12 @@ GLOBAL_LIST_EMPTY(vending_products)
|
||||
to_chat(user, "<span class='notice'>You insert [I] into [src]'s input compartment.</span>")
|
||||
loaded_items++
|
||||
|
||||
|
||||
/obj/machinery/vending/unbuckle_mob(mob/living/buckled_mob, force=FALSE)
|
||||
if(!force)
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/**
|
||||
* Is the passed in user allowed to load this vending machines compartments
|
||||
*
|
||||
@@ -511,12 +651,13 @@ GLOBAL_LIST_EMPTY(vending_products)
|
||||
if(seconds_electrified && !(stat & NOPOWER))
|
||||
if(shock(user, 100))
|
||||
return
|
||||
if(tilted && !user.buckled && !isAI(user))
|
||||
to_chat(user, "<span class='notice'>You begin righting [src].")
|
||||
if(do_after(user, 50, target=src))
|
||||
untilt(user)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/vending/ui_base_html(html)
|
||||
var/datum/asset/spritesheet/assets = get_asset_datum(/datum/asset/spritesheet/vending)
|
||||
. = replacetext(html, "<!--customheadhtml-->", assets.css_tag())
|
||||
|
||||
/obj/machinery/vending/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
@@ -922,7 +1063,7 @@ GLOBAL_LIST_EMPTY(vending_products)
|
||||
C = H.get_idcard(TRUE)
|
||||
if(C?.registered_account)
|
||||
private_a = C.registered_account
|
||||
say("\The [src] has been linked to [C].")
|
||||
say("[src] has been linked to [C].")
|
||||
|
||||
if(compartmentLoadAccessCheck(user))
|
||||
if(istype(I, /obj/item/pen))
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
extra_price = PRICE_NORMAL
|
||||
payment_department = ACCOUNT_MED
|
||||
cost_multiplier_per_dept = list(ACCOUNT_MED = 0)
|
||||
tiltable = FALSE
|
||||
|
||||
/obj/item/vending_refill/wallmed
|
||||
machine_name = "NanoMed"
|
||||
|
||||
Reference in New Issue
Block a user