From 464d702d4bc4d3aaaf79d3ce3f8aea5e5881c0a9 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sat, 28 Mar 2015 16:17:58 +0100 Subject: [PATCH] Mob refactoring. Updates Bump() code. Intents now use constants. Simple animals can now use languages without overriding say(). There is now a difference between being able to smash normal and reinforced walls. Reworks simple_animal/attackby so that constructs don't need to override it simply to add damage resistance. --- code/_onclick/click.dm | 2 +- code/_onclick/hud/human.dm | 8 +- code/_onclick/hud/monkey.dm | 2 +- code/_onclick/hud/other_mobs.dm | 4 +- code/_onclick/hud/robot.dm | 2 +- code/_onclick/hud/screen_objects.dm | 16 +- code/_onclick/oldcode.dm | 2 +- code/_onclick/other_mobs.dm | 14 +- code/game/atoms_movable.dm | 5 +- code/game/dna/dna_misc.dm | 1116 ++++++++--------- code/game/dna/genes/monkey.dm | 350 +++--- code/game/machinery/doors/door.dm | 2 +- code/game/machinery/portable_turret.dm | 2 +- code/game/machinery/rechargestation.dm | 40 +- code/game/mecha/combat/combat.dm | 2 +- code/game/mecha/equipment/tools/tools.dm | 6 +- code/game/mecha/mecha.dm | 2 +- code/game/objects/items/toys.dm | 12 +- code/game/objects/items/weapons/handcuffs.dm | 2 +- code/game/objects/items/weapons/kitchen.dm | 2 +- code/game/objects/items/weapons/policetape.dm | 4 +- code/game/objects/items/weapons/stunbaton.dm | 2 +- .../objects/items/weapons/swords_axes_etc.dm | 2 +- code/game/objects/items/weapons/tools.dm | 2 +- .../stool_bed_chair_nest/wheelchair.dm | 4 +- code/game/objects/structures/tables_racks.dm | 2 +- code/game/objects/structures/window.dm | 2 +- code/game/turfs/simulated/walls.dm | 4 - code/game/turfs/simulated/walls_reinforced.dm | 7 + code/modules/client/preferences_toggles.dm | 2 +- .../clothing/under/accessories/accessory.dm | 2 +- .../clothing/under/accessories/holster.dm | 2 +- code/modules/holodeck/HolodeckObjects.dm | 4 +- code/modules/hydroponics/grown.dm | 4 +- code/modules/mob/language/outsider.dm | 27 + .../mob/living/carbon/alien/alien_attacks.dm | 4 +- .../carbon/alien/diona/diona_attacks.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 100 +- code/modules/mob/living/carbon/human/human.dm | 4 + .../living/carbon/human/human_attackhand.dm | 12 +- .../mob/living/carbon/human/human_defines.dm | 4 + .../living/carbon/human/species/species.dm | 7 +- .../carbon/human/species/station/monkey.dm | 5 + .../carbon/human/species/station/slime.dm | 6 +- .../human/species/xenomorphs/alien_species.dm | 4 + .../modules/mob/living/carbon/metroid/life.dm | 14 +- .../mob/living/carbon/metroid/metroid.dm | 4 +- code/modules/mob/living/living.dm | 116 ++ code/modules/mob/living/living_defines.dm | 5 +- code/modules/mob/living/say.dm | 5 + .../mob/living/silicon/robot/drone/drone.dm | 19 +- .../silicon/robot/drone/drone_abilities.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 41 +- .../mob/living/simple_animal/borer/borer.dm | 2 +- .../simple_animal/constructs/constructs.dm | 173 +-- .../mob/living/simple_animal/friendly/cat.dm | 2 +- .../living/simple_animal/friendly/corgi.dm | 273 ---- .../simple_animal/friendly/farm_animals.dm | 2 +- .../living/simple_animal/friendly/slime.dm | 37 - .../mob/living/simple_animal/hostile/alien.dm | 4 +- .../simple_animal/hostile/retaliate/clown.dm | 2 +- .../simple_animal/hostile/retaliate/drone.dm | 2 +- .../living/simple_animal/hostile/russian.dm | 2 +- .../living/simple_animal/hostile/syndicate.dm | 6 +- .../mob/living/simple_animal/parrot.dm | 2 +- .../modules/mob/living/simple_animal/shade.dm | 46 +- .../mob/living/simple_animal/simple_animal.dm | 150 ++- code/modules/mob/living/simple_animal/worm.dm | 4 +- code/modules/mob/mob_defines.dm | 3 +- code/modules/mob/mob_helpers.dm | 32 +- code/modules/mob/transform_procs.dm | 8 +- code/modules/organs/organ_objects.dm | 2 +- code/modules/power/apc.dm | 2 +- code/modules/power/cable.dm | 2 +- code/modules/power/lighting.dm | 2 +- code/modules/projectiles/gun.dm | 6 +- code/modules/projectiles/projectile/change.dm | 2 +- code/modules/projectiles/targeting.dm | 2 +- code/modules/reagents/Chemistry-Reagents.dm | 2 +- .../reagent_containers/food/drinks/bottle.dm | 2 +- .../reagents/reagent_containers/syringes.dm | 2 +- .../artifact/effects/unknown_effect_hurt.dm | 98 +- code/modules/surgery/surgery.dm | 4 +- code/setup.dm | 30 +- 84 files changed, 1314 insertions(+), 1607 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index abd7542d6c8..b8caa45399d 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -195,7 +195,7 @@ */ /mob/proc/RangedAttack(var/atom/A, var/params) if(!mutations.len) return - if((LASER in mutations) && a_intent == "harm") + if((LASER in mutations) && a_intent == I_HURT) LaserEyes(A) // moved into a proc below else if(TK in mutations) switch(get_dist(src,A)) diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 9f3991bbc2f..92fe661d002 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -77,7 +77,7 @@ ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height()) using = new /obj/screen( src ) - using.name = "help" + using.name = I_HELP using.icon = ico using.screen_loc = ui_acti using.alpha = ui_alpha @@ -89,7 +89,7 @@ ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height()) using = new /obj/screen( src ) - using.name = "disarm" + using.name = I_DISARM using.icon = ico using.screen_loc = ui_acti using.alpha = ui_alpha @@ -101,7 +101,7 @@ ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2) using = new /obj/screen( src ) - using.name = "grab" + using.name = I_GRAB using.icon = ico using.screen_loc = ui_acti using.alpha = ui_alpha @@ -113,7 +113,7 @@ ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2) using = new /obj/screen( src ) - using.name = "harm" + using.name = I_HURT using.icon = ico using.screen_loc = ui_acti using.alpha = ui_alpha diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index 0081fbe6b52..76adf0414c3 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -10,7 +10,7 @@ using.name = "act_intent" using.set_dir(SOUTHWEST) using.icon = ui_style - using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent) + using.icon_state = (mymob.a_intent == I_HURT ? I_HURT : mymob.a_intent) using.screen_loc = ui_acti using.layer = 20 src.adding += using diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm index cd5a859715a..3f785d8a83b 100644 --- a/code/_onclick/hud/other_mobs.dm +++ b/code/_onclick/hud/other_mobs.dm @@ -90,7 +90,7 @@ ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2) using = new /obj/screen( src ) - using.name = "harm" + using.name = I_HURT using.icon = ico using.screen_loc = ui_zonesel using.layer = 21 @@ -100,4 +100,4 @@ mymob.client.screen = null mymob.client.screen += src.adding - return \ No newline at end of file + return diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 2738cf3a7d6..48378fce7f4 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -57,7 +57,7 @@ var/obj/screen/robot_inventory using.name = "act_intent" using.set_dir(SOUTHWEST) using.icon = 'icons/mob/screen1_robot.dmi' - using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent) + using.icon_state = (mymob.a_intent == I_HURT ? I_HURT : mymob.a_intent) using.screen_loc = ui_acti using.layer = 20 src.adding += using diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 400bf051ad3..7e6e072ead4 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -360,17 +360,17 @@ C << "You don't have a[breathes=="oxygen" ? "n oxygen" : addtext(" ",breathes)] tank." if("act_intent") usr.a_intent_change("right") - if("help") - usr.a_intent = "help" + if(I_HELP) + usr.a_intent = I_HELP usr.hud_used.action_intent.icon_state = "intent_help" - if("harm") - usr.a_intent = "hurt" + if(I_HURT) + usr.a_intent = I_HURT usr.hud_used.action_intent.icon_state = "intent_hurt" - if("grab") - usr.a_intent = "grab" + if(I_GRAB) + usr.a_intent = I_GRAB usr.hud_used.action_intent.icon_state = "intent_grab" - if("disarm") - usr.a_intent = "disarm" + if(I_DISARM) + usr.a_intent = I_DISARM usr.hud_used.action_intent.icon_state = "intent_disarm" if("pull") diff --git a/code/_onclick/oldcode.dm b/code/_onclick/oldcode.dm index 8585eb8e5fc..ce6a238329d 100644 --- a/code/_onclick/oldcode.dm +++ b/code/_onclick/oldcode.dm @@ -347,7 +347,7 @@ src.hand_al(usr, usr.hand) else // ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD ------- - if((LASER in usr:mutations) && usr:a_intent == "harm" && world.time >= usr.next_move) + if((LASER in usr:mutations) && usr:a_intent == I_HURT && world.time >= usr.next_move) // ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED ------- var/turf/T = get_turf(usr) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index e8c868bb729..477fb04b7ad 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -31,7 +31,7 @@ /mob/living/carbon/human/RangedAttack(var/atom/A) if(!gloves && !mutations.len) return var/obj/item/clothing/gloves/G = gloves - if((LASER in mutations) && a_intent == "hurt") + if((LASER in mutations) && a_intent == I_HURT) LaserEyes(A) // moved into a proc below else if(istype(G) && G.Touch(A,0)) // for magic gloves @@ -89,9 +89,9 @@ if (istype(M)) switch(src.a_intent) - if ("help") // We just poke the other + if (I_HELP) // We just poke the other M.visible_message("[src] gently pokes [M]!", "[src] gently pokes you!") - if ("disarm") // We stun the target, with the intention to feed + if (I_DISARM) // We stun the target, with the intention to feed var/stunprob = 1 var/power = max(0, min(10, (powerlevel + rand(0, 3)))) if (powerlevel > 0 && !istype(A, /mob/living/carbon/slime)) @@ -130,9 +130,9 @@ else M.visible_message("[src] has tried to pounce at [M]!", "[src] has tried to pounce at you!") M.updatehealth() - if ("grab") // We feed + if (I_GRAB) // We feed Wrap(M) - if ("hurt") // Attacking + if (I_HURT) // Attacking A.attack_generic(src, (is_adult ? rand(20,40) : rand(5,25)), "glomped") else A.attack_generic(src, (is_adult ? rand(20,40) : rand(5,25)), "glomped") // Basic attack. @@ -156,5 +156,5 @@ return var/damage = rand(melee_damage_lower, melee_damage_upper) - if(A.attack_generic(src,damage,attacktext,wall_smash) && loc && attack_sound) - playsound(loc, attack_sound, 50, 1, 1) \ No newline at end of file + if(A.attack_generic(src,damage,attacktext,environment_smash) && loc && attack_sound) + playsound(loc, attack_sound, 50, 1, 1) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 21e8b5d9a9f..79d6e8fd08d 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -14,11 +14,12 @@ var/moved_recently = 0 var/mob/pulledby = null -/atom/movable/Bump(var/atom/A as mob|obj|turf|area, yes) +/atom/movable/Bump(var/atom/A, yes) if(src.throwing) src.throw_impact(A) + src.throwing = 0 - spawn( 0 ) + spawn(0) if ((A && yes)) A.last_bumped = world.time A.Bumped(src) diff --git a/code/game/dna/dna_misc.dm b/code/game/dna/dna_misc.dm index fd5d0f59a1e..08a479963b1 100644 --- a/code/game/dna/dna_misc.dm +++ b/code/game/dna/dna_misc.dm @@ -1,559 +1,559 @@ -/////////////////////////// DNA HELPER-PROCS -/proc/getleftblocks(input,blocknumber,blocksize) - var/string - - if (blocknumber > 1) - string = copytext(input,1,((blocksize*blocknumber)-(blocksize-1))) - return string - else - return null - -/proc/getrightblocks(input,blocknumber,blocksize) - var/string - if (blocknumber < (length(input)/blocksize)) - string = copytext(input,blocksize*blocknumber+1,length(input)+1) - return string - else - return null - -/proc/getblockstring(input,block,subblock,blocksize,src,ui) // src is probably used here just for urls; ui is 1 when requesting for the unique identifier screen, 0 for structural enzymes screen - var/string - var/subpos = 1 // keeps track of the current sub block - var/blockpos = 1 // keeps track of the current block - - - for(var/i = 1, i <= length(input), i++) // loop through each letter - - var/pushstring - - if(subpos == subblock && blockpos == block) // if the current block/subblock is selected, mark it - pushstring = "[copytext(input, i, i+1)]" - else - if(ui) //This is for allowing block clicks to be differentiated - pushstring = "[copytext(input, i, i+1)]" - else - pushstring = "[copytext(input, i, i+1)]" - - string += pushstring // push the string to the return string - - if(subpos >= blocksize) // add a line break for every block - string += " | " - subpos = 0 - blockpos++ - - subpos++ - - return string - - -/proc/getblock(input,blocknumber,blocksize) - var/result - result = copytext(input ,(blocksize*blocknumber)-(blocksize-1),(blocksize*blocknumber)+1) - return result - -/proc/getblockbuffer(input,blocknumber,blocksize) - var/result[3] - var/block = copytext(input ,(blocksize*blocknumber)-(blocksize-1),(blocksize*blocknumber)+1) - for(var/i = 1, i <= 3, i++) - result[i] = copytext(block, i, i+1) - return result - -/proc/setblock(istring, blocknumber, replacement, blocksize) - if(!blocknumber) - return istring - if(!istring || !replacement || !blocksize) return 0 - var/result = getleftblocks(istring, blocknumber, blocksize) + replacement + getrightblocks(istring, blocknumber, blocksize) - return result - -/proc/add_zero2(t, u) - var/temp1 - while (length(t) < u) - t = "0[t]" - temp1 = t - if (length(t) > u) - temp1 = copytext(t,2,u+1) - return temp1 - -/proc/miniscramble(input,rs,rd) - var/output - output = null - if (input == "C" || input == "D" || input == "E" || input == "F") - output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"6",prob((rs*10));"7",prob((rs*5)+(rd));"0",prob((rs*5)+(rd));"1",prob((rs*10)-(rd));"2",prob((rs*10)-(rd));"3") - if (input == "8" || input == "9" || input == "A" || input == "B") - output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3") - if (input == "4" || input == "5" || input == "6" || input == "7") - output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3") - if (input == "0" || input == "1" || input == "2" || input == "3") - output = pick(prob((rs*10));"8",prob((rs*10));"9",prob((rs*10));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C",prob((rs*10)-(rd));"D",prob((rs*5)+(rd));"E",prob((rs*5)+(rd));"F") - if (!output) output = "5" - return output - -//Instead of picking a value far from the input, this will pick values closer to it. -//Sorry for the block of code, but it's more efficient then calling text2hex -> loop -> hex2text -/proc/miniscrambletarget(input,rs,rd) - var/output = null - switch(input) - if("0") - output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10));"2",prob((rs*10)-(rd));"3") - if("1") - output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10));"3",prob((rs*10)-(rd));"4") - if("2") - output = pick(prob((rs*10));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10));"4",prob((rs*10)-(rd));"5") - if("3") - output = pick(prob((rs*10)-(rd));"0",prob((rs*10));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10));"5",prob((rs*10)-(rd));"6") - if("4") - output = pick(prob((rs*10)-(rd));"1",prob((rs*10));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10));"6",prob((rs*10)-(rd));"7") - if("5") - output = pick(prob((rs*10)-(rd));"2",prob((rs*10));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10));"7",prob((rs*10)-(rd));"8") - if("6") - output = pick(prob((rs*10)-(rd));"3",prob((rs*10));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10));"8",prob((rs*10)-(rd));"9") - if("7") - output = pick(prob((rs*10)-(rd));"4",prob((rs*10));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10));"9",prob((rs*10)-(rd));"A") - if("8") - output = pick(prob((rs*10)-(rd));"5",prob((rs*10));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10));"A",prob((rs*10)-(rd));"B") - if("9") - output = pick(prob((rs*10)-(rd));"6",prob((rs*10));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C") - if("10")//A - output = pick(prob((rs*10)-(rd));"7",prob((rs*10));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10));"C",prob((rs*10)-(rd));"D") - if("11")//B - output = pick(prob((rs*10)-(rd));"8",prob((rs*10));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10));"D",prob((rs*10)-(rd));"E") - if("12")//C - output = pick(prob((rs*10)-(rd));"9",prob((rs*10));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10));"E",prob((rs*10)-(rd));"F") - if("13")//D - output = pick(prob((rs*10)-(rd));"A",prob((rs*10));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10));"F") - if("14")//E - output = pick(prob((rs*10)-(rd));"B",prob((rs*10));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F") - if("15")//F - output = pick(prob((rs*10)-(rd));"C",prob((rs*10));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F") - - if(!input || !output) //How did this happen? - output = "8" - - return output - -/proc/isblockon(hnumber, bnumber , var/UI = 0) - - var/temp2 - temp2 = hex2num(hnumber) - - if(UI) - if(temp2 >= 2050) - return 1 - else - return 0 - - if (bnumber == HULKBLOCK || bnumber == TELEBLOCK || bnumber == NOBREATHBLOCK || bnumber == NOPRINTSBLOCK || bnumber == SMALLSIZEBLOCK || bnumber == SHOCKIMMUNITYBLOCK) - if (temp2 >= 3500 + BLOCKADD) - return 1 - else - return 0 - if (bnumber == XRAYBLOCK || bnumber == FIREBLOCK || bnumber == REMOTEVIEWBLOCK || bnumber == REGENERATEBLOCK || bnumber == INCREASERUNBLOCK || bnumber == REMOTETALKBLOCK || bnumber == MORPHBLOCK) - if (temp2 >= 3050 + BLOCKADD) - return 1 - else - return 0 - - - if (temp2 >= 2050 + BLOCKADD) - return 1 - else - return 0 - -/proc/ismuton(var/block,var/mob/M) - return isblockon(getblock(M.dna.struc_enzymes, block,3),block) - -/proc/randmutb(mob/M as mob) - if(!M) return - var/num - var/newdna - num = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK,HALLUCINATIONBLOCK) - M.dna.check_integrity() - newdna = setblock(M.dna.struc_enzymes,num,toggledblock(getblock(M.dna.struc_enzymes,num,3)),3) - M.dna.struc_enzymes = newdna - return - -/proc/randmutg(mob/M as mob) - if(!M) return - var/num - var/newdna - num = pick(HULKBLOCK,XRAYBLOCK,FIREBLOCK,TELEBLOCK,NOBREATHBLOCK,REMOTEVIEWBLOCK,REGENERATEBLOCK,INCREASERUNBLOCK,REMOTETALKBLOCK,MORPHBLOCK,BLENDBLOCK,NOPRINTSBLOCK,SHOCKIMMUNITYBLOCK,SMALLSIZEBLOCK) - M.dna.check_integrity() - newdna = setblock(M.dna.struc_enzymes,num,toggledblock(getblock(M.dna.struc_enzymes,num,3)),3) - M.dna.struc_enzymes = newdna - return - -/proc/scramble(var/type, mob/M as mob, var/p) - if(!M) return - M.dna.check_integrity() - if(type) - for(var/i = 1, i <= STRUCDNASIZE-1, i++) - if(prob(p)) - M.dna.uni_identity = setblock(M.dna.uni_identity, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3) - updateappearance(M, M.dna.uni_identity) - - else - for(var/i = 1, i <= STRUCDNASIZE-1, i++) - if(prob(p)) - M.dna.struc_enzymes = setblock(M.dna.struc_enzymes, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3) - domutcheck(M, null) - return - -/proc/randmuti(mob/M as mob) - if(!M) return - var/num - var/newdna - num = rand(1,UNIDNASIZE) - M.dna.check_integrity() - newdna = setblock(M.dna.uni_identity,num,add_zero2(num2hex(rand(1,4095),1),3),3) - M.dna.uni_identity = newdna - return - -/proc/toggledblock(hnumber) //unused - var/temp3 - var/chtemp - temp3 = hex2num(hnumber) - if (temp3 < 2050) - chtemp = rand(2050,4095) - return add_zero2(num2hex(chtemp,1),3) - else - chtemp = rand(1,2049) - return add_zero2(num2hex(chtemp,1),3) -/////////////////////////// DNA HELPER-PROCS - -/////////////////////////// DNA MISC-PROCS -/proc/updateappearance(mob/M as mob , structure) - if(istype(M, /mob/living/carbon/human)) - M.dna.check_integrity() - var/mob/living/carbon/human/H = M - H.r_hair = hex2num(getblock(structure,1,3)) - H.b_hair = hex2num(getblock(structure,2,3)) - H.g_hair = hex2num(getblock(structure,3,3)) - H.r_facial = hex2num(getblock(structure,4,3)) - H.b_facial = hex2num(getblock(structure,5,3)) - H.g_facial = hex2num(getblock(structure,6,3)) - H.s_tone = round(((hex2num(getblock(structure,7,3)) / 16) - 220)) - H.r_eyes = hex2num(getblock(structure,8,3)) - H.g_eyes = hex2num(getblock(structure,9,3)) - H.b_eyes = hex2num(getblock(structure,10,3)) - - if (isblockon(getblock(structure, 11,3),11 , 1)) - H.gender = FEMALE - else - H.gender = MALE - - //Hair - var/hairnum = hex2num(getblock(structure,13,3)) - var/index = round(1 +(hairnum / 4096)*hair_styles_list.len) - if((0 < index) && (index <= hair_styles_list.len)) - H.h_style = hair_styles_list[index] - - //Facial Hair - var/beardnum = hex2num(getblock(structure,12,3)) - index = round(1 +(beardnum / 4096)*facial_hair_styles_list.len) - if((0 < index) && (index <= facial_hair_styles_list.len)) - H.f_style = facial_hair_styles_list[index] - - H.update_body(0) - H.update_hair() - - return 1 - else - return 0 - -/proc/probinj(var/pr, var/inj) - return prob(pr+inj*pr) - -/proc/domutcheck(mob/living/M as mob, connected, inj) - if (!M) return - - M.dna.check_integrity() - - M.disabilities = 0 - M.sdisabilities = 0 - var/old_mutations = M.mutations - M.mutations = list() - -// M.see_in_dark = 2 -// M.see_invisible = 0 - - if(PLANT in old_mutations) - M.mutations.Add(PLANT) - if(SKELETON in old_mutations) - M.mutations.Add(SKELETON) - if(FAT in old_mutations) - M.mutations.Add(FAT) - if(HUSK in old_mutations) - M.mutations.Add(HUSK) - - if(ismuton(NOBREATHBLOCK,M)) - if(probinj(45,inj) || (mNobreath in old_mutations)) - M << "\blue You feel no need to breathe." - M.mutations.Add(mNobreath) - if(ismuton(REMOTEVIEWBLOCK,M)) - if(probinj(45,inj) || (mRemote in old_mutations)) - M << "\blue Your mind expands" - M.mutations.Add(mRemote) - if(ismuton(REGENERATEBLOCK,M)) - if(probinj(45,inj) || (mRegen in old_mutations)) - M << "\blue You feel strange" - M.mutations.Add(mRegen) - if(ismuton(INCREASERUNBLOCK,M)) - if(probinj(45,inj) || (mRun in old_mutations)) - M << "\blue You feel quick" - M.mutations.Add(mRun) - if(ismuton(REMOTETALKBLOCK,M)) - if(probinj(45,inj) || (mRemotetalk in old_mutations)) - M << "\blue You expand your mind outwards" - M.mutations.Add(mRemotetalk) - if(ismuton(MORPHBLOCK,M)) - if(probinj(45,inj) || (mMorph in old_mutations)) - M.mutations.Add(mMorph) - M << "\blue Your skin feels strange" - if(ismuton(BLENDBLOCK,M)) - if(probinj(45,inj) || (mBlend in old_mutations)) - M.mutations.Add(mBlend) - M << "\blue You feel alone" - if(ismuton(HALLUCINATIONBLOCK,M)) - if(probinj(45,inj) || (mHallucination in old_mutations)) - M.mutations.Add(mHallucination) - M << "\blue Your mind says 'Hello'" - if(ismuton(NOPRINTSBLOCK,M)) - if(probinj(45,inj) || (mFingerprints in old_mutations)) - M.mutations.Add(mFingerprints) - M << "\blue Your fingers feel numb" - if(ismuton(SHOCKIMMUNITYBLOCK,M)) - if(probinj(45,inj) || (mShock in old_mutations)) - M.mutations.Add(mShock) - M << "\blue You feel strange" - if(ismuton(SMALLSIZEBLOCK,M)) - if(probinj(45,inj) || (mSmallsize in old_mutations)) - M << "\blue Your skin feels rubbery" - M.mutations.Add(mSmallsize) - - - - if (isblockon(getblock(M.dna.struc_enzymes, HULKBLOCK,3),HULKBLOCK)) - if(probinj(5,inj) || (HULK in old_mutations)) - M << "\blue Your muscles hurt." - M.mutations.Add(HULK) - if (isblockon(getblock(M.dna.struc_enzymes, HEADACHEBLOCK,3),HEADACHEBLOCK)) - M.disabilities |= EPILEPSY - M << "\red You get a headache." - if (isblockon(getblock(M.dna.struc_enzymes, FAKEBLOCK,3),FAKEBLOCK)) - M << "\red You feel strange." - if (prob(95)) - if(prob(50)) - randmutb(M) - else - randmuti(M) - else - randmutg(M) - if (isblockon(getblock(M.dna.struc_enzymes, COUGHBLOCK,3),COUGHBLOCK)) - M.disabilities |= COUGHING - M << "\red You start coughing." - if (isblockon(getblock(M.dna.struc_enzymes, CLUMSYBLOCK,3),CLUMSYBLOCK)) - M << "\red You feel lightheaded." - M.mutations.Add(CLUMSY) - if (isblockon(getblock(M.dna.struc_enzymes, TWITCHBLOCK,3),TWITCHBLOCK)) - M.disabilities |= TOURETTES - M << "\red You twitch." - if (isblockon(getblock(M.dna.struc_enzymes, XRAYBLOCK,3),XRAYBLOCK)) - if(probinj(30,inj) || (XRAY in old_mutations)) - M << "\blue The walls suddenly disappear." -// M.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) -// M.see_in_dark = 8 -// M.see_invisible = 2 - M.mutations.Add(XRAY) - if (isblockon(getblock(M.dna.struc_enzymes, NERVOUSBLOCK,3),NERVOUSBLOCK)) - M.disabilities |= NERVOUS - M << "\red You feel nervous." - if (isblockon(getblock(M.dna.struc_enzymes, FIREBLOCK,3),FIREBLOCK)) - if(probinj(30,inj) || (COLD_RESISTANCE in old_mutations)) - M << "\blue Your body feels warm." - M.mutations.Add(COLD_RESISTANCE) - if (isblockon(getblock(M.dna.struc_enzymes, BLINDBLOCK,3),BLINDBLOCK)) - M.sdisabilities |= BLIND - M << "\red You can't seem to see anything." - if (isblockon(getblock(M.dna.struc_enzymes, TELEBLOCK,3),TELEBLOCK)) - if(probinj(15,inj) || (TK in old_mutations)) - M << "\blue You feel smarter." - M.mutations.Add(TK) - if (isblockon(getblock(M.dna.struc_enzymes, DEAFBLOCK,3),DEAFBLOCK)) - M.sdisabilities |= DEAF - M.ear_deaf = 1 - M << "\red Its kinda quiet.." - if (isblockon(getblock(M.dna.struc_enzymes, GLASSESBLOCK,3),GLASSESBLOCK)) - M.disabilities |= NEARSIGHTED - M << "Your eyes feel weird..." - - /* If you want the new mutations to work, UNCOMMENT THIS. - if(istype(M, /mob/living/carbon)) - for (var/datum/mutations/mut in global_mutations) - mut.check_mutation(M) - */ - -//////////////////////////////////////////////////////////// Monkey Block - if (isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && istype(M, /mob/living/carbon/human)) - // human > monkey - var/mob/living/carbon/human/H = M - H.monkeyizing = 1 - var/list/implants = list() //Try to preserve implants. - for(var/obj/item/weapon/implant/W in H) - implants += W - W.loc = null - - if(!connected) - for(var/obj/item/W in (H.contents-implants)) - if (W==H.w_uniform) // will be teared - continue - H.drop_from_inventory(W) - M.monkeyizing = 1 - M.canmove = 0 - M.icon = null - M.invisibility = 101 - var/atom/movable/overlay/animation = new( M.loc ) - animation.icon_state = "blank" - animation.icon = 'icons/mob/mob.dmi' - animation.master = src - flick("h2monkey", animation) - sleep(48) - del(animation) - - - var/mob/living/carbon/monkey/O = null - if(H.species.primitive) - O = new H.species.primitive(src) - else - H.gib() //Trying to change the species of a creature with no primitive var set is messy. - return - - if(M) - if (M.dna) - O.dna = M.dna - M.dna = null - - if (M.suiciding) - O.suiciding = M.suiciding - M.suiciding = null - - - for(var/datum/disease/D in M.viruses) - O.viruses += D - D.affected_mob = O - M.viruses -= D - - - for(var/obj/T in (M.contents-implants)) - del(T) - - O.loc = M.loc - - if(M.mind) - M.mind.transfer_to(O) //transfer our mind to the cute little monkey - - if (connected) //inside dna thing - var/obj/machinery/dna_scannernew/C = connected - O.loc = C - C.occupant = O - connected = null - O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6)) - O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss()) - O.adjustToxLoss(M.getToxLoss() + 20) - O.adjustOxyLoss(M.getOxyLoss()) - O.stat = M.stat - O.a_intent = "hurt" - for (var/obj/item/weapon/implant/I in implants) - I.loc = O - I.implanted = O -// O.update_icon = 1 //queue a full icon update at next life() call - del(M) - return - - if (!isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && !istype(M, /mob/living/carbon/human)) - // monkey > human, - var/mob/living/carbon/monkey/Mo = M - Mo.monkeyizing = 1 - var/list/implants = list() //Still preserving implants - for(var/obj/item/weapon/implant/W in Mo) - implants += W - W.loc = null - if(!connected) - for(var/obj/item/W in (Mo.contents-implants)) - Mo.drop_from_inventory(W) - M.monkeyizing = 1 - M.canmove = 0 - M.icon = null - M.invisibility = 101 - var/atom/movable/overlay/animation = new( M.loc ) - animation.icon_state = "blank" - animation.icon = 'icons/mob/mob.dmi' - animation.master = src - flick("monkey2h", animation) - sleep(48) - del(animation) - - var/mob/living/carbon/human/O = new( src ) - if(Mo.greaterform) - O.set_species(Mo.greaterform) - - if (isblockon(getblock(M.dna.uni_identity, 11,3),11)) - O.gender = FEMALE - else - O.gender = MALE - - if (M) - if (M.dna) - O.dna = M.dna - M.dna = null - - if (M.suiciding) - O.suiciding = M.suiciding - M.suiciding = null - - for(var/datum/disease/D in M.viruses) - O.viruses += D - D.affected_mob = O - M.viruses -= D - - //for(var/obj/T in M) - // del(T) - - O.loc = M.loc - - if(M.mind) - M.mind.transfer_to(O) //transfer our mind to the human - - if (connected) //inside dna thing - var/obj/machinery/dna_scannernew/C = connected - O.loc = C - C.occupant = O - connected = null - - var/i - while (!i) - var/randomname - if (O.gender == MALE) - randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names))) - else - randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names))) - if (findname(randomname)) - continue - else - O.real_name = randomname - i++ - updateappearance(O,O.dna.uni_identity) - O.take_overall_damage(M.getBruteLoss(), M.getFireLoss()) - O.adjustToxLoss(M.getToxLoss()) - O.adjustOxyLoss(M.getOxyLoss()) - O.stat = M.stat - for (var/obj/item/weapon/implant/I in implants) - I.loc = O - I.implanted = O -// O.update_icon = 1 //queue a full icon update at next life() call - del(M) - return -//////////////////////////////////////////////////////////// Monkey Block - if(M) - M.update_icon = 1 //queue a full icon update at next life() call - return null +/////////////////////////// DNA HELPER-PROCS +/proc/getleftblocks(input,blocknumber,blocksize) + var/string + + if (blocknumber > 1) + string = copytext(input,1,((blocksize*blocknumber)-(blocksize-1))) + return string + else + return null + +/proc/getrightblocks(input,blocknumber,blocksize) + var/string + if (blocknumber < (length(input)/blocksize)) + string = copytext(input,blocksize*blocknumber+1,length(input)+1) + return string + else + return null + +/proc/getblockstring(input,block,subblock,blocksize,src,ui) // src is probably used here just for urls; ui is 1 when requesting for the unique identifier screen, 0 for structural enzymes screen + var/string + var/subpos = 1 // keeps track of the current sub block + var/blockpos = 1 // keeps track of the current block + + + for(var/i = 1, i <= length(input), i++) // loop through each letter + + var/pushstring + + if(subpos == subblock && blockpos == block) // if the current block/subblock is selected, mark it + pushstring = "[copytext(input, i, i+1)]" + else + if(ui) //This is for allowing block clicks to be differentiated + pushstring = "[copytext(input, i, i+1)]" + else + pushstring = "[copytext(input, i, i+1)]" + + string += pushstring // push the string to the return string + + if(subpos >= blocksize) // add a line break for every block + string += " | " + subpos = 0 + blockpos++ + + subpos++ + + return string + + +/proc/getblock(input,blocknumber,blocksize) + var/result + result = copytext(input ,(blocksize*blocknumber)-(blocksize-1),(blocksize*blocknumber)+1) + return result + +/proc/getblockbuffer(input,blocknumber,blocksize) + var/result[3] + var/block = copytext(input ,(blocksize*blocknumber)-(blocksize-1),(blocksize*blocknumber)+1) + for(var/i = 1, i <= 3, i++) + result[i] = copytext(block, i, i+1) + return result + +/proc/setblock(istring, blocknumber, replacement, blocksize) + if(!blocknumber) + return istring + if(!istring || !replacement || !blocksize) return 0 + var/result = getleftblocks(istring, blocknumber, blocksize) + replacement + getrightblocks(istring, blocknumber, blocksize) + return result + +/proc/add_zero2(t, u) + var/temp1 + while (length(t) < u) + t = "0[t]" + temp1 = t + if (length(t) > u) + temp1 = copytext(t,2,u+1) + return temp1 + +/proc/miniscramble(input,rs,rd) + var/output + output = null + if (input == "C" || input == "D" || input == "E" || input == "F") + output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"6",prob((rs*10));"7",prob((rs*5)+(rd));"0",prob((rs*5)+(rd));"1",prob((rs*10)-(rd));"2",prob((rs*10)-(rd));"3") + if (input == "8" || input == "9" || input == "A" || input == "B") + output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3") + if (input == "4" || input == "5" || input == "6" || input == "7") + output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3") + if (input == "0" || input == "1" || input == "2" || input == "3") + output = pick(prob((rs*10));"8",prob((rs*10));"9",prob((rs*10));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C",prob((rs*10)-(rd));"D",prob((rs*5)+(rd));"E",prob((rs*5)+(rd));"F") + if (!output) output = "5" + return output + +//Instead of picking a value far from the input, this will pick values closer to it. +//Sorry for the block of code, but it's more efficient then calling text2hex -> loop -> hex2text +/proc/miniscrambletarget(input,rs,rd) + var/output = null + switch(input) + if("0") + output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10));"2",prob((rs*10)-(rd));"3") + if("1") + output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10));"3",prob((rs*10)-(rd));"4") + if("2") + output = pick(prob((rs*10));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10));"4",prob((rs*10)-(rd));"5") + if("3") + output = pick(prob((rs*10)-(rd));"0",prob((rs*10));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10));"5",prob((rs*10)-(rd));"6") + if("4") + output = pick(prob((rs*10)-(rd));"1",prob((rs*10));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10));"6",prob((rs*10)-(rd));"7") + if("5") + output = pick(prob((rs*10)-(rd));"2",prob((rs*10));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10));"7",prob((rs*10)-(rd));"8") + if("6") + output = pick(prob((rs*10)-(rd));"3",prob((rs*10));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10));"8",prob((rs*10)-(rd));"9") + if("7") + output = pick(prob((rs*10)-(rd));"4",prob((rs*10));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10));"9",prob((rs*10)-(rd));"A") + if("8") + output = pick(prob((rs*10)-(rd));"5",prob((rs*10));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10));"A",prob((rs*10)-(rd));"B") + if("9") + output = pick(prob((rs*10)-(rd));"6",prob((rs*10));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C") + if("10")//A + output = pick(prob((rs*10)-(rd));"7",prob((rs*10));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10));"C",prob((rs*10)-(rd));"D") + if("11")//B + output = pick(prob((rs*10)-(rd));"8",prob((rs*10));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10));"D",prob((rs*10)-(rd));"E") + if("12")//C + output = pick(prob((rs*10)-(rd));"9",prob((rs*10));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10));"E",prob((rs*10)-(rd));"F") + if("13")//D + output = pick(prob((rs*10)-(rd));"A",prob((rs*10));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10));"F") + if("14")//E + output = pick(prob((rs*10)-(rd));"B",prob((rs*10));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F") + if("15")//F + output = pick(prob((rs*10)-(rd));"C",prob((rs*10));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F") + + if(!input || !output) //How did this happen? + output = "8" + + return output + +/proc/isblockon(hnumber, bnumber , var/UI = 0) + + var/temp2 + temp2 = hex2num(hnumber) + + if(UI) + if(temp2 >= 2050) + return 1 + else + return 0 + + if (bnumber == HULKBLOCK || bnumber == TELEBLOCK || bnumber == NOBREATHBLOCK || bnumber == NOPRINTSBLOCK || bnumber == SMALLSIZEBLOCK || bnumber == SHOCKIMMUNITYBLOCK) + if (temp2 >= 3500 + BLOCKADD) + return 1 + else + return 0 + if (bnumber == XRAYBLOCK || bnumber == FIREBLOCK || bnumber == REMOTEVIEWBLOCK || bnumber == REGENERATEBLOCK || bnumber == INCREASERUNBLOCK || bnumber == REMOTETALKBLOCK || bnumber == MORPHBLOCK) + if (temp2 >= 3050 + BLOCKADD) + return 1 + else + return 0 + + + if (temp2 >= 2050 + BLOCKADD) + return 1 + else + return 0 + +/proc/ismuton(var/block,var/mob/M) + return isblockon(getblock(M.dna.struc_enzymes, block,3),block) + +/proc/randmutb(mob/M as mob) + if(!M) return + var/num + var/newdna + num = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK,HALLUCINATIONBLOCK) + M.dna.check_integrity() + newdna = setblock(M.dna.struc_enzymes,num,toggledblock(getblock(M.dna.struc_enzymes,num,3)),3) + M.dna.struc_enzymes = newdna + return + +/proc/randmutg(mob/M as mob) + if(!M) return + var/num + var/newdna + num = pick(HULKBLOCK,XRAYBLOCK,FIREBLOCK,TELEBLOCK,NOBREATHBLOCK,REMOTEVIEWBLOCK,REGENERATEBLOCK,INCREASERUNBLOCK,REMOTETALKBLOCK,MORPHBLOCK,BLENDBLOCK,NOPRINTSBLOCK,SHOCKIMMUNITYBLOCK,SMALLSIZEBLOCK) + M.dna.check_integrity() + newdna = setblock(M.dna.struc_enzymes,num,toggledblock(getblock(M.dna.struc_enzymes,num,3)),3) + M.dna.struc_enzymes = newdna + return + +/proc/scramble(var/type, mob/M as mob, var/p) + if(!M) return + M.dna.check_integrity() + if(type) + for(var/i = 1, i <= STRUCDNASIZE-1, i++) + if(prob(p)) + M.dna.uni_identity = setblock(M.dna.uni_identity, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3) + updateappearance(M, M.dna.uni_identity) + + else + for(var/i = 1, i <= STRUCDNASIZE-1, i++) + if(prob(p)) + M.dna.struc_enzymes = setblock(M.dna.struc_enzymes, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3) + domutcheck(M, null) + return + +/proc/randmuti(mob/M as mob) + if(!M) return + var/num + var/newdna + num = rand(1,UNIDNASIZE) + M.dna.check_integrity() + newdna = setblock(M.dna.uni_identity,num,add_zero2(num2hex(rand(1,4095),1),3),3) + M.dna.uni_identity = newdna + return + +/proc/toggledblock(hnumber) //unused + var/temp3 + var/chtemp + temp3 = hex2num(hnumber) + if (temp3 < 2050) + chtemp = rand(2050,4095) + return add_zero2(num2hex(chtemp,1),3) + else + chtemp = rand(1,2049) + return add_zero2(num2hex(chtemp,1),3) +/////////////////////////// DNA HELPER-PROCS + +/////////////////////////// DNA MISC-PROCS +/proc/updateappearance(mob/M as mob , structure) + if(istype(M, /mob/living/carbon/human)) + M.dna.check_integrity() + var/mob/living/carbon/human/H = M + H.r_hair = hex2num(getblock(structure,1,3)) + H.b_hair = hex2num(getblock(structure,2,3)) + H.g_hair = hex2num(getblock(structure,3,3)) + H.r_facial = hex2num(getblock(structure,4,3)) + H.b_facial = hex2num(getblock(structure,5,3)) + H.g_facial = hex2num(getblock(structure,6,3)) + H.s_tone = round(((hex2num(getblock(structure,7,3)) / 16) - 220)) + H.r_eyes = hex2num(getblock(structure,8,3)) + H.g_eyes = hex2num(getblock(structure,9,3)) + H.b_eyes = hex2num(getblock(structure,10,3)) + + if (isblockon(getblock(structure, 11,3),11 , 1)) + H.gender = FEMALE + else + H.gender = MALE + + //Hair + var/hairnum = hex2num(getblock(structure,13,3)) + var/index = round(1 +(hairnum / 4096)*hair_styles_list.len) + if((0 < index) && (index <= hair_styles_list.len)) + H.h_style = hair_styles_list[index] + + //Facial Hair + var/beardnum = hex2num(getblock(structure,12,3)) + index = round(1 +(beardnum / 4096)*facial_hair_styles_list.len) + if((0 < index) && (index <= facial_hair_styles_list.len)) + H.f_style = facial_hair_styles_list[index] + + H.update_body(0) + H.update_hair() + + return 1 + else + return 0 + +/proc/probinj(var/pr, var/inj) + return prob(pr+inj*pr) + +/proc/domutcheck(mob/living/M as mob, connected, inj) + if (!M) return + + M.dna.check_integrity() + + M.disabilities = 0 + M.sdisabilities = 0 + var/old_mutations = M.mutations + M.mutations = list() + +// M.see_in_dark = 2 +// M.see_invisible = 0 + + if(PLANT in old_mutations) + M.mutations.Add(PLANT) + if(SKELETON in old_mutations) + M.mutations.Add(SKELETON) + if(FAT in old_mutations) + M.mutations.Add(FAT) + if(HUSK in old_mutations) + M.mutations.Add(HUSK) + + if(ismuton(NOBREATHBLOCK,M)) + if(probinj(45,inj) || (mNobreath in old_mutations)) + M << "\blue You feel no need to breathe." + M.mutations.Add(mNobreath) + if(ismuton(REMOTEVIEWBLOCK,M)) + if(probinj(45,inj) || (mRemote in old_mutations)) + M << "\blue Your mind expands" + M.mutations.Add(mRemote) + if(ismuton(REGENERATEBLOCK,M)) + if(probinj(45,inj) || (mRegen in old_mutations)) + M << "\blue You feel strange" + M.mutations.Add(mRegen) + if(ismuton(INCREASERUNBLOCK,M)) + if(probinj(45,inj) || (mRun in old_mutations)) + M << "\blue You feel quick" + M.mutations.Add(mRun) + if(ismuton(REMOTETALKBLOCK,M)) + if(probinj(45,inj) || (mRemotetalk in old_mutations)) + M << "\blue You expand your mind outwards" + M.mutations.Add(mRemotetalk) + if(ismuton(MORPHBLOCK,M)) + if(probinj(45,inj) || (mMorph in old_mutations)) + M.mutations.Add(mMorph) + M << "\blue Your skin feels strange" + if(ismuton(BLENDBLOCK,M)) + if(probinj(45,inj) || (mBlend in old_mutations)) + M.mutations.Add(mBlend) + M << "\blue You feel alone" + if(ismuton(HALLUCINATIONBLOCK,M)) + if(probinj(45,inj) || (mHallucination in old_mutations)) + M.mutations.Add(mHallucination) + M << "\blue Your mind says 'Hello'" + if(ismuton(NOPRINTSBLOCK,M)) + if(probinj(45,inj) || (mFingerprints in old_mutations)) + M.mutations.Add(mFingerprints) + M << "\blue Your fingers feel numb" + if(ismuton(SHOCKIMMUNITYBLOCK,M)) + if(probinj(45,inj) || (mShock in old_mutations)) + M.mutations.Add(mShock) + M << "\blue You feel strange" + if(ismuton(SMALLSIZEBLOCK,M)) + if(probinj(45,inj) || (mSmallsize in old_mutations)) + M << "\blue Your skin feels rubbery" + M.mutations.Add(mSmallsize) + + + + if (isblockon(getblock(M.dna.struc_enzymes, HULKBLOCK,3),HULKBLOCK)) + if(probinj(5,inj) || (HULK in old_mutations)) + M << "\blue Your muscles hurt." + M.mutations.Add(HULK) + if (isblockon(getblock(M.dna.struc_enzymes, HEADACHEBLOCK,3),HEADACHEBLOCK)) + M.disabilities |= EPILEPSY + M << "\red You get a headache." + if (isblockon(getblock(M.dna.struc_enzymes, FAKEBLOCK,3),FAKEBLOCK)) + M << "\red You feel strange." + if (prob(95)) + if(prob(50)) + randmutb(M) + else + randmuti(M) + else + randmutg(M) + if (isblockon(getblock(M.dna.struc_enzymes, COUGHBLOCK,3),COUGHBLOCK)) + M.disabilities |= COUGHING + M << "\red You start coughing." + if (isblockon(getblock(M.dna.struc_enzymes, CLUMSYBLOCK,3),CLUMSYBLOCK)) + M << "\red You feel lightheaded." + M.mutations.Add(CLUMSY) + if (isblockon(getblock(M.dna.struc_enzymes, TWITCHBLOCK,3),TWITCHBLOCK)) + M.disabilities |= TOURETTES + M << "\red You twitch." + if (isblockon(getblock(M.dna.struc_enzymes, XRAYBLOCK,3),XRAYBLOCK)) + if(probinj(30,inj) || (XRAY in old_mutations)) + M << "\blue The walls suddenly disappear." +// M.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) +// M.see_in_dark = 8 +// M.see_invisible = 2 + M.mutations.Add(XRAY) + if (isblockon(getblock(M.dna.struc_enzymes, NERVOUSBLOCK,3),NERVOUSBLOCK)) + M.disabilities |= NERVOUS + M << "\red You feel nervous." + if (isblockon(getblock(M.dna.struc_enzymes, FIREBLOCK,3),FIREBLOCK)) + if(probinj(30,inj) || (COLD_RESISTANCE in old_mutations)) + M << "\blue Your body feels warm." + M.mutations.Add(COLD_RESISTANCE) + if (isblockon(getblock(M.dna.struc_enzymes, BLINDBLOCK,3),BLINDBLOCK)) + M.sdisabilities |= BLIND + M << "\red You can't seem to see anything." + if (isblockon(getblock(M.dna.struc_enzymes, TELEBLOCK,3),TELEBLOCK)) + if(probinj(15,inj) || (TK in old_mutations)) + M << "\blue You feel smarter." + M.mutations.Add(TK) + if (isblockon(getblock(M.dna.struc_enzymes, DEAFBLOCK,3),DEAFBLOCK)) + M.sdisabilities |= DEAF + M.ear_deaf = 1 + M << "\red Its kinda quiet.." + if (isblockon(getblock(M.dna.struc_enzymes, GLASSESBLOCK,3),GLASSESBLOCK)) + M.disabilities |= NEARSIGHTED + M << "Your eyes feel weird..." + + /* If you want the new mutations to work, UNCOMMENT THIS. + if(istype(M, /mob/living/carbon)) + for (var/datum/mutations/mut in global_mutations) + mut.check_mutation(M) + */ + +//////////////////////////////////////////////////////////// Monkey Block + if (isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && istype(M, /mob/living/carbon/human)) + // human > monkey + var/mob/living/carbon/human/H = M + H.monkeyizing = 1 + var/list/implants = list() //Try to preserve implants. + for(var/obj/item/weapon/implant/W in H) + implants += W + W.loc = null + + if(!connected) + for(var/obj/item/W in (H.contents-implants)) + if (W==H.w_uniform) // will be teared + continue + H.drop_from_inventory(W) + M.monkeyizing = 1 + M.canmove = 0 + M.icon = null + M.invisibility = 101 + var/atom/movable/overlay/animation = new( M.loc ) + animation.icon_state = "blank" + animation.icon = 'icons/mob/mob.dmi' + animation.master = src + flick("h2monkey", animation) + sleep(48) + del(animation) + + + var/mob/living/carbon/monkey/O = null + if(H.species.primitive) + O = new H.species.primitive(src) + else + H.gib() //Trying to change the species of a creature with no primitive var set is messy. + return + + if(M) + if (M.dna) + O.dna = M.dna + M.dna = null + + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null + + + for(var/datum/disease/D in M.viruses) + O.viruses += D + D.affected_mob = O + M.viruses -= D + + + for(var/obj/T in (M.contents-implants)) + del(T) + + O.loc = M.loc + + if(M.mind) + M.mind.transfer_to(O) //transfer our mind to the cute little monkey + + if (connected) //inside dna thing + var/obj/machinery/dna_scannernew/C = connected + O.loc = C + C.occupant = O + connected = null + O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6)) + O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss()) + O.adjustToxLoss(M.getToxLoss() + 20) + O.adjustOxyLoss(M.getOxyLoss()) + O.stat = M.stat + O.a_intent = I_HURT + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call + del(M) + return + + if (!isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && !istype(M, /mob/living/carbon/human)) + // monkey > human, + var/mob/living/carbon/monkey/Mo = M + Mo.monkeyizing = 1 + var/list/implants = list() //Still preserving implants + for(var/obj/item/weapon/implant/W in Mo) + implants += W + W.loc = null + if(!connected) + for(var/obj/item/W in (Mo.contents-implants)) + Mo.drop_from_inventory(W) + M.monkeyizing = 1 + M.canmove = 0 + M.icon = null + M.invisibility = 101 + var/atom/movable/overlay/animation = new( M.loc ) + animation.icon_state = "blank" + animation.icon = 'icons/mob/mob.dmi' + animation.master = src + flick("monkey2h", animation) + sleep(48) + del(animation) + + var/mob/living/carbon/human/O = new( src ) + if(Mo.greaterform) + O.set_species(Mo.greaterform) + + if (isblockon(getblock(M.dna.uni_identity, 11,3),11)) + O.gender = FEMALE + else + O.gender = MALE + + if (M) + if (M.dna) + O.dna = M.dna + M.dna = null + + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null + + for(var/datum/disease/D in M.viruses) + O.viruses += D + D.affected_mob = O + M.viruses -= D + + //for(var/obj/T in M) + // del(T) + + O.loc = M.loc + + if(M.mind) + M.mind.transfer_to(O) //transfer our mind to the human + + if (connected) //inside dna thing + var/obj/machinery/dna_scannernew/C = connected + O.loc = C + C.occupant = O + connected = null + + var/i + while (!i) + var/randomname + if (O.gender == MALE) + randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names))) + else + randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names))) + if (findname(randomname)) + continue + else + O.real_name = randomname + i++ + updateappearance(O,O.dna.uni_identity) + O.take_overall_damage(M.getBruteLoss(), M.getFireLoss()) + O.adjustToxLoss(M.getToxLoss()) + O.adjustOxyLoss(M.getOxyLoss()) + O.stat = M.stat + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call + del(M) + return +//////////////////////////////////////////////////////////// Monkey Block + if(M) + M.update_icon = 1 //queue a full icon update at next life() call + return null /////////////////////////// DNA MISC-PROCS \ No newline at end of file diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm index 69aba349f75..2e0f6cdec2f 100644 --- a/code/game/dna/genes/monkey.dm +++ b/code/game/dna/genes/monkey.dm @@ -1,175 +1,175 @@ -/datum/dna/gene/monkey - name="Monkey" - -/datum/dna/gene/monkey/New() - block=MONKEYBLOCK - -/datum/dna/gene/monkey/can_activate(var/mob/M,var/flags) - return istype(M, /mob/living/carbon/human) || istype(M,/mob/living/carbon/monkey) - -/datum/dna/gene/monkey/activate(var/mob/living/M, var/connected, var/flags) - if(!istype(M,/mob/living/carbon/human)) - //testing("Cannot monkey-ify [M], type is [M.type].") - return - var/mob/living/carbon/human/H = M - H.monkeyizing = 1 - var/list/implants = list() //Try to preserve implants. - for(var/obj/item/weapon/implant/W in H) - implants += W - W.loc = null - - if(!connected) - for(var/obj/item/W in (H.contents-implants)) - if (W==H.w_uniform) // will be teared - continue - H.drop_from_inventory(W) - M.monkeyizing = 1 - M.canmove = 0 - M.icon = null - M.invisibility = 101 - var/atom/movable/overlay/animation = new( M.loc ) - animation.icon_state = "blank" - animation.icon = 'icons/mob/mob.dmi' - animation.master = src - flick("h2monkey", animation) - sleep(48) - del(animation) - - - var/mob/living/carbon/monkey/O = null - if(H.species.primitive) - O = new H.species.primitive(src) - else - H.gib() //Trying to change the species of a creature with no primitive var set is messy. - return - - if(M) - if (M.dna) - O.dna = M.dna.Clone() - M.dna = null - - if (M.suiciding) - O.suiciding = M.suiciding - M.suiciding = null - - - for(var/datum/disease/D in M.viruses) - O.viruses += D - D.affected_mob = O - M.viruses -= D - - - for(var/obj/T in (M.contents-implants)) - del(T) - - O.loc = M.loc - - if(M.mind) - M.mind.transfer_to(O) //transfer our mind to the cute little monkey - - if (connected) //inside dna thing - var/obj/machinery/dna_scannernew/C = connected - O.loc = C - C.occupant = O - connected = null - O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6)) - O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss()) - O.adjustToxLoss(M.getToxLoss() + 20) - O.adjustOxyLoss(M.getOxyLoss()) - O.stat = M.stat - O.a_intent = "hurt" - for (var/obj/item/weapon/implant/I in implants) - I.loc = O - I.implanted = O -// O.update_icon = 1 //queue a full icon update at next life() call - del(M) - return - -/datum/dna/gene/monkey/deactivate(var/mob/living/M, var/connected, var/flags) - if(!istype(M,/mob/living/carbon/monkey)) - //testing("Cannot humanize [M], type is [M.type].") - return - var/mob/living/carbon/monkey/Mo = M - Mo.monkeyizing = 1 - var/list/implants = list() //Still preserving implants - for(var/obj/item/weapon/implant/W in Mo) - implants += W - W.loc = null - if(!connected) - for(var/obj/item/W in (Mo.contents-implants)) - Mo.drop_from_inventory(W) - M.monkeyizing = 1 - M.canmove = 0 - M.icon = null - M.invisibility = 101 - var/atom/movable/overlay/animation = new( M.loc ) - animation.icon_state = "blank" - animation.icon = 'icons/mob/mob.dmi' - animation.master = src - flick("monkey2h", animation) - sleep(48) - del(animation) - - var/mob/living/carbon/human/O - if(Mo.greaterform) - O = new(src, Mo.greaterform) - else - O = new(src) - - if (M.dna.GetUIState(DNA_UI_GENDER)) - O.gender = FEMALE - else - O.gender = MALE - - if (M) - if (M.dna) - O.dna = M.dna.Clone() - M.dna = null - - if (M.suiciding) - O.suiciding = M.suiciding - M.suiciding = null - - for(var/datum/disease/D in M.viruses) - O.viruses += D - D.affected_mob = O - M.viruses -= D - - //for(var/obj/T in M) - // del(T) - - O.loc = M.loc - - if(M.mind) - M.mind.transfer_to(O) //transfer our mind to the human - - if (connected) //inside dna thing - var/obj/machinery/dna_scannernew/C = connected - O.loc = C - C.occupant = O - connected = null - - var/i - while (!i) - var/randomname - if (O.gender == MALE) - randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names))) - else - randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names))) - if (findname(randomname)) - continue - else - O.real_name = randomname - O.dna.real_name = randomname - i++ - O.UpdateAppearance() - O.take_overall_damage(M.getBruteLoss(), M.getFireLoss()) - O.adjustToxLoss(M.getToxLoss()) - O.adjustOxyLoss(M.getOxyLoss()) - O.stat = M.stat - for (var/obj/item/weapon/implant/I in implants) - I.loc = O - I.implanted = O -// O.update_icon = 1 //queue a full icon update at next life() call - del(M) - return \ No newline at end of file +/datum/dna/gene/monkey + name="Monkey" + +/datum/dna/gene/monkey/New() + block=MONKEYBLOCK + +/datum/dna/gene/monkey/can_activate(var/mob/M,var/flags) + return istype(M, /mob/living/carbon/human) || istype(M,/mob/living/carbon/monkey) + +/datum/dna/gene/monkey/activate(var/mob/living/M, var/connected, var/flags) + if(!istype(M,/mob/living/carbon/human)) + //testing("Cannot monkey-ify [M], type is [M.type].") + return + var/mob/living/carbon/human/H = M + H.monkeyizing = 1 + var/list/implants = list() //Try to preserve implants. + for(var/obj/item/weapon/implant/W in H) + implants += W + W.loc = null + + if(!connected) + for(var/obj/item/W in (H.contents-implants)) + if (W==H.w_uniform) // will be teared + continue + H.drop_from_inventory(W) + M.monkeyizing = 1 + M.canmove = 0 + M.icon = null + M.invisibility = 101 + var/atom/movable/overlay/animation = new( M.loc ) + animation.icon_state = "blank" + animation.icon = 'icons/mob/mob.dmi' + animation.master = src + flick("h2monkey", animation) + sleep(48) + del(animation) + + + var/mob/living/carbon/monkey/O = null + if(H.species.primitive) + O = new H.species.primitive(src) + else + H.gib() //Trying to change the species of a creature with no primitive var set is messy. + return + + if(M) + if (M.dna) + O.dna = M.dna.Clone() + M.dna = null + + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null + + + for(var/datum/disease/D in M.viruses) + O.viruses += D + D.affected_mob = O + M.viruses -= D + + + for(var/obj/T in (M.contents-implants)) + del(T) + + O.loc = M.loc + + if(M.mind) + M.mind.transfer_to(O) //transfer our mind to the cute little monkey + + if (connected) //inside dna thing + var/obj/machinery/dna_scannernew/C = connected + O.loc = C + C.occupant = O + connected = null + O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6)) + O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss()) + O.adjustToxLoss(M.getToxLoss() + 20) + O.adjustOxyLoss(M.getOxyLoss()) + O.stat = M.stat + O.a_intent = I_HURT + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call + del(M) + return + +/datum/dna/gene/monkey/deactivate(var/mob/living/M, var/connected, var/flags) + if(!istype(M,/mob/living/carbon/monkey)) + //testing("Cannot humanize [M], type is [M.type].") + return + var/mob/living/carbon/monkey/Mo = M + Mo.monkeyizing = 1 + var/list/implants = list() //Still preserving implants + for(var/obj/item/weapon/implant/W in Mo) + implants += W + W.loc = null + if(!connected) + for(var/obj/item/W in (Mo.contents-implants)) + Mo.drop_from_inventory(W) + M.monkeyizing = 1 + M.canmove = 0 + M.icon = null + M.invisibility = 101 + var/atom/movable/overlay/animation = new( M.loc ) + animation.icon_state = "blank" + animation.icon = 'icons/mob/mob.dmi' + animation.master = src + flick("monkey2h", animation) + sleep(48) + del(animation) + + var/mob/living/carbon/human/O + if(Mo.greaterform) + O = new(src, Mo.greaterform) + else + O = new(src) + + if (M.dna.GetUIState(DNA_UI_GENDER)) + O.gender = FEMALE + else + O.gender = MALE + + if (M) + if (M.dna) + O.dna = M.dna.Clone() + M.dna = null + + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null + + for(var/datum/disease/D in M.viruses) + O.viruses += D + D.affected_mob = O + M.viruses -= D + + //for(var/obj/T in M) + // del(T) + + O.loc = M.loc + + if(M.mind) + M.mind.transfer_to(O) //transfer our mind to the human + + if (connected) //inside dna thing + var/obj/machinery/dna_scannernew/C = connected + O.loc = C + C.occupant = O + connected = null + + var/i + while (!i) + var/randomname + if (O.gender == MALE) + randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names))) + else + randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names))) + if (findname(randomname)) + continue + else + O.real_name = randomname + O.dna.real_name = randomname + i++ + O.UpdateAppearance() + O.take_overall_damage(M.getBruteLoss(), M.getFireLoss()) + O.adjustToxLoss(M.getToxLoss()) + O.adjustOxyLoss(M.getOxyLoss()) + O.stat = M.stat + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call + del(M) + return diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 4f480e41ea2..f7058921da0 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -262,7 +262,7 @@ return //psa to whoever coded this, there are plenty of objects that need to call attack() on doors without bludgeoning them. - if(src.density && istype(I, /obj/item/weapon) && user.a_intent == "hurt" && !istype(I, /obj/item/weapon/card)) + if(src.density && istype(I, /obj/item/weapon) && user.a_intent == I_HURT && !istype(I, /obj/item/weapon/card)) var/obj/item/weapon/W = I if(W.damtype == BRUTE || W.damtype == BURN) if(W.force < min_force) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 3e08aad5856..8a46395c0dd 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -331,7 +331,7 @@ else //if the turret was attacked with the intention of harming it: - user.changeNext_move(CLICK_CD_MELEE) + user.changeNext_move(NEXT_MOVE_DELAY) take_damage(I.force * 0.5) if(I.force * 0.5 > 1) //if the force of impact dealt at least 1 damage, the turret gets pissed off if(!attacked && !emagged) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 22612983a86..1020833e31c 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -147,6 +147,8 @@ if(99 to 110) overlays += image('icons/obj/objects.dmi', "statn_c100") +/obj/machinery/recharge_station/Bumped(var/mob/AM) + move_inside(AM) /obj/machinery/recharge_station/proc/build_icon() if(NOPOWER|BROKEN) @@ -199,31 +201,37 @@ add_fingerprint(usr) return -/obj/machinery/recharge_station/verb/move_inside() +/obj/machinery/recharge_station/verb/move_inside(var/mob/user = usr) set category = "Object" set src in oview(1) - if(usr.stat == 2) + + if(!user) + return + + if(!(istype(user, /mob/living/silicon/robot))) + user << "Only non-organics may enter the recharger!" + return + var/mob/living/silicon/robot/R = user + + if(R.stat == 2) //Whoever had it so that a borg with a dead cell can't enter this thing should be shot. --NEO return - if(!(istype(usr, /mob/living/silicon/))) - usr << "Only non-organics may enter the recharger!" - return if(occupant) - usr << "The cell is already occupied!" + R << "The cell is already occupied!" return - if(!usr:cell) - usr << "Without a powercell, you can't be recharged." + if(!R.cell) + R << "Without a powercell, you can't be recharged." //Make sure they actually HAVE a cell, now that they can get in while powerless. --NEO return - usr.stop_pulling() - if(usr && usr.client) - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src - usr.loc = src - occupant = usr + R.stop_pulling() + if(R.client) + R.client.perspective = EYE_PERSPECTIVE + R.client.eye = src + R.loc = src + occupant = R /*for(var/obj/O in src) O.loc = loc*/ - add_fingerprint(usr) + add_fingerprint(R) build_icon() update_use_power(1) - return \ No newline at end of file + return diff --git a/code/game/mecha/combat/combat.dm b/code/game/mecha/combat/combat.dm index f75bd01ac49..1499af49961 100644 --- a/code/game/mecha/combat/combat.dm +++ b/code/game/mecha/combat/combat.dm @@ -25,7 +25,7 @@ if(!melee_can_hit || !istype(target, /atom)) return if(istype(target, /mob/living)) var/mob/living/M = target - if(src.occupant.a_intent == "hurt") + if(src.occupant.a_intent == I_HURT) playsound(src, 'sound/weapons/punch4.ogg', 50, 1) if(damtype == "brute") step_away(M,src,15) diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index 130d8d89c81..b0ff7e633dd 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -51,7 +51,7 @@ else if(istype(target,/mob/living)) var/mob/living/M = target if(M.stat>1) return - if(chassis.occupant.a_intent == "hurt") + if(chassis.occupant.a_intent == I_HURT) M.take_overall_damage(dam_force) M.adjustOxyLoss(round(dam_force/2)) M.updatehealth() @@ -1039,10 +1039,10 @@ else if(istype(target,/mob/living)) var/mob/living/M = target if(M.stat>1) return - if(chassis.occupant.a_intent == "hurt") + if(chassis.occupant.a_intent == I_HURT) chassis.occupant_message("\red You obliterate [target] with [src.name], leaving blood and guts everywhere.") chassis.visible_message("\red [chassis] destroys [target] in an unholy fury.") - if(chassis.occupant.a_intent == "disarm") + if(chassis.occupant.a_intent == I_DISARM) chassis.occupant_message("\red You tear [target]'s limbs off with [src.name].") chassis.visible_message("\red [chassis] rips [target]'s arms off.") else diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index b2bdadfdbeb..570aa0b777e 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -784,7 +784,7 @@ user << "There's already a powercell installed." return - else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != "hurt") + else if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != I_HURT) var/obj/item/weapon/weldingtool/WT = W if (WT.remove_fuel(0,user)) if (hasInternalDamage(MECHA_INT_TANK_BREACH)) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 0baff58a855..a39acac9c16 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -873,11 +873,11 @@ var/phrase = "I don't want to exist anymore!" /obj/structure/plushie/attack_hand(mob/user) - if(user.a_intent == "help") + if(user.a_intent == I_HELP) user.visible_message("[user] hugs [src]!","You hug [src]!") - else if (user.a_intent == "hurt") + else if (user.a_intent == I_HURT) user.visible_message("[user] punches [src]!","You punch [src]!") - else if (user.a_intent == "grab") + else if (user.a_intent == I_GRAB) user.visible_message("[user] attempts to strangle [src]!","You attempt to strangle [src]!") else user.visible_message("[user] pokes the [src].","You poke the [src].") @@ -915,11 +915,11 @@ icon_state = "nymphplushie" /obj/item/toy/plushie/attack_self(mob/user as mob) - if(user.a_intent == "help") + if(user.a_intent == I_HELP) user.visible_message("[user] hugs [src]!","You hug [src]!") - else if (user.a_intent == "hurt") + else if (user.a_intent == I_HURT) user.visible_message("[user] punches [src]!","You punch [src]!") - else if (user.a_intent == "grab") + else if (user.a_intent == I_GRAB) user.visible_message("[user] attempts to strangle [src]!","You attempt to strangle [src]!") else user.visible_message("[user] pokes the [src].","You poke the [src].") diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 42249d14358..73c14edc887 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -74,7 +74,7 @@ var/last_chew = 0 var/mob/living/carbon/human/H = A if (!H.handcuffed) return - if (H.a_intent != "hurt") return + if (H.a_intent != I_HURT) return if (H.zone_sel.selecting != "mouth") return if (H.wear_mask) return if (istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket)) return diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index 66d8c6d01b2..e27e38af7bf 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -40,7 +40,7 @@ if(!istype(M)) return ..() - if(user.a_intent != "help") + if(user.a_intent != I_HELP) if(user.zone_sel.selecting == "head" || user.zone_sel.selecting == "eyes") if((CLUMSY in user.mutations) && prob(50)) M = user diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm index 8791ea10753..4444904c1b8 100644 --- a/code/game/objects/items/weapons/policetape.dm +++ b/code/game/objects/items/weapons/policetape.dm @@ -125,7 +125,7 @@ breaktape(W, user) /obj/item/tape/attack_hand(mob/user as mob) - if (user.a_intent == "help" && src.allowed(user)) + if (user.a_intent == I_HELP && src.allowed(user)) user.show_viewers("\blue [user] lifts [src], allowing passage.") crumple() lifted = 1 @@ -137,7 +137,7 @@ /obj/item/tape/proc/breaktape(obj/item/weapon/W as obj, mob/user as mob) - if(user.a_intent == "help" && ((!can_puncture(W) && src.allowed(user)))) + if(user.a_intent == I_HELP && ((!can_puncture(W) && src.allowed(user)))) user << "You can't break the [src] with that!" return user.show_viewers("\blue [user] breaks the [src]!") diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 62890d849ce..bd34960a353 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -113,7 +113,7 @@ var/mob/living/L = M var/target_zone = check_zone(user.zone_sel.selecting) - if(user.a_intent == "hurt") + if(user.a_intent == I_HURT) if (!..()) //item/attack() does it's own messaging and logs return 0 // item/attack() will return 1 if they hit, 0 if they missed. agony *= 0.5 //whacking someone causes a much poorer contact than prodding them. diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index e7d46bc68ea..d466c65afad 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -41,7 +41,7 @@ log_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])") */ - if (user.a_intent == "hurt") + if (user.a_intent == I_HURT) if(!..()) return //playsound(src.loc, "swing_hit", 50, 1, -1) if (M.stuttering < 8 && (!(HULK in M.mutations)) /*&& (!istype(H:wear_suit, /obj/item/clothing/suit/judgerobe))*/) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index ee56415be77..5b23e90a019 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -460,7 +460,7 @@ var/datum/organ/external/S = M:organs_by_name[user.zone_sel.selecting] if (!S) return - if(!(S.status & ORGAN_ROBOT) || user.a_intent != "help") + if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP) return ..() if(istype(M,/mob/living/carbon/human)) diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index f3ae3185508..81d7f31cdb9 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -137,10 +137,10 @@ ..() if(!buckled_mob) return - if(propelled || (pulling && (pulling.a_intent == "hurt"))) + if(propelled || (pulling && (pulling.a_intent == I_HURT))) var/mob/living/occupant = unbuckle_mob() - if (pulling && (pulling.a_intent == "hurt")) + if (pulling && (pulling.a_intent == I_HURT)) occupant.throw_at(A, 3, 3, pulling) else if (propelled) occupant.throw_at(A, 3, propelled) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 64ef0c8fad2..6b857ae4cf3 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -363,7 +363,7 @@ if (istype(G.affecting, /mob/living)) var/mob/living/M = G.affecting if (G.state < 2) - if(user.a_intent == "hurt") + if(user.a_intent == I_HURT) if (prob(15)) M.Weaken(5) M.apply_damage(8,def_zone = "head") visible_message("[G.assailant] slams [G.affecting]'s face against \the [src]!") diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index f51716d0d11..fd96873b7ac 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -180,7 +180,7 @@ user.visible_message("[user] smashes through [src]!") shatter() - else if (usr.a_intent == "hurt") + else if (usr.a_intent == I_HURT) if (istype(usr,/mob/living/carbon/human)) var/mob/living/carbon/human/H = usr diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 80c872bcfcc..969b872caf6 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -284,14 +284,10 @@ return 0 /turf/simulated/wall/attack_generic(var/mob/user, var/damage, var/attack_message, var/wallbreaker) - if(!damage || !wallbreaker) user << "You push the wall but nothing happens." return - if(istype(src,/turf/simulated/wall/r_wall) && !rotting) - user << "This wall is far too strong for you to destroy." - if(rotting || prob(40)) user << "You smash through the wall!" spawn(1) dismantle_wall(1) diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm index 5eddfc8b71c..497371eb5f6 100644 --- a/code/game/turfs/simulated/walls_reinforced.dm +++ b/code/game/turfs/simulated/walls_reinforced.dm @@ -18,6 +18,13 @@ rotting_destroy_touch = 0 rotting_touch_message = "\blue This wall feels rather unstable." +/turf/simulated/wall/r_wall/attack_generic(var/mob/user, var/damage, var/attack_message, var/wallbreaker) + if(!rotting && wallbreaker < 2) + user << "You push the wall but nothing happens." + return + + return ..() + /turf/simulated/wall/r_wall/attackby(obj/item/W as obj, mob/user as mob) if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index c57633678a3..00487ed60ac 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -182,7 +182,7 @@ icons.Add(usr.zone_sel) for(var/obj/screen/I in icons) - if(I.name in list("help", "harm", "disarm", "grab")) continue + if(I.name in list(I_HELP, I_HURT, I_DISARM, I_GRAB)) continue I.icon = ui_style2icon(UI_style_new) I.color = UI_style_color_new I.alpha = UI_style_alpha_new diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index e1c9a25c248..f606c846703 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -68,7 +68,7 @@ /obj/item/clothing/accessory/stethoscope/attack(mob/living/carbon/human/M, mob/living/user) if(ishuman(M) && isliving(user)) - if(user.a_intent == "help") + if(user.a_intent == I_HELP) var/body_part = parse_zone(user.zone_sel.selecting) if(body_part) var/their = "their" diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm index d87925534a9..f02ae38a5ab 100644 --- a/code/modules/clothing/under/accessories/holster.dm +++ b/code/modules/clothing/under/accessories/holster.dm @@ -29,7 +29,7 @@ if(istype(user.get_active_hand(),/obj) && istype(user.get_inactive_hand(),/obj)) user << "You need an empty hand to draw \the [holstered]!" else - if(user.a_intent == "hurt") + if(user.a_intent == I_HURT) usr.visible_message( "\red [user] draws \the [holstered], ready to shoot!", "You draw \the [holstered], ready to shoot!" diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index 460f4422fbe..60f0ba4a0a8 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -401,13 +401,13 @@ faction = "neutral" melee_damage_lower = 0 melee_damage_upper = 0 - wall_smash = 0 + environment_smash = 0 destroy_surroundings = 0 else faction = "carp" melee_damage_lower = initial(melee_damage_lower) melee_damage_upper = initial(melee_damage_upper) - wall_smash = initial(wall_smash) + environment_smash = initial(environment_smash) destroy_surroundings = initial(destroy_surroundings) /mob/living/simple_animal/hostile/carp/holodeck/gib() diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 2598e5e4d00..9ca784070d6 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -226,7 +226,7 @@ if(user == M) return ..() - if(user.a_intent == "hurt") + if(user.a_intent == I_HURT) // This is being copypasted here because reagent_containers (WHY DOES FOOD DESCEND FROM THAT) overrides it completely. // TODO: refactor all food paths to be less horrible and difficult to work with in this respect. ~Z @@ -291,7 +291,7 @@ if(istype(user.loc,/turf/space)) return - if(user.a_intent == "hurt") + if(user.a_intent == I_HURT) user.visible_message("\The [user] squashes \the [src]!") seed.thrown_at(src,user) sleep(-1) diff --git a/code/modules/mob/language/outsider.dm b/code/modules/mob/language/outsider.dm index c03cb9a9d1b..1745718464f 100644 --- a/code/modules/mob/language/outsider.dm +++ b/code/modules/mob/language/outsider.dm @@ -82,3 +82,30 @@ /datum/language/vox/get_random_name() return ..(FEMALE,1,6) + +/datum/language/cultcommon + name = "Cult" + desc = "The chants of the occult, the incomprehensible." + speech_verb = "intones" + ask_verb = "intones" + exclaim_verb = "chants" + colour = "cult" + key = "n" + flags = RESTRICTED + space_chance = 100 + syllables = list("ire","ego","nahlizet","certum","veri","jatkaa","mgar","balaq", "karazet", "geeri", \ + "orkan", "allaq", "sas'so", "c'arta", "forbici", "tarem", "n'ath", "reth", "sh'yro", "eth", "d'raggathnor", \ + "mah'weyh", "pleggh", "at", "e'ntrath", "tok-lyr", "rqa'nap", "g'lt-ulotf", "ta'gh", "fara'qha", "fel", "d'amar det", \ + "yu'gular", "faras", "desdae", "havas", "mithum", "javara", "umathar", "uf'kal", "thenar", "rash'tla", \ + "sektath mal'zua", "zasan", "therium", "viortia", "kla'atu", "barada", "nikt'o", "fwe'sh", "mah", "erl", "nyag", "r'ya", \ + "gal'h'rfikk", "harfrandid", "mud'gib") + +/datum/language/cult + name = "Occult" + desc = "The initiated can share their thoughts, by means defying reason." + speech_verb = "intones" + ask_verb = "intones" + exclaim_verb = "chants" + colour = "cult" + key = "m" + flags = RESTRICTED | HIVEMIND diff --git a/code/modules/mob/living/carbon/alien/alien_attacks.dm b/code/modules/mob/living/carbon/alien/alien_attacks.dm index 4285f91c3f6..62768945a36 100644 --- a/code/modules/mob/living/carbon/alien/alien_attacks.dm +++ b/code/modules/mob/living/carbon/alien/alien_attacks.dm @@ -20,10 +20,10 @@ switch(M.a_intent) - if ("help") + if (I_HELP) help_shake_act(M) - if ("grab") + if (I_GRAB) if (M == src) return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src ) diff --git a/code/modules/mob/living/carbon/alien/diona/diona_attacks.dm b/code/modules/mob/living/carbon/alien/diona/diona_attacks.dm index a379af21c76..58aba691dda 100644 --- a/code/modules/mob/living/carbon/alien/diona/diona_attacks.dm +++ b/code/modules/mob/living/carbon/alien/diona/diona_attacks.dm @@ -2,7 +2,7 @@ if(istype(M)) //Let people pick the little buggers up. - if(M.a_intent == "help") + if(M.a_intent == I_HELP) if(M.species && M.species.name == "Diona") M << "You feel your being twine with that of [src] as it merges with your biomass." src << "You feel your being twine with that of [M] as you merge with its biomass." diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 6e59b4be663..72b7c5dbcb5 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -442,102 +442,12 @@ if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes") usr.sleeping = 20 //Short nap -/mob/living/carbon/Bump(atom/movable/AM as mob|obj, yes) - - spawn( 0 ) - if ((!( yes ) || now_pushing)) - return - now_pushing = 1 - if(ismob(AM)) - var/mob/tmob = AM - - if( istype(tmob, /mob/living/carbon) && prob(10) ) - src.spread_disease_to(AM, "Contact") - - if(istype(tmob, /mob/living/carbon/human)) - - if(HULK in tmob.mutations) - if(prob(70)) - usr << "\red You fail to push [tmob]'s fat ass out of the way." - now_pushing = 0 - return - if(!(tmob.status_flags & CANPUSH)) - now_pushing = 0 - return - - for(var/mob/M in range(tmob, 1)) - if(tmob.pinned.len || ((M.pulling == tmob && ( tmob.restrained() && !( M.restrained() ) && M.stat == 0)) || locate(/obj/item/weapon/grab, tmob.grabbed_by.len)) ) - if ( !(world.time % 5) ) - src << "\red [tmob] is restrained, you cannot push past" - now_pushing = 0 - return - if( tmob.pulling == M && ( M.restrained() && !( tmob.restrained() ) && tmob.stat == 0) ) - if ( !(world.time % 5) ) - src << "\red [tmob] is restraining [M], you cannot push past" - now_pushing = 0 - return - - //Leaping mobs just land on the tile, no pushing, no anything. - if(status_flags & LEAPING) - loc = tmob.loc - status_flags &= ~LEAPING - now_pushing = 0 - return - - // Step over drones. - // I have no idea why the hell this isn't already happening. How do mice do it? - if(istype(tmob,/mob/living/silicon/robot/drone)) - loc = tmob.loc - now_pushing = 0 - return - - if((tmob.a_intent == "help" || tmob.restrained()) && (a_intent == "help" || src.restrained()) && tmob.canmove && !tmob.buckled && canmove) // mutual brohugs all around! - var/turf/oldloc = loc - loc = tmob.loc - tmob.loc = oldloc - now_pushing = 0 - for(var/mob/living/carbon/slime/slime in view(1,tmob)) - if(slime.Victim == tmob) - slime.UpdateFeed() - return - - if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) - if(prob(40) && !(FAT in src.mutations)) - src << "\red You fail to push [tmob]'s fat ass out of the way." - now_pushing = 0 - return - if(tmob.r_hand && istype(tmob.r_hand, /obj/item/weapon/shield/riot)) - if(prob(99)) - now_pushing = 0 - return - if(tmob.l_hand && istype(tmob.l_hand, /obj/item/weapon/shield/riot)) - if(prob(99)) - now_pushing = 0 - return - if(!(tmob.status_flags & CANPUSH)) - now_pushing = 0 - return - - tmob.LAssailant = src - - now_pushing = 0 - ..() - if (!( istype(AM, /atom/movable) )) - return - if (!( now_pushing )) - now_pushing = 1 - if (!( AM.anchored )) - var/t = get_dir(src, AM) - if (istype(AM, /obj/structure/window)) - var/obj/structure/window/W = AM - if(W.is_full_window()) - for(var/obj/structure/window/win in get_step(AM,t)) - now_pushing = 0 - return - step(AM, t) - now_pushing = 0 +/mob/living/carbon/Bump(var/atom/movable/AM, yes) + if(now_pushing || !yes) return - return + ..() + if(istype(AM, /mob/living/carbon) && prob(10)) + src.spread_disease_to(AM, "Contact") /mob/living/carbon/can_use_vents() return diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index fd8be289e9f..e2a318339f6 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1166,6 +1166,10 @@ else return 0 + mob_bump_flag = species.bump_flag + mob_swap_flags = species.swap_flags + mob_push_flags = species.push_flags + /mob/living/carbon/human/proc/bloody_doodle() set category = "IC" set name = "Write in blood" diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 23f90946bcd..82c03a181f6 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -45,7 +45,7 @@ M.spread_disease_to(src, "Contact") switch(M.a_intent) - if("help") + if(I_HELP) if(istype(H) && health < config.health_threshold_crit) @@ -69,7 +69,7 @@ help_shake_act(M) return 1 - if("grab") + if(I_GRAB) if(M == src || anchored) return 0 if(w_uniform) @@ -88,7 +88,7 @@ visible_message("[M] has grabbed [src] passively!") return 1 - if("hurt") + if(I_HURT) if(!istype(H)) attack_generic(H,rand(1,3),"punched") @@ -101,11 +101,11 @@ var/datum/organ/external/affecting = get_organ(hit_zone) switch(src.a_intent) - if("help") + if(I_HELP) // We didn't see this coming, so we get the full blow rand_damage = 5 accurate = 1 - if("hurt", "grab") + if(I_HURT, I_GRAB) // We're in a fighting stance, there's a chance we block if(src.canmove && src!=H && prob(20)) block = 1 @@ -200,7 +200,7 @@ // Finally, apply damage to target apply_damage(real_damage, BRUTE, affecting, armour, sharp=attack.sharp, edge=attack.edge) - if("disarm") + if(I_DISARM) M.attack_log += text("\[[time_stamp()]\] Disarmed [src.name] ([src.ckey])") src.attack_log += text("\[[time_stamp()]\] Has been disarmed by [M.name] ([M.ckey])") diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 064819b2cd8..4546fab0507 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -82,3 +82,7 @@ var/hand_blood_color var/list/flavor_texts = list() + + mob_bump_flag = HUMAN + mob_push_flags = ALLMOBS + mob_swap_flags = ALLMOBS diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 90ff22cab0b..ea03c44e45d 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -115,6 +115,11 @@ "eyes" = /datum/organ/internal/eyes ) + // Bump vars + var/bump_flag = HUMAN // What are we considered to be when bumped? + var/push_flags = ALLMOBS // What can we push? + var/swap_flags = ALLMOBS // What can we swap place with? + /datum/species/New() if(hud_type) hud = new hud_type() @@ -250,7 +255,7 @@ // Called when using the shredding behavior. /datum/species/proc/can_shred(var/mob/living/carbon/human/H, var/ignore_intent) - if(!ignore_intent && H.a_intent != "hurt") + if(!ignore_intent && H.a_intent != I_HURT) return 0 for(var/datum/unarmed_attack/attack in unarmed_attacks) diff --git a/code/modules/mob/living/carbon/human/species/station/monkey.dm b/code/modules/mob/living/carbon/human/species/station/monkey.dm index 4f00eaea20a..0166900a0fb 100644 --- a/code/modules/mob/living/carbon/human/species/station/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/station/monkey.dm @@ -33,6 +33,10 @@ flags = IS_RESTRICTED + bump_flag = MONKEY + swap_flags = MONKEY|SLIME|SIMPLE_ANIMAL + push_flags = MONKEY|SLIME|SIMPLE_ANIMAL|ALIEN + /datum/species/monkey/handle_npc(var/mob/living/carbon/human/H) if(H.stat != CONSCIOUS) return @@ -44,6 +48,7 @@ /datum/species/monkey/handle_post_spawn(var/mob/living/carbon/human/H) H.real_name = "[lowertext(name)] ([rand(100,999)])" H.name = H.real_name + ..() /datum/species/monkey/tajaran diff --git a/code/modules/mob/living/carbon/human/species/station/slime.dm b/code/modules/mob/living/carbon/human/species/station/slime.dm index 83af39876a6..0e148b02369 100644 --- a/code/modules/mob/living/carbon/human/species/station/slime.dm +++ b/code/modules/mob/living/carbon/human/species/station/slime.dm @@ -25,7 +25,11 @@ breath_type = null poison_type = null + bump_flag = SLIME + swap_flags = MONKEY|SLIME|SIMPLE_ANIMAL + push_flags = MONKEY|SLIME|SIMPLE_ANIMAL + /datum/species/slime/handle_death(var/mob/living/carbon/human/H) spawn(1) if(H) - H.gib() \ No newline at end of file + H.gib() diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm index a854d0e6db6..4265f1b39a9 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm @@ -52,6 +52,10 @@ "nutrient vessel" = /datum/organ/internal/diona/nutrients ) + bump_flag = ALIEN + swap_flags = ALLMOBS + push_flags = ALLMOBS ^ ROBOT + var/alien_number = 0 var/caste_name = "creature" // Used to update alien name. var/weeds_heal_rate = 1 // Health regen on weeds. diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index ce7bdad6f63..f122830c76f 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -304,7 +304,7 @@ if(Target.Adjacent(src)) if(istype(Target, /mob/living/silicon)) // Glomp the silicons if(!Atkcool) - a_intent = "hurt" + a_intent = I_HURT UnarmedAttack(Target) Atkcool = 1 spawn(45) @@ -318,12 +318,12 @@ spawn(45) Atkcool = 0 - a_intent = "disarm" + a_intent = I_DISARM UnarmedAttack(Target) else if(!Atkcool) - a_intent = "grab" + a_intent = I_GRAB UnarmedAttack(Target) else if(Target in view(7, src)) @@ -341,9 +341,9 @@ frenemy = S if (frenemy && prob(1)) if (frenemy.colour == colour) - a_intent = "help" + a_intent = I_HELP else - a_intent = "hurt" + a_intent = I_HURT UnarmedAttack(frenemy) var/sleeptime = movement_delay() @@ -355,10 +355,10 @@ /mob/living/carbon/slime/proc/handle_speech_and_mood() //Mood starts here var/newmood = "" - a_intent = "help" + a_intent = I_HELP if (rabid || attacked) newmood = "angry" - a_intent = "hurt" + a_intent = I_HURT else if (Target) newmood = "mischevous" if (!newmood) diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index d6c8c226c41..0e2a237372a 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -285,10 +285,10 @@ switch(M.a_intent) - if ("help") + if (I_HELP) help_shake_act(M) - if ("grab") + if (I_GRAB) if (M == src || anchored) return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 3f54916bb84..df6d4130b87 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -20,6 +20,122 @@ usr.visible_message("[src] points to [A]") return 1 +/*one proc, four uses +swapping: if it's 1, the mobs are trying to switch, if 0, non-passive is pushing passive +default behaviour is: + - non-passive mob passes the passive version + - passive mob checks to see if its mob_bump_flag is in the non-passive's mob_bump_flags + - if si, the proc returns +*/ +/mob/living/proc/can_move_mob(var/mob/living/swapped, swapping = 0, passive = 0) + if(!swapped) + return 1 + if(!passive) + return swapped.can_move_mob(src, swapping, 1) + else + var/context_flags = 0 + if(swapping) + context_flags = swapped.mob_swap_flags + else + context_flags = swapped.mob_push_flags + if(!mob_bump_flag) //nothing defined, go wild + return 1 + if(mob_bump_flag & context_flags) + return 1 + return 0 + +/mob/living/Bump(atom/movable/AM, yes) + spawn(0) + if ((!( yes ) || now_pushing) || !loc) + return + now_pushing = 1 + if (istype(AM, /mob/living)) + var/mob/living/tmob = AM + + for(var/mob/living/M in range(tmob, 1)) + if(tmob.pinned.len || ((M.pulling == tmob && ( tmob.restrained() && !( M.restrained() ) && M.stat == 0)) || locate(/obj/item/weapon/grab, tmob.grabbed_by.len)) ) + if ( !(world.time % 5) ) + src << "[tmob] is restrained, you cannot push past" + now_pushing = 0 + return + if( tmob.pulling == M && ( M.restrained() && !( tmob.restrained() ) && tmob.stat == 0) ) + if ( !(world.time % 5) ) + src << "[tmob] is restraining [M], you cannot push past" + now_pushing = 0 + return + + //BubbleWrap: people in handcuffs are always switched around as if they were on 'help' intent to prevent a person being pulled from being seperated from their puller + var/dense = 0 + if(loc.density) + dense = 1 + for(var/atom/movable/A in loc) + if(A == src) + continue + if(A.density) + if(A.flags&ON_BORDER) + dense = !A.CanPass(src, src.loc) + else + dense = 1 + if(dense) break + + //Leaping mobs just land on the tile, no pushing, no anything. + if(status_flags & LEAPING) + loc = tmob.loc + status_flags &= ~LEAPING + now_pushing = 0 + return + + if((tmob.mob_always_swap || (tmob.a_intent == I_HELP || tmob.restrained()) && (a_intent == I_HELP || src.restrained())) && tmob.canmove && canmove && !dense && can_move_mob(tmob, 1, 0)) // mutual brohugs all around! + var/turf/oldloc = loc + loc = tmob.loc + tmob.loc = oldloc + now_pushing = 0 + for(var/mob/living/carbon/slime/slime in view(1,tmob)) + if(slime.Victim == tmob) + slime.UpdateFeed() + return + + if(!can_move_mob(tmob, 0, 0)) + now_pushing = 0 + return + if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) + if(prob(40) && !(FAT in src.mutations)) + src << "You fail to push [tmob]'s fat ass out of the way." + now_pushing = 0 + return + if(tmob.r_hand && istype(tmob.r_hand, /obj/item/weapon/shield/riot)) + if(prob(99)) + now_pushing = 0 + return + if(tmob.l_hand && istype(tmob.l_hand, /obj/item/weapon/shield/riot)) + if(prob(99)) + now_pushing = 0 + return + if(!(tmob.status_flags & CANPUSH)) + now_pushing = 0 + return + + tmob.LAssailant = src + + now_pushing = 0 + spawn(0) + ..() + if (!istype(AM, /atom/movable)) + return + if (!now_pushing) + now_pushing = 1 + + if (!AM.anchored) + var/t = get_dir(src, AM) + if (istype(AM, /obj/structure/window)) + for(var/obj/structure/window/win in get_step(AM,t)) + now_pushing = 0 + return + step(AM, t) + now_pushing = 0 + return + return + /mob/living/verb/succumb() set hidden = 1 if ((src.health < 0 && src.health > -95.0)) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 9998a08feb4..3771bc135e7 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -20,7 +20,6 @@ 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. //Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects. @@ -32,6 +31,10 @@ var/t_n2 = null var/now_pushing = null + var/mob_bump_flag = 0 + var/mob_swap_flags = 0 + var/mob_push_flags = 0 + var/mob_always_swap = 0 var/mob/living/cameraFollow = null diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 622ee23bc7b..6600ebf9c06 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -80,6 +80,11 @@ proc/get_radio_key_from_channel(var/channel) if(dongle.translate_binary) return 1 /mob/living/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/italics=0, var/message_range = world.view, var/sound/speech_sound, var/sound_vol) + if(stat) + return + + if(!message) + return var/turf/T = get_turf(src) diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 9aa8ef25bee..4e7d3fb5f87 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -16,6 +16,11 @@ integrated_light_power = 2 local_transmit = 1 + mob_bump_flag = SIMPLE_ANIMAL + mob_swap_flags = SIMPLE_ANIMAL + mob_push_flags = SIMPLE_ANIMAL + mob_always_swap = 1 + //Used for self-mailing. var/mail_destination = "" @@ -255,20 +260,6 @@ src << "Don't invade their worksites, don't steal their resources, don't tell them about the changeling in the toilets." src << "If a crewmember has noticed you, you are probably breaking your third law." -/mob/living/silicon/robot/drone/Bump(atom/movable/AM as mob|obj, yes) - if (!yes || ( \ - !istype(AM,/obj/machinery/door) && \ - !istype(AM,/obj/machinery/recharge_station) && \ - !istype(AM,/obj/machinery/disposal/deliveryChute) && \ - !istype(AM,/obj/machinery/teleport/hub) && \ - !istype(AM,/obj/effect/portal) - )) return - ..() - return - -/mob/living/silicon/robot/drone/Bumped(AM as mob|obj) - return - /mob/living/silicon/robot/drone/start_pulling(var/atom/movable/AM) if(istype(AM,/obj/item/pipe) || istype(AM,/obj/structure/disposalconstruct)) diff --git a/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm b/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm index 55cb1376b60..e5778ad4dc5 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm @@ -24,6 +24,6 @@ //Actual picking-up event. /mob/living/silicon/robot/drone/attack_hand(mob/living/carbon/human/M as mob) - if(M.a_intent == "help") + if(M.a_intent == I_HELP) get_scooped(M) ..() \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 7c0d3dd85d4..4afae6c1eef 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -8,6 +8,10 @@ maxHealth = 200 health = 200 + mob_bump_flag = ROBOT + mob_swap_flags = ROBOT|MONKEY|SLIME|SIMPLE_ANIMAL + mob_push_flags = ALLMOBS //trundle trundle + var/lights_on = 0 // Is our integrated light on? var/used_power_this_tick = 0 var/sight_mode = 0 @@ -573,43 +577,6 @@ if(prob(75) && Proj.damage > 0) spark_system.start() return 2 -/mob/living/silicon/robot/Bump(atom/movable/AM as mob|obj, yes) - spawn( 0 ) - if ((!( yes ) || now_pushing)) - return - now_pushing = 1 - if(ismob(AM)) - var/mob/tmob = AM - if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) - if(prob(20)) - usr << "\red You fail to push [tmob]'s fat ass out of the way." - now_pushing = 0 - return - if(!(tmob.status_flags & CANPUSH)) - now_pushing = 0 - return - now_pushing = 0 - ..() - if (istype(AM, /obj/machinery/recharge_station)) - var/obj/machinery/recharge_station/F = AM - F.move_inside() - if (!istype(AM, /atom/movable)) - return - if (!now_pushing) - now_pushing = 1 - if (!AM.anchored) - var/t = get_dir(src, AM) - if (istype(AM, /obj/structure/window)) - var/obj/structure/window/W = AM - if(W.is_full_window()) - for(var/obj/structure/window/win in get_step(AM,t)) - now_pushing = 0 - return - step(AM, t) - now_pushing = null - return - return - /mob/living/silicon/robot/attackby(obj/item/weapon/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/handcuffs)) // fuck i don't even know why isrobot() in handcuff code isn't working so this will have to do return diff --git a/code/modules/mob/living/simple_animal/borer/borer.dm b/code/modules/mob/living/simple_animal/borer/borer.dm index 9c2e9ca7706..0ca5e36828a 100644 --- a/code/modules/mob/living/simple_animal/borer/borer.dm +++ b/code/modules/mob/living/simple_animal/borer/borer.dm @@ -11,7 +11,7 @@ icon_living = "brainslug" icon_dead = "brainslug_dead" speed = 5 - a_intent = "harm" + a_intent = I_HURT stop_automated_movement = 1 status_flags = CANPUSH attacktext = "nipped" diff --git a/code/modules/mob/living/simple_animal/constructs/constructs.dm b/code/modules/mob/living/simple_animal/constructs/constructs.dm index 23718fb8836..12d868e1106 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs.dm @@ -10,10 +10,11 @@ response_harm = "punches" icon_dead = "shade_dead" speed = -1 - a_intent = "harm" + a_intent = I_HURT stop_automated_movement = 1 status_flags = CANPUSH - universal_speak = 1 + universal_speak = 0 + universal_understand = 1 attack_sound = 'sound/weapons/punch1.ogg' min_oxy = 0 max_oxy = 0 @@ -24,15 +25,25 @@ min_n2 = 0 max_n2 = 0 minbodytemp = 0 + show_stat_health = 0 faction = "cult" + supernatural = 1 + var/nullblock = 0 + + mob_swap_flags = HUMAN|SIMPLE_ANIMAL|SLIME|MONKEY + mob_push_flags = ALLMOBS + var/list/construct_spells = list() /mob/living/simple_animal/construct/New() ..() name = text("[initial(name)] ([rand(1, 1000)])") real_name = name + add_language("Cult") + add_language("Occult") for(var/spell in construct_spells) spell_list += new spell(src) + updateicon() /mob/living/simple_animal/construct/death() new /obj/item/weapon/ectoplasm (src.loc) @@ -40,12 +51,11 @@ ghostize() del src - /mob/living/simple_animal/construct/attack_generic(var/mob/user) if(istype(user, /mob/living/simple_animal/construct/builder)) if(health < maxHealth) adjustBruteLoss(-5) - user.visible_message("\The [user] mends some of \the [src]'s wounds.") + user.visible_message("\The [user] mends some of \the [src]'s wounds.") else user << "\The [src] is undamaged." return @@ -53,7 +63,7 @@ /mob/living/simple_animal/construct/examine(mob/user) ..(user) - var/msg = "" + var/msg = "*---------*\nThis is \icon[src] \a [src]!\n" if (src.health < src.maxHealth) msg += "" if (src.health >= src.maxHealth/2) @@ -64,54 +74,12 @@ msg += "*---------*" user << msg - return - -/mob/living/simple_animal/construct/Bump(atom/movable/AM as mob|obj, yes) - if ((!( yes ) || now_pushing)) - return - now_pushing = 1 - if(ismob(AM)) - var/mob/tmob = AM - if(!(tmob.status_flags & CANPUSH)) - now_pushing = 0 - return - - tmob.LAssailant = src - now_pushing = 0 - ..() - if (!istype(AM, /atom/movable)) - return - if (!( now_pushing )) - now_pushing = 1 - if (!( AM.anchored )) - var/t = get_dir(src, AM) - if (istype(AM, /obj/structure/window)) - var/obj/structure/window/W = AM - if(W.is_full_window()) - for(var/obj/structure/window/win in get_step(AM,t)) - now_pushing = 0 - return - step(AM, t) - now_pushing = null - -/mob/living/simple_animal/construct/attackby(var/obj/item/O as obj, var/mob/user as mob) - if(O.force) - var/damage = O.force - if (O.damtype == HALLOSS) - damage = 0 - adjustBruteLoss(damage) - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red \b [src] has been attacked with [O] by [user]. ") - else - usr << "\red This weapon is ineffective, it does no damage." - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red [user] gently taps [src] with [O]. ") - /////////////////Juggernaut/////////////// + + + /mob/living/simple_animal/construct/armoured name = "Juggernaut" real_name = "Juggernaut" @@ -128,32 +96,12 @@ attacktext = "smashed their armoured gauntlet into" mob_size = 20 speed = 3 - wall_smash = 1 + environment_smash = 2 attack_sound = 'sound/weapons/punch3.ogg' status_flags = 0 + resistance = 10 construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/lesserforcewall) -/mob/living/simple_animal/construct/armoured/attackby(var/obj/item/O as obj, var/mob/user as mob) - if(O.force) - if(O.force >= 11) - var/damage = O.force - if (O.damtype == HALLOSS) - damage = 0 - adjustBruteLoss(damage) - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red \b [src] has been attacked with [O] by [user]. ") - else - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red \b [O] bounces harmlessly off of [src]. ") - else - usr << "\red This weapon is ineffective, it does no damage." - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red [user] gently taps [src] with [O]. ") - - /mob/living/simple_animal/construct/armoured/Life() weakened = 0 ..() @@ -163,8 +111,8 @@ var/reflectchance = 80 - round(P.damage/3) if(prob(reflectchance)) adjustBruteLoss(P.damage * 0.5) - visible_message("\The [P] was reflected by \the [src]'s shell!", \ - "\The [P] was reflected by \the [src]'s shell!") + visible_message("The [P.name] gets reflected by [src]'s shell!", \ + "The [P.name] gets reflected by [src]'s shell!") // Find a turf near or on the original location to bounce to if(P.starting) @@ -198,12 +146,12 @@ melee_damage_upper = 25 attacktext = "slashed" speed = -1 + environment_smash = 1 see_in_dark = 7 attack_sound = 'sound/weapons/bladeslice.ogg' construct_spells = list(/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift) - /////////////////////////////Artificer///////////////////////// @@ -223,7 +171,7 @@ melee_damage_upper = 5 attacktext = "rammed" speed = 0 - wall_smash = 1 + environment_smash = 2 attack_sound = 'sound/weapons/punch2.ogg' construct_spells = list(/obj/effect/proc_holder/spell/aoe_turf/conjure/construct/lesser, /obj/effect/proc_holder/spell/aoe_turf/conjure/wall, @@ -250,60 +198,35 @@ melee_damage_upper = 50 attacktext = "brutally crushed" speed = 5 - wall_smash = 1 + environment_smash = 2 attack_sound = 'sound/weapons/punch4.ogg' - mob_size = 20 + resistance = 10 var/energy = 0 var/max_energy = 1000 -/mob/living/simple_animal/construct/behemoth/attackby(var/obj/item/O as obj, var/mob/user as mob) - if(O.force) - if(O.force >= 11) - var/damage = O.force - if (O.damtype == HALLOSS) - damage = 0 - adjustBruteLoss(damage) - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red \b [src] has been attacked with [O] by [user]. ") - else - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red \b [O] bounces harmlessly off of [src]. ") - else - usr << "\red This weapon is ineffective, it does no damage." - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red [user] gently taps [src] with [O]. ") +////////////////////////Harvester//////////////////////////////// -////////////////Powers////////////////// +/mob/living/simple_animal/construct/harvester + name = "Harvester" + real_name = "Harvester" + desc = "The promised reward of the livings who follow narsie. Obtained by offering their bodies to the geometer of blood" + icon = 'icons/mob/mob.dmi' + icon_state = "harvester" + icon_living = "harvester" + maxHealth = 150 + health = 150 + melee_damage_lower = 25 + melee_damage_upper = 25 + attacktext = "violently stabs" + speed = -1 + environment_smash = 1 + see_in_dark = 7 + attack_sound = 'sound/weapons/pierce.ogg' - -/* -/client/proc/summon_cultist() - set category = "Behemoth" - set name = "Summon Cultist (300)" - set desc = "Teleport a cultist to your location" - if (istype(usr,/mob/living/simple_animal/constructbehemoth)) - - if(usr.energy<300) - usr << "\red You do not have enough power stored!" - return - - if(usr.stat) - return - - usr.energy -= 300 - var/list/mob/living/cultists = new - for(var/datum/mind/H in ticker.mode.cult) - if (istype(H.current,/mob/living)) - cultists+=H.current - var/mob/cultist = input("Choose the one who you want to summon", "Followers of Geometer") as null|anything in (cultists - usr) - if(!cultist) - return - if (cultist == usr) //just to be sure. - return - cultist.loc = usr.loc - usr.visible_message("/red [cultist] appears in a flash of red light as [usr] glows with power")*/ + construct_spells = list( + //spell/targeted/harvest, + //spell/aoe_turf/knock/harvester, + //spell/rune_write + ) diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index a71360d4bfa..4e72bf55c0f 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -103,7 +103,7 @@ /mob/living/simple_animal/cat/attack_hand(mob/living/carbon/human/M as mob) . = ..() - if(M.a_intent == "hurt") + if(M.a_intent == I_HURT) set_flee_target(M) /mob/living/simple_animal/cat/ex_act() diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 89a824f61f7..322d08dc9ff 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -24,241 +24,6 @@ var/obj/item/inventory_back var/facehugger -/* -/mob/living/simple_animal/corgi/Life() - ..() - regenerate_icons() - -/mob/living/simple_animal/corgi/show_inv(mob/user as mob) - user.set_machine(src) - if(user.stat) return - - var/dat = "
Inventory of [name]

" - if(inventory_head) - dat += "
Head: [inventory_head] (Remove)" - else - dat += "
Head: Nothing" - if(inventory_back) - dat += "
Back: [inventory_back] (Remove)" - else - dat += "
Back: Nothing" - - user << browse(dat, text("window=mob[];size=325x500", name)) - onclose(user, "mob[real_name]") - return - -/mob/living/simple_animal/corgi/attackby(var/obj/item/O as obj, var/mob/user as mob) - if(inventory_head && inventory_back) - //helmet and armor = 100% protection - if( istype(inventory_head,/obj/item/clothing/head/helmet) && istype(inventory_back,/obj/item/clothing/suit/armor) ) - if( O.force ) - usr << "\red This animal is wearing too much armor. You can't cause /him any damage." - for (var/mob/M in viewers(src, null)) - M.show_message("\red \b [user] hits [src] with the [O], however [src] is too armored.") - else - usr << "\red This animal is wearing too much armor. You can't reach its skin." - for (var/mob/M in viewers(src, null)) - M.show_message("\red [user] gently taps [src] with the [O]. ") - if(prob(15)) - visible_emote("looks at [user] with [pick("an amused","an annoyed","a confused","a resentful", "a happy", "an excited")] expression on \his face") - return - ..() - -/mob/living/simple_animal/corgi/Topic(href, href_list) - if(usr.stat) return - - //Removing from inventory - if(href_list["remove_inv"]) - if(!Adjacent(usr) || !(ishuman(usr) || issmall(usr) || isrobot(usr) || isalienadult(usr))) - return - var/remove_from = href_list["remove_inv"] - switch(remove_from) - if("head") - if(inventory_head) - name = real_name - desc = initial(desc) - speak = list("YAP", "Woof!", "Bark!", "AUUUUUU") - speak_emote = list("barks", "woofs") - emote_hear = list("barks", "woofs", "yaps","pants") - emote_see = list("shakes its head", "shivers") - desc = "It's a corgi." - SetLuminosity(0) - inventory_head.loc = src.loc - inventory_head = null - else - usr << "\red There is nothing to remove from its [remove_from]." - return - if("back") - if(inventory_back) - inventory_back.loc = src.loc - inventory_back = null - else - usr << "\red There is nothing to remove from its [remove_from]." - return - - //show_inv(usr) //Commented out because changing Ian's name and then calling up his inventory opens a new inventory...which is annoying. - - //Adding things to inventory - else if(href_list["add_inv"]) - if(!Adjacent(usr) || !(ishuman(usr) || issmall(usr) || isrobot(usr) || isalienadult(usr))) - return - var/add_to = href_list["add_inv"] - if(!usr.get_active_hand()) - usr << "\red You have nothing in your hand to put on its [add_to]." - return - switch(add_to) - if("head") - if(inventory_head) - usr << "\red It's is already wearing something." - return - else - place_on_head(usr.get_active_hand()) - - var/obj/item/item_to_add = usr.get_active_hand() - if(!item_to_add) - return - - //Corgis are supposed to be simpler, so only a select few objects can actually be put - //to be compatible with them. The objects are below. - //Many hats added, Some will probably be removed, just want to see which ones are popular. - - var/list/allowed_types = list( - /obj/item/clothing/head/helmet, - /obj/item/clothing/glasses/sunglasses, - /obj/item/clothing/head/caphat, - /obj/item/clothing/head/collectable/captain, - /obj/item/clothing/head/that, - /obj/item/clothing/head/that, - /obj/item/clothing/head/kitty, - /obj/item/clothing/head/collectable/kitty, - /obj/item/clothing/head/rabbitears, - /obj/item/clothing/head/collectable/rabbitears, - /obj/item/clothing/head/beret, - /obj/item/clothing/head/collectable/beret, - /obj/item/clothing/head/det_hat, - /obj/item/clothing/head/nursehat, - /obj/item/clothing/head/pirate, - /obj/item/clothing/head/collectable/pirate, - /obj/item/clothing/head/ushanka, - /obj/item/clothing/head/chefhat, - /obj/item/clothing/head/collectable/chef, - /obj/item/clothing/head/collectable/police, - /obj/item/clothing/head/wizard/fake, - /obj/item/clothing/head/wizard, - /obj/item/clothing/head/collectable/wizard, - /obj/item/clothing/head/hardhat, - /obj/item/clothing/head/collectable/hardhat, - /obj/item/clothing/head/hardhat/white, - /obj/item/weapon/bedsheet, - /obj/item/clothing/head/helmet/space/santahat, - /obj/item/clothing/head/collectable/paper, - /obj/item/clothing/head/soft - ) - - if( ! ( item_to_add.type in allowed_types ) ) - usr << "\red It doesn't seem too keen on wearing that item." - return - - usr.drop_item() - - place_on_head(item_to_add) - - if("back") - if(inventory_back) - usr << "\red It's already wearing something." - return - else - var/obj/item/item_to_add = usr.get_active_hand() - if(!item_to_add) - return - - //Corgis are supposed to be simpler, so only a select few objects can actually be put - //to be compatible with them. The objects are below. - - var/list/allowed_types = list( - /obj/item/clothing/suit/armor/vest, - /obj/item/device/radio - ) - - if( ! ( item_to_add.type in allowed_types ) ) - usr << "\red This object won't fit." - return - - usr.drop_item() - item_to_add.loc = src - src.inventory_back = item_to_add - regenerate_icons() - - //show_inv(usr) //Commented out because changing Ian's name and then calling up his inventory opens a new inventory...which is annoying. - else - ..() - -/mob/living/simple_animal/corgi/proc/place_on_head(obj/item/item_to_add) - item_to_add.loc = src - src.inventory_head = item_to_add - regenerate_icons() - - //Various hats and items (worn on his head) change Ian's behaviour. His attributes are reset when a HAT is removed. - switch(inventory_head && inventory_head.type) - if(/obj/item/clothing/head/caphat, /obj/item/clothing/head/collectable/captain) - name = "Captain [real_name]" - desc = "Probably better than the last captain." - if(/obj/item/clothing/head/kitty, /obj/item/clothing/head/collectable/kitty) - name = "Runtime" - emote_see = list("coughs up a furball", "stretches") - emote_hear = list("purrs") - speak = list("Purrr", "Meow!", "MAOOOOOW!", "HISSSSS", "MEEEEEEW") - desc = "It's a cute little kitty-cat! ... wait ... what the hell?" - if(/obj/item/clothing/head/rabbitears, /obj/item/clothing/head/collectable/rabbitears) - name = "Hoppy" - emote_see = list("twitches its nose", "hops around a bit") - desc = "This is hoppy. It's a corgi-...urmm... bunny rabbit" - if(/obj/item/clothing/head/beret, /obj/item/clothing/head/collectable/beret) - name = "Yann" - desc = "Mon dieu! C'est un chien!" - speak = list("le woof!", "le bark!", "JAPPE!!") - emote_see = list("cowers in fear", "surrenders", "plays dead","looks as though there is a wall in front of him") - if(/obj/item/clothing/head/det_hat) - name = "Detective [real_name]" - desc = "[name] sees through your lies..." - emote_see = list("investigates the area","sniffs around for clues","searches for scooby snacks") - if(/obj/item/clothing/head/nursehat) - name = "Nurse [real_name]" - desc = "[name] needs 100cc of beef jerky...STAT!" - if(/obj/item/clothing/head/pirate, /obj/item/clothing/head/collectable/pirate) - name = "[pick("Ol'","Scurvy","Black","Rum","Gammy","Bloody","Gangrene","Death","Long-John")] [pick("kibble","leg","beard","tooth","poop-deck","Threepwood","Le Chuck","corsair","Silver","Crusoe")]" - desc = "Yaarghh!! Thar' be a scurvy dog!" - emote_see = list("hunts for treasure","stares coldly...","gnashes his tiny corgi teeth") - emote_hear = list("growls ferociously", "snarls") - speak = list("Arrrrgh!!","Grrrrrr!") - if(/obj/item/clothing/head/ushanka) - name = "[pick("Comrade","Commissar","Glorious Leader")] [real_name]" - desc = "A follower of Karl Barx." - emote_see = list("contemplates the failings of the capitalist economic model", "ponders the pros and cons of vangaurdism") - if(/obj/item/clothing/head/collectable/police) - name = "Officer [real_name]" - emote_see = list("drools","looks for donuts") - desc = "Stop right there criminal scum!" - if(/obj/item/clothing/head/wizard/fake, /obj/item/clothing/head/wizard, /obj/item/clothing/head/collectable/wizard) - name = "Grandwizard [real_name]" - speak = list("YAP", "Woof!", "Bark!", "AUUUUUU", "EI NATH!") - if(/obj/item/weapon/bedsheet) - name = "\improper Ghost" - speak = list("WoooOOOooo~","AUUUUUUUUUUUUUUUUUU") - emote_see = list("stumbles around", "shivers") - emote_hear = list("howls","groans") - desc = "Spooky!" - if(/obj/item/clothing/head/helmet/space/santahat) - name = "Rudolph the Red-Nosed Corgi" - emote_hear = list("barks christmas songs", "yaps") - desc = "He has a very shiny nose." - SetLuminosity(6) - if(/obj/item/clothing/head/soft) - name = "Corgi Tech [real_name]" - desc = "The reason your yellow gloves have chew-marks." -*/ - - //IAN! SQUEEEEEEEEE~ /mob/living/simple_animal/corgi/Ian name = "Ian" @@ -325,44 +90,6 @@ name = "Corgi meat" desc = "Tastes like... well you know..." -/mob/living/simple_animal/corgi/Ian/Bump(atom/movable/AM as mob|obj, yes) - - spawn( 0 ) - if ((!( yes ) || now_pushing)) - return - now_pushing = 1 - if(ismob(AM)) - var/mob/tmob = AM - if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) - if(prob(70)) - src << "\red You fail to push [tmob]'s fat ass out of the way." - now_pushing = 0 - return - if(!(tmob.status_flags & CANPUSH)) - now_pushing = 0 - return - - tmob.LAssailant = src - now_pushing = 0 - ..() - if (!( istype(AM, /atom/movable) )) - return - if (!( now_pushing )) - now_pushing = 1 - if (!( AM.anchored )) - var/t = get_dir(src, AM) - if (istype(AM, /obj/structure/window)) - var/obj/structure/window/W = AM - if(W.is_full_window()) - for(var/obj/structure/window/win in get_step(AM,t)) - now_pushing = 0 - return - step(AM, t) - now_pushing = null - return - return -//PC stuff-Sieve - /mob/living/simple_animal/corgi/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri if(istype(O, /obj/item/weapon/newspaper)) if(!stat) diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index ca0b4e173a9..b7e72da0c6f 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -125,7 +125,7 @@ udder.add_reagent("milk", rand(5, 10)) /mob/living/simple_animal/cow/attack_hand(mob/living/carbon/M as mob) - if(!stat && M.a_intent == "disarm" && icon_state != icon_dead) + if(!stat && M.a_intent == I_DISARM && icon_state != icon_dead) M.visible_message("[M] tips over [src].","You tip over [src].") Weaken(30) icon_state = icon_dead diff --git a/code/modules/mob/living/simple_animal/friendly/slime.dm b/code/modules/mob/living/simple_animal/friendly/slime.dm index 9674517a4ce..dab2d2e2d90 100644 --- a/code/modules/mob/living/simple_animal/friendly/slime.dm +++ b/code/modules/mob/living/simple_animal/friendly/slime.dm @@ -14,43 +14,6 @@ emote_see = list("jiggles", "bounces in place") var/colour = "grey" -/mob/living/simple_animal/slime/Bump(atom/movable/AM as mob|obj, yes) - - spawn( 0 ) - if ((!( yes ) || now_pushing)) - return - now_pushing = 1 - if(ismob(AM)) - var/mob/tmob = AM - if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations)) - if(prob(70)) - src << "\red You fail to push [tmob]'s fat ass out of the way." - now_pushing = 0 - return - if(!(tmob.status_flags & CANPUSH)) - now_pushing = 0 - return - - tmob.LAssailant = src - now_pushing = 0 - ..() - if (!( istype(AM, /atom/movable) )) - return - if (!( now_pushing )) - now_pushing = 1 - if (!( AM.anchored )) - var/t = get_dir(src, AM) - if (istype(AM, /obj/structure/window)) - var/obj/structure/window/W = AM - if(W.is_full_window()) - for(var/obj/structure/window/win in get_step(AM,t)) - now_pushing = 0 - return - step(AM, t) - now_pushing = null - return - return - /mob/living/simple_animal/adultslime name = "pet slime" desc = "A lovable, domesticated slime." diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index 447ad6b1c9c..27b43a7cc3a 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -17,7 +17,7 @@ melee_damage_lower = 25 melee_damage_upper = 25 attacktext = "slashed" - a_intent = "harm" + a_intent = I_HURT attack_sound = 'sound/weapons/bladeslice.ogg' min_oxy = 0 max_oxy = 0 @@ -29,7 +29,7 @@ max_n2 = 0 unsuitable_atoms_damage = 15 faction = "alien" - wall_smash = 1 + environment_smash = 2 status_flags = CANPUSH minbodytemp = 0 heat_damage_per_tick = 20 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm index cdaf72f6bd1..5a6a7e57688 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm @@ -13,7 +13,7 @@ speak = list("HONK", "Honk!", "Welcome to clown planet!") emote_see = list("honks") speak_chance = 1 - a_intent = "harm" + a_intent = I_HURT stop_automated_movement_when_pulled = 0 maxHealth = 75 health = 75 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm index c6d3052b5d0..872eb95b612 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm @@ -15,7 +15,7 @@ response_harm = "hits" speak = list("ALERT.","Hostile-ile-ile entities dee-twhoooo-wected.","Threat parameterszzzz- szzet.","Bring sub-sub-sub-systems uuuup to combat alert alpha-a-a.") emote_see = list("beeps menacingly","whirrs threateningly","scans its immediate vicinity") - a_intent = "harm" + a_intent = I_HURT stop_automated_movement_when_pulled = 0 health = 300 maxHealth = 300 diff --git a/code/modules/mob/living/simple_animal/hostile/russian.dm b/code/modules/mob/living/simple_animal/hostile/russian.dm index b96a615170c..84f1c6f27a8 100644 --- a/code/modules/mob/living/simple_animal/hostile/russian.dm +++ b/code/modules/mob/living/simple_animal/hostile/russian.dm @@ -18,7 +18,7 @@ melee_damage_lower = 15 melee_damage_upper = 15 attacktext = "punched" - a_intent = "harm" + a_intent = I_HURT var/corpse = /obj/effect/landmark/mobcorpse/russian var/weapon1 = /obj/item/weapon/kitchenknife min_oxy = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index c5c87014ecf..12f175cfef7 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -18,7 +18,7 @@ melee_damage_lower = 10 melee_damage_upper = 10 attacktext = "punched" - a_intent = "harm" + a_intent = I_HURT var/corpse = /obj/effect/landmark/mobcorpse/syndicatesoldier var/weapon1 var/weapon2 @@ -31,7 +31,7 @@ min_n2 = 0 max_n2 = 0 unsuitable_atoms_damage = 15 - wall_smash = 1 + environment_smash = 1 faction = "syndicate" status_flags = CANPUSH @@ -159,4 +159,4 @@ /mob/living/simple_animal/hostile/viscerator/death() ..(null,"is smashed into pieces!") - del src + del src diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 9090ab6fe62..5895c42d71e 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -215,7 +215,7 @@ /mob/living/simple_animal/parrot/attack_hand(mob/living/carbon/M as mob) ..() if(client) return - if(!stat && M.a_intent == "hurt") + if(!stat && M.a_intent == I_HURT) icon_state = "parrot_fly" //It is going to be flying regardless of whether it flees or attacks diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index c200ef6f703..98db91e7cc3 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -28,34 +28,20 @@ faction = "cult" status_flags = CANPUSH - - Life() - ..() - if(stat == 2) - new /obj/item/weapon/ectoplasm (src.loc) - for(var/mob/M in viewers(src, null)) - if((M.client && !( M.blinded ))) - M.show_message("\red [src] lets out a contented sigh as their form unwinds. ") - ghostize() - del src - return - - - attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri - if(istype(O, /obj/item/device/soulstone)) - O.transfer_soul("SHADE", src, user) - else - if(O.force) - var/damage = O.force - if (O.damtype == HALLOSS) - damage = 0 - health -= damage - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red \b [src] has been attacked with the [O] by [user]. ") - else - usr << "\red This weapon is ineffective, it does no damage." - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red [user] gently taps [src] with the [O]. ") +/mob/living/simple_animal/shade/Life() + ..() + if(stat == 2) + new /obj/item/weapon/ectoplasm (src.loc) + for(var/mob/M in viewers(src, null)) + if((M.client && !( M.blinded ))) + M.show_message("\red [src] lets out a contented sigh as their form unwinds. ") + ghostize() + del src return + + +/mob/living/simple_animal/shade/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri + if(istype(O, /obj/item/device/soulstone)) + O.transfer_soul("SHADE", src, user) + return + return ..() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 425295cd2d9..ce78d7f13f3 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -4,6 +4,12 @@ health = 20 maxHealth = 20 + mob_bump_flag = SIMPLE_ANIMAL + mob_swap_flags = MONKEY|SLIME|SIMPLE_ANIMAL + mob_push_flags = MONKEY|SLIME|SIMPLE_ANIMAL + + var/show_stat_health = 1 //does the percentage health show in the stat panel for the mob + var/icon_living = "" var/icon_dead = "" var/icon_gib = null //We only try to show a gibbing animation if this exists. @@ -52,7 +58,12 @@ var/attacktext = "attacked" var/attack_sound = null var/friendly = "nuzzles" - var/wall_smash = 0 + var/environment_smash = 0 + var/resistance = 0 // Damage reduction + + //Null rod stuff + var/supernatural = 0 + var/purge = 0 /mob/living/simple_animal/New() ..() @@ -88,6 +99,7 @@ handle_stunned() handle_weakened() handle_paralysed() + handle_supernatural() //Movement if(!client && !stop_automated_movement && wander && !anchored) @@ -186,19 +198,9 @@ adjustBruteLoss(unsuitable_atoms_damage) return 1 -/mob/living/simple_animal/Bumped(AM as mob|obj) - if(!AM) return - - if(resting || buckled) - return - - if(isturf(src.loc)) - if(ismob(AM)) - var/newamloc = src.loc - src.loc = AM:loc - AM:loc = newamloc - else - ..() +/mob/living/simple_animal/proc/handle_supernatural() + if(purge) + purge -= 1 /mob/living/simple_animal/gib() ..(icon_gib,1) @@ -225,15 +227,15 @@ switch(M.a_intent) - if("help") + if(I_HELP) if (health > 0) M.visible_message("\blue [M] [response_help] \the [src]") - if("disarm") + if(I_DISARM) M.visible_message("\blue [M] [response_disarm] \the [src]") //TODO: Push the mob away or something - if("grab") + if(I_GRAB) if (M == src) return if (!(status_flags & CANPUSH)) @@ -249,62 +251,66 @@ M.visible_message("\red [M] has grabbed [src] passively!") - if("hurt") + if(I_HURT) adjustBruteLoss(harm_intent_damage) M.visible_message("\red [M] [response_harm] \the [src]") return -/mob/living/simple_animal/attackby(var/obj/item/O, var/mob/user) //Marker -Agouri - +/mob/living/simple_animal/attackby(var/obj/item/O, var/mob/user) if(istype(O, /obj/item/stack/medical)) - - if(stat != DEAD && health < maxHealth) - var/obj/item/stack/medical/medical_pack = O - if(medical_pack.use(1)) - adjustBruteLoss(-medical_pack.heal_brute) - visible_message("\The [user] applies the [medical_pack] to \the [src].") + user.changeNext_move(4) + if(stat != DEAD) + var/obj/item/stack/medical/MED = O + if(health < maxHealth) + if(MED.amount >= 1) + adjustBruteLoss(-MED.heal_brute) + MED.amount -= 1 + if(MED.amount <= 0) + del(MED) + for(var/mob/M in viewers(src, null)) + if ((M.client && !( M.blinded ))) + M.show_message("\The [src] cannot benefit from medical items in \his current state." - return - - else if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch)) - var/actual_meat_amount = max(1,(meat_amount/2)) - if(meat_type && actual_meat_amount>0 && (stat == DEAD)) - for(var/i=0;i[user] chops up \the [src]!") - new/obj/effect/decal/cleanable/blood/splatter(get_turf(src)) - del(src) - else - user.visible_message("[user] butchers \the [src] messily!") - gib() - return - - if(O.force) - var/damage = O.force - if (O.damtype == HALLOSS) - damage = 0 - adjustBruteLoss(damage) - visible_message("\The [src] has been attacked with \the [O] by [user].") + user << "" + if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead. + if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch)) + harvest(user) else - user << "This weapon is ineffective; it does no damage." - visible_message("\The [user] gently taps [src] with the [O].") + user.changeNext_move(8) + if(O.force > resistance) + var/damage = O.force + if (O.damtype == HALLOSS) + damage = 0 + if(supernatural && istype(O,/obj/item/weapon/nullrod)) + damage *= 2 + purge = 3 + adjustBruteLoss(damage) + for(var/mob/M in viewers(src, null)) + if ((M.client && !( M.blinded ))) + M.show_message("This weapon is ineffective, it does no damage." + for(var/mob/M in viewers(src, null)) + if ((M.client && !( M.blinded ))) + M.show_message("0 && (stat == DEAD)) + for(var/i=0;i[user] chops up \the [src]!") + new/obj/effect/decal/cleanable/blood/splatter(get_turf(src)) + del(src) + else + user.visible_message("[user] butchers \the [src] messily!") + gib() diff --git a/code/modules/mob/living/simple_animal/worm.dm b/code/modules/mob/living/simple_animal/worm.dm index 0df4f5c7c42..fe76fa87b44 100644 --- a/code/modules/mob/living/simple_animal/worm.dm +++ b/code/modules/mob/living/simple_animal/worm.dm @@ -30,9 +30,9 @@ max_co2 = 0 max_tox = 0 - a_intent = "harm" //so they don't get pushed around + a_intent = I_HURT //so they don't get pushed around - wall_smash = 1 + environment_smash = 2 speed = -1 diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 47c3bb0f6cb..9b17a182aa5 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -14,6 +14,7 @@ var/obj/screen/blind = null var/obj/screen/hands = null var/obj/screen/pullin = null + var/obj/screen/purged = null var/obj/screen/internals = null var/obj/screen/oxygen = null var/obj/screen/i_select = null @@ -117,7 +118,7 @@ var/losebreath = 0.0//Carbon var/intent = null//Living var/shakecamera = 0 - var/a_intent = "help"//Living + var/a_intent = I_HELP//Living var/m_int = null//Living var/m_intent = "run"//Living var/lastKnownIP = null diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 4deb43a3c21..b5dc65e9d94 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -433,20 +433,20 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return 0 //converts intent-strings into numbers and back -var/list/intents = list("help","disarm","grab","hurt") +var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT) /proc/intent_numeric(argument) if(istext(argument)) switch(argument) - if("help") return 0 - if("disarm") return 1 - if("grab") return 2 + if(I_HELP) return 0 + if(I_DISARM) return 1 + if(I_GRAB) return 2 else return 3 else switch(argument) - if(0) return "help" - if(1) return "disarm" - if(2) return "grab" - else return "hurt" + if(0) return I_HELP + if(1) return I_DISARM + if(2) return I_GRAB + else return I_HURT //change a mob's act-intent. Input the intent as a string such as "help" or use "right"/"left /mob/verb/a_intent_change(input as text) @@ -455,7 +455,7 @@ var/list/intents = list("help","disarm","grab","hurt") if(ishuman(src) || isbrain(src) || isslime(src)) switch(input) - if("help","disarm","grab","hurt") + if(I_HELP,I_DISARM,I_GRAB,I_HURT) a_intent = input if("right") a_intent = intent_numeric((intent_numeric(a_intent)+1) % 4) @@ -466,17 +466,17 @@ var/list/intents = list("help","disarm","grab","hurt") else if(isrobot(src)) switch(input) - if("help") - a_intent = "help" - if("hurt") - a_intent = "hurt" + if(I_HELP) + a_intent = I_HELP + if(I_HURT) + a_intent = I_HURT if("right","left") a_intent = intent_numeric(intent_numeric(a_intent) - 3) if(hud_used && hud_used.action_intent) - if(a_intent == "hurt") - hud_used.action_intent.icon_state = "harm" + if(a_intent == I_HURT) + hud_used.action_intent.icon_state = I_HURT else - hud_used.action_intent.icon_state = "help" + hud_used.action_intent.icon_state = I_HELP proc/is_blind(A) if(istype(A, /mob/living/carbon)) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 9793fe02fad..958f0b982ae 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -180,7 +180,7 @@ var/alien_caste = pick("Hunter","Sentinel","Drone") var/mob/living/carbon/human/new_xeno = create_new_xenomorph(alien_caste,loc) - new_xeno.a_intent = "hurt" + new_xeno.a_intent = I_HURT new_xeno.key = key new_xeno << "You are now an alien." @@ -237,7 +237,7 @@ del(t) var/mob/living/simple_animal/corgi/new_corgi = new /mob/living/simple_animal/corgi (loc) - new_corgi.a_intent = "hurt" + new_corgi.a_intent = I_HURT new_corgi.key = key new_corgi << "You are now a Corgi. Yap Yap!" @@ -271,7 +271,7 @@ var/mob/new_mob = new mobpath(src.loc) new_mob.key = key - new_mob.a_intent = "hurt" + new_mob.a_intent = I_HURT new_mob << "You suddenly feel more... animalistic." @@ -291,7 +291,7 @@ var/mob/new_mob = new mobpath(src.loc) new_mob.key = key - new_mob.a_intent = "hurt" + new_mob.a_intent = I_HURT new_mob << "You feel more... animalistic" del(src) diff --git a/code/modules/organs/organ_objects.dm b/code/modules/organs/organ_objects.dm index a97f1f28f53..51e657a6f92 100644 --- a/code/modules/organs/organ_objects.dm +++ b/code/modules/organs/organ_objects.dm @@ -18,7 +18,7 @@ /obj/item/organ/attack_self(mob/user as mob) // Convert it to an edible form, yum yum. - if(!robotic && user.a_intent == "help" && user.zone_sel.selecting == "mouth") + if(!robotic && user.a_intent == I_HELP && user.zone_sel.selecting == "mouth") bitten(user) return diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 6285e9dfe26..fb68cea74c9 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -658,7 +658,7 @@ if(istype(user,/mob/living/carbon/human)) var/mob/living/carbon/human/H = user - if(H.species.flags & IS_SYNTHETIC && H.a_intent == "grab") + if(H.species.flags & IS_SYNTHETIC && H.a_intent == I_GRAB) if(emagged || stat & BROKEN) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(3, 1, src) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index d73d60926e5..4ce3d4ba3e5 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -517,7 +517,7 @@ obj/structure/cable/proc/cableColor(var/colorC) if(istype(M,/mob/living/carbon/human)) var/mob/living/carbon/human/H = M var/datum/organ/external/S = H.get_organ(user.zone_sel.selecting) - if(!(S.status & ORGAN_ROBOT) || user.a_intent != "help") + if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP) return ..() if(H.species.flags & IS_SYNTHETIC) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 7c9ae41cf25..14bdaa16446 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -737,7 +737,7 @@ if(!proximity) return if(istype(target, /obj/machinery/light)) return - if(user.a_intent != "hurt") + if(user.a_intent != I_HURT) return shatter() diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 05b877f87ea..8df7969d8dd 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -90,14 +90,14 @@ if(user && user.client && !(A in aim_targets)) var/client/C = user.client //If help intent is on and we have clicked on an eligible target, switch to aim mode automatically - if(user.a_intent == "help" && isliving(A) && !C.gun_mode) + if(user.a_intent == I_HELP && isliving(A) && !C.gun_mode) C.ToggleGunMode() if(C.gun_mode) aiming = PreFire(A,user,params) //They're using the new gun system, locate what they're aiming at. if (!aiming) - if(user && user.a_intent == "help") //regardless of what happens, refuse to shoot if help intent is on + if(user && user.a_intent == I_HELP) //regardless of what happens, refuse to shoot if help intent is on user << "\red You refrain from firing your [src] as your intent is set to help." else Fire(A,user,params) //Otherwise, fire normally. @@ -105,7 +105,7 @@ /obj/item/weapon/gun/attack(atom/A, mob/living/user, def_zone) if (A == user && user.zone_sel.selecting == "mouth" && !mouthshoot) handle_suicide(user) - else if(user.a_intent == "hurt") //point blank shooting + else if(user.a_intent == I_HURT) //point blank shooting Fire(A, user, pointblank=1) else return ..() //Pistolwhippin' diff --git a/code/modules/projectiles/projectile/change.dm b/code/modules/projectiles/projectile/change.dm index 5bde8a5cfc1..c91e5de233c 100644 --- a/code/modules/projectiles/projectile/change.dm +++ b/code/modules/projectiles/projectile/change.dm @@ -71,7 +71,7 @@ for (var/obj/effect/proc_holder/spell/S in M.spell_list) new_mob.spell_list += new S.type - new_mob.a_intent = "hurt" + new_mob.a_intent = I_HURT if(M.mind) M.mind.transfer_to(new_mob) else diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm index c3988ff2ffe..bd5c1c8d97a 100644 --- a/code/modules/projectiles/targeting.dm +++ b/code/modules/projectiles/targeting.dm @@ -85,7 +85,7 @@ return //reflex firing is disabled when help intent is set - if (M.a_intent == "help") + if (M.a_intent == I_HELP) M << "\red You refrain from firing your [src] as your intent is set to help." return diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 89e993e4b3c..1399fdd14ad 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -370,7 +370,7 @@ datum W.loc = M.loc W.dropped(M) var/mob/living/carbon/slime/new_mob = new /mob/living/carbon/slime(M.loc) - new_mob.a_intent = "hurt" + new_mob.a_intent = I_HURT new_mob.universal_speak = 1 if(M.mind) M.mind.transfer_to(new_mob) diff --git a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm index 52a4ba12ba7..22c0bf6da82 100644 --- a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm +++ b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm @@ -37,7 +37,7 @@ if(!target) return - if(user.a_intent != "hurt" || !isGlass) + if(user.a_intent != I_HURT || !isGlass) return ..() diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 8aa34a7dcab..01bddd04312 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -58,7 +58,7 @@ user << "\red This syringe is broken!" return - if (user.a_intent == "hurt" && ismob(target)) + if (user.a_intent == I_HURT && ismob(target)) if((CLUMSY in user.mutations) && prob(50)) target = user syringestab(target, user) diff --git a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_hurt.dm b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_hurt.dm index 77074be63f9..0c81a604a2f 100644 --- a/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_hurt.dm +++ b/code/modules/research/xenoarchaeology/artifact/effects/unknown_effect_hurt.dm @@ -1,49 +1,49 @@ - -/datum/artifact_effect/hurt - effecttype = "hurt" - effect_type = 5 - -/datum/artifact_effect/hurt/DoEffectTouch(var/mob/toucher) - if(toucher) - var/weakness = GetAnomalySusceptibility(toucher) - if(iscarbon(toucher) && prob(weakness * 100)) - var/mob/living/carbon/C = toucher - C << "\red A painful discharge of energy strikes you!" - C.adjustOxyLoss(rand(5,25) * weakness) - C.adjustToxLoss(rand(5,25) * weakness) - C.adjustBruteLoss(rand(5,25) * weakness) - C.adjustFireLoss(rand(5,25) * weakness) - C.adjustBrainLoss(rand(5,25) * weakness) - C.radiation += 25 * weakness - C.nutrition -= min(50 * weakness, C.nutrition) - C.make_dizzy(6 * weakness) - C.weakened += 6 * weakness - -/datum/artifact_effect/hurt/DoEffectAura() - if(holder) - var/turf/T = get_turf(holder) - for (var/mob/living/carbon/C in range(src.effectrange,T)) - var/weakness = GetAnomalySusceptibility(C) - if(prob(weakness * 100)) - if(prob(10)) - C << "\red You feel a painful force radiating from something nearby." - C.adjustBruteLoss(1 * weakness) - C.adjustFireLoss(1 * weakness) - C.adjustToxLoss(1 * weakness) - C.adjustOxyLoss(1 * weakness) - C.adjustBrainLoss(1 * weakness) - C.updatehealth() - -/datum/artifact_effect/hurt/DoEffectPulse() - if(holder) - var/turf/T = get_turf(holder) - for (var/mob/living/carbon/C in range(effectrange, T)) - var/weakness = GetAnomalySusceptibility(C) - if(prob(weakness * 100)) - C << "\red A wave of painful energy strikes you!" - C.adjustBruteLoss(3 * weakness) - C.adjustFireLoss(3 * weakness) - C.adjustToxLoss(3 * weakness) - C.adjustOxyLoss(3 * weakness) - C.adjustBrainLoss(3 * weakness) - C.updatehealth() + +/datum/artifact_effect/hurt + effecttype = I_HURT + effect_type = 5 + +/datum/artifact_effect/hurt/DoEffectTouch(var/mob/toucher) + if(toucher) + var/weakness = GetAnomalySusceptibility(toucher) + if(iscarbon(toucher) && prob(weakness * 100)) + var/mob/living/carbon/C = toucher + C << "\red A painful discharge of energy strikes you!" + C.adjustOxyLoss(rand(5,25) * weakness) + C.adjustToxLoss(rand(5,25) * weakness) + C.adjustBruteLoss(rand(5,25) * weakness) + C.adjustFireLoss(rand(5,25) * weakness) + C.adjustBrainLoss(rand(5,25) * weakness) + C.radiation += 25 * weakness + C.nutrition -= min(50 * weakness, C.nutrition) + C.make_dizzy(6 * weakness) + C.weakened += 6 * weakness + +/datum/artifact_effect/hurt/DoEffectAura() + if(holder) + var/turf/T = get_turf(holder) + for (var/mob/living/carbon/C in range(src.effectrange,T)) + var/weakness = GetAnomalySusceptibility(C) + if(prob(weakness * 100)) + if(prob(10)) + C << "\red You feel a painful force radiating from something nearby." + C.adjustBruteLoss(1 * weakness) + C.adjustFireLoss(1 * weakness) + C.adjustToxLoss(1 * weakness) + C.adjustOxyLoss(1 * weakness) + C.adjustBrainLoss(1 * weakness) + C.updatehealth() + +/datum/artifact_effect/hurt/DoEffectPulse() + if(holder) + var/turf/T = get_turf(holder) + for (var/mob/living/carbon/C in range(effectrange, T)) + var/weakness = GetAnomalySusceptibility(C) + if(prob(weakness * 100)) + C << "\red A wave of painful energy strikes you!" + C.adjustBruteLoss(3 * weakness) + C.adjustFireLoss(3 * weakness) + C.adjustToxLoss(3 * weakness) + C.adjustOxyLoss(3 * weakness) + C.adjustBrainLoss(3 * weakness) + C.updatehealth() diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index a4e6cfdc6f3..b0626cdc778 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -80,7 +80,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user) proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool) if(!istype(M)) return 0 - if (user.a_intent == "harm") //check for Hippocratic Oath + if (user.a_intent == I_HURT) //check for Hippocratic Oath return 0 var/zone = user.zone_sel.selecting if(zone in M.op_stage.in_progress) //Can't operate on someone repeatedly. @@ -108,7 +108,7 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool) H.update_surgery() return 1 //don't want to do weapony things after surgery - if (user.a_intent == "help") + if (user.a_intent == I_HELP) user << "\red You can't see any useful way to use [tool] on [M]." return 1 return 0 diff --git a/code/setup.dm b/code/setup.dm index cee4313d931..7723932367a 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -425,10 +425,6 @@ #define SEC_LEVEL_RED 2 #define SEC_LEVEL_DELTA 3 -// Click cooldowns, in tenths of a second. -#define CLICK_CD_MELEE 8 -#define CLICK_CD_RANGE 4 - #define TRANSITIONEDGE 7 // Distance from edge to move to another z-level. // A set of constants used to determine which type of mute an admin wishes to apply. @@ -787,15 +783,15 @@ var/list/be_special_flags = list( // Appearance change flags #define APPEARANCE_UPDATE_DNA 1 -#define APPEARANCE_RACE 2|APPEARANCE_UPDATE_DNA -#define APPEARANCE_GENDER 4|APPEARANCE_UPDATE_DNA +#define APPEARANCE_RACE (2|APPEARANCE_UPDATE_DNA) +#define APPEARANCE_GENDER (4|APPEARANCE_UPDATE_DNA) #define APPEARANCE_SKIN 8 #define APPEARANCE_HAIR 16 #define APPEARANCE_HAIR_COLOR 32 #define APPEARANCE_FACIAL_HAIR 64 #define APPEARANCE_FACIAL_HAIR_COLOR 128 #define APPEARANCE_EYE_COLOR 256 -#define APPEARANCE_ALL_HAIR APPEARANCE_HAIR|APPEARANCE_HAIR_COLOR|APPEARANCE_FACIAL_HAIR|APPEARANCE_FACIAL_HAIR_COLOR +#define APPEARANCE_ALL_HAIR (APPEARANCE_HAIR|APPEARANCE_HAIR_COLOR|APPEARANCE_FACIAL_HAIR|APPEARANCE_FACIAL_HAIR_COLOR) #define APPEARANCE_ALL 511 // Antagonist datum flags. @@ -836,3 +832,23 @@ var/list/be_special_flags = list( //Area flags, possibly more to come #define RAD_SHIELDED 1 //shielded from radiation, clearly + +//intent flags, why wasn't this done the first time? +#define I_HELP "help" +#define I_DISARM "disarm" +#define I_GRAB "grab" +#define I_HURT "hurt" + +/* + These are used Bump() code for living mobs, in the mob_bump_flag, mob_swap_flags, and mob_push_flags vars to determine whom can bump/swap with whom. +*/ +#define HUMAN 1 +#define MONKEY 2 +#define ALIEN 4 +#define ROBOT 8 +#define SLIME 16 +#define SIMPLE_ANIMAL 32 + +#define ALLMOBS (HUMAN|MONKEY|ALIEN|ROBOT|SLIME|SIMPLE_ANIMAL) + +#define NEXT_MOVE_DELAY 8