Merge branch 'master' into holy-chapel

This commit is contained in:
warior4356
2021-06-28 20:31:34 -07:00
684 changed files with 25456 additions and 31090 deletions
+26 -2
View File
@@ -17,13 +17,18 @@
var/healverb = "bandage"
/obj/item/stack/medical/attack(mob/living/M, mob/user)
if(get_amount() <= 0)
if(is_cyborg)
to_chat(user, "<span class='warning'>You don't have enough energy to dispense more [singular_name]\s!</span>")
return TRUE
if(!iscarbon(M) && !isanimal(M))
to_chat(user, "<span class='danger'>[src] cannot be applied to [M]!</span>")
return 1
return TRUE
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='danger'>You don't have the dexterity to do this!</span>")
return 1
return TRUE
if(ishuman(M))
@@ -167,7 +172,12 @@
heal_brute = 25
stop_bleeding = 0
/obj/item/stack/medical/bruise_pack/advanced/cyborg
energy_type = /datum/robot_energy_storage/medical/adv_brute_kit
is_cyborg = TRUE
/obj/item/stack/medical/bruise_pack/advanced/cyborg/syndicate
energy_type = /datum/robot_energy_storage/medical/adv_brute_kit/syndicate
//Ointment//
@@ -208,6 +218,13 @@
icon_state = "burnkit"
heal_burn = 25
/obj/item/stack/medical/ointment/advanced/cyborg
energy_type = /datum/robot_energy_storage/medical/adv_burn_kit
is_cyborg = TRUE
/obj/item/stack/medical/ointment/advanced/cyborg/syndicate
energy_type = /datum/robot_energy_storage/medical/adv_burn_kit/syndicate
//Medical Herbs//
/obj/item/stack/medical/bruise_pack/comfrey
name = "\improper Comfrey leaf"
@@ -283,6 +300,13 @@
H.handle_splints()
use(1)
/obj/item/stack/medical/splint/cyborg
energy_type = /datum/robot_energy_storage/medical/splint
is_cyborg = TRUE
/obj/item/stack/medical/splint/cyborg/syndicate
energy_type = /datum/robot_energy_storage/medical/splint/syndicate
/obj/item/stack/medical/splint/tribal
name = "tribal splints"
icon_state = "tribal_splint"
@@ -63,3 +63,16 @@
to_chat(user, "<span class='notice'>Nothing to fix here.</span>")
else
to_chat(user, "<span class='notice'>[src] won't work on that.</span>")
/obj/item/stack/nanopaste/cyborg
energy_type = /datum/robot_energy_storage/medical/nanopaste
is_cyborg = TRUE
/obj/item/stack/nanopaste/cyborg/attack(mob/living/M, mob/user)
if(get_amount() <= 0)
to_chat(user, "<span class='warning'>You don't have enough energy to dispense more [name]!</span>")
else
return ..()
/obj/item/stack/nanopaste/cyborg/syndicate
energy_type = /datum/robot_energy_storage/medical/nanopaste/syndicate
+6
View File
@@ -21,10 +21,16 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
hitsound = 'sound/weapons/grenadelaunch.ogg'
toolspeed = 1
usesound = 'sound/items/deconstruct.ogg'
merge_type = /obj/item/stack/rods
/obj/item/stack/rods/cyborg
energy_type = /datum/robot_energy_storage/rods
is_cyborg = TRUE
materials = list()
/obj/item/stack/rods/cyborg/update_icon()
return // icon_state should always be a full stack of rods.
/obj/item/stack/rods/ten
amount = 10
+11 -7
View File
@@ -40,6 +40,8 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
amount = 50
/obj/item/stack/sheet/glass/cyborg
energy_type = /datum/robot_energy_storage/glass
is_cyborg = TRUE
materials = list()
/obj/item/stack/sheet/glass/New(loc, amount)
@@ -48,15 +50,15 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user, params)
..()
if(istype(W,/obj/item/stack/cable_coil))
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if(CC.amount < 5)
if(CC.get_amount() < 5)
to_chat(user, "<b>There is not enough wire in this coil. You need 5 lengths.</b>")
return
CC.use(5)
to_chat(user, "<span class='notice'>You attach wire to the [name].</span>")
to_chat(user, "<span class='notice'>You attach wire to [src].</span>")
new /obj/item/stack/light_w(user.loc)
src.use(1)
use(1)
else if( istype(W, /obj/item/stack/rods) )
var/obj/item/stack/rods/V = W
var/obj/item/stack/sheet/rglass/RG = new (user.loc)
@@ -97,9 +99,6 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
merge_type = /obj/item/stack/sheet/rglass
point_value = 4
/obj/item/stack/sheet/rglass/cyborg
materials = list()
/obj/item/stack/sheet/rglass/New(loc, amount)
recipes = GLOB.reinforced_glass_recipes
..()
@@ -109,6 +108,11 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( \
new/datum/stack_recipe/window("fulltile window", /obj/structure/window/full/plasmabasic, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/rglass/cyborg
energy_type = /datum/robot_energy_storage/rglass
is_cyborg = TRUE
materials = list()
/obj/item/stack/sheet/plasmaglass
name = "plasma glass"
desc = "A very strong and very resistant sheet of a plasma-glass alloy."
+9 -18
View File
@@ -13,25 +13,16 @@
flags = CONDUCT
max_amount = 60
/obj/item/stack/light_w/attackby(obj/item/O as obj, mob/user as mob, params)
/obj/item/stack/light_w/attackby(obj/item/I, mob/user, params)
..()
if(istype(O,/obj/item/wirecutters))
var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc)
if(istype(I, /obj/item/wirecutters))
var/obj/item/stack/cable_coil/CC = new(user.loc)
CC.amount = 5
amount--
new/obj/item/stack/sheet/glass(user.loc)
if(amount <= 0)
user.unEquip(src, 1)
qdel(src)
use(1)
if(istype(O,/obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = O
M.amount--
if(M.amount <= 0)
user.unEquip(src, 1)
qdel(M)
amount--
new/obj/item/stack/tile/light(user.loc)
if(amount <= 0)
user.unEquip(src, 1)
qdel(src)
if(istype(I, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = I
M.use(1)
new /obj/item/stack/tile/light(user.loc)
use(1)
@@ -110,15 +110,13 @@ GLOBAL_LIST_INIT(metal_recipes, list(
point_value = 2
/obj/item/stack/sheet/metal/cyborg
energy_type = /datum/robot_energy_storage/metal
is_cyborg = TRUE
materials = list()
/obj/item/stack/sheet/metal/fifty
amount = 50
/obj/item/stack/sheet/metal/ratvar_act()
new /obj/item/stack/tile/brass(loc, amount)
qdel(src)
/obj/item/stack/sheet/metal/narsie_act()
new /obj/item/stack/sheet/runed_metal(loc, amount)
qdel(src)
@@ -162,6 +160,10 @@ GLOBAL_LIST_INIT(plasteel_recipes, list(
recipes = GLOB.plasteel_recipes
return ..()
/obj/item/stack/sheet/wood/cyborg
energy_type = /datum/robot_energy_storage/wood
is_cyborg = TRUE
/*
* Wood
*/
@@ -372,10 +374,6 @@ GLOBAL_LIST_INIT(cult_recipes, list ( \
. = ..()
icon_state = SSticker.cultdat?.runed_metal_icon_state
/obj/item/stack/sheet/runed_metal/ratvar_act()
new /obj/item/stack/tile/brass(loc, amount)
qdel(src)
/obj/item/stack/sheet/runed_metal/attack_self(mob/living/user)
if(!iscultist(user))
to_chat(user, "<span class='warning'>Only one with forbidden knowledge could hope to work this metal...</span>")
+52 -20
View File
@@ -10,7 +10,16 @@
*/
/obj/item/stack
origin_tech = "materials=1"
var/list/recipes = list() // /datum/stack_recipe
/// Whether this stack is a `/cyborg` subtype or not.
var/is_cyborg = FALSE
/// The energy storage datum that will be used with this stack. Used only with `/cyborg` type stacks.
var/datum/robot_energy_storage/source
/// Which `robot_energy_storage` to choose when this stack is created in cyborgs. Used only with `/cyborg` type stacks.
var/energy_type
/// How much energy using 1 sheet from the stack costs. Used only with `/cyborg` type stacks.
var/cost = 1
/// A list of recipes buildable with this stack.
var/list/recipes = list()
var/singular_name
var/amount = 1
var/to_transfer = 0
@@ -52,15 +61,27 @@
/obj/item/stack/examine(mob/user)
. = ..()
if(in_range(user, src))
if(!in_range(user, src))
return
if(is_cyborg)
if(singular_name)
. += "There are [amount] [singular_name]\s in the stack."
. += "There is enough energy for [get_amount()] [singular_name]\s."
else
. += "There are [amount] [name]\s in the stack."
. +="<span class='notice'>Alt-click to take a custom amount.</span>"
. += "There is enough energy for [get_amount()]."
return
if(singular_name)
. += "There are [amount] [singular_name]\s in the stack."
else
. += "There are [amount] [name]\s in the stack."
. +="<span class='notice'>Alt-click to take a custom amount.</span>"
/obj/item/stack/proc/add(newamount)
amount += newamount
if(is_cyborg)
source.add_charge(newamount * cost)
else
amount += newamount
update_icon()
/obj/item/stack/attack_self(mob/user)
@@ -87,8 +108,10 @@
if(!recipes)
return
if(amount <= 0)
if(get_amount() <= 0)
user << browse(null, "window=stack")
if(is_cyborg)
to_chat(user, "<span class='warning'>You don't have enough energy to dispense more [name]!</span>")
return
user.set_machine(src) //for correct work of onclose
@@ -98,7 +121,7 @@
var/datum/stack_recipe_list/srl = recipe_list[recipes_sublist]
recipe_list = srl.recipes
var/t1 = "Amount Left: [amount]<br>"
var/t1 = "Amount Left: [get_amount()]<br>"
for(var/i in 1 to recipe_list.len)
var/E = recipe_list[i]
if(isnull(E))
@@ -114,7 +137,7 @@
if(istype(E, /datum/stack_recipe))
var/datum/stack_recipe/R = E
var/max_multiplier = round(amount / R.req_amount)
var/max_multiplier = round(get_amount() / R.req_amount)
var/title
var/can_build = 1
can_build = can_build && (max_multiplier > 0)
@@ -154,7 +177,7 @@
list_recipes(usr, text2num(href_list["sublist"]))
if(href_list["make"])
if(amount < 1)
if(amount < 0 && !is_cyborg)
qdel(src) //Never should happen
var/list/recipes_list = recipes
@@ -167,15 +190,15 @@
if(!multiplier || multiplier <= 0 || multiplier > 50) // Href exploit checks
multiplier = 1
if(amount < R.req_amount * multiplier)
if(R.req_amount * multiplier>1)
if(get_amount() < R.req_amount * multiplier)
if(R.req_amount * multiplier > 1)
to_chat(usr, "<span class='warning'>You haven't got enough [src] to build \the [R.req_amount * multiplier] [R.title]\s!</span>")
else
to_chat(usr, "<span class='warning'>You haven't got enough [src] to build \the [R.title]!</span>")
return FALSE
if(R.window_checks && !valid_window_location(usr.loc, usr.dir))
to_chat(usr, "<span class='warning'>The [R.title] won't fit here!</span>")
to_chat(usr, "<span class='warning'>\The [R.title] won't fit here!</span>")
return FALSE
if(R.one_per_turf && (locate(R.result_type) in usr.drop_location()))
@@ -201,7 +224,7 @@
if(!do_after(usr, R.time, target = usr))
return 0
if(amount < R.req_amount * multiplier)
if(get_amount() < R.req_amount * multiplier)
return
var/atom/O
@@ -211,6 +234,7 @@
O = new R.result_type(usr.drop_location())
O.setDir(usr.dir)
use(R.req_amount * multiplier)
updateUsrDialog()
R.post_build(src, O)
@@ -237,6 +261,8 @@
/obj/item/stack/use(used, check = TRUE)
if(check && zero_amount())
return FALSE
if(is_cyborg)
return source.use_charge(used * cost)
if(amount < used)
return FALSE
amount -= used
@@ -246,6 +272,8 @@
return TRUE
/obj/item/stack/proc/get_amount()
if(is_cyborg)
return round(source.energy / cost)
return amount
/obj/item/stack/proc/get_max_amount()
@@ -264,7 +292,7 @@
return F
/obj/item/stack/attack_hand(mob/user)
if(user.is_in_inactive_hand(src) && amount > 1)
if(user.is_in_inactive_hand(src) && get_amount() > 1)
change_stack(user, 1)
if(src && usr.machine == src)
spawn(0)
@@ -278,6 +306,8 @@
return
if(!in_range(src, user))
return
if(is_cyborg)
return
if(!ishuman(usr))
return
if(amount < 1)
@@ -311,11 +341,9 @@
// Returns TRUE if the stack amount is zero.
// Also qdels the stack gracefully if it is.
/obj/item/stack/proc/zero_amount()
if(is_cyborg)
return source.energy < cost
if(amount < 1)
if(isrobot(loc))
var/mob/living/silicon/robot/R = loc
if(locate(src) in R.module.modules)
R.module.modules -= src
if(ismob(loc))
var/mob/living/L = loc // At this stage, stack code is so horrible and atrocious, I wouldn't be all surprised ghosts can somehow have stacks. If this happens, then the world deserves to burn.
L.unEquip(src, TRUE)
@@ -331,7 +359,10 @@
if(QDELETED(S) || QDELETED(src) || S == src) //amusingly this can cause a stack to consume itself, let's not allow that.
return FALSE
var/transfer = get_amount()
transfer = min(transfer, S.max_amount - S.amount)
if(S.is_cyborg)
transfer = min(transfer, round((S.source.max_energy - S.source.energy) / S.cost))
else
transfer = min(transfer, S.max_amount - S.amount)
if(transfer <= 0)
return
if(pulledby)
@@ -339,6 +370,7 @@
S.copy_evidences(src)
S.add(transfer)
use(transfer)
return transfer
/obj/item/stack/proc/copy_evidences(obj/item/stack/from)
blood_DNA = from.blood_DNA
@@ -61,8 +61,13 @@
icon_state = "tile-wood"
origin_tech = "biotech=1"
turf_type = /turf/simulated/floor/wood
merge_type = /obj/item/stack/tile/wood
resistance_flags = FLAMMABLE
/obj/item/stack/tile/wood/cyborg
energy_type = /datum/robot_energy_storage/wood_tile
is_cyborg = TRUE
//Carpets
/obj/item/stack/tile/carpet
name = "carpet"
@@ -101,13 +106,17 @@
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 70)
resistance_flags = FIRE_PROOF
/obj/item/stack/tile/plasteel/cyborg
energy_type = /datum/robot_energy_storage/metal_tile
is_cyborg = TRUE
//Light
/obj/item/stack/tile/light
name = "light tiles"
gender = PLURAL
singular_name = "light floor tile"
desc = "A floor tile, made out off glass. Use a multitool on it to change its color."
icon_state = "tile_light blue"
desc = "A floor tile made of glass, with an integrated light. Use a multitool on it to change its color."
icon_state = "tile_white"
force = 3
throwforce = 5
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")