Standardize CLUMSY

Conflicts:
	code/game/jobs/job/civilian.dm
	code/game/objects/items/weapons/defib.dm
	code/game/objects/items/weapons/stunbaton.dm
	code/modules/mob/living/silicon/robot/component.dm
	code/modules/reagents/reagent_containers/syringes.dm
This commit is contained in:
Rob Nelson
2014-01-21 13:53:13 -08:00
committed by ZomgPonies
parent 22a2df1115
commit d49e6d3bf4
34 changed files with 370 additions and 211 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ var/global/sent_honksquad = 0
equip_to_slot_or_del(new /obj/item/toy/crayon/rainbow(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/gun/energy/clown(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/spray/waterflower(src), slot_in_backpack)
src.mutations.Add(CLUMSY)
src.mutations.Add(M_CLUMSY)
+3 -3
View File
@@ -19,7 +19,7 @@
if(!armed)
if(ishuman(usr))
var/mob/living/carbon/human/user = usr
if(((user.getBrainLoss() >= 60 || (CLUMSY in user.mutations)) && prob(50)))
if(((user.getBrainLoss() >= 60 || (M_CLUMSY in user.mutations)) && prob(50)))
user << "Your hand slips, setting off the trigger."
pulse(0)
update_icon()
@@ -69,7 +69,7 @@
if(!armed)
user << "<span class='notice'>You arm [src].</span>"
else
if(((user.getBrainLoss() >= 60 || (CLUMSY in user.mutations)) && prob(50)))
if(((user.getBrainLoss() >= 60 || (M_CLUMSY in user.mutations)) && prob(50)))
var/which_hand = "l_hand"
if(!user.hand)
which_hand = "r_hand"
@@ -85,7 +85,7 @@
attack_hand(mob/living/user as mob)
if(armed)
if(((user.getBrainLoss() >= 60 || CLUMSY in user.mutations)) && prob(50))
if(((user.getBrainLoss() >= 60 || M_CLUMSY in user.mutations)) && prob(50))
var/which_hand = "l_hand"
if(!user.hand)
which_hand = "r_hand"
+160 -160
View File
@@ -1,160 +1,160 @@
// TODO: remove the robot.mmi and robot.cell variables and completely rely on the robot component system
/datum/robot_component/var/name
/datum/robot_component/var/installed = 0
/datum/robot_component/var/powered = 0
/datum/robot_component/var/toggled = 1
/datum/robot_component/var/brute_damage = 0
/datum/robot_component/var/electronics_damage = 0
/datum/robot_component/var/energy_consumption = 0
/datum/robot_component/var/max_damage = 30
/datum/robot_component/var/mob/living/silicon/robot/owner
// The actual device object that has to be installed for this.
/datum/robot_component/var/external_type = null
// The wrapped device(e.g. radio), only set if external_type isn't null
/datum/robot_component/var/obj/item/wrapped = null
/datum/robot_component/New(mob/living/silicon/robot/R)
src.owner = R
/datum/robot_component/proc/install()
/datum/robot_component/proc/uninstall()
/datum/robot_component/proc/destroy()
if(wrapped)
del wrapped
wrapped = new/obj/item/broken_device
// The thing itself isn't there anymore, but some fried remains are.
installed = -1
uninstall()
/datum/robot_component/proc/take_damage(brute, electronics, sharp)
if(installed != 1) return
brute_damage += brute
electronics_damage += electronics
if(brute_damage + electronics_damage >= max_damage) destroy()
/datum/robot_component/proc/heal_damage(brute, electronics)
if(installed != 1)
// If it's not installed, can't repair it.
return 0
brute_damage = max(0, brute_damage - brute)
electronics_damage = max(0, electronics_damage - electronics)
/datum/robot_component/proc/is_powered()
return (installed == 1) && (brute_damage + electronics_damage < max_damage) && (!energy_consumption || powered)
/datum/robot_component/proc/consume_power()
if(toggled == 0)
powered = 0
return
if(owner.cell.charge >= energy_consumption)
owner.cell.use(energy_consumption)
powered = 1
else
powered = 0
/datum/robot_component/armour
name = "armour plating"
energy_consumption = 0
external_type = /obj/item/robot_parts/robot_component/armour
max_damage = 60
/datum/robot_component/actuator
name = "actuator"
energy_consumption = 2
external_type = /obj/item/robot_parts/robot_component/actuator
max_damage = 50
/datum/robot_component/cell
name = "power cell"
max_damage = 50
/datum/robot_component/cell/destroy()
..()
owner.cell = null
/datum/robot_component/radio
name = "radio"
external_type = /obj/item/robot_parts/robot_component/radio
energy_consumption = 1
max_damage = 40
/datum/robot_component/binary_communication
name = "binary communication device"
external_type = /obj/item/robot_parts/robot_component/binary_communication_device
energy_consumption = 0
max_damage = 30
/datum/robot_component/camera
name = "camera"
external_type = /obj/item/robot_parts/robot_component/camera
energy_consumption = 1
max_damage = 40
/datum/robot_component/diagnosis_unit
name = "self-diagnosis unit"
energy_consumption = 1
external_type = /obj/item/robot_parts/robot_component/diagnosis_unit
max_damage = 30
/mob/living/silicon/robot/proc/initialize_components()
// This only initializes the components, it doesn't set them to installed.
components["actuator"] = new/datum/robot_component/actuator(src)
components["radio"] = new/datum/robot_component/radio(src)
components["power cell"] = new/datum/robot_component/cell(src)
components["diagnosis unit"] = new/datum/robot_component/diagnosis_unit(src)
components["camera"] = new/datum/robot_component/camera(src)
components["comms"] = new/datum/robot_component/binary_communication(src)
components["armour"] = new/datum/robot_component/armour(src)
/mob/living/silicon/robot/proc/is_component_functioning(module_name)
var/datum/robot_component/C = components[module_name]
return C && C.installed == 1 && C.toggled && C.is_powered()
/obj/item/broken_device
name = "broken component"
icon = 'icons/obj/robot_component.dmi'
icon_state = "broken"
/obj/item/robot_parts/robot_component
icon = 'icons/obj/robot_component.dmi'
icon_state = "working"
construction_time = 200
construction_cost = list("metal"=5000)
/obj/item/robot_parts/robot_component/binary_communication_device
name = "binary communication device"
icon_state = "binary_translator"
/obj/item/robot_parts/robot_component/actuator
name = "actuator"
icon_state = "actuator"
/obj/item/robot_parts/robot_component/armour
name = "armour plating"
icon_state = "armor_plating"
/obj/item/robot_parts/robot_component/camera
name = "camera"
icon_state = "camera"
/obj/item/robot_parts/robot_component/diagnosis_unit
name = "diagnosis unit"
icon_state = "diagnosis_unit"
/obj/item/robot_parts/robot_component/radio
name = "radio"
icon_state = "radio"
// TODO: remove the robot.mmi and robot.cell variables and completely rely on the robot component system
/datum/robot_component/var/name
/datum/robot_component/var/installed = 0
/datum/robot_component/var/powered = 0
/datum/robot_component/var/toggled = 1
/datum/robot_component/var/brute_damage = 0
/datum/robot_component/var/electronics_damage = 0
/datum/robot_component/var/energy_consumption = 0
/datum/robot_component/var/max_damage = 30
/datum/robot_component/var/mob/living/silicon/robot/owner
// The actual device object that has to be installed for this.
/datum/robot_component/var/external_type = null
// The wrapped device(e.g. radio), only set if external_type isn't null
/datum/robot_component/var/obj/item/wrapped = null
/datum/robot_component/New(mob/living/silicon/robot/R)
src.owner = R
/datum/robot_component/proc/install()
/datum/robot_component/proc/uninstall()
/datum/robot_component/proc/destroy()
if(wrapped)
del wrapped
wrapped = new/obj/item/broken_device
// The thing itself isn't there anymore, but some fried remains are.
installed = -1
uninstall()
/datum/robot_component/proc/take_damage(brute, electronics, sharp)
if(installed != 1) return
brute_damage += brute
electronics_damage += electronics
if(brute_damage + electronics_damage >= max_damage) destroy()
/datum/robot_component/proc/heal_damage(brute, electronics)
if(installed != 1)
// If it's not installed, can't repair it.
return 0
brute_damage = max(0, brute_damage - brute)
electronics_damage = max(0, electronics_damage - electronics)
/datum/robot_component/proc/is_powered()
return (installed == 1) && (brute_damage + electronics_damage < max_damage) && (!energy_consumption || powered)
/datum/robot_component/proc/consume_power()
if(toggled == 0)
powered = 0
return
if(owner.cell.charge >= energy_consumption)
owner.cell.use(energy_consumption)
powered = 1
else
powered = 0
/datum/robot_component/armour
name = "armour plating"
energy_consumption = 0
external_type = /obj/item/robot_parts/robot_component/armour
max_damage = 60
/datum/robot_component/actuator
name = "actuator"
energy_consumption = 2
external_type = /obj/item/robot_parts/robot_component/actuator
max_damage = 50
/datum/robot_component/cell
name = "power cell"
max_damage = 50
/datum/robot_component/cell/destroy()
..()
owner.cell = null
/datum/robot_component/radio
name = "radio"
external_type = /obj/item/robot_parts/robot_component/radio
energy_consumption = 1
max_damage = 40
/datum/robot_component/binary_communication
name = "binary communication device"
external_type = /obj/item/robot_parts/robot_component/binary_communication_device
energy_consumption = 0
max_damage = 30
/datum/robot_component/camera
name = "camera"
external_type = /obj/item/robot_parts/robot_component/camera
energy_consumption = 1
max_damage = 40
/datum/robot_component/diagnosis_unit
name = "self-diagnosis unit"
energy_consumption = 1
external_type = /obj/item/robot_parts/robot_component/diagnosis_unit
max_damage = 30
/mob/living/silicon/robot/proc/initialize_components()
// This only initializes the components, it doesn't set them to installed.
components["actuator"] = new/datum/robot_component/actuator(src)
components["radio"] = new/datum/robot_component/radio(src)
components["power cell"] = new/datum/robot_component/cell(src)
components["diagnosis unit"] = new/datum/robot_component/diagnosis_unit(src)
components["camera"] = new/datum/robot_component/camera(src)
components["comms"] = new/datum/robot_component/binary_communication(src)
components["armour"] = new/datum/robot_component/armour(src)
/mob/living/silicon/robot/proc/is_component_functioning(module_name)
var/datum/robot_component/C = components[module_name]
return C && C.installed == 1 && C.toggled && C.is_powered()
/obj/item/broken_device
name = "broken component"
icon = 'icons/obj/robot_component.dmi'
icon_state = "broken"
/obj/item/robot_parts/robot_component
icon = 'icons/obj/robot_component.dmi'
icon_state = "working"
construction_time = 200
construction_cost = list("metal"=5000)
/obj/item/robot_parts/robot_component/binary_communication_device
name = "binary communication device"
icon_state = "binary_translator"
/obj/item/robot_parts/robot_component/actuator
name = "actuator"
icon_state = "actuator"
/obj/item/robot_parts/robot_component/armour
name = "armour plating"
icon_state = "armor_plating"
/obj/item/robot_parts/robot_component/camera
name = "camera"
icon_state = "camera"
/obj/item/robot_parts/robot_component/diagnosis_unit
name = "diagnosis unit"
icon_state = "diagnosis_unit"
/obj/item/robot_parts/robot_component/radio
name = "radio"
icon_state = "radio"
+1 -1
View File
@@ -71,7 +71,7 @@
set category = "Object"
set src in usr
if((CLUMSY in usr.mutations) && prob(50))
if((M_CLUMSY in usr.mutations) && prob(50))
usr << "<span class='warning'>You cut yourself on the paper.</span>"
return
var/n_name = copytext(sanitize(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text), 1, MAX_NAME_LEN)
+2 -2
View File
@@ -71,11 +71,11 @@
return 1
/obj/item/weapon/gun/proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)//TODO: go over this
//Exclude lasertag guns from the CLUMSY check.
//Exclude lasertag guns from the M_CLUMSY check.
if(clumsy_check)
if(istype(user, /mob/living))
var/mob/living/M = user
if ((CLUMSY in M.mutations) && prob(50))
if ((M_CLUMSY in M.mutations) && prob(50))
M << "<span class='danger'>[src] blows up in your face.</span>"
M.take_organ_damage(0,20)
M.drop_item()
@@ -58,7 +58,7 @@
return
if (user.a_intent == "harm" && ismob(target))
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
target = user
syringestab(target, user)
return