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
@@ -512,7 +512,7 @@
return
playsound(loc, "punch", 25, 1, -1)
if(HULK in H.mutations) damage += 5
if(M_HULK in H.mutations) damage += 5
if(damage < 5)
visible_message("[H] gives \the [src] a weak punch.")
+1 -1
View File
@@ -145,7 +145,7 @@
M << "\red You start coughing."
if (M.dna.GetSEState(CLUMSYBLOCK))
M << "\red You feel lightheaded."
M.mutations.Add(CLUMSY)
M.mutations.Add(M_CLUMSY)
if (M.dna.GetSEState(TWITCHBLOCK))
M.disabilities |= TOURETTES
M << "\red You twitch."
+1 -1
View File
@@ -78,7 +78,7 @@
/datum/dna/gene/disability/clumsy
name="Clumsiness"
activation_message="You feel lightheaded."
mutation=CLUMSY
mutation=M_CLUMSY
New()
block=CLUMSYBLOCK
+1 -1
View File
@@ -125,7 +125,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
if (changeling.current.mind)
if (changeling.current.mind.assigned_role == "Clown")
changeling.current << "You have evolved beyond your clownish nature, allowing you to wield weapons without harming yourself."
changeling.current.mutations.Remove(CLUMSY)
changeling.current.mutations.Remove(M_CLUMSY)
var/obj_count = 1
for(var/datum/objective/objective in changeling.objectives)
+1 -1
View File
@@ -131,7 +131,7 @@
if (mob.mind)
if (mob.mind.assigned_role == "Clown")
mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself."
mob.mutations.Remove(CLUMSY)
mob.mutations.Remove(M_CLUMSY)
var/obj/item/weapon/paper/talisman/supply/T = new(mob)
+1 -1
View File
@@ -134,7 +134,7 @@
if (mob.mind)
if (mob.mind.assigned_role == "Clown")
mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself."
mob.mutations.Remove(CLUMSY)
mob.mutations.Remove(M_CLUMSY)
var/obj/item/device/flash/T = new(mob)
+1 -1
View File
@@ -248,7 +248,7 @@
if (traitor_mob.mind)
if (traitor_mob.mind.assigned_role == "Clown")
traitor_mob << "Your training has allowed you to overcome your clownish nature, allowing you to wield weapons without harming yourself."
traitor_mob.mutations.Remove(CLUMSY)
traitor_mob.mutations.Remove(M_CLUMSY)
// find a radio! toolbox(es), backpack, belt, headset
var/loc = ""
+1 -1
View File
@@ -192,7 +192,7 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha
if (vampire.current.mind)
if (vampire.current.mind.assigned_role == "Clown")
vampire.current << "Your lust for blood has allowed you to overcome your clumsy nature allowing you to wield weapons without harming yourself."
vampire.current.mutations.Remove(CLUMSY)
vampire.current.mutations.Remove(M_CLUMSY)
var/obj_count = 1
for(var/datum/objective/objective in vampire.objectives)
+2 -2
View File
@@ -229,7 +229,7 @@
H.equip_or_collect(new /obj/item/toy/crayon/rainbow(H), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/storage/fancy/crayons(H), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/reagent_containers/spray/waterflower(H), slot_in_backpack)
H.mutations.Add(CLUMSY)
H.mutations.Add(M_CLUMSY)
return 1
@@ -399,4 +399,4 @@
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
else
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
return 1
return 1
+2 -2
View File
@@ -102,7 +102,7 @@
if(5.0)
size = "huge"
else
//if ((CLUMSY in usr.mutations) && prob(50)) t = "funny-looking"
//if ((M_CLUMSY in usr.mutations) && prob(50)) t = "funny-looking"
usr << "This is a [src.blood_DNA ? "bloody " : ""]\icon[src][src.name]. It is a [size] item."
if(src.desc)
usr << src.desc
@@ -548,7 +548,7 @@
M.LAssailant = user
src.add_fingerprint(user)
//if((CLUMSY in user.mutations) && prob(50))
//if((M_CLUMSY in user.mutations) && prob(50))
// M = user
/*
M << "\red You stab yourself in the eye."
+1 -1
View File
@@ -15,7 +15,7 @@
var/last_used = 0 //last world.time it was used.
/obj/item/device/flash/proc/clown_check(var/mob/user)
if(user && (CLUMSY in user.mutations) && prob(50))
if(user && (M_CLUMSY in user.mutations) && prob(50))
user << "\red \The [src] slips out of your hand."
user.drop_item()
return 0
@@ -49,7 +49,7 @@
add_fingerprint(user)
if(on && user.zone_sel.selecting == "eyes")
if(((CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
if(((M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
return ..() //just hit them in the head
if(!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") //don't have dexterity
+1 -1
View File
@@ -77,7 +77,7 @@ REAGENT SCANNER
/obj/item/device/healthanalyzer/attack(mob/living/M as mob, mob/living/user as mob)
if (( (CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))
if (( (M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))
user << text("\red You try to analyze the floor's vitals!")
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [user] has analyzed the floor's vitals!"), 1)
+159
View File
@@ -0,0 +1,159 @@
/obj/item/weapon/melee/defibrilator
name = "emergency defibrilator"
desc = "A handheld emergency defibrilator, used to bring people back from the brink of death or put them there."
icon_state = "defib_full"
item_state = "defib"
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
force = 5
throwforce = 5
w_class = 3
var/emagged = 0
var/charges = 10
var/status = 0
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread
origin_tech = "biotech=3"
suicide_act(mob/user)
viewers(user) << "\red <b>[user] is putting the live paddles on \his chest! It looks like \he's trying to commit suicide.</b>"
return (OXYLOSS)
/obj/item/weapon/melee/defibrilator/update_icon()
if(!status)
if(charges >= 7)
icon_state = "defib_full"
if(charges <= 6 && charges >= 4)
icon_state = "defib_half"
if(charges <= 3 && charges >= 1)
icon_state = "defib_low"
if(charges <= 0)
icon_state = "defib_empty"
else
if(charges >= 7)
icon_state = "defibpaddleout_full"
if(charges <= 6 && charges >= 4)
icon_state = "defibpaddleout_half"
if(charges <= 3 && charges >= 1)
icon_state = "defibpaddleout_low"
/obj/item/weapon/melee/defibrilator/attack_self(mob/user as mob)
if(status && (M_CLUMSY in user.mutations) && prob(50))
spark_system.attach(user)
spark_system.set_up(5, 0, src)
spark_system.start()
user << "\red You touch the paddles together shorting the device."
user.Weaken(5)
charges--
if(charges < 1)
status = 0
update_icon()
return
if(charges > 0)
status = !status
user << "<span class='notice'>\The [src] is now [status ? "on" : "off"].</span>"
playsound(get_turf(src), "sparks", 75, 1, -1)
update_icon()
else
status = 0
user << "<span class='warning'>\The [src] is out of charge.</span>"
add_fingerprint(user)
/obj/item/weapon/melee/defibrilator/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/card/emag))
var/image/I = image("icon" = "icons/obj/weapons.dmi", "icon_state" = "defib_emag")
if(emagged == 0)
emagged = 1
usr << "\red [W] unlocks [src]'s safety protocols"
overlays += I
else
emagged = 0
usr << "\blue [W] sets [src]'s safety protocols"
overlays -= I
/obj/item/weapon/melee/defibrilator/attack(mob/M as mob, mob/user as mob)
var/tobehealed
var/threshhold = -config.health_threshold_dead
var/mob/living/carbon/human/H = M
if(!ishuman(M))
..()
return
if(status)
if(user.a_intent == "hurt" && emagged)
H.visible_message("<span class='danger'>[M.name] has been touched by the defibrilator paddles by [user]!</span>")
if(charges >= 2)
H.Weaken(10)
H.adjustOxyLoss(10)
else
H.Weaken(5)
H.adjustOxyLoss(5)
H.updatehealth() //forces health update before next life tick
spark_system.attach(M)
spark_system.set_up(5, 0, M)
spark_system.start()
charges -= 2
if(charges < 0)
charges = 0
if(!charges)
status = 0
update_icon()
playsound(get_turf(src), 'sound/weapons/Egloves.ogg', 50, 1, -1)
user.attack_log += "\[[time_stamp()]\]<font color='red'> Defibrilated [H.name] ([H.ckey]) with [src.name]</font>"
H.attack_log += "\[[time_stamp()]\]<font color='orange'> Defibrilated by [user.name] ([user.ckey]) with [src.name]</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) defibrilated [H.name] ([H.ckey]) with [src.name]</font>" )
if(!iscarbon(user))
M.LAssailant = null
else
M.LAssailant = user
return
H.visible_message("\blue [user] places the defibrilator paddles on [M.name]'s chest.", "\blue You place the defibrilator paddles on [M.name]'s chest.")
if(do_after(user, 10))
if(H.stat == 2 || H.stat == DEAD)
var/uni = 0
var/armor = 0
var/health = H.health
for(var/obj/item/carried_item in H.contents)
if(istype(carried_item, /obj/item/clothing/under))
uni = 1
if(istype(carried_item, /obj/item/clothing/suit/armor))
armor = 1
if(uni && armor)
if(prob(30))
spark_system.attach(M)
spark_system.start()
if(prob(30))
tobehealed = health + threshhold
tobehealed -= 5 //They get 5 health in crit to heal the person or inject stabalizers
H.adjustOxyLoss(tobehealed)
else if(uni || armor)
if(prob(30))
spark_system.attach(M)
spark_system.start()
if(prob(60))
tobehealed = health + threshhold
tobehealed -= 5 //They get 5 health in crit to heal the person or inject stabalizers
H.adjustOxyLoss(tobehealed)
else
if(prob(90))
tobehealed = health + threshhold
tobehealed -= 5 //They get 5 health in crit to heal the person or inject stabalizers
H.adjustOxyLoss(tobehealed)
H.updatehealth() //forces a health update, otherwise the oxyloss adjustment wouldnt do anything
M.visible_message("\red [M]'s body convulses a bit.")
var/datum/organ/external/temp = H.get_organ("head")
if(H.health > -100 && !(temp.status & ORGAN_DESTROYED) && !(NOCLONE in H.mutations) && !H.suiciding)
viewers(M) << "\blue [src] beeps: Resuscitation successful."
spawn(0)
H.stat = 1
dead_mob_list -= H
living_mob_list |= H
H.emote("gasp")
else
viewers(M) << "\blue [src] beeps: Resuscitation failed."
charges--
if(charges < 1)
charges = 0
status = 0
update_icon()
else
user.visible_message("\blue [src] beeps: Patient is not in a valid state.")
@@ -13,7 +13,7 @@
var/det_time = 50
/obj/item/weapon/grenade/proc/clown_check(var/mob/living/user)
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
user << "<span class='warning'>Huh? How does this thing work?</span>"
active = 1
icon_state = initial(icon_state) + "_active"
+1 -1
View File
@@ -30,7 +30,7 @@
C.update_inv_handcuffed()
else
if ((CLUMSY in usr.mutations) && prob(50))
if ((M_CLUMSY in usr.mutations) && prob(50))
usr << "\red Uh ... how do those things work?!"
if (istype(C, /mob/living/carbon/human))
if(!C.handcuffed)
+6 -6
View File
@@ -73,7 +73,7 @@
src.icon_state = "fork"
return
else
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
@@ -101,7 +101,7 @@
src.icon_state = "fork"
return
else
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
@@ -122,7 +122,7 @@
return (BRUTELOSS)
/obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You accidentally cut yourself with the [src]."
user.take_organ_damage(20)
return
@@ -137,7 +137,7 @@
throwforce = 10.0
/obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You somehow managed to cut yourself with the [src]."
user.take_organ_damage(20)
return
@@ -220,7 +220,7 @@
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked") //I think the rollingpin attackby will end up ignoring this anyway.
/obj/item/weapon/kitchen/rollingpin/attack(mob/living/M as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(2)
@@ -307,7 +307,7 @@
sleep(rand(2,4))
if((CLUMSY in user.mutations) && prob(50)) //What if he's a clown?
if((M_CLUMSY in user.mutations) && prob(50)) //What if he's a clown?
M << "\red You accidentally slam yourself with the [src]!"
M.Weaken(1)
user.take_organ_damage(2)
@@ -56,7 +56,7 @@
user.take_organ_damage(0,10)
return
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(20)
@@ -16,7 +16,7 @@
/obj/item/weapon/storage/briefcase/attack(mob/living/M as mob, mob/living/user as mob)
//..()
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(2)
@@ -176,7 +176,7 @@
//I consider this worthless but it isn't my code so whatever. Remove or uncomment.
/*attack(mob/M as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(2)
+5 -5
View File
@@ -77,8 +77,8 @@
..()
return
/obj/item/weapon/melee/baton/attack_self(mob/user as mob)
if(status && (CLUMSY in user.mutations) && prob(50))
/obj/item/weapon/melee/baton/attack_self(mob/user)
if(status && (M_CLUMSY in user.mutations) && prob(50))
user << "\red You grab the [src] on the wrong side."
user.Weaken(stunforce*3)
deductcharge(hitcost)
@@ -100,9 +100,9 @@
user << "<span class='warning'>[src] is out of charge.</span>"
add_fingerprint(user)
/obj/item/weapon/melee/baton/attack(mob/M as mob, mob/user as mob)
if(status && (CLUMSY in user.mutations) && prob(50))
user << "<span class='danger'>You accidentally hit yourself with the [src]!</span>"
/obj/item/weapon/melee/baton/attack(mob/M, mob/user)
if(status && (M_CLUMSY in user.mutations) && prob(50))
user << "<span class='danger'>You accidentally hit yourself with [src]!</span>"
user.Weaken(stunforce*3)
deductcharge(hitcost)
return
@@ -401,7 +401,7 @@ LOOK FOR SURGERY.DM*/
//if(M.mutations & HUSK) return ..()
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
@@ -645,7 +645,7 @@ LOOK FOR SURGERY.DM*/
if(!istype(M))
return ..()
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
@@ -27,7 +27,7 @@
_color = pick("red","blue","green","purple")
/obj/item/weapon/melee/energy/sword/attack_self(mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You accidentally cut yourself with [src]."
user.take_organ_damage(5,5)
active = !active
@@ -82,7 +82,7 @@
force = 10
/obj/item/weapon/melee/classic_baton/attack(mob/M as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You club yourself over the head."
user.Weaken(3 * force)
if(ishuman(user))
@@ -181,7 +181,7 @@
/obj/item/weapon/melee/telebaton/attack(mob/target as mob, mob/living/user as mob)
if(on)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You club yourself over the head."
user.Weaken(3 * force)
if(ishuman(user))
@@ -272,7 +272,7 @@
return 0
/obj/item/weapon/shield/energy/attack_self(mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You beat yourself in the head with [src]."
user.take_organ_damage(5)
active = !active
+1 -1
View File
@@ -86,7 +86,7 @@
if(!istype(M)) return ..()
if(user.zone_sel.selecting != "eyes" && user.zone_sel.selecting != "head")
return ..()
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
+1 -1
View File
@@ -161,7 +161,7 @@
/obj/item/weapon/twohanded/dualsaber/attack(target as mob, mob/living/user as mob)
..()
if((CLUMSY in user.mutations) && (wielded) &&prob(40))
if((M_CLUMSY in user.mutations) && (wielded) &&prob(40))
user << "\red You twirl around a bit before losing your balance and impaling yourself on the [src]."
user.take_organ_damage(20,25)
return
+1 -1
View File
@@ -49,7 +49,7 @@
user << "\red You don't have the dexterity to do this!"
return
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The rod slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(20)
+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
+1 -1
View File
@@ -325,7 +325,7 @@ var/MAX_EXPLOSION_RANGE = 14
#define M_RESIST_COLD 2
#define M_XRAY 3
#define M_HULK 4
#define CLUMSY 5
#define M_CLUMSY 5
#define FAT 6
#define HUSK 7
#define NOCLONE 8
+2 -2
View File
@@ -60,7 +60,7 @@
/obj/item/weapon/firbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (user.get_active_hand() == src)
if ((CLUMSY in usr.mutations) && prob(50))
if ((M_CLUMSY in usr.mutations) && prob(50))
user << "\red Huh? How does this thing work?!"
src.state = 1
src.icon_state = "flashbang1"
@@ -108,7 +108,7 @@
/obj/item/weapon/firbang/attack_self(mob/user as mob)
if (!src.state)
if (CLUMSY in user.mutations)
if (M_CLUMSY in user.mutations)
user << "\red Huh? How does this thing work?!"
spawn( 5 )
prime()