Merge pull request #525 from Zuhayr/qol

Porting various QOL from Bay.
This commit is contained in:
Neerti
2015-12-13 21:25:43 -05:00
38 changed files with 330 additions and 56 deletions
+18 -7
View File
@@ -12,6 +12,7 @@
throw_range = 5
origin_tech = list(TECH_MATERIAL = 1)
matter = list(DEFAULT_WALL_MATERIAL = 500)
var/elastic
var/dispenser = 0
var/breakouttime = 1200 //Deciseconds = 120s = 2 minutes
var/cuff_sound = 'sound/weapons/handcuffs.ogg'
@@ -53,20 +54,20 @@
var/mob/living/carbon/human/H = target
if(!istype(H))
return
return 0
if (!H.has_organ_for_slot(slot_handcuffed))
user << "<span class='danger'>\The [H] needs at least two wrists before you can cuff them together!</span>"
return
return 0
if(istype(H.gloves,/obj/item/clothing/gloves/rig)) // Can't cuff someone who's in a deployed hardsuit.
user << "<span class='danger'>The cuffs won't fit around \the [H.gloves]!</span>"
return
if(istype(H.gloves,/obj/item/clothing/gloves/rig) && !elastic) // Can't cuff someone who's in a deployed hardsuit.
user << "<span class='danger'>\The [src] won't fit around \the [H.gloves]!</span>"
return 0
user.visible_message("<span class='danger'>\The [user] is attempting to put [cuff_type] on \the [H]!</span>")
if(!do_after(user,30))
return
return 0
H.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been handcuffed (attempt) by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to handcuff [H.name] ([H.ckey])</font>")
@@ -84,7 +85,7 @@
cuffs.loc = target
target.handcuffed = cuffs
target.update_inv_handcuffed()
return
return 1
var/last_chew = 0
/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
@@ -118,6 +119,7 @@ var/last_chew = 0
breakouttime = 300 //Deciseconds = 30s
cuff_sound = 'sound/weapons/cablecuff.ogg'
cuff_type = "cable restraints"
elastic = 1
/obj/item/weapon/handcuffs/cable/red
color = "#DD0000"
@@ -156,3 +158,12 @@ var/last_chew = 0
/obj/item/weapon/handcuffs/cyborg
dispenser = 1
/obj/item/weapon/handcuffs/cable/tape
name = "tape restraints"
desc = "DIY!"
icon_state = "tape_cross"
item_state = null
icon = 'icons/obj/bureaucracy.dmi'
breakouttime = 200
cuff_type = "duct tape"
@@ -10,6 +10,7 @@
default_material = "wood"
force_divisor = 1.1 // 22 when wielded with weight 20 (steel)
unwielded_force_divisor = 0.7 // 15 when unwielded based on above.
slot_flags = SLOT_BACK
//Predefined materials go here.
/obj/item/weapon/material/twohanded/baseballbat/metal/New(var/newloc)
@@ -75,6 +75,17 @@
icon_state = "knife"
force_divisor = 0.1 // 6 when wielded with hardness 60 (steel)
// Identical to the tactical knife but nowhere near as stabby.
// Kind of like the toy esword compared to the real thing.
/obj/item/weapon/material/kitchen/utensil/knife/boot
name = "boot knife"
desc = "A small fixed-blade knife for putting inside a boot."
icon = 'icons/obj/weapons.dmi'
icon_state = "tacknife"
item_state = "knife"
applies_material_colour = 0
unbreakable = 1
/obj/item/weapon/material/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
user << "<span class='warning'>You accidentally cut yourself with the [src].</span>"
@@ -135,7 +135,7 @@
throwforce = 2
slot_flags = SLOT_BELT
storage_slots = 6
can_hold = list(/obj/item/clothing/mask/smokable/cigarette)
can_hold = list(/obj/item/clothing/mask/smokable/cigarette, /obj/item/weapon/flame/lighter)
icon_type = "cigarette"
/obj/item/weapon/storage/fancy/cigarettes/New()
@@ -4,6 +4,7 @@
name = "jetpack (empty)"
desc = "A tank of compressed gas for use as propulsion in zero-gravity areas. Use with caution."
icon_state = "jetpack"
gauge_icon = null
w_class = 4.0
item_state = "jetpack"
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
@@ -85,6 +85,7 @@
name = "phoron tank"
desc = "Contains dangerous phoron. Do not inhale. Warning: extremely flammable."
icon_state = "phoron"
gauge_icon = null
flags = CONDUCT
slot_flags = null //they have no straps!
@@ -114,6 +115,8 @@
name = "emergency oxygen tank"
desc = "Used for emergencies. Contains very little oxygen, so try to conserve it until you actually need it."
icon_state = "emergency"
gauge_icon = "indicator_emergency"
gauge_cap = 4
flags = CONDUCT
slot_flags = SLOT_BELT
w_class = 2.0
@@ -142,12 +145,15 @@
/obj/item/weapon/tank/emergency_oxygen/double
name = "double emergency oxygen tank"
icon_state = "emergency_double"
gauge_icon = "indicator_emergency_double"
volume = 10
/obj/item/weapon/tank/emergency_nitrogen
name = "emergency nitrogen tank"
desc = "An emergency air tank hastily painted red and issued to Vox crewmembers."
icon_state = "emergency_nitro"
gauge_icon = "indicator_emergency"
gauge_cap = 4
flags = CONDUCT
slot_flags = SLOT_BELT
w_class = 2.0
+29 -1
View File
@@ -1,9 +1,17 @@
#define TANK_MAX_RELEASE_PRESSURE (3*ONE_ATMOSPHERE)
#define TANK_DEFAULT_RELEASE_PRESSURE 24
#define TANK_IDEAL_PRESSURE 1015 //Arbitrary.
var/list/global/tank_gauge_cache = list()
/obj/item/weapon/tank
name = "tank"
icon = 'icons/obj/tank.dmi'
var/gauge_icon = "indicator_tank"
var/last_gauge_pressure
var/gauge_cap = 6
flags = CONDUCT
slot_flags = SLOT_BACK
w_class = 3
@@ -31,8 +39,8 @@
src.air_contents = new /datum/gas_mixture()
src.air_contents.volume = volume //liters
src.air_contents.temperature = T20C
processing_objects.Add(src)
update_gauge()
return
/obj/item/weapon/tank/Destroy()
@@ -220,8 +228,28 @@
/obj/item/weapon/tank/process()
//Allow for reactions
air_contents.react() //cooking up air tanks - add phoron and oxygen, then heat above PHORON_MINIMUM_BURN_TEMPERATURE
if(gauge_icon)
update_gauge()
check_status()
/obj/item/weapon/tank/proc/update_gauge()
var/gauge_pressure = 0
if(air_contents)
gauge_pressure = air_contents.return_pressure()
if(gauge_pressure > TANK_IDEAL_PRESSURE)
gauge_pressure = -1
else
gauge_pressure = round((gauge_pressure/TANK_IDEAL_PRESSURE)*gauge_cap)
if(gauge_pressure == last_gauge_pressure)
return
last_gauge_pressure = gauge_pressure
overlays.Cut()
var/indicator = "[gauge_icon][(gauge_pressure == -1) ? "overload" : gauge_pressure]"
if(!tank_gauge_cache[indicator])
tank_gauge_cache[indicator] = image(icon, indicator)
overlays += tank_gauge_cache[indicator]
/obj/item/weapon/tank/proc/check_status()
//Handle exploding, leaking, and rupturing of the tank
+63 -9
View File
@@ -5,18 +5,71 @@
icon_state = "taperoll"
w_class = 1
/* -- Disabled for now until it has a use --
/obj/item/weapon/tape_roll/attack_self(mob/user as mob)
user << "You remove a length of tape from [src]."
var/obj/item/weapon/ducttape/tape = new()
user.put_in_hands(tape)
*/
/obj/item/weapon/tape_roll/attack(var/mob/living/carbon/human/H, var/mob/user)
if(istype(H))
if(user.zone_sel.selecting == "eyes")
if(!H.organs_by_name["head"])
user << "<span class='warning'>\The [H] doesn't have a head.</span>"
return
if(!H.has_eyes())
user << "<span class='warning'>\The [H] doesn't have any eyes.</span>"
return
if(H.glasses)
user << "<span class='warning'>\The [H] is already wearing somethign on their eyes.</span>"
return
if(H.head && (H.head.body_parts_covered & FACE))
user << "<span class='warning'>Remove their [H.head] first.</span>"
return
user.visible_message("<span class='danger'>\The [user] begins taping over \the [H]'s eyes!</span>")
if(!do_after(user, 30))
return
// Repeat failure checks.
if(!H || !src || !H.organs_by_name["head"] || !H.has_eyes() || H.glasses || (H.head && (H.head.body_parts_covered & FACE)))
return
user.visible_message("<span class='danger'>\The [user] has taped up \the [H]'s eyes!</span>")
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/blindfold/tape(H), slot_glasses)
else if(user.zone_sel.selecting == "mouth" || user.zone_sel.selecting == "head")
if(!H.organs_by_name["head"])
user << "<span class='warning'>\The [H] doesn't have a head.</span>"
return
if(!H.check_has_mouth())
user << "<span class='warning'>\The [H] doesn't have a mouth.</span>"
return
if(H.wear_mask)
user << "<span class='warning'>\The [H] is already wearing a mask.</span>"
return
if(H.head && (H.head.body_parts_covered & FACE))
user << "<span class='warning'>Remove their [H.head] first.</span>"
return
user.visible_message("<span class='danger'>\The [user] begins taping up \the [H]'s mouth!</span>")
if(!do_after(user, 30))
return
// Repeat failure checks.
if(!H || !src || !H.organs_by_name["head"] || !H.check_has_mouth() || H.wear_mask || (H.head && (H.head.body_parts_covered & FACE)))
return
user.visible_message("<span class='danger'>\The [user] has taped up \the [H]'s mouth!</span>")
H.equip_to_slot_or_del(new /obj/item/clothing/mask/muzzle/tape(H), slot_wear_mask)
else if(user.zone_sel.selecting == "r_hand" || user.zone_sel.selecting == "l_hand")
var/obj/item/weapon/handcuffs/cable/tape/T = new(user)
if(!T.place_handcuffs(H, user))
user.unEquip(T)
qdel(T)
else
return ..()
return 1
/obj/item/weapon/tape_roll/proc/stick(var/obj/item/weapon/W, mob/user)
if(!istype(W, /obj/item/weapon/paper))
return
user.drop_from_inventory(W)
var/obj/item/weapon/ducttape/tape = new(get_turf(src))
tape.attach(W)
@@ -52,7 +105,7 @@
return
user << "You remove \the [initial(name)] from [stuck]."
user.drop_from_inventory(src)
stuck.forceMove(get_turf(src))
user.put_in_hands(stuck)
@@ -61,6 +114,7 @@
qdel(src)
/obj/item/weapon/ducttape/afterattack(var/A, mob/user, flag, params)
if(!in_range(user, A) || istype(A, /obj/machinery/door) || !stuck)
return
+2 -2
View File
@@ -20,8 +20,8 @@
/obj/structure/mopbucket/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/mop))
if(reagents.total_volume < 1)
user << "<span class='warning'>[src] is out of water!</span>"
user << "<span class='warning'>\The [src] is out of water!</span>"
else
reagents.trans_to_obj(I, 5)
user << "<span class='notice'>You wet [I] in [src].</span>"
user << "<span class='notice'>You wet \the [I] in \the [src].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
+7 -2
View File
@@ -316,11 +316,11 @@
/obj/machinery/shower/proc/process_heat(mob/living/M)
if(!on || !istype(M)) return
var/temperature = temperature_settings[watertemp]
var/temp_adj = between(BODYTEMP_COOLING_MAX, temperature - M.bodytemperature, BODYTEMP_HEATING_MAX)
M.bodytemperature += temp_adj
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(temperature >= H.species.heat_level_1)
@@ -411,6 +411,11 @@
// Short of a rewrite, this is necessary to stop monkeycubes being washed.
else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeycube))
return
else if(istype(O, /obj/item/weapon/mop))
O.reagents.add_reagent("water", 5)
user << "<span class='notice'>You wet \the [O] in \the [src].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return
var/turf/location = user.loc
if(!isturf(location)) return