| @@ -0,0 +1,156 @@ | ||
| /mob/living/carbon/proc/print_happiness() | ||
| var/msg = "\n<span class='info'>I am a follower of <font color='red'>[religion]</font></span>.\n" | ||
| msg += "<span class='info'>I am [get_social_class()]</span>.\n" | ||
| msg += "<span class='info'>*---------*\n<EM>Current mood</EM>\n" | ||
| for(var/i in events) | ||
| var/datum/happiness_event/event = events[i] | ||
| msg += event.description | ||
|
|
||
| if(!events.len) | ||
| msg += "<span class='info'>I feel indifferent.</span>\n" | ||
|
|
||
|
|
||
| msg += "<span class='info'>*---------*</span>" | ||
| to_chat(src, msg) | ||
|
|
||
| /mob/living/carbon/proc/update_happiness() | ||
| var/old_happiness = happiness | ||
| var/old_icon = null | ||
| if(happiness_icon) | ||
| old_icon = happiness_icon.icon_state | ||
| happiness = 0 | ||
| for(var/i in events) | ||
| var/datum/happiness_event/event = events[i] | ||
| happiness += event.happiness | ||
|
|
||
| switch(happiness) | ||
| if(-5000000 to MOOD_LEVEL_SAD4) | ||
| if(happiness_icon) | ||
| happiness_icon.icon_state = "mood7" | ||
|
|
||
| if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3) | ||
| if(happiness_icon) | ||
| happiness_icon.icon_state = "mood6" | ||
|
|
||
| if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2) | ||
| if(happiness_icon) | ||
| happiness_icon.icon_state = "mood5" | ||
|
|
||
| if(MOOD_LEVEL_SAD2 to MOOD_LEVEL_SAD1) | ||
| if(happiness_icon) | ||
| happiness_icon.icon_state = "mood5" | ||
|
|
||
| if(MOOD_LEVEL_SAD1 to MOOD_LEVEL_HAPPY1) | ||
| if(happiness_icon) | ||
| happiness_icon.icon_state = "mood4" | ||
|
|
||
| if(MOOD_LEVEL_HAPPY1 to MOOD_LEVEL_HAPPY2) | ||
| if(happiness_icon) | ||
| happiness_icon.icon_state = "mood4" | ||
|
|
||
| if(MOOD_LEVEL_HAPPY2 to MOOD_LEVEL_HAPPY3) | ||
| if(happiness_icon) | ||
| happiness_icon.icon_state = "mood3" | ||
|
|
||
| if(MOOD_LEVEL_HAPPY3 to MOOD_LEVEL_HAPPY4) | ||
| if(happiness_icon) | ||
| happiness_icon.icon_state = "mood2" | ||
|
|
||
| if(MOOD_LEVEL_HAPPY4 to INFINITY) | ||
| if(happiness_icon) | ||
| happiness_icon.icon_state = "mood1" | ||
|
|
||
| if(old_icon && old_icon != happiness_icon.icon_state) | ||
| if(old_happiness > happiness) | ||
| to_chat(src, "<span class='warning'>My mood gets worse.</span>") | ||
| else | ||
| to_chat(src, "<span class='info'>My mood gets better.</span>") | ||
|
|
||
| /mob/proc/flash_sadness() | ||
| if(prob(2)) | ||
| flick("sadness",pain) | ||
| var/spoopysound = pick('sound/effects/badmood1.ogg','sound/effects/badmood2.ogg','sound/effects/badmood3.ogg','sound/effects/badmood4.ogg') | ||
| sound_to(src, spoopysound) | ||
|
|
||
| /mob/living/carbon/proc/handle_happiness() | ||
| switch(happiness) | ||
| if(-5000000 to MOOD_LEVEL_SAD4) | ||
| flash_sadness() | ||
| crit_mood_modifier = -10 | ||
| if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3) | ||
| flash_sadness() | ||
| crit_mood_modifier = -5 | ||
| if(MOOD_LEVEL_SAD1 to MOOD_LEVEL_HAPPY2) | ||
| crit_mood_modifier = CRIT_SUCCESS_NORM | ||
| if(MOOD_LEVEL_HAPPY3 to MOOD_LEVEL_HAPPY4) | ||
| crit_mood_modifier = 5 | ||
| if(MOOD_LEVEL_HAPPY4 to INFINITY) | ||
| crit_mood_modifier = 10 | ||
|
|
||
|
|
||
| /mob/living/carbon/proc/add_event(category, type) //Category will override any events in the same category, should be unique unless the event is based on the same thing like hunger. | ||
| var/datum/happiness_event/the_event | ||
| if(events[category]) | ||
| the_event = events[category] | ||
| if(the_event.type != type) | ||
| clear_event(category) | ||
| return .() | ||
| else | ||
| return 0 //Don't have to update the event. | ||
| else | ||
| the_event = new type() | ||
|
|
||
| events[category] = the_event | ||
| update_happiness() | ||
|
|
||
| if(the_event.timeout) | ||
| spawn(the_event.timeout) | ||
| clear_event(category) | ||
|
|
||
| /mob/living/carbon/proc/clear_event(category) | ||
| var/datum/happiness_event/event = events[category] | ||
| if(!event) | ||
| return 0 | ||
|
|
||
| events -= category | ||
| qdel(event) | ||
| update_happiness() | ||
|
|
||
| /mob/living/carbon/proc/handle_hygiene() | ||
| adjust_hygiene(-my_hygiene_factor) | ||
| var/image/smell = image('icons/effects/effects.dmi', "smell")//This is a hack, there has got to be a safer way to do this but I don't know it at the moment. | ||
| switch(hygiene) | ||
| if(HYGIENE_LEVEL_NORMAL to INFINITY) | ||
| add_event("hygiene", /datum/happiness_event/hygiene/clean) | ||
| overlays -= smell | ||
| if(HYGIENE_LEVEL_DIRTY to HYGIENE_LEVEL_NORMAL) | ||
| clear_event("hygiene") | ||
| overlays -= smell | ||
| if(0 to HYGIENE_LEVEL_DIRTY) | ||
| overlays -= smell | ||
| overlays += smell | ||
| add_event("hygiene", /datum/happiness_event/hygiene/smelly) | ||
|
|
||
| /mob/living/carbon/proc/adjust_hygiene(var/amount) | ||
| var/old_hygiene = hygiene | ||
| if(amount>0) | ||
| hygiene = min(hygiene+amount, HYGIENE_LEVEL_CLEAN) | ||
|
|
||
| else if(old_hygiene) | ||
| hygiene = max(hygiene+amount, 0) | ||
|
|
||
| /mob/living/carbon/proc/set_hygiene(var/amount) | ||
| if(amount >= 0) | ||
| hygiene = min(HYGIENE_LEVEL_CLEAN, amount) | ||
|
|
||
| /mob/living/carbon/proc/adjust_thirst(var/amount) | ||
| var/old_thirst = thirst | ||
| if(amount>0) | ||
| thirst = min(thirst+amount, THIRST_LEVEL_MAX) | ||
|
|
||
| else if(old_thirst) | ||
| thirst = max(thirst+amount, 0) | ||
|
|
||
| /mob/living/carbon/proc/set_thirst(var/amount) | ||
| if(amount >= 0) | ||
| thirst = min(THIRST_LEVEL_MAX, amount) |
| @@ -0,0 +1,179 @@ | ||
| /datum/happiness_event | ||
| var/description | ||
| var/happiness = 0 | ||
| var/timeout = 0 | ||
|
|
||
| ///For descriptions, use the span classes bold info, info, none, warning and boldwarning in order from great to horrible. | ||
|
|
||
| //thirst | ||
| /datum/happiness_event/thirst/filled | ||
| description = "<span class='binfo'>I've had enough to drink for a while!</span>\n" | ||
| happiness = 4 | ||
|
|
||
| /datum/happiness_event/thirst/watered | ||
| description = "<span class='info'>I have recently had something to drink.</span>\n" | ||
| happiness = 2 | ||
|
|
||
| /datum/happiness_event/thirst/thirsty | ||
| description = "<span class='warning'>I'm getting a bit thirsty.</span>\n" | ||
| happiness = -7 | ||
|
|
||
| /datum/happiness_event/thirst/dehydrated | ||
| description = "<span class='danger'>I need water!</span>\n" | ||
| happiness = -14 | ||
|
|
||
|
|
||
|
|
||
| //nutrition | ||
| /datum/happiness_event/nutrition/fat | ||
| description = "<span class='warning'><B>I'm so fat..</B></span>\n" //muh fatshaming | ||
| happiness = -4 | ||
|
|
||
| /datum/happiness_event/nutrition/wellfed | ||
| description = "<span class='binfo'>My belly feels round and full.</span>\n" | ||
| happiness = 4 | ||
|
|
||
| /datum/happiness_event/nutrition/fed | ||
| description = "<span class='info'>I have recently had some food.</span>\n" | ||
| happiness = 2 | ||
|
|
||
| /datum/happiness_event/nutrition/hungry | ||
| description = "<span class='warning'>I'm getting a bit hungry.</span>\n" | ||
| happiness = -6 | ||
|
|
||
| /datum/happiness_event/nutrition/starving | ||
| description = "<span class='danger'>I'm starving!</span>\n" | ||
| happiness = -12 | ||
|
|
||
|
|
||
| //Hygiene | ||
| /datum/happiness_event/hygiene/clean | ||
| description = "<span class='info'>I feel so clean!\n" | ||
| happiness = 2 | ||
|
|
||
| /datum/happiness_event/hygiene/smelly | ||
| description = "<span class='warning'>I smell like shit.\n" | ||
| happiness = -5 | ||
|
|
||
| /datum/happiness_event/hygiene/vomitted | ||
| description = "<span class='warning'>Ugh, I've vomitted.\n" | ||
| happiness = -5 | ||
| timeout = 1800 | ||
|
|
||
|
|
||
|
|
||
| //Disgust | ||
| /datum/happiness_event/disgust/gross | ||
| description = "<span class='warning'>That was gross.</span>\n" | ||
| happiness = -2 | ||
| timeout = 1800 | ||
|
|
||
| /datum/happiness_event/disgust/verygross | ||
| description = "<span class='warning'>I think I'm going to puke...</span>\n" | ||
| happiness = -4 | ||
| timeout = 1800 | ||
|
|
||
| /datum/happiness_event/disgust/disgusted | ||
| description = "<span class='danger'>Oh god that's disgusting...</span>\n" | ||
| happiness = -6 | ||
| timeout = 1800 | ||
|
|
||
|
|
||
|
|
||
| //Generic events | ||
| /datum/happiness_event/favorite_food | ||
| description = "<span class='info'>I really liked eating that.</span>\n" | ||
| happiness = 3 | ||
| timeout = 2400 | ||
|
|
||
| /datum/happiness_event/nice_shower | ||
| description = "<span class='info'>I had a nice shower.</span>\n" | ||
| happiness = 1 | ||
| timeout = 1800 | ||
|
|
||
| /datum/happiness_event/handcuffed | ||
| description = "<span class='warning'>I guess my antics finally caught up with me..</span>\n" | ||
| happiness = -1 | ||
|
|
||
| /datum/happiness_event/booze | ||
| description = "<span class='info'>Alcohol makes the pain go away.</span>\n" | ||
| happiness = 3 | ||
| timeout = 2400 | ||
|
|
||
| /datum/happiness_event/relaxed//For nicotine. | ||
| description = "<span class='info'>I feel relaxed.</span>\n" | ||
| happiness = 1 | ||
| timeout = 1800 | ||
|
|
||
| /datum/happiness_event/antsy//Withdrawl. | ||
| description = "<span class='danger'>I could use a smoke.</span>\n" | ||
| happiness = -3 | ||
| timeout = 1800 | ||
|
|
||
| /datum/happiness_event/hot_food //Hot food feels good! | ||
| description = "<span class='info'>I've eaten something warm.</span>\n" | ||
| happiness = 3 | ||
| timeout = 1800 | ||
|
|
||
| /datum/happiness_event/cold_drink //Cold drinks feel good! | ||
| description = "<span class='info'>I've had something refreshing.</span>\n" | ||
| happiness = 3 | ||
| timeout = 1800 | ||
|
|
||
| /datum/happiness_event/high | ||
| description = "<span class='binfo'>I'm high as fuck</span>\n" | ||
| happiness = 12 | ||
|
|
||
|
|
||
|
|
||
| //Embarassment | ||
| /datum/happiness_event/hygiene/shit | ||
| description = "<span class='danger'>I shit myself. How embarassing.\n" | ||
| happiness = -12 | ||
| timeout = 1800 | ||
|
|
||
| /datum/happiness_event/hygiene/pee | ||
| description = "<span class='danger'>I pissed myself. How embarassing.\n" | ||
| happiness = -12 | ||
| timeout = 1800 | ||
|
|
||
| /datum/happiness_event/badsex | ||
| description = "<span class='warning'>Ugh, that sex was horrible.\n" | ||
| happiness = -4 | ||
| timeout = 1800 | ||
|
|
||
| //Good sex here too because why not. | ||
| /datum/happiness_event/came | ||
| description = "<span class='binfo'>I came!\n" | ||
| happiness = 10 | ||
| timeout = 1800 | ||
|
|
||
| //For when you get branded. | ||
| /datum/happiness_event/humiliated | ||
| description = "<span class='danger'>I've been humiliated, and I am embarassed.</span>\n" | ||
| happiness = -10 | ||
| timeout = 1800 | ||
|
|
||
| //And when you've seen someone branded | ||
| /datum/happiness_event/punished_heretic | ||
| description = "<span class='binfo'>I've seen a punished heretic.</span>\n" | ||
| happiness = 10 | ||
| timeout = 1800 | ||
|
|
||
|
|
||
| //Unused so far but I want to remember them to use them later. | ||
| /datum/happiness_event/disturbing | ||
| description = "<span class='danger'>I recently saw something disturbing</span>\n" | ||
| happiness = -2 | ||
|
|
||
| /datum/happiness_event/clown | ||
| description = "<span class='info'>I recently saw a funny clown!</span>\n" | ||
| happiness = 1 | ||
|
|
||
| /datum/happiness_event/cloned_corpse | ||
| description = "<span class='danger'>I recently saw my own corpse...</span>\n" | ||
| happiness = -6 | ||
|
|
||
| /datum/happiness_event/surgery | ||
| description = "<span class='danger'>HE'S CUTTING ME OPEN!!</span>\n" | ||
| happiness = -8 |
| @@ -0,0 +1,87 @@ | ||
| /mob/proc/agony_scream() | ||
| if(stat) | ||
| return | ||
| var/screamsound = null | ||
| var/muzzled = istype(wear_mask, /obj/item/clothing/mask/muzzle) | ||
| var/message = null | ||
|
|
||
| if(ishuman(src)) | ||
| var/mob/living/carbon/human/H = src | ||
| if(!muzzled) | ||
| if(H.isMonkey()) | ||
| screamsound = "sound/voice/monkey_pain[rand(1,3)].ogg" | ||
|
|
||
| else if(H.isChild()) | ||
| screamsound = "sound/voice/child_pain[rand(1,2)].ogg" | ||
|
|
||
| else if(src.gender == MALE) | ||
| screamsound = "sound/voice/man_pain[rand(1,3)].ogg" | ||
|
|
||
| else | ||
| screamsound = "sound/voice/woman_agony[rand(1,3)].ogg" | ||
| message = "screams in agony!" | ||
|
|
||
| else | ||
| message = "makes a loud noise!" | ||
| screamsound = "sound/voice/gagscream[rand(1,3)].wav" | ||
|
|
||
| if(screamsound) | ||
| playsound(src, screamsound, 50, 0, 1) | ||
|
|
||
| if(message) | ||
| custom_emote(2,message) | ||
|
|
||
| /mob/proc/gasp_sound() | ||
| var/gaspsound = null | ||
| var/muzzled = istype(wear_mask, /obj/item/clothing/mask/muzzle) | ||
| if(stat) | ||
| return | ||
|
|
||
| if(muzzled) | ||
| custom_emote(2,"[src.name] makes a muffled gasping noise.") | ||
| return | ||
|
|
||
| if(gender == MALE) | ||
| gaspsound = "sound/voice/gasp_male[rand(1,7)].ogg" | ||
|
|
||
| if(gender == FEMALE) | ||
| gaspsound = "sound/voice/gasp_female[rand(1,7)].ogg" | ||
|
|
||
| if(gaspsound) | ||
| playsound(src, gaspsound, 25, 0, 1) | ||
|
|
||
|
|
||
| /mob/proc/agony_moan() | ||
| if(stat) | ||
| return | ||
| var/moansound = null | ||
| var/message = null | ||
| if(stat) | ||
| return | ||
|
|
||
| var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) | ||
| if(ishuman(src)) | ||
| var/mob/living/carbon/human/H = src | ||
| if(!muzzled) | ||
| if(H.isMonkey()) | ||
| return | ||
|
|
||
| if(H.isChild()) | ||
| moansound = 'sound/voice/child_moan1.ogg' | ||
|
|
||
| else if(src.gender == MALE) | ||
| moansound = "sound/voice/male_moan[rand(1,3)].ogg" | ||
|
|
||
| else | ||
| moansound = "sound/voice/female_moan[rand(1,3)].ogg" | ||
|
|
||
| message = "moans." | ||
| else | ||
| message = "makes a loud noise!" | ||
| moansound = "sound/voice/gagscream[rand(1,3)].wav" | ||
|
|
||
| if(moansound) | ||
| playsound(src, moansound, 50, 0, 1) | ||
|
|
||
| if(message) | ||
| custom_emote(2,message) |
| @@ -0,0 +1,209 @@ | ||
| /mob/living/carbon/human/verb/blink_t() | ||
| set name = "Blink" | ||
| set category = "Emotes" | ||
|
|
||
| emote("blink",1) | ||
|
|
||
| /mob/living/carbon/human/verb/bow() | ||
| set name = "Bow" | ||
| set category = "Emotes" | ||
|
|
||
| emote("bow",1) | ||
|
|
||
| /mob/living/carbon/human/verb/salute() | ||
| set name = "Salute" | ||
| set category = "Emotes" | ||
|
|
||
| emote("salute",1) | ||
|
|
||
| /mob/living/carbon/human/verb/poo() | ||
| set name = "Poo" | ||
| set category = "Emotes" | ||
|
|
||
| emote("poo",1) | ||
|
|
||
| /mob/living/carbon/human/verb/pee() | ||
| set name = "Pee" | ||
| set category = "Emotes" | ||
|
|
||
| emote("pee",1) | ||
|
|
||
| /mob/living/carbon/human/verb/hem() | ||
| set name = "Hem" | ||
| set category = "Emotes" | ||
|
|
||
| emote("hem", 1) | ||
|
|
||
| /mob/living/carbon/human/verb/clap() | ||
| set name = "Clap" | ||
| set category = "Emotes" | ||
|
|
||
| emote("clap",1) | ||
|
|
||
| /mob/living/carbon/human/verb/eyebrow() | ||
| set name = "Eyebrow" | ||
| set category = "Emotes" | ||
|
|
||
| emote("eyebrow",1) | ||
| /* | ||
| /mob/living/carbon/human/verb/chuckle() | ||
| set name = "Chuckle" | ||
| set category = "Emotes" | ||
| emote("chuckle",1) | ||
| */ | ||
| /mob/living/carbon/human/verb/cough() | ||
| set name = "Cough" | ||
| set category = "Emotes" | ||
|
|
||
| emote("cough",1) | ||
|
|
||
| /mob/living/carbon/human/verb/frown() | ||
| set name = "Frown" | ||
| set category = "Emotes" | ||
|
|
||
| emote("frown",1) | ||
|
|
||
| /mob/living/carbon/human/verb/nod() | ||
| set name = "Nod" | ||
| set category = "Emotes" | ||
|
|
||
| emote("nod",1) | ||
|
|
||
| /mob/living/carbon/human/verb/blush() | ||
| set name = "Blush" | ||
| set category = "Emotes" | ||
|
|
||
| emote("blush",1) | ||
|
|
||
| /mob/living/carbon/human/verb/wave() | ||
| set name = "Wave" | ||
| set category = "Emotes" | ||
|
|
||
| emote("wave",1) | ||
|
|
||
| /mob/living/carbon/human/verb/giggle() | ||
| set name = "Giggle" | ||
| set category = "Emotes" | ||
|
|
||
| emote("giggle",1) | ||
|
|
||
| /mob/living/carbon/human/verb/look() | ||
| set name = "Look" | ||
| set category = "Emotes" | ||
|
|
||
| emote("look",1) | ||
|
|
||
| /mob/living/carbon/human/verb/grin() | ||
| set name = "Grin" | ||
| set category = "Emotes" | ||
|
|
||
| emote("grin",1) | ||
|
|
||
| /mob/living/carbon/human/verb/cry() | ||
| set name = "Cry" | ||
| set category = "Emotes" | ||
|
|
||
| emote("cry",1) | ||
|
|
||
| /mob/living/carbon/human/verb/sigh() | ||
| set name = "Sigh" | ||
| set category = "Emotes" | ||
|
|
||
| emote("sigh",1) | ||
|
|
||
| /mob/living/carbon/human/verb/laugh() | ||
| set name = "Laugh" | ||
| set category = "Emotes" | ||
|
|
||
| emote("laugh",1) | ||
|
|
||
| /mob/living/carbon/human/verb/mumble() | ||
| set name = "Mumble" | ||
| set category = "Emotes" | ||
|
|
||
| emote("mumble",1) | ||
|
|
||
| /mob/living/carbon/human/verb/grumble() | ||
| set name = "Grumble" | ||
| set category = "Emotes" | ||
|
|
||
| emote("grumble",1) | ||
|
|
||
| /mob/living/carbon/human/verb/groan() | ||
| set name = "Groan" | ||
| set category = "Emotes" | ||
|
|
||
| emote("groan",1) | ||
|
|
||
| /mob/living/carbon/human/verb/mmoan() | ||
| set name = "Moan" | ||
| set category = "Emotes" | ||
|
|
||
| emote("moan",1) | ||
|
|
||
| /mob/living/carbon/human/verb/raise() | ||
| set name = "Raise Hand" | ||
| set category = "Emotes" | ||
|
|
||
| emote("raise",1) | ||
|
|
||
| /mob/living/carbon/human/verb/shake() | ||
| set name = "Shake" | ||
| set category = "Emotes" | ||
|
|
||
| emote("shake",1) | ||
|
|
||
| /mob/living/carbon/human/verb/shrug() | ||
| set name = "Shrug" | ||
| set category = "Emotes" | ||
|
|
||
| emote("shrug",1) | ||
|
|
||
| /mob/living/carbon/human/verb/smile() | ||
| set name = "Smile" | ||
| set category = "Emotes" | ||
|
|
||
| emote("smile",1) | ||
|
|
||
| /mob/living/carbon/human/verb/whimper() | ||
| set name = "Whimper" | ||
| set category = "Emotes" | ||
|
|
||
| emote("whimper",1) | ||
|
|
||
| /mob/living/carbon/human/verb/wink() | ||
| set name = "Wink" | ||
| set category = "Emotes" | ||
|
|
||
| emote("wink",1) | ||
|
|
||
| /mob/living/carbon/human/verb/yawn() | ||
| set name = "Yawn" | ||
| set category = "Emotes" | ||
|
|
||
| emote("yawn",1) | ||
|
|
||
| /mob/living/carbon/human/verb/hug() | ||
| set name = "Hug" | ||
| set category = "Emotes" | ||
|
|
||
| emote("hug",1) | ||
|
|
||
| /mob/living/carbon/human/verb/scream() | ||
| set name = "Scream" | ||
| set category = "Emotes" | ||
|
|
||
| emote("scream",1) | ||
|
|
||
| /mob/living/carbon/human/verb/emoteclearthroat() | ||
| set name = "Clear Throat" | ||
| set category = "Emotes" | ||
|
|
||
| emote("clearthroat",1) | ||
|
|
||
| /mob/living/carbon/human/verb/fap() | ||
| set name = "Fap" | ||
| set category = "Emotes" | ||
|
|
||
| emote("fap",1) |
| @@ -0,0 +1,67 @@ | ||
| //Commented out debugging shit. | ||
| /* | ||
| /mob/living/carbon/human/verb/toggle_combat_mode() | ||
| set name = "Toggle Combat Mode" | ||
| set category = "Combat" | ||
| if(combat_mode) | ||
| combat_mode = 0 | ||
| to_chat(src, "You toggle off combat mode.") | ||
| else | ||
| combat_mode = 1 | ||
| to_chat(src, "You toggle on combat mode.") | ||
| /mob/living/carbon/human/verb/toggle_dodge_parry() | ||
| set name = "Toggle Defense Intent" | ||
| set category = "Combat" | ||
| if(defense_intent == I_DODGE) | ||
| defense_intent = I_PARRY | ||
| to_chat(src, "You will now parry.") | ||
| else | ||
| defense_intent = I_DODGE | ||
| to_chat(src, "You will now dodge.") | ||
| */ | ||
|
|
||
| //Going here till I find a better place for it. | ||
| /mob/living/proc/handle_combat_mode()//Makes it so that you can't regain stamina in combat mode. | ||
| if(combat_mode) | ||
| if(staminaloss < 25) | ||
| adjustStaminaLoss(1) | ||
|
|
||
| /mob/living/proc/attempt_dodge()//Handle parry is an object proc and it's, its own thing. | ||
| if(combat_mode && (defense_intent == I_DODGE) && !lying)//Todo, make use of the check_shield_arc proc to make sure you can't dodge from behind. | ||
| if(staminaloss < 50 && statscheck(dex, 20))//You gotta be the master of dexterity to dodge every time. | ||
| do_dodge() | ||
| return 1 | ||
| else if(staminaloss >= 50 && prob(10)) | ||
| do_dodge() | ||
| return 1 | ||
|
|
||
| /mob/living/proc/do_dodge() | ||
| var/lol = pick(cardinal)//get a direction. | ||
| adjustStaminaLoss(15)//add some stamina loss | ||
| playsound(loc, 'sound/weapons/punchmiss.ogg', 80, 1)//play a sound | ||
| step(src,lol)//move them | ||
| visible_message("<b><big>[src.name] dodges out of the way!!</big></b>")//send a message | ||
| //be on our way | ||
|
|
||
|
|
||
| /mob/proc/surrender()//Surrending. I need to put this in a different file. | ||
| if(!incapacitated()) | ||
| Stun(5) | ||
| Weaken(5) | ||
| visible_message("<b>[src] surrenders!</b>") | ||
| playsound(src, 'sound/effects/surrender.ogg', 50, 1) | ||
|
|
||
| /mob/proc/mob_rest() | ||
| if(resting && !stunned && !weakened)//The incapacitated proc includes resting for whatever fucking stupid reason I hate SS13 code so fucking much. | ||
| visible_message("<span class='notice'>[usr] is trying to get up.</span>") | ||
| if(do_after(src, 20)) | ||
| resting = 0 | ||
| rest.icon_state = "rest0" | ||
| return | ||
|
|
||
| else | ||
| resting = 1 | ||
| rest.icon_state = "rest1" |
| @@ -0,0 +1,120 @@ | ||
| /////////////VISION CONE/////////////// | ||
| //Vision cone code by Matt and Honkertron. This vision cone code allows for mobs and/or items to blocked out from a players field of vision. | ||
| //This code makes use of the "cone of effect" proc created by Lummox, contributed by Jtgibson. More info on that here: | ||
| //http://www.byond.com/forum/?post=195138 | ||
| /////////////////////////////////////// | ||
|
|
||
| //"Made specially for Otuska" | ||
| // - Honker | ||
|
|
||
|
|
||
|
|
||
| //Defines. | ||
| #define OPPOSITE_DIR(D) turn(D, 180) | ||
|
|
||
| client/ | ||
| var/list/hidden_atoms = list() | ||
| var/list/hidden_mobs = list() | ||
|
|
||
|
|
||
|
|
||
| atom/proc/InCone(atom/center = usr, dir = NORTH) | ||
| if(get_dist(center, src) == 0 || src == center) return 0 | ||
| var/d = get_dir(center, src) | ||
|
|
||
| if(!d || d == dir) return 1 | ||
| if(dir & (dir-1)) | ||
| return (d & ~dir) ? 0 : 1 | ||
| if(!(d & dir)) return 0 | ||
| var/dx = abs(x - center.x) | ||
| var/dy = abs(y - center.y) | ||
| if(dx == dy) return 1 | ||
| if(dy > dx) | ||
| return (dir & (NORTH|SOUTH)) ? 1 : 0 | ||
| return (dir & (EAST|WEST)) ? 1 : 0 | ||
|
|
||
| mob/dead/InCone(mob/center = usr, dir = NORTH) | ||
| return | ||
|
|
||
| mob/living/InCone(mob/center = usr, dir = NORTH) | ||
| . = ..() | ||
| for(var/obj/item/weapon/grab/G in center)//TG doesn't have the grab item. But if you're porting it and you do then uncomment this. | ||
| if(src == G.affecting) | ||
| return 0 | ||
| else | ||
| return . | ||
|
|
||
|
|
||
| proc/cone(atom/center = usr, dir = NORTH, list/list = oview(center)) | ||
| for(var/atom/O in list) if(!O.InCone(center, dir)) list -= O | ||
| return list | ||
|
|
||
| mob/proc/update_vision_cone() | ||
| return | ||
|
|
||
| mob/living/carbon/human/update_vision_cone() | ||
| var/delay = 10 | ||
| if(src.client) | ||
| var/image/I = null | ||
| for(I in src.client.hidden_atoms) | ||
| I.override = 0 | ||
| spawn(delay) | ||
| qdel(I) | ||
| delay += 10 | ||
| check_fov() | ||
| src.client.hidden_atoms = list() | ||
| src.client.hidden_mobs = list() | ||
| src.fov.dir = src.dir | ||
| if(fov.alpha != 0) | ||
| var/mob/living/M | ||
| for(M in cone(src, OPPOSITE_DIR(src.dir), view(10, src))) | ||
| I = image("split", M) | ||
| I.override = 1 | ||
| src.client.images += I | ||
| src.client.hidden_atoms += I | ||
| src.client.hidden_mobs += M | ||
| if(src.pulling == M)//If we're pulling them we don't want them to be invisible, too hard to play like that. | ||
| I.override = 0 | ||
|
|
||
| else if(M.footstep >= 1) | ||
| M.in_vision_cones[src.client] = 1 | ||
|
|
||
| //Optional items can be made invisible too. Uncomment this part if you wish to items to be invisible. | ||
| //var/obj/item/O | ||
| //for(O in cone(src, OPPOSITE_DIR(src.dir), oview(src))) | ||
| // I = image("split", O) | ||
| // I.override = 1 | ||
| // src.client.images += I | ||
| // src.client.hidden_atoms += I | ||
|
|
||
| else | ||
| return | ||
|
|
||
| mob/living/carbon/human/proc/SetFov(var/n) | ||
| if(!n) | ||
| hide_cone() | ||
| else | ||
| show_cone() | ||
|
|
||
| mob/living/carbon/human/proc/check_fov() | ||
|
|
||
| if(resting || lying || client.eye != client.mob) | ||
| src.fov.alpha = 0 | ||
| return | ||
|
|
||
| else if(src.usefov) | ||
| show_cone() | ||
|
|
||
| else | ||
| hide_cone() | ||
|
|
||
| //Making these generic procs so you can call them anywhere. | ||
| mob/living/carbon/human/proc/show_cone() | ||
| if(src.fov) | ||
| src.fov.alpha = 255 | ||
| src.usefov = 1 | ||
|
|
||
| mob/living/carbon/human/proc/hide_cone() | ||
| if(src.fov) | ||
| src.fov.alpha = 0 | ||
| src.usefov = 0 |
| @@ -0,0 +1,15 @@ | ||
| /mob/living/simple_animal/hostile/beepis | ||
| name = "beepis" | ||
| desc = "I don't know some fuckin' thing?" | ||
| icon_state = "beepis" | ||
| icon_living = "beepis" | ||
| icon_dead = "beepis_dead" | ||
| icon_gib = "beepis" | ||
| speak_chance = 0 | ||
| turns_per_move = 5 | ||
| response_help = "pets the" | ||
| response_disarm = "gently pushes aside the" | ||
| response_harm = "hits the" | ||
| speed = 4 | ||
| maxHealth = 25 | ||
| health = 25 |
| @@ -0,0 +1,398 @@ | ||
| /*#####SHIT AND PISS##### | ||
| ##Ok there's a lot of stupid shit here. Literally, but let me explain a bit why I put this here. | ||
| ##I feel like poo and pee add a degree of autistic realism that you wouldn't otherwise get. And I'm autistic about that kind of thing. | ||
| ##This file contains all the reagents, decals, objects and life procs. These procs are used in human/life.dm and human/emote.dm | ||
| ##Have some shitty fun. - Matt | ||
| */ | ||
|
|
||
| //####DEFINES#### | ||
|
|
||
| /mob | ||
| var/bladder = 0 | ||
| var/bowels = 0 | ||
|
|
||
| //#####DECALS##### | ||
| /obj/effect/decal/cleanable/poo | ||
| name = "poo stain" | ||
| desc = "Well that stinks." | ||
| density = 0 | ||
| anchored = 1 | ||
| layer = 2 | ||
| icon = 'icons/effects/pooeffect.dmi' | ||
| icon_state = "floor1" | ||
| random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7", "floor8") | ||
| var/dried = 0 | ||
|
|
||
|
|
||
| /obj/effect/decal/cleanable/poo/New() | ||
| icon = 'icons/effects/pooeffect.dmi' | ||
| icon_state = pick(src.random_icon_states) | ||
| for(var/obj/effect/decal/cleanable/poo/shit in src.loc) | ||
| if(shit != src) | ||
| qdel(shit) | ||
| spawn(6000) | ||
| dried = 1 | ||
| name = "dried poo stain" | ||
| desc = "It's a dried poo stain..." | ||
|
|
||
|
|
||
| /obj/effect/decal/cleanable/poo/tracks | ||
| icon_state = "tracks" | ||
| random_icon_states = null | ||
|
|
||
| /obj/effect/decal/cleanable/poo/drip | ||
| name = "drips of poo" | ||
| desc = "It's brown." | ||
| density = 0 | ||
| anchored = 1 | ||
| layer = 2 | ||
| icon = 'icons/effects/pooeffect.dmi' | ||
| icon_state = "drip1" | ||
| random_icon_states = list("drip1", "drip2", "drip3", "drip4", "drip5") | ||
|
|
||
| //This proc is really deprecated. | ||
| /*/obj/effect/decal/cleanable/poo/proc/streak(var/list/directions) | ||
| spawn (0) | ||
| var/direction = pick(directions) | ||
| for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++) | ||
| sleep(3) | ||
| if (i > 0) | ||
| new /obj/effect/decal/cleanable/poo(src.loc) | ||
| if (step_to(src, get_step(src, direction), 0)) | ||
| break | ||
| */ | ||
|
|
||
| /obj/effect/decal/cleanable/poo/Crossed(AM as mob|obj, var/forceslip = 0) | ||
| if (istype(AM, /mob/living/carbon) && src.dried == 0) | ||
| var/mob/living/carbon/M = AM | ||
| if (M.m_intent == "walk") | ||
| return | ||
|
|
||
| if(prob(5)) | ||
| M.slip("poo") | ||
|
|
||
| //These aren't needed for now. | ||
| ///obj/effect/decal/cleanable/poo/tracks/Crossed(AM as mob|obj) | ||
| // return | ||
|
|
||
| //obj/effect/decal/cleanable/poo/drip/Crossed(AM as mob|obj) | ||
| // return | ||
|
|
||
| /obj/effect/decal/cleanable/urine | ||
| name = "urine stain" | ||
| desc = "Someone couldn't hold it.." | ||
| density = 0 | ||
| anchored = 1 | ||
| layer = 2 | ||
| icon = 'icons/effects/pooeffect.dmi' | ||
| icon_state = "pee1" | ||
| random_icon_states = list("pee1", "pee2", "pee3") | ||
| var/dried = 0 | ||
|
|
||
| /obj/effect/decal/cleanable/urine/Crossed(AM as mob|obj) | ||
| if (istype(AM, /mob/living/carbon)) | ||
| var/mob/living/carbon/M = AM | ||
| if ((ishuman(M) && istype(M:shoes, /obj/item/clothing/shoes/galoshes)) || M.m_intent == "walk") | ||
| return | ||
|
|
||
| if((!dried) && prob(5)) | ||
| M.slip("urine") | ||
|
|
||
| /obj/effect/decal/cleanable/urine/New() | ||
| ..() | ||
| icon_state = pick(random_icon_states) | ||
| //spawn(10) src.reagents.add_reagent("urine",5) | ||
| for(var/obj/effect/decal/cleanable/urine/piss in src.loc) | ||
| if(piss != src) | ||
| qdel(piss) | ||
|
|
||
| spawn(800) | ||
| dried = 1 | ||
| name = "dried urine stain" | ||
| desc = "That's a dried crusty urine stain. Fucking janitors." | ||
|
|
||
|
|
||
|
|
||
| /obj/effect/decal/cleanable/cum | ||
| name = "cum" | ||
| desc = "It's pie cream from a cream pie. Or not..." | ||
| density = 0 | ||
| layer = 2 | ||
| icon = 'honk/icons/effects/cum.dmi' | ||
| blood_DNA = list() | ||
| anchored = 1 | ||
| random_icon_states = list("cum1", "cum3", "cum4", "cum5", "cum6", "cum7", "cum8", "cum9", "cum10", "cum11", "cum12") | ||
|
|
||
|
|
||
| /obj/effect/decal/cleanable/cum/New() | ||
| ..() | ||
| icon_state = pick(random_icon_states) | ||
| for(var/obj/effect/decal/cleanable/cum/jizz in src.loc) | ||
| if(jizz != src) | ||
| qdel(jizz) | ||
|
|
||
|
|
||
| //#####REAGENTS##### | ||
|
|
||
| //SHIT | ||
| /datum/reagent/poo | ||
| name = "poo" | ||
| id = "poo" | ||
| description = "It's poo." | ||
| reagent_state = LIQUID | ||
| color = "#643200" | ||
| taste_description = "literal shit" | ||
|
|
||
|
|
||
| /datum/reagent/poo/on_mob_life(var/mob/living/M) | ||
| if(!M) | ||
| M = holder.my_atom | ||
|
|
||
| M.adjustToxLoss(1) | ||
| holder.remove_reagent(src.id, 0.2) | ||
| ..() | ||
| return | ||
|
|
||
| //TO MAKE add_poo() PROC | ||
| /* reaction_mob(var/mob/M, var/method=TOUCH, var/volume) | ||
| src = null | ||
| if(istype(M, /mob/living/carbon/human) && method==TOUCH) | ||
| if(M:wear_suit) M:wear_suit.add_poo() | ||
| if(M:w_uniform) M:w_uniform.add_poo() | ||
| if(M:shoes) M:shoes.add_poo() | ||
| if(M:gloves) M:gloves.add_poo() | ||
| if(M:head) M:head.add_poo() | ||
| //if(method==INGEST) | ||
| // if(prob(20)) | ||
| // M.contract_disease(new /datum/disease/gastric_ejections) | ||
| // holder.add_reagent("gastricejections", 1) | ||
| // M:toxloss += 0.1 | ||
| // holder.remove_reagent(src.id, 0.2) | ||
| */ | ||
|
|
||
| /datum/reagent/poo/touch_turf(var/turf/T) | ||
| src = null | ||
| if(!istype(T, /turf/space)) | ||
| new /obj/effect/decal/cleanable/poo(T) | ||
|
|
||
| //URINE | ||
| /datum/reagent/urine | ||
| name = "urine" | ||
| id = "urine" | ||
| description = "It's pee." | ||
| reagent_state = LIQUID | ||
| color = COLOR_YELLOW | ||
| taste_description = "urine" | ||
|
|
||
| /datum/reagent/urine/touch_turf(var/turf/T) | ||
| src = null | ||
| if(!istype(T, /turf/space)) | ||
| new /obj/effect/decal/cleanable/urine(T) | ||
|
|
||
| //SEMEN | ||
| /datum/reagent/semen | ||
| name = "semen" | ||
| id = "semen" | ||
| description = "It's semen." | ||
| reagent_state = LIQUID | ||
| color = COLOR_WHITE | ||
| taste_description = "salt" | ||
|
|
||
| /datum/reagent/semen/touch_turf(var/turf/T) | ||
| src = null | ||
| if(!istype(T, /turf/space)) | ||
| new /obj/effect/decal/cleanable/cum(T) | ||
|
|
||
| /obj/item/weapon/reagent_containers/food/snacks/poo | ||
| name = "poo" | ||
| desc = "A chocolately surprise!" | ||
| icon = 'icons/obj/poop.dmi' | ||
| icon_state = "poop2" | ||
| item_state = "poop" | ||
|
|
||
| /obj/item/weapon/reagent_containers/food/snacks/poo/New() | ||
| ..() | ||
| icon_state = pick("poop1", "poop2", "poop3", "poop4", "poop5", "poop6", "poop7") | ||
| reagents.add_reagent("poo", 10) | ||
| bitesize = 3 | ||
|
|
||
| /obj/item/weapon/reagent_containers/food/snacks/poo/throw_impact(atom/hit_atom) | ||
| //if(prob(50)) //this is so we actually have a chance of recovering some from disposal. | ||
| // return | ||
| playsound(src.loc, "sound/effects/squishy.ogg", 40, 1) | ||
| var/turf/T = src.loc | ||
| if(!istype(T, /turf/space)) | ||
| new /obj/effect/decal/cleanable/poo(T) | ||
| //qdel(src) THIS IS BAD AND YOU SHOULD FEEL BAD. | ||
| ..() | ||
|
|
||
| //#####BOTTLES##### | ||
|
|
||
| //PISS | ||
| /obj/item/weapon/reagent_containers/glass/bottle/urine | ||
| name = "urine bottle" | ||
| desc = "A small bottle. Contains urine." | ||
| icon = 'icons/obj/chemical.dmi' | ||
| icon_state = "bottle15" | ||
|
|
||
| New() | ||
| ..() | ||
| reagents.add_reagent("urine", 30) | ||
|
|
||
|
|
||
| //#####LIFE PROCS##### | ||
|
|
||
| //poo and pee counters. This is called in human/handle_stomach. | ||
| /mob/living/carbon/human/proc/handle_excrement() | ||
| if(bowels <= 0) | ||
| bowels = 0 | ||
| if(bladder <= 0) | ||
| bladder = 0 | ||
|
|
||
| if(bowels >= 250) | ||
| switch(bowels) | ||
| if(250 to 400) | ||
| if(prob(5)) | ||
| to_chat(src, "<b>You need to use the bathroom.</b>") | ||
| bowels += 15 | ||
| if(400 to 450) | ||
| if(prob(5)) | ||
| to_chat(src, "<span class='danger'>You really need to use the restroom!</span>") | ||
| bowels += 15 | ||
| if(450 to 500) | ||
| if(prob(2)) | ||
| handle_shit() | ||
| else if(prob(10)) | ||
| to_chat(src, "<span class='danger'>You're about to shit yourself!</span>") | ||
| bowels += 25 | ||
| if(500 to 550) | ||
| if(prob(15)) | ||
| handle_shit() | ||
| else if(prob(30)) | ||
| to_chat(src, "<span class='danger'>OH MY GOD YOU HAVE TO SHIT!</span>") | ||
| bowels += 35 | ||
| if(550 to INFINITY) | ||
| handle_shit() | ||
|
|
||
| if(bladder >= 100)//Your bladder is smaller than your colon | ||
| switch(bladder) | ||
| if(100 to 250) | ||
| if(prob(5)) | ||
| to_chat(src, "<b>You need to use the bathroom.</b>") | ||
| bladder += 15 | ||
| if(250 to 400) | ||
| if(prob(5)) | ||
| to_chat(src, "<span class='danger'>You really need to use the restroom!</span>") | ||
| bladder += 15 | ||
| if(400 to 500) | ||
| if(prob(2)) | ||
| handle_piss() | ||
| else if(prob(10)) | ||
| to_chat(src, "<span class='danger'>You're about to piss yourself!</span>") | ||
| bladder += 25 | ||
| if(500 to 550) | ||
| if(prob(15)) | ||
| handle_piss() | ||
| else if(prob(30)) | ||
| to_chat(src, "<span class='danger'>OH MY GOD YOU HAVE TO PEE!</span>") | ||
| bladder += 35 | ||
| if(550 to INFINITY) | ||
| handle_piss() | ||
|
|
||
| //Shitting | ||
| /mob/living/carbon/human/proc/handle_shit() | ||
| var/message = null | ||
| if (src.bowels >= 30) | ||
|
|
||
| //Poo in the loo. | ||
| var/obj/structure/toilet/T = locate() in src.loc | ||
| var/obj/machinery/disposal/toilet/T2 = locate() in src.loc | ||
| var/mob/living/M = locate() in src.loc | ||
| if(T && T.open) | ||
| message = "<B>[src]</B> defecates into \the [T]." | ||
|
|
||
| else if (T2 && T2.open) | ||
| message = "<B>[src]</B> defecates into \the [T2]." | ||
| var/obj/item/weapon/reagent_containers/food/snacks/poo/V = new/obj/item/weapon/reagent_containers/food/snacks/poo(src.loc) | ||
| if(reagents) | ||
| reagents.trans_to(V, rand(1,5)) | ||
|
|
||
| if(T2.CanInsertItem(src)) //attempt to insert the shit into the toilet. | ||
| V.forceMove(T2) | ||
| else | ||
| shit_left++ | ||
|
|
||
| else if(w_uniform) | ||
| message = "<B>[src]</B> shits \his pants." | ||
| reagents.add_reagent("poo", 10) | ||
| adjust_hygiene(-25) | ||
| add_event("shitself", /datum/happiness_event/hygiene/shit) | ||
|
|
||
| //Poo on the face. | ||
| else if(M != src && M.lying)//Can only shit on them if they're lying down. | ||
| message = "<span class='danger'><b>[src]</b> shits right on <b>[M]</b>'s face!</span>" | ||
| M.reagents.add_reagent("poo", 10) | ||
|
|
||
| //Poo on the floor. | ||
| else | ||
| message = "<B>[src]</B> [pick("shits", "craps", "poops")]." | ||
| var/obj/item/weapon/reagent_containers/food/snacks/poo/V = new/obj/item/weapon/reagent_containers/food/snacks/poo(src.loc) | ||
| if(reagents) | ||
| reagents.trans_to(V, rand(1,5)) | ||
|
|
||
| shit_left++//Global var for round end, not how much piss is left. | ||
|
|
||
| playsound(src.loc, 'sound/effects/poo2.ogg', 60, 1) | ||
| bowels -= rand(60,80) | ||
|
|
||
| else | ||
| to_chat(src, "You don't have to.") | ||
| return | ||
|
|
||
| visible_message("[message]") | ||
|
|
||
| //Peeing | ||
| /mob/living/carbon/human/proc/handle_piss() | ||
| var/message = null | ||
| if (bladder < 30) | ||
| to_chat(src, "You don't have to.") | ||
| return | ||
|
|
||
| var/obj/structure/urinal/U = locate() in src.loc | ||
| var/obj/machinery/disposal/toilet/T = locate() in src.loc | ||
| var/obj/machinery/disposal/toilet/T2 = locate() in src.loc | ||
| var/obj/structure/sink/S = locate() in src.loc | ||
| var/obj/item/weapon/reagent_containers/RC = locate() in src.loc | ||
| if((U || S) && gender != FEMALE)//In the urinal or sink. | ||
| message = "<B>[src]</B> urinates into [U ? U : S]." | ||
| reagents.remove_any(rand(1,8)) | ||
|
|
||
| else if( (T && T.open) || (T2 && T2.open) )//In the toilet. | ||
| message = "<B>[src]</B> urinates into [T]." | ||
| reagents.remove_any(rand(1,8)) | ||
|
|
||
| else if(RC && (istype(RC,/obj/item/weapon/reagent_containers/food/drinks || istype(RC,/obj/item/weapon/reagent_containers/glass)))) | ||
| if(RC.is_open_container()) | ||
| //Inside a beaker, glass, drink, etc. | ||
| message = "<B>[src]</B> urinates into [RC]." | ||
| var/amount = rand(1,8) | ||
| RC.reagents.add_reagent("urine", amount) | ||
| if(reagents) | ||
| reagents.trans_to(RC, amount) | ||
|
|
||
| else if(w_uniform)//In your pants. | ||
| message = "<B>[src]</B> pisses \his pants." | ||
| adjust_hygiene(-25) | ||
| add_event("pissedself", /datum/happiness_event/hygiene/pee) | ||
|
|
||
| else//On the floor. | ||
| var/turf/TT = src.loc | ||
| var/obj/effect/decal/cleanable/urine/D = new/obj/effect/decal/cleanable/urine(src.loc) | ||
| if(reagents) | ||
| reagents.trans_to(D, rand(1,8)) | ||
| message = "<B>[src]</B> pisses on the [TT.name]." | ||
| piss_left++//Global var for round end, not how much piss is left. | ||
|
|
||
| bladder -= 50 | ||
| visible_message("[message]") | ||
|
|
| @@ -0,0 +1,179 @@ | ||
| ////////////////////////////////////////////////////////////////////////// | ||
| //This is the file where all the stats and skills procs are kept. // | ||
| //The system is kinda barebones now but I hope to rewrite it to // | ||
| //be betting in the near future. // | ||
| // // | ||
| //Stats are pretty generic, skills are kind of specific. // | ||
| //You should just be able to plop in the proc call wherever you want. // | ||
| //I tried to make it versitile. // | ||
| // - Matt // | ||
| ////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| //defines | ||
| #define CRIT_SUCCESS_NORM 5 | ||
| #define CRIT_FAILURE_NORM 5 | ||
| #define CRIT_SUCCESS 2 | ||
| #define CRIT_FAILURE 3 | ||
|
|
||
|
|
||
| //I am aware this is probably the worst possible way of doing it but I'm using this method till I get a better one. - Matt | ||
| /mob | ||
| var/str = 10 //strength - used for hitting and lifting. | ||
| var/dex = 10 //dexterity - used for dodging and parrying. | ||
| var/int = 10 | ||
|
|
||
| //skills | ||
| var/melee_skill = 50 | ||
| var/ranged_skill = 50 | ||
| var/medical_skill = 20 | ||
| var/engineering_skill = 50 | ||
|
|
||
| //crit shit | ||
| var/crit_success_chance = CRIT_SUCCESS_NORM | ||
| var/crit_failure_chance = CRIT_FAILURE_NORM | ||
| var/crit_success_modifier = 0 | ||
| var/crit_failure_modifier = 0 | ||
| var/crit_mood_modifier = 0 | ||
|
|
||
|
|
||
| /mob/proc/get_success_chance() | ||
| return crit_success_chance + crit_success_modifier + crit_mood_modifier | ||
|
|
||
| /mob/proc/get_failure_chance() | ||
| return crit_failure_chance + crit_failure_modifier + crit_mood_modifier | ||
|
|
||
|
|
||
|
|
||
|
|
||
| /mob/proc/skillcheck(var/skill, var/requirement, var/show_message, var/message = "I have failed to do this.")//1 - 100 | ||
| if(skill >= requirement)//If we already surpass the skill requirements no need to roll. | ||
| if(prob(get_success_chance()))//Only thing we roll for is a crit success. | ||
| return CRIT_SUCCESS | ||
| return 1 | ||
| else | ||
| if(prob(skill + src.mood_affect(0, 1)))//Otherwise we roll to see if we pass. | ||
| if(prob(get_success_chance()))//And again to see if we get a crit scucess. | ||
| return CRIT_SUCCESS | ||
| return 1 | ||
| else | ||
| if(show_message)//If we don't pass then we return failure | ||
| to_chat(src, "<span class = 'warning'>[message]</span>") | ||
| if(prob(get_failure_chance()))//And roll for a crit failure. | ||
| return CRIT_FAILURE | ||
| return 0 | ||
|
|
||
|
|
||
| /mob/proc/statscheck(var/stat, var/requirement, var/show_message, var/message = "I have failed to do this.")//Requirement needs to be 1 through 20 | ||
| if(stat < requirement) | ||
| var/H = rand(1,20)// our "dice" | ||
| H += mood_affect(1)// our skill modifier | ||
| if(stat >= H)//Rolling that d20 | ||
| //world << "Rolled and passed." | ||
| return 1 | ||
| else | ||
| if(show_message)//If we fail then print this message and return 0. | ||
| to_chat(src, "<span class = 'warning'>[message]</span>") | ||
| return 0 | ||
| else | ||
| //world << "Didn't roll and passed." | ||
| return 1 | ||
|
|
||
| //having a bad mood fucks your shit up fam. | ||
| /mob/proc/mood_affect(var/stat = null, var/skill = null) | ||
| if(iscarbon(src)) | ||
| var/mob/living/carbon/C = src | ||
| if(C.happiness <= MOOD_LEVEL_SAD3) | ||
| if(stat) | ||
| return 5 | ||
| if(skill) | ||
| return -15 | ||
|
|
||
|
|
||
| proc/strToDamageModifier(var/strength) | ||
| switch(strength) | ||
| if(1 to 5) | ||
| return 0.5 | ||
|
|
||
| if(6 to 11) | ||
| return 1 | ||
|
|
||
| if(12 to 15) | ||
| return 1.5 | ||
|
|
||
| if(16 to INFINITY) | ||
| return 1.75 | ||
|
|
||
| proc/strToSpeedModifier(var/strength, var/w_class)//Looks messy. Is messy. Is also only used once. But I don't give a fuuuuuuuuck. | ||
| switch(strength) | ||
| if(1 to 5) | ||
| if(w_class > ITEM_SIZE_NORMAL) | ||
| return 20 | ||
|
|
||
| if(6 to 11) | ||
| if(w_class > ITEM_SIZE_NORMAL) | ||
| return 15 | ||
|
|
||
| if(12 to 15) | ||
| if(w_class > ITEM_SIZE_NORMAL) | ||
| return 10 | ||
|
|
||
| if(16 to INFINITY) | ||
| if(w_class > ITEM_SIZE_NORMAL) | ||
| return 5 | ||
|
|
||
| //Stats helpers. | ||
| /mob/proc/add_stats(var/stre, var/dexe, var/inti)//To make adding stats quicker. | ||
| if(stre) | ||
| str = stre | ||
| if(dexe) | ||
| dex = dexe | ||
| if(inti) | ||
| int = inti | ||
|
|
||
|
|
||
| /mob/proc/adjustStrength(var/num) | ||
| str += num | ||
|
|
||
| /mob/proc/adjustDexterity(var/num) | ||
| dex += num | ||
|
|
||
| /mob/proc/adjustInteligence(var/num) | ||
| int += num | ||
|
|
||
|
|
||
|
|
||
| //Skill helpers. | ||
| /mob/proc/skillnumtodesc(var/skill) | ||
| switch(skill) | ||
| if(0 to 25) | ||
| return "<small><i>pathetic</i></small>" | ||
| if(25 to 45) | ||
| return "unskilled" | ||
| if(45 to 60) | ||
| return pick("alright", "ok", "not bad") | ||
| if(60 to 80) | ||
| return "skilled" | ||
| if(80 to INFINITY) | ||
| return "<b>GOD LIKE</b>" | ||
|
|
||
| /mob/proc/add_skills(var/melee, var/ranged, var/medical, var/engineering)//To make adding skills quicker. | ||
| if(melee) | ||
| melee_skill = melee | ||
| if(ranged) | ||
| ranged_skill = ranged | ||
| if(medical) | ||
| medical_skill = medical | ||
| if(engineering) | ||
| engineering_skill = engineering | ||
|
|
||
| /mob/living/carbon/human/verb/check_skills()//Debug tool for checking skills until I add the icon for it to the HUD. | ||
| set name = "Check Skills" | ||
| set category = "IC" | ||
|
|
||
| var/message = "<big><b>Skills:</b></big>\n" | ||
| message += "I am <b>[skillnumtodesc(melee_skill)]</b> at melee.\n" | ||
| message += "I am <b>[skillnumtodesc(ranged_skill)]</b> with guns.</b></i>\n" | ||
| message += "I am <b>[skillnumtodesc(medical_skill)]</b> with medicine.</b></i>\n" | ||
| message += "I am <b>[skillnumtodesc(engineering_skill)]</b> at engineering.</b></i>\n" | ||
|
|
||
| to_chat(src, message) |