mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
** Mob Define Cleanup: Part 1 **
I'm currently working on moving all of the vars in mob_defines.dm and some procs in mob.dm into more fitting places. For example, ghosts and simple animals can not be cloned, so they do not need a cloneloss var. Cloneloss would be better fitting to /mob/living or even /mob/living/carbon. By moving these defines into proper children of /mob we lower the amount of resources that must be set aside every time a mob is created and we lower the amount of data that gets transfered between mobs when we combine, transfer or transform them. In theory, this should help free up some resources and combat lag. Due to how integrated some of these defines are in the rest of the code, I'm going to be committing this cleanup in small batches. Doing it this way instead of one massive commit means that bugs will be easier to locate and identify. It is also less likely to overwhelm players with bugs, and if it still does, it will make it easier for us to revert only the section that is causing problems. Smaller commits also means merging with existing code will be less of a nightmare and has less potential for merging mistakes. One of my goals in this cleanup is to add a description to every single variable in mob defines. While some of them are self explanatory, there are some there that are used in horribly obscure ways on top of having no comment to describe their use. ----------------------- Mob defines moved to living: - last_special* - bruteloss - oxyloss - toxloss - fireloss - cloneloss - brainloss - halloss - hallucination - hallucinations(list) *Note: I believe this variable is not needed, but the code it is used in (the resist verb) is cluttered and messy. That chunk of code probably use a re-write. I'll put it on my TODO list and if I survive mob_defines I'll try to get around to it but if anyone wants to do it for me, that would certainly help! ----------------------- Mob procs moved to living: - getBruteLoss() - adjustBruteLoss() - getOxyLoss() - adjustOxyLoss() - setOxyLoss() - getToxLoss() - adjustToxLoss() - setToxLoss() - getFireLoss() - adjustFireLoss() - getCloneLoss() - adjustCloneLoss() - setCloneLoss() - getHalLoss() - adjustHalLoss() - setHalLoss() - getBrainLoss() - adjustBrainLoss() - setBrainLoss Mob procs moved to carbon: getDNA() setDNA() ----------------------- Mob verbs moved to carbon: - Sleep - Lay down / Get up ----------------------- The : operator... The thing that has been killing me through this whole cleanup is people using or copy/pasting the : operator everywhere. *** Please use obj.var_or_procname. Do not use obj:var_or_procname *** Using obj:procname will not throw a compiler error if obj does not have that specific var or proc. This means that the coder making changes will NOT be informed of an error which will result in a proc failing, potentially being completely unusable and definatly causing a runtime error. With that said, I fully anticipate that most bugs (if any) caused by this mob define cleanup to be the result of : operators. I've been replacing many : operators in favour of the . operator as I've been going, most noteably I went out of my way to remove almost every : operator from the 4000+ line Chemistry-Regents.dm Exceptions: - Water: Turf and Atmos related vars. I'm not familiar with the members and methods in those class' hierarchy. - Silicate: because it's commented out and I honestly dont see it returning. - Thermite: Turf and Atmos related vars. - Corn Oil: Turf and Atmos related vars. Final note: While this may be the source of some mob-related bugs, there are two other revisions that have been committed between now and the last time either of the the two tgstation servers have been updated. These revisions both touch mob-related files. I'm not blaming these other revisions for anything, especially since one of them is mine anyway, I'm just listing them here for refrence to help quickly identify any problems. - My human/life() changes in r3925 - Carn's life() standardizations in r3933 Stuff unrelated to mob defines: - Fixed borgs and such being able to go into DNA modifiers. - Changelog updated and I added Sieve to the list of coders. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3934 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -167,11 +167,11 @@ client
|
||||
|
||||
if(istype(D,/atom))
|
||||
var/atom/A = D
|
||||
if(ismob(A))
|
||||
if(isliving(A))
|
||||
body += "<a href='byond://?src=\ref[src];rename=\ref[D]'><b>[D]</b></a>"
|
||||
if(A.dir)
|
||||
body += "<br><font size='1'><a href='byond://?src=\ref[src];rotatedatum=\ref[D];rotatedir=left'><<</a> <a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=dir'>[dir2text(A.dir)]</a> <a href='byond://?src=\ref[src];rotatedatum=\ref[D];rotatedir=right'>>></a></font>"
|
||||
var/mob/M = A
|
||||
var/mob/living/M = A
|
||||
body += "<br><font size='1'><a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=ckey'>[M.ckey ? M.ckey : "No ckey"]</a> / <a href='byond://?src=\ref[src];datumedit=\ref[D];varnameedit=real_name'>[M.real_name ? M.real_name : "No real name"]</a></font>"
|
||||
body += {"
|
||||
<br><font size='1'>
|
||||
@@ -763,19 +763,22 @@ client
|
||||
var/mob/M = locate(href_list["mobToDamage"])
|
||||
var/Text = locate(href_list["adjustDamage"])
|
||||
|
||||
if(!isliving(M)) return
|
||||
var/mob/living/L = M
|
||||
|
||||
var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num
|
||||
if(Text == "brute")
|
||||
M.adjustBruteLoss(amount)
|
||||
L.adjustBruteLoss(amount)
|
||||
else if(Text == "fire")
|
||||
M.adjustFireLoss(amount)
|
||||
L.adjustFireLoss(amount)
|
||||
else if(Text == "toxin")
|
||||
M.adjustToxLoss(amount)
|
||||
L.adjustToxLoss(amount)
|
||||
else if(Text == "oxygen")
|
||||
M.adjustOxyLoss(amount)
|
||||
L.adjustOxyLoss(amount)
|
||||
else if(Text == "brain")
|
||||
M.adjustBrainLoss(amount)
|
||||
L.adjustBrainLoss(amount)
|
||||
else if(Text == "clone")
|
||||
M.adjustCloneLoss(amount)
|
||||
L.adjustCloneLoss(amount)
|
||||
else
|
||||
usr << "You caused an error. DEBUG: Text:[Text] Mob:[M]"
|
||||
return
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
//affected_mob.contract_disease(new /datum/disease/alien_embryo)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/disease/alien_embryo
|
||||
name = "Unidentified Foreign Body"
|
||||
max_stages = 5
|
||||
|
||||
@@ -186,7 +186,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
|
||||
return
|
||||
|
||||
/obj/effect/proc_holder/spell/proc/adjust_var(mob/target = usr, type, amount) //handles the adjustment of the var when the spell is used. has some hardcoded types
|
||||
/obj/effect/proc_holder/spell/proc/adjust_var(mob/living/target = usr, type, amount) //handles the adjustment of the var when the spell is used. has some hardcoded types
|
||||
switch(type)
|
||||
if("bruteloss")
|
||||
target.adjustBruteLoss(amount)
|
||||
|
||||
@@ -650,6 +650,9 @@
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if (!ishuman(usr) && !ismonkey(usr)) //Make sure they're a mob that has dna
|
||||
usr << "\blue Try as you might, you can not climb up into the scanner."
|
||||
return
|
||||
if (src.occupant)
|
||||
usr << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
|
||||
@@ -251,25 +251,30 @@
|
||||
usr << "Our genes are still mending themselves! We cannot transform!"
|
||||
return
|
||||
|
||||
usr.changeling.chem_charges--
|
||||
if(!iscarbon(usr))
|
||||
return //Changelings should only really be carbon as only monkeys/humans have DNA
|
||||
|
||||
usr.remove_changeling_powers()
|
||||
var/mob/living/carbon/C = usr
|
||||
|
||||
usr.visible_message(text("\red <B>[usr] transforms!</B>"))
|
||||
C.changeling.chem_charges--
|
||||
|
||||
usr.changeling.geneticdamage = 30
|
||||
usr << "Our genes cry out!"
|
||||
C.remove_changeling_powers()
|
||||
|
||||
C.visible_message(text("\red <B>[C] transforms!</B>"))
|
||||
|
||||
C.changeling.geneticdamage = 30
|
||||
C << "Our genes cry out!"
|
||||
|
||||
var/list/implants = list() //Try to preserve implants.
|
||||
for(var/obj/item/weapon/implant/W in usr)
|
||||
for(var/obj/item/weapon/implant/W in C)
|
||||
implants += W
|
||||
|
||||
usr.regenerate_icons()
|
||||
usr.monkeyizing = 1
|
||||
usr.canmove = 0
|
||||
usr.icon = null
|
||||
usr.invisibility = 101
|
||||
var/atom/movable/overlay/animation = new /atom/movable/overlay( usr.loc )
|
||||
C.regenerate_icons()
|
||||
C.monkeyizing = 1
|
||||
C.canmove = 0
|
||||
C.icon = null
|
||||
C.invisibility = 101
|
||||
var/atom/movable/overlay/animation = new /atom/movable/overlay( C.loc )
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'mob.dmi'
|
||||
animation.master = src
|
||||
@@ -278,36 +283,36 @@
|
||||
del(animation)
|
||||
|
||||
var/mob/living/carbon/monkey/O = new /mob/living/carbon/monkey(src)
|
||||
O.dna = usr.dna
|
||||
usr.dna = null
|
||||
O.changeling = usr.changeling
|
||||
O.dna = C.dna
|
||||
C.dna = null
|
||||
O.changeling = C.changeling
|
||||
feedback_add_details("changeling_powers","LF")
|
||||
|
||||
for(var/obj/item/W in usr)
|
||||
usr.drop_from_inventory(W)
|
||||
for(var/obj/item/W in C)
|
||||
C.drop_from_inventory(W)
|
||||
|
||||
|
||||
for(var/obj/T in usr)
|
||||
for(var/obj/T in C)
|
||||
del(T)
|
||||
//for(var/R in usr.organs) //redundant, let's give garbage collector work to do --rastaf0
|
||||
// del(usr.organs[text("[]", R)])
|
||||
|
||||
O.loc = usr.loc
|
||||
O.loc = C.loc
|
||||
|
||||
O.name = text("monkey ([])",copytext(md5(usr.real_name), 2, 6))
|
||||
O.setToxLoss(usr.getToxLoss())
|
||||
O.adjustBruteLoss(usr.getBruteLoss())
|
||||
O.setOxyLoss(usr.getOxyLoss())
|
||||
O.adjustFireLoss(usr.getFireLoss())
|
||||
O.stat = usr.stat
|
||||
O.name = text("monkey ([])",copytext(md5(C.real_name), 2, 6))
|
||||
O.setToxLoss(C.getToxLoss())
|
||||
O.adjustBruteLoss(C.getBruteLoss())
|
||||
O.setOxyLoss(C.getOxyLoss())
|
||||
O.adjustFireLoss(C.getFireLoss())
|
||||
O.stat = C.stat
|
||||
O.a_intent = "hurt"
|
||||
for (var/obj/item/weapon/implant/I in implants)
|
||||
I.loc = O
|
||||
I.implanted = O
|
||||
continue
|
||||
|
||||
if(usr.mind)
|
||||
usr.mind.transfer_to(O)
|
||||
if(C.mind)
|
||||
C.mind.transfer_to(O)
|
||||
|
||||
O.make_lesser_changeling()
|
||||
O.verbs += /client/proc/changeling_lesser_transform
|
||||
@@ -334,29 +339,34 @@
|
||||
usr << "\red We don't have enough stored chemicals to do that!"
|
||||
return
|
||||
|
||||
if(!iscarbon(usr))
|
||||
return //Only humans/monkeys have DNA
|
||||
|
||||
var/S = input("Select the target DNA: ", "Target DNA", null) in usr.changeling.absorbed_dna
|
||||
|
||||
if (S == null)
|
||||
return
|
||||
|
||||
usr.changeling.chem_charges -= 1
|
||||
var/mob/living/carbon/C = usr
|
||||
|
||||
usr.remove_changeling_powers()
|
||||
C.changeling.chem_charges -= 1
|
||||
|
||||
usr.visible_message(text("\red <B>[usr] transforms!</B>"))
|
||||
C.remove_changeling_powers()
|
||||
|
||||
usr.dna = usr.changeling.absorbed_dna[S]
|
||||
C.visible_message(text("\red <B>[C] transforms!</B>"))
|
||||
|
||||
C.dna = C.changeling.absorbed_dna[S]
|
||||
|
||||
var/list/implants = list()
|
||||
for (var/obj/item/weapon/implant/I in usr) //Still preserving implants
|
||||
for (var/obj/item/weapon/implant/I in C) //Still preserving implants
|
||||
implants += I
|
||||
|
||||
usr.regenerate_icons()
|
||||
usr.monkeyizing = 1
|
||||
usr.canmove = 0
|
||||
usr.icon = null
|
||||
usr.invisibility = 101
|
||||
var/atom/movable/overlay/animation = new /atom/movable/overlay( usr.loc )
|
||||
C.regenerate_icons()
|
||||
C.monkeyizing = 1
|
||||
C.canmove = 0
|
||||
C.icon = null
|
||||
C.invisibility = 101
|
||||
var/atom/movable/overlay/animation = new /atom/movable/overlay( C.loc )
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'mob.dmi'
|
||||
animation.master = src
|
||||
@@ -365,44 +375,44 @@
|
||||
del(animation)
|
||||
|
||||
for(var/obj/item/W in usr)
|
||||
usr.u_equip(W)
|
||||
if (usr.client)
|
||||
usr.client.screen -= W
|
||||
C.u_equip(W)
|
||||
if (C.client)
|
||||
C.client.screen -= W
|
||||
if (W)
|
||||
W.loc = usr.loc
|
||||
W.dropped(usr)
|
||||
W.loc = C.loc
|
||||
W.dropped(C)
|
||||
W.layer = initial(W.layer)
|
||||
|
||||
var/mob/living/carbon/human/O = new /mob/living/carbon/human( src )
|
||||
if (isblockon(getblock(usr.dna.uni_identity, 11,3),11))
|
||||
if (isblockon(getblock(C.dna.uni_identity, 11,3),11))
|
||||
O.gender = FEMALE
|
||||
else
|
||||
O.gender = MALE
|
||||
O.dna = usr.dna
|
||||
usr.dna = null
|
||||
O.changeling = usr.changeling
|
||||
O.dna = C.dna
|
||||
C.dna = null
|
||||
O.changeling = C.changeling
|
||||
O.real_name = S
|
||||
feedback_add_details("changeling_powers","LFT")
|
||||
|
||||
for(var/obj/T in usr)
|
||||
for(var/obj/T in C)
|
||||
del(T)
|
||||
|
||||
O.loc = usr.loc
|
||||
O.loc = C.loc
|
||||
|
||||
updateappearance(O,O.dna.uni_identity)
|
||||
domutcheck(O, null)
|
||||
O.setToxLoss(usr.getToxLoss())
|
||||
O.adjustBruteLoss(usr.getBruteLoss())
|
||||
O.setOxyLoss(usr.getOxyLoss())
|
||||
O.adjustFireLoss(usr.getFireLoss())
|
||||
O.stat = usr.stat
|
||||
O.setToxLoss(C.getToxLoss())
|
||||
O.adjustBruteLoss(C.getBruteLoss())
|
||||
O.setOxyLoss(C.getOxyLoss())
|
||||
O.adjustFireLoss(C.getFireLoss())
|
||||
O.stat = C.stat
|
||||
for (var/obj/item/weapon/implant/I in implants)
|
||||
I.loc = O
|
||||
I.implanted = O
|
||||
continue
|
||||
|
||||
if(usr.mind)
|
||||
usr.mind.transfer_to(O)
|
||||
if(C.mind)
|
||||
C.mind.transfer_to(O)
|
||||
|
||||
O.make_changeling()
|
||||
|
||||
@@ -532,45 +542,48 @@ Tarjan shit, not recoding this -Sieve{R}*/
|
||||
if(usr.changeling.chem_charges < 20)
|
||||
usr << "\red We don't have enough stored chemicals to do that!"
|
||||
return
|
||||
if(!isliving(usr)) return //This should NEVER happen
|
||||
|
||||
usr.changeling.chem_charges -= 20
|
||||
var/mob/living/L = usr
|
||||
|
||||
usr << "\blue We will regenerate our form."
|
||||
L.changeling.chem_charges -= 20
|
||||
|
||||
usr.lying = 1
|
||||
usr.canmove = 0
|
||||
usr.changeling.changeling_fakedeath = 1
|
||||
usr.remove_changeling_powers()
|
||||
L << "\blue We will regenerate our form."
|
||||
feedback_add_details("changeling_powers","FD")
|
||||
|
||||
usr.emote("gasp")
|
||||
L.lying = 1
|
||||
L.canmove = 0
|
||||
L.changeling.changeling_fakedeath = 1
|
||||
L.remove_changeling_powers()
|
||||
|
||||
L.emote("gasp")
|
||||
|
||||
spawn(1200)
|
||||
usr.stat = 0
|
||||
L.stat = 0
|
||||
//usr.fireloss = 0
|
||||
usr.setToxLoss(0)
|
||||
L.setToxLoss(0)
|
||||
//usr.bruteloss = 0
|
||||
usr.setOxyLoss(0)
|
||||
usr.setCloneLoss(0)
|
||||
usr.SetParalysis(0)
|
||||
usr.SetStunned(0)
|
||||
usr.SetWeakened(0)
|
||||
usr.radiation = 0
|
||||
//usr.health = 100
|
||||
//usr.updatehealth()
|
||||
L.setOxyLoss(0)
|
||||
L.setCloneLoss(0)
|
||||
L.SetParalysis(0)
|
||||
L.SetStunned(0)
|
||||
L.SetWeakened(0)
|
||||
L.radiation = 0
|
||||
//L.health = 100
|
||||
//L.updatehealth()
|
||||
var/mob/living/M = src
|
||||
M.heal_overall_damage(M.getBruteLoss(), M.getFireLoss())
|
||||
usr.reagents.clear_reagents()
|
||||
usr.lying = 0
|
||||
usr.canmove = 1
|
||||
usr << "\blue We have regenerated."
|
||||
usr.visible_message(text("\red <B>[usr] appears to wake from the dead, having healed all wounds.</B>"))
|
||||
L.reagents.clear_reagents()
|
||||
L.lying = 0
|
||||
L.canmove = 1
|
||||
L << "\blue We have regenerated."
|
||||
L.visible_message(text("\red <B>[usr] appears to wake from the dead, having healed all wounds.</B>"))
|
||||
|
||||
usr.changeling.changeling_fakedeath = 0
|
||||
if (usr.changeling.changeling_level == 1)
|
||||
usr.make_lesser_changeling()
|
||||
else if (usr.changeling.changeling_level == 2)
|
||||
usr.make_changeling()
|
||||
L.changeling.changeling_fakedeath = 0
|
||||
if (L.changeling.changeling_level == 1)
|
||||
L.make_lesser_changeling()
|
||||
else if (L.changeling.changeling_level == 2)
|
||||
L.make_changeling()
|
||||
|
||||
return
|
||||
|
||||
@@ -1056,7 +1069,7 @@ Tarjan shit, not recoding this -Sieve{R}*/
|
||||
var/list/victims = list()
|
||||
for(var/mob/living/carbon/C in oview(usr.changeling.sting_range))
|
||||
victims += C
|
||||
var/mob/T = input(usr, "Who do you wish to sting?") as null | anything in victims
|
||||
var/mob/living/T = input(usr, "Who do you wish to sting?") as null | anything in victims
|
||||
|
||||
if(T && T in view(usr.changeling.sting_range))
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
if(..())
|
||||
return
|
||||
if (src.connected)
|
||||
var/mob/occupant = src.connected.occupant
|
||||
var/mob/living/occupant = src.connected.occupant
|
||||
var/dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>"
|
||||
if (occupant)
|
||||
var/t1
|
||||
@@ -138,7 +138,7 @@
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/orient = "LEFT" // "RIGHT" changes the dir suffix to "-r"
|
||||
var/mob/occupant = null
|
||||
var/mob/living/occupant = null
|
||||
|
||||
|
||||
New()
|
||||
@@ -267,7 +267,7 @@
|
||||
return
|
||||
|
||||
|
||||
proc/inject_inap(mob/user as mob)
|
||||
proc/inject_inap(mob/living/user as mob)
|
||||
if(src.occupant)
|
||||
if(src.occupant.reagents.get_reagent_amount("inaprovaline") + 30 <= 60)
|
||||
src.occupant.reagents.add_reagent("inaprovaline", 30)
|
||||
@@ -277,7 +277,7 @@
|
||||
return
|
||||
|
||||
|
||||
proc/inject_stox(mob/user as mob)
|
||||
proc/inject_stox(mob/living/user as mob)
|
||||
if(src.occupant)
|
||||
if(src.occupant.reagents.get_reagent_amount("stoxin") + 20 <= 40)
|
||||
src.occupant.reagents.add_reagent("stoxin", 20)
|
||||
@@ -287,7 +287,7 @@
|
||||
return
|
||||
|
||||
|
||||
proc/inject_dermaline(mob/user as mob)
|
||||
proc/inject_dermaline(mob/living/user as mob)
|
||||
if (src.occupant)
|
||||
if(src.occupant.reagents.get_reagent_amount("dermaline") + 20 <= 40)
|
||||
src.occupant.reagents.add_reagent("dermaline", 20)
|
||||
@@ -297,7 +297,7 @@
|
||||
return
|
||||
|
||||
|
||||
proc/inject_bicaridine(mob/user as mob)
|
||||
proc/inject_bicaridine(mob/living/user as mob)
|
||||
if(src.occupant)
|
||||
if(src.occupant.reagents.get_reagent_amount("bicaridine") + 10 <= 20)
|
||||
src.occupant.reagents.add_reagent("bicaridine", 10)
|
||||
@@ -307,7 +307,7 @@
|
||||
return
|
||||
|
||||
|
||||
proc/inject_dexalin(mob/user as mob)
|
||||
proc/inject_dexalin(mob/living/user as mob)
|
||||
if(src.occupant)
|
||||
if(src.occupant.reagents.get_reagent_amount("dexalin") + 20 <= 40)
|
||||
src.occupant.reagents.add_reagent("dexalin", 20)
|
||||
@@ -317,7 +317,7 @@
|
||||
return
|
||||
|
||||
|
||||
proc/check(mob/user as mob)
|
||||
proc/check(mob/living/user as mob)
|
||||
if(src.occupant)
|
||||
user << text("\blue <B>Occupant ([]) Statistics:</B>", src.occupant)
|
||||
var/t1
|
||||
|
||||
@@ -91,7 +91,9 @@
|
||||
if (!src.implanted)
|
||||
return "ERROR"
|
||||
else
|
||||
src.healthstring = "[round(src.implanted:getOxyLoss())] - [round(src.implanted:getFireLoss())] - [round(src.implanted:getToxLoss())] - [round(src.implanted:getBruteLoss())]"
|
||||
if(isliving(src.implanted))
|
||||
var/mob/living/L = src.implanted
|
||||
src.healthstring = "[round(L.getOxyLoss())] - [round(L.getFireLoss())] - [round(L.getToxLoss())] - [round(L.getBruteLoss())]"
|
||||
if (!src.healthstring)
|
||||
src.healthstring = "ERROR"
|
||||
return src.healthstring
|
||||
@@ -115,6 +117,8 @@
|
||||
if(((!ghost) || (!ghost.client)) || src.mess || src.attempting)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
src.attempting = 1 //One at a time!!
|
||||
src.locked = 1
|
||||
|
||||
|
||||
@@ -327,7 +327,7 @@ About the new airlock wires panel:
|
||||
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/bumpopen(mob/user as mob) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite
|
||||
/obj/machinery/door/airlock/bumpopen(mob/living/user as mob) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite
|
||||
if(!istype(usr, /mob/living/silicon))
|
||||
if(src.isElectrified())
|
||||
if(!src.justzap)
|
||||
@@ -1270,7 +1270,7 @@ About the new airlock wires panel:
|
||||
close()
|
||||
return
|
||||
|
||||
for(var/mob/M in get_turf(src))
|
||||
for(var/mob/living/M in get_turf(src))
|
||||
if(isrobot(M))
|
||||
M.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
|
||||
else
|
||||
|
||||
@@ -205,11 +205,12 @@ Class Procs:
|
||||
return 1
|
||||
*/
|
||||
if (ishuman(user))
|
||||
if(user.getBrainLoss() >= 60)
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.getBrainLoss() >= 60)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
M << "\red [user] stares cluelessly at [src] and drools."
|
||||
M << "\red [H] stares cluelessly at [src] and drools."
|
||||
return 1
|
||||
else if(prob(user.getBrainLoss()))
|
||||
else if(prob(H.getBrainLoss()))
|
||||
user << "\red You momentarily forget how to use [src]."
|
||||
return 1
|
||||
|
||||
|
||||
@@ -134,14 +134,14 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
|
||||
return
|
||||
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
attack_hand(mob/living/user as mob)
|
||||
if(!iscultist(user))
|
||||
user << "You can't mouth the arcane scratchings without fumbling over them."
|
||||
return
|
||||
if(istype(user.wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
user << "You are unable to speak the words of the rune."
|
||||
return
|
||||
if(!word1 || !word2 || !word3 || prob(usr.getBrainLoss()))
|
||||
if(!word1 || !word2 || !word3 || prob(user.getBrainLoss()))
|
||||
return fizzle()
|
||||
// if(!src.visibility)
|
||||
// src.visibility=1
|
||||
|
||||
@@ -890,7 +890,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
user << "<span class='notify'>You slide \the [C] into \the [src].</span>"
|
||||
return
|
||||
|
||||
/obj/item/device/pda/attack(mob/C as mob, mob/user as mob)
|
||||
/obj/item/device/pda/attack(mob/living/C as mob, mob/living/user as mob)
|
||||
if (istype(C, /mob/living/carbon))
|
||||
switch(scanmode)
|
||||
if(1)
|
||||
|
||||
@@ -46,9 +46,10 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/flashlight/attack(mob/M as mob, mob/user as mob)
|
||||
/obj/item/device/flashlight/attack(mob/living/M as mob, mob/living/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(src.on && user.zone_sel.selecting == "eyes")
|
||||
|
||||
if (((CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))//too dumb to use flashlight properly
|
||||
return ..()//just hit them in the head
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ MASS SPECTROMETER
|
||||
origin_tech = "magnets=1;biotech=1"
|
||||
var/mode = 1;
|
||||
|
||||
/obj/item/device/healthanalyzer/attack(mob/M as mob, mob/user as mob)
|
||||
/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))
|
||||
user << text("\red You try to analyze the floor's vitals!")
|
||||
for(var/mob/O in viewers(M, null))
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
|
||||
/obj/item/device/taperecorder/hear_talk(mob/M as mob, msg)
|
||||
/obj/item/device/taperecorder/hear_talk(mob/living/M as mob, msg)
|
||||
if (recording)
|
||||
var/ending = copytext(msg, length(msg))
|
||||
src.timestamp+= src.timerecorded
|
||||
|
||||
@@ -470,7 +470,7 @@ ZIPPO
|
||||
|
||||
/obj/item/weapon/lighter
|
||||
|
||||
attack_self(mob/user)
|
||||
attack_self(mob/living/user)
|
||||
if(user.r_hand == src || user.l_hand == src)
|
||||
if(!src.lit)
|
||||
src.lit = 1
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
H.UpdateDamageIcon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/bible/attack(mob/M as mob, mob/living/user as mob)
|
||||
/obj/item/weapon/storage/bible/attack(mob/living/M as mob, mob/living/user as mob)
|
||||
|
||||
var/chaplain = 0
|
||||
if(user.mind && (user.mind.assigned_role == "Chaplain"))
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
var/open = 0 //if the lid is up
|
||||
var/cistern = 0 //if the cistern bit is open
|
||||
var/w_items = 0 //the combined w_class of all the items in the cistern
|
||||
var/mob/swirlie = null //the mob being given a swirlie
|
||||
var/mob/living/swirlie = null //the mob being given a swirlie
|
||||
|
||||
/obj/structure/toilet/New()
|
||||
open = round(rand(0, 1))
|
||||
update_icon()
|
||||
|
||||
/obj/structure/toilet/attack_hand(mob/user as mob)
|
||||
/obj/structure/toilet/attack_hand(mob/living/user as mob)
|
||||
if(swirlie)
|
||||
usr.visible_message("<span class='danger'>[user] slams the toilet seat onto [swirlie.name]'s head!</span>", "<span class='notice'>You slam the toilet seat onto [swirlie.name]'s head!</span>", "You hear reverberating porcelain.")
|
||||
swirlie.adjustBruteLoss(8)
|
||||
@@ -44,7 +44,7 @@
|
||||
/obj/structure/toilet/update_icon()
|
||||
icon_state = "toilet[open][cistern]"
|
||||
|
||||
/obj/structure/toilet/attackby(obj/item/I as obj, mob/user as mob)
|
||||
/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
|
||||
if(istype(I, /obj/item/weapon/crowbar))
|
||||
user << "<span class='notice'>You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"].</span>"
|
||||
playsound(loc, 'stonedoor_openclose.ogg', 50, 1)
|
||||
@@ -56,8 +56,10 @@
|
||||
|
||||
if(istype(I, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = I
|
||||
var/mob/GM = G.affecting
|
||||
if(ismob(G.affecting))
|
||||
|
||||
if(isliving(G.affecting))
|
||||
var/mob/living/GM = G.affecting
|
||||
|
||||
if(G.state>1)
|
||||
if(!GM.loc == get_turf(src))
|
||||
user << "<span class='notice'>[GM.name] needs to be on the toilet.</span>"
|
||||
@@ -102,8 +104,8 @@
|
||||
/obj/structure/urinal/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = I
|
||||
var/mob/GM = G.affecting
|
||||
if(ismob(G.affecting))
|
||||
if(isliving(G.affecting))
|
||||
var/mob/living/GM = G.affecting
|
||||
if(G.state>1)
|
||||
if(!GM.loc == get_turf(src))
|
||||
user << "<span class='notice'>[GM.name] needs to be on the urinal.</span>"
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
target.adjustBruteLoss(100)
|
||||
*/
|
||||
|
||||
/obj/item/weapon/mousetrap/attack_self(mob/user as mob)
|
||||
/obj/item/weapon/mousetrap/attack_self(mob/living/user as mob)
|
||||
if(!armed)
|
||||
icon_state = "mousetraparmed"
|
||||
user << "\blue You arm the mousetrap."
|
||||
@@ -170,7 +170,7 @@
|
||||
armed = !armed
|
||||
playsound(user.loc, 'handcuffs.ogg', 30, 1, -3)
|
||||
|
||||
/obj/item/weapon/mousetrap/attack_hand(mob/user as mob)
|
||||
/obj/item/weapon/mousetrap/attack_hand(mob/living/user as mob)
|
||||
if(armed)
|
||||
if(( (user.getBrainLoss() >= 60 || CLUMSY in user.mutations)) && prob(50))
|
||||
var/which_hand = "l_hand"
|
||||
|
||||
@@ -1152,7 +1152,11 @@ var/global/BSACooldown = 0
|
||||
special_role_description = "Role: <i>Mind datum missing</i> Antagonist: <i>Mind datum missing</i>; Has been rev: <i>Mind datum missing</i>;"
|
||||
|
||||
//Health
|
||||
health_description = "Oxy: [M.oxyloss] - Tox: [M.toxloss] - Fire: [M.fireloss] - Brute: [M.bruteloss] - Clone: [M.cloneloss] - Brain: [M.brainloss]"
|
||||
if(isliving(M))
|
||||
var/mob/living/L
|
||||
health_description = "Oxy: [L.oxyloss] - Tox: [L.toxloss] - Fire: [L.fireloss] - Brute: [L.bruteloss] - Clone: [L.cloneloss] - Brain: [L.brainloss]"
|
||||
else
|
||||
health_description = "This mob type has no health to speak of."
|
||||
|
||||
src.owner << "<b>Info about [M.name]:</b> "
|
||||
src.owner << "Mob type = [M.type]; Damage = [health_description]"
|
||||
@@ -1191,10 +1195,16 @@ var/global/BSACooldown = 0
|
||||
show_traitor_panel(M)
|
||||
|
||||
if (href_list["BlueSpaceArtillery"])
|
||||
var/mob/M = locate(href_list["BlueSpaceArtillery"])
|
||||
if(!M)
|
||||
var/mob/target = locate(href_list["BlueSpaceArtillery"])
|
||||
if(!target)
|
||||
return
|
||||
|
||||
if(!isliving(target))
|
||||
src.owner << "That is not a valid target."
|
||||
return
|
||||
|
||||
var/mob/living/M = target
|
||||
|
||||
var/choice = alert(src.owner, "Are you sure you wish to hit [key_name(M)] with Blue Space Artillery?", "Confirm Firing?" , "Yes" , "No")
|
||||
if (choice == "No")
|
||||
return
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -194,13 +194,14 @@
|
||||
|
||||
var/damage = rand(melee_damage_lower, melee_damage_upper)
|
||||
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/datum/organ/external/affecting = H.get_organ(ran_zone(dam_zone))
|
||||
H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"))
|
||||
else
|
||||
target:adjustBruteLoss(damage)
|
||||
else if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
L.adjustBruteLoss(damage)
|
||||
|
||||
if(attack_sound)
|
||||
playsound(loc, attack_sound, 50, 1, -1)
|
||||
|
||||
@@ -346,7 +346,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite
|
||||
/obj/item/clothing/shoes/magboots, /obj/item/blueprints, /obj/item/weapon/disk/nuclear,\
|
||||
/obj/item/clothing/suit/space/nasavoid, /obj/item/weapon/tank)
|
||||
|
||||
/proc/fake_attack(var/mob/target)
|
||||
/proc/fake_attack(var/mob/living/target)
|
||||
// var/list/possible_clones = new/list()
|
||||
var/mob/living/carbon/human/clone = null
|
||||
var/clone_weapon = null
|
||||
|
||||
@@ -528,7 +528,7 @@
|
||||
|
||||
proc/handle_stomach()
|
||||
spawn(0)
|
||||
for(var/mob/M in stomach_contents)
|
||||
for(var/mob/living/M in stomach_contents)
|
||||
if(M.loc != src)
|
||||
stomach_contents.Remove(M)
|
||||
continue
|
||||
|
||||
@@ -459,7 +459,7 @@
|
||||
|
||||
proc/handle_stomach()
|
||||
spawn(0)
|
||||
for(var/mob/M in stomach_contents)
|
||||
for(var/mob/living/M in stomach_contents)
|
||||
if(M.loc != src)
|
||||
stomach_contents.Remove(M)
|
||||
continue
|
||||
|
||||
@@ -235,3 +235,13 @@
|
||||
/mob/living/carbon/proc/eyecheck()
|
||||
return 0
|
||||
|
||||
// ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching.
|
||||
// Stop! ... Hammertime! ~Carn
|
||||
|
||||
/mob/living/carbon/proc/getDNA()
|
||||
return dna
|
||||
|
||||
/mob/living/carbon/proc/setDNA(var/datum/dna/newDNA)
|
||||
dna = newDNA
|
||||
|
||||
// ++++ROCKDTBEN++++ MOB PROCS //END
|
||||
|
||||
@@ -310,7 +310,7 @@
|
||||
|
||||
var/t7 = 1
|
||||
if (restrained())
|
||||
for(var/mob/M in range(src, 1))
|
||||
for(var/mob/living/M in range(src, 1))
|
||||
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
|
||||
t7 = null
|
||||
if ((t7 && (pulling && ((get_dist(src, pulling) <= 1 || pulling.loc == loc) && (client && client.moving)))))
|
||||
@@ -337,8 +337,8 @@
|
||||
else
|
||||
diag = null
|
||||
if ((get_dist(src, pulling) > 1 || diag))
|
||||
if (ismob(pulling))
|
||||
var/mob/M = pulling
|
||||
if (isliving(pulling))
|
||||
var/mob/living/M = pulling
|
||||
var/ok = 1
|
||||
if (locate(/obj/item/weapon/grab, M.grabbed_by))
|
||||
if (prob(75))
|
||||
|
||||
@@ -1102,7 +1102,7 @@
|
||||
|
||||
proc/handle_stomach()
|
||||
spawn(0)
|
||||
for(var/mob/M in stomach_contents)
|
||||
for(var/mob/living/M in stomach_contents)
|
||||
if(M.loc != src)
|
||||
stomach_contents.Remove(M)
|
||||
continue
|
||||
|
||||
@@ -81,6 +81,70 @@
|
||||
// world << "[src] ~ [src.bodytemperature] ~ [temperature]"
|
||||
return temperature
|
||||
|
||||
|
||||
// ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching.
|
||||
// Stop! ... Hammertime! ~Carn
|
||||
|
||||
/mob/living/proc/getBruteLoss()
|
||||
return bruteloss
|
||||
|
||||
/mob/living/proc/adjustBruteLoss(var/amount)
|
||||
bruteloss = max(bruteloss + amount, 0)
|
||||
|
||||
/mob/living/proc/getOxyLoss()
|
||||
return oxyloss
|
||||
|
||||
/mob/living/proc/adjustOxyLoss(var/amount)
|
||||
oxyloss = max(oxyloss + amount, 0)
|
||||
|
||||
/mob/living/proc/setOxyLoss(var/amount)
|
||||
oxyloss = amount
|
||||
|
||||
/mob/living/proc/getToxLoss()
|
||||
return toxloss
|
||||
|
||||
/mob/living/proc/adjustToxLoss(var/amount)
|
||||
toxloss = max(toxloss + amount, 0)
|
||||
|
||||
/mob/living/proc/setToxLoss(var/amount)
|
||||
toxloss = amount
|
||||
|
||||
/mob/living/proc/getFireLoss()
|
||||
return fireloss
|
||||
|
||||
/mob/living/proc/adjustFireLoss(var/amount)
|
||||
fireloss = max(fireloss + amount, 0)
|
||||
|
||||
/mob/living/proc/getCloneLoss()
|
||||
return cloneloss
|
||||
|
||||
/mob/living/proc/adjustCloneLoss(var/amount)
|
||||
cloneloss = max(cloneloss + amount, 0)
|
||||
|
||||
/mob/living/proc/setCloneLoss(var/amount)
|
||||
cloneloss = amount
|
||||
|
||||
/mob/living/proc/getBrainLoss()
|
||||
return brainloss
|
||||
|
||||
/mob/living/proc/adjustBrainLoss(var/amount)
|
||||
brainloss = max(brainloss + amount, 0)
|
||||
|
||||
/mob/living/proc/setBrainLoss(var/amount)
|
||||
brainloss = amount
|
||||
|
||||
/mob/living/proc/getHalLoss()
|
||||
return halloss
|
||||
|
||||
/mob/living/proc/adjustHalLoss(var/amount)
|
||||
halloss = max(halloss + amount, 0)
|
||||
|
||||
/mob/living/proc/setHalLoss(var/amount)
|
||||
halloss = amount
|
||||
|
||||
// ++++ROCKDTBEN++++ MOB PROCS //END
|
||||
|
||||
|
||||
/mob/proc/get_contents()
|
||||
|
||||
/mob/living/get_contents()
|
||||
|
||||
17
code/modules/mob/living/living_defines.dm
Normal file
17
code/modules/mob/living/living_defines.dm
Normal file
@@ -0,0 +1,17 @@
|
||||
/mob/living
|
||||
|
||||
|
||||
//Vars that should only be accessed via procs
|
||||
var/bruteloss = 0.0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
|
||||
var/oxyloss = 0.0 //Oxygen depravation damage (no air in lungs)
|
||||
var/toxloss = 0.0 //Toxic damage caused by being poisoned or radiated
|
||||
var/fireloss = 0.0 //Burn damage caused by being way too hot, too cold or burnt.
|
||||
var/cloneloss = 0 //Damage caused by being cloned or ejected from the cloner early. Metroids also deal cloneloss damage to victims
|
||||
var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot.
|
||||
var/halloss = 0 //Hallucination damage. 'Fake' damage obtained through hallucinating or the holodeck. Sleeping should cause it to wear off.
|
||||
//Vars that should only be accessed via procs ++END
|
||||
|
||||
var/hallucination = 0 //Directly affects how long a mob will hallucinate for
|
||||
var/list/atom/hallucinations = list() //A list of hallucinated people that try to attack the mob. See /obj/effect/fake_attacker in hallucinations.dm
|
||||
|
||||
var/last_special = 0 //Used by the resist verb, likely used to prevent players from bypassing next_move by logging in/out.
|
||||
@@ -812,82 +812,12 @@ note dizziness decrements automatically in the mob's Life() proc.
|
||||
resting = max(resting + amount,0)
|
||||
return
|
||||
|
||||
// ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching.
|
||||
// Stop! ... Hammertime! ~Carn
|
||||
|
||||
/mob/proc/getBruteLoss()
|
||||
return bruteloss
|
||||
|
||||
/mob/proc/adjustBruteLoss(var/amount)
|
||||
bruteloss = max(bruteloss + amount, 0)
|
||||
|
||||
/mob/proc/getOxyLoss()
|
||||
return oxyloss
|
||||
|
||||
/mob/proc/adjustOxyLoss(var/amount)
|
||||
oxyloss = max(oxyloss + amount, 0)
|
||||
|
||||
/mob/proc/setOxyLoss(var/amount)
|
||||
oxyloss = amount
|
||||
|
||||
/mob/proc/getToxLoss()
|
||||
return toxloss
|
||||
|
||||
/mob/proc/adjustToxLoss(var/amount)
|
||||
toxloss = max(toxloss + amount, 0)
|
||||
|
||||
/mob/proc/setToxLoss(var/amount)
|
||||
toxloss = amount
|
||||
|
||||
/mob/proc/getFireLoss()
|
||||
return fireloss
|
||||
|
||||
/mob/proc/adjustFireLoss(var/amount)
|
||||
fireloss = max(fireloss + amount, 0)
|
||||
|
||||
/mob/proc/getCloneLoss()
|
||||
return cloneloss
|
||||
|
||||
/mob/proc/adjustCloneLoss(var/amount)
|
||||
cloneloss = max(cloneloss + amount, 0)
|
||||
|
||||
/mob/proc/setCloneLoss(var/amount)
|
||||
cloneloss = amount
|
||||
|
||||
/mob/proc/getHalLoss()
|
||||
return halloss
|
||||
|
||||
/mob/proc/adjustHalLoss(var/amount)
|
||||
halloss = max(halloss + amount, 0)
|
||||
|
||||
/mob/proc/setHalLoss(var/amount)
|
||||
halloss = amount
|
||||
|
||||
|
||||
|
||||
/mob/proc/getBrainLoss()
|
||||
return brainloss
|
||||
|
||||
/mob/proc/adjustBrainLoss(var/amount)
|
||||
brainloss = max(brainloss + amount, 0)
|
||||
|
||||
/mob/proc/setBrainLoss(var/amount)
|
||||
brainloss = amount
|
||||
|
||||
/mob/proc/getDNA()
|
||||
return dna
|
||||
|
||||
/mob/proc/setDNA(var/datum/dna/newDNA)
|
||||
dna = newDNA
|
||||
|
||||
/mob/proc/getMaxHealth()
|
||||
return maxHealth
|
||||
|
||||
/mob/proc/setMaxHealth(var/newMaxHealth)
|
||||
maxHealth = newMaxHealth
|
||||
|
||||
// ++++ROCKDTBEN++++ MOB PROCS //END
|
||||
|
||||
/*
|
||||
* Sends resource files to client cache
|
||||
*/
|
||||
|
||||
@@ -5,25 +5,10 @@
|
||||
flags = NOREACT
|
||||
var/datum/mind/mind
|
||||
|
||||
//MOB overhaul
|
||||
|
||||
//Not in use yet
|
||||
var/obj/effect/organstructure/organStructure = null
|
||||
|
||||
//Vars that have been relocated to organStructure
|
||||
//Vars that have been relocated to organStructure ++END
|
||||
|
||||
|
||||
|
||||
//Vars that should only be accessed via procs
|
||||
var/bruteloss = 0.0//Living
|
||||
var/oxyloss = 0.0//Living
|
||||
var/toxloss = 0.0//Living
|
||||
var/fireloss = 0.0//Living
|
||||
var/cloneloss = 0//Carbon
|
||||
var/brainloss = 0//Carbon
|
||||
var/maxHealth = 100 //Living
|
||||
//Vars that should only be accessed via procs ++END
|
||||
var/maxHealth = 100 //Maximum health that should be possible. Used by living, organ and simple_mobs
|
||||
|
||||
|
||||
// var/uses_hud = 0
|
||||
@@ -57,7 +42,6 @@
|
||||
*/
|
||||
//var/midis = 1 //Check if midis should be played for someone - no, this is something that is tied to clients, not mobs.
|
||||
var/alien_egg_flag = 0//Have you been infected?
|
||||
var/last_special = 0
|
||||
var/obj/screen/zone_sel/zone_sel = null
|
||||
|
||||
var/emote_allowed = 1
|
||||
@@ -238,11 +222,6 @@
|
||||
var/robot_talk_understand = 0
|
||||
var/alien_talk_understand = 0
|
||||
|
||||
//You can guess what these are for. --SkyMarshal
|
||||
var/list/atom/hallucinations = list()
|
||||
var/halloss = 0
|
||||
var/hallucination = 0
|
||||
|
||||
/*For ninjas and others. This variable is checked when a mob moves and I guess it was supposed to allow the mob to move
|
||||
through dense areas, such as walls. Setting density to 0 does the same thing. The difference here is that
|
||||
the mob is also allowed to move without any sort of restriction. For instance, in space or out of holder objects.*/
|
||||
|
||||
@@ -57,8 +57,10 @@
|
||||
var/ending = copytext(text, length(text))
|
||||
if (src.stuttering)
|
||||
return "stammers, \"[text]\"";
|
||||
if (src.getBrainLoss() >= 60)
|
||||
return "gibbers, \"[text]\"";
|
||||
if(isliving(src))
|
||||
var/mob/living/L = src
|
||||
if (L.getBrainLoss() >= 60)
|
||||
return "gibbers, \"[text]\"";
|
||||
if (ending == "?")
|
||||
return "asks, \"[text]\"";
|
||||
if (ending == "!")
|
||||
|
||||
@@ -521,7 +521,7 @@
|
||||
return
|
||||
|
||||
|
||||
/mob/living/verb/mob_sleep()
|
||||
/mob/living/carbon/verb/mob_sleep()
|
||||
set name = "Sleep"
|
||||
set category = "IC"
|
||||
|
||||
@@ -531,7 +531,7 @@
|
||||
else
|
||||
usr.sleeping = 20 //Short nap
|
||||
|
||||
/mob/living/verb/lay_down()
|
||||
/mob/living/carbon/verb/lay_down()
|
||||
set name = "Lay down / Get up"
|
||||
set category = "IC"
|
||||
|
||||
@@ -543,14 +543,16 @@
|
||||
set name = "Resist"
|
||||
set category = "IC"
|
||||
|
||||
if(usr.next_move > world.time)
|
||||
if(!isliving(usr) || usr.next_move > world.time)
|
||||
return
|
||||
usr.next_move = world.time + 20
|
||||
|
||||
var/mob/living/L = usr
|
||||
|
||||
//resisting grabs (as if it helps anyone...)
|
||||
if ((!( usr.stat ) && usr.canmove && !( usr.restrained() )))
|
||||
if ((!( L.stat ) && L.canmove && !( L.restrained() )))
|
||||
var/resisting = 0
|
||||
for(var/obj/O in usr.requests)
|
||||
for(var/obj/O in L.requests)
|
||||
del(O)
|
||||
resisting++
|
||||
for(var/obj/item/weapon/grab/G in usr.grabbed_by)
|
||||
@@ -560,86 +562,46 @@
|
||||
else
|
||||
if (G.state == 2)
|
||||
if (prob(25))
|
||||
for(var/mob/O in viewers(usr, null))
|
||||
O.show_message(text("\red [] has broken free of []'s grip!", usr, G.assailant), 1)
|
||||
for(var/mob/O in viewers(L, null))
|
||||
O.show_message(text("\red [] has broken free of []'s grip!", L, G.assailant), 1)
|
||||
del(G)
|
||||
else
|
||||
if (G.state == 3)
|
||||
if (prob(5))
|
||||
for(var/mob/O in viewers(usr, null))
|
||||
O.show_message(text("\red [] has broken free of []'s headlock!", usr, G.assailant), 1)
|
||||
O.show_message(text("\red [] has broken free of []'s headlock!", L, G.assailant), 1)
|
||||
del(G)
|
||||
if(resisting)
|
||||
for(var/mob/O in viewers(usr, null))
|
||||
O.show_message(text("\red <B>[] resists!</B>", usr), 1)
|
||||
O.show_message(text("\red <B>[] resists!</B>", L), 1)
|
||||
|
||||
|
||||
|
||||
//breaking out of handcuffs
|
||||
if(usr:handcuffed && usr:canmove && (usr.last_special <= world.time))
|
||||
usr.next_move = world.time + 100
|
||||
usr.last_special = world.time + 100
|
||||
if(isalienadult(usr) || (HULK in usr.mutations) || (SUPRSTR in usr.augmentations))//Don't want to do a lot of logic gating here.
|
||||
usr << "\green You attempt to break your handcuffs. (This will take around 5 seconds and you need to stand still)"
|
||||
for(var/mob/O in viewers(usr))
|
||||
O.show_message(text("\red <B>[] is trying to break the handcuffs!</B>", usr), 1)
|
||||
spawn(0)
|
||||
if(do_after(usr, 50))
|
||||
if(!usr:handcuffed || usr:buckled)
|
||||
return
|
||||
for(var/mob/O in viewers(usr))
|
||||
O.show_message(text("\red <B>[] manages to break the handcuffs!</B>", usr), 1)
|
||||
usr << "\green You successfully break your handcuffs."
|
||||
del(usr:handcuffed)
|
||||
usr:handcuffed = null
|
||||
usr.update_inv_handcuffed()
|
||||
else
|
||||
var/obj/item/weapon/handcuffs/HC = usr:handcuffed
|
||||
var/breakouttime = 1200 //A default in case you are somehow handcuffed with something that isn't an obj/item/weapon/handcuffs type
|
||||
var/displaytime = 2 //Minutes to display in the "this will take X minutes."
|
||||
if(istype(HC)) //If you are handcuffed with actual handcuffs... Well what do I know, maybe someone will want to handcuff you with toilet paper in the future...
|
||||
breakouttime = HC.breakouttime
|
||||
displaytime = breakouttime / 600 //Minutes
|
||||
usr << "\red You attempt to remove \the [HC]. (This will take around [displaytime] minutes and you need to stand still)"
|
||||
for(var/mob/O in viewers(usr))
|
||||
O.show_message( "\red <B>[usr] attempts to remove \the [HC]!</B>", 1)
|
||||
spawn(0)
|
||||
if(do_after(usr, breakouttime))
|
||||
if(!usr:handcuffed || usr:buckled)
|
||||
return // time leniency for lag which also might make this whole thing pointless but the server
|
||||
for(var/mob/O in viewers(usr))// lags so hard that 40s isn't lenient enough - Quarxink
|
||||
O.show_message("\red <B>[usr] manages to remove the handcuffs!</B>", 1)
|
||||
usr << "\blue You successfully remove \the [usr:handcuffed]."
|
||||
usr:handcuffed.loc = usr.loc
|
||||
usr:handcuffed = null
|
||||
usr.update_inv_handcuffed()
|
||||
|
||||
//unbuckling yourself
|
||||
else if( usr:buckled && (usr.last_special <= world.time) )
|
||||
if( usr:handcuffed )
|
||||
usr.next_move = world.time + 100
|
||||
usr.last_special = world.time + 100
|
||||
usr << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)"
|
||||
for(var/mob/O in viewers(usr))
|
||||
if( L.buckled && (L.last_special <= world.time) )
|
||||
if( L.handcuffed )
|
||||
L.next_move = world.time + 100
|
||||
L.last_special = world.time + 100
|
||||
L << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)"
|
||||
for(var/mob/O in viewers(L))
|
||||
O.show_message("\red <B>[usr] attempts to unbuckle themself!</B>", 1)
|
||||
spawn(0)
|
||||
if(do_after(usr, 1200))
|
||||
if(!usr:buckled)
|
||||
if(!L.buckled)
|
||||
return
|
||||
for(var/mob/O in viewers(usr))
|
||||
for(var/mob/O in viewers(L))
|
||||
O.show_message("\red <B>[usr] manages to unbuckle themself!</B>", 1)
|
||||
usr << "\blue You successfully unbuckle yourself."
|
||||
usr:buckled.manual_unbuckle(usr)
|
||||
L << "\blue You successfully unbuckle yourself."
|
||||
L.buckled.manual_unbuckle(L)
|
||||
else
|
||||
usr:buckled.manual_unbuckle(usr)
|
||||
|
||||
L.buckled.manual_unbuckle(L)
|
||||
|
||||
//Breaking out of a locker?
|
||||
else if( src.loc && (istype(src.loc, /obj/structure/closet)) )
|
||||
var/obj/structure/closet/C = usr.loc
|
||||
var/obj/structure/closet/C = L.loc
|
||||
if(C.opened)
|
||||
return //Door's open... wait, why are you in it's contents then?
|
||||
if(istype(usr.loc, /obj/structure/closet/secure_closet))
|
||||
var/obj/structure/closet/secure_closet/SC = usr.loc
|
||||
if(istype(L.loc, /obj/structure/closet/secure_closet))
|
||||
var/obj/structure/closet/secure_closet/SC = L.loc
|
||||
if(!SC.locked && !SC.welded)
|
||||
return //It's a secure closet, but isn't locked. Easily escapable from, no need to 'resist'
|
||||
else
|
||||
@@ -648,18 +610,18 @@
|
||||
|
||||
//okay, so the closet is either welded or locked... resist!!!
|
||||
usr.next_move = world.time + 100
|
||||
usr.last_special = world.time + 100
|
||||
usr << "\red You lean on the back of \the [C] and start pushing the door open. (this will take about 2 minutes)"
|
||||
L.last_special = world.time + 100
|
||||
L << "\red You lean on the back of \the [C] and start pushing the door open. (this will take about 2 minutes)"
|
||||
for(var/mob/O in viewers(usr.loc))
|
||||
O.show_message("\red <B>The [usr.loc] begins to shake violently!</B>", 1)
|
||||
O.show_message("\red <B>The [L.loc] begins to shake violently!</B>", 1)
|
||||
spawn(0)
|
||||
if(do_after(usr, 50))
|
||||
if(!C || !usr || usr.loc != C || C.opened) //User, closet destroyed OR user no longer in closet OR closet opened
|
||||
if(!C || !L || L.loc != C || C.opened) //User, closet destroyed OR user no longer in closet OR closet opened
|
||||
return
|
||||
|
||||
//Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
|
||||
if(istype(usr.loc, /obj/structure/closet/secure_closet))
|
||||
var/obj/structure/closet/secure_closet/SC = usr.loc
|
||||
if(istype(L.loc, /obj/structure/closet/secure_closet))
|
||||
var/obj/structure/closet/secure_closet/SC = L.loc
|
||||
if(!SC.locked && !SC.welded)
|
||||
return
|
||||
else
|
||||
@@ -668,7 +630,7 @@
|
||||
|
||||
//Well then break it!
|
||||
if(istype(usr.loc, /obj/structure/closet/secure_closet))
|
||||
var/obj/structure/closet/secure_closet/SC = usr.loc
|
||||
var/obj/structure/closet/secure_closet/SC = L.loc
|
||||
SC.desc = "It appears to be broken."
|
||||
SC.icon_state = SC.icon_off
|
||||
flick(SC.icon_broken, SC)
|
||||
@@ -678,12 +640,53 @@
|
||||
SC.broken = 1
|
||||
SC.locked = 0
|
||||
usr << "\red You successfully break out!"
|
||||
for(var/mob/O in viewers(usr.loc))
|
||||
for(var/mob/O in viewers(L.loc))
|
||||
O.show_message("\red <B>\the [usr] successfully broke out of \the [SC]!</B>", 1)
|
||||
SC.open()
|
||||
else
|
||||
C.welded = 0
|
||||
usr << "\red You successfully break out!"
|
||||
for(var/mob/O in viewers(usr.loc))
|
||||
for(var/mob/O in viewers(L.loc))
|
||||
O.show_message("\red <B>\the [usr] successfully broke out of \the [C]!</B>", 1)
|
||||
C.open()
|
||||
C.open()
|
||||
|
||||
//breaking out of handcuffs
|
||||
else if(iscarbon(L))
|
||||
var/mob/living/carbon/CM = L
|
||||
if(CM.handcuffed && CM.canmove && (CM.last_special <= world.time))
|
||||
CM.next_move = world.time + 100
|
||||
CM.last_special = world.time + 100
|
||||
if(isalienadult(CM) || (HULK in usr.mutations) || (SUPRSTR in CM.augmentations))//Don't want to do a lot of logic gating here.
|
||||
usr << "\green You attempt to break your handcuffs. (This will take around 5 seconds and you need to stand still)"
|
||||
for(var/mob/O in viewers(CM))
|
||||
O.show_message(text("\red <B>[] is trying to break the handcuffs!</B>", CM), 1)
|
||||
spawn(0)
|
||||
if(do_after(CM, 50))
|
||||
if(!CM.handcuffed || CM.buckled)
|
||||
return
|
||||
for(var/mob/O in viewers(CM))
|
||||
O.show_message(text("\red <B>[] manages to break the handcuffs!</B>", CM), 1)
|
||||
CM << "\green You successfully break your handcuffs."
|
||||
del(CM.handcuffed)
|
||||
CM.handcuffed = null
|
||||
CM.update_inv_handcuffed()
|
||||
else
|
||||
var/obj/item/weapon/handcuffs/HC = CM.handcuffed
|
||||
var/breakouttime = 1200 //A default in case you are somehow handcuffed with something that isn't an obj/item/weapon/handcuffs type
|
||||
var/displaytime = 2 //Minutes to display in the "this will take X minutes."
|
||||
if(istype(HC)) //If you are handcuffed with actual handcuffs... Well what do I know, maybe someone will want to handcuff you with toilet paper in the future...
|
||||
breakouttime = HC.breakouttime
|
||||
displaytime = breakouttime / 600 //Minutes
|
||||
CM << "\red You attempt to remove \the [HC]. (This will take around [displaytime] minutes and you need to stand still)"
|
||||
for(var/mob/O in viewers(CM))
|
||||
O.show_message( "\red <B>[usr] attempts to remove \the [HC]!</B>", 1)
|
||||
spawn(0)
|
||||
if(do_after(CM, breakouttime))
|
||||
if(!CM.handcuffed || CM.buckled)
|
||||
return // time leniency for lag which also might make this whole thing pointless but the server
|
||||
for(var/mob/O in viewers(CM))// lags so hard that 40s isn't lenient enough - Quarxink
|
||||
O.show_message("\red <B>[CM] manages to remove the handcuffs!</B>", 1)
|
||||
CM << "\blue You successfully remove \the [CM.handcuffed]."
|
||||
CM.handcuffed.loc = usr.loc
|
||||
CM.handcuffed = null
|
||||
CM.update_inv_handcuffed()
|
||||
@@ -48,7 +48,7 @@
|
||||
flag = "energy"
|
||||
|
||||
on_hit(var/atom/target, var/blocked = 0)
|
||||
var/mob/M = target
|
||||
var/mob/living/M = target
|
||||
if(istype(target, /mob/living) && M:mutantrace == "plant") //Plantmen possibly get mutated and damaged by the rays.
|
||||
var/mob/living/L as mob
|
||||
if(prob(15))
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<table align='center' class="top">
|
||||
<tr>
|
||||
<td valign='top'>
|
||||
<font size='2'><b>Coders:</b> TLE, NEO, Errorage, muskets, veryinky, Skie, Noise, Numbers, Agouri, Noka, Urist McDorf, Uhangi, Darem, Mport, rastaf0, Doohl, Superxpdude, Rockdtben, ConstantA, Petethegoat, Kor, Polymorph, Carn, Nodrak, Donkie<br></font>
|
||||
<font size='2'><b>Coders:</b> TLE, NEO, Errorage, muskets, veryinky, Skie, Noise, Numbers, Agouri, Noka, Urist McDorf, Uhangi, Darem, Mport, rastaf0, Doohl, Superxpdude, Rockdtben, ConstantA, Petethegoat, Kor, Polymorph, Carn, Nodrak, Donkie, Sieve<br></font>
|
||||
<font size='2'><b>Spriters:</b> Agouri, Cheridan, Cruazy Guest, Deeaych, Deuryn, Matty406, Microwave, ShiftyEyesShady, Skie, Uhangi, Veyveyr, Petethegoat, Kor, Ricotez, Ausops, TankNut<br></font>
|
||||
<font size='2'><b>Sounds:</b> Skie, Lasty/Vinyl<br></font>
|
||||
<font size='2'><b>Thanks to:</b> CDK Station devs, GoonStation devs, the original SpaceStation developers and Invisty for the title image</font>
|
||||
@@ -46,6 +46,14 @@ Stuff which is in development and not yet visible to players or just code relate
|
||||
should be listed in the changelog upon commit tho. Thanks. -->
|
||||
|
||||
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">Thursday, June 28th</h2>
|
||||
<h3 class="author">Nodrak updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="wip">I'm currently working on cleaning up and moving around a large portion of the mob code. These changes do not directly affect players; HOWEVER, bugs, oversights or simple mistakes may cause problems for players. While I have tested as much as I can, there may be some lingering bugs I have missed. <p> This part of the mob code cleanup mainly focuses on damage variables and procs. So if you suspect something related to taking, dealing or examining damage is not working as intended please fill out an issue report <a href="http://code.google.com/p/tgstation13/issues/list">here</a> and be as detailed as possible. This includes what you were doing, steps to reproduce the problem, who you were doing it to, what you were using ect... Thank you.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">Wednesday, June 27th</h2>
|
||||
<h3 class="author">Errorage updated:</h3>
|
||||
|
||||
@@ -920,6 +920,7 @@
|
||||
#include "code\modules\mob\living\damage_procs.dm"
|
||||
#include "code\modules\mob\living\living.dm"
|
||||
#include "code\modules\mob\living\living_defense.dm"
|
||||
#include "code\modules\mob\living\living_defines.dm"
|
||||
#include "code\modules\mob\living\login.dm"
|
||||
#include "code\modules\mob\living\say.dm"
|
||||
#include "code\modules\mob\living\blob\blob.dm"
|
||||
|
||||
Reference in New Issue
Block a user