Conflicts:
	code/modules/mob/living/living.dm
This commit is contained in:
mwerezak
2015-05-22 19:38:04 -04:00
241 changed files with 3903 additions and 3373 deletions

View File

@@ -597,7 +597,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/thunderdome(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/destroyer(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/material/knife(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/grenade/smokebomb(M), slot_r_store)
@@ -620,10 +620,10 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/head/chefhat(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/rollingpin(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_s_store)
M.equip_to_slot_or_del(new /obj/item/weapon/material/kitchen/rollingpin(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/material/knife(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/material/knife(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/material/knife(M), slot_s_store)
if ("tournament janitor")
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(M), slot_w_uniform)
@@ -687,7 +687,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
W.registered_name = M.real_name
M.equip_to_slot_or_del(W, slot_wear_id)
var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
var/obj/item/weapon/material/twohanded/fireaxe/fire_axe = new(M)
M.equip_to_slot_or_del(fire_axe, slot_r_hand)
if("masked killer")
@@ -699,10 +699,10 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/plain/monocle(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/apron(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/weapon/material/knife(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/weapon/scalpel(M), slot_r_store)
var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
var/obj/item/weapon/material/twohanded/fireaxe/fire_axe = new(M)
M.equip_to_slot_or_del(fire_axe, slot_r_hand)
for(var/obj/item/carried_item in M.contents)

View File

@@ -1035,7 +1035,7 @@ var/global/list/gear_datums = list()
/datum/gear/ashtray
display_name = "ashtray, plastic"
path = /obj/item/ashtray/plastic
path = /obj/item/weapon/material/ashtray/plastic
sort_category = "misc"
cost = 1

View File

@@ -276,6 +276,7 @@ BLIND // can't see anything
set_light(0)
light_applied = 0
update_icon(user)
user.update_action_buttons()
/obj/item/clothing/head/update_icon(var/mob/user)

View File

@@ -30,6 +30,7 @@
if(activation_sound)
usr << activation_sound
usr << "You activate the optical matrix on the [src]."
user.update_action_buttons()
/obj/item/clothing/glasses/meson
name = "Optical Meson Scanner"
@@ -173,8 +174,8 @@
body_parts_covered &= ~EYES
icon_state = "[initial(icon_state)]up"
usr << "You push \the [src] up out of your face."
update_clothing_icon()
usr.update_action_buttons()
/obj/item/clothing/glasses/welding/superior
name = "superior welding goggles"

View File

@@ -48,7 +48,8 @@
flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
icon_state = "[initial(icon_state)]up"
usr << "You push the [src] up out of your face."
update_clothing_icon() //so our mob-overlays update
update_clothing_icon() //so our mob-overlays
usr.update_action_buttons()
/*

View File

@@ -33,6 +33,7 @@
if(icon_base) icon_state = "[icon_base]1"
user << "You enable the mag-pulse traction system."
user.update_inv_shoes() //so our mob-overlays update
user.update_action_buttons()
/obj/item/clothing/shoes/magboots/mob_can_equip(mob/user)
var/mob/living/carbon/human/H = user

View File

@@ -151,12 +151,12 @@
user << "You will have to put on the [src] before you can do that."
return
flags |= NOSLIP
magpulse = 1
canremove = 0 //kinda hard to take off magclaws when you are gripping them tightly.
user << "You dig your claws deeply into the flooring, bracing yourself."
user << "It would be hard to take off the [src] without relaxing your grip first."
user.update_action_buttons()
//In case they somehow come off while enabled.
/obj/item/clothing/shoes/magboots/vox/dropped(mob/user as mob)

View File

@@ -178,7 +178,7 @@ var/global/list/breach_burn_descriptors = list(
//Handles repairs (and also upgrades).
/obj/item/clothing/suit/space/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/stack/sheet/mineral/plastic) || istype(W,/obj/item/stack/sheet/metal))
if(istype(W,/obj/item/stack/material/plastic) || istype(W,/obj/item/stack/material/steel))
if(istype(src.loc,/mob/living))
user << "\red How do you intend to patch a hardsuit while someone is wearing it?"
@@ -188,13 +188,13 @@ var/global/list/breach_burn_descriptors = list(
user << "There is no surface damage on \the [src] to repair."
return
var/obj/item/stack/sheet/P = W
var/obj/item/stack/material/P = W
if(P.get_amount() < 3)
P.use(P.get_amount())
repair_breaches(BURN, ( istype(P,/obj/item/stack/sheet/mineral/plastic) ? P.get_amount() : (P.get_amount()*2) ), user)
repair_breaches(BURN, ( istype(P,/obj/item/stack/material/plastic) ? P.get_amount() : (P.get_amount()*2) ), user)
else
P.use(3)
repair_breaches(BURN, ( istype(P,/obj/item/stack/sheet/mineral/plastic) ? 3 : 5), user)
repair_breaches(BURN, ( istype(P,/obj/item/stack/material/plastic) ? 3 : 5), user)
return
else if(istype(W, /obj/item/weapon/weldingtool))

View File

@@ -212,7 +212,7 @@
interface_name = "death blossom launcher"
interface_desc = "An integrated microfactory that produces poisoned throwing stars from thin air and electricity."
var/fabrication_type = /obj/item/weapon/star/ninja
var/fabrication_type = /obj/item/weapon/material/star/ninja
var/fire_force = 30
var/fire_distance = 10

View File

@@ -707,7 +707,7 @@
take_hit((100/severity_class), "electrical pulse", 1)
/obj/item/weapon/rig/proc/shock(mob/user)
if (electrocute_mob(user, cell, src))
if (electrocute_mob(user, cell, src)) //electrocute_mob() handles removing charge from the cell, no need to do that here.
spark_system.start()
if(user.stunned)
return 1

View File

@@ -3,13 +3,11 @@
if(!istype(user,/mob/living)) return 0
if(electrified != 0)
if(cell && cell.charge >= 100)
cell.use(100)
if(shock(user, 100))
if(shock(user)) //Handles removing charge from the cell, as well. No need to do that here.
return
// Pass repair items on to the chestpiece.
if(chest && (istype(W,/obj/item/stack/sheet/mineral/plastic) || istype(W,/obj/item/stack/sheet/metal) || istype(W, /obj/item/weapon/weldingtool)))
if(chest && (istype(W,/obj/item/stack/material/plastic) || istype(W,/obj/item/stack/material/steel) || istype(W, /obj/item/weapon/weldingtool)))
return chest.attackby(W,user)
// Lock or unlock the access panel.
@@ -193,8 +191,6 @@
/obj/item/weapon/rig/attack_hand(var/mob/user)
if(electrified != 0)
if(cell && cell.charge >= 100)
cell.use(100)
if(shock(user, 100))
if(shock(user)) //Handles removing charge from the cell, as well. No need to do that here.
return
..()

View File

@@ -35,6 +35,7 @@
camera.replace_networks(camera_networks)
camera.c_tag = user.name
user << "\blue User scanned as [camera.c_tag]. Camera activated."
user.update_action_buttons()
return 1
..()

View File

@@ -10,7 +10,7 @@
item_state = "apron"
blood_overlay_type = "armor"
body_parts_covered = 0
allowed = list (/obj/item/weapon/reagent_containers/spray/plantbgone,/obj/item/device/analyzer/plant_analyzer,/obj/item/seeds,/obj/item/weapon/reagent_containers/glass/fertilizer,/obj/item/weapon/minihoe)
allowed = list (/obj/item/weapon/reagent_containers/spray/plantbgone,/obj/item/device/analyzer/plant_analyzer,/obj/item/seeds,/obj/item/weapon/reagent_containers/glass/fertilizer,/obj/item/weapon/material/minihoe)
sprite_sheets = list("Vox" = 'icons/mob/species/vox/suit.dmi')
//Captain
/obj/item/clothing/suit/captunic
@@ -51,14 +51,14 @@
//Chef
/obj/item/clothing/suit/chef
name = "Chef's apron"
name = "chef's apron"
desc = "An apron used by a high class chef."
icon_state = "chef"
item_state = "chef"
gas_transfer_coefficient = 0.90
permeability_coefficient = 0.50
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
allowed = list (/obj/item/weapon/kitchenknife,/obj/item/weapon/butch)
allowed = list (/obj/item/weapon/material/knife)
sprite_sheets = list("Vox" = 'icons/mob/species/vox/suit.dmi')
//Chef

View File

@@ -91,24 +91,42 @@
if(MALE) their = "his"
if(FEMALE) their = "her"
var/sound = "pulse"
var/sound_strength
var/sound = "heartbeat"
var/sound_strength = "cannot hear"
var/heartbeat = 0
if(M.species && M.species.has_organ["heart"])
var/obj/item/organ/heart/heart = M.internal_organs_by_name["heart"]
if(heart && !heart.robotic)
heartbeat = 1
if(M.stat == DEAD || (M.status_flags&FAKEDEATH))
sound_strength = "cannot hear"
sound = "anything"
else
sound_strength = "hear a weak"
switch(body_part)
if("chest")
if(M.oxyloss < 50)
sound_strength = "hear a healthy"
sound = "pulse and respiration"
sound_strength = "hear"
sound = "no heartbeat"
if(heartbeat)
var/obj/item/organ/heart/heart = M.internal_organs_by_name["heart"]
if(heart.is_bruised() || M.getOxyLoss() > 50)
sound = "[pick("odd noises in","weak")] heartbeat"
else
sound = "healthy heartbeat"
var/obj/item/organ/heart/L = M.internal_organs_by_name["lungs"]
if(!L || M.losebreath)
sound += " and no respiration"
else if(M.is_lung_ruptured() || M.getOxyLoss() > 50)
sound += " and [pick("wheezing","gurgling")] sounds"
else
sound += " and healthy respiration"
if("eyes","mouth")
sound_strength = "cannot hear"
sound = "anything"
else
sound_strength = "hear a weak"
if(heartbeat)
sound_strength = "hear a weak"
sound = "pulse"
user.visible_message("[user] places [src] against [M]'s [body_part] and listens attentively.", "You place [src] against [their] [body_part]. You [sound_strength] [sound].")
return

View File

@@ -72,11 +72,11 @@
/obj/item/clothing/accessory/storage/knifeharness/New()
..()
hold.max_storage_space = 4
hold.can_hold = list(/obj/item/weapon/hatchet/unathiknife,\
/obj/item/weapon/kitchen/utensil/knife,\
/obj/item/weapon/kitchen/utensil/pknife,\
/obj/item/weapon/kitchenknife,\
/obj/item/weapon/kitchenknife/ritual)
hold.can_hold = list(/obj/item/weapon/material/hatchet/unathiknife,\
/obj/item/weapon/material/kitchen/utensil/knife,\
/obj/item/weapon/material/kitchen/utensil/knife/plastic,\
/obj/item/weapon/material/knife,\
/obj/item/weapon/material/knife/ritual)
new /obj/item/weapon/hatchet/unathiknife(hold)
new /obj/item/weapon/hatchet/unathiknife(hold)
new /obj/item/weapon/material/hatchet/unathiknife(hold)
new /obj/item/weapon/material/hatchet/unathiknife(hold)

View File

@@ -2,23 +2,23 @@
description_info = "Made from metal sheets. You can build a grille by using it in your hand. \
Clicking on a floor without any tiles will reinforce the floor. You can make reinforced glass by combining rods and normal glass sheets."
/obj/item/stack/sheet/glass
/obj/item/stack/material/glass
description_info = "Use in your hand to build a window. Can be upgraded to reinforced glass by adding metal rods, which are made from metal sheets."
/obj/item/stack/sheet/glass/cyborg
/obj/item/stack/material/cyborg/glass
description_info = "Use in your hand to build a window. Can be upgraded to reinforced glass by adding metal rods, which are made from metal sheets.<br>\
As a synthetic, you can acquire more sheets of glass by recharging."
/obj/item/stack/sheet/glass/reinforced
/obj/item/stack/material/glass/reinforced
description_info = "Use in your hand to build a window. Reinforced glass is much stronger against damage."
/obj/item/stack/sheet/glass/reinforced/cyborg
/obj/item/stack/material/cyborg/glass/reinforced
description_info = "Use in your hand to build a window. Reinforced glass is much stronger against damage.<br>\
As a synthetic, you can gain more reinforced glass by recharging."
/obj/item/stack/sheet/metal/cyborg
/obj/item/stack/material/cyborg/steel
description_info = "Use in your hand to bring up the recipe menu. If you have enough sheets, click on something on the list to build it.<br>\
You can replenish your supply of metal as a synthetic by recharging."
/obj/item/stack/sheet
/obj/item/stack/material
description_info = "Use in your hand to bring up the recipe menu. If you have enough sheets, click on something on the list to build it."

View File

@@ -192,12 +192,12 @@
qdel(src)
return
else if(seed.chems)
if(istype(W,/obj/item/weapon/hatchet) && !isnull(seed.chems["woodpulp"]))
if(istype(W,/obj/item/weapon/material/hatchet) && !isnull(seed.chems["woodpulp"]))
user.show_message("<span class='notice'>You make planks out of \the [src]!</span>", 1)
for(var/i=0,i<2,i++)
var/obj/item/stack/sheet/wood/NG = new (user.loc)
var/obj/item/stack/material/wood/NG = new (user.loc)
NG.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
for (var/obj/item/stack/sheet/wood/G in user.loc)
for (var/obj/item/stack/material/wood/G in user.loc)
if(G==NG)
continue
if(G.amount>=G.max_amount)

View File

@@ -45,7 +45,7 @@
/obj/item/weapon/corncob/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/kitchenknife/ritual))
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/material/hatchet) || istype(W, /obj/item/weapon/material/kitchen/utensil/knife) || istype(W, /obj/item/weapon/material/knife) || istype(W, /obj/item/weapon/material/knife/ritual))
user << "<span class='notice'>You use [W] to fashion a pipe out of the corn cob!</span>"
new /obj/item/clothing/mask/smokable/pipe/cobpipe (user.loc)
qdel(src)

View File

@@ -475,7 +475,7 @@
else
user << "<span class='danger'>\The [src] already has seeds in it!</span>"
else if (istype(O, /obj/item/weapon/minihoe)) // The minihoe
else if (istype(O, /obj/item/weapon/material/minihoe)) // The minihoe
if(weedlevel > 0)
user.visible_message("<span class='danger'>[user] starts uprooting the weeds.</span>", "<span class='danger'>You remove the weeds from the [src].</span>")

View File

@@ -63,7 +63,7 @@
else
user << "\blue You insert [O] into [src]. Now it just needs some bees."
qdel(O)
else if(istype(O, /obj/item/weapon/minihoe))
else if(istype(O, /obj/item/weapon/material/minihoe))
if(health > 0)
user << "\red <b>You begin to dislodge the apiary from the tray, the bees don't like that.</b>"
angry_swarm(user)

View File

@@ -48,7 +48,7 @@
toxicity = 8
pest_kill_str = 7
/obj/item/weapon/minihoe // -- Numbers
/obj/item/weapon/material/minihoe // -- Numbers
name = "mini hoe"
desc = "It's used for removing weeds or scratching your back."
icon = 'icons/obj/weapons.dmi'

View File

@@ -204,69 +204,3 @@
user << browse(dat,"window=plant_analyzer")
return
/obj/item/weapon/minihoe // -- Numbers
name = "mini hoe"
desc = "It's used for removing weeds or scratching your back."
icon = 'icons/obj/weapons.dmi'
icon_state = "hoe"
item_state = "hoe"
flags = CONDUCT | NOBLUDGEON
force = 5.0
throwforce = 7.0
w_class = 2.0
matter = list(DEFAULT_WALL_MATERIAL = 50)
attack_verb = list("slashed", "sliced", "cut", "clawed")
//Hatchets and things to kill kudzu
/obj/item/weapon/hatchet
name = "hatchet"
desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood."
icon = 'icons/obj/weapons.dmi'
icon_state = "hatchet"
flags = CONDUCT
force = 12.0
w_class = 2
throwforce = 15.0
throw_speed = 4
throw_range = 4
sharp = 1
edge = 1
matter = list(DEFAULT_WALL_MATERIAL = 15000)
origin_tech = "materials=2;combat=1"
attack_verb = list("chopped", "torn", "cut")
/obj/item/weapon/hatchet/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return ..()
//If it's a hatchet it goes here. I guess
/obj/item/weapon/hatchet/unathiknife
name = "duelling knife"
desc = "A length of leather-bound wood studded with razor-sharp teeth. How crude."
icon = 'icons/obj/weapons.dmi'
icon_state = "unathiknife"
attack_verb = list("ripped", "torn", "cut")
/obj/item/weapon/hatchet/tacknife
name = "tactical knife"
desc = "You'd be killing loads of people if this was Medal of Valor: Heroes of Nyx."
icon = 'icons/obj/weapons.dmi'
icon_state = "tacknife"
item_state = "knife"
attack_verb = list("stabbed", "chopped", "cut")
/obj/item/weapon/scythe
icon_state = "scythe0"
name = "scythe"
desc = "A sharp and curved blade on a long fibremetal handle, this tool makes it easy to reap what you sow."
force = 13.0
throwforce = 5.0
throw_speed = 1
throw_range = 3
w_class = 4.0
flags = NOSHIELD
slot_flags = SLOT_BACK
origin_tech = "materials=2;combat=2"
attack_verb = list("chopped", "sliced", "cut", "reaped")

View File

@@ -226,7 +226,7 @@
return
scanner.computer.inventory.Add(src)
user << "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'"
else if(istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/wirecutters))
else if(istype(W, /obj/item/weapon/material/knife) || istype(W, /obj/item/weapon/wirecutters))
if(carved) return
user << "<span class='notice'>You begin to carve out [title].</span>"
if(do_after(user, 30))

View File

@@ -0,0 +1,127 @@
/material/proc/get_recipes()
if(!recipes)
generate_recipes()
return recipes
/material/proc/generate_recipes()
recipes = list()
// If is_brittle() returns true, these are only good for a single strike.
recipes += new/datum/stack_recipe("[display_name] baseball bat", /obj/item/weapon/material/twohanded/baseballbat, 10, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]")
recipes += new/datum/stack_recipe("[display_name] ashtray", /obj/item/weapon/material/ashtray, 2, one_per_turf = 1, on_floor = 1, supplied_material = "[name]")
recipes += new/datum/stack_recipe("[display_name] spoon", /obj/item/weapon/material/kitchen/utensil/spoon/plastic, 1, on_floor = 1, supplied_material = "[name]")
if(integrity>=100)
recipes += new/datum/stack_recipe("[display_name] door", /obj/structure/simple_door, 10, one_per_turf = 1, on_floor = 1, supplied_material = "[name]")
recipes += new/datum/stack_recipe("[display_name] barricade", /obj/structure/barricade, 5, time = 50, one_per_turf = 1, on_floor = 1, supplied_material = "[name]")
recipes += new/datum/stack_recipe("[display_name] stool", /obj/item/weapon/stool, one_per_turf = 1, on_floor = 1, supplied_material = "[name]")
recipes += new/datum/stack_recipe("[display_name] chair", /obj/structure/bed/chair, one_per_turf = 1, on_floor = 1, supplied_material = "[name]")
recipes += new/datum/stack_recipe("[display_name] bed", /obj/structure/bed, 2, one_per_turf = 1, on_floor = 1, supplied_material = "[name]")
if(hardness>50)
recipes += new/datum/stack_recipe("[display_name] fork", /obj/item/weapon/material/kitchen/utensil/fork/plastic, 1, on_floor = 1, supplied_material = "[name]")
recipes += new/datum/stack_recipe("[display_name] knife", /obj/item/weapon/material/kitchen/utensil/knife/plastic, 1, on_floor = 1, supplied_material = "[name]")
recipes += new/datum/stack_recipe("[display_name] blade", /obj/item/weapon/material/butterflyblade, 6, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]")
/material/steel/generate_recipes()
..()
recipes += new/datum/stack_recipe_list("office chairs",list( \
new/datum/stack_recipe("dark office chair", /obj/structure/bed/chair/office/dark, 5, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("light office chair", /obj/structure/bed/chair/office/light, 5, one_per_turf = 1, on_floor = 1) \
), 5)
recipes += new/datum/stack_recipe_list("comfy chairs", list( \
new/datum/stack_recipe("beige comfy chair", /obj/structure/bed/chair/comfy/beige, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("black comfy chair", /obj/structure/bed/chair/comfy/black, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("brown comfy chair", /obj/structure/bed/chair/comfy/brown, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("lime comfy chair", /obj/structure/bed/chair/comfy/lime, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("teal comfy chair", /obj/structure/bed/chair/comfy/teal, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("red comfy chair", /obj/structure/bed/chair/comfy/red, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("blue comfy chair", /obj/structure/bed/chair/comfy/blue, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("purple comfy chair", /obj/structure/bed/chair/comfy/purp, 2, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("green comfy chair", /obj/structure/bed/chair/comfy/green, 2, one_per_turf = 1, on_floor = 1), \
), 2)
recipes += new/datum/stack_recipe("table frame", /obj/structure/table, 1, time = 10, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("rack", /obj/structure/table/rack, 1, time = 5, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("closet", /obj/structure/closet, 2, time = 15, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("canister", /obj/machinery/portable_atmospherics/canister, 10, time = 15, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("cannon frame", /obj/item/weapon/cannonframe, 10, time = 15, one_per_turf = 0, on_floor = 0)
recipes += new/datum/stack_recipe("floor tile", /obj/item/stack/tile/plasteel, 1, 4, 20)
recipes += new/datum/stack_recipe("metal rod", /obj/item/stack/rods, 1, 2, 60)
recipes += new/datum/stack_recipe("computer frame", /obj/structure/computerframe, 5, time = 25, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("wall girders", /obj/structure/girder, 2, time = 50, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("machine frame", /obj/machinery/constructable_frame/machine_frame, 5, time = 25, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 25, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe_list("airlock assemblies", list( \
new/datum/stack_recipe("standard airlock assembly", /obj/structure/door_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("command airlock assembly", /obj/structure/door_assembly/door_assembly_com, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("security airlock assembly", /obj/structure/door_assembly/door_assembly_sec, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("engineering airlock assembly", /obj/structure/door_assembly/door_assembly_eng, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("mining airlock assembly", /obj/structure/door_assembly/door_assembly_min, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("atmospherics airlock assembly", /obj/structure/door_assembly/door_assembly_atmo, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("research airlock assembly", /obj/structure/door_assembly/door_assembly_research, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("medical airlock assembly", /obj/structure/door_assembly/door_assembly_med, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("maintenance airlock assembly", /obj/structure/door_assembly/door_assembly_mai, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("external airlock assembly", /obj/structure/door_assembly/door_assembly_ext, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("freezer airlock assembly", /obj/structure/door_assembly/door_assembly_fre, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("airtight hatch assembly", /obj/structure/door_assembly/door_assembly_hatch, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("maintenance hatch assembly", /obj/structure/door_assembly/door_assembly_mhatch, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("high security airlock assembly", /obj/structure/door_assembly/door_assembly_highsecurity, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("emergency shutter", /obj/structure/firedoor_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("multi-tile airlock assembly", /obj/structure/door_assembly/multi_tile, 4, time = 50, one_per_turf = 1, on_floor = 1), \
), 4)
recipes += new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade)
recipes += new/datum/stack_recipe("light fixture frame", /obj/item/frame/light, 2)
recipes += new/datum/stack_recipe("small light fixture frame", /obj/item/frame/light/small, 1)
recipes += new/datum/stack_recipe("apc frame", /obj/item/apc_frame, 2)
recipes += new/datum/stack_recipe("air alarm frame", /obj/item/frame/air_alarm, 2)
recipes += new/datum/stack_recipe("fire alarm frame", /obj/item/frame/fire_alarm, 2)
/material/plasteel/generate_recipes()
..()
recipes += new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = 1)
recipes += new/datum/stack_recipe("Metal crate", /obj/structure/closet/crate, 10, time = 50, one_per_turf = 1)
recipes += new/datum/stack_recipe("RUST fuel assembly port frame", /obj/item/frame/rust/assembly, 12, time = 50, one_per_turf = 1)
recipes += new/datum/stack_recipe("RUST fuel compressor frame", /obj/item/frame/rust, 12, time = 50, one_per_turf = 1)
recipes += new/datum/stack_recipe("knife grip", /obj/item/weapon/material/butterflyhandle, 4, time = 20, one_per_turf = 0, on_floor = 1)
/material/sandstone/generate_recipes()
..()
recipes += new/datum/stack_recipe("pile of dirt", /obj/machinery/portable_atmospherics/hydroponics/soil, 3, time = 10, one_per_turf = 1, on_floor = 1)
/material/plastic/generate_recipes()
..()
recipes += new/datum/stack_recipe("plastic crate", /obj/structure/closet/crate/plastic, 10, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("plastic bag", /obj/item/weapon/storage/bag/plasticbag, 3, on_floor = 1)
recipes += new/datum/stack_recipe("blood pack", /obj/item/weapon/reagent_containers/blood/empty, 4, on_floor = 0)
recipes += new/datum/stack_recipe("reagent dispenser cartridge (large)", /obj/item/weapon/reagent_containers/chem_disp_cartridge, 5, on_floor=0) // 500u
recipes += new/datum/stack_recipe("reagent dispenser cartridge (med)", /obj/item/weapon/reagent_containers/chem_disp_cartridge/medium, 3, on_floor=0) // 250u
recipes += new/datum/stack_recipe("reagent dispenser cartridge (small)", /obj/item/weapon/reagent_containers/chem_disp_cartridge/small, 1, on_floor=0) // 100u
/material/wood/generate_recipes()
..()
recipes += new/datum/stack_recipe("wooden sandals", /obj/item/clothing/shoes/sandal, 1)
recipes += new/datum/stack_recipe("wood floor tile", /obj/item/stack/tile/wood, 1, 4, 20)
recipes += new/datum/stack_recipe("wooden chair", /obj/structure/bed/chair/wood, 3, time = 10, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("crossbow frame", /obj/item/weapon/crossbowframe, 5, time = 25, one_per_turf = 0, on_floor = 0)
recipes += new/datum/stack_recipe("coffin", /obj/structure/closet/coffin, 5, time = 15, one_per_turf = 1, on_floor = 1)
/material/cardboard/generate_recipes()
..()
recipes += new/datum/stack_recipe("box", /obj/item/weapon/storage/box)
recipes += new/datum/stack_recipe("donut box", /obj/item/weapon/storage/box/donut/empty)
recipes += new/datum/stack_recipe("egg box", /obj/item/weapon/storage/fancy/egg_box)
recipes += new/datum/stack_recipe("light tubes box", /obj/item/weapon/storage/box/lights/tubes)
recipes += new/datum/stack_recipe("light bulbs box", /obj/item/weapon/storage/box/lights/bulbs)
recipes += new/datum/stack_recipe("mouse traps box", /obj/item/weapon/storage/box/mousetraps)
recipes += new/datum/stack_recipe("cardborg suit", /obj/item/clothing/suit/cardborg, 3)
recipes += new/datum/stack_recipe("cardborg helmet", /obj/item/clothing/head/cardborg)
recipes += new/datum/stack_recipe("pizza box", /obj/item/pizzabox)
recipes += new/datum/stack_recipe_list("folders",list( \
new/datum/stack_recipe("blue folder", /obj/item/weapon/folder/blue), \
new/datum/stack_recipe("grey folder", /obj/item/weapon/folder), \
new/datum/stack_recipe("red folder", /obj/item/weapon/folder/red), \
new/datum/stack_recipe("white folder", /obj/item/weapon/folder/white), \
new/datum/stack_recipe("yellow folder", /obj/item/weapon/folder/yellow), \
), 3)

View File

@@ -0,0 +1,151 @@
// Stacked resources. They use a material datum for a lot of inherited values.
/obj/item/stack/material
force = 5.0
throwforce = 5
w_class = 3.0
throw_speed = 3
throw_range = 3
var/default_type = DEFAULT_WALL_MATERIAL
var/material/material
var/perunit
var/apply_colour //temp pending icon rewrite
/obj/item/stack/material/New()
..()
pixel_x = rand(0,4)-4
pixel_y = rand(0,4)-4
if(!default_type)
default_type = DEFAULT_WALL_MATERIAL
material = get_material_by_name("[default_type]")
if(!material)
qdel(src)
return 0
// Update from material datum.
name = "[material.display_name] sheets"
desc = "A stack of sheets of [material.display_name]."
recipes = material.get_recipes()
stacktype = material.stack_type
origin_tech = material.stack_origin_tech
perunit = material.stack_per_sheet
if(apply_colour)
color = material.icon_colour
if(material.conductive)
flags |= CONDUCT
if(!islist(matter))
matter = list()
if(material.composite_material)
for(var/material_string in material.composite_material)
matter[material_string] = material.composite_material[material_string]
else
matter[material.name] = material.stack_per_sheet
return 1
obj/item/stack/material/iron
name = "iron"
icon_state = "sheet-silver"
default_type = "iron"
apply_colour = 1
/obj/item/stack/material/sandstone
name = "sandstone brick"
singular_name = "sandstone brick"
icon_state = "sheet-sandstone"
default_type = "sandstone"
/obj/item/stack/material/diamond
name = "diamond"
icon_state = "sheet-diamond"
default_type = "diamond"
/obj/item/stack/material/uranium
name = "uranium"
icon_state = "sheet-uranium"
default_type = "uranium"
/obj/item/stack/material/phoron
name = "solid phoron"
icon_state = "sheet-phoron"
default_type = "phoron"
/obj/item/stack/material/plastic
name = "Plastic"
icon_state = "sheet-plastic"
default_type = "plastic"
/obj/item/stack/material/gold
name = "gold"
icon_state = "sheet-gold"
default_type = "gold"
/obj/item/stack/material/silver
name = "silver"
icon_state = "sheet-silver"
default_type = "silver"
//Valuable resource, cargo can sell it.
/obj/item/stack/material/platinum
name = "platinum"
icon_state = "sheet-adamantine"
default_type = "platinum"
//Extremely valuable to Research.
/obj/item/stack/material/mhydrogen
name = "metallic hydrogen"
icon_state = "sheet-mythril"
default_type = "mhydrogen"
//Fuel for MRSPACMAN generator.
/obj/item/stack/material/tritium
name = "tritium"
icon_state = "sheet-silver"
default_type = "tritium"
apply_colour = 1
/obj/item/stack/material/osmium
name = "osmium"
icon_state = "sheet-silver"
default_type = "osmium"
apply_colour = 1
/obj/item/stack/material/steel
name = DEFAULT_WALL_MATERIAL
singular_name = "steel sheet"
icon_state = "sheet-metal"
default_type = DEFAULT_WALL_MATERIAL
/obj/item/stack/material/plasteel
name = "plasteel"
singular_name = "plasteel sheet"
icon_state = "sheet-plasteel"
item_state = "sheet-metal"
default_type = "plasteel"
/obj/item/stack/material/wood
name = "wooden plank"
singular_name = "wood plank"
icon_state = "sheet-wood"
default_type = "wood"
/obj/item/stack/material/cloth
name = "cloth"
singular_name = "cloth roll"
icon_state = "sheet-cloth"
default_type = "cloth"
/obj/item/stack/material/cardboard
name = "cardboard"
singular_name = "cardboard sheet"
icon_state = "sheet-card"
default_type = "cardboard"
/obj/item/stack/material/leather
name = "leather"
desc = "The by-product of mob grinding."
singular_name = "leather piece"
icon_state = "sheet-leather"
default_type = "leather"

View File

@@ -0,0 +1,32 @@
// These objects are used by cyborgs to get around a lot of the limitations on stacks
// and the weird bugs that crop up when expecting borg module code to behave sanely.
/obj/item/stack/material/cyborg
uses_charge = 1
charge_costs = list(1000)
gender = NEUTER
matter = null // Don't shove it in the autholathe.
/obj/item/stack/material/cyborg/New()
if(..())
name = "[material.display_name] synthesiser"
desc = "A device that synthesises [material.display_name]."
matter = null
/obj/item/stack/material/cyborg/plastic
default_type = "plastic"
/obj/item/stack/material/cyborg/steel
default_type = "steel"
/obj/item/stack/material/cyborg/plasteel
default_type = "plasteel"
/obj/item/stack/material/cyborg/wood
default_type = "wood"
/obj/item/stack/material/cyborg/glass
default_type = "glass"
/obj/item/stack/material/cyborg/glass/reinforced
default_type = "reinforced glass"
charge_costs = list(500, 1000)

View File

@@ -1,5 +1,33 @@
/*
MATERIAL DATUMS
This data is used by various parts of the game for basic physical properties and behaviors
of the metals/materials used for constructing many objects. Each var is commented and should be pretty
self-explanatory but the various object types may have their own documentation. ~Z
PATHS THAT USE DATUMS
/turf/simulated/wall
/obj/item/weapon/material
/obj/structure/barricade
/obj/item/stack/material
/obj/structure/table
VALID ICONS
WALLS
stone
metal
solid
cult
DOORS
stone
metal
resin
wood
*/
// Assoc list containing all material datums indexed by name.
var/list/name_to_material
// Builds the datum list above.
/proc/populate_material_list(force_remake=0)
if(name_to_material && !force_remake) return // Already set up!
name_to_material = list()
@@ -10,42 +38,58 @@ var/list/name_to_material
name_to_material[lowertext(new_mineral.name)] = new_mineral
return 1
// Safety proc to make sure the material list exists before trying to grab from it.
/proc/get_material_by_name(name)
if(!name_to_material)
populate_material_list()
return name_to_material[name]
/*
Valid sprite masks:
stone
metal
solid
cult
*/
// Material definition and procs follow.
/material
var/name // Tag for use in overlay generation/list population .
var/display_name
var/flags = 0
var/icon_base = "metal"
var/icon_colour
var/icon_reinf = "reinf_metal"
var/stack_type
var/cut_delay = 0
var/radioactivity
var/ignition_point
var/melting_point = 1800 // K, walls will take damage if they're next to a fire hotter than this
var/integrity = 150 // Damage before wall falls apart, essentially.
var/hardness = 60 // Used to determine if a hulk can punch through this wall.
var/rotting_touch_message = "crumbles under your touch"
var/opacity = 1
var/explosion_resistance = 5
var/shard_type = SHARD_SHRAPNEL
var/shard_icon
var/shard_can_repair = 1
var/tableslam_noise = 'sound/weapons/tablehit1.ogg'
var/name // Unique name for use in indexing the list.
var/display_name // Prettier name for display.
var/flags = 0 // Various status modifiers.
// Shards/tables/structures
var/shard_type = SHARD_SHRAPNEL // Path of debris object.
var/shard_icon // Related to above.
var/shard_can_repair = 1 // Can shards be turned into sheets with a welder?
var/list/recipes // Holder for all recipes usable with a sheet of this material.
var/destruction_desc = "breaks apart" // Fancy string for barricades/tables/objects exploding.
// Icons
var/icon_colour // Colour applied to products of this material.
var/icon_base = "metal" // Wall and table base icon tag. See header.
var/door_icon_base = "metal" // Door base icon tag. See header.
var/icon_reinf = "reinf_metal" // Overlay used
var/stack_origin_tech = "materials=1" // Research level for stacks.
var/stack_per_sheet = 2000 // perunit value for stacks.
// Attributes
var/cut_delay = 0 // Delay in ticks when cutting through this wall.
var/radioactivity // Radiation var. Used in wall and object processing to irradiate surroundings.
var/ignition_point // Point at which the material catches on fire.
var/melting_point = 1800 // K, walls will take damage if they're next to a fire hotter than this
var/integrity = 150 // General-use HP value for products.
var/opacity = 1 // Is the material transparent? 0.5< makes transparent walls/doors.
var/explosion_resistance = 5 // Only used by walls currently.
var/conductive = 1 // Objects with this var add CONDUCTS to flags on spawn.
var/list/composite_material // If set, object matter var will be a list containing these values.
// Damage values.
var/hardness = 60 // Prob of wall destruction by hulk, used for edge damage in weapons.
var/weight = 20 // Determines blunt damage/throwforce for weapons.
// Noise when someone is faceplanted onto a table made of this material.
var/tableslam_noise = 'sound/weapons/tablehit1.ogg'
// Noise made when a simple door made of this material opens or closes.
var/dooropen_noise = 'sound/effects/stonedoor_openclose.ogg'
// Path to resulting stacktype. Todo remove need for this.
var/stack_type = /obj/item/stack/material/steel
// Wallrot crumble message.
var/rotting_touch_message = "crumbles under your touch"
// Make sure we have a display name and shard icon even if they aren't explicitly set.
/material/New()
..()
if(!display_name)
@@ -53,77 +97,126 @@ var/list/name_to_material
if(!shard_icon)
shard_icon = shard_type
// Weapons handle applying a divisor for this value locally.
/material/proc/get_blunt_damage()
return weight //todo
// As above.
/material/proc/get_edge_damage()
return hardness //todo
// Snowflakey, only checked for alien doors at the moment.
/material/proc/can_open_material_door(var/mob/living/user)
return 1
// Currently used for weapons and objects made of uranium to irradiate things.
/material/proc/products_need_process()
return (radioactivity>0) //todo
// Used by walls when qdel()ing to avoid neighbor merging.
/material/placeholder
name = "placeholder"
// Places a girder object when a wall is dismantled, also applies reinforced material.
/material/proc/place_dismantled_girder(var/turf/target, var/material/reinf_material)
var/obj/structure/girder/G = new(target)
if(reinf_material)
G.reinf_material = reinf_material
G.reinforce_girder()
// General wall debris product placement.
// Not particularly necessary aside from snowflakey cult girders.
/material/proc/place_dismantled_product(var/turf/target,var/is_devastated)
for(var/x=1;x<(is_devastated?2:3);x++)
place_sheet(target)
// Debris product. Used ALL THE TIME.
/material/proc/place_sheet(var/turf/target)
if(stack_type)
return new stack_type(target)
// As above.
/material/proc/place_shard(var/turf/target)
if(shard_type)
return new /obj/item/weapon/shard(target, src)
return new /obj/item/weapon/material/shard(target, src.name)
// Used by walls and weapons to determine if they break or not.
/material/proc/is_brittle()
return !!(flags & MATERIAL_BRITTLE)
// Datum definitions follow.
/material/uranium
name = "uranium"
stack_type = /obj/item/stack/sheet/mineral/uranium
stack_type = /obj/item/stack/material/uranium
radioactivity = 12
icon_base = "stone"
icon_reinf = "reinf_stone"
icon_colour = "#007A00"
weight = 22
stack_origin_tech = "materials=5"
door_icon_base = "stone"
/material/diamond
name = "diamond"
stack_type = /obj/item/stack/sheet/mineral/diamond
stack_type = /obj/item/stack/material/diamond
flags = MATERIAL_UNMELTABLE
cut_delay = 60
icon_colour = "#00FFE1"
opacity = 0.4
shard_type = SHARD_SHARD
tableslam_noise = 'sound/effects/Glasshit.ogg'
hardness = 100
stack_origin_tech = "materials=6"
stack_per_sheet = 3750
/material/gold
name = "gold"
stack_type = /obj/item/stack/sheet/mineral/gold
stack_type = /obj/item/stack/material/gold
icon_colour = "#EDD12F"
weight = 24
hardness = 40
stack_origin_tech = "materials=4"
/material/silver
name = "silver"
stack_type = /obj/item/stack/sheet/mineral/silver
stack_type = /obj/item/stack/material/silver
icon_colour = "#D1E6E3"
weight = 22
hardness = 50
stack_origin_tech = "materials=3"
/material/phoron
name = "phoron"
stack_type = /obj/item/stack/sheet/mineral/phoron
ignition_point = 300
stack_type = /obj/item/stack/material/phoron
ignition_point = 100
icon_base = "stone"
icon_colour = "#FC2BC5"
shard_type = SHARD_SHARD
hardness = 30
stack_origin_tech = "phorontech=2;materials=2"
door_icon_base = "stone"
/material/sandstone
/material/stone
name = "sandstone"
stack_type = /obj/item/stack/sheet/mineral/sandstone
stack_type = /obj/item/stack/material/sandstone
icon_base = "stone"
icon_reinf = "reinf_stone"
icon_colour = "#D9C179"
shard_type = SHARD_STONE_PIECE
weight = 22
hardness = 55
door_icon_base = "stone"
/material/stone/marble
name = "marble"
icon_colour = "#AAAAAA"
weight = 26
hardness = 100
integrity = 201 //hack to stop kitchen benches being flippable, todo: refactor into weight system
/material/steel
name = DEFAULT_WALL_MATERIAL
stack_type = /obj/item/stack/sheet/metal
stack_type = /obj/item/stack/material/steel
icon_base = "solid"
icon_reinf = "reinf_over"
icon_colour = "#666666"
@@ -136,74 +229,119 @@ var/list/name_to_material
/material/plasteel
name = "plasteel"
stack_type = /obj/item/stack/sheet/plasteel
stack_type = /obj/item/stack/material/plasteel
integrity = 800
melting_point = 6000
icon_base = "solid"
icon_reinf = "reinf_over"
icon_colour = "#777777"
explosion_resistance = 25
hardness = 80
weight = 23
stack_origin_tech = "materials=2"
composite_material = list() //todo
/material/glass
name = "glass"
stack_type = /obj/item/stack/sheet/glass
stack_type = /obj/item/stack/material/glass
flags = MATERIAL_BRITTLE
icon_colour = "#00E1FF"
opacity = 0.3
integrity = 100
shard_type = SHARD_SHARD
tableslam_noise = 'sound/effects/Glasshit.ogg'
hardness = 30
weight = 15
door_icon_base = "stone"
destruction_desc = "shatters"
/material/glass/phoron
name = "phoron glass"
stack_type = /obj/item/stack/sheet/glass/phoronglass
stack_type = /obj/item/stack/material/glass/phoronglass
flags = MATERIAL_BRITTLE
ignition_point = 300
integrity = 200 // idk why but phoron windows are strong, so.
icon_colour = "#FC2BC5"
stack_origin_tech = "materials=3;phorontech=2"
/material/glass/phoron/reinforced
name = "reinforced phoron glass"
stack_type = /obj/item/stack/material/glass/phoronrglass
stack_origin_tech = "materials=4;phorontech=2"
composite_material = list() //todo
/material/glass/reinforced
name = "reinforced glass"
stack_type = /obj/item/stack/material/glass/reinforced
flags = MATERIAL_BRITTLE
icon_colour = "#00E1FF"
opacity = 0.3
integrity = 100
shard_type = SHARD_SHARD
tableslam_noise = 'sound/effects/Glasshit.ogg'
hardness = 40
weight = 30
stack_origin_tech = "materials=2"
composite_material = list() //todo
/material/plastic
name = "plastic"
stack_type = /obj/item/stack/sheet/mineral/plastic
stack_type = /obj/item/stack/material/plastic
flags = MATERIAL_BRITTLE
icon_base = "solid"
icon_reinf = "reinf_over"
icon_colour = "#CCCCCC"
hardness = 10
weight = 12
stack_origin_tech = "materials=3"
/material/osmium
name = "osmium"
stack_type = /obj/item/stack/sheet/mineral/osmium
stack_type = /obj/item/stack/material/osmium
icon_colour = "#9999FF"
stack_origin_tech = "materials=5"
/material/tritium
name = "tritium"
stack_type = /obj/item/stack/sheet/mineral/tritium
stack_type = /obj/item/stack/material/tritium
icon_colour = "#777777"
stack_origin_tech = "materials=5"
/material/mhydrogen
name = "mhydrogen"
stack_type = /obj/item/stack/sheet/mineral/mhydrogen
stack_type = /obj/item/stack/material/mhydrogen
icon_colour = "#E6C5DE"
stack_origin_tech = "materials=6;powerstorage=5;magnets=5"
/material/platinum
name = "platinum"
stack_type = /obj/item/stack/sheet/mineral/platinum
stack_type = /obj/item/stack/material/platinum
icon_colour = "#9999FF"
weight = 27
stack_origin_tech = "materials=2"
/material/iron
name = "iron"
stack_type = /obj/item/stack/sheet/mineral/iron
stack_type = /obj/item/stack/material/iron
icon_colour = "#5C5454"
weight = 22
stack_per_sheet = 3750
/material/wood
name = "wood"
stack_type = /obj/item/stack/sheet/wood
stack_type = /obj/item/stack/material/wood
icon_colour = "#824B28"
integrity = 25
icon_base = "solid"
explosion_resistance = 2
shard_type = SHARD_SPLINTER
shard_can_repair = 0 // you can't weld splinters back into planks
hardness = 15
weight = 18
stack_origin_tech = "materials=1;biotech=1"
dooropen_noise = 'sound/effects/doorcreaky.ogg'
door_icon_base = "wood"
destruction_desc = "splinters"
/material/wood/holographic
name = "holographic wood"
@@ -211,6 +349,24 @@ var/list/name_to_material
stack_type = null
shard_type = SHARD_NONE
/material/cardboard
name = "cardboard"
stack_type = /obj/item/stack/material/cardboard
flags = MATERIAL_BRITTLE
icon_base = "solid"
icon_reinf = "reinf_over"
icon_colour = "#AAAAAA"
hardness = 1
weight = 1
stack_origin_tech = "materials=1"
door_icon_base = "wood"
destruction_desc = "crumples"
/material/cloth //todo
name = "cloth"
stack_origin_tech = "materials=2"
door_icon_base = "wood"
/material/cult
name = "cult"
display_name = "disturbing stone"
@@ -231,3 +387,25 @@ var/list/name_to_material
/material/cult/reinf/place_dismantled_product(var/turf/target)
new /obj/effect/decal/remains/human(target)
/material/resin
name = "resin"
icon_colour = "#E85DD8"
dooropen_noise = 'sound/effects/attackblob.ogg'
door_icon_base = "resin"
/material/resin/can_open_material_door(var/mob/living/user)
var/mob/living/carbon/M = user
if(istype(M) && locate(/obj/item/organ/xenos/hivenode) in M.internal_organs)
return 1
return 0
/material/leather //todo
name = "leather"
icon_colour = "#5C4831"
stack_origin_tech = "materials=2"
/material/carpet
name = "carpet"
display_name = "padding"
icon_colour = "#A83C1B"

View File

@@ -109,7 +109,7 @@
if(91)
new/obj/item/device/soulstone(src)
if(92)
new/obj/item/weapon/katana(src)
new/obj/item/weapon/material/sword/katana(src)
if(93)
new/obj/item/weapon/dnainjector/xraymut(src) // Probably the least OP
if(94) // Why the hell not

View File

@@ -16,7 +16,7 @@
"hematite" = 2
)
product_mod = 0.3
product = /obj/item/stack/sheet/plasteel
product = /obj/item/stack/material/plasteel
/datum/alloy/steel
metaltag = DEFAULT_WALL_MATERIAL
@@ -24,4 +24,4 @@
"coal" = 1,
"hematite" = 1
)
product = /obj/item/stack/sheet/metal
product = /obj/item/stack/material/steel

View File

@@ -53,7 +53,7 @@
if(href_list["release_stack"])
if(machine.stack_storage[href_list["release_stack"]] > 0)
var/stacktype = machine.stack_paths[href_list["release_stack"]]
var/obj/item/stack/sheet/S = new stacktype (get_turf(machine.output))
var/obj/item/stack/material/S = new stacktype (get_turf(machine.output))
S.amount = machine.stack_storage[href_list["release_stack"]]
machine.stack_storage[href_list["release_stack"]] = 0
@@ -81,18 +81,18 @@
/obj/machinery/mineral/stacking_machine/New()
..()
for(var/stacktype in typesof(/obj/item/stack/sheet/mineral)-/obj/item/stack/sheet/mineral)
for(var/stacktype in typesof(/obj/item/stack/material)-/obj/item/stack/material)
var/obj/item/stack/S = new stacktype(src)
stack_storage[S.name] = 0
stack_paths[S.name] = stacktype
qdel(S)
stack_storage["glass"] = 0
stack_paths["glass"] = /obj/item/stack/sheet/glass
stack_paths["glass"] = /obj/item/stack/material/glass
stack_storage[DEFAULT_WALL_MATERIAL] = 0
stack_paths[DEFAULT_WALL_MATERIAL] = /obj/item/stack/sheet/metal
stack_paths[DEFAULT_WALL_MATERIAL] = /obj/item/stack/material/steel
stack_storage["plasteel"] = 0
stack_paths["plasteel"] = /obj/item/stack/sheet/plasteel
stack_paths["plasteel"] = /obj/item/stack/material/plasteel
spawn( 5 )
for (var/dir in cardinal)
@@ -122,7 +122,7 @@
for(var/sheet in stack_storage)
if(stack_storage[sheet] >= stack_amt)
var/stacktype = stack_paths[sheet]
var/obj/item/stack/sheet/S = new stacktype (get_turf(output))
var/obj/item/stack/material/S = new stacktype (get_turf(output))
S.amount = stack_amt
stack_storage[sheet] -= stack_amt

View File

@@ -346,25 +346,25 @@
R.amount = rand(1,5)
if(3)
var/obj/item/stack/sheet/metal/R = new(src)
var/obj/item/stack/material/steel/R = new(src)
R.amount = rand(5,25)
if(4)
var/obj/item/stack/sheet/plasteel/R = new(src)
var/obj/item/stack/material/plasteel/R = new(src)
R.amount = rand(5,25)
if(5)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard(src)
new /obj/item/weapon/material/shard(src)
if(6)
var/quantity = rand(1,3)
for(var/i=0, i<quantity, i++)
new /obj/item/weapon/shard/phoron(src)
new /obj/item/weapon/material/shard/phoron(src)
if(7)
var/obj/item/stack/sheet/mineral/uranium/R = new(src)
var/obj/item/stack/material/uranium/R = new(src)
R.amount = rand(5,25)
/turf/simulated/mineral/random

View File

@@ -37,25 +37,25 @@
/obj/machinery/mineral/mint/process()
if ( src.input)
var/obj/item/stack/sheet/O
O = locate(/obj/item/stack/sheet, input.loc)
var/obj/item/stack/material/O
O = locate(/obj/item/stack/material, input.loc)
if(O)
if (istype(O,/obj/item/stack/sheet/mineral/gold))
if (istype(O,/obj/item/stack/material/gold))
amt_gold += 100 * O.get_amount()
qdel(O)
if (istype(O,/obj/item/stack/sheet/mineral/silver))
if (istype(O,/obj/item/stack/material/silver))
amt_silver += 100 * O.get_amount()
qdel(O)
if (istype(O,/obj/item/stack/sheet/mineral/diamond))
if (istype(O,/obj/item/stack/material/diamond))
amt_diamond += 100 * O.get_amount()
qdel(O)
if (istype(O,/obj/item/stack/sheet/mineral/phoron))
if (istype(O,/obj/item/stack/material/phoron))
amt_phoron += 100 * O.get_amount()
qdel(O)
if (istype(O,/obj/item/stack/sheet/mineral/uranium))
if (istype(O,/obj/item/stack/material/uranium))
amt_uranium += 100 * O.get_amount()
qdel(O)
if (istype(O,/obj/item/stack/sheet/metal))
if (istype(O,/obj/item/stack/material/steel))
amt_iron += 100 * O.get_amount()
qdel(O)

View File

@@ -0,0 +1,163 @@
/*
adds a dizziness amount to a mob
use this rather than directly changing var/dizziness
since this ensures that the dizzy_process proc is started
currently only humans get dizzy
value of dizziness ranges from 0 to 1000
below 100 is not dizzy
*/
/mob/var/dizziness = 0//Carbon
/mob/var/is_dizzy = 0
/mob/proc/make_dizzy(var/amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return
dizziness = min(1000, dizziness + amount) // store what will be new value
// clamped to max 1000
if(dizziness > 100 && !is_dizzy)
spawn(0)
dizzy_process()
/*
dizzy process - wiggles the client's pixel offset over time
spawned from make_dizzy(), will terminate automatically when dizziness gets <100
note dizziness decrements automatically in the mob's Life() proc.
*/
/mob/proc/dizzy_process()
is_dizzy = 1
while(dizziness > 100)
if(client)
var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70
client.pixel_x = amplitude * sin(0.008 * dizziness * world.time)
client.pixel_y = amplitude * cos(0.008 * dizziness * world.time)
sleep(1)
//endwhile - reset the pixel offsets to zero
is_dizzy = 0
if(client)
client.pixel_x = 0
client.pixel_y = 0
// jitteriness - copy+paste of dizziness
/mob/var/is_jittery = 0
/mob/var/jitteriness = 0//Carbon
/mob/proc/make_jittery(var/amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return
jitteriness = min(1000, jitteriness + amount) // store what will be new value
// clamped to max 1000
if(jitteriness > 100 && !is_jittery)
spawn(0)
jittery_process()
// Typo from the oriignal coder here, below lies the jitteriness process. So make of his code what you will, the previous comment here was just a copypaste of the above.
/mob/proc/jittery_process()
//var/old_x = pixel_x
//var/old_y = pixel_y
is_jittery = 1
while(jitteriness > 100)
// var/amplitude = jitteriness*(sin(jitteriness * 0.044 * world.time) + 1) / 70
// pixel_x = amplitude * sin(0.008 * jitteriness * world.time)
// pixel_y = amplitude * cos(0.008 * jitteriness * world.time)
var/amplitude = min(4, jitteriness / 100)
pixel_x = old_x + rand(-amplitude, amplitude)
pixel_y = old_y + rand(-amplitude/3, amplitude/3)
sleep(1)
//endwhile - reset the pixel offsets to zero
is_jittery = 0
pixel_x = old_x
pixel_y = old_y
//handles up-down floaty effect in space
/mob/var/is_floating = 0
/mob/var/floatiness = 0
/mob/proc/make_floating(var/n)
floatiness = n
if(floatiness && !is_floating)
start_floating()
else if(!floatiness && is_floating)
stop_floating()
/mob/proc/start_floating()
is_floating = 1
var/amplitude = 2 //maximum displacement from original position
var/period = 36 //time taken for the mob to go up >> down >> original position, in deciseconds. Should be multiple of 4
var/top = old_y + amplitude
var/bottom = old_y - amplitude
var/half_period = period / 2
var/quarter_period = period / 4
animate(src, pixel_y = top, time = quarter_period, easing = SINE_EASING | EASE_OUT, loop = -1) //up
animate(pixel_y = bottom, time = half_period, easing = SINE_EASING, loop = -1) //down
animate(pixel_y = old_y, time = quarter_period, easing = SINE_EASING | EASE_IN, loop = -1) //back
/mob/proc/stop_floating()
animate(src, pixel_y = old_y, time = 5, easing = SINE_EASING | EASE_IN) //halt animation
//reset the pixel offsets to zero
is_floating = 0
/atom/movable/proc/do_attack_animation(atom/A)
var/pixel_x_diff = 0
var/pixel_y_diff = 0
var/direction = get_dir(src, A)
switch(direction)
if(NORTH)
pixel_y_diff = 8
if(SOUTH)
pixel_y_diff = -8
if(EAST)
pixel_x_diff = 8
if(WEST)
pixel_x_diff = -8
if(NORTHEAST)
pixel_x_diff = 8
pixel_y_diff = 8
if(NORTHWEST)
pixel_x_diff = -8
pixel_y_diff = 8
if(SOUTHEAST)
pixel_x_diff = 8
pixel_y_diff = -8
if(SOUTHWEST)
pixel_x_diff = -8
pixel_y_diff = -8
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, time = 2)
animate(pixel_x = initial(pixel_x), pixel_y = initial(pixel_y), time = 2)
/mob/do_attack_animation(atom/A)
..()
is_floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement.
/mob/proc/spin(spintime, speed)
spawn()
var/D = dir
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
set_dir(D)
spintime -= speed
return

View File

@@ -218,7 +218,7 @@ var/list/slot_equipment_priority = list( \
drop_from_inventory(I)
return 1
//Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob.
//Attemps to remove an object on a mob.
/mob/proc/remove_from_mob(var/obj/O)
src.u_equip(O)
if (src.client)
@@ -227,6 +227,7 @@ var/list/slot_equipment_priority = list( \
O.screen_loc = null
if(istype(O, /obj/item))
var/obj/item/I = O
I.loc = src.loc
I.dropped(src)
return 1

View File

@@ -228,6 +228,7 @@
switch(action)
if("weed")
flick("farmbot_hoe", src)
do_attack_animation(A)
if(prob(50))
visible_message("<span class='danger'>[src] swings wildly at [A] with a minihoe, missing completely!</span>")
return
@@ -241,7 +242,7 @@
visible_message("<span class='danger'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
new /obj/item/weapon/minihoe(Tsec)
new /obj/item/weapon/material/minihoe(Tsec)
new /obj/item/weapon/reagent_containers/glass/bucket(Tsec)
new /obj/item/device/assembly/prox_sensor(Tsec)
new /obj/item/device/analyzer/plant_analyzer(Tsec)
@@ -326,7 +327,7 @@
user.remove_from_mob(W)
qdel(W)
else if((istype(W, /obj/item/weapon/minihoe)) && (build_step == 2))
else if((istype(W, /obj/item/weapon/material/minihoe)) && (build_step == 2))
build_step++
user << "You add a minihoe to [src]."
name = "farmbot assembly with bucket and minihoe"

View File

@@ -154,7 +154,7 @@
target = T
break
if(maketiles && !target)
for(var/obj/item/stack/sheet/metal/T in view(src))
for(var/obj/item/stack/material/steel/T in view(src))
if(T in ignorelist)
continue
target = T
@@ -249,8 +249,8 @@
target = null
repairing = 0
update_icons()
else if(istype(A, /obj/item/stack/sheet/metal) && amount + 3 < maxAmount)
var/obj/item/stack/sheet/metal/M = A
else if(istype(A, /obj/item/stack/material/steel) && amount + 3 < maxAmount)
var/obj/item/stack/material/steel/M = A
visible_message("<span class='notice'>[src] begins to make tiles.</span>")
repairing = 1
update_icons()

View File

@@ -264,6 +264,7 @@
if(!cuff)
C.stun_effect_act(0, 60, null)
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
do_attack_animation(C)
is_attacking = 1
update_icons()
spawn(2)
@@ -283,6 +284,7 @@
var/mob/living/simple_animal/S = M
S.AdjustStunned(10)
S.adjustBruteLoss(15)
do_attack_animation(M)
playsound(loc, "swing_hit", 50, 1, -1)
is_attacking = 1
update_icons()

View File

@@ -132,7 +132,7 @@
/mob/living/carbon/proc/swap_hand()
var/obj/item/item_in_hand = src.get_active_hand()
if(item_in_hand) //this segment checks if the item in your hand is twohanded.
if(istype(item_in_hand,/obj/item/weapon/twohanded))
if(istype(item_in_hand,/obj/item/weapon/material/twohanded))
if(item_in_hand:wielded == 1)
usr << "<span class='warning'>Your other hand is too busy holding the [item_in_hand.name]</span>"
return
@@ -173,7 +173,7 @@
)
for(var/obj/item/organ/external/org in H.organs)
var/status = ""
var/list/status = list()
var/brutedamage = org.brute_dam
var/burndamage = org.burn_dam
if(halloss > 0)
@@ -181,29 +181,39 @@
brutedamage += halloss
if(prob(30))
burndamage += halloss
switch(brutedamage)
if(1 to 20)
status += "bruised"
if(20 to 40)
status += "wounded"
if(40 to INFINITY)
status += "mangled"
if(brutedamage > 0)
status = "bruised"
if(brutedamage > 20)
status = "bleeding"
if(brutedamage > 40)
status = "mangled"
if(brutedamage > 0 && burndamage > 0)
status += " and "
if(burndamage > 40)
status += "peeling away"
switch(burndamage)
if(1 to 10)
status += "numb"
if(10 to 40)
status += "blistered"
if(40 to INFINITY)
status += "peeling away"
else if(burndamage > 10)
status += "blistered"
else if(burndamage > 0)
status += "numb"
if(org.status & ORGAN_DESTROYED)
status = "MISSING!"
status += "MISSING"
if(org.status & ORGAN_MUTATED)
status = "weirdly shapen."
if(status == "")
status = "OK"
src.show_message(text("\t []My [] is [].",status=="OK"?"\blue ":"\red ",org.name,status),1)
status += "weirdly shapen"
if(org.dislocated == 2)
status += "dislocated"
if(org.status & ORGAN_BROKEN)
status += "hurts when touched"
if(org.status & ORGAN_DEAD)
status += "is bruised and necrotic"
if(!org.is_usable())
status += "dangling uselessly"
if(status.len)
src.show_message("My [org.name] is <span class='warning'> [english_list(status)].",1)
else
src.show_message("My [org.name] is <span class='notice'> OK.",1)
if((SKELETON in H.mutations) && (!H.w_uniform) && (!H.wear_suit))
H.play_xylophone()
else if (on_fire)
@@ -452,17 +462,17 @@
Stun(stun_duration)
Weaken(Floor(stun_duration/2))
return 1
/mob/living/carbon/proc/add_chemical_effect(var/effect, var/magnitude = 1)
if(effect in chem_effects)
chem_effects[effect] += magnitude
else
chem_effects[effect] = magnitude
chem_effects[effect] = magnitude
/mob/living/carbon/get_default_language()
if(default_language)
return default_language
if(!species)
return null
return species.default_language ? all_languages[species.default_language] : null
return species.default_language ? all_languages[species.default_language] : null

View File

@@ -274,76 +274,17 @@
wound_flavor_text["[temp.name]"] = "<span class='warning'>[t_He] has a robot [temp.name]!</span>\n"
continue
else
wound_flavor_text["[temp.name]"] = "<span class='warning'>[t_He] has a robot [temp.name]. It has"
if(temp.brute_dam) switch(temp.brute_dam)
if(0 to 20)
wound_flavor_text["[temp.name]"] += " some dents"
if(21 to INFINITY)
wound_flavor_text["[temp.name]"] += pick(" a lot of dents"," severe denting")
if(temp.brute_dam && temp.burn_dam)
wound_flavor_text["[temp.name]"] += " and"
if(temp.burn_dam) switch(temp.burn_dam)
if(0 to 20)
wound_flavor_text["[temp.name]"] += " some burns"
if(21 to INFINITY)
wound_flavor_text["[temp.name]"] += pick(" a lot of burns"," severe melting")
if(wound_flavor_text["[temp.name]"])
wound_flavor_text["[temp.name]"] += "!</span>\n"
else if(temp.wounds.len > 0)
var/list/wound_descriptors = list()
for(var/datum/wound/W in temp.wounds)
if(W.internal && !temp.open) continue // can't see internal wounds
var/this_wound_desc = W.desc
if(W.damage_type == BURN && W.salved) this_wound_desc = "salved [this_wound_desc]"
if(W.bleeding()) this_wound_desc = "bleeding [this_wound_desc]"
else if(W.bandaged) this_wound_desc = "bandaged [this_wound_desc]"
if(W.germ_level > 600) this_wound_desc = "badly infected [this_wound_desc]"
else if(W.germ_level > 330) this_wound_desc = "lightly infected [this_wound_desc]"
if(this_wound_desc in wound_descriptors)
wound_descriptors[this_wound_desc] += W.amount
continue
wound_descriptors[this_wound_desc] = W.amount
if(wound_descriptors.len)
var/list/flavor_text = list()
var/list/no_exclude = list("gaping wound", "big gaping wound", "massive wound", "large bruise",\
"huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area")
for(var/wound in wound_descriptors)
switch(wound_descriptors[wound])
if(1)
if(!flavor_text.len)
flavor_text += "<span class='warning'>[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]"
else
flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]"
if(2)
if(!flavor_text.len)
flavor_text += "<span class='warning'>[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s"
else
flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s"
if(3 to 5)
if(!flavor_text.len)
flavor_text += "<span class='warning'>[t_He] has several [wound]s"
else
flavor_text += " several [wound]s"
if(6 to INFINITY)
if(!flavor_text.len)
flavor_text += "<span class='warning'>[t_He] has a bunch of [wound]s"
else
flavor_text += " a ton of [wound]\s"
var/flavor_text_string = ""
for(var/text = 1, text <= flavor_text.len, text++)
if(text == flavor_text.len && flavor_text.len > 1)
flavor_text_string += ", and"
else if(flavor_text.len > 1 && text > 1)
flavor_text_string += ","
flavor_text_string += flavor_text[text]
flavor_text_string += " on [t_his] [temp.name].</span><br>"
wound_flavor_text["[temp.name]"] = flavor_text_string
else
wound_flavor_text["[temp.name]"] = ""
wound_flavor_text["[temp.name]"] = "<span class='warning'>[t_He] has a robot [temp.name]. It has[temp.get_wounds_desc()]!</span>\n"
else if(temp.wounds.len > 0 || temp.open)
wound_flavor_text["[temp.name]"] = "<span class='warning'>[t_He] has [temp.get_wounds_desc()] on [t_his] [temp.name].</span><br>"
if(temp.status & ORGAN_BLEEDING)
is_bleeding["[temp.name]"] = 1
else
wound_flavor_text["[temp.name]"] = ""
if(temp.dislocated == 2)
wound_flavor_text["[temp.name]"] += "<span class='warning'>[capitalize(t_his)] [temp.joint] is dislocated!</span><br>"
if(((temp.status & ORGAN_BROKEN) && temp.brute_dam > temp.min_broken_damage) || (temp.status & ORGAN_MUTATED))
wound_flavor_text["[temp.name]"] += "<span class='warning'>[capitalize(t_his)] [temp.name] is dented and swollen!</span><br>"
//Handles the text strings being added to the actual description.
//If they have something that covers the limb, and it is not missing, put flavortext. If it is covered but bleeding, add other flavortext.
@@ -354,9 +295,9 @@
msg += wound_flavor_text["head"]
else if(is_bleeding["head"])
msg += "<span class='warning'>[src] has blood running down [t_his] face!</span>\n"
if(wound_flavor_text["chest"] && !w_uniform && !skipjumpsuit) //No need. A missing chest gibs you.
msg += wound_flavor_text["chest"]
else if(is_bleeding["chest"])
if(wound_flavor_text["upper body"] && !w_uniform && !skipjumpsuit) //No need. A missing chest gibs you.
msg += wound_flavor_text["upper body"]
else if(is_bleeding["upper body"])
display_chest = 1
if(wound_flavor_text["left arm"] && (is_destroyed["left arm"] || (!w_uniform && !skipjumpsuit)))
msg += wound_flavor_text["left arm"]
@@ -374,9 +315,9 @@
msg += wound_flavor_text["right hand"]
else if(is_bleeding["right hand"])
display_gloves = 1
if(wound_flavor_text["groin"] && (is_destroyed["groin"] || (!w_uniform && !skipjumpsuit)))
msg += wound_flavor_text["groin"]
else if(is_bleeding["groin"])
if(wound_flavor_text["lower body"] && (is_destroyed["lower body"] || (!w_uniform && !skipjumpsuit)))
msg += wound_flavor_text["lower body"]
else if(is_bleeding["lower body"])
display_chest = 1
if(wound_flavor_text["left leg"] && (is_destroyed["left leg"] || (!w_uniform && !skipjumpsuit)))
msg += wound_flavor_text["left leg"]

View File

@@ -1026,7 +1026,7 @@
var/list/visible_implants = list()
for(var/obj/item/organ/external/organ in src.organs)
for(var/obj/item/weapon/O in organ.implants)
if(!istype(O,/obj/item/weapon/implant) && (O.w_class > class) && !istype(O,/obj/item/weapon/shard/shrapnel))
if(!istype(O,/obj/item/weapon/implant) && (O.w_class > class) && !istype(O,/obj/item/weapon/material/shard/shrapnel))
visible_implants += O
return(visible_implants)
@@ -1061,30 +1061,28 @@
set src in view(1)
var/self = 0
if(usr.stat == 1 || usr.restrained() || !isliving(usr)) return
if(usr.stat || usr.restrained() || !isliving(usr)) return
if(usr == src)
self = 1
if(!self)
usr.visible_message("\blue [usr] kneels down, puts \his hand on [src]'s wrist and begins counting their pulse.",\
usr.visible_message("<span class='notice'>[usr] kneels down, puts \his hand on [src]'s wrist and begins counting their pulse.</span>",\
"You begin counting [src]'s pulse")
else
usr.visible_message("\blue [usr] begins counting their pulse.",\
usr.visible_message("<span class='notice'>[usr] begins counting their pulse.</span>",\
"You begin counting your pulse.")
if(src.pulse)
usr << "\blue [self ? "You have a" : "[src] has a"] pulse! Counting..."
usr << "<span class='notice'>[self ? "You have a" : "[src] has a"] pulse! Counting...</span>"
else
usr << "\red [src] has no pulse!" //it is REALLY UNLIKELY that a dead person would check his own pulse
usr << "<span class='danger'>[src] has no pulse!</span>" //it is REALLY UNLIKELY that a dead person would check his own pulse
return
usr << "Don't move until counting is finished."
var/time = world.time
sleep(60)
if(usr.l_move_time >= time) //checks if our mob has moved during the sleep()
usr << "You moved while counting. Try again."
usr << "You must [self ? "" : "both"] stand until counting is finished."
if(do_mob(usr, src, 60))
usr << "<span class='notice'>[self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)].</span>"
else
usr << "\blue [self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]."
usr << "<span class='warning'>You failed to check the pulse. Try again.</span>"
/mob/living/carbon/human/proc/set_species(var/new_species, var/default_colour)

View File

@@ -15,10 +15,11 @@
if(istype(H))
if((H != src) && check_shields(0, H.name))
visible_message("\red <B>[H] attempted to touch [src]!</B>")
H.do_attack_animation(src)
return 0
if(istype(H.gloves, /obj/item/clothing/gloves/boxing/hologlove))
H.do_attack_animation(src)
var/damage = rand(0, 9)
if(!damage)
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
@@ -95,6 +96,7 @@
G.synch()
LAssailant = M
H.do_attack_animation(src)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("<span class='warning'>[M] has grabbed [src] passively!</span>")
return 1
@@ -186,6 +188,7 @@
if(!attack)
return 0
H.do_attack_animation(src)
if(!attack_message)
attack.show_attack(H, src, hit_zone, rand_damage)
else
@@ -220,6 +223,7 @@
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been disarmed by [M.name] ([M.ckey])</font>")
msg_admin_attack("[key_name(M)] disarmed [src.name] ([src.ckey])")
M.do_attack_animation(src)
if(w_uniform)
w_uniform.add_fingerprint(M)
@@ -278,6 +282,7 @@
user.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [user.name] ([user.ckey])</font>")
src.visible_message("<span class='danger'>[user] has [attack_message] [src]!</span>")
user.do_attack_animation(src)
var/dam_zone = pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg", "groin")
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))

View File

@@ -43,7 +43,7 @@ emp_act
if(P.can_embed())
var/armor = getarmor_organ(organ, "bullet")
if(prob(20 + max(P.damage - armor, -10)))
var/obj/item/weapon/shard/shrapnel/SP = new()
var/obj/item/weapon/material/shard/shrapnel/SP = new()
SP.name = (P.name != "shrapnel")? "[P.name] shrapnel" : "shrapnel"
SP.desc = "[SP.desc] It looks like it was fired from [P.shot_from]."
SP.loc = organ

View File

@@ -253,6 +253,6 @@
visible_message("<span class='warning'>\The [src] quivers slightly, then splits apart with a wet slithering noise.</span>")
del(src)
qdel(src)

View File

@@ -315,6 +315,9 @@ This saves us from having to call add_fingerprint() any time something is put in
W.layer = 20
if(W.icon_action_button)
update_action_buttons()
return 1
//Checks if a given slot can be accessed at this time, either to equip or unequip I

View File

@@ -1131,8 +1131,6 @@
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask, global_hud.nvg, global_hud.thermal, global_hud.meson, global_hud.science)
update_action_buttons()
if(damageoverlay.overlays)
damageoverlay.overlays = list()

View File

@@ -54,8 +54,10 @@ var/const/MAX_ACTIVE_TIME = 400
user << "\red \b It looks like the proboscis has been removed."
return
/obj/item/clothing/mask/facehugger/attackby()
Die()
/obj/item/clothing/mask/facehugger/attackby(obj/item/I, mob/user)
if(I.force)
user.do_attack_animation(src)
Die()
return
/obj/item/clothing/mask/facehugger/bullet_act()
@@ -63,7 +65,7 @@ var/const/MAX_ACTIVE_TIME = 400
return
/obj/item/clothing/mask/facehugger/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
if(exposed_temperature > T0C+80)
Die()
return

View File

@@ -210,7 +210,7 @@
visible_message("<span class='warning'><B>[src] vomits up a thick purple substance and begins to shape it!</B></span>", "<span class='alium'>You shape a [choice].</span>")
switch(choice)
if("resin door")
new /obj/structure/mineral_door/resin(loc)
new /obj/structure/simple_door/resin(loc)
if("resin wall")
new /obj/effect/alien/resin/wall(loc)
if("resin membrane")

View File

@@ -118,7 +118,7 @@
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
del(handcuffed)
qdel(handcuffed)
handcuffed = null
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
@@ -139,7 +139,7 @@
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
del(legcuffed)
qdel(legcuffed)
legcuffed = null
update_inv_legcuffed()

View File

@@ -777,24 +777,6 @@ default behaviour is:
return
..()
/mob/living/carbon/proc/spin(spintime, speed)
spawn()
var/D = dir
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
set_dir(D)
spintime -= speed
return
/mob/living/touch_map_edge()
//check for nuke disks

View File

@@ -194,6 +194,7 @@
user.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [user.name] ([user.ckey])</font>")
src.visible_message("<span class='danger'>[user] has [attack_message] [src]!</span>")
user.do_attack_animation(src)
spawn(1) updatehealth()
return 1

View File

@@ -92,7 +92,7 @@
icon_state = "gripper-sheet"
can_hold = list(
/obj/item/stack/sheet
/obj/item/stack/material
)
/obj/item/weapon/gripper/attack_self(mob/user as mob)
@@ -328,10 +328,10 @@
else if(istype(W,/obj/item/ammo_casing))
if(metal)
metal.add_charge(1000)
else if(istype(W,/obj/item/weapon/shard/shrapnel))
else if(istype(W,/obj/item/weapon/material/shard/shrapnel))
if(metal)
metal.add_charge(1000)
else if(istype(W,/obj/item/weapon/shard))
else if(istype(W,/obj/item/weapon/material/shard))
if(glass)
glass.add_charge(1000)
else if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/grown))

View File

@@ -1081,8 +1081,9 @@
if(cell.charge == 0)
return 0
if(cell.use(amount * CELLRATE * CYBORG_POWER_USAGE_MULTIPLIER))
used_power_this_tick += amount * CYBORG_POWER_USAGE_MULTIPLIER
var/power_use = amount * CYBORG_POWER_USAGE_MULTIPLIER
if(cell.checked_use(CELLRATE * power_use))
used_power_this_tick += power_use
return 1
return 0

View File

@@ -37,8 +37,8 @@
for(var/obj/I in contents)
for(var/mob/M in I.contents)
M.death()
if(istype(I,/obj/item/stack/sheet))//Only deconsturcts one sheet at a time instead of the entire stack
var/obj/item/stack/sheet/S = I
if(istype(I,/obj/item/stack/material))//Only deconsturcts one sheet at a time instead of the entire stack
var/obj/item/stack/material/S = I
if(S.get_amount() > 1)
S.use(1)
loaded_item = S
@@ -129,7 +129,10 @@
return
if(istype(target,/obj/machinery/portable_atmospherics/hydroponics))
var/obj/machinery/portable_atmospherics/hydroponics/T = target
T.harvest(user)
if(T.harvest) //Try to harvest, assuming it's alive.
T.harvest(user)
else if(T.dead) //It's probably dead otherwise.
T.remove_dead(user)
else
user << "Harvesting \a [target] is not the purpose of this tool. The [src] is for plants being grown."

View File

@@ -310,7 +310,7 @@ var/global/list/robot_modules = list(
synths += plasteel
synths += glass
var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src)
var/obj/item/stack/material/cyborg/steel/M = new (src)
M.synths = list(metal)
src.modules += M
@@ -318,11 +318,11 @@ var/global/list/robot_modules = list(
R.synths = list(metal)
src.modules += R
var/obj/item/stack/sheet/plasteel/cyborg/S = new /obj/item/stack/sheet/plasteel/cyborg(src)
var/obj/item/stack/material/cyborg/plasteel/S = new (src)
S.synths = list(plasteel)
src.modules += S
var/obj/item/stack/sheet/glass/reinforced/cyborg/RG = new /obj/item/stack/sheet/glass/reinforced/cyborg(src)
var/obj/item/stack/material/cyborg/glass/reinforced/RG = new (src)
RG.synths = list(metal, glass)
src.modules += RG
@@ -356,11 +356,11 @@ var/global/list/robot_modules = list(
MD.glass = glass
src.modules += MD
var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src)
var/obj/item/stack/material/cyborg/steel/M = new (src)
M.synths = list(metal)
src.modules += M
var/obj/item/stack/sheet/glass/cyborg/G = new /obj/item/stack/sheet/glass/cyborg(src)
var/obj/item/stack/material/cyborg/glass/G = new (src)
G.synths = list(glass)
src.modules += G
@@ -376,7 +376,7 @@ var/global/list/robot_modules = list(
S.synths = list(metal)
src.modules += S
var/obj/item/stack/sheet/glass/reinforced/cyborg/RG = new /obj/item/stack/sheet/glass/reinforced/cyborg(src)
var/obj/item/stack/material/cyborg/glass/reinforced/RG = new (src)
RG.synths = list(metal, glass)
src.modules += RG
@@ -484,8 +484,8 @@ var/global/list/robot_modules = list(
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/weapon/gripper/service(src)
src.modules += new /obj/item/weapon/reagent_containers/glass/bucket(src)
src.modules += new /obj/item/weapon/minihoe(src)
src.modules += new /obj/item/weapon/hatchet(src)
src.modules += new /obj/item/weapon/material/minihoe(src)
src.modules += new /obj/item/weapon/material/hatchet(src)
src.modules += new /obj/item/device/analyzer/plant_analyzer(src)
src.modules += new /obj/item/weapon/storage/bag/plants(src)
src.modules += new /obj/item/weapon/robot_harvester(src)
@@ -676,11 +676,11 @@ var/global/list/robot_modules = list(
MD.plastic = plastic
src.modules += MD
var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src)
var/obj/item/stack/material/cyborg/steel/M = new (src)
M.synths = list(metal)
src.modules += M
var/obj/item/stack/sheet/glass/cyborg/G = new /obj/item/stack/sheet/glass/cyborg(src)
var/obj/item/stack/material/cyborg/glass/G = new (src)
G.synths = list(glass)
src.modules += G
@@ -696,7 +696,7 @@ var/global/list/robot_modules = list(
S.synths = list(metal)
src.modules += S
var/obj/item/stack/sheet/glass/reinforced/cyborg/RG = new /obj/item/stack/sheet/glass/reinforced/cyborg(src)
var/obj/item/stack/material/cyborg/glass/reinforced/RG = new (src)
RG.synths = list(metal, glass)
src.modules += RG
@@ -704,11 +704,11 @@ var/global/list/robot_modules = list(
WT.synths = list(wood)
src.modules += WT
var/obj/item/stack/sheet/wood/cyborg/W = new /obj/item/stack/sheet/wood/cyborg(src)
var/obj/item/stack/material/cyborg/wood/W = new (src)
W.synths = list(wood)
src.modules += W
var/obj/item/stack/sheet/mineral/plastic/cyborg/P = new /obj/item/stack/sheet/mineral/plastic/cyborg(src)
var/obj/item/stack/material/cyborg/plastic/P = new (src)
P.synths = list(plastic)
src.modules += P

View File

@@ -49,12 +49,16 @@
var/obj/effect/plant/SV = locate() in loc
SV.die_off(1)
if(locate(/obj/machinery/portable_atmospherics/hydroponics/soil/invisible) in loc)
var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/SP = locate() in loc
qdel(SP)
if(!pulledby)
for(var/direction in shuffle(list(1,2,4,8,5,6,9,10)))
var/step = get_step(src, direction)
if(step)
if(locate(/obj/effect/plant) in step)
Move(step)
var/obj/effect/plant/food
food = locate(/obj/effect/plant) in oview(5,loc)
if(food)
var/step = get_step_to(src, food, 0)
Move(step)
/mob/living/simple_animal/hostile/retaliate/goat/Retaliate()
..()

View File

@@ -135,19 +135,7 @@
spawn(300) src.explode()
else
if(O.force)
var/damage = O.force
if (O.damtype == HALLOSS)
damage = 0
adjustBruteLoss(damage)
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("\red \b [src] has been attacked with the [O] by [user]. ")
else
usr << "\red This weapon is ineffective, it does no damage."
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("\red [user] gently taps [src] with the [O]. ")
attacked_with_item(O, user)
/mob/living/simple_animal/spiderbot/proc/transfer_personality(var/obj/item/device/mmi/M as obj)

View File

@@ -232,8 +232,8 @@
if(istype(A,/obj/machinery/door/airlock))
var/obj/machinery/door/airlock/D = A
D.open(1)
else if(istype(A,/obj/structure/mineral_door))
var/obj/structure/mineral_door/D = A
else if(istype(A,/obj/structure/simple_door))
var/obj/structure/simple_door/D = A
if(D.density)
D.Open()
else if(istype(A,/obj/structure/cult/pylon))

View File

@@ -170,16 +170,16 @@
var/obj/O
//shards
O = new /obj/item/weapon/shard(src.loc)
O = new /obj/item/weapon/material/shard(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(75))
O = new /obj/item/weapon/shard(src.loc)
O = new /obj/item/weapon/material/shard(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(50))
O = new /obj/item/weapon/shard(src.loc)
O = new /obj/item/weapon/material/shard(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(25))
O = new /obj/item/weapon/shard(src.loc)
O = new /obj/item/weapon/material/shard(src.loc)
step_to(O, get_turf(pick(view(7, src))))
//rods
@@ -196,16 +196,16 @@
step_to(O, get_turf(pick(view(7, src))))
//plasteel
O = new /obj/item/stack/sheet/plasteel(src.loc)
O = new /obj/item/stack/material/plasteel(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(75))
O = new /obj/item/stack/sheet/plasteel(src.loc)
O = new /obj/item/stack/material/plasteel(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(50))
O = new /obj/item/stack/sheet/plasteel(src.loc)
O = new /obj/item/stack/material/plasteel(src.loc)
step_to(O, get_turf(pick(view(7, src))))
if(prob(25))
O = new /obj/item/stack/sheet/plasteel(src.loc)
O = new /obj/item/stack/material/plasteel(src.loc)
step_to(O, get_turf(pick(view(7, src))))
//also drop dummy circuit boards deconstructable for research (loot)

View File

@@ -20,7 +20,7 @@
attacktext = "punched"
a_intent = I_HURT
var/corpse = /obj/effect/landmark/mobcorpse/russian
var/weapon1 = /obj/item/weapon/kitchenknife
var/weapon1 = /obj/item/weapon/material/knife
min_oxy = 5
max_oxy = 0
min_tox = 0

View File

@@ -68,6 +68,7 @@
visible_message("\red \b [src] has been attacked with the [O] by [user]. ")
else
visible_message("\red \b [src] blocks the [O] with its shield! ")
//user.do_attack_animation(src)
else
usr << "\red This weapon is ineffective, it does no damage."
visible_message("\red [user] gently taps [src] with the [O]. ")

View File

@@ -52,5 +52,5 @@
/mob/living/simple_animal/hostile/tree/death()
..(null,"is hacked into pieces!")
new /obj/item/stack/sheet/wood(loc)
new /obj/item/stack/material/wood(loc)
qdel(src)

View File

@@ -240,6 +240,7 @@
if(I_DISARM)
M.visible_message("\blue [M] [response_disarm] \the [src]")
M.do_attack_animation(src)
//TODO: Push the mob away or something
if(I_GRAB)
@@ -257,10 +258,12 @@
LAssailant = M
M.visible_message("\red [M] has grabbed [src] passively!")
M.do_attack_animation(src)
if(I_HURT)
adjustBruteLoss(harm_intent_damage)
M.visible_message("\red [M] [response_harm] \the [src]")
M.do_attack_animation(src)
return
@@ -279,28 +282,33 @@
if ((M.client && !( M.blinded )))
M.show_message("<span class='notice'>[user] applies the [MED] on [src].</span>")
else
user << "<span class='notice'>\The [src] is dead, medical items won't bring it back to life.</span>"
user << "<span class='notice'>\The [src] is dead, medical items won't bring \him back to life.</span>"
if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch))
if(istype(O, /obj/item/weapon/material/knife) || istype(O, /obj/item/weapon/material/knife/butch))
harvest(user)
else
user.changeNext_move(8)
if(O.force > resistance)
var/damage = O.force
if (O.damtype == HALLOSS)
damage = 0
if(supernatural && istype(O,/obj/item/weapon/nullrod))
damage *= 2
purge = 3
adjustBruteLoss(damage)
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("<span class='danger>[src] has been attacked with the [O] by [user].</span>")
else
usr << "<span class='danger>This weapon is ineffective, it does no damage.</span>"
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("<span class='notice'>[user] gently taps [src] with \the [O].</span>")
attacked_with_item(O, user)
//TODO: refactor mob attackby(), attacked_by(), and friends.
/mob/living/simple_animal/proc/attacked_with_item(var/obj/item/O, var/mob/user)
user.changeNext_move(8)
if(!O.force)
visible_message("<span class='notice'>[user] gently taps [src] with \the [O].</span>")
return
if(O.force > resistance)
var/damage = O.force
if (O.damtype == HALLOSS)
damage = 0
if(supernatural && istype(O,/obj/item/weapon/nullrod))
damage *= 2
purge = 3
adjustBruteLoss(damage)
else
usr << "<span class='danger>This weapon is ineffective, it does no damage.</span>"
visible_message("<span class='danger>[src] has been attacked with the [O] by [user].</span>")
user.do_attack_animation(src)
/mob/living/simple_animal/movement_delay()
var/tally = 0 //Incase I need to add stuff other than "speed" later

View File

@@ -175,18 +175,18 @@
for(var/atom/movable/stomachContent in contents)
if(prob(digestionProbability))
if(istype(stomachContent,/obj/item/stack)) //converts to plasma, keeping the stack value
if(!istype(stomachContent,/obj/item/stack/sheet/mineral/phoron))
if(!istype(stomachContent,/obj/item/stack/material/phoron))
var/obj/item/stack/oldStack = stomachContent
new /obj/item/stack/sheet/mineral/phoron(src, oldStack.get_amount())
new /obj/item/stack/material/phoron(src, oldStack.get_amount())
qdel(oldStack)
continue
else if(istype(stomachContent,/obj/item)) //converts to plasma, keeping the w_class
var/obj/item/oldItem = stomachContent
new /obj/item/stack/sheet/mineral/phoron(src, oldItem.w_class)
new /obj/item/stack/material/phoron(src, oldItem.w_class)
qdel(oldItem)
continue
else
new /obj/item/stack/sheet/mineral/phoron(src, flatPlasmaValue) //just flat amount
new /obj/item/stack/material/phoron(src, flatPlasmaValue) //just flat amount
qdel(stomachContent)
continue

View File

@@ -601,111 +601,6 @@
for(var/mob/M in viewers())
M.see(message)
/*
adds a dizziness amount to a mob
use this rather than directly changing var/dizziness
since this ensures that the dizzy_process proc is started
currently only humans get dizzy
value of dizziness ranges from 0 to 1000
below 100 is not dizzy
*/
/mob/proc/make_dizzy(var/amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return
dizziness = min(1000, dizziness + amount) // store what will be new value
// clamped to max 1000
if(dizziness > 100 && !is_dizzy)
spawn(0)
dizzy_process()
/*
dizzy process - wiggles the client's pixel offset over time
spawned from make_dizzy(), will terminate automatically when dizziness gets <100
note dizziness decrements automatically in the mob's Life() proc.
*/
/mob/proc/dizzy_process()
is_dizzy = 1
while(dizziness > 100)
if(client)
var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70
client.pixel_x = amplitude * sin(0.008 * dizziness * world.time)
client.pixel_y = amplitude * cos(0.008 * dizziness * world.time)
sleep(1)
//endwhile - reset the pixel offsets to zero
is_dizzy = 0
if(client)
client.pixel_x = 0
client.pixel_y = 0
// jitteriness - copy+paste of dizziness
/mob/proc/make_jittery(var/amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return
jitteriness = min(1000, jitteriness + amount) // store what will be new value
// clamped to max 1000
if(jitteriness > 100 && !is_jittery)
spawn(0)
jittery_process()
// Typo from the oriignal coder here, below lies the jitteriness process. So make of his code what you will, the previous comment here was just a copypaste of the above.
/mob/proc/jittery_process()
//var/old_x = pixel_x
//var/old_y = pixel_y
is_jittery = 1
while(jitteriness > 100)
// var/amplitude = jitteriness*(sin(jitteriness * 0.044 * world.time) + 1) / 70
// pixel_x = amplitude * sin(0.008 * jitteriness * world.time)
// pixel_y = amplitude * cos(0.008 * jitteriness * world.time)
var/amplitude = min(4, jitteriness / 100)
pixel_x = old_x + rand(-amplitude, amplitude)
pixel_y = old_y + rand(-amplitude/3, amplitude/3)
sleep(1)
//endwhile - reset the pixel offsets to zero
is_jittery = 0
pixel_x = old_x
pixel_y = old_y
//handles up-down floaty effect in space
/mob/proc/make_floating(var/n)
floatiness = n
if(floatiness && !is_floating)
start_floating()
else if(!floatiness && is_floating)
stop_floating()
/mob/proc/start_floating()
is_floating = 1
var/amplitude = 2 //maximum displacement from original position
var/period = 36 //time taken for the mob to go up >> down >> original position, in deciseconds. Should be multiple of 4
var/top = old_y + amplitude
var/bottom = old_y - amplitude
var/half_period = period / 2
var/quarter_period = period / 4
animate(src, pixel_y = top, time = quarter_period, easing = SINE_EASING | EASE_OUT, loop = -1) //up
animate(pixel_y = bottom, time = half_period, easing = SINE_EASING, loop = -1) //down
animate(pixel_y = old_y, time = quarter_period, easing = SINE_EASING | EASE_IN, loop = -1) //back
/mob/proc/stop_floating()
animate(src, pixel_y = old_y, time = 5, easing = SINE_EASING | EASE_IN) //halt animation
//reset the pixel offsets to zero
is_floating = 0
/mob/Stat()
..()

View File

@@ -108,12 +108,6 @@
var/old_x = 0
var/old_y = 0
var/drowsyness = 0.0//Carbon
var/dizziness = 0//Carbon
var/is_dizzy = 0
var/is_jittery = 0
var/jitteriness = 0//Carbon
var/is_floating = 0
var/floatiness = 0
var/charges = 0.0
var/nutrition = 400.0//Carbon

View File

@@ -297,6 +297,44 @@
assailant << "<span class='warning'>You are no longer pinning [affecting] to the ground.</span>"
force_down = 0
return
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/E = H.get_organ(hit_zone)
if(E && !(E.status & ORGAN_DESTROYED))
assailant.visible_message("<span class='notice'>[assailant] starts inspecting [affecting]'s [E.name] carefully.</span>")
if(do_mob(assailant,H, 10))
if(E.wounds.len)
assailant << "<span class='warning'>You find [E.get_wounds_desc()]</span>"
else
assailant << "<span class='notice'>You find no visible wounds.</span>"
else
assailant << "<span class='notice'>You must stand still to inspect [E] for wounds.</span>"
assailant << "<span class='notice'>Checking bones now...</span>"
if(do_mob(assailant, H, 20))
if(E.status & ORGAN_BROKEN)
assailant << "<span class='warning'>The [E.encased ? E.encased : "bone in the [E.name]"] moves slightly when you poke it!</span>"
H.custom_pain("Your [E.name] hurts where it's poked.")
else
assailant << "<span class='notice'>The [E.encased ? E.encased : "bones in the [E.name]"] seem to be fine.</span>"
else
assailant << "<span class='notice'>You must stand still to feel [E] for fractures.</span>"
assailant << "<span class='notice'>Checking skin now...</span>"
if(do_mob(assailant, H, 10))
var/bad = 0
if(H.getToxLoss() >= 40)
assailant << "<span class='warning'>[H] has an unhealthy skin discoloration.</span>"
bad = 1
if(H.getOxyLoss() >= 20)
assailant << "<span class='warning'>[H]'s skin is unusaly pale.</span>"
bad = 1
if(E.status & ORGAN_DEAD)
assailant << "<span class='warning'>[E] is decaying!</span>"
bad = 1
if(!bad)
assailant << "<span class='notice'>[H]'s skin is normal.</span>"
else
assailant << "<span class='notice'>You must stand still to check [H]'s skin for abnormalities.</span>"
else
assailant << "<span class='notice'>[H] is missing that bodypart.</span>"
if(I_GRAB)
if(state < GRAB_AGGRESSIVE)
assailant << "<span class='warning'>You require a better grab to do this.</span>"

View File

@@ -106,7 +106,8 @@
O.add_ai_verbs()
O.rename_self("ai",1)
qdel(src)
spawn(0) // Mobs still instantly del themselves, thus we need to spawn or O will never be returned
qdel(src)
return O
//human -> robot
@@ -158,7 +159,8 @@
callHook("borgify", list(O))
O.Namepick()
qdel(src)
spawn(0) // Mobs still instantly del themselves, thus we need to spawn or O will never be returned
qdel(src)
return O
//human -> alien

View File

@@ -175,7 +175,7 @@
var/can_cut = (prob(brute*2) || sharp) && !(status & ORGAN_ROBOT)
// If the limbs can break, make sure we don't exceed the maximum damage a limb can take before breaking
// Non-vital organs are limited to max_damage. You can't kill someone by bludeonging their arm all the way to 200 -- you can
// Non-vital organs are limited to max_damage. You can't kill someone by bludeonging their arm all the way to 200 -- you can
// push them faster into paincrit though, as the additional damage is converted into shock.
if(vital || (brute_dam + burn_dam + brute + burn) < max_damage || !config.limbs_can_break)
if(brute)
@@ -931,6 +931,58 @@ Note that amputating the affected organ does in fact remove the infection from t
"\red You hear a sickening sizzle.")
disfigured = 1
/obj/item/organ/external/proc/get_wounds_desc()
. = ""
if(status & ORGAN_ROBOT)
if(brute_dam)
switch(brute_dam)
if(0 to 20)
. += " some dents"
if(21 to INFINITY)
. += pick(" a lot of dents"," severe denting")
if(brute_dam && burn_dam)
. += " and"
if(burn_dam)
switch(burn_dam)
if(0 to 20)
. += " some burns"
if(21 to INFINITY)
. += pick(" a lot of burns"," severe melting")
return
var/list/wound_descriptors = list()
if(open > 1)
wound_descriptors["an open incision"] = 1
else if (open)
wound_descriptors["an incision"] = 1
for(var/datum/wound/W in wounds)
if(W.internal && !open) continue // can't see internal wounds
var/this_wound_desc = W.desc
if(W.damage_type == BURN && W.salved) this_wound_desc = "salved [this_wound_desc]"
if(W.bleeding()) this_wound_desc = "bleeding [this_wound_desc]"
else if(W.bandaged) this_wound_desc = "bandaged [this_wound_desc]"
if(W.germ_level > 600) this_wound_desc = "badly infected [this_wound_desc]"
else if(W.germ_level > 330) this_wound_desc = "lightly infected [this_wound_desc]"
if(wound_descriptors[this_wound_desc])
wound_descriptors[this_wound_desc] += W.amount
else
wound_descriptors[this_wound_desc] = W.amount
if(wound_descriptors.len)
var/list/flavor_text = list()
var/list/no_exclude = list("gaping wound", "big gaping wound", "massive wound", "large bruise",\
"huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area")
for(var/wound in wound_descriptors)
switch(wound_descriptors[wound])
if(1)
flavor_text += "[prob(10) && !(wound in no_exclude) ? "what might be " : ""]a [wound]"
if(2)
flavor_text += "[prob(10) && !(wound in no_exclude) ? "what might be " : ""]a pair of [wound]s"
if(3 to 5)
flavor_text += "several [wound]s"
if(6 to INFINITY)
flavor_text += "a ton of [wound]\s"
return english_list(flavor_text)
/****************************************************
ORGAN DEFINES
****************************************************/

View File

@@ -452,7 +452,7 @@
if(W.w_class != 3)
user << "\The [W] is too [W.w_class < 3? "small" : "large"] to fit here."
return
user.drop_item()
W.loc = src
cell = W
@@ -590,7 +590,7 @@
if(do_after(user, 50))
if(!src || !WT.remove_fuel(3, user)) return
if (emagged || malfhack || (stat & BROKEN) || opened==2)
new /obj/item/stack/sheet/metal(loc)
new /obj/item/stack/material/steel(loc)
user.visible_message(\
"<span class='warning'>[src] has been cut apart by [user.name] with the weldingtool.</span>",\
"<span class='notice'>You disassembled the broken APC frame.</span>",\

View File

@@ -10,7 +10,7 @@
..()
updateicon()
/obj/item/weapon/cell/drain_power(var/drain_check, var/surge, var/amount = 0)
/obj/item/weapon/cell/drain_power(var/drain_check, var/surge, var/power = 0)
if(drain_check)
return 1
@@ -18,9 +18,9 @@
if(charge <= 0)
return 0
var/cell_amt = min((amount * CELLRATE), charge)
use(cell_amt)
return cell_amt / CELLRATE
var/cell_amt = power * CELLRATE
return use(cell_amt) / CELLRATE
/obj/item/weapon/cell/proc/updateicon()
overlays.Cut()
@@ -38,13 +38,26 @@
/obj/item/weapon/cell/proc/fully_charged()
return (charge == maxcharge)
// use power from a cell
// checks if the power cell is able to provide the specified amount of charge
/obj/item/weapon/cell/proc/check_charge(var/amount)
return (charge >= amount)
// use power from a cell, returns the amount actually used
/obj/item/weapon/cell/proc/use(var/amount)
if(rigged && amount > 0)
explode()
return 0
charge = max(0, charge - amount)
return charge
var/used = min(charge, amount)
charge -= used
return used
// Checks if the specified amount can be provided. If it can, it removes the amount
// from the cell and returns 1. Otherwise does nothing and returns 0.
/obj/item/weapon/cell/proc/checked_use(var/amount)
if(!check_charge(amount))
return 0
use(amount)
return 1
// recharge the cell
/obj/item/weapon/cell/proc/give(var/amount)

View File

@@ -50,7 +50,7 @@
usr << "You begin deconstructing [src]."
if (!do_after(usr, 30))
return
new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded )
new /obj/item/stack/material/steel( get_turf(src.loc), sheets_refunded )
user.visible_message("[user.name] deconstructs [src].", \
"You deconstruct [src].", "You hear a noise.")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 75, 1)
@@ -271,6 +271,7 @@
if(!(status == LIGHT_OK||status == LIGHT_BURNED))
return
visible_message("<span class='danger'>[user] smashes the light!</span>")
user.do_attack_animation(src)
broken()
return 1

View File

@@ -87,7 +87,7 @@
desc = "A power generator that runs on solid phoron sheets. Rated for 80 kW max safe output."
var/sheet_name = "Phoron Sheets"
var/sheet_path = /obj/item/stack/sheet/mineral/phoron
var/sheet_path = /obj/item/stack/material/phoron
var/board_path = "/obj/item/weapon/circuitboard/pacman"
/*
@@ -162,7 +162,7 @@
//Removes one stack's worth of material from the generator.
/obj/machinery/power/port_gen/pacman/DropFuel()
if(sheets)
var/obj/item/stack/sheet/S = new sheet_path(loc)
var/obj/item/stack/material/S = new sheet_path(loc)
var/amount = min(sheets, S.max_amount)
S.amount = amount
sheets -= amount
@@ -403,7 +403,7 @@
name = "S.U.P.E.R.P.A.C.M.A.N.-type Portable Generator"
desc = "A power generator that utilizes uranium sheets as fuel. Can run for much longer than the standard PACMAN type generators. Rated for 80 kW max safe output."
icon_state = "portgen1"
sheet_path = /obj/item/stack/sheet/mineral/uranium
sheet_path = /obj/item/stack/material/uranium
sheet_name = "Uranium Sheets"
time_per_sheet = 576 //same power output, but a 50 sheet stack will last 2 hours at max safe power
board_path = "/obj/item/weapon/circuitboard/pacman/super"
@@ -430,7 +430,7 @@
name = "M.R.S.P.A.C.M.A.N.-type Portable Generator"
desc = "An advanced power generator that runs on tritium. Rated for 200 kW maximum safe output!"
icon_state = "portgen2"
sheet_path = /obj/item/stack/sheet/mineral/tritium
sheet_path = /obj/item/stack/material/tritium
sheet_name = "Tritium Fuel Sheets"
//I don't think tritium has any other use, so we might as well make this rewarding for players

View File

@@ -374,7 +374,7 @@
if (source_area)
source_area.use_power(drained_energy/CELLRATE)
else if (istype(power_source,/datum/powernet))
var/drained_power = drained_energy/CELLRATE //convert from "joules" to "watts"
var/drained_power = drained_energy/CELLRATE
drained_power = PN.draw_power(drained_power)
else if (istype(power_source, /obj/item/weapon/cell))
cell.use(drained_energy)

View File

@@ -50,10 +50,10 @@ var/list/solars_list = list()
/obj/machinery/power/solar/proc/Make(var/obj/item/solar_assembly/S)
if(!S)
S = new /obj/item/solar_assembly(src)
S.glass_type = /obj/item/stack/sheet/glass
S.glass_type = /obj/item/stack/material/glass
S.anchored = 1
S.loc = src
if(S.glass_type == /obj/item/stack/sheet/glass/reinforced) //if the panel is in reinforced glass
if(S.glass_type == /obj/item/stack/material/glass/reinforced) //if the panel is in reinforced glass
health *= 2 //this need to be placed here, because panels already on the map don't have an assembly linked to
update_icon()
@@ -91,8 +91,8 @@ var/list/solars_list = list()
if(!(stat & BROKEN))
broken()
else
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/material/shard(src.loc)
new /obj/item/weapon/material/shard(src.loc)
qdel(src)
return
return
@@ -153,13 +153,13 @@ var/list/solars_list = list()
switch(severity)
if(1.0)
if(prob(15))
new /obj/item/weapon/shard( src.loc )
new /obj/item/weapon/material/shard( src.loc )
qdel(src)
return
if(2.0)
if (prob(25))
new /obj/item/weapon/shard( src.loc )
new /obj/item/weapon/material/shard( src.loc )
qdel(src)
return
@@ -231,7 +231,7 @@ var/list/solars_list = list()
// Give back the glass type we were supplied with
/obj/item/solar_assembly/proc/give_glass()
if(glass_type)
var/obj/item/stack/sheet/S = new glass_type(src.loc)
var/obj/item/stack/material/S = new glass_type(src.loc)
S.amount = 2
glass_type = null
@@ -251,8 +251,8 @@ var/list/solars_list = list()
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
return 1
if(istype(W, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/S = W
if(istype(W, /obj/item/stack/material/glass))
var/obj/item/stack/material/S = W
if(S.use(2))
glass_type = W.type
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
@@ -420,7 +420,7 @@ var/list/solars_list = list()
if (src.stat & BROKEN)
user << "\blue The broken glass falls out."
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
new /obj/item/weapon/shard( src.loc )
new /obj/item/weapon/material/shard( src.loc )
var/obj/item/weapon/circuitboard/solar_control/M = new /obj/item/weapon/circuitboard/solar_control( A )
for (var/obj/C in src)
C.loc = src.loc

View File

@@ -41,7 +41,7 @@
/obj/machinery/power/tracker/proc/Make(var/obj/item/solar_assembly/S)
if(!S)
S = new /obj/item/solar_assembly(src)
S.glass_type = /obj/item/stack/sheet/glass
S.glass_type = /obj/item/stack/material/glass
S.tracker = 1
S.anchored = 1
S.loc = src

View File

@@ -234,7 +234,7 @@
if (src.stat & BROKEN)
user << "\blue The broken glass falls out."
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
new /obj/item/weapon/shard( src.loc )
new /obj/item/weapon/material/shard( src.loc )
var/obj/item/weapon/circuitboard/turbine_control/M = new /obj/item/weapon/circuitboard/turbine_control( A )
for (var/obj/C in src)
C.loc = src.loc

View File

@@ -78,7 +78,7 @@
/obj/item/weapon/gun/energy/consume_next_projectile()
if(!power_supply) return null
if(!ispath(projectile_type)) return null
if(!power_supply.use(charge_cost)) return null
if(!power_supply.checked_use(charge_cost)) return null
return new projectile_type(src)
/obj/item/weapon/gun/energy/proc/get_external_power_supply()

View File

@@ -41,7 +41,7 @@
/obj/item/weapon/arrow/rod/removed(mob/user)
if(throwforce == 15) // The rod has been superheated - we don't want it to be useable when removed from the bow.
user << "[src] shatters into a scattering of overstressed metal shards as it leaves the crossbow."
var/obj/item/weapon/shard/shrapnel/S = new()
var/obj/item/weapon/material/shard/shrapnel/S = new()
S.loc = get_turf(src)
qdel(src)
@@ -254,9 +254,9 @@
else
user << "<span class='notice'>You need at least five segments of cable coil to complete this task.</span>"
return
else if(istype(W,/obj/item/stack/sheet/mineral/plastic))
else if(istype(W,/obj/item/stack/material/plastic))
if(buildstate == 3)
var/obj/item/stack/sheet/mineral/plastic/P = W
var/obj/item/stack/material/plastic/P = W
if(P.use(3))
user << "<span class='notice'>You assemble and install a heavy plastic lath onto the crossbow.</span>"
buildstate++

View File

@@ -167,9 +167,9 @@
buildstate++
update_icon()
return
else if(istype(W,/obj/item/stack/sheet/metal))
else if(istype(W,/obj/item/stack/material/steel))
if(buildstate == 2)
var/obj/item/stack/sheet/metal/M = W
var/obj/item/stack/material/steel/M = W
if(M.use(5))
user << "<span class='notice'>You assemble a chassis around the cannon frame.</span>"
buildstate++

View File

@@ -3,17 +3,16 @@
var/total_volume = 0
var/maximum_volume = 100
var/atom/my_atom = null
var/reacting = 0 // Reacting right now
/datum/reagents/New(var/max = 100)
maximum_volume = max
maximum_volume = max
//I dislike having these here but map-objects are initialised before world/New() is called. >_>
if(!chemical_reagents_list)
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
var/paths = typesof(/datum/reagent) - /datum/reagent
chemical_reagents_list = list()
for(var/path in paths)
var/datum/reagent/D = new path()
var/datum/reagent/D = new path()
if(!D.name)
continue
chemical_reagents_list[D.id] = D
@@ -40,16 +39,16 @@
for(var/id in reaction_ids)
if(!chemical_reactions_list[id])
chemical_reactions_list[id] = list()
chemical_reactions_list[id] += D
break // Don't bother adding ourselves to other reagent ids, it is redundant.
/datum/reagents/Destroy()
..()
for(var/datum/reagent/R in reagent_list)
qdel(R)
reagent_list.Cut()
reagent_list = null
if(my_atom && my_atom.reagents == src)
chemical_reactions_list[id] += D
break // Don't bother adding ourselves to other reagent ids, it is redundant.
/datum/reagents/Destroy()
..()
for(var/datum/reagent/R in reagent_list)
qdel(R)
reagent_list.Cut()
reagent_list = null
if(my_atom && my_atom.reagents == src)
my_atom.reagents = null
/* Internal procs */
@@ -116,7 +115,7 @@
for(var/datum/chemical_reaction/C in chemical_reactions_list[R.id])
var/reagents_suitable = 1
for(var/B in C.required_reagents)
if(!has_reagent(B, C.required_reagents[B]))
if(!has_reagent(B))
reagents_suitable = 0
for(var/B in C.catalysts)
if(!has_reagent(B, C.catalysts[B]))
@@ -169,7 +168,7 @@
if(!isnull(data)) // For all we know, it could be zero or empty string and meaningful
current.mix_data(data, amount)
update_total()
if(!safety)
if(!safety)
handle_reactions()
if(my_atom)
my_atom.on_reagent_change()
@@ -183,7 +182,7 @@
R.initialize_data(data)
update_total()
if(!safety)
handle_reactions()
handle_reactions()
if(my_atom)
my_atom.on_reagent_change()
return 1
@@ -218,7 +217,7 @@
/datum/reagents/proc/has_reagent(var/id, var/amount = 0)
for(var/datum/reagent/current in reagent_list)
if(current.id == id)
if(current.volume >= amount)
if(current.volume >= amount)
return 1
else
return 0
@@ -234,12 +233,12 @@
if(current.id == id)
return current.volume
return 0
/datum/reagents/proc/get_data(var/id)
for(var/datum/reagent/current in reagent_list)
if(current.id == id)
return current.get_data()
return 0
return 0
/datum/reagents/proc/get_reagents()
var/res = ""
@@ -255,14 +254,14 @@
amount = min(amount, total_volume)
if(!amount)
return
return
var/part = amount / total_volume
for(var/datum/reagent/current in reagent_list)
var/amount_to_remove = current.volume * part
remove_reagent(current.id, amount_to_remove, 1)
update_total()
handle_reactions()
return amount
@@ -431,6 +430,6 @@
/* Atom reagent creation - use it all the time */
/atom/proc/create_reagents(var/max_vol)
/atom/proc/create_reagents(var/max_vol)
reagents = new/datum/reagents(max_vol)
reagents.my_atom = src
reagents.my_atom = src

View File

@@ -587,12 +587,12 @@
var/limit = 10
var/list/holdingitems = list()
var/list/sheet_reagents = list(
/obj/item/stack/sheet/mineral/iron = "iron",
/obj/item/stack/sheet/mineral/uranium = "uranium",
/obj/item/stack/sheet/mineral/phoron = "phoron",
/obj/item/stack/sheet/mineral/gold = "gold",
/obj/item/stack/sheet/mineral/silver = "silver",
/obj/item/stack/sheet/mineral/mhydrogen = "hydrogen"
/obj/item/stack/material/iron = "iron",
/obj/item/stack/material/uranium = "uranium",
/obj/item/stack/material/phoron = "phoron",
/obj/item/stack/material/gold = "gold",
/obj/item/stack/material/silver = "silver",
/obj/item/stack/material/mhydrogen = "hydrogen"
)
/obj/machinery/reagentgrinder/New()
@@ -798,4 +798,4 @@
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
#undef REAGENTS_PER_SHEET
#undef REAGENTS_PER_SHEET

View File

@@ -24,212 +24,258 @@ About the Holder:
The holder (reagents datum) is the datum that holds a list of all reagents
currently in the object.It also has all the procs needed to manipulate reagents
remove_any(var/amount)
This proc removes reagents from the holder until the passed amount
is matched. It'll try to remove some of ALL reagents contained.
Vars:
list/datum/reagent/reagent_list
List of reagent datums.
trans_to(var/obj/target, var/amount)
This proc equally transfers the contents of the holder to another
objects holder. You need to pass it the object (not the holder) you want
to transfer to and the amount you want to transfer. Its return value is the
actual amount transfered (if one of the objects is full/empty)
total_volume
Total volume of all reagents.
trans_id_to(var/obj/target, var/reagent, var/amount)
Same as above but only for a specific reagent in the reagent list.
If the specified amount is greater than what is available, it will use
the amount of the reagent that is available. If no reagent exists, returns null.
maximum_volume
Maximum volume.
metabolize(var/mob/M)
This proc is called by the mobs life proc. It simply calls on_mob_life for
all contained reagents. You shouldnt have to use this one directly.
atom/my_atom
Reference to the object that contains this.
handle_reactions()
This proc check all recipes and, on a match, uses them.
It will also call the recipe's on_reaction proc (for explosions or w/e).
Currently, this proc is automatically called by trans_to.
- Modified from the original to preserve reagent data across reactions (originally for xenoarchaeology)
Procs:
isolate_reagent(var/reagent)
Pass it a reagent id and it will remove all reagents but that one.
It's that simple.
get_free_space()
Returns the remaining free volume in the holder.
del_reagent(var/reagent)
Completely remove the reagent with the matching id.
get_master_reagent()
Returns the reference to the reagent with the largest volume
reaction_fire(exposed_temp)
Simply calls the reaction_fire procs of all contained reagents.
get_master_reagent_name()
Ditto, but returns the name.
get_master_reagent_id()
Ditto, but returns ID.
update_total()
This one simply updates the total volume of the holder.
(the volume of all reagents added together)
Updates total volume, called automatically.
handle_reactions()
Checks reagents and triggers any reactions that happen. Usually called automatically.
add_reagent(var/id, var/amount, var/data = null, var/safety = 0)
Adds [amount] units of [id] reagent. [data] will be passed to reagent's mix_data() or initialize_data(). If [safety] is 0, handle_reactions() will be called. Returns 1 if successful, 0 otherwise.
remove_reagent(var/id, var/amount, var/safety = 0)
Ditto, but removes reagent. Returns 1 if successful, 0 otherwise.
del_reagent(var/id)
Removes all of the reagent.
has_reagent(var/id, var/amount = 0)
Checks if holder has at least [amount] of [id] reagent. Returns 1 if the reagent is found and volume is above [amount]. Returns 0 otherwise.
clear_reagents()
This proc removes ALL reagents from the holder.
Removes all reagents.
reaction(var/atom/A, var/method=TOUCH, var/volume_modifier=0)
This proc calls the appropriate reaction procs of the reagents.
I.e. if A is an object, it will call the reagents reaction_obj
proc. The method var is used for reaction on mobs. It simply tells
us if the mob TOUCHed the reagent or if it INGESTed the reagent.
Since the volume can be checked in a reagents proc, you might want to
use the volume_modifier var to modifiy the passed value without actually
changing the volume of the reagents.
If you're not sure if you need to use this the answer is very most likely 'No'.
You'll want to use this proc whenever an atom first comes in
contact with the reagents of a holder. (in the 'splash' part of a beaker i.e.)
More on the reaction in the reagent part of this readme.
get_reagent_amount(var/id)
Returns reagent volume. Returns 0 if reagent is not found.
add_reagent(var/reagent, var/amount, var/data)
Attempts to add X of the matching reagent to the holder.
You wont use this much. Mostly in new procs for pre-filled
objects.
get_data(var/id)
Returns get_data() of the reagent.
remove_reagent(var/reagent, var/amount)
The exact opposite of the add_reagent proc.
- Modified from original to return the reagent's data, in order to preserve reagent data across reactions (originally for xenoarchaeology)
get_reagents()
Returns a string containing all reagent ids and volumes, e.g. "carbon(4),nittrogen(5)".
has_reagent(var/reagent, var/amount)
Returns 1 if the holder contains this reagent.
Or 0 if not.
If you pass it an amount it will additionally check
if the amount is matched. This is optional.
remove_any(var/amount = 1)
Removes up to [amount] of reagents from [src]. Returns actual amount removed.
get_reagent_amount(var/reagent)
Returns the amount of the matching reagent inside the
holder. Returns 0 if the reagent is missing.
trans_to_holder(var/datum/reagents/target, var/amount = 1, var/multiplier = 1, var/copy = 0)
Transfers [amount] reagents from [src] to [target], multiplying them by [multiplier]. Returns actual amount removed from [src] (not amount transferred to [target]). If [copy] is 1, copies reagents instead.
Important variables:
touch(var/atom/target)
Not recommended to use. Calls touch_mob(target), touch_turf(target), or touch_obj(target), depending on target's type.
total_volume
This variable contains the total volume of all reagents in this holder.
touch_mob(var/mob/target)
Calls each reagent's touch_mob(target).
reagent_list
This is a list of all contained reagents. More specifically, references
to the reagent datums.
touch_turf(var/turf/target)
Calls each reagent's touch_turf(target).
maximum_volume
This is the maximum volume of the holder.
touch_obj(var/obj/target)
Calls each reagent's touch_obj(target).
my_atom
This is the atom the holder is 'in'. Useful if you need to find the location.
(i.e. for explosions)
trans_to(var/atom/target, var/amount = 1, var/multiplier = 1, var/copy = 0)
Checks the type of [target], calling splash_mob(target, amount), trans_to_turf(target, amount, multiplier, copy), or trans_to_obj(target, amount, multiplier, copy).
trans_id_to(var/atom/target, var/id, var/amount = 1)
Transfers [amount] of [id] to [target]. Returns amount transferred.
splash_mob(var/mob/target, var/amount = 1, var/clothes = 1)
Checks mob's clothing if [clothes] is 1 and transfers [amount] reagents to mob's skin.
trans_to_mob(var/mob/target, var/amount = 1, var/type = CHEM_BLOOD, var/multiplier = 1, var/copy = 0)
Transfers [amount] reagents to the mob's appropriate holder, depending on [type]. Ignores protection.
trans_to_turf(var/turf/target, var/amount = 1, var/multiplier = 1, var/copy = 0)
Turfs don't currently have any reagents. Puts [amount] reagents into a temporary holder, calls touch_turf(target) from it, and deletes it.
trans_to_obj(var/turf/target, var/amount = 1, var/multiplier = 1, var/copy = 0)
If target has reagents, transfers [amount] to it. Otherwise, same as trans_to_turf().
/atom/proc/create_reagents(var/max_vol)
Creates a new reagent datum.
About Reagents:
Reagents are all the things you can mix and fille in bottles etc. This can be anything from
rejuvs over water to ... iron. Each reagent also has a few procs - i'll explain those below.
rejuvs over water to... iron.
reaction_mob(var/mob/M, var/method=TOUCH)
This is called by the holder's reation proc.
This version is only called when the reagent
reacts with a mob. The method var can be either
TOUCH or INGEST. You'll want to put stuff like
acid-facemelting in here.
reaction_obj(var/obj/O)
This is called by the holder's reation proc.
This version is called when the reagents reacts
with an object. You'll want to put stuff like
object melting in here ... or something. i dunno.
reaction_turf(var/turf/T)
This is called by the holder's reaction proc.
This version is called when the reagents reacts
with a turf. You'll want to put stuff like extra
slippery floors for lube or something in here.
on_mob_life(var/mob/M)
This proc is called everytime the mobs life proc executes.
This is the place where you put damage for toxins ,
drowsyness for sleep toxins etc etc.
You'll want to call the parents proc by using ..() .
If you don't, the chemical will stay in the mob forever -
unless you write your own piece of code to slowly remove it.
(Should be pretty easy, 1 line of code)
Important variables:
holder
This variable contains a reference to the holder the chemical is 'in'
volume
This is the volume of the reagent.
id
The id of the reagent
Vars:
name
The name of the reagent.
Name that shows up in-game.
data
This var can be used for whatever the fuck you want. I used it for the sleep
toxins to make them work slowly instead of instantly. You could also use this
for DNA in a blood reagent or ... well whatever you want.
id
ID that is used for internal tracking. MUST BE UNIQUE.
description
Description that shows up in-game.
datum/reagents/holder
Reference to holder.
reagent_state
Could be GAS, LIQUID, or SOLID. Affects nothing. Reserved for future use.
list/data
Use varies by reagent. Custom variable. For example, blood stores blood group and viruses.
volume
Current volume.
metabolism
How quickly reagent is processed in mob's bloodstream; by default aslo affects ingest and touch metabolism.
ingest_met
How quickly reagent is processed when ingested; [metabolism] is used if zero.
touch_met
Ditto when touching.
dose
How much of the reagent has been processed, limited by [max_dose]. Used for reagents with varying effects (e.g. ethanol or rezadone) and overdosing.
max_dose
Maximum amount of reagent that has ever been in a mob. Exists so dose won't grow infinitely when small amounts of reagent are added over time.
overdose
If [dose] is bigger than [overdose], overdose() proc is called every tick.
scannable
If set to 1, will show up on health analyzers by name.
affects_dead
If set to 1, will affect dead players. Used by Adminordrazine.
glass_icon_state
Used by drinks. icon_state of the glass when this reagent is the master reagent.
glass_name
Ditto for glass name.
glass_desc
Ditto for glass desciption.
glass_center_of_mass
Used for glass placement on tables.
color
This is a hexadecimal color that represents the reagent outside of containers,
you define it as "#RRGGBB", or, red green blue. You can also define it using the
rgb() proc, which returns a hexadecimal value too. The color is black by default.
"#RRGGBB" or "#RRGGBBAA" where A is alpha channel.
A good website for color calculations: http://www.psyclops.com/tools/rgb/
color_weight
How much reagent affects color of holder. Used by paint.
Procs:
remove_self(var/amount)
Removes [amount] of itself.
touch_mob(var/mob/M)
Called when reagent is in another holder and not splashing the mob. Can be used with noncarbons.
touch_obj(var/obj/O)
How reagent reacts with objects.
touch_turf(var/turf/T)
How reagent reacts with turfs.
on_mob_life(var/mob/living/carbon/M, var/alien, var/location)
Makes necessary checks and calls one of affect procs.
affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
How reagent affects mob when injected. [removed] is the amount of reagent that has been removed this tick. [alien] is the mob's reagent flag.
affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
Ditto, ingested. Defaults to affect_blood with halved dose.
affect_touch(var/mob/living/carbon/M, var/alien, var/removed)
Ditto, touching.
overdose(var/mob/living/carbon/M, var/alien)
Called when dose is above overdose. Defaults to M.adjustToxLoss(REM).
initialize_data(var/newdata)
Called when reagent is created. Defaults to setting [data] to [newdata].
mix_data(var/newdata, var/newamount)
Called when [newamount] of reagent with [newdata] data is added to the current reagent. Used by paint.
get_data()
Returns data. Can be overriden.
About Recipes:
Recipes are simple datums that contain a list of required reagents and a result.
They also have a proc that is called when the recipe is matched.
on_reaction(var/datum/reagents/holder, var/created_volume)
This proc is called when the recipe is matched.
You'll want to add explosions etc here.
To find the location you'll have to do something
like get_turf(holder.my_atom)
Vars:
name & id
Should be pretty obvious.
name
Name of the reaction, currently unused.
id
ID of the reaction, must be unique.
result
This var contains the id of the resulting reagent.
ID of the resulting reagent. Can be null.
required_reagents
This is a list of ids of the required reagents.
Each id also needs an associated value that gives us the minimum required amount
of that reagent. The handle_reaction proc can detect mutiples of the same recipes
so for most cases you want to set the required amount to 1.
list/required_reagents
Reagents that are required for the reaction and are used up during it.
required_catalysts (Added May 2011)
This is a list of the ids of the required catalysts.
Functionally similar to required_reagents, it is a list of reagents that are required
for the reaction. However, unlike required_reagents, catalysts are NOT consumed.
They mearly have to be present in the container.
list/catalysts
Ditto, but not used up.
list/inhibitors
Opposite, prevent the reaction from happening.
result_amount
This is the amount of the resulting reagent this recipe will produce.
I recommend you set this to the total volume of all required reagent.
Amount of resulting reagent.
required_container
The container the recipe has to take place in in order to happen. Leave this blank/null
if you want the reaction to happen anywhere.
mix_message
Message that is shown to mobs when reaction happens.
required_other
Basically like a reagent's data variable. You can set extra requirements for a
reaction with this.
Procs:
can_happen(var/datum/reagents/holder)
Customizable. If it returns 0, reaction will not happen. Defaults to always returning 1. Used by slime core reactions.
on_reaction(var/datum/reagents/holder, var/created_volume)
Called when reaction happens. Used by explosives.
send_data(var/datum/reagents/T)
Sets resulting reagent's data. Used by blood paint.
About the Tools:
By default, all atom have a reagents var - but its empty. if you want to use an object for the chem.
system you'll need to add something like this in its new proc:
var/datum/reagents/R = new/datum/reagents(100) <<<<< create a new datum , 100 is the maximum_volume of the new holder datum.
reagents = R <<<<< assign the new datum to the objects reagents var
R.my_atom = src <<<<< set the holders my_atom to src so that we know where we are.
This can also be done by calling a convenience proc:
atom/proc/create_reagents(var/max_volume)
/atom/proc/create_reagents(var/max_volume)
Other important stuff:

View File

@@ -11,6 +11,17 @@
description = "A chemical element, the builing block of life."
reagent_state = SOLID
color = "#1C1300"
ingest_met = REM * 5
/datum/reagent/carbon/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
return
if(M.ingested && M.ingested.reagent_list.len > 1) // Need to have at least 2 reagents - cabon and something to remove
var/effect = 1 / (M.ingested.reagent_list.len - 1)
for(var/datum/reagent/R in M.ingested.reagent_list)
if(R == src)
continue
M.ingested.remove_reagent(R.id, removed * effect)
/datum/reagent/carbon/touch_turf(var/turf/T)
if(!istype(T, /turf/space))

View File

@@ -329,7 +329,7 @@
M.stuttering = 0
M.confused = 0
if(M.ingested)
for(var/datum/reagent/R in M.ingested)
for(var/datum/reagent/R in M.ingested.reagent_list)
if(istype(R, /datum/reagent/ethanol))
R.dose = max(R.dose - removed * 5, 0)

View File

@@ -439,7 +439,7 @@
result_amount = 1
/datum/chemical_reaction/phoronsolidification/on_reaction(var/datum/reagents/holder, var/created_volume)
new /obj/item/stack/sheet/mineral/phoron(get_turf(holder.my_atom), created_volume)
new /obj/item/stack/material/phoron(get_turf(holder.my_atom), created_volume)
return
/datum/chemical_reaction/plastication
@@ -450,7 +450,7 @@
result_amount = 1
/datum/chemical_reaction/plastication/on_reaction(var/datum/reagents/holder, var/created_volume)
new /obj/item/stack/sheet/mineral/plastic(get_turf(holder.my_atom), created_volume)
new /obj/item/stack/material/plastic(get_turf(holder.my_atom), created_volume)
return
/* Grenade reactions */
@@ -884,7 +884,7 @@
if(T.Uses <= 0)
T.visible_message("\icon[T]<span class='notice'>\The [T]'s power is consumed in the reaction.</span>")
T.name = "used slime extract"
T.desc = "This extract has been used up."
T.desc = "This extract has been used up."
//Grey
/datum/chemical_reaction/slime/spawn
@@ -934,10 +934,10 @@
required = /obj/item/slime_extract/metal
/datum/chemical_reaction/slime/metal/on_reaction(var/datum/reagents/holder)
var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal
var/obj/item/stack/material/steel/M = new /obj/item/stack/material/steel
M.amount = 15
M.loc = get_turf(holder.my_atom)
var/obj/item/stack/sheet/plasteel/P = new /obj/item/stack/sheet/plasteel
var/obj/item/stack/material/plasteel/P = new /obj/item/stack/material/plasteel
P.amount = 5
P.loc = get_turf(holder.my_atom)
..()
@@ -1104,7 +1104,7 @@
/datum/chemical_reaction/slime/plasma/on_reaction(var/datum/reagents/holder)
..()
var/obj/item/stack/sheet/mineral/phoron/P = new /obj/item/stack/sheet/mineral/phoron
var/obj/item/stack/material/phoron/P = new /obj/item/stack/material/phoron
P.amount = 10
P.loc = get_turf(holder.my_atom)
@@ -1145,7 +1145,7 @@
var/obj/item/weapon/slimepotion/P = new /obj/item/weapon/slimepotion
P.loc = get_turf(holder.my_atom)
//Black
//Black
/datum/chemical_reaction/slime/mutate2
name = "Advanced Mutation Toxin"
id = "mutationtoxin2"
@@ -1154,7 +1154,7 @@
result_amount = 1
required = /obj/item/slime_extract/black
//Oil
//Oil
/datum/chemical_reaction/slime/explosion
name = "Slime Explosion"
id = "m_explosion"
@@ -1167,7 +1167,7 @@
/datum/chemical_reaction/slime/explosion/on_reaction(var/datum/reagents/holder)
..()
sleep(50)
explosion(get_turf(holder.my_atom), 1, 3, 6)
explosion(get_turf(holder.my_atom), 1, 3, 6)
//Light Pink
/datum/chemical_reaction/slime/potion2
@@ -1266,32 +1266,32 @@
var/location = get_turf(holder.my_atom)
for(var/i = 1, i <= created_volume, i++)
new /obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesewheel(location)
return
/datum/chemical_reaction/meatball
name = "Meatball"
id = "meatball"
result = null
required_reagents = list("protein" = 3, "flour" = 5)
result_amount = 3
return
/datum/chemical_reaction/meatball
name = "Meatball"
id = "meatball"
result = null
required_reagents = list("protein" = 3, "flour" = 5)
result_amount = 3
/datum/chemical_reaction/meatball/on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
for(var/i = 1, i <= created_volume, i++)
new /obj/item/weapon/reagent_containers/food/snacks/meatball(location)
return
/datum/chemical_reaction/dough
name = "Dough"
id = "dough"
result = null
required_reagents = list("egg" = 3, "flour" = 10)
result_amount = 1
for(var/i = 1, i <= created_volume, i++)
new /obj/item/weapon/reagent_containers/food/snacks/meatball(location)
return
/datum/chemical_reaction/dough
name = "Dough"
id = "dough"
result = null
required_reagents = list("egg" = 3, "flour" = 10)
result_amount = 1
/datum/chemical_reaction/dough/on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
for(var/i = 1, i <= created_volume, i++)
new /obj/item/weapon/reagent_containers/food/snacks/dough(location)
for(var/i = 1, i <= created_volume, i++)
new /obj/item/weapon/reagent_containers/food/snacks/dough(location)
return
/datum/chemical_reaction/syntiflesh
@@ -1941,4 +1941,4 @@ datum
required_reagents = list("density_separated_sample" = 5)
result_amount = 4
requires_heating = 1
*/
*/

View File

@@ -16,7 +16,7 @@
var/obj/item/weapon/broken_bottle/B = new /obj/item/weapon/broken_bottle(user.loc)
user.put_in_active_hand(B)
if(prob(33))
new/obj/item/weapon/shard(target.loc) // Create a glass shard at the target's location!
new/obj/item/weapon/material/shard(target.loc) // Create a glass shard at the target's location!
B.icon_state = src.icon_state
var/icon/I = new('icons/obj/drinks.dmi', src.icon_state)

View File

@@ -1,6 +1,6 @@
/obj/item/weapon/reagent_containers/food/snacks/breadslice/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/shard) || istype(W,/obj/item/weapon/reagent_containers/food/snacks))
if(istype(W,/obj/item/weapon/material/shard) || istype(W,/obj/item/weapon/reagent_containers/food/snacks))
var/obj/item/weapon/reagent_containers/food/snacks/csandwich/S = new(get_turf(src))
S.attackby(W,user)
qdel(src)
@@ -25,7 +25,7 @@
if(src.contents.len > sandwich_limit)
user << "\red If you put anything else on \the [src] it's going to collapse."
return
else if(istype(W,/obj/item/weapon/shard))
else if(istype(W,/obj/item/weapon/material/shard))
user << "\blue You hide [W] in \the [src]."
user.drop_item()
W.loc = src
@@ -87,7 +87,7 @@
var/obj/item/shard
for(var/obj/item/O in contents)
if(istype(O,/obj/item/weapon/shard))
if(istype(O,/obj/item/weapon/material/shard))
shard = O
break

View File

@@ -48,12 +48,12 @@
if(H.species.flags & IS_SYNTHETIC)
H << "<span class='danger'>You have a monitor for a head, where do you think you're going to put that?</span>"
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
user << "<span class='warning'>\The [blocked] is in the way!</span>"
return
if (fullness <= 50)
M << "<span class='danger'>You hungrily chew out a piece of [src] and gobble it!</span>"
if (fullness > 50 && fullness <= 150)
@@ -71,7 +71,7 @@
if(H.species.flags & IS_SYNTHETIC)
user << "<span class='danger'>They have a monitor for a head, where do you think you're going to put that?</span>"
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
user << "<span class='warning'>\The [blocked] is in the way!</span>"
@@ -128,8 +128,8 @@
return
// Eating with forks
if(istype(W,/obj/item/weapon/kitchen/utensil))
var/obj/item/weapon/kitchen/utensil/U = W
if(istype(W,/obj/item/weapon/material/kitchen/utensil))
var/obj/item/weapon/material/kitchen/utensil/U = W
if(!U.reagents)
U.create_reagents(5)
@@ -186,9 +186,9 @@
var/reagents_per_slice = reagents.total_volume/slices_num
for(var/i=1 to (slices_num-slices_lost))
var/obj/slice = new slice_path (src.loc)
var/obj/slice = new slice_path (src.loc)
reagents.trans_to_obj(slice, reagents_per_slice)
qdel(src)
qdel(src)
return
/obj/item/weapon/reagent_containers/food/snacks/proc/is_sliceable()
@@ -2819,7 +2819,7 @@
// Dough + rolling pin = flat dough
/obj/item/weapon/reagent_containers/food/snacks/dough/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/kitchen/rollingpin))
if(istype(W,/obj/item/weapon/material/kitchen/rollingpin))
new /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough(src)
user << "You flatten the dough."
qdel(src)
@@ -2964,7 +2964,7 @@
// potato + knife = raw sticks
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/kitchen/utensil/knife))
if(istype(W,/obj/item/weapon/material/kitchen/utensil/knife))
new /obj/item/weapon/reagent_containers/food/snacks/rawsticks(src)
user << "You cut the potato."
qdel(src)

View File

@@ -10,7 +10,7 @@
src.bitesize = 3
/obj/item/weapon/reagent_containers/food/snacks/meat/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/kitchenknife))
if(istype(W,/obj/item/weapon/material/knife))
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)

View File

@@ -68,16 +68,16 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
reagents.trans_to_obj(I, reagents.total_volume)
if(g_amount >= 3750)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(loc)
var/obj/item/stack/material/glass/G = new /obj/item/stack/material/glass(loc)
G.amount = round(g_amount / 3750)
if(gold_amount >= 2000)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(loc)
var/obj/item/stack/material/gold/G = new /obj/item/stack/material/gold(loc)
G.amount = round(gold_amount / 2000)
if(diamond_amount >= 2000)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(loc)
var/obj/item/stack/material/diamond/G = new /obj/item/stack/material/diamond(loc)
G.amount = round(diamond_amount / 2000)
if(uranium_amount >= 2000)
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(loc)
var/obj/item/stack/material/uranium/G = new /obj/item/stack/material/uranium(loc)
G.amount = round(uranium_amount / 2000)
..()
@@ -104,7 +104,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
return 1
if(O.is_open_container())
return 0
// if(!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/mineral/gold) && !istype(O, /obj/item/stack/sheet/mineral/diamond) && !istype(O, /obj/item/stack/sheet/mineral/uranium))
// if(!istype(O, /obj/item/stack/material/glass) && !istype(O, /obj/item/stack/material/gold) && !istype(O, /obj/item/stack/material/diamond) && !istype(O, /obj/item/stack/material/uranium))
// user << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
// return 1
if(stat)
@@ -113,9 +113,9 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
user << "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>"
return 1
if(istype(O, /obj/item/stack/sheet/glass) || istype(O, /obj/item/stack/sheet/mineral/gold) || istype(O, /obj/item/stack/sheet/mineral/diamond) || istype(O, /obj/item/stack/sheet/mineral/uranium))
if(istype(O, /obj/item/stack/material/glass) || istype(O, /obj/item/stack/material/gold) || istype(O, /obj/item/stack/material/diamond) || istype(O, /obj/item/stack/material/uranium))
var/obj/item/stack/sheet/stack = O
var/obj/item/stack/material/stack = O
if((TotalMaterials() + stack.perunit) > max_material_amount)
user << "<span class='notice'>\The [src] is full. Please remove glass from \the [src] in order to insert more.</span>"
return 1
@@ -135,13 +135,13 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
if(do_after(usr, 16))
user << "<span class='notice'>You add [amount] sheets to \the [src].</span>"
switch(stacktype)
if(/obj/item/stack/sheet/glass)
if(/obj/item/stack/material/glass)
g_amount += amount * 3750
if(/obj/item/stack/sheet/mineral/gold)
if(/obj/item/stack/material/gold)
gold_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/diamond)
if(/obj/item/stack/material/diamond)
diamond_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/uranium)
if(/obj/item/stack/material/uranium)
uranium_amount += amount * 2000
else
new stacktype(loc, amount)

View File

@@ -63,25 +63,25 @@ Note: Must be placed west/left of and R&D console to function.
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
reagents.trans_to_obj(I, reagents.total_volume)
if(m_amount >= 3750)
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(loc)
var/obj/item/stack/material/steel/G = new /obj/item/stack/material/steel(loc)
G.amount = round(m_amount / G.perunit)
if(g_amount >= 3750)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(loc)
var/obj/item/stack/material/glass/G = new /obj/item/stack/material/glass(loc)
G.amount = round(g_amount / G.perunit)
if(phoron_amount >= 2000)
var/obj/item/stack/sheet/mineral/phoron/G = new /obj/item/stack/sheet/mineral/phoron(loc)
var/obj/item/stack/material/phoron/G = new /obj/item/stack/material/phoron(loc)
G.amount = round(phoron_amount / G.perunit)
if(silver_amount >= 2000)
var/obj/item/stack/sheet/mineral/silver/G = new /obj/item/stack/sheet/mineral/silver(loc)
var/obj/item/stack/material/silver/G = new /obj/item/stack/material/silver(loc)
G.amount = round(silver_amount / G.perunit)
if(gold_amount >= 2000)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(loc)
var/obj/item/stack/material/gold/G = new /obj/item/stack/material/gold(loc)
G.amount = round(gold_amount / G.perunit)
if(uranium_amount >= 2000)
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(loc)
var/obj/item/stack/material/uranium/G = new /obj/item/stack/material/uranium(loc)
G.amount = round(uranium_amount / G.perunit)
if(diamond_amount >= 2000)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(loc)
var/obj/item/stack/material/diamond/G = new /obj/item/stack/material/diamond(loc)
G.amount = round(diamond_amount / G.perunit)
..()
@@ -118,13 +118,13 @@ Note: Must be placed west/left of and R&D console to function.
return 1
if(stat)
return 1
if(istype(O,/obj/item/stack/sheet))
var/obj/item/stack/sheet/S = O
if(istype(O,/obj/item/stack/material))
var/obj/item/stack/material/S = O
if(TotalMaterials() + S.perunit > max_material_storage)
user << "<span class='notice'>\The [src]'s material bin is full. Please remove material before adding more.</span>"
return 1
var/obj/item/stack/sheet/stack = O
var/obj/item/stack/material/stack = O
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
if(!O)
return
@@ -150,19 +150,19 @@ Note: Must be placed west/left of and R&D console to function.
user << "<span class='notice'>You add [amount] sheets to \the [src].</span>"
icon_state = "protolathe"
switch(stacktype)
if(/obj/item/stack/sheet/metal)
if(/obj/item/stack/material/steel)
m_amount += amount * 3750
if(/obj/item/stack/sheet/glass)
if(/obj/item/stack/material/glass)
g_amount += amount * 3750
if(/obj/item/stack/sheet/mineral/gold)
if(/obj/item/stack/material/gold)
gold_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/silver)
if(/obj/item/stack/material/silver)
silver_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/phoron)
if(/obj/item/stack/material/phoron)
phoron_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/uranium)
if(/obj/item/stack/material/uranium)
uranium_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/diamond)
if(/obj/item/stack/material/diamond)
diamond_amount += amount * 2000
else
new stacktype(loc, amount)

View File

@@ -269,8 +269,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
for(var/obj/I in linked_destroy.contents)
for(var/mob/M in I.contents)
M.death()
if(istype(I,/obj/item/stack/sheet))//Only deconsturcts one sheet at a time instead of the entire stack
var/obj/item/stack/sheet/S = I
if(istype(I,/obj/item/stack/material))//Only deconsturcts one sheet at a time instead of the entire stack
var/obj/item/stack/material/S = I
if(S.get_amount() > 1)
S.use(1)
linked_destroy.loaded_item = S
@@ -460,7 +460,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
res_amount = "diamond_amount"
if(ispath(type) && hasvar(linked_lathe, res_amount))
var/obj/item/stack/sheet/sheet = new type(linked_lathe.loc)
var/obj/item/stack/material/sheet = new type(linked_lathe.loc)
var/available_num_sheets = round(linked_lathe.vars[res_amount]/sheet.perunit)
if(available_num_sheets>0)
sheet.amount = min(available_num_sheets, desired_num_sheets)
@@ -472,19 +472,19 @@ won't update every console in existence) but it's more of a hassle to do. Also,
var/res_amount, type
switch(href_list["imprinter_ejectsheet"])
if("glass")
type = /obj/item/stack/sheet/glass
type = /obj/item/stack/material/glass
res_amount = "g_amount"
if("gold")
type = /obj/item/stack/sheet/mineral/gold
type = /obj/item/stack/material/gold
res_amount = "gold_amount"
if("diamond")
type = /obj/item/stack/sheet/mineral/diamond
type = /obj/item/stack/material/diamond
res_amount = "diamond_amount"
if("uranium")
type = /obj/item/stack/sheet/mineral/uranium
type = /obj/item/stack/material/uranium
res_amount = "uranium_amount"
if(ispath(type) && hasvar(linked_imprinter, res_amount))
var/obj/item/stack/sheet/sheet = new type(linked_imprinter.loc)
var/obj/item/stack/material/sheet = new type(linked_imprinter.loc)
var/available_num_sheets = round(linked_imprinter.vars[res_amount]/sheet.perunit)
if(available_num_sheets>0)
sheet.amount = min(available_num_sheets, desired_num_sheets)

View File

@@ -20,17 +20,17 @@
/obj/structure/crystal/Destroy()
src.visible_message("\red<b>[src] shatters!</b>")
if(prob(75))
new /obj/item/weapon/shard/phoron(src.loc)
new /obj/item/weapon/material/shard/phoron(src.loc)
if(prob(50))
new /obj/item/weapon/shard/phoron(src.loc)
new /obj/item/weapon/material/shard/phoron(src.loc)
if(prob(25))
new /obj/item/weapon/shard/phoron(src.loc)
new /obj/item/weapon/material/shard/phoron(src.loc)
if(prob(75))
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/material/shard(src.loc)
if(prob(50))
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/material/shard(src.loc)
if(prob(25))
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/material/shard(src.loc)
..()
//todo: laser_act

View File

@@ -43,17 +43,17 @@
/obj/item/weapon/autopsy_scanner,\
/obj/item/weapon/bikehorn,\
/obj/item/weapon/bonesetter,\
/obj/item/weapon/butch,\
/obj/item/weapon/material/knife/butch,\
/obj/item/weapon/caution,\
/obj/item/weapon/caution/cone,\
/obj/item/weapon/crowbar,\
/obj/item/weapon/clipboard,\
/obj/item/weapon/cell,\
/obj/item/weapon/circular_saw,\
/obj/item/weapon/hatchet,\
/obj/item/weapon/material/hatchet,\
/obj/item/weapon/handcuffs,\
/obj/item/weapon/hemostat,\
/obj/item/weapon/kitchenknife,\
/obj/item/weapon/material/knife,\
/obj/item/weapon/flame/lighter,\
/obj/item/weapon/light/bulb,\
/obj/item/weapon/light/tube,\

View File

@@ -136,11 +136,11 @@
if(3)
item_type = "[pick("fork","spoon","knife")]"
if(prob(25))
new_item = new /obj/item/weapon/kitchen/utensil/fork(src.loc)
new_item = new /obj/item/weapon/material/kitchen/utensil/fork(src.loc)
else if(prob(50))
new_item = new /obj/item/weapon/kitchen/utensil/knife(src.loc)
new_item = new /obj/item/weapon/material/kitchen/utensil/knife(src.loc)
else
new_item = new /obj/item/weapon/kitchen/utensil/spoon(src.loc)
new_item = new /obj/item/weapon/material/kitchen/utensil/spoon(src.loc)
additional_desc = "[pick("It's like no [item_type] you've ever seen before",\
"It's a mystery how anyone is supposed to eat with this",\
"You wonder what the creator's mouth was shaped like")]."
@@ -167,7 +167,7 @@
"You wonder what kind of music was made with it")]."
if(6)
item_type = "[pick("bladed knife","serrated blade","sharp cutting implement")]"
new_item = new /obj/item/weapon/kitchenknife(src.loc)
new_item = new /obj/item/weapon/material/knife(src.loc)
additional_desc = "[pick("It doesn't look safe.",\
"It looks wickedly jagged",\
"There appear to be [pick("dark red","dark purple","dark green","dark blue")] stains along the edges")]."
@@ -236,16 +236,16 @@
if(14)
apply_material_decorations = 0
var/list/possible_spawns = list()
possible_spawns += /obj/item/stack/sheet/metal
possible_spawns += /obj/item/stack/sheet/plasteel
possible_spawns += /obj/item/stack/sheet/glass
possible_spawns += /obj/item/stack/sheet/glass/reinforced
possible_spawns += /obj/item/stack/sheet/mineral/phoron
possible_spawns += /obj/item/stack/sheet/mineral/gold
possible_spawns += /obj/item/stack/sheet/mineral/silver
possible_spawns += /obj/item/stack/sheet/mineral/enruranium
possible_spawns += /obj/item/stack/sheet/mineral/sandstone
possible_spawns += /obj/item/stack/sheet/mineral/silver
possible_spawns += /obj/item/stack/material/steel
possible_spawns += /obj/item/stack/material/plasteel
possible_spawns += /obj/item/stack/material/glass
possible_spawns += /obj/item/stack/material/glass/reinforced
possible_spawns += /obj/item/stack/material/phoron
possible_spawns += /obj/item/stack/material/gold
possible_spawns += /obj/item/stack/material/silver
possible_spawns += /obj/item/stack/material/uranium
possible_spawns += /obj/item/stack/material/sandstone
possible_spawns += /obj/item/stack/material/silver
var/new_type = pick(possible_spawns)
new_item = new new_type(src.loc)
@@ -294,7 +294,7 @@
new_item.desc = ""
if(19)
apply_prefix = 0
new_item = new /obj/item/weapon/claymore(src.loc)
new_item = new /obj/item/weapon/material/sword(src.loc)
new_item.force = 10
item_type = new_item.name
if(20)
@@ -315,9 +315,9 @@
apply_material_decorations = 0
if(22)
if(prob(50))
new_item = new /obj/item/weapon/shard(src.loc)
new_item = new /obj/item/weapon/material/shard(src.loc)
else
new_item = new /obj/item/weapon/shard/phoron(src.loc)
new_item = new /obj/item/weapon/material/shard/phoron(src.loc)
apply_prefix = 0
apply_image_decorations = 0
apply_material_decorations = 0
@@ -337,7 +337,7 @@
apply_material_decorations = 0
if(25)
apply_prefix = 0
new_item = new /obj/item/weapon/katana(src.loc)
new_item = new /obj/item/weapon/material/sword/katana(src.loc)
new_item.force = 10
item_type = new_item.name
if(26)

View File

@@ -107,7 +107,7 @@
icon_state = "excavation"
desc = "A set of picks for excavation."
item_state = "syringe_kit"
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
foldable = /obj/item/stack/material/cardboard //BubbleWrap
storage_slots = 7
w_class = 2
can_hold = list(/obj/item/weapon/pickaxe/brush,\

View File

@@ -6,7 +6,7 @@
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/kitchen/utensil/fork = 20
/obj/item/weapon/material/kitchen/utensil/fork = 20
)
priority = 3

View File

@@ -18,7 +18,7 @@
/datum/surgery_step/open_encased/saw
allowed_tools = list(
/obj/item/weapon/circular_saw = 100, \
/obj/item/weapon/hatchet = 75
/obj/item/weapon/material/hatchet = 75
)
min_duration = 50

View File

@@ -20,8 +20,8 @@
/datum/surgery_step/eye/cut_open
allowed_tools = list(
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchenknife = 75, \
/obj/item/weapon/shard = 50, \
/obj/item/weapon/material/knife = 75, \
/obj/item/weapon/material/shard = 50, \
)
min_duration = 90
@@ -52,7 +52,7 @@
/datum/surgery_step/eye/lift_eyes
allowed_tools = list(
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/kitchen/utensil/fork = 50
/obj/item/weapon/material/kitchen/utensil/fork = 50
)
min_duration = 30

View File

@@ -17,8 +17,8 @@
/datum/surgery_step/generic/cut_face
allowed_tools = list(
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchenknife = 75, \
/obj/item/weapon/shard = 50, \
/obj/item/weapon/material/knife = 75, \
/obj/item/weapon/material/shard = 50, \
)
min_duration = 90
@@ -76,7 +76,7 @@
allowed_tools = list(
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 55, \
/obj/item/weapon/kitchen/utensil/fork = 75)
/obj/item/weapon/material/kitchen/utensil/fork = 75)
min_duration = 80
max_duration = 100

Some files were not shown because too many files have changed in this diff Show More