diff --git a/code/datums/configuration.dm b/code/datums/configuration.dm index cef31a7763..cbfcd3bef1 100644 --- a/code/datums/configuration.dm +++ b/code/datums/configuration.dm @@ -40,6 +40,7 @@ var/list/modes = list() // allowed modes var/list/votable_modes = list() // votable modes var/list/probabilities = list() // relative probability of each mode + var/humans_need_surnames = 0 var/allow_random_events = 0 // enables random events mid-round when set to 1 var/allow_ai = 1 // allow ai job var/hostedby = null @@ -309,6 +310,9 @@ if("tickcomp") Tickcomp = 1 + if("humans_need_surnames") + humans_need_surnames = 1 + else diary << "Unknown setting in configuration: '[name]'" diff --git a/code/defines/mob/dead/observer.dm b/code/defines/mob/dead/observer.dm index f5f395f1f8..3a3af24c7b 100644 --- a/code/defines/mob/dead/observer.dm +++ b/code/defines/mob/dead/observer.dm @@ -4,6 +4,7 @@ icon = 'mob.dmi' icon_state = "ghost" layer = 4 + stat = DEAD density = 0 canmove = 0 blinded = 0 diff --git a/code/defines/mob/living/carbon/alien.dm b/code/defines/mob/living/carbon/alien.dm index cf2fe173f5..1ba8a00883 100644 --- a/code/defines/mob/living/carbon/alien.dm +++ b/code/defines/mob/living/carbon/alien.dm @@ -16,5 +16,4 @@ var/move_delay_add = 0 // movement delay to add - canstun = 0 - canweaken = 0 // aliens cannot be stunned or knocked down. Massive buff! \ No newline at end of file + status_flags = CANPARALYSE \ No newline at end of file diff --git a/code/defines/mob/living/carbon/metroid.dm b/code/defines/mob/living/carbon/metroid.dm index ac6ddf9300..14d93537f9 100644 --- a/code/defines/mob/living/carbon/metroid.dm +++ b/code/defines/mob/living/carbon/metroid.dm @@ -22,8 +22,7 @@ // canstun and canweaken don't affect metroids because they ignore stun and weakened variables // for the sake of cleanliness, though, here they are. - canstun = 0 - canweaken = 0 + status_flags = CANPARALYSE var/amount_grown = 0// controls how long the metroid has been overfed, if 10, grows into an adult // if adult: if 10: reproduces diff --git a/code/defines/mob/living/silicon/ai.dm b/code/defines/mob/living/silicon/ai.dm index aaa0772a11..e9fc9c7550 100644 --- a/code/defines/mob/living/silicon/ai.dm +++ b/code/defines/mob/living/silicon/ai.dm @@ -4,7 +4,7 @@ icon_state = "ai" anchored = 1 // -- TLE density = 1 - canweaken = 0 + status_flags = CANSTUN|CANPARALYSE var/network = "SS13" var/obj/machinery/camera/current = null var/list/connected_robots = list() diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 81eda7d7ae..3feb18c89f 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -686,10 +686,16 @@ var/mob/living/buckled_mob /obj/structure/stool/bed/alien - name = "Resting contraption" + name = "resting contraption" desc = "This looks similar to contraptions from earth. Could aliens be stealing our technology?" icon_state = "abed" +/obj/structure/stool/bed/nest + name = "alien nest" + desc = "It's a gruesome pile of thick, sticky resin shaped like a nest." + icon = 'alien.dmi' + icon_state = "nest" + var/health = 100 /obj/structure/stool/bed/chair //YES, chairs are a type of bed, which are a type of stool. This works, believe me. -Pete name = "chair" diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index 7f22e1a5a5..4be223c098 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -146,46 +146,51 @@ //removes doublespaces and double apostrophes //lowercases everything and capitalises the first letter of each word (or characters following an apostrophe) //prevents names which are too short, have too many space, or not enough normal letters -/proc/reject_bad_name(var/t_in, var/minimum_words=2, var/allow_numbers=0, var/max_length=MAX_NAME_LEN) +/proc/reject_bad_name(var/t_in, var/allow_numbers=0, var/max_length=MAX_NAME_LEN) if(length(t_in) > max_length) return //name too long var/number_of_alphanumeric = 0 - var/number_of_spaces = 0 var/last_char_group = 0 var/t_out = "" + for(var/i=1, i<=length(t_in), i++) var/ascii_char = text2ascii(t_in,i) switch(ascii_char) - if(65 to 90) //Uppercase letters allowed + if(65 to 90) //Uppercase Letters + t_out += ascii2text(ascii_char) + number_of_alphanumeric++ + last_char_group = 4 + + if(97 to 122) //Lowercase Letters + if(last_char_group<2) t_out += ascii2text(ascii_char-32) //Force uppercase first character + else t_out += ascii2text(ascii_char) + number_of_alphanumeric++ + last_char_group = 4 + + if(48 to 57) //Numbers + if(!last_char_group) continue //suppress at start of string + if(!allow_numbers) continue + t_out += ascii2text(ascii_char) + number_of_alphanumeric++ + last_char_group = 3 + + if(39,45,46) //Common name punctuation + t_out += ascii2text(ascii_char) + last_char_group = 2 + + if(126,124,64,58,35,36,37,38,42,43) //Other crap that's harmless + if(!last_char_group) continue //suppress at start of string + if(!allow_numbers) continue + t_out += ascii2text(ascii_char) + last_char_group = 2 + + if(32) //Space + if(last_char_group <= 1) continue //suppress double-spaces and spaces at start of string t_out += ascii2text(ascii_char) last_char_group = 1 - number_of_alphanumeric++ - if(97 to 122) //Lowercase letters allowed - switch(last_char_group) - if(3,4,0) t_out += ascii2text(ascii_char-32) //Force uppercase if preceeded by space or ' - else t_out += ascii2text(ascii_char) - last_char_group = 2 - number_of_alphanumeric++ - if(32) //Space - switch(last_char_group) - if(3,0) continue - else t_out += ascii2text(ascii_char) //so we don't get double-spaces - last_char_group = 3 - number_of_spaces++ - if(39,45,46) //Apostrophe for dem Oirish names like "O'Neil", dashes for double-barreled names and periods for "James T. Kirk" and AI's - switch(last_char_group) - if(4,0) continue - else t_out += ascii2text(ascii_char) //so we don't get double apostrophes or whatever - last_char_group = 4 - if(48 to 57) - if(allow_numbers) - t_out += ascii2text(ascii_char) //Allow numbers (i.e. for borgs andd AIs) - number_of_alphanumeric++ - last_char_group = 5 else return - if(last_char_group == 3) number_of_spaces-- - if(number_of_alphanumeric < 4) return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '" - if(number_of_spaces > 4 || number_of_spaces < minimum_words-1) return //protects against single-word names like "Unknown" and names like "I ' M A D E R P Spaces Lul" + + if(number_of_alphanumeric < 2) return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '" return t_out /proc/strip_html_simple(var/t,var/limit=MAX_MESSAGE_LEN) @@ -739,7 +744,7 @@ Turf and target are seperate in case you want to teleport some distance from a t if(0) if(1 to 5) M << "Invalid name. Your name should be at least 4 alphanumeric characters but under [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, 0-9, -, ' and ." else break - newname = reject_bad_name(input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname),1,1) + newname = reject_bad_name(input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname),1) iterations++ if((world.time-time_passed)>300)//If more than 20 game seconds passed. diff --git a/code/game/objects/alien/defines.dm b/code/game/objects/alien/defines.dm index da67cc9cd5..da187f6b6d 100644 --- a/code/game/objects/alien/defines.dm +++ b/code/game/objects/alien/defines.dm @@ -49,8 +49,6 @@ name = "purple sac" desc = "Weird purple octopus-like thing." - density = 1 - /obj/effect/alien/acid name = "acid" desc = "Burbling corrossive stuff. I wouldn't want to touch it." diff --git a/code/game/objects/alien/nest.dm b/code/game/objects/alien/nest.dm new file mode 100644 index 0000000000..a34a9e95ca --- /dev/null +++ b/code/game/objects/alien/nest.dm @@ -0,0 +1,62 @@ +//Alium nests. Essentially beds with an unbuckle delay that only aliums can buckle mobs to. +/obj/structure/stool/bed/nest/manual_unbuckle(mob/user as mob) + if(buckled_mob) + if(buckled_mob.buckled == src) + if(buckled_mob != user) + buckled_mob.visible_message(\ + "[user.name] pulls [buckled_mob.name] free from the sticky nest!",\ + "[user.name] pulls you free from the gelatinous resin.",\ + "You hear squelching...") + unbuckle() + else + buckled_mob.visible_message(\ + "[buckled_mob.name] struggles to break free of the gelatinous resin...",\ + "You struggle to break free from the gelatinous resin...",\ + "You hear squelching...") + spawn(1200) + if(buckled_mob && user.buckled == src) unbuckle() + src.add_fingerprint(user) + return + +/obj/structure/stool/bed/nest/buckle_mob(mob/M as mob, mob/user as mob) + if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || usr.stat || M.buckled || istype(user, /mob/living/silicon/pai) ) + return + + if(istype(M,/mob/living/carbon/alien)) + return + if(!istype(user,/mob/living/carbon/alien/humanoid)) + return + + unbuckle() + + if(M == usr) + return + else + M.visible_message(\ + "[user.name] secretes a thick vile goo, securing [M.name] into [src]!",\ + "[user.name] drenches you in a foul-smelling resin, trapping you in the [src]!",\ + "You hear squelching...") + M.buckled = src + M.loc = src.loc + M.dir = src.dir + M.update_canmove() + src.buckled_mob = M + src.add_fingerprint(user) + return + +/obj/structure/stool/blob_act() + del(src) + +/obj/structure/stool/bed/nest/attackby(obj/item/weapon/W as obj, mob/user as mob) + var/aforce = W.force + health = max(0, health - aforce) + playsound(loc, 'attackblob.ogg', 100, 1) + for(var/mob/M in viewers(src, 7)) + M.show_message("[user] hits [src] with [W]!", 1) + healthcheck() + +/obj/structure/stool/bed/nest/proc/healthcheck() + if(health <=0) + density = 0 + del(src) + return diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 6fc34c1c87..17156558c5 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -19,4 +19,13 @@ client.images += activeIndicator /mob/living/carbon/alien/IsAdvancedToolUser() - return has_fine_manipulation \ No newline at end of file + return has_fine_manipulation + + +/mob/living/carbon/alien/Stun(amount) + if(status_flags & CANSTUN) + stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun + else + // add some movement delay + move_delay_add = min(move_delay_add + round(amount / 2), 10) // a maximum delay of 10 + return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 5b9c7ab803..479e7c1215 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -82,43 +82,23 @@ I kind of like the right click only--the window version can get a little confusi var/obj/effect/alien/acid/A = new(src.loc) A.target = src for(var/mob/M in viewers(src, null)) - M.show_message(text("\green [user] vomits globs of vile stuff all over [src]!"), 1) + M.show_message(text("\green [user] vomits globs of vile stuff all over [src]. It begins to sizzle and melt under the bubbling mess of acid!"), 1) A.tick() -/mob/living/carbon/alien/humanoid/proc/corrode_target() //Aliens only see items on the list of objects that they can actually spit on./N - set name = "Spit Corrosive Acid (200)" +/mob/living/carbon/alien/humanoid/proc/corrosive_acid(obj/O as obj in oview(1)) //If they right click to corrode, an error will flash if its an invalid target./N + set name = "Corrossive Acid (200)" set desc = "Drench an object in acid, destroying it over time." set category = "Alien" - if(powerc(200))//Check 1. - var/list/xeno_target - xeno_target = list("Abort Command") - for(var/obj/O in view(1)) - if(!O.unacidable) - xeno_target.Add(O) - var/obj/A - A = input("Corrode which target?", "Targets", A) in xeno_target - if(!A == "Abort Command") - if(powerc(200))//Check 2. - if(A in view(1))//Check 3. - adjustToxLoss(-200) - A.acid(src) - else - src << "\green Target is too far away." - return - -/mob/living/carbon/alien/humanoid/verb/corrode(obj/O as anything in oview(1)) //If they right click to corrode, an error will flash if its an invalid target./N - set name = "Corrode with Acid (200)" - set desc = "Drench an object in acid, destroying it over time." - set category = "Alien" - - if(istype(O, /obj)) - if(powerc(200)) - if(!O.unacidable) + if(powerc(200)) + if(O in oview(1)) + if(O.unacidable) //So the aliens don't destroy energy fields/singularies/other aliens/etc with their acid. + src << "\green You cannot dissolve this object." + else adjustToxLoss(-200) - O.acid() - else//So the aliens don't destroy energy fields/singularies/other aliens/etc with their acid. - src << "\green You cannot destroy this object." + O.acid(src) + else + src << "\green Target is too far away." return /mob/living/carbon/alien/humanoid/verb/ventcrawl() // -- TLE @@ -194,4 +174,63 @@ I kind of like the right click only--the window version can get a little confusi src << "\green This vent is not connected to anything." else src << "\green You must be standing on or beside an open air vent to enter it." - return \ No newline at end of file + return + +/mob/living/carbon/alien/humanoid/proc/neurotoxin(mob/target as mob in oview()) + set name = "Spit Neurotoxin (50)" + set desc = "Spits neurotoxin at someone, paralyzing them for a short time." + set category = "Alien" + + if(powerc(50)) + if(isalien(target)) + src << "\green Your allies are not a valid target." + return + adjustToxLoss(-50) + src << "\green You spit neurotoxin at [target]." + for(var/mob/O in oviewers()) + if ((O.client && !( O.blinded ))) + O << "\red [src] spits neurotoxin at [target]!" + //I'm not motivated enough to revise this. Prjectile code in general needs update. + var/turf/T = loc + var/turf/U = (istype(target, /atom/movable) ? target.loc : target) + + if(!U || !T) + return + while(U && !istype(U,/turf)) + U = U.loc + if(!istype(T, /turf)) + return + if (U == T) + usr.bullet_act(src, get_organ_target()) + return + if(!istype(U, /turf)) + return + + var/obj/item/projectile/energy/dart/A = new /obj/item/projectile/energy/dart(usr.loc) + + A.current = U + A.yo = U.y - T.y + A.xo = U.x - T.x + A.process() + return + +/mob/living/carbon/alien/humanoid/proc/resin() // -- TLE + set name = "Secrete Resin (100)" + set desc = "Secrete tough malleable resin." + set category = "Alien" + + if(powerc(100)) + var/choice = input("Choose what you wish to shape.","Resin building") as null|anything in list("resin wall","resin membrane","resin nest") //would do it through typesof but then the player choice would have the type path and we don't want the internal workings to be exposed ICly - Urist + if(!choice || !powerc(100)) return + adjustToxLoss(-100) + src << "\green You shape a [choice]." + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [src] vomits up a thick purple substance and begins to shape it!"), 1) + switch(choice) + if("resin wall") + new /obj/effect/alien/resin/wall(loc) + if("resin membrane") + new /obj/effect/alien/resin/membrane(loc) + if("resin nest") + new /obj/structure/stool/bed/nest(loc) + return diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm index 8311617de7..966bc68815 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm @@ -5,8 +5,8 @@ if(src.name == "alien drone") src.name = text("alien drone ([rand(1, 1000)])") src.real_name = src.name - src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target - src.verbs -= /mob/living/carbon/alien/humanoid/verb/ActivateHuggers + verbs.Add(/mob/living/carbon/alien/humanoid/proc/resin,/mob/living/carbon/alien/humanoid/proc/corrosive_acid) + verbs -= /mob/living/carbon/alien/humanoid/verb/ActivateHuggers //<-- pointless //Drones use the same base as generic humanoids. //Drone verbs @@ -25,22 +25,4 @@ new_xeno.mind_initialize(src, "Queen") new_xeno.key = key del(src) - return - -/mob/living/carbon/alien/humanoid/drone/verb/resinwall() // -- TLE - set name = "Shape Resin (100)" - set desc = "Produce a wall of resin that blocks entry and line of sight" - set category = "Alien" - - if(powerc(100)) - adjustToxLoss(-100) - var/choice = input("Choose what you wish to shape.","Resin building") as anything in list("resin wall","resin membrane") //would do it through typesof but then the player choice would have the type path and we don't want the internal workings to be exposed ICly - Urist - src << "\green You shape a [choice]." - for(var/mob/O in viewers(src, null)) - O.show_message(text("\red [src] vomits up a thick purple substance and begins to shape it!"), 1) - switch(choice) - if("resin wall") - new /obj/effect/alien/resin/wall(loc) - if("resin membrane") - new /obj/effect/alien/resin/membrane(loc) return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index 810d4279c9..5274f5c580 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -5,7 +5,6 @@ if(name == "alien hunter") name = text("alien hunter ([rand(1, 1000)])") real_name = name - verbs -= /mob/living/carbon/alien/humanoid/verb/corrode /mob/living/carbon/alien/humanoid/hunter diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index 72bad8ad24..cc7e270e3a 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -5,7 +5,7 @@ if(name == "alien sentinel") name = text("alien sentinel ([rand(1, 1000)])") real_name = name - verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target + verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/neurotoxin) /mob/living/carbon/alien/humanoid/sentinel @@ -50,43 +50,3 @@ else adjustBruteLoss(-10) adjustFireLoss(-10) - -//Sentinel verbs - -/mob/living/carbon/alien/humanoid/sentinel/verb/spit(mob/target as mob in oview()) - set name = "Spit Neurotoxin (50)" - set desc = "Spits neurotoxin at someone, paralyzing them for a short time." - set category = "Alien" - - if(powerc(50)) - if(isalien(target)) - src << "\green Your allies are not a valid target." - return - adjustToxLoss(-50) - src << "\green You spit neurotoxin at [target]." - for(var/mob/O in oviewers()) - if ((O.client && !( O.blinded ))) - O << "\red [src] spits neurotoxin at [target]!" - //I'm not motivated enough to revise this. Prjectile code in general needs update. - var/turf/T = loc - var/turf/U = (istype(target, /atom/movable) ? target.loc : target) - - if(!U || !T) - return - while(U && !istype(U,/turf)) - U = U.loc - if(!istype(T, /turf)) - return - if (U == T) - usr.bullet_act(src, get_organ_target()) - return - if(!istype(U, /turf)) - return - - var/obj/item/projectile/energy/dart/A = new /obj/item/projectile/energy/dart(usr.loc) - - A.current = U - A.yo = U.y - T.y - A.xo = U.x - T.x - A.process() - return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm index 0c5b6fc258..ece60729bf 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/emote.dm @@ -33,6 +33,10 @@ if (!muzzled) message = "The [src.name] roars." m_type = 2 + if("hiss") + if(!muzzled) + message = "The [src.name] hisses." + m_type = 2 if("tail") message = "The [src.name] waves its tail." m_type = 1 diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index a38e75d47e..d633ddeefe 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -2,13 +2,16 @@ var/datum/reagents/R = new/datum/reagents(100) reagents = R R.my_atom = src -//there should only be one queen -// if(src.name == "alien") -// src.name = text("alien ([rand(1, 1000)])") - src.real_name = src.name - src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target - src.verbs += /mob/living/carbon/alien/humanoid/sentinel/verb/spit - src.verbs -= /mob/living/carbon/alien/humanoid/verb/ventcrawl + + //there should only be one queen + for(var/mob/living/carbon/alien/humanoid/queen/Q in world) + if(Q.stat != DEAD) + name = "alien princess ([rand(1, 1000)])" //if this is too cutesy feel free to change it/remove it. + break + + real_name = src.name + verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/neurotoxin,/mob/living/carbon/alien/humanoid/proc/resin) + verbs -= /mob/living/carbon/alien/humanoid/verb/ventcrawl /mob/living/carbon/alien/humanoid/queen @@ -59,7 +62,7 @@ /mob/living/carbon/alien/humanoid/queen/verb/lay_egg() set name = "Lay Egg (200)" - set desc = "Plants an egg" + set desc = "Lay an egg to produce huggers to impregnate prey with." set category = "Alien" if(locate(/obj/effect/alien/egg) in get_turf(src)) diff --git a/code/modules/mob/living/carbon/alien/larva/death.dm b/code/modules/mob/living/carbon/alien/larva/death.dm index 0242119ef5..86d3261780 100644 --- a/code/modules/mob/living/carbon/alien/larva/death.dm +++ b/code/modules/mob/living/carbon/alien/larva/death.dm @@ -4,12 +4,7 @@ if(src.healths) src.healths.icon_state = "health6" - /* - if(istype(src,/mob/living/carbon/alien/larva/metroid)) - src.icon_state = "metroid_dead" - */ - else - src.icon_state = "larva_l" + src.icon_state = "larva_l" src.stat = 2 if (!gibbed) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 7a9362be21..e0d05b12ef 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -53,7 +53,7 @@ if(IRRADIATE) radiation += max((((effect - (effect*(getarmor(null, "rad")/100))))/(blocked+1)),0)//Rads auto check armor if(STUTTER) - if(canstun) // stun is usually associated with stutter + if(status_flags & CANSTUN) // stun is usually associated with stutter stuttering = max(stuttering,(effect/(blocked+1))) if(EYE_BLUR) eye_blurry = max(eye_blurry,(effect/(blocked+1))) diff --git a/code/modules/mob/living/simple_animal/behemoth.dm b/code/modules/mob/living/simple_animal/behemoth.dm index 5d3c6fcd9b..be5a4c6b77 100644 --- a/code/modules/mob/living/simple_animal/behemoth.dm +++ b/code/modules/mob/living/simple_animal/behemoth.dm @@ -28,8 +28,7 @@ nopush = 1 a_intent = "harm" stop_automated_movement = 1 - canstun = 0 - canweaken = 0 + status_flags = CANPARALYSE var/energy = 0 var/max_energy = 1000 diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index 9a67ce88f2..f79847f464 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -31,8 +31,7 @@ nopush = 1 a_intent = "harm" stop_automated_movement = 1 - canstun = 0 - canweaken = 0 + status_flags = CANPARALYSE Life() @@ -168,8 +167,7 @@ speed = -1 a_intent = "harm" stop_automated_movement = 1 - canstun = 0 - canweaken = 0 + status_flags = CANPARALYSE see_in_dark = 7 Life() @@ -301,8 +299,7 @@ nopush = 1 a_intent = "harm" stop_automated_movement = 1 - canstun = 0 - canweaken = 0 + status_flags = CANPARALYSE Life() ..() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 07733b109b..294e2519f4 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -737,52 +737,51 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/Stun(amount) - if(canstun) + if(status_flags & CANSTUN) stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun - else - if(istype(src, /mob/living/carbon/alien)) // add some movement delay - var/mob/living/carbon/alien/Alien = src - Alien.move_delay_add = min(Alien.move_delay_add + round(amount / 2), 10) // a maximum delay of 10 return /mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned" - if(canstun) + if(status_flags & CANSTUN) stunned = max(amount,0) return /mob/proc/AdjustStunned(amount) - if(canstun) + if(status_flags & CANSTUN) stunned = max(stunned + amount,0) return /mob/proc/Weaken(amount) - if(canweaken) + if(status_flags & CANWEAKEN) weakened = max(max(weakened,amount),0) update_canmove() //updates lying, canmove and icons return /mob/proc/SetWeakened(amount) - if(canweaken) + if(status_flags & CANWEAKEN) weakened = max(amount,0) update_canmove() //updates lying, canmove and icons return /mob/proc/AdjustWeakened(amount) - if(canweaken) + if(status_flags & CANWEAKEN) weakened = max(weakened + amount,0) update_canmove() //updates lying, canmove and icons return /mob/proc/Paralyse(amount) - paralysis = max(max(paralysis,amount),0) + if(status_flags & CANPARALYSE) + paralysis = max(max(paralysis,amount),0) return /mob/proc/SetParalysis(amount) - paralysis = max(amount,0) + if(status_flags & CANPARALYSE) + paralysis = max(amount,0) return /mob/proc/AdjustParalysis(amount) - paralysis = max(paralysis + amount,0) + if(status_flags & CANPARALYSE) + paralysis = max(paralysis + amount,0) return /mob/proc/Sleeping(amount) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 757d1e8b51..6186a6c949 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -198,8 +198,7 @@ var/UI = 'screen1_Midnight.dmi' // For changing the UI from preferences - var/canstun = 1 // determines if this mob can be stunned by things - var/canweaken = 1 // determines if this mob can be weakened/knocked down by things + var/status_flags = 255 //bitflags defining which status effects can be inflicted (replaces canweaken, canstun, etc) var/nopush = 0 //Can they be shoved? var/area/lastarea = null diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index 3ad87a1dc7..884baca206 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -445,7 +445,7 @@ datum/preferences switch(link_tags["real_name"]) if("input") - new_name = reject_bad_name( input(user, "Please select a name:", "Character Generation") as text|null, 2 ) + new_name = reject_bad_name( input(user, "Please select a name:", "Character Generation") as text|null ) if("random") randomize_name() @@ -453,7 +453,7 @@ datum/preferences if(new_name) real_name = new_name else - user << "Invalid name. Your name should be at least 4 letters and two words but it should be under [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and ." + user << "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and ." if(link_tags["age"]) switch(link_tags["age"]) @@ -707,6 +707,15 @@ datum/preferences proc/copy_to(mob/living/carbon/human/character, safety = 0) if(be_random_name) randomize_name() + + if(config.humans_need_surnames) + var/firstspace = findtext(real_name, " ") + var/name_length = length(real_name) + if(!firstspace) //we need a surname + real_name += " [pick(last_names)]" + else if(firstspace == name_length) + real_name += "[pick(last_names)]" + character.real_name = real_name character.original_name = real_name //Original name is only used in ghost chat! It is not to be edited by anything! diff --git a/code/modules/mob/new_player/savefile.dm b/code/modules/mob/new_player/savefile.dm index 3a7a1ecb9d..e447928818 100644 --- a/code/modules/mob/new_player/savefile.dm +++ b/code/modules/mob/new_player/savefile.dm @@ -1,5 +1,5 @@ -#define SAVEFILE_VERSION_MIN 5 -#define SAVEFILE_VERSION_MAX 6 +#define SAVEFILE_VERSION_MIN 7 +#define SAVEFILE_VERSION_MAX 7 datum/preferences/proc/savefile_path(mob/user) return "data/player_saves/[copytext(user.ckey, 1, 2)]/[user.ckey]/preferences.sav" diff --git a/code/setup.dm b/code/setup.dm index 716b453c1b..a3428598ea 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -314,7 +314,7 @@ var/list/global_mutations = list() // list of hidden mutation things //Bluh shields -//Damage things +//Damage things //TODO: merge these down to reduce on defines >_> #define BRUTE "brute" #define BURN "fire" #define TOX "tox" @@ -330,6 +330,11 @@ var/list/global_mutations = list() // list of hidden mutation things #define EYE_BLUR "eye_blur" #define DROWSY "drowsy" +//Bitflags defining which status effects can be inflicted on a mob +#define CANSTUN 1 +#define CANWEAKEN 2 +#define CANPARALYSE 4 + var/static/list/scarySounds = list('thudswoosh.ogg','Taser.ogg','armbomb.ogg','hiss1.ogg','hiss2.ogg','hiss3.ogg','hiss4.ogg','hiss5.ogg','hiss6.ogg','Glassbr1.ogg','Glassbr2.ogg','Glassbr3.ogg','Welder.ogg','Welder2.ogg','airlock.ogg','clownstep1.ogg','clownstep2.ogg') //Security levels diff --git a/config/config.txt b/config/config.txt index 1e8484e0ad..eab32a5494 100644 --- a/config/config.txt +++ b/config/config.txt @@ -160,4 +160,5 @@ TICKLAG 0.9 ## Defines if Tick Compensation is used. It results in a minor slowdown of movement of all mobs, but attempts to result in a level movement speed across all ticks. Recommended if tickrate is lowered. TICKCOMP 0 - +## if uncommented this adds a random surname to a player's name if they only specify one name +HUMANS_NEED_SURNAMES diff --git a/html/changelog.html b/html/changelog.html index 08743d134a..1995074a4b 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -46,6 +46,17 @@ 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. --> +