This commit is contained in:
RavingManiac
2012-11-18 22:04:20 +08:00
947 changed files with 46298 additions and 39591 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
/obj/hud/proc/ghost_hud()
/datum/hud/proc/ghost_hud()
return
+5 -2
View File
@@ -9,15 +9,16 @@
canmove = 0
blinded = 0
anchored = 1 // don't get pushed around
invisibility = INVISIBILITY_OBSERVER
var/can_reenter_corpse
var/datum/hud/living/carbon/hud = null // hud
var/bootime = 0
var/started_as_observer //This variable is set to 1 when you enter the game as an observer.
//If you died in the game and are a ghsot - this will remain as null.
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
universal_speak = 1
/mob/dead/observer/New(mob/body)
invisibility = INVISIBILITY_OBSERVER
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
see_invisible = SEE_INVISIBLE_OBSERVER
see_in_dark = 100
@@ -178,7 +179,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(istype(usr, /mob/dead/observer))
var/list/mobs = getmobs()
var/input = input("Please, select a mob!", "Follow Mob", null, null) as null|anything in mobs
var/input = input("Please, select a mob!", "Haunt", null, null) as null|anything in mobs
var/mob/target = mobs[input]
if(target && target != usr)
spawn(0)
@@ -187,6 +188,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/turf/T = get_turf(target)
if(!T)
break
if(!client)
break
src.loc = T
pos = src.loc
sleep(15)
+3 -2
View File
@@ -18,7 +18,7 @@
return
. = src.say_dead(message)
/*
for (var/mob/M in hearers(null, null))
if (!M.stat)
if(M.job == "Chaplain")
@@ -41,4 +41,5 @@
else
M.show_message("<span class='game'><i>You hear muffled speech... you can almost make out some words...</i></span>", 2)
// M.show_message("<span class='game'><i>[stutter(message)]</i></span>", 2)
playsound(src.loc, pick('sound/effects/ghost.ogg','sound/effects/ghost2.ogg'), 10, 1)
playsound(src.loc, pick('sound/effects/ghost.ogg','sound/effects/ghost2.ogg'), 10, 1)
*/
+1 -1
View File
@@ -31,7 +31,7 @@ mob/proc/custom_emote(var/m_type=1,var/message = null)
if (istype(M, /mob/new_player))
continue
if(findtext(message," snores.")) //Because we have so many sleeping people.
continue
break
if(M.stat == 2 && M.client.ghost_sight && !(M in viewers(src,null)))
M.show_message(message)
+102 -3
View File
@@ -16,9 +16,6 @@
if(hand) return r_hand
else return l_hand
/mob/proc/equipped()
return get_active_hand()
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(var/obj/item/W)
if(lying) return 0
@@ -216,3 +213,105 @@
//if(hasvar(src,"r_hand")) if(src:r_hand) items += src:r_hand
return items
/** BS12's proc to get the item in the active hand. Couldn't find the /tg/ equivalent. **/
/mob/proc/equipped()
if(issilicon(src))
if(isrobot(src))
if(src:module_active)
return src:module_active
else
if (hand)
return l_hand
else
return r_hand
return
/mob/living/carbon/human/proc/equip_if_possible(obj/item/W, slot, del_on_fail = 1) // since byond doesn't seem to have pointers, this seems like the best way to do this :/
//warning: icky code
var/equipped = 0
switch(slot)
if(slot_back)
if(!src.back)
src.back = W
equipped = 1
if(slot_wear_mask)
if(!src.wear_mask)
src.wear_mask = W
equipped = 1
if(slot_handcuffed)
if(!src.handcuffed)
src.handcuffed = W
equipped = 1
if(slot_l_hand)
if(!src.l_hand)
src.l_hand = W
equipped = 1
if(slot_r_hand)
if(!src.r_hand)
src.r_hand = W
equipped = 1
if(slot_belt)
if(!src.belt && src.w_uniform)
src.belt = W
equipped = 1
if(slot_wear_id)
if(!src.wear_id && src.w_uniform)
src.wear_id = W
equipped = 1
if(slot_ears)
if(!src.ears)
src.ears = W
equipped = 1
if(slot_glasses)
if(!src.glasses)
src.glasses = W
equipped = 1
if(slot_gloves)
if(!src.gloves)
src.gloves = W
equipped = 1
if(slot_head)
if(!src.head)
src.head = W
equipped = 1
if(slot_shoes)
if(!src.shoes)
src.shoes = W
equipped = 1
if(slot_wear_suit)
if(!src.wear_suit)
src.wear_suit = W
equipped = 1
if(slot_w_uniform)
if(!src.w_uniform)
src.w_uniform = W
equipped = 1
if(slot_l_store)
if(!src.l_store && src.w_uniform)
src.l_store = W
equipped = 1
if(slot_r_store)
if(!src.r_store && src.w_uniform)
src.r_store = W
equipped = 1
if(slot_s_store)
if(!src.s_store && src.wear_suit)
src.s_store = W
equipped = 1
if(slot_in_backpack)
if (src.back && istype(src.back, /obj/item/weapon/storage/backpack))
var/obj/item/weapon/storage/backpack/B = src.back
if(B.contents.len < B.storage_slots && W.w_class <= B.max_w_class)
W.loc = B
equipped = 1
if(equipped)
W.layer = 20
if(src.back && W.loc != src.back)
W.loc = src
else
if (del_on_fail)
del(W)
return equipped
+132 -9
View File
@@ -1,3 +1,7 @@
#define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point
#define HEAT_DAMAGE_LEVEL_2 4 //Amount of damage applied when your body temperature passes the 400K point
#define HEAT_DAMAGE_LEVEL_3 8 //Amount of damage applied when your body temperature passes the 1000K point
/mob/living/carbon/alien
name = "alien"
voice_name = "alien"
@@ -20,29 +24,145 @@
var/heal_rate = 5
var/plasma_rate = 5
var/oxygen_alert = 0
var/toxins_alert = 0
var/fire_alert = 0
var/heat_protection = 0.5
/mob/living/carbon/alien/adjustToxLoss(amount)
storedPlasma = min(max(storedPlasma + amount,0),max_plasma) //upper limit of max_plasma, lower limit of 0
return
/mob/living/carbon/alien/adjustFireLoss(amount) // Weak to Fire
if(amount > 0)
..(amount * 1.5)
else
..(amount)
return
/mob/living/carbon/alien/proc/getPlasma()
return storedPlasma
/mob/living/carbon/alien/eyecheck()
return 2
/mob/living/carbon/alien/New()
..()
/mob/living/carbon/alien/updatehealth()
if(nodamage)
health = maxHealth
stat = CONSCIOUS
else
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
health = maxHealth - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
for(var/obj/item/clothing/mask/facehugger/facehugger in world)
if(facehugger.stat == CONSCIOUS)
var/image/activeIndicator = image('icons/mob/alien.dmi', loc = facehugger, icon_state = "facehugger_active")
activeIndicator.override = 1
if(client)
client.images += activeIndicator
/mob/living/carbon/alien/proc/handle_environment(var/datum/gas_mixture/environment)
//If there are alien weeds on the ground then heal if needed or give some toxins
if(locate(/obj/effect/alien/weeds) in loc)
if(health >= maxHealth)
adjustToxLoss(plasma_rate)
else
adjustBruteLoss(-heal_rate)
adjustFireLoss(-heal_rate)
adjustOxyLoss(-heal_rate)
if(!environment)
return
var/loc_temp = T0C
if(istype(loc, /obj/mecha))
var/obj/mecha/M = loc
loc_temp = M.return_temperature()
else if(istype(get_turf(src), /turf/space))
var/turf/heat_turf = get_turf(src)
loc_temp = heat_turf.temperature
else if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
loc_temp = loc:air_contents.temperature
else
loc_temp = environment.temperature
//world << "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Fire protection: [heat_protection] - Location: [loc] - src: [src]"
// Aliens are now weak to fire.
//After then, it reacts to the surrounding atmosphere based on your thermal protection
if(loc_temp > bodytemperature)
//Place is hotter than we are
var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to.
if(thermal_protection < 1)
bodytemperature += (1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
else
bodytemperature += 1 * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
// bodytemperature -= max((loc_temp - bodytemperature / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature > 360.15)
//Body temperature is too hot.
fire_alert = max(fire_alert, 1)
switch(bodytemperature)
if(360 to 400)
apply_damage(HEAT_DAMAGE_LEVEL_1, BURN)
fire_alert = max(fire_alert, 2)
if(400 to 1000)
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
fire_alert = max(fire_alert, 2)
if(1000 to INFINITY)
apply_damage(HEAT_DAMAGE_LEVEL_3, BURN)
fire_alert = max(fire_alert, 2)
return
/mob/living/carbon/alien/proc/handle_mutations_and_radiation()
if(getFireLoss())
if((COLD_RESISTANCE in mutations) || prob(5))
adjustFireLoss(-1)
// Aliens love radiation nom nom nom
if (radiation)
if (radiation > 100)
radiation = 100
if (radiation < 0)
radiation = 0
switch(radiation)
if(1 to 49)
radiation--
if(prob(25))
adjustToxLoss(1)
if(50 to 74)
radiation -= 2
adjustToxLoss(1)
if(prob(5))
radiation -= 5
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
/mob/living/carbon/alien/IsAdvancedToolUser()
return has_fine_manipulation
/mob/living/carbon/alien/Process_Spaceslipping()
return 0 // Don't slip in space.
/mob/living/carbon/alien/Stat()
statpanel("Status")
stat(null, "Intent: [a_intent]")
stat(null, "Move Mode: [m_intent]")
..()
if (client.statpanel == "Status")
stat(null, "Plasma Stored: [getPlasma()]/[max_plasma]")
if(emergency_shuttle)
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
/mob/living/carbon/alien/Stun(amount)
if(status_flags & CANSTUN)
@@ -59,7 +179,7 @@ Des: Gives the client of the alien an image on each infected mob.
----------------------------------------*/
/mob/living/carbon/alien/proc/AddInfectionImages()
if (client)
for (var/mob/living/carbon/C in world)
for (var/mob/living/carbon/C in mob_list)
if(C.status_flags & XENO_HOST)
var/I = image('icons/mob/alien.dmi', loc = C, icon_state = "infected")
client.images += I
@@ -77,3 +197,6 @@ Des: Removes all infected images from the alien.
del(I)
return
#undef HEAT_DAMAGE_LEVEL_1
#undef HEAT_DAMAGE_LEVEL_2
#undef HEAT_DAMAGE_LEVEL_3
@@ -30,6 +30,7 @@ Doesn't work on other aliens/AI.*/
new /obj/effect/alien/weeds/node(loc)
return
/*
/mob/living/carbon/alien/humanoid/verb/ActivateHuggers()
set name = "Activate facehuggers (5)"
set desc = "Makes all nearby facehuggers activate"
@@ -41,7 +42,7 @@ Doesn't work on other aliens/AI.*/
F.GoActive()
emote("roar")
return
*/
/mob/living/carbon/alien/humanoid/verb/whisp(mob/M as mob in oview())
set name = "Whisper (10)"
set desc = "Whisper to someone"
@@ -14,23 +14,33 @@
src.name = text("alien drone ([rand(1, 1000)])")
src.real_name = src.name
verbs.Add(/mob/living/carbon/alien/humanoid/proc/resin,/mob/living/carbon/alien/humanoid/proc/corrosive_acid)
verbs -= /mob/living/carbon/alien/humanoid/verb/ActivateHuggers //<-- pointless
//verbs -= /mob/living/carbon/alien/humanoid/verb/ActivateHuggers //<-- pointless
add_to_mob_list(src)
//Drones use the same base as generic humanoids.
//Drone verbs
/mob/living/carbon/alien/humanoid/drone/verb/evolve() // -- TLE
set name = "Evolve (500)"
set desc = "Produce an interal egg sac capable of spawning children"
set desc = "Produce an interal egg sac capable of spawning children. Only one queen can exist at a time."
set category = "Alien"
if(powerc(500))
adjustToxLoss(-500)
src << "\green You begin to evolve!"
for(var/mob/O in viewers(src, null))
O.show_message(text("\green <B>[src] begins to twist and contort!</B>"), 1)
var/mob/living/carbon/alien/humanoid/queen/new_xeno = new (loc)
new_xeno.UI = UI
mind.transfer_to(new_xeno)
del(src)
// Queen check
var/no_queen = 1
for(var/mob/living/carbon/alien/humanoid/queen/Q in living_mob_list)
if(!Q.key && Q.brain_op_stage != 4)
continue
no_queen = 0
if(no_queen)
adjustToxLoss(-500)
src << "\green You begin to evolve!"
for(var/mob/O in viewers(src, null))
O.show_message(text("\green <B>[src] begins to twist and contort!</B>"), 1)
var/mob/living/carbon/alien/humanoid/queen/new_xeno = new (loc)
new_xeno.UI = UI
mind.transfer_to(new_xeno)
del(src)
else
src << "<span class='notice'>We already have an alive queen.</span>"
return
@@ -1,42 +1,12 @@
/obj/hud/proc/alien_hud()
/datum/hud/proc/alien_hud()
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new src.h_type( src )
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
@@ -47,45 +17,55 @@
action_intent = using
//intent small hud objects
using = new src.h_type( src )
var/icon/ico
ico = new('icons/mob/screen1_alien.dmi', "black")
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.icon = 'screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "help" ? "help_small_active" : "help_small")
using.screen_loc = ui_help_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
using = new src.h_type( src )
ico = new('icons/mob/screen1_alien.dmi', "black")
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.icon = 'screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "disarm" ? "disarm_small_active" : "disarm_small")
using.screen_loc = ui_disarm_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
using = new src.h_type( src )
ico = new('icons/mob/screen1_alien.dmi', "black")
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.icon = 'screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "grab" ? "grab_small_active" : "grab_small")
using.screen_loc = ui_grab_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
using = new src.h_type( src )
ico = new('icons/mob/screen1_alien.dmi', "black")
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.icon = 'screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm_small_active" : "harm_small")
using.screen_loc = ui_harm_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new src.h_type( src )
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
@@ -95,50 +75,7 @@
src.adding += using
move_intent = using
/*
using = new src.h_type(src) //Right hud bar
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.screen_loc = "EAST+1,SOUTH to EAST+1,NORTH"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Lower hud bar
using.dir = EAST
using.icon = 'icons/mob/screen1_alien.dmi'
using.screen_loc = "WEST,SOUTH-1 to EAST,SOUTH-1"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Corner Button
using.dir = NORTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.screen_loc = "EAST+1,SOUTH-1"
using.layer = 19
src.adding += using
*/
/*
using = new src.h_type( src )
using.name = "arrowleft"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "s_arrow"
using.dir = WEST
using.screen_loc = ui_iarrowleft
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "arrowright"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "s_arrow"
using.dir = EAST
using.screen_loc = ui_iarrowright
using.layer = 19
src.adding += using
*/
using = new src.h_type( src )
using = new /obj/screen()
using.name = "drop"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_drop"
@@ -146,11 +83,9 @@
using.layer = 19
src.adding += using
//equippable shit
//suit
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "o_clothing"
inv_box.dir = SOUTH
inv_box.icon = 'icons/mob/screen1_alien.dmi'
@@ -160,7 +95,7 @@
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
@@ -173,7 +108,7 @@
inv_box.slot_id = slot_r_hand
src.adding += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
@@ -186,7 +121,7 @@
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory( src )
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
@@ -195,7 +130,7 @@
using.layer = 19
src.adding += using
using = new /obj/screen/inventory( src )
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
@@ -205,7 +140,7 @@
src.adding += using
//pocket 1
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
@@ -215,7 +150,7 @@
src.adding += inv_box
//pocket 2
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
@@ -225,7 +160,7 @@
src.adding += inv_box
//head
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hair"
@@ -236,7 +171,7 @@
//end of equippable shit
/*
using = new src.h_type( src )
using = new /obj/screen()
using.name = "resist"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_resist"
@@ -245,114 +180,57 @@
src.adding += using
*/
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "1,1 to 5,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "5,1 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "11,1 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = 'icons/mob/screen1_alien.dmi'
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.oxygen = new /obj/screen( null )
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_alien_oxygen
mymob.toxin = new /obj/screen( null )
mymob.toxin = new /obj/screen()
mymob.toxin.icon = 'icons/mob/screen1_alien.dmi'
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_alien_toxin
mymob.fire = new /obj/screen( null )
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_alien_fire
mymob.healths = new /obj/screen( null )
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_alien.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.pullin = new /obj/screen( null )
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen( null )
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen( null )
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
/*
mymob.hands = new /obj/screen( null )
mymob.hands.icon = 'icons/mob/screen1_alien.dmi'
mymob.hands.icon_state = "hand"
mymob.hands.name = "hand"
mymob.hands.screen_loc = ui_hand
mymob.hands.dir = NORTH
mymob.sleep = new /obj/screen( null )
mymob.sleep.icon = 'icons/mob/screen1_alien.dmi'
mymob.sleep.icon_state = "sleep0"
mymob.sleep.name = "sleep"
mymob.sleep.screen_loc = ui_sleep
mymob.rest = new /obj/screen( null )
mymob.rest.icon = 'icons/mob/screen1_alien.dmi'
mymob.rest.icon_state = "rest0"
mymob.rest.name = "rest"
mymob.rest.screen_loc = ui_rest
*/
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi'
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
@@ -60,20 +60,6 @@
tally = -1 // hunters go supersuperfast
return (tally + move_delay_add + config.alien_delay)
//This needs to be fixed
/mob/living/carbon/alien/humanoid/Stat()
..()
statpanel("Status")
if (client && client.holder)
stat(null, "([x], [y], [z])")
stat(null, "Intent: [a_intent]")
stat(null, "Move Mode: [m_intent]")
if (client.statpanel == "Status")
stat(null, "Plasma Stored: [getPlasma()]")
///mob/living/carbon/alien/humanoid/bullet_act(var/obj/item/projectile/Proj) taken care of in living
/mob/living/carbon/alien/humanoid/emp_act(severity)
@@ -87,15 +73,6 @@
if(!blinded)
flick("flash", flash)
if (stat == 2 && client)
gib()
return
else if (stat == 2 && !client)
xgibs(loc, viruses)
del(src)
return
var/shielded = 0
var/b_loss = null
@@ -427,7 +404,7 @@
if ((HULK in M.mutations) || (SUPRSTR in M.augmentations))//HULK SMASH
damage += 14
spawn(0)
Paralyse(5)
Weaken(damage) // Why can a hulk knock an alien out but not knock out a human? Damage is robust enough.
step_away(src,M,15)
sleep(3)
step_away(src,M,15)
@@ -538,13 +515,4 @@ In all, this is a lot like the monkey code. /N
onclose(user, "mob[name]")
return
/mob/living/carbon/alien/humanoid/updatehealth()
if(nodamage)
health = maxHealth
stat = CONSCIOUS
else
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
health = maxHealth - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
@@ -1,9 +1,9 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
/mob/living/carbon/alien/humanoid
var/oxygen_alert = 0
var/toxins_alert = 0
var/fire_alert = 0
oxygen_alert = 0
toxins_alert = 0
fire_alert = 0
var/temperature_alert = 0
@@ -17,6 +17,8 @@
..()
var/datum/gas_mixture/environment = loc.return_air()
if (stat != DEAD) //still breathing
//First, resolve location and get a breath
@@ -49,7 +51,7 @@
//handle_virus_updates() There is no disease that affects aliens
//Handle temperature/pressure differences between body and environment
handle_environment()
handle_environment(environment)
//stuff in the stomach
handle_stomach()
@@ -90,60 +92,6 @@
stuttering = max(10, stuttering)
proc/handle_mutations_and_radiation()
if(getFireLoss())
if((COLD_RESISTANCE in mutations) || prob(50))
switch(getFireLoss())
if(1 to 50)
adjustFireLoss(-1)
if(51 to 100)
adjustFireLoss(-5)
if ((HULK in mutations) && health <= 25)
mutations.Remove(HULK)
src << "\red You suddenly feel very weak."
Weaken(3)
emote("collapse")
if (radiation)
if (radiation > 100)
radiation = 100
Weaken(10)
src << "\red You feel weak."
emote("collapse")
if (radiation < 0)
radiation = 0
switch(radiation)
if(1 to 49)
radiation--
if(prob(25))
adjustToxLoss(1)
updatehealth()
if(50 to 74)
radiation -= 2
adjustToxLoss(1)
if(prob(5))
radiation -= 5
Weaken(3)
src << "\red You feel weak."
emote("collapse")
updatehealth()
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
if(prob(1))
src << "\red You mutate!"
randmutb(src)
domutcheck(src,null)
emote("gasp")
updatehealth()
proc/breathe()
if(reagents)
if(reagents.has_reagent("lexorin")) return
@@ -257,18 +205,6 @@
return 1
proc/handle_environment()
//If there are alien weeds on the ground then heal if needed or give some toxins
if(locate(/obj/effect/alien/weeds) in loc)
if(health >= maxHealth)
adjustToxLoss(plasma_rate)
else
adjustBruteLoss(-heal_rate)
adjustFireLoss(-heal_rate)
adjustOxyLoss(-heal_rate)
proc/adjust_body_temperature(current, loc_temp, boost)
@@ -334,12 +270,12 @@
if(prob(round((50 - nutrition) / 100)))
src << "\blue You feel fit again!"
mutations.Remove(FAT)
else
/* else
if(nutrition > 500)
if(prob(5 + round((nutrition - 200) / 2)))
src << "\red You suddenly feel blubbery!"
mutations.Add(FAT)
FUCK YOU FATCODE -Hawk */
if (nutrition > 0)
nutrition -= HUNGER_FACTOR
@@ -456,9 +392,6 @@
see_in_dark = 4
see_invisible = SEE_INVISIBLE_LEVEL_TWO
if (sleep) sleep.icon_state = text("sleep[]", sleeping)
if (rest) rest.icon_state = text("rest[]", resting)
if (healths)
if (stat != 2)
switch(health)
@@ -486,9 +419,7 @@
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
//blame the person who coded them. Temporary fix added.
client.screen -= hud_used.blurry
client.screen -= hud_used.druggy
client.screen -= hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
@@ -497,13 +428,13 @@
blind.layer = 0
if (disabilities & NEARSIGHTED)
client.screen += hud_used.vimpaired
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += hud_used.blurry
client.screen += global_hud.blurry
if (druggy)
client.screen += hud_used.druggy
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
@@ -6,7 +6,7 @@
health = 250
icon_state = "alienq_s"
nopush = 1
heal_rate = 5
heal_rate = 10 // Let's regenerate more than our average underling.
plasma_rate = 20
+13 -146
View File
@@ -1,43 +1,12 @@
/datum/hud/proc/larva_hud()
/obj/hud/proc/larva_hud()
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
src.adding = list()
src.other = list()
var/obj/screen/using
using = new src.h_type( src )
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
@@ -47,7 +16,7 @@
src.adding += using
action_intent = using
using = new src.h_type( src )
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
@@ -57,155 +26,53 @@
src.adding += using
move_intent = using
/*
using = new src.h_type(src) //Right hud bar
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.screen_loc = "EAST+1,SOUTH to EAST+1,NORTH"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Lower hud bar
using.dir = EAST
using.icon = 'icons/mob/screen1_alien.dmi'
using.screen_loc = "WEST,SOUTH-1 to EAST,SOUTH-1"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Corner Button
using.dir = NORTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.screen_loc = "EAST+1,SOUTH-1"
using.layer = 19
src.adding += using
*/
/*
using = new src.h_type( src )
using.name = "arrowleft"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "s_arrow"
using.dir = WEST
using.screen_loc = ui_iarrowleft
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "arrowright"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "s_arrow"
using.dir = EAST
using.screen_loc = ui_iarrowright
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "resist"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_resist"
using.screen_loc = ui_resist
using.layer = 19
src.adding += using
*/
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "1,1 to 5,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "5,1 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "11,1 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
mymob.oxygen = new /obj/screen( null )
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_alien_oxygen
mymob.toxin = new /obj/screen( null )
mymob.toxin = new /obj/screen()
mymob.toxin.icon = 'icons/mob/screen1_alien.dmi'
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_alien_toxin
mymob.fire = new /obj/screen( null )
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_alien_fire
mymob.healths = new /obj/screen( null )
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_alien.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.pullin = new /obj/screen( null )
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen( null )
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen( null )
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
/*
mymob.sleep = new /obj/screen( null )
mymob.sleep.icon = 'icons/mob/screen1_alien.dmi'
mymob.sleep.icon_state = "sleep0"
mymob.sleep.name = "sleep"
mymob.sleep.screen_loc = ui_sleep
mymob.rest = new /obj/screen( null )
mymob.rest.icon = 'icons/mob/screen1_alien.dmi'
mymob.rest.icon_state = "rest0"
mymob.rest.name = "rest"
mymob.rest.screen_loc = ui_rest
*/
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
@@ -6,6 +6,8 @@
maxHealth = 25
health = 25
storedPlasma = 50
max_plasma = 50
var/amount_grown = 0
var/max_grown = 200
@@ -56,39 +58,18 @@
//This needs to be fixed
/mob/living/carbon/alien/larva/Stat()
..()
stat(null, "Progress: [amount_grown]/[max_grown]")
statpanel("Status")
if (client && client.holder)
stat(null, "([x], [y], [z])")
stat(null, "Intent: [a_intent]")
stat(null, "Move Mode: [m_intent]")
if (client.statpanel == "Status")
stat(null, "Progress: [amount_grown]/[max_grown]")
stat(null, "Plasma Stored: [getPlasma()]")
///mob/living/carbon/alien/larva/bullet_act(var/obj/item/projectile/Proj) taken care of in living
/mob/living/carbon/alien/larva/emp_act(severity)
..()
/mob/living/carbon/alien/larva/adjustToxLoss(amount)
if(stat != DEAD)
amount_grown = min(amount_grown + 1, max_grown)
..(amount)
/mob/living/carbon/alien/larva/ex_act(severity)
if(!blinded)
flick("flash", flash)
if (stat == 2 && client)
gib()
return
else if (stat == 2 && !client)
gibs(loc, viruses)
del(src)
return
var/b_loss = null
var/f_loss = null
switch (severity)
@@ -1,9 +1,6 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
/mob/living/carbon/alien/larva
var/oxygen_alert = 0
var/toxins_alert = 0
var/fire_alert = 0
var/temperature_alert = 0
@@ -16,8 +13,13 @@
return
..()
var/datum/gas_mixture/enviroment = loc.return_air()
if (stat != DEAD) //still breathing
// GROW!
if(amount_grown < max_grown)
amount_grown++
//First, resolve location and get a breath
if(air_master.current_cycle%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
@@ -43,7 +45,7 @@
//handle_virus_updates() There is no disease that affects larva
//Handle temperature/pressure differences between body and environment
handle_environment()
handle_environment(enviroment)
//stuff in the stomach
//handle_stomach()
@@ -61,43 +63,6 @@
/mob/living/carbon/alien/larva
proc/handle_mutations_and_radiation()
//grow!! but not if metroid or dead
if(stat != DEAD && amount_grown < max_grown)
amount_grown++
if (radiation)
if (radiation > 100)
radiation = 100
Weaken(10)
src << "\red You feel weak."
emote("collapse")
if (radiation < 0)
radiation = 0
switch(radiation)
if(1 to 49)
radiation--
if(prob(25))
adjustToxLoss(1)
updatehealth()
if(50 to 74)
radiation -= 2
adjustToxLoss(1)
if(prob(5))
radiation -= 5
Weaken(3)
src << "\red You feel weak."
emote("collapse")
updatehealth()
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
updatehealth()
proc/breathe()
@@ -212,18 +177,6 @@
return 1
proc/handle_environment()
//If there are alien weeds on the ground then heal if needed or give some toxins
if(locate(/obj/effect/alien/weeds) in loc)
if(health >= 25)
adjustToxLoss(5)
else
adjustBruteLoss(-5)
adjustFireLoss(-5)
return
proc/handle_chemicals_in_body()
if(reagents) reagents.metabolize(src)
@@ -233,12 +186,12 @@
if(prob(round((50 - nutrition) / 100)))
src << "\blue You feel fit again!"
mutations.Add(FAT)
else
/* else
if(nutrition > 500)
if(prob(5 + round((nutrition - max_grown) / 2)))
src << "\red You suddenly feel blubbery!"
mutations.Add(FAT)
FUCK YOU MORE FAT CODE -Hawk*/
if (nutrition > 0)
nutrition-= HUNGER_FACTOR
@@ -269,23 +222,23 @@
blinded = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
if(health < config.health_threshold_dead || brain_op_stage == 4.0)
if(health < -25 || brain_op_stage == 4.0)
death()
blinded = 1
silent = 0
return 1
//UNCONSCIOUS. NO-ONE IS HOME
if( (getOxyLoss() > 50) || (config.health_threshold_crit > health) )
if( health <= 20 && prob(1) )
spawn(0)
emote("gasp")
if( (getOxyLoss() > 50) || (0 > health) )
//if( health <= 20 && prob(1) )
// spawn(0)
// emote("gasp")
if(!reagents.has_reagent("inaprovaline"))
adjustOxyLoss(1)
Paralyse(3)
if(paralysis)
AdjustParalysis(-1)
AdjustParalysis(-2)
blinded = 1
stat = UNCONSCIOUS
else if(sleeping)
@@ -353,9 +306,6 @@
see_in_dark = 4
see_invisible = SEE_INVISIBLE_LEVEL_TWO
if (sleep) sleep.icon_state = text("sleep[]", sleeping)
if (rest) rest.icon_state = text("rest[]", resting)
if (healths)
if (stat != 2)
switch(health)
@@ -384,9 +334,7 @@
//blame the person who coded them. Temporary fix added.
client.screen -= hud_used.blurry
client.screen -= hud_used.druggy
client.screen -= hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
@@ -395,13 +343,13 @@
blind.layer = 0
if (disabilities & NEARSIGHTED)
client.screen += hud_used.vimpaired
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += hud_used.blurry
client.screen += global_hud.blurry
if (druggy)
client.screen += hud_used.druggy
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
@@ -5,18 +5,19 @@
var/const/MIN_IMPREGNATION_TIME = 100 //time it takes to impregnate someone
var/const/MAX_IMPREGNATION_TIME = 150
var/const/MIN_ACTIVE_TIME = 300 //time between being dropped and going idle
var/const/MAX_ACTIVE_TIME = 600
var/const/MIN_ACTIVE_TIME = 200 //time between being dropped and going idle
var/const/MAX_ACTIVE_TIME = 400
/obj/item/clothing/mask/facehugger
name = "alien"
desc = "It has some sort of a tube at the end of its tail."
icon = 'icons/mob/alien.dmi'
icon_state = "facehugger"
item_state = "facehugger"
w_class = 1 //note: can be picked up by aliens unlike most other items of w_class below 4
flags = FPRINT|TABLEPASS|MASKCOVERSMOUTH|MASKCOVERSEYES
var/stat = UNCONSCIOUS //UNCONSCIOUS is the idle state in this case
var/stat = CONSCIOUS //UNCONSCIOUS is the idle state in this case
var/sterile = 0
@@ -24,235 +25,196 @@ var/const/MAX_ACTIVE_TIME = 600
var/attached = 0
attack_paw(user as mob) //can be picked up by aliens
if(isalien(user))
attack_hand(user)
return
else
..()
return
attack_hand(user as mob)
if(stat == CONSCIOUS && !isalien(user))
Attach(user)
return
else
..()
return
attack(mob/living/M as mob, mob/user as mob)
/obj/item/clothing/mask/facehugger/attack_paw(user as mob) //can be picked up by aliens
if(isalien(user))
attack_hand(user)
return
else
..()
user.drop_from_inventory(src)
Attach(M)
New()
if(aliens_allowed)
..()
else
del(src)
examine()
..()
switch(stat)
if(DEAD,UNCONSCIOUS)
usr << "\red \b [src] is not moving."
if(CONSCIOUS)
usr << "\red \b [src] seems to be active."
if (sterile)
usr << "\red \b It looks like the proboscis has been removed."
return
attackby()
/obj/item/clothing/mask/facehugger/attack_hand(user as mob)
if(stat == CONSCIOUS && !isalien(user))
Attach(user)
return
else
..()
return
/obj/item/clothing/mask/facehugger/attack(mob/living/M as mob, mob/user as mob)
..()
user.drop_from_inventory(src)
Attach(M)
/obj/item/clothing/mask/facehugger/New()
if(aliens_allowed)
..()
else
del(src)
/obj/item/clothing/mask/facehugger/examine()
..()
switch(stat)
if(DEAD,UNCONSCIOUS)
usr << "\red \b [src] is not moving."
if(CONSCIOUS)
usr << "\red \b [src] seems to be active."
if (sterile)
usr << "\red \b It looks like the proboscis has been removed."
return
/obj/item/clothing/mask/facehugger/attackby()
Die()
return
/obj/item/clothing/mask/facehugger/bullet_act()
Die()
return
/obj/item/clothing/mask/facehugger/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
Die()
return
/obj/item/clothing/mask/facehugger/equipped(mob/M)
Attach(M)
/obj/item/clothing/mask/facehugger/HasEntered(atom/target)
HasProximity(target)
return
/obj/item/clothing/mask/facehugger/dropped()
..()
GoActive()
return
/obj/item/clothing/mask/facehugger/throw_impact(atom/hit_atom)
Attach(hit_atom)
return
/obj/item/clothing/mask/facehugger/proc/Attach(M as mob)
if(!iscarbon(M) || isalien(M))
return
bullet_act()
Die()
if(attached)
return
else
attached++
spawn(MAX_IMPREGNATION_TIME)
attached = 0
temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
Die()
return
var/mob/living/L = M //just so I don't need to use :
equipped(mob/M)
Attach(M)
if(stat != CONSCIOUS) return
if(!sterile) L.take_organ_damage(strength,0) //done here so that even borgs and humans in helmets take damage
HasEntered(atom/target)
Attach(target)
return
var/mob/living/carbon/target = L
dropped()
..()
GoActive()
return
for(var/mob/O in viewers(target, null))
O.show_message("\red \b [src] leaps at [target]'s face!", 1)
throw_impact(atom/hit_atom)
Attach(hit_atom)
return
proc/Attach(M as mob)
if(!isliving(M) || isalien(M))
return
if(attached)
return
else
attached++
spawn(MAX_IMPREGNATION_TIME)
attached = 0
var/mob/living/L = M //just so I don't need to use :
if(stat != CONSCIOUS) return
if(!sterile) L.take_organ_damage(strength,0) //done here so that even borgs and humans in helmets take damage
if(issilicon(L))
for(var/mob/O in viewers(src, null))
O.show_message("\red \b [src] smashes against [L]'s frame!", 1)
if(ishuman(target))
var/mob/living/carbon/human/H = target
if(H.head && H.head.flags & HEADCOVERSMOUTH)
for(var/mob/O in viewers(H, null))
O.show_message("\red \b [src] smashes against [H]'s [H.head]!", 1)
Die()
return
var/mob/living/carbon/target = L
if(target.wear_mask)
if(prob(20)) return
var/obj/item/clothing/W = target.wear_mask
if(!W.canremove) return
target.drop_from_inventory(W)
for(var/mob/O in viewers(target, null))
O.show_message("\red \b [src] leaps at [target]'s face!", 1)
O.show_message("\red \b [src] tears [W] off of [target]'s face!", 1)
if(ishuman(target))
var/mob/living/carbon/human/H = target
if(H.head && H.head.flags & HEADCOVERSMOUTH)
for(var/mob/O in viewers(H, null))
O.show_message("\red \b [src] smashes against [H]'s [H.head]!", 1)
Die()
return
loc = target
layer = 20
target.wear_mask = src
target.update_inv_wear_mask()
if(target.wear_mask)
if(prob(20)) return
var/obj/item/clothing/W = target.wear_mask
if(!W.canremove) return
target.drop_from_inventory(W)
GoIdle() //so it doesn't jump the people that tear it off
for(var/mob/O in viewers(target, null))
O.show_message("\red \b [src] tears [W] off of [target]'s face!", 1)
if(!sterile) target.Paralyse(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings
loc = target
layer = 20
target.wear_mask = src
target.update_inv_wear_mask()
GoIdle() //so it doesn't jump the people that tear it off
if(!sterile) target.Paralyse(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings
spawn(rand(MIN_IMPREGNATION_TIME,MAX_IMPREGNATION_TIME))
Impregnate(target)
return
proc/Impregnate(mob/living/carbon/target as mob)
if(!target || target.wear_mask != src || target.stat == DEAD) //was taken off or something
return
if(!sterile)
target.contract_disease(new /datum/disease/alien_embryo(0)) //so infection chance is same as virus infection chance
for(var/datum/disease/alien_embryo/A in target.viruses)
target.status_flags |= XENO_HOST
break
for(var/mob/O in viewers(target,null))
O.show_message("\red \b [src] falls limp after violating [target]'s face!", 1)
Die()
else
for(var/mob/O in viewers(target,null))
O.show_message("\red \b [src] violates [target]'s face!", 1)
target.update_inv_wear_mask()
return
proc/GoActive()
if(stat == DEAD || stat == CONSCIOUS)
return
stat = CONSCIOUS
/* for(var/mob/living/carbon/alien/alien in world)
var/image/activeIndicator = image('icons/mob/alien.dmi', loc = src, icon_state = "facehugger_active")
activeIndicator.override = 1
if(alien && alien.client)
alien.client.images += activeIndicator */
spawn(rand(MIN_ACTIVE_TIME,MAX_ACTIVE_TIME))
GoIdle()
return
proc/GoIdle()
if(stat == DEAD || stat == UNCONSCIOUS)
return
/* RemoveActiveIndicators() */
stat = UNCONSCIOUS
return
proc/Die()
if(stat == DEAD)
return
/* RemoveActiveIndicators() */
icon_state = "facehugger_dead"
stat = DEAD
for(var/mob/O in viewers(src, null))
O.show_message("\red \b[src] curls up into a ball!", 1)
return
/* proc/RemoveActiveIndicators() //removes the "active" facehugger indicator from all aliens in the world for this hugger
for(var/mob/living/carbon/alien/alien in world)
if(alien.client)
for(var/image/image in alien.client.images)
if(image.icon_state == "facehugger_active" && image.loc == src)
del(image)
return */
/obj/item/clothing/mask/facehugger/angry
stat = CONSCIOUS
/obj/item/clothing/mask/facehugger/angry/HasProximity(atom/movable/AM as mob|obj)
if(istype(AM , /mob/living/))
Attach(AM)
/*
/obj/item/clothing/mask/facehugger/angry/New()
processing_objects.Add(src)
/obj/item/clothing/mask/facehugger/angry/process()
if(!src || src.stat == (DEAD))
return
for(var/mob/living/carbon/C in range(1,src))
Attach(C)
return
for(var/mob/living/carbon/C in range(5,src))
if(isInSight(C,src))
step_to(src,C,0)
spawn(5)
if(C in range(1,src))
Attach(C)
return
step_rand(src)
spawn(rand(MIN_IMPREGNATION_TIME,MAX_IMPREGNATION_TIME))
Impregnate(target)
return
/obj/item/clothing/mask/facehugger/angry/Attach(var/mob/M as mob)
/obj/item/clothing/mask/facehugger/proc/Impregnate(mob/living/carbon/target as mob)
if(!target || target.wear_mask != src || target.stat == DEAD) //was taken off or something
return
..(M)
processing_objects.Remove(src)
if(!sterile)
target.contract_disease(new /datum/disease/alien_embryo(0)) //so infection chance is same as virus infection chance
for(var/datum/disease/alien_embryo/A in target.viruses)
target.status_flags |= XENO_HOST
break
*/
for(var/mob/O in viewers(target,null))
O.show_message("\red \b [src] falls limp after violating [target]'s face!", 1)
Die()
else
for(var/mob/O in viewers(target,null))
O.show_message("\red \b [src] violates [target]'s face!", 1)
target.update_inv_wear_mask()
return
/obj/item/clothing/mask/facehugger/proc/GoActive()
if(stat == DEAD || stat == CONSCIOUS)
return
stat = CONSCIOUS
icon_state = "[initial(icon_state)]"
/* for(var/mob/living/carbon/alien/alien in world)
var/image/activeIndicator = image('icons/mob/alien.dmi', loc = src, icon_state = "facehugger_active")
activeIndicator.override = 1
if(alien && alien.client)
alien.client.images += activeIndicator */
return
/obj/item/clothing/mask/facehugger/proc/GoIdle()
if(stat == DEAD || stat == UNCONSCIOUS)
return
/* RemoveActiveIndicators() */
stat = UNCONSCIOUS
icon_state = "[initial(icon_state)]_inactive"
spawn(rand(MIN_ACTIVE_TIME,MAX_ACTIVE_TIME))
GoActive()
return
/obj/item/clothing/mask/facehugger/proc/Die()
if(stat == DEAD)
return
/* RemoveActiveIndicators() */
icon_state = "[initial(icon_state)]_dead"
stat = DEAD
for(var/mob/O in viewers(src, null))
O.show_message("\red \b[src] curls up into a ball!", 1)
return
/obj/item/clothing/mask/facehugger/HasProximity(atom/movable/AM as mob|obj)
if(CanHug(AM))
Attach(AM)
/proc/CanHug(var/mob/M)
if(!iscarbon(M) || isalien(M))
return 0
var/mob/living/carbon/C = M
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(H.head && H.head.flags & HEADCOVERSMOUTH)
return 0
return 1
@@ -134,7 +134,7 @@
if(istype(M) && M.lying) //Pulling lying down people is slower
tally += 3
if(MINCREASERUN in mutations)
if(mRun in mutations)
tally = 0
return tally
@@ -10,7 +10,7 @@
src.darkMask = list( )
src.intent_small_hud_objects = list( )
src.g_dither = new src.h_type( src )
src.g_dither = new /obj/screen( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon = ui_style
@@ -18,7 +18,7 @@
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view = new /obj/screen(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon = ui_style
@@ -26,7 +26,7 @@
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry = new /obj/screen( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon = ui_style
@@ -34,7 +34,7 @@
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy = new /obj/screen( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon = ui_style
@@ -44,7 +44,7 @@
var/obj/screen/using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = ui_style
@@ -55,45 +55,55 @@
action_intent = using
//intent small hud objects
using = new src.h_type( src )
var/icon/ico
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "help" ? "help_small_active" : "help_small")
using.screen_loc = ui_help_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
using = new src.h_type( src )
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "disarm" ? "disarm_small_active" : "disarm_small")
using.screen_loc = ui_disarm_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
using = new src.h_type( src )
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "grab" ? "grab_small_active" : "grab_small")
using.screen_loc = ui_grab_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
using = new src.h_type( src )
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm_small_active" : "harm_small")
using.screen_loc = ui_harm_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = ui_style
@@ -103,7 +113,7 @@
src.adding += using
move_intent = using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "drop"
using.icon = ui_style
using.icon_state = "act_drop"
@@ -111,7 +121,7 @@
using.layer = 19
src.adding += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "r_hand"
using.dir = WEST
using.icon = ui_style
@@ -123,7 +133,7 @@
src.r_hand_hud_object = using
src.adding += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "l_hand"
using.dir = EAST
using.icon = ui_style
@@ -135,7 +145,7 @@
src.l_hand_hud_object = using
src.adding += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
@@ -144,7 +154,7 @@
using.layer = 19
src.adding += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
@@ -153,7 +163,7 @@
using.layer = 19
src.adding += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "mask"
using.dir = NORTH
using.icon = ui_style
@@ -162,7 +172,7 @@
using.layer = 19
src.adding += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "back"
using.dir = NORTHEAST
using.icon = ui_style
@@ -171,7 +181,7 @@
using.layer = 19
src.adding += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
@@ -179,7 +189,7 @@
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
@@ -187,7 +197,7 @@
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
@@ -195,7 +205,7 @@
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
+3 -19
View File
@@ -1,26 +1,10 @@
/obj/hud/proc/brain_hud(var/ui_style='icons/mob/screen1_old.dmi')
/datum/hud/proc/brain_hud(var/ui_style='icons/mob/screen1_old.dmi')
//ui_style='icons/mob/screen1_old.dmi' //Overriding the parameter. Only this UI style is acceptable with the 'sleek' layout.
blurry = new h_type( src )
blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
blurry.name = "Blurry"
blurry.icon = ui_style
blurry.icon_state = "blurry"
blurry.layer = 17
blurry.mouse_opacity = 0
druggy = new h_type( src )
druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
druggy.name = "Druggy"
druggy.icon = ui_style
druggy.icon_state = "druggy"
druggy.layer = 17
druggy.mouse_opacity = 0
mymob.blind = new /obj/screen( null )
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.blind.layer = 0
+4 -9
View File
@@ -221,9 +221,6 @@
see_in_dark = 2
see_invisible = SEE_INVISIBLE_LIVING
if (sleep) sleep.icon_state = text("sleep[]", sleeping)
if (rest) rest.icon_state = text("rest[]", resting)
if (healths)
if (stat != 2)
switch(health)
@@ -246,9 +243,7 @@
if(pullin) pullin.icon_state = "pull[pulling ? 1 : 0]"
client.screen -= hud_used.blurry
client.screen -= hud_used.druggy
client.screen -= hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
@@ -257,13 +252,13 @@
blind.layer = 0
if (disabilities & NEARSIGHTED)
client.screen += hud_used.vimpaired
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += hud_used.blurry
client.screen += global_hud.blurry
if (druggy)
client.screen += hud_used.druggy
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
+5 -3
View File
@@ -10,6 +10,8 @@
return
else
message = Gibberish(message, (emp_damage*6))//scrambles the message, gets worse when emp_damage is higher
..()
else
..()
if(istype(container, /obj/item/device/mmi/radio_enabled))
var/obj/item/device/mmi/radio_enabled/R = container
if(R.radio)
spawn(0) R.radio.hear_talk(src, sanitize(message))
..()
+26 -2
View File
@@ -50,6 +50,13 @@
/mob/living/carbon/attack_hand(mob/M as mob)
if(!istype(M, /mob/living/carbon)) return
if (hasorgans(M))
var/datum/organ/external/temp = M:organs_by_name["r_hand"]
if (M.hand)
temp = M:organs_by_name["l_hand"]
if(temp && temp.status & ORGAN_DESTROYED)
M << "\red Yo- wait a minute."
return
for(var/datum/disease/D in viruses)
var/s_spread_type
@@ -88,6 +95,13 @@
/mob/living/carbon/attack_paw(mob/M as mob)
if(!istype(M, /mob/living/carbon)) return
if (hasorgans(M))
var/datum/organ/external/temp = M:organs_by_name["r_hand"]
if (M.hand)
temp = M:organs_by_name["l_hand"]
if(temp && temp.status & ORGAN_DESTROYED)
M << "\red Yo- wait a minute."
return
for(var/datum/disease/D in viruses)
var/s_spread_type
@@ -127,7 +141,7 @@
shock_damage *= siemens_coeff
if (shock_damage<1)
return 0
src.take_overall_damage(0,shock_damage)
src.take_overall_damage(0,shock_damage,used_weapon="Electrocution")
//src.burn_skin(shock_damage)
//src.adjustFireLoss(shock_damage) //burn_skin will do this for us
//src.updatehealth()
@@ -211,9 +225,13 @@
status += "blistered"
else if(burndamage > 0)
status += "numb"
if(org.status & ORGAN_DESTROYED)
status = "MISSING!"
if(status == "")
status = "OK"
src.show_message(text("\t []My [] is [].",status=="OK"?"\blue ":"\red ",org.getDisplayName(),status),1)
if((SKELETON in H.mutations) && (!H.w_uniform) && (!H.wear_suit))
H.play_xylophone()
else
var/t_him = "it"
if (src.gender == MALE)
@@ -335,10 +353,12 @@
if(H.gloves)
if(H.gloves.clean_blood())
H.update_inv_gloves(0)
H.gloves.germ_level = 0
else
if(H.bloody_hands)
H.bloody_hands = 0
H.update_inv_gloves(0)
H.germ_level = 0
update_icons() //apply the now updated overlays to the mob
@@ -430,5 +450,9 @@
*/
item.throw_at(target, item.throw_range, item.throw_speed)
item.throw_at(target, item.throw_range, item.throw_speed)
/mob/living/carbon/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > CARBON_LIFEFORM_FIRE_RESISTANCE)
adjustFireLoss(CARBON_LIFEFORM_FIRE_DAMAGE)
..()
@@ -1,10 +1,14 @@
/mob/living/carbon/
gender = MALE
var/list/stomach_contents = list()
var/brain_op_stage = 0.0
var/ribcage_op_stage = 0
/*
var/eye_op_stage = 0.0
var/appendix_op_stage = 0.0
*/
var/datum/disease2/disease/virus2 = null
var/list/datum/disease2/disease/resistances2 = list()
var/antibodies = 0
@@ -12,6 +16,7 @@
var/last_eating = 0 //Not sure what this does... I found it hidden in food.dm
var/life_tick = 0 // The amount of life ticks that have processed on this mob.
var/analgesic = 0 // when this is set, the mob isn't affected by shock or pain
// life should decrease this by 1 every tick
// total amount of wounds on mob, used to spread out healing and the like over all wounds
var/number_wounds = 0
var/number_wounds = 0
@@ -67,6 +67,21 @@
ticker.mode.check_win() //Calls the rounds wincheck, mainly for wizard, malf, and changeling now
return ..(gibbed)
/mob/living/carbon/human/proc/makeSkeleton()
if(SKELETON in src.mutations) return
if(f_style)
f_style = "Shaved"
if(h_style)
h_style = "Bald"
update_hair(0)
mutations.Add(SKELETON)
status_flags |= DISFIGURED
update_body(0)
update_mutantrace()
return
/mob/living/carbon/human/proc/ChangeToHusk()
if(HUSK in mutations) return
@@ -482,9 +482,9 @@
if (m_type & 1)
for (var/mob/O in viewers(src, null))
for (var/mob/O in get_mobs_in_view(world.view,src))
O.show_message(message, m_type)
else if (m_type & 2)
for (var/mob/O in hearers(src.loc, null))
for (var/mob/O in (hearers(src.loc, null) | get_mobs_in_view(world.view,src)))
O.show_message(message, m_type)
+64 -33
View File
@@ -63,10 +63,17 @@
//uniform
if(w_uniform && !skipjumpsuit)
//Ties
var/tie_msg
if(istype(w_uniform,/obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
if(U.hastie)
tie_msg += " with \icon[U.hastie] \a [U.hastie]"
if(w_uniform.blood_DNA)
msg += "<span class='warning'>[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] blood-stained [w_uniform.name]!</span>\n"
msg += "<span class='warning'>[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] blood-stained [w_uniform.name][tie_msg]!</span>\n"
else
msg += "[t_He] [t_is] wearing \icon[w_uniform] \a [w_uniform].\n"
msg += "[t_He] [t_is] wearing \icon[w_uniform] \a [w_uniform][tie_msg].\n"
//head
if(head)
@@ -162,7 +169,7 @@
//ID
if(wear_id)
var/id
/*var/id
if(istype(wear_id, /obj/item/device/pda))
var/obj/item/device/pda/pda = wear_id
id = pda.owner
@@ -171,8 +178,8 @@
id = idcard.registered_name
if(id && (id != real_name) && (get_dist(src, usr) <= 1) && prob(10))
msg += "<span class='warning'>[t_He] [t_is] wearing \icon[wear_id] \a [wear_id] yet something doesn't seem right...</span>\n"
else
msg += "[t_He] [t_is] wearing \icon[wear_id] \a [wear_id].\n"
else*/
msg += "[t_He] [t_is] wearing \icon[wear_id] \a [wear_id].\n"
//Jitters
if(is_jittery)
@@ -186,42 +193,58 @@
if(suiciding)
msg += "<span class='warning'>[t_He] [t_has] bitten off [t_his] own tongue and [t_has] suffered major bloodloss!</span>\n"
if(stat == DEAD || (status_flags & FAKEDEATH))
msg += "<span class='deadsay'>[t_He] [t_is] limp and unresponsive; there are no signs of life"
if(mSmallsize in mutations)
msg += "[t_He] [t_is] small halfling!\n"
if(!key)
var/foundghost = 0
if(mind)
for(var/mob/dead/observer/G in player_list)
if(G.mind == mind)
foundghost = 1
break
if(!foundghost)
msg += " and [t_his] soul has departed"
msg += "...</span>\n"
var/distance = get_dist(usr,src)
if(istype(usr, /mob/dead/observer) || usr.stat == 2) // ghosts can see anything
distance = 1
if (src.stat == 1 || stat == 2)
msg += "<span class='warning'>[t_He] [t_is]n't responding to anything around [t_him] and seems to be asleep.</span>\n"
if((stat == 2 || src.health < config.health_threshold_crit) && distance <= 3)
msg += "<span class='warning'>[t_He] does not appear to be breathing.</span>\n"
if(istype(usr, /mob/living/carbon/human) && usr.stat == 0 && src.stat == 1 && distance <= 1)
for(var/mob/O in viewers(usr.loc, null))
O.show_message("[usr] checks [src]'s pulse.", 1)
spawn(15)
usr << "\blue [t_He] has a pulse!"
else
if(stat == UNCONSCIOUS)
msg += "[t_He] [t_is]n't responding to anything around [t_him] and seems to be asleep.\n"
else if(getBrainLoss() >= 60)
msg += "[t_He] [t_has] a stupid expression on [t_his] face.\n"
if(!key)
msg += "<span class='deadsay'>[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely</span>\n"
else if(!client)
msg += "[t_He] [t_has] a vacant, braindead stare...\n"
if (src.stat == 2 || (status_flags & FAKEDEATH))
if(distance <= 1)
if(istype(usr, /mob/living/carbon/human) && usr.stat == 0)
for(var/mob/O in viewers(usr.loc, null))
O.show_message("[usr] checks [src]'s pulse.", 1)
spawn(15)
var/foundghost = 0
if(src.client)
foundghost = 1
if(!foundghost)
usr << "<span class='deadsay'>[t_He] has no pulse and [t_his] soul has departed...</span>"
else
usr << "<span class='deadsay'>[t_He] has no pulse...</span>"
msg += "<span class='warning'>"
if(nutrition < 100)
msg += "[t_He] [t_is] severely malnourished.\n"
else if(nutrition >= 500)
if(usr.nutrition < 100)
/*if(usr.nutrition < 100)
msg += "[t_He] [t_is] plump and delicious looking - Like a fat little piggy. A tasty piggy.\n"
else
msg += "[t_He] [t_is] quite chubby.\n"
else*/
msg += "[t_He] [t_is] quite chubby.\n"
msg += "</span>"
if(stat == UNCONSCIOUS)
msg += "[t_He] [t_is]n't responding to anything around [t_him] and seems to be asleep.\n"
else if(getBrainLoss() >= 60)
msg += "[t_He] [t_has] a stupid expression on [t_his] face.\n"
if(!key && brain_op_stage != 4 && stat != DEAD)
msg += "<span class='deadsay'>[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely</span>\n"
else if(!client && brain_op_stage != 4 && stat != DEAD)
msg += "[t_He] [t_has] a vacant, braindead stare...\n"
var/list/wound_flavor_text = list()
var/list/is_destroyed = list()
var/list/is_bleeding = list()
@@ -253,10 +276,16 @@
else if(temp.wounds.len > 0)
var/list/wound_descriptors = list()
for(var/datum/wound/W in temp.wounds)
if(W.desc in wound_descriptors)
wound_descriptors[W.desc] += W.amount
if(W.internal && !temp.open) continue // can't see internal wounds
var/this_wound_desc = W.desc
if(W.bleeding()) this_wound_desc = "bleeding [this_wound_desc]"
else if(W.bandaged) this_wound_desc = "bandaged [this_wound_desc]"
if(W.germ_level > 1000) this_wound_desc = "badly infected [this_wound_desc]"
else if(W.germ_level > 100) this_wound_desc = "lightly infected [this_wound_desc]"
if(this_wound_desc in wound_descriptors)
wound_descriptors[this_wound_desc] += W.amount
continue
wound_descriptors[W.desc] = W.amount
wound_descriptors[this_wound_desc] = W.amount
var/list/flavor_text = list()
var/list/no_exclude = list("gaping wound", "big gaping wound", "massive wound", "large bruise",\
"huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area")
@@ -385,6 +414,8 @@
msg += "<span class = 'deptradio'>Criminal status:</span> <a href='?src=\ref[src];criminal=1'>\[[criminal]\]</a>\n"
//msg += "\[Set Hostile Identification\]\n"
if(print_flavor_text()) msg += "[print_flavor_text()]\n"
msg += "*---------*</span>"
usr << msg
+81 -372
View File
@@ -1,96 +1,72 @@
/obj/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi')
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi')
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.hotkeybuttons = list( ) //These can be disabled for hotkey usersx
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon = ui_style
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon = ui_style
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon = ui_style
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon = ui_style
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
src.adding = list()
src.other = list()
src.hotkeybuttons = list() //These can be disabled for hotkey usersx
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new src.h_type( src )
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.icon_state = "intent_"+mymob.a_intent
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
using = new src.h_type( src )
var/icon/ico
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "help" ? "help_small_active" : "help_small")
using.screen_loc = ui_help_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
using = new src.h_type( src )
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "disarm" ? "disarm_small_active" : "disarm_small")
using.screen_loc = ui_disarm_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
using = new src.h_type( src )
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "grab" ? "grab_small_active" : "grab_small")
using.screen_loc = ui_grab_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
using = new src.h_type( src )
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm_small_active" : "harm_small")
using.screen_loc = ui_harm_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new src.h_type( src )
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = ui_style
@@ -100,48 +76,7 @@
src.adding += using
move_intent = using
/*
using = new src.h_type(src) //Right hud bar
using.dir = SOUTH
using.icon = ui_style
using.screen_loc = "EAST+1,SOUTH to EAST+1,NORTH"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Lower hud bar
using.dir = EAST
using.icon = ui_style
using.screen_loc = "WEST,SOUTH-1 to EAST,SOUTH-1"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Corner Button
using.dir = NORTHWEST
using.icon = ui_style
using.screen_loc = "EAST+1,SOUTH-1"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "arrowleft"
using.icon = ui_style
using.icon_state = "s_arrow"
using.dir = WEST
using.screen_loc = ui_iarrowleft
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "arrowright"
using.icon = ui_style
using.icon_state = "s_arrow"
using.dir = EAST
using.screen_loc = ui_iarrowright
using.layer = 19
src.adding += using
*/
using = new src.h_type( src )
using = new /obj/screen()
using.name = "drop"
using.icon = ui_style
using.icon_state = "act_drop"
@@ -149,7 +84,7 @@
using.layer = 19
src.hotkeybuttons += using
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "i_clothing"
inv_box.dir = SOUTH
inv_box.icon = ui_style
@@ -159,7 +94,7 @@
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "o_clothing"
inv_box.dir = SOUTH
inv_box.icon = ui_style
@@ -169,16 +104,7 @@
inv_box.layer = 19
src.other += inv_box
/* inv_box = new /obj/screen/inventory( src )
inv_box.name = "headset"
inv_box.dir = SOUTHEAST
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_headset
inv_box.layer = 19
if(istype(mymob,/mob/living/carbon/monkey)) inv_box.overlays += blocked
src.other += inv_box*/
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = ui_style
@@ -191,7 +117,7 @@
src.r_hand_hud_object = inv_box
src.adding += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = ui_style
@@ -204,7 +130,7 @@
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory( src )
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
@@ -213,7 +139,7 @@
using.layer = 19
src.adding += using
using = new /obj/screen/inventory( src )
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
@@ -222,7 +148,7 @@
using.layer = 19
src.adding += using
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "id"
inv_box.dir = NORTH
inv_box.icon = ui_style
@@ -232,7 +158,7 @@
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.dir = NORTH
inv_box.icon = ui_style
@@ -242,7 +168,7 @@
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.dir = NORTH
inv_box.icon = ui_style
@@ -252,7 +178,7 @@
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
@@ -261,7 +187,7 @@
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
@@ -270,7 +196,7 @@
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "suit storage"
inv_box.icon = ui_style
inv_box.dir = 8 //The sprite at dir=8 has the background whereas the others don't.
@@ -280,7 +206,7 @@
inv_box.layer = 19
src.adding += inv_box
using = new src.h_type( src )
using = new /obj/screen()
using.name = "resist"
using.icon = ui_style
using.icon_state = "act_resist"
@@ -288,7 +214,7 @@
using.layer = 19
src.hotkeybuttons += using
using = new src.h_type( src )
using = new /obj/screen()
using.name = "other"
using.icon = ui_style
using.icon_state = "other"
@@ -296,7 +222,7 @@
using.layer = 20
src.adding += using
using = new src.h_type( src )
using = new /obj/screen()
using.name = "equip"
using.icon = ui_style
using.icon_state = "act_equip"
@@ -304,23 +230,7 @@
using.layer = 20
src.adding += using
/*
using = new src.h_type( src )
using.name = "intent"
using.icon_state = "intent"
using.screen_loc = "15,15"
using.layer = 20
src.adding += using
using = new src.h_type( src )
using.name = "m_intent"
using.icon_state = "move"
using.screen_loc = "15,14"
using.layer = 20
src.adding += using
*/
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "gloves"
inv_box.icon = ui_style
inv_box.icon_state = "gloves"
@@ -329,7 +239,7 @@
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "eyes"
inv_box.icon = ui_style
inv_box.icon_state = "glasses"
@@ -338,7 +248,7 @@
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "ears"
inv_box.icon = ui_style
inv_box.icon_state = "ears"
@@ -347,7 +257,7 @@
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = ui_style
inv_box.icon_state = "hair"
@@ -356,7 +266,7 @@
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "shoes"
inv_box.icon = ui_style
inv_box.icon_state = "shoes"
@@ -365,7 +275,7 @@
inv_box.layer = 19
src.other += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "belt"
inv_box.icon = ui_style
inv_box.icon_state = "belt"
@@ -374,236 +284,69 @@
inv_box.layer = 19
src.adding += inv_box
/*
using = new src.h_type( src )
using.name = "grab"
using.icon_state = "grab"
using.screen_loc = "12:-11,15"
using.layer = 19
src.intents += using
//ICONS
using = new src.h_type( src )
using.name = "hurt"
using.icon_state = "harm"
using.screen_loc = "15:-11,15"
using.layer = 19
src.intents += using
src.m_ints += using
using = new src.h_type( src )
using.name = "disarm"
using.icon_state = "disarm"
using.screen_loc = "14:-10,15"
using.layer = 19
src.intents += using
using = new src.h_type( src )
using.name = "help"
using.icon_state = "help"
using.screen_loc = "13:-10,15"
using.layer = 19
src.intents += using
src.m_ints += using
using = new src.h_type( src )
using.name = "face"
using.icon_state = "facing"
using.screen_loc = "15:-11,14"
using.layer = 19
src.mov_int += using
using = new src.h_type( src )
using.name = "walk"
using.icon_state = "walking"
using.screen_loc = "14:-11,14"
using.layer = 19
src.mov_int += using
using = new src.h_type( src )
using.name = "run"
using.icon_state = "running"
using.screen_loc = "13:-11,14"
using.layer = 19
src.mov_int += using
*/
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "1,1 to 5,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "5,1 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "11,1 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
//welding mask dither
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "3,3 to 5,13"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "5,3 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,13"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "11,3 to 13,13"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
//welding mask blackness
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "black"
using.screen_loc = "1,1 to 15,2"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "black"
using.screen_loc = "1,3 to 2,15"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "black"
using.screen_loc = "14,3 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "black"
using.screen_loc = "3,14 to 13,15"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
src.hotkeybuttons += mymob.throw_icon
mymob.oxygen = new /obj/screen( null )
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = ui_style
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.pressure = new /obj/screen( null )
mymob.pressure = new /obj/screen()
mymob.pressure.icon = ui_style
mymob.pressure.icon_state = "pressure0"
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
/*
mymob.i_select = new /obj/screen( null )
mymob.i_select.icon_state = "selector"
mymob.i_select.name = "intent"
mymob.i_select.screen_loc = "16:-11,15"
mymob.m_select = new /obj/screen( null )
mymob.m_select.icon_state = "selector"
mymob.m_select.name = "moving"
mymob.m_select.screen_loc = "16:-11,14"
*/
mymob.toxin = new /obj/screen( null )
mymob.toxin = new /obj/screen()
mymob.toxin.icon = ui_style
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_toxin
mymob.internals = new /obj/screen( null )
mymob.internals = new /obj/screen()
mymob.internals.icon = ui_style
mymob.internals.icon_state = "internal0"
mymob.internals.name = "internal"
mymob.internals.screen_loc = ui_internal
mymob.fire = new /obj/screen( null )
mymob.fire = new /obj/screen()
mymob.fire.icon = ui_style
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.bodytemp = new /obj/screen( null )
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon = ui_style
mymob.bodytemp.icon_state = "temp1"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.healths = new /obj/screen( null )
mymob.healths = new /obj/screen()
mymob.healths.icon = ui_style
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
mymob.nutrition_icon = new /obj/screen( null )
mymob.nutrition_icon = new /obj/screen()
mymob.nutrition_icon.icon = ui_style
mymob.nutrition_icon.icon_state = "nutrition0"
mymob.nutrition_icon.name = "nutrition"
mymob.nutrition_icon.screen_loc = ui_nutrition
mymob.pullin = new /obj/screen( null )
mymob.pullin = new /obj/screen()
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
src.hotkeybuttons += mymob.pullin
mymob.blind = new /obj/screen( null )
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
@@ -611,15 +354,15 @@
mymob.blind.mouse_opacity = 0
mymob.blind.layer = 0
mymob.damageoverlay = new /obj/screen( null )
mymob.damageoverlay = new /obj/screen()
mymob.damageoverlay.icon = 'icons/mob/screen1_full.dmi'
mymob.damageoverlay.icon_state = "oxydamageoverlay0"
mymob.damageoverlay.name = "dmg"
mymob.damageoverlay.screen_loc = "1,1"
mymob.damageoverlay.mouse_opacity = 0
mymob.damageoverlay.layer = 17
mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top.
mymob.flash = new /obj/screen( null )
mymob.flash = new /obj/screen()
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
@@ -651,84 +394,84 @@
/*/Monkey blockers
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_ears
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_belt
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_shoes
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_storage2
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_glasses
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_gloves
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_storage1
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_headset
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_oclothing
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_iclothing
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_id
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using = new /obj/screen( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_head
@@ -744,46 +487,12 @@
mymob.client.screen = null
//, mymob.i_select, mymob.m_select
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += src.adding + src.hotkeybuttons
inventory_shown = 0;
//if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo
return
/*
using = new src.h_type( src )
using.dir = WEST
using.screen_loc = "1,3 to 2,3"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.dir = NORTHEAST
using.screen_loc = "3,3"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.dir = NORTH
using.screen_loc = "3,2"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.dir = SOUTHEAST
using.screen_loc = "3,1"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.dir = SOUTHWEST
using.screen_loc = "1,1 to 2,2"
using.layer = 19
src.adding += using
*/
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
set category = "OOC"
+334 -38
View File
@@ -5,6 +5,10 @@
icon = 'icons/mob/human.dmi'
icon_state = "body_m_s"
var/datum/reagents/vessel
// TODO: make this actually affect the way the mob is rendered
var/pale = 0
/mob/living/carbon/human/dummy
real_name = "Test Dummy"
@@ -23,18 +27,20 @@
//initialise organs
organs = list()
organs_by_name["chest"] = new/datum/organ/external/chest()
organs_by_name["head"] = new/datum/organ/external/head()
organs_by_name["l_arm"] = new/datum/organ/external/l_arm()
organs_by_name["r_arm"] = new/datum/organ/external/r_arm()
organs_by_name["r_leg"] = new/datum/organ/external/r_leg()
organs_by_name["l_leg"] = new/datum/organ/external/l_leg()
organs_by_name["l_hand"] = new/datum/organ/external/l_hand()
organs_by_name["r_hand"] = new/datum/organ/external/r_hand()
organs_by_name["l_foot"] = new/datum/organ/external/l_foot()
organs_by_name["r_foot"] = new/datum/organ/external/r_foot()
organs_by_name["groin"] = new/datum/organ/external/groin(organs_by_name["chest"])
organs_by_name["head"] = new/datum/organ/external/head(organs_by_name["chest"])
organs_by_name["l_arm"] = new/datum/organ/external/l_arm(organs_by_name["chest"])
organs_by_name["r_arm"] = new/datum/organ/external/r_arm(organs_by_name["chest"])
organs_by_name["r_leg"] = new/datum/organ/external/r_leg(organs_by_name["groin"])
organs_by_name["l_leg"] = new/datum/organ/external/l_leg(organs_by_name["groin"])
organs_by_name["l_hand"] = new/datum/organ/external/l_hand(organs_by_name["l_arm"])
organs_by_name["r_hand"] = new/datum/organ/external/r_hand(organs_by_name["r_arm"])
organs_by_name["l_foot"] = new/datum/organ/external/l_foot(organs_by_name["l_leg"])
organs_by_name["r_foot"] = new/datum/organ/external/r_foot(organs_by_name["r_leg"])
// connect feet to legs and hands to arms
var/datum/organ/external/organ = organs_by_name["l_hand"]
/* var/datum/organ/external/organ = organs_by_name["l_hand"]
organ.parent = organs_by_name["l_arm"]
organ = organs_by_name["r_hand"]
organ.parent = organs_by_name["r_arm"]
@@ -46,15 +52,17 @@
organ.parent = organs_by_name["r_leg"]
organ = organs_by_name["head"]
organ.parent = organs_by_name["chest"]
organ = organs_by_name["groin"]
organ.parent = organs_by_name["chest"]
organ = organs_by_name["r_leg"]
organ.parent = organs_by_name["chest"]
organ.parent = organs_by_name["groin"]
organ = organs_by_name["l_leg"]
organ.parent = organs_by_name["chest"]
organ.parent = organs_by_name["groin"]
organ = organs_by_name["r_arm"]
organ.parent = organs_by_name["chest"]
organ = organs_by_name["l_arm"]
organ.parent = organs_by_name["chest"]
*/
for(var/name in organs_by_name)
organs += organs_by_name[name]
@@ -69,6 +77,49 @@
prev_gender = gender // Debug for plural genders
vessel = new/datum/reagents(600)
vessel.my_atom = src
vessel.add_reagent("blood",560)
spawn(1)
fixblood()
/mob/living/carbon/human/proc/drip(var/amt as num)
if(!amt)
return
var/amm = 0.1 * amt
var/turf/T = get_turf(src)
var/list/obj/effect/decal/cleanable/blood/drip/nums = list()
var/list/iconL = list("1","2","3","4","5")
vessel.remove_reagent("blood",amm)
for(var/obj/effect/decal/cleanable/blood/drip/G in T)
nums += G
iconL.Remove(G.icon_state)
if(nums.len >= 3)
var/obj/effect/decal/cleanable/blood/drip/D = pick(nums)
D.blood_DNA[dna.unique_enzymes] = dna.b_type
return
var/obj/effect/decal/cleanable/blood/drip/this = new(T)
this.icon_state = pick(iconL)
this.blood_DNA = list()
this.blood_DNA[dna.unique_enzymes] = dna.b_type
// replace many drips with something larger
if(nums.len > 3)
for(var/obj/effect/decal/cleanable/blood/drip/G in nums)
del G
T.add_blood(src)
/mob/living/carbon/human/proc/fixblood()
for(var/datum/reagent/blood/B in vessel.reagent_list)
if(B.id == "blood")
B.data = list("donor"=src,"viruses"=null,"blood_DNA"=dna.unique_enzymes,"blood_type"=dna.b_type,"resistances"=null,"trace_chem"=null, "virus2" = null, "antobodies" = null)
/mob/living/carbon/human/Bump(atom/movable/AM as mob|obj, yes)
if ((!( yes ) || now_pushing))
return
@@ -177,18 +228,6 @@
if(!blinded)
flick("flash", flash)
// /obj/item/clothing/suit/bomb_suit(src)
// /obj/item/clothing/head/bomb_hood(src)
if (stat == 2 && client)
gib()
return
else if (stat == 2 && !client)
gibs(loc, viruses)
del(src)
return
var/shielded = 0
var/b_loss = null
var/f_loss = null
@@ -233,34 +272,36 @@
// focus most of the blast on one organ
var/datum/organ/external/take_blast = pick(organs)
update |= take_blast.take_damage(b_loss * 0.9, f_loss * 0.9)
update |= take_blast.take_damage(b_loss * 0.9, f_loss * 0.9, used_weapon = "Explosive blast")
// distribute the remaining 10% on all limbs equally
b_loss *= 0.1
f_loss *= 0.1
var/weapon_message = "Explosive Blast"
for(var/datum/organ/external/temp in organs)
switch(temp.name)
if("head")
update |= temp.take_damage(b_loss * 0.2, f_loss * 0.2)
update |= temp.take_damage(b_loss * 0.2, f_loss * 0.2, used_weapon = weapon_message)
if("chest")
update |= temp.take_damage(b_loss * 0.4, f_loss * 0.4)
update |= temp.take_damage(b_loss * 0.4, f_loss * 0.4, used_weapon = weapon_message)
if("l_arm")
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if("r_arm")
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if("l_leg")
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if("r_leg")
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if("r_foot")
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if("l_foot")
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if("r_arm")
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if("l_arm")
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if(update) UpdateDamageIcon()
@@ -350,6 +391,26 @@
var/turf/location = M.loc
if (istype(location, /turf/simulated))
location.add_blood(M)
if(ishuman(M))
var/mob/living/carbon/H = M
var/blood_volume = round(H:vessel.get_reagent_amount("blood"))
if(blood_volume > 0)
H:vessel.remove_reagent("blood",1)
if(prob(5))
M.adjustBruteLoss(1)
visible_message("\red \The [M]'s wounds open more from being dragged!")
if(M.pull_damage())
if(prob(25))
M.adjustBruteLoss(2)
visible_message("\red \The [M]'s wounds worsen terribly from being dragged!")
var/turf/location = M.loc
if (istype(location, /turf/simulated))
location.add_blood(M)
if(ishuman(M))
var/mob/living/carbon/H = M
var/blood_volume = round(H:vessel.get_reagent_amount("blood"))
if(blood_volume > 0)
H:vessel.remove_reagent("blood",1)
step(pulling, get_dir(pulling.loc, T))
@@ -672,10 +733,14 @@
number += 2
if(istype(src.head, /obj/item/clothing/head/helmet/space))
number += 2
if(istype(src.glasses, /obj/item/clothing/glasses/sunglasses))
number += 1
if(istype(src.glasses, /obj/item/clothing/glasses/thermal))
number -= 1
if(istype(src.glasses, /obj/item/clothing/glasses/sunglasses))
number += 1
if(istype(src.glasses, /obj/item/clothing/glasses/welding))
var/obj/item/clothing/glasses/welding/W = src.glasses
if(!W.up)
number += 2
return number
@@ -712,3 +777,234 @@
return "Animated Construct"
else
return "Human"
/mob/living/carbon/get_species()
if(src.dna)
if(src.dna.mutantrace == "lizard")
return "Soghun"
else if(src.dna.mutantrace == "skrell")
return "Skrell"
else if(src.dna.mutantrace == "tajaran")
return "Tajaran"
/mob/living/carbon/human/proc/play_xylophone()
if(!src.xylophone)
visible_message("\red [src] begins playing his ribcage like a xylophone. It's quite spooky.","\blue You begin to play a spooky refrain on your ribcage.","\red You hear a spooky xylophone melody.")
var/song = pick('sound/effects/xylophone1.ogg','sound/effects/xylophone2.ogg','sound/effects/xylophone3.ogg')
playsound(loc, song, 50, 1, -1)
xylophone = 1
spawn(1200)
xylophone=0
return
/mob/living/carbon/human/proc/vomit()
if(!lastpuke)
lastpuke = 1
src << "<spawn class='warning'>You feel nauseous..."
spawn(150) //15 seconds until second warning
src << "<spawn class='warning'>You feel like you are about to throw up!"
spawn(100) //and you have 10 more for mad dash to the bucket
Stun(5)
src.visible_message("<spawn class='warning'>[src] throws up!","<spawn class='warning'>You throw up!")
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
var/turf/location = loc
if (istype(location, /turf/simulated))
location.add_vomit_floor(src, 1)
nutrition -= 40
adjustToxLoss(-3)
spawn(350) //wait 35 seconds before next volley
lastpuke = 0
/mob/living/carbon/human/proc/morph()
set name = "Morph"
set category = "Superpower"
if(stat!=CONSCIOUS)
reset_view(0)
remoteview_target = null
return
if(!(mMorph in mutations))
src.verbs -= /mob/living/carbon/human/proc/morph
return
var/new_facial = input("Please select facial hair color.", "Character Generation",rgb(r_facial,g_facial,b_facial)) as color
if(new_facial)
r_facial = hex2num(copytext(new_facial, 2, 4))
g_facial = hex2num(copytext(new_facial, 4, 6))
b_facial = hex2num(copytext(new_facial, 6, 8))
var/new_hair = input("Please select hair color.", "Character Generation",rgb(r_hair,g_hair,b_hair)) as color
if(new_facial)
r_hair = hex2num(copytext(new_hair, 2, 4))
g_hair = hex2num(copytext(new_hair, 4, 6))
b_hair = hex2num(copytext(new_hair, 6, 8))
var/new_eyes = input("Please select eye color.", "Character Generation",rgb(r_eyes,g_eyes,b_eyes)) as color
if(new_eyes)
r_eyes = hex2num(copytext(new_eyes, 2, 4))
g_eyes = hex2num(copytext(new_eyes, 4, 6))
b_eyes = hex2num(copytext(new_eyes, 6, 8))
var/new_tone = input("Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation", "[35-s_tone]") as text
if (!new_tone)
new_tone = 35
s_tone = max(min(round(text2num(new_tone)), 220), 1)
s_tone = -s_tone + 35
// hair
var/list/all_hairs = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair
var/list/hairs = list()
// loop through potential hairs
for(var/x in all_hairs)
var/datum/sprite_accessory/hair/H = new x // create new hair datum based on type x
hairs.Add(H.name) // add hair name to hairs
del(H) // delete the hair after it's all done
var/new_style = input("Please select hair style", "Character Generation",h_style) as null|anything in hairs
// if new style selected (not cancel)
if (new_style)
h_style = new_style
// facial hair
var/list/all_fhairs = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair
var/list/fhairs = list()
for(var/x in all_fhairs)
var/datum/sprite_accessory/facial_hair/H = new x
fhairs.Add(H.name)
del(H)
new_style = input("Please select facial style", "Character Generation",f_style) as null|anything in fhairs
if(new_style)
f_style = new_style
var/new_gender = alert(usr, "Please select gender.", "Character Generation", "Male", "Female")
if (new_gender)
if(new_gender == "Male")
gender = MALE
else
gender = FEMALE
regenerate_icons()
check_dna()
visible_message("\blue \The [src] morphs and changes [get_visible_gender() == MALE ? "his" : get_visible_gender() == FEMALE ? "her" : "their"] appearance!", "\blue You change your appearance!", "\red Oh, god! What the hell was that? It sounded like flesh getting squished and bone ground into a different shape!")
/mob/living/carbon/human/proc/remotesay()
set name = "Project mind"
set category = "Superpower"
if(stat!=CONSCIOUS)
reset_view(0)
remoteview_target = null
return
if(!(mRemotetalk in src.mutations))
src.verbs -= /mob/living/carbon/human/proc/remotesay
return
var/list/creatures = list()
for(var/mob/living/carbon/h in world)
creatures += h
var/mob/target = input ("Who do you want to project your mind to ?") as null|anything in creatures
if (isnull(target))
return
var/say = input ("What do you wish to say")
if(mRemotetalk in target.mutations)
target.show_message("\blue You hear [src.real_name]'s voice: [say]")
else
target.show_message("\blue You hear a voice that seems to echo around the room: [say]")
usr.show_message("\blue You project your mind into [target.real_name]: [say]")
for(var/mob/dead/observer/G in world)
G.show_message("<i>Telepathic message from <b>[src]</b> to <b>[target]</b>: [say]</i>")
/mob/living/carbon/human/proc/remoteobserve()
set name = "Remote View"
set category = "Superpower"
if(stat!=CONSCIOUS)
remoteview_target = null
reset_view(0)
return
if(!(mRemote in src.mutations))
remoteview_target = null
reset_view(0)
src.verbs -= /mob/living/carbon/human/proc/remoteobserve
return
if(client.eye != client.mob)
remoteview_target = null
reset_view(0)
return
var/list/mob/creatures = list()
for(var/mob/living/carbon/h in world)
var/turf/temp_turf = get_turf(h)
if((temp_turf.z != 1 && temp_turf.z != 5) || h.stat!=CONSCIOUS) //Not on mining or the station. Or dead
continue
creatures += h
var/mob/target = input ("Who do you want to project your mind to ?") as mob in creatures
if (target)
remoteview_target = target
reset_view(target)
else
remoteview_target = null
reset_view(0)
/mob/living/carbon/human/proc/get_visible_gender()
if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT && ((head && head.flags_inv & HIDEMASK) || wear_mask))
return NEUTER
return gender
/mob/living/carbon/human/proc/increase_germ_level(n)
if(gloves)
gloves.germ_level += n
else
germ_level += n
/mob/living/carbon/human/revive()
for (var/datum/organ/external/O in organs)
O.status &= ~ORGAN_BROKEN
O.status &= ~ORGAN_BLEEDING
O.status &= ~ORGAN_SPLINTED
O.status &= ~ORGAN_ATTACHABLE
if (!O.amputated)
O.status &= ~ORGAN_DESTROYED
O.wounds.Cut()
vessel.add_reagent("blood",560-vessel.total_volume)
fixblood()
for (var/obj/item/weapon/organ/head/H in world)
if(H.brainmob)
if(H.brainmob.real_name == src.real_name)
if(H.brainmob.mind)
H.brainmob.mind.transfer_to(src)
del(H)
..()
/mob/living/carbon/human/proc/is_lung_ruptured()
var/datum/organ/external/chest/E = get_organ("chest")
return E.ruptured_lungs
/mob/living/carbon/human/proc/rupture_lung()
var/datum/organ/external/chest/E = get_organ("chest")
if(E.ruptured_lungs == 0)
src.custom_pain("You feel a stabbing pain in your chest!", 1)
E.ruptured_lungs = 1
@@ -61,6 +61,7 @@
switch(M.a_intent)
if("help")
if(health > config.health_threshold_crit)
diary << "\[[time2text(world.timeofday, "hh:mm.ss")]\] CPR BUGHINTING: [M] shakes [src]: health - [health], threshold - [config.health_threshold_crit]. Health details: OX [getOxyLoss()] TX [getToxLoss()] BU [getFireLoss()] BR [getBruteLoss()] Blood: [round(vessel.get_reagent_amount("blood"))] out of 560"
help_shake_act(M)
return 1
// if(M.health < -75) return 0
@@ -191,6 +192,27 @@
if(w_uniform)
w_uniform.add_fingerprint(M)
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
if (istype(r_hand,/obj/item/weapon/gun) || istype(l_hand,/obj/item/weapon/gun))
var/obj/item/weapon/gun/W = null
var/chance = 0
if (istype(l_hand,/obj/item/weapon/gun))
W = l_hand
chance = hand ? 40 : 20
if (istype(r_hand,/obj/item/weapon/gun))
W = r_hand
chance = !hand ? 40 : 20
if (prob(chance))
visible_message("<spawn class=danger>[src]'s [W] goes off during struggle!")
var/list/turfs = list()
for(var/turf/T in view())
turfs += T
var/turf/target = pick(turfs)
return W.afterattack(target,src)
var/randn = rand(1, 100)
if (randn <= 25)
apply_effect(4, WEAKEN, run_armor_check(affecting, "melee"))
@@ -116,7 +116,7 @@
if(update) UpdateDamageIcon()
// damage MANY external organs, in random order
/mob/living/carbon/human/take_overall_damage(var/brute, var/burn, var/sharp = 0)
/mob/living/carbon/human/take_overall_damage(var/brute, var/burn, var/sharp = 0, var/used_weapon = null)
if(nodamage) return //godmode
var/list/datum/organ/external/parts = get_damageable_organs()
var/update = 0
@@ -126,7 +126,7 @@
var/brute_was = picked.brute_dam
var/burn_was = picked.burn_dam
update |= picked.take_damage(brute,burn,sharp)
update |= picked.take_damage(brute,burn,sharp,used_weapon)
brute -= (picked.brute_dam - brute_was)
burn -= (picked.burn_dam - burn_was)
@@ -150,9 +150,11 @@
/mob/living/carbon/human/proc/get_organ(var/zone)
if(!zone) zone = "chest"
if (zone in list( "eyes", "mouth" ))
zone = "head"
return organs_by_name[zone]
/mob/living/carbon/human/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0)
/mob/living/carbon/human/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0, var/used_weapon = null)
if((damagetype != BRUTE) && (damagetype != BURN))
..(damage, damagetype, def_zone, blocked)
return 1
@@ -174,10 +176,10 @@
switch(damagetype)
if(BRUTE)
if(organ.take_damage(damage, 0, sharp))
if(organ.take_damage(damage, 0, sharp, used_weapon))
UpdateDamageIcon()
if(BURN)
if(organ.take_damage(0, damage, sharp))
if(organ.take_damage(0, damage, sharp, used_weapon))
UpdateDamageIcon()
updatehealth()
return 1
@@ -104,6 +104,9 @@ emp_act
for(var/obj/O in src)
if(!O) continue
O.emp_act(severity)
for(var/datum/organ/external/O in organs)
if(O.status & ORGAN_DESTROYED) continue
O.emp_act(severity)
..()
@@ -111,7 +114,11 @@ emp_act
if(!I || !user) return 0
var/datum/organ/external/affecting = get_organ(ran_zone(user.zone_sel.selecting))
if (!affecting)
return
if(affecting.status & ORGAN_DESTROYED)
user << "What [affecting.display_name]?"
return
var/hit_area = affecting.display_name
if((user != src) && check_shields(I.force, "the [I.name]"))
@@ -126,7 +133,7 @@ emp_act
if(armor >= 2) return 0
if(!I.force) return 0
apply_damage(I.force, I.damtype, affecting, armor , I.sharp)
apply_damage(I.force, I.damtype, affecting, armor , I.sharp, I.name)
var/bloody = 0
if(((I.damtype == BRUTE) || (I.damtype == HALLOSS)) && prob(25 + (I.force * 2)))
@@ -162,7 +169,7 @@ emp_act
if(prob(I.force))
apply_effect(20, PARALYZE, armor)
visible_message("\red <B>[src] has been knocked unconscious!</B>")
if(src != user)
if(src != user && I.damtype == BRUTE)
ticker.mode.remove_revolutionary(mind)
if(bloody)//Apply blood
@@ -48,9 +48,13 @@
var/icon/stand_icon = null
var/icon/lying_icon = null
var/list/organs = list()
var/list/organs = list() //Gets filled up in the constructor (human.dm, New() proc, line 24. I'm sick and tired of missing comments. -Agouri
var/list/organs_by_name = list() // map organ names to organs
var/miming = null //Toggle for the mime's abilities.
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/xylophone = 0 //For the spoooooooky xylophone cooldown
var/mob/remoteview_target = null
@@ -26,11 +26,16 @@
else if(E.status & ORGAN_BROKEN)
tally += 1.5
if(shock_stage >= 10) tally += 3
if(FAT in src.mutations)
tally += 1.5
if (bodytemperature < 283.222)
tally += (283.222 - bodytemperature) / 10 * 1.75
if(mRun in mutations)
tally = 0
return (tally+config.human_delay)
/mob/living/carbon/human/Process_Spacemove(var/check_drift = 0)
@@ -181,9 +181,6 @@
src.r_hand = null
update_inv_r_hand()
//check later on if our species can't wear some clothes
var/cur_species = get_species()
W.loc = src
switch(slot)
if(slot_back)
@@ -228,21 +225,9 @@
W.equipped(src, slot)
update_inv_glasses(redraw_mob)
if(slot_gloves)
var/broken = 0
if(cur_species == "Tajaran")
if(prob(5))
src.visible_message("\red Your feet burst out of the [W], ripping them to shreds!", "\red [src]'s feet burst out of the [W], ripping them to shreds!", "\red You hear a ripping, tearing sound!")
apply_damage(5)
broken = 1
spawn(0)
del(W)
else if(prob(50))
src << "\red You hurt your feet forcing them into the [W]!"
apply_damage(5)
if(!broken)
src.gloves = W
W.equipped(src, slot)
update_inv_gloves(redraw_mob)
src.gloves = W
W.equipped(src, slot)
update_inv_gloves(redraw_mob)
if(slot_head)
src.head = W
if(head.flags & BLOCKHAIR)
@@ -252,21 +237,9 @@
W.equipped(src, slot)
update_inv_head(redraw_mob)
if(slot_shoes)
var/broken = 0
if(cur_species == "Tajaran")
if(prob(5))
src.visible_message("\red Your feet burst out of the [W], ripping them to shreds!", "\red [src]'s feet burst out of the [W], ripping them to shreds!", "\red You hear a ripping, tearing sound!")
apply_damage(5)
broken = 1
spawn(0)
del(W)
else if(prob(50))
src << "\red You hurt your feet forcing them into the [W]!"
apply_damage(5)
if(!broken)
src.shoes = W
W.equipped(src, slot)
update_inv_shoes(redraw_mob)
src.shoes = W
W.equipped(src, slot)
update_inv_shoes(redraw_mob)
if(slot_wear_suit)
src.wear_suit = W
W.equipped(src, slot)
@@ -295,41 +268,10 @@
src << "\red You are trying to eqip this item to an unsupported inventory slot. How the heck did you manage that? Stop it..."
return
//can't quite fit some alien bodyparts
if( W.body_parts_covered & LOWER_TORSO && W.flags_inv & HIDEJUMPSUIT && (cur_species == "Tajaran" || cur_species == "Soghun"))
if(prob(50))
src << "\red You twist your tail trying to fit it in!"
apply_damage(5)
if( W.body_parts_covered & HEAD && W.flags & BLOCKHAIR && (cur_species == "Skrell"))
if(prob(50))
src << "\red You twist your eartails trying to fit it in!"
apply_damage(5)
W.layer = 20
return
/*
/mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1)
overlays_lying[TAIL_LAYER] = null
overlays_standing[TAIL_LAYER] = null
var/cur_species = get_species()
if( cur_species == "Tajaran")
if(!wear_suit || !(wear_suit.flags_inv & HIDEJUMPSUIT) && !istype(wear_suit, /obj/item/clothing/suit/space))
overlays_lying[TAIL_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "tajtail_l")
overlays_standing[TAIL_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "tajtail_s")
else if( cur_species == "Soghun")
if(!wear_suit || !(wear_suit.flags_inv & HIDEJUMPSUIT) && !istype(wear_suit, /obj/item/clothing/suit/space))
overlays_lying[TAIL_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "sogtail_l")
overlays_standing[TAIL_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "sogtail_s")
if(update_icons) update_icons()
*/
/obj/effect/equip_e
name = "equip e"
var/mob/source = null
@@ -491,8 +433,9 @@
return
message = "\red <B>[source] is trying to empty [target]'s pockets.</B>"
if("CPR")
if (target.cpr_time >= world.time + 3)
if (!target.cpr_time)
del(src)
target.cpr_time = 0
message = "\red <B>[source] is trying perform CPR on [target]!</B>"
if("id")
message = "\red <B>[source] is trying to take off [target.wear_id] from [target]'s uniform!</B>"
@@ -598,10 +541,7 @@ It can still be worn/put on as normal.
if (target.legcuffed)
strip_item = target.legcuffed
if("CPR")
if (target.cpr_time >= world.time + 30)
del(src)
if ((target.health >= -99.0 && target.health <= 0))
target.cpr_time = world.time
var/suff = min(target.getOxyLoss(), 7)
target.adjustOxyLoss(-suff)
target.updatehealth()
@@ -609,6 +549,7 @@ It can still be worn/put on as normal.
O.show_message("\red [source] performs CPR on [target]!", 1)
target << "\blue <b>You feel a breath of fresh air enter your lungs. It feels good.</b>"
source << "\red Repeat at least every 7 seconds."
target.cpr_time = 1
if("dnainjector")
var/obj/item/weapon/dnainjector/S = item
if(S)
@@ -645,7 +586,7 @@ It can still be worn/put on as normal.
target.internal = target.belt
if (target.internal)
for(var/mob/M in viewers(target, 1))
M.show_message("[source] is now running on internals.", 1)
M.show_message("[target] is now running on internals.", 1)
target.internal.add_fingerprint(source)
if (target.internals)
target.internals.icon_state = "internal1"
@@ -666,4 +607,4 @@ It can still be worn/put on as normal.
if(source && target)
if(source.machine == target)
target.show_inv(source)
del(src)
del(src)
+420 -126
View File
@@ -1,8 +1,8 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
//NOTE: Breathing happens once per FOUR TICKS, unless the last breath fails. In which case it happens once per ONE TICK! So oxyloss healing is done once per 4 ticks while oxyloss damage is applied once per tick!
#define HUMAN_MAX_OXYLOSS 3 //Defines how much oxyloss humans can get per tick. A tile with no air at all (such as space) applies this value, otherwise it's a percentage of it.
#define HUMAN_CRIT_MAX_OXYLOSS ( (last_tick_duration) /3) //The amount of damage you'll get when in critical condition. We want this to be a 5 minute deal = 300s. There are 100HP to get through, so (1/3)*last_tick_duration per second. Breaths however only happen every 4 ticks.
#define HUMAN_MAX_OXYLOSS 1 //Defines how much oxyloss humans can get per tick. A tile with no air at all (such as space) applies this value, otherwise it's a percentage of it.
#define HUMAN_CRIT_MAX_OXYLOSS ( (last_tick_duration) /5) //The amount of damage you'll get when in critical condition. We want this to be a 5 minute deal = 300s. There are 100HP to get through, so (1/3)*last_tick_duration per second. Breaths however only happen every 4 ticks.
#define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point
#define HEAT_DAMAGE_LEVEL_2 4 //Amount of damage applied when your body temperature passes the 400K point
@@ -38,13 +38,14 @@
..()
/*
//This code is here to try to determine what causes the gender switch to plural error. Once the error is tracked down and fixed, this code should be deleted
//Also delete var/prev_gender once this is removed.
if(prev_gender != gender)
prev_gender = gender
if(gender in list(PLURAL, NEUTER))
message_admins("[src] ([ckey]) gender has been changed to plural or neuter. Please record what has happened recently to the person and then notify coders. (<A HREF='?src=%holder_ref%;adminmoreinfo=\ref[src]'>?</A>) (<A HREF='?src=%holder_ref%;adminplayervars=\ref[src]'>VV</A>) (<A HREF='?src=%admin_ref%;priv_msg=\ref[src]'>PM</A>) (<A HREF='?src=%holder_ref%;adminplayerobservejump=\ref[src]'>JMP</A>)",1,1) //The 1,1 at the end is there to make '%holder_ref%' get replaced with the actual ref object
*/
//Apparently, the person who wrote this code designed it so that
//blinded get reset each cycle and then get activated later in the
//code. Very ugly. I dont care. Moving this stuff here so its easy
@@ -91,6 +92,10 @@
//stuff in the stomach
handle_stomach()
handle_shock()
handle_pain()
//Status updates, death etc.
handle_regular_status_updates() //TODO: optimise ~Carn
update_canmove()
@@ -123,6 +128,78 @@
/mob/living/carbon/human
proc/handle_blood()
// take care of blood and blood loss
if(stat < 2)
var/blood_volume = round(vessel.get_reagent_amount("blood"))
if(blood_volume < 560 && blood_volume)
var/datum/reagent/blood/B = locate() in vessel.reagent_list //Grab some blood
if(B) // Make sure there's some blood at all
if(B.data["donor"] != src) //If it's not theirs, then we look for theirs
for(var/datum/reagent/blood/D in vessel.reagent_list)
if(D.data["donor"] == src)
B = D
break
var/datum/reagent/nutriment/F = locate() in vessel.reagent_list
if(F != null)
if(F.volume >= 1)
// nutriment speeds it up quite a bit
B.volume += 0.4
F.volume -= 0.1
else
//At this point, we dun care which blood we are adding to, as long as they get more blood.
B.volume = B.volume + 0.1 // regenerate blood VERY slowly
switch(blood_volume)
if(501 to 10000)
if(pale)
pale = 0
update_body()
if(336 to 500)
if(!pale)
pale = 1
update_body()
var/word = pick("dizzy","woosey","faint")
src << "\red You feel [word]"
if(prob(1))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel [word]"
if(oxyloss < 20)
// hint that they're getting close to suffocation
oxyloss += 3
if(224 to 335)
if(!pale)
pale = 1
update_body()
eye_blurry += 6
if(oxyloss < 50)
oxyloss += 10
oxyloss += 1
if(prob(15))
Paralyse(rand(1,3))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel extremely [word]"
if(122 to 244)
oxyloss += 5
toxloss += 5
if(prob(15))
var/word = pick("dizzy","woosey","faint")
src << "\red You feel extremely [word]"
if(0 to 122)
death()
var/blood_max = 0
for(var/datum/organ/external/temp in organs)
if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT)
continue
for(var/datum/wound/W in temp.wounds) if(W.bleeding())
blood_max += W.damage / 4
if(temp.status & ORGAN_DESTROYED && !(temp.status & ORGAN_GAUZED))
blood_max += 20 //Yer missing a fucking limb.
drip(blood_max)
proc/handle_disabilities()
if (disabilities & EPILEPSY)
if ((prob(1) && paralysis < 1))
@@ -165,7 +242,7 @@
if(1)
say(pick("IM A PONY NEEEEEEIIIIIIIIIGH", "without oxigen blob don't evoluate?", "CAPTAINS A COMDOM", "[pick("", "that faggot traitor")] [pick("joerge", "george", "gorge", "gdoruge")] [pick("mellens", "melons", "mwrlins")] is grifing me HAL;P!!!", "can u give me [pick("telikesis","halk","eppilapse")]?", "THe saiyans screwed", "Bi is THE BEST OF BOTH WORLDS>", "I WANNA PET TEH monkeyS", "stop grifing me!!!!", "SOTP IT#"))
if(2)
say(pick("FUS RO DAH","fucking 4rries!", "stat me", ">my face", "roll it easy!", "waaaaaagh!!!", "red wonz go fasta", "FOR TEH EMPRAH", "lol2cat", "dem dwarfs man, dem dwarfs", "SPESS MAHREENS", "hwee did eet fhor khayosss", "lifelike texture ;_;", "luv can bloooom"))
say(pick("FUS RO DAH","fucking 4rries!", "stat me", ">my face", "roll it easy!", "waaaaaagh!!!", "red wonz go fasta", "FOR TEH EMPRAH", "lol2cat", "dem dwarfs man, dem dwarfs", "SPESS MAHREENS", "hwee did eet fhor khayosss", "lifelike texture ;_;", "luv can bloooom", "PACKETS!!!"))
if(3)
emote("drool")
@@ -181,6 +258,12 @@
number_wounds += E.number_wounds
var/leg_tally = 2
var/canstand_l = 1 //Can stand on left leg
var/canstand_r = 1 //Can stand on right leg
var/hasleg_l = 1 //Have left leg
var/hasleg_r = 1 //Have right leg
var/hasarm_l = 1 //Have left arm
var/hasarm_r = 1 //Have right arm
for(var/datum/organ/external/E in organs)
E.process()
if(E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam))
@@ -207,7 +290,7 @@
else if(E.name == "l_leg" || E.name == "l_foot" \
|| E.name == "r_leg" || E.name == "r_foot" && !lying)
leg_tally-- // let it fail even if just foot&leg
if(E.status & ORGAN_BROKEN || E.status & ORGAN_DESTROYED)
if(E.status & ORGAN_BROKEN || (E.status & ORGAN_DESTROYED && !E.amputated))
if(E.name == "l_hand" || E.name == "l_arm")
if(hand && equipped())
if(E.status & ORGAN_SPLINTED && prob(10))
@@ -228,6 +311,7 @@
|| E.name == "r_leg" || E.name == "r_foot" && !lying)
if(!(E.status & ORGAN_SPLINTED))
leg_tally-- // let it fail even if just foot&leg
// standing is poor
if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5))
emote("scream")
@@ -235,37 +319,128 @@
paralysis = 10
//Check arms and legs for existence
var/datum/organ/external/E
E = get_organ("l_leg")
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
canstand_l = 0
hasleg_l = 0
E = get_organ("r_leg")
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
canstand_r = 0
hasleg_r = 0
E = get_organ("l_foot")
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
canstand_l = 0
E = get_organ("r_foot")
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
canstand_r = 0
E = get_organ("l_arm")
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
hasarm_l = 0
E = get_organ("r_arm")
if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED))
hasarm_r = 0
// Can stand if have at least one full leg (with leg and foot parts present)
// Has limbs to move around if at least one arm or leg is at least partially there
can_stand = canstand_l||canstand_r
has_limbs = hasleg_l||hasleg_r||hasarm_l||hasarm_r
proc/handle_mutations_and_radiation()
if(getFireLoss())
if((COLD_RESISTANCE in mutations) || (prob(1) && prob(75)))
if((COLD_RESISTANCE in mutations) || (prob(1)))
heal_organ_damage(0,1)
if(mHallucination in mutations)
hallucination = 100
halloss = 0
if(mSmallsize in mutations)
if(!(pass_flags & PASSTABLE))
pass_flags |= PASSTABLE
else
if(pass_flags & PASSTABLE)
pass_flags &= ~PASSTABLE
// Make nanoregen heal youu, -3 all damage types
if(NANOREGEN in augmentations)
if((NANOREGEN in augmentations) || (mRegen in mutations))
var/healed = 0
if(getToxLoss())
adjustToxLoss(-3)
healed = 1
if(getOxyLoss())
adjustOxyLoss(-3)
healed = 1
if(getCloneLoss())
adjustCloneLoss(-3)
healed = 1
if(getBruteLoss())
heal_organ_damage(3,0)
healed = 1
if(getFireLoss())
heal_organ_damage(0,3)
healed = 1
if(halloss > 0)
halloss -= 3
if(halloss < 0) halloss = 0
healed = 1
var/hptoreg = 0
if(NANOREGEN in augmentations)
hptoreg += 3
if(mRegen in mutations)
hptoreg += 2
if(stat==UNCONSCIOUS) hptoreg/=2
if(stat==DEAD) hptoreg=0
for(var/i=0, i<hptoreg, i++)
var/list/damages = new/list()
if(getToxLoss())
damages+="tox"
if(getOxyLoss())
damages+="oxy"
if(getCloneLoss())
damages+="clone"
if(getBruteLoss())
damages+="brute"
if(getFireLoss())
damages+="burn"
if(halloss != 0)
damages+="hal"
if(damages.len)
switch(pick(damages))
if("tox")
adjustToxLoss(-1)
healed = 1
if("oxy")
adjustOxyLoss(-1)
healed = 1
if("clone")
adjustCloneLoss(-1)
healed = 1
if("brute")
heal_organ_damage(1,0)
healed = 1
if("burn")
heal_organ_damage(0,1)
healed = 1
if("hal")
if(halloss > 0)
halloss -= 1
if(halloss < 0)
halloss = 0
healed = 1
else
break
if(healed)
if(prob(5))
src << "\blue You feel your wounds mending..."
if(!(/mob/living/carbon/human/proc/morph in src.verbs))
if(mMorph in mutations)
src.verbs += /mob/living/carbon/human/proc/morph
else
if(!(mMorph in mutations))
src.verbs -= /mob/living/carbon/human/proc/morph
if(!(/mob/living/carbon/human/proc/remoteobserve in src.verbs))
if(mRemote in mutations)
src.verbs += /mob/living/carbon/human/proc/remoteobserve
else
if(!(mRemote in mutations))
src.verbs -= /mob/living/carbon/human/proc/remoteobserve
if(!(/mob/living/carbon/human/proc/remotesay in src.verbs))
if(mRemotetalk in mutations)
src.verbs += /mob/living/carbon/human/proc/remotesay
else
if(!(mRemotetalk in mutations))
src.verbs -= /mob/living/carbon/human/proc/remotesay
if ((HULK in mutations) && health <= 25)
mutations.Remove(HULK)
update_mutations() //update our mutation overlays
@@ -284,15 +459,18 @@
radiation = 0
else
var/damage = 0
switch(radiation)
if(1 to 49)
radiation--
if(prob(25))
adjustToxLoss(1)
damage = 1
updatehealth()
if(50 to 74)
radiation -= 2
damage = 1
adjustToxLoss(1)
if(prob(5))
radiation -= 5
@@ -304,25 +482,35 @@
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
damage = 1
if(prob(1))
src << "\red You mutate!"
randmutb(src)
domutcheck(src,null)
emote("gasp")
updatehealth()
if(damage && organs.len)
var/datum/organ/external/O = pick(organs)
if(istype(O)) O.add_autopsy_data("Radiation Poisoning", damage)
proc/breathe()
if(reagents.has_reagent("lexorin")) return
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
var/lung_ruptured = is_lung_ruptured()
if(lung_ruptured && prob(2))
spawn emote("me", 1, "coughs up blood!")
src.drip(10)
var/datum/gas_mixture/environment = loc.return_air()
var/datum/gas_mixture/breath
// HACK NEED CHANGING LATER
if(health < 0)
losebreath++
if(lung_ruptured && prob(4))
spawn emote("me", 1, "gasps for air!")
losebreath += 5
if(losebreath>0) //Suffocating so do not take a breath
losebreath--
if (prob(10)) //Gasp per 10 ticks? Sounds about right.
@@ -397,10 +585,10 @@
proc/handle_breath(datum/gas_mixture/breath)
if(nodamage || REBREATHER in augmentations)
if(nodamage || (REBREATHER in augmentations) || (mNobreath in mutations))
return
if(!breath || (breath.total_moles == 0) || suiciding)
if(!breath || (breath.total_moles() == 0) || suiciding)
if(reagents.has_reagent("inaprovaline"))
return
if(suiciding)
@@ -480,7 +668,7 @@
if(Toxins_pp > safe_toxins_max) // Too much toxins
var/ratio = breath.toxins/safe_toxins_max
adjustToxLoss(min(ratio, 10)) //Limit amount of damage toxin exposure can do per second
adjustToxLoss(min(ratio, MIN_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
toxins_alert = max(toxins_alert, 1)
else
toxins_alert = 0
@@ -495,6 +683,7 @@
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
if(prob(20))
spawn(0) emote(pick("giggle", "laugh"))
SA.moles = 0
if( (abs(310.15 - breath.temperature) > 50) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :(
if(breath.temperature < 260.15)
@@ -506,24 +695,27 @@
switch(breath.temperature)
if(-INFINITY to 120)
apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head")
apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
if(120 to 200)
apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head")
apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
if(200 to 260)
apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head")
apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
if(360 to 400)
apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head")
apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2)
if(400 to 1000)
apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head")
apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2)
if(1000 to INFINITY)
apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head")
apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2)
if(oxyloss >= 50 && prob(oxyloss / 5))
rupture_lung()
//Temporary fixes to the alerts.
return 1
@@ -812,7 +1004,8 @@
proc/handle_chemicals_in_body()
if(reagents) reagents.metabolize(src)
if(dna && dna.mutantrace == "plant") //couldn't think of a better place to place it, since it handles nutrition -- Urist
// if(dna && dna.mutantrace == "plant") //couldn't think of a better place to place it, since it handles nutrition -- Urist
if(PLANT in mutations)
var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing
if(isturf(loc)) //else, there's considered to be no light
var/turf/T = loc
@@ -828,7 +1021,7 @@
adjustToxLoss(-1)
adjustOxyLoss(-1)
//The fucking FAT mutation is the dumbest shit ever. It makes the code so difficult to work with
/* //The fucking FAT mutation is the dumbest shit ever. It makes the code so difficult to work with
if(FAT in mutations)
if(overeatduration < 100)
src << "\blue You feel fit again!"
@@ -845,6 +1038,7 @@
update_mutations(0)
update_inv_w_uniform(0)
update_inv_wear_suit()
*/
// nutrition decrease
if (nutrition > 0 && stat != 2)
@@ -857,7 +1051,8 @@
if(overeatduration > 1)
overeatduration -= 2 //doubled the unfat rate
if(dna && dna.mutantrace == "plant")
// if(dna && dna.mutantrace == "plant")
if(PLANT in mutations)
if(nutrition < 200)
take_overall_damage(2,0)
@@ -877,6 +1072,19 @@
dizziness = max(0, dizziness - 3)
jitteriness = max(0, jitteriness - 3)
if(life_tick % 10 == 0)
// handle trace chemicals for autopsy
for(var/datum/organ/O in organs)
for(var/chemID in O.trace_chemicals)
O.trace_chemicals[chemID] = O.trace_chemicals[chemID] - 1
if(O.trace_chemicals[chemID] <= 0)
O.trace_chemicals.Remove(chemID)
for(var/datum/reagent/A in reagents.reagent_list)
// add chemistry traces to a random organ
var/datum/organ/O = pick(organs)
O.trace_chemicals[A.name] = 100
updatehealth()
return //TODO: DEFERRED
@@ -888,12 +1096,15 @@
else //ALIVE. LIGHTS ARE ON
updatehealth() //TODO
handle_organs()
handle_blood()
if(health <= config.health_threshold_dead || brain_op_stage == 4.0)
death()
blinded = 1
silent = 0
return 1
// the analgesic effect wears off slowly
analgesic = max(0, analgesic - 1)
//UNCONSCIOUS. NO-ONE IS HOME
if( (getOxyLoss() > 50) || (config.health_threshold_crit > health) )
@@ -937,7 +1148,9 @@
else if(sleeping)
handle_dreams()
adjustHalLoss(-5)
sleeping = max(sleeping-1, 0)
if (mind)
if(mind.active || immune_to_ssd)
sleeping = max(sleeping-1, 0)
blinded = 1
stat = UNCONSCIOUS
if( prob(10) && health && !hal_crit )
@@ -953,7 +1166,7 @@
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
blinded = 1
else if(istype(glasses, /obj/item/clothing/glasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster
else if(istype(glasses, /obj/item/clothing/glasses/sunglasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster
eye_blurry = max(eye_blurry-3, 0)
blinded = 1
else if(eye_blurry) //blurry eyes heal slowly
@@ -979,12 +1192,20 @@
if(stuttering)
stuttering = max(stuttering-1, 0)
if (src.slurring)
slurring = max(slurring-1, 0)
if(silent)
silent = max(silent-1, 0)
if(druggy)
druggy = max(druggy-1, 0)
// Increase germ_level regularly
if(prob(40))
germ_level += 1
// If you're dirty, your gloves will become dirty, too.
if(gloves && germ_level > gloves.germ_level && prob(10))
gloves.germ_level += 1
return 1
proc/handle_regular_hud_updates()
@@ -994,64 +1215,78 @@
if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe
del(hud)
client.screen.Remove(hud_used.blurry, hud_used.druggy, hud_used.vimpaired, hud_used.darkMask)
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
update_action_buttons()
if(!src.oxyloss)
damageoverlay.icon_state = "oxydamageoverlay0"
else
switch(oxyloss)
if(0 to 10)
damageoverlay.icon_state = "oxydamageoverlay0"
if(10 to 20)
damageoverlay.icon_state = "oxydamageoverlay1"
if(20 to 25)
damageoverlay.icon_state = "oxydamageoverlay2"
if(25 to 30)
damageoverlay.icon_state = "oxydamageoverlay3"
if(30 to 35)
damageoverlay.icon_state = "oxydamageoverlay4"
if(35 to 40)
damageoverlay.icon_state = "oxydamageoverlay5"
if(40 to 45)
damageoverlay.icon_state = "oxydamageoverlay6"
if(45 to INFINITY)
damageoverlay.icon_state = "oxydamageoverlay7"
if(damageoverlay.overlays)
damageoverlay.overlays = list()
var/hurtdamage = src.getBruteLoss() + src.getFireLoss()
if(hurtdamage)
var/image/I
switch(hurtdamage)
if(10 to 20)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay1")
if(20 to 30)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay2")
if(30 to 40)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay3")
if(40 to 45)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay4")
if(45 to 50)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay5")
if(50 to 56)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay6")
if(56 to 62)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay7")
if(62 to 68)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay8")
if(68 to 74)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay9")
if(74 to 80)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay10")
if(80 to 86)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay11")
if(86 to 92)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay12")
if(92 to INFINITY)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay13")
damageoverlay.overlays += I
if(stat == UNCONSCIOUS)
//Critical damage passage overlay
if(health <= 0)
var/image/I
switch(health)
if(-20 to -10)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage1")
if(-30 to -20)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage2")
if(-40 to -30)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage3")
if(-50 to -40)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage4")
if(-60 to -50)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage5")
if(-70 to -60)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage6")
if(-80 to -70)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage7")
if(-90 to -80)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage8")
if(-95 to -90)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage9")
if(-INFINITY to -95)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage10")
damageoverlay.overlays += I
else
//Oxygen damage overlay
if(oxyloss)
var/image/I
switch(oxyloss)
if(10 to 20)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay1")
if(20 to 25)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay2")
if(25 to 30)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay3")
if(30 to 35)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay4")
if(35 to 40)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay5")
if(40 to 45)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay6")
if(45 to INFINITY)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay7")
damageoverlay.overlays += I
//Fire and Brute damage overlay (BSSR)
var/hurtdamage = src.getBruteLoss() + src.getFireLoss()
if(hurtdamage)
var/image/I
switch(hurtdamage)
if(10 to 25)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay1")
if(25 to 40)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay2")
if(40 to 55)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay3")
if(55 to 70)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay4")
if(70 to 85)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay5")
if(85 to INFINITY)
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay6")
damageoverlay.overlays += I
if( stat == DEAD )
sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
@@ -1062,9 +1297,13 @@
sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
if(dna)
switch(dna.mutantrace)
if("lizard","metroid")
if("metroid")
see_in_dark = 3
see_invisible = SEE_INVISIBLE_LEVEL_ONE
if("lizard")
see_in_dark = 3
if("tajaran")
see_in_dark = 8
else
see_in_dark = 2
@@ -1145,8 +1384,6 @@
else
see_invisible = SEE_INVISIBLE_LIVING
if(sleep && !hal_crit) sleep.icon_state = "sleep[sleeping]" //used?
if(healths)
switch(hal_screwyhud)
if(1) healths.icon_state = "health6"
@@ -1215,46 +1452,44 @@
else blind.layer = 0
if( disabilities & NEARSIGHTED && !istype(glasses, /obj/item/clothing/glasses/regular) )
client.screen += hud_used.vimpaired
if(eye_blurry) client.screen += hud_used.blurry
if(druggy) client.screen += hud_used.druggy
client.screen += global_hud.vimpaired
if(eye_blurry) client.screen += global_hud.blurry
if(druggy) client.screen += global_hud.druggy
var/masked = 0
if( istype(head, /obj/item/clothing/head/welding) )
var/obj/item/clothing/head/welding/O = head
if(!O.up && tinted_weldhelh)
client.screen += hud_used.darkMask
client.screen += global_hud.darkMask
masked = 1
if(!masked && istype(glasses, /obj/item/clothing/glasses/welding) )
var/obj/item/clothing/glasses/welding/O = glasses
if(!O.up && tinted_weldhelh)
client.screen += global_hud.darkMask
if(eye_stat > 20)
if(eye_stat > 30) client.screen += hud_used.darkMask
else client.screen += hud_used.vimpaired
if(eye_stat > 30) client.screen += global_hud.darkMask
else client.screen += global_hud.vimpaired
if(machine)
if(!machine.check_eye(src)) reset_view(null)
else
if(!client.adminobs) reset_view(null)
var/isRemoteObserve = 0
if((mRemote in mutations) && remoteview_target)
if(remoteview_target.stat==CONSCIOUS)
isRemoteObserve = 1
if(!isRemoteObserve && !client.adminobs)
remoteview_target = null
reset_view(null)
return 1
proc/handle_random_events()
// Puke if toxloss is too high
if(!stat)
if (getToxLoss() >= 45 && nutrition > 20)
lastpuke ++
if(lastpuke >= 25) // about 25 second delay I guess
Stun(5)
for(var/mob/O in viewers(world.view, src))
O.show_message(text("<b>\red [] throws up!</b>", src), 1)
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
var/turf/location = loc
if (istype(location, /turf/simulated))
location.add_vomit_floor(src, 1)
nutrition -= 20
adjustToxLoss(-3)
// make it so you can only puke so fast
lastpuke = 0
vomit()
//0.1% chance of playing a scary sound to someone who's in complete darkness
if(isturf(loc) && rand(1,1000) == 1)
@@ -1266,7 +1501,28 @@
if(bodytemperature > 406)
for(var/datum/disease/D in viruses)
D.cure()
return
if(!virus2)
for(var/obj/effect/decal/cleanable/blood/B in view(1,src))
if(B.virus2 && get_infection_chance())
infect_virus2(src,B.virus2)
for(var/obj/effect/decal/cleanable/mucus/M in view(1,src))
if(M.virus2 && get_infection_chance())
infect_virus2(src,M.virus2)
else
if(isnull(virus2)) // Trying to figure out a runtime error that keeps repeating
CRASH("virus2 nulled before calling activate()")
else
virus2.activate(src)
// activate may have deleted the virus
if(!virus2) return
// check if we're immune
if(virus2.antigen & src.antibodies) virus2.dead = 1
return
proc/handle_stomach()
spawn(0)
@@ -1289,5 +1545,43 @@
if(mind && mind.changeling)
mind.changeling.regenerate()
handle_shock()
..()
if(analgesic) return // analgesic avoids all traumatic shock temporarily
if(health < 0)// health 0 makes you immediately collapse
shock_stage = max(shock_stage, 61)
if(traumatic_shock >= 80)
shock_stage += 1
else
shock_stage = min(shock_stage, 100)
shock_stage = max(shock_stage-1, 0)
return
if(shock_stage == 10)
src << "<font color='red'><b>"+pick("It hurts so much!", "You really need some painkillers..", "Dear god, the pain!")
if(shock_stage >= 30)
if(shock_stage == 30) emote("me",1,"is having trouble keeping their eyes open.")
eye_blurry = max(2, eye_blurry)
stuttering = max(stuttering, 5)
if(shock_stage == 40)
src << "<font color='red'><b>"+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!")
if (shock_stage >= 60)
if(shock_stage == 60) emote("me",1,"'s body becomes limp.")
if (prob(5))
Stun(20)
lying = 1
if(shock_stage == 80)
src << "<font color='red'><b>"+pick("You see a light at the end of the tunnel!", "You feel like you could die any moment now.", "You're about to lose consciousness.")
if (shock_stage > 80)
Paralyse(rand(15,28))
#undef HUMAN_MAX_OXYLOSS
#undef HUMAN_CRIT_MAX_OXYLOSS
#undef HUMAN_CRIT_MAX_OXYLOSS
+20 -4
View File
@@ -11,16 +11,18 @@
return
else
return ..(message)
if(stat == DEAD)
return ..(message)
if(length(message) >= 1) //In case people forget the '*help' command, this will slow them the message and prevent people from saying one letter at a time
if (copytext(message, 1, 2) != "*")
return
if(src.dna)
if(src.dna.mutantrace == "lizard")
/*if(src.dna.mutantrace == "lizard") //Soghun stutterss-s-ss-sss.
if(copytext(message, 1, 2) != "*")
message = dd_replacetext(message, "s", stutter("ss"))
*/
if(src.dna.mutantrace == "metroid" && prob(5))
if(copytext(message, 1, 2) != "*")
if(copytext(message, 1, 2) == ";")
@@ -32,7 +34,7 @@
for(var/i = 0,i<imax,i++)
message += "E"
if(stat != 2)
if(stat != DEAD)
for(var/datum/disease/pierrot_throat/D in viruses)
var/list/temp_message = dd_text2list(message, " ") //List each word in the message
var/list/pick_list = list()
@@ -115,6 +117,8 @@
message = dd_replacetext(message, ".", "")
message = lowertext(message)
*/
if (src.slurring)
message = slur(message)
..(message)
/mob/living/carbon/human/say_understands(var/other)
@@ -130,4 +134,16 @@
return 1
if (istype(other, /mob/living/carbon/metroid))
return 1
return ..()
return ..()
/mob/living/carbon/human/GetVoice()
if(istype(src.wear_mask, /obj/item/clothing/mask/gas/voice))
var/obj/item/clothing/mask/gas/voice/V = src.wear_mask
if(V.vchange)
return V.voice
else
return name
if(mind && mind.changeling && mind.changeling.mimicing)
return mind.changeling.mimicing
return real_name
@@ -216,104 +216,140 @@ proc/get_damage_icon_part(damage_state, body_part)
//BASE MOB SPRITE
/mob/living/carbon/human/proc/update_body(var/update_icons=1)
if(stand_icon) del(stand_icon)
if(lying_icon) del(lying_icon)
// if(dna && dna.mutantrace) return
var/husk_color_mod = rgb(96,88,80)
var/hulk_color_mod = rgb(48,224,40)
var/plant_color_mod = rgb(144,224,144)
var/husk = (HUSK in src.mutations) //100% unnecessary -Agouri //nope, do you really want to iterate through src.mutations repeatedly? -Pete
var/fat = (FAT in src.mutations)
var/hulk = (HULK in src.mutations)
var/skeleton = (SKELETON in src.mutations)
var/plant = (PLANT in src.mutations)
var/g = "m"
if(gender == FEMALE) g = "f"
var/husk = (HUSK in src.mutations)
var/obese = (FAT in src.mutations)
// whether to draw the individual limbs
var/individual_limbs = 1
//Base mob icon
if(obese)
// Sorry, no dismemberment for fat people.
stand_icon = new /icon('icons/mob/human.dmi', "fatbody_s")
lying_icon = new /icon('icons/mob/human.dmi', "fatbody_l")
individual_limbs = 0
// If dismemberment is on, draw individual limbs
else if(config.limbs_can_break)
stand_icon = new /icon('icons/mob/human.dmi', "torso_[g]_s")
lying_icon = new /icon('icons/mob/human.dmi', "torso_[g]_l")
// Otherwise just draw the full body.
var/icon/icobase
if(skeleton)
icobase = 'icons/mob/human_races/r_skeleton.dmi'
else if(dna)
switch(dna.mutantrace)
if("tajaran")
icobase = 'icons/mob/human_races/r_tajaran.dmi'
if("lizard")
icobase = 'icons/mob/human_races/r_lizard.dmi'
if("skrell")
icobase = 'icons/mob/human_races/r_skrell.dmi'
else
icobase = 'icons/mob/human_races/r_human.dmi'
else
stand_icon = new /icon('icons/mob/human.dmi', "body_[g]_s")
lying_icon = new /icon('icons/mob/human.dmi', "body_[g]_l")
individual_limbs = 0
icobase = 'icons/mob/human_races/r_human.dmi'
// Draw each individual limb
if(individual_limbs)
stand_icon.Blend(new /icon('icons/mob/human.dmi', "chest_[g]_s"), ICON_OVERLAY)
lying_icon.Blend(new /icon('icons/mob/human.dmi', "chest_[g]_l"), ICON_OVERLAY)
if(!skeleton)
stand_icon = new /icon(icobase, "torso_[g][fat?"_fat":""]")
if(husk)
stand_icon.ColorTone(husk_color_mod)
else if(hulk)
// stand_icon.ColorTone(hulk_color_mod)
var/list/TONE = ReadRGB(hulk_color_mod)
stand_icon.MapColors(rgb(TONE[1],0,0),rgb(0,TONE[2],0),rgb(0,0,TONE[3]))
else if(plant)
stand_icon.ColorTone(plant_color_mod)
else
stand_icon = new /icon(icobase, "torso")
var/datum/organ/external/head = get_organ("head")
if(head && !(head.status & ORGAN_DESTROYED))
stand_icon.Blend(new /icon('icons/mob/human.dmi', "head_[g]_s"), ICON_OVERLAY)
lying_icon.Blend(new /icon('icons/mob/human.dmi', "head_[g]_l"), ICON_OVERLAY)
var/datum/organ/external/head = get_organ("head")
var/has_head = 0
if(head && !(head.status & ORGAN_DESTROYED))
has_head = 1
for(var/datum/organ/external/part in organs)
if(!istype(part, /datum/organ/external/groin) \
&& !istype(part, /datum/organ/external/chest) \
&& !istype(part, /datum/organ/external/head) \
&& !(part.status & ORGAN_DESTROYED))
var/icon/temp = new /icon('human.dmi', "[part.icon_name]_s")
if(part.status & ORGAN_ROBOT) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
for(var/datum/organ/external/part in organs)
if(!istype(part, /datum/organ/external/chest) && !(part.status & ORGAN_DESTROYED))
var/icon/temp
if(istype(part, /datum/organ/external/groin))
if(skeleton)
temp = new /icon(icobase, "groin")
else
temp = new /icon(icobase, "groin_[g]")
else if(istype(part, /datum/organ/external/head))
if(skeleton)
temp = new /icon(icobase, "head")
else
temp = new /icon(icobase, "head_[g]")
else
temp = new /icon(icobase, "[part.icon_name]")
if(part.status & ORGAN_ROBOT)
temp.GrayScale()
else if(!skeleton)
if(husk)
temp.ColorTone(husk_color_mod)
else if(hulk)
// temp.ColorTone(hulk_color_mod)
var/list/TONE = ReadRGB(hulk_color_mod)
temp.MapColors(rgb(TONE[1],0,0),rgb(0,TONE[2],0),rgb(0,0,TONE[3]))
else if(plant)
temp.ColorTone(plant_color_mod)
//That part makes left and right legs drawn topmost and lowermost when human looks WEST or EAST
//And no change in rendering for other parts (they icon_position is 0, so goes to 'else' part)
if(part.icon_position&(LEFT|RIGHT))
var/icon/temp2 = new('icons/mob/human.dmi',"blank")
temp2.Insert(new/icon(temp,dir=NORTH),dir=NORTH)
temp2.Insert(new/icon(temp,dir=SOUTH),dir=SOUTH)
if(!(part.icon_position & LEFT))
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
if(!(part.icon_position & RIGHT))
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
stand_icon.Blend(temp2, ICON_OVERLAY)
temp2 = new('icons/mob/human.dmi',"blank")
if(part.icon_position & LEFT)
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
if(part.icon_position & RIGHT)
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
stand_icon.Blend(temp2, ICON_UNDERLAY)
else
stand_icon.Blend(temp, ICON_OVERLAY)
temp = new /icon('human.dmi', "[part.icon_name]_l")
if(part.status & ORGAN_ROBOT) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
lying_icon.Blend(temp , ICON_OVERLAY)
stand_icon.Blend(new /icon('human.dmi', "groin_[g]_s"), ICON_OVERLAY)
lying_icon.Blend(new /icon('human.dmi', "groin_[g]_l"), ICON_OVERLAY)
if (husk)
var/icon/husk_s = new /icon('human.dmi', "husk_s")
var/icon/husk_l = new /icon('human.dmi', "husk_l")
for(var/datum/organ/external/part in organs)
if(!istype(part, /datum/organ/external/groin) \
&& !istype(part, /datum/organ/external/chest) \
&& !istype(part, /datum/organ/external/head) \
&& (part.status & ORGAN_DESTROYED))
husk_s.Blend(new /icon('dam_mask.dmi', "[part.icon_name]"), ICON_SUBTRACT)
husk_l.Blend(new /icon('dam_mask.dmi', "[part.icon_name]2"), ICON_SUBTRACT)
stand_icon.Blend(husk_s, ICON_OVERLAY)
lying_icon.Blend(husk_l, ICON_OVERLAY)
//Skin tone
if(s_tone >= 0)
stand_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
lying_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
else
stand_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
lying_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
if(!skeleton && !husk && !hulk && !plant)
if(s_tone >= 0)
stand_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
else
stand_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
//Eyes
// Note: These used to be in update_face(), and the fact they're here will make it difficult to create a disembodied head
var/icon/eyes_s = new/icon('icons/mob/human_face.dmi', "eyes_s")
var/icon/eyes_l = new/icon('icons/mob/human_face.dmi', "eyes_l")
eyes_s.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
eyes_l.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
stand_icon.Blend(eyes_s, ICON_OVERLAY)
lying_icon.Blend(eyes_l, ICON_OVERLAY)
if(husk)
var/icon/mask = new(stand_icon)
var/icon/husk_over = new(icobase,"overlay_husk")
mask.MapColors(0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,0)
husk_over.Blend(mask, ICON_ADD)
stand_icon.Blend(husk_over, ICON_OVERLAY)
if(has_head)
//Eyes
if(!skeleton)
var/icon/eyes_s = new/icon('icons/mob/human_face.dmi', "eyes_s")
eyes_s.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
stand_icon.Blend(eyes_s, ICON_OVERLAY)
//Mouth (lipstick!)
if(lip_style)
if(lip_style) //skeletons are allowed to wear lipstick no matter what you think, agouri.
stand_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_s"), ICON_OVERLAY)
lying_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_l"), ICON_OVERLAY)
//Underwear
if(underwear < 6 && underwear > 0)
if(!obese)
stand_icon.Blend(new /icon('human.dmi', "underwear[underwear]_[g]_s"), ICON_OVERLAY)
lying_icon.Blend(new /icon('human.dmi', "underwear[underwear]_[g]_l"), ICON_OVERLAY)
//tail update_tail_showing(0)
if(update_icons) update_icons()
if(underwear >0 && underwear < 12)
if(!fat && !skeleton)
stand_icon.Blend(new /icon('icons/mob/human.dmi', "underwear[underwear]_[g]_s"), ICON_OVERLAY)
lying_icon = stand_icon.MakeLying()
if(update_icons)
update_icons()
//tail
update_tail_showing(0)
//HAIR OVERLAY
@@ -322,15 +358,15 @@ proc/get_damage_icon_part(damage_state, body_part)
overlays_lying[HAIR_LAYER] = null
overlays_standing[HAIR_LAYER] = null
var/datum/organ/external/head/head = get_organ("head")
if( !head || (head.status & ORGAN_DESTROYED) )
var/datum/organ/external/head/head_organ = get_organ("head")
if( !head_organ || (head_organ.status & ORGAN_DESTROYED) )
if(update_icons) update_icons()
return
//mutantraces (xeno crew) can have hair. masks and helmets can obscure our hair too.
if( (head && (head.status & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
if(update_icons)
update_icons()
//masks and helmets can obscure our hair.
if( (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
if(update_icons) update_icons()
return
//base icons
@@ -364,7 +400,7 @@ proc/get_damage_icon_part(damage_state, body_part)
/mob/living/carbon/human/update_mutations(var/update_icons=1)
var/fat
if( FAT in mutations )
if(FAT in mutations)
fat = "fat"
var/image/lying = image("icon" = 'icons/effects/genetics.dmi')
@@ -407,27 +443,29 @@ proc/get_damage_icon_part(damage_state, body_part)
var/fat
if( FAT in mutations )
fat = "fat"
var/g = "m"
if (gender == FEMALE) g = "f"
// var/g = "m"
// if (gender == FEMALE) g = "f"
//BS12 EDIT
if(dna)
switch(dna.mutantrace)
if("golem","metroid")
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_l")
overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_s")
if("lizard", "tajaran", "skrell")
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "[dna.mutantrace]_[g]_l")
overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "[dna.mutantrace]_[g]_s")
if("plant")
if(stat == DEAD) //TODO
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace]_d")
else
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_l")
overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_s")
var/icon/I = new('icons/effects/genetics.dmi',"[dna.mutantrace][fat]_s")
overlays_standing[MUTANTRACE_LAYER] = image(I)
overlays_lying[MUTANTRACE_LAYER] = image(I.MakeLying())
// if("lizard", "tajaran", "skrell")
// overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "[dna.mutantrace]_[g]_l")
// overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "[dna.mutantrace]_[g]_s")
// if("plant")
// if(stat == DEAD) //TODO
// overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace]_d")
// else
// overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_l")
// overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_s")
else
overlays_lying[MUTANTRACE_LAYER] = null
overlays_standing[MUTANTRACE_LAYER] = null
update_body(0)
if(!dna || !(dna.mutantrace in list("golem","metroid")))
update_body(0)
update_hair(0)
if(update_icons) update_icons()
@@ -471,17 +509,9 @@ proc/get_damage_icon_part(damage_state, body_part)
var/image/lying = image("icon_state" = "[t_color]_l")
var/image/standing = image("icon_state" = "[t_color]_s")
if(FAT in mutations)
if(w_uniform.flags&ONESIZEFITSALL)
lying.icon = 'icons/mob/uniform_fat.dmi'
standing.icon = 'icons/mob/uniform_fat.dmi'
else
src << "\red You burst out of \the [w_uniform]!"
drop_from_inventory(w_uniform)
return
else
lying.icon = 'icons/mob/uniform.dmi'
standing.icon = 'icons/mob/uniform.dmi'
lying.icon = 'icons/mob/uniform.dmi'
standing.icon = 'icons/mob/uniform.dmi'
if(w_uniform.blood_DNA)
lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "uniformblood2")
@@ -628,35 +658,21 @@ proc/get_damage_icon_part(damage_state, body_part)
var/image/lying = image("icon" = 'icons/mob/suit.dmi', "icon_state" = "[wear_suit.icon_state]2")
var/image/standing = image("icon" = 'icons/mob/suit.dmi', "icon_state" = "[wear_suit.icon_state]")
if(FAT in mutations)
if(!wear_suit.flags&ONESIZEFITSALL)
src << "\red You burst out of \the [wear_suit]!"
var/obj/item/clothing/c = wear_suit
wear_suit = null
if(client)
client.screen -= c
c.loc = loc
c.dropped(src)
c.layer = initial(c.layer)
lying = null
standing = null
if( istype(wear_suit, /obj/item/clothing/suit/straight_jacket) )
drop_from_inventory(handcuffed)
drop_l_hand()
drop_r_hand()
else
if( istype(wear_suit, /obj/item/clothing/suit/straight_jacket) )
drop_from_inventory(handcuffed)
drop_l_hand()
drop_r_hand()
if(wear_suit.blood_DNA)
var/t_state
if( istype(wear_suit, /obj/item/clothing/suit/armor/vest || /obj/item/clothing/suit/wcoat) )
t_state = "armor"
else if( istype(wear_suit, /obj/item/clothing/suit/det_suit || /obj/item/clothing/suit/labcoat) )
t_state = "coat"
else
t_state = "suit"
lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_state]blood2")
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_state]blood")
if(wear_suit.blood_DNA)
var/t_state
if( istype(wear_suit, /obj/item/clothing/suit/armor/vest || /obj/item/clothing/suit/wcoat) )
t_state = "armor"
else if( istype(wear_suit, /obj/item/clothing/suit/det_suit || /obj/item/clothing/suit/labcoat) )
t_state = "coat"
else
t_state = "suit"
lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_state]blood2")
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_state]blood")
overlays_lying[SUIT_LAYER] = lying
overlays_standing[SUIT_LAYER] = standing
@@ -713,6 +729,8 @@ proc/get_damage_icon_part(damage_state, body_part)
/mob/living/carbon/human/update_inv_handcuffed(var/update_icons=1)
if(handcuffed)
drop_r_hand()
drop_l_hand()
stop_pulling() //TODO: should be handled elsewhere
overlays_lying[HANDCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "handcuff2")
overlays_standing[HANDCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "handcuff1")
@@ -742,6 +760,7 @@ proc/get_damage_icon_part(damage_state, body_part)
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
overlays_standing[R_HAND_LAYER] = image("icon" = 'icons/mob/items_righthand.dmi', "icon_state" = "[t_state]")
if (handcuffed) drop_r_hand()
else
overlays_standing[R_HAND_LAYER] = null
if(update_icons) update_icons()
@@ -753,10 +772,27 @@ proc/get_damage_icon_part(damage_state, body_part)
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
overlays_standing[L_HAND_LAYER] = image("icon" = 'icons/mob/items_lefthand.dmi', "icon_state" = "[t_state]")
if (handcuffed) drop_l_hand()
else
overlays_standing[L_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1)
overlays_lying[TAIL_LAYER] = null
overlays_standing[TAIL_LAYER] = null
var/cur_species = get_species()
if( cur_species == "Tajaran")
if(!wear_suit || !(wear_suit.flags_inv & HIDEJUMPSUIT) && !istype(wear_suit, /obj/item/clothing/suit/space))
overlays_lying[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "tajtail_l")
overlays_standing[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "tajtail_s")
else if( cur_species == "Soghun")
if(!wear_suit || !(wear_suit.flags_inv & HIDEJUMPSUIT) && !istype(wear_suit, /obj/item/clothing/suit/space))
overlays_lying[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "sogtail_l")
overlays_standing[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "sogtail_s")
if(update_icons)
update_icons()
// Used mostly for creating head items
/mob/living/carbon/human/proc/generate_head_icon()
//gender no longer matters for the mouth, although there should probably be seperate base head icons.
@@ -792,22 +828,6 @@ proc/get_damage_icon_part(damage_state, body_part)
var/image/face_lying_image = new /image(icon = face_lying)
return face_lying_image
/mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1)
overlays_lying[TAIL_LAYER] = null
overlays_standing[TAIL_LAYER] = null
var/cur_species = get_species()
if( cur_species == "Tajaran")
if(!wear_suit || !(wear_suit.flags_inv & HIDEJUMPSUIT) && !istype(wear_suit, /obj/item/clothing/suit/space))
overlays_lying[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "tajtail_l")
overlays_standing[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "tajtail_s")
else if( cur_species == "Soghun")
if(!wear_suit || !(wear_suit.flags_inv & HIDEJUMPSUIT) && !istype(wear_suit, /obj/item/clothing/suit/space))
overlays_lying[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "sogtail_l")
overlays_standing[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "sogtail_s")
if(update_icons)
update_icons()
//Human Overlays Indexes/////////
#undef MUTANTRACE_LAYER
#undef MUTATIONS_LAYER
@@ -23,7 +23,7 @@
return
var/alt_name = ""
if (istype(src, /mob/living/carbon/human) && src.name != src.real_name)
if (istype(src, /mob/living/carbon/human) && src.name != GetVoice())
var/mob/living/carbon/human/H = src
alt_name = " (as [H.get_id_name("Unknown")])"
// Mute disability
@@ -98,15 +98,7 @@
if (italics)
message_a = "<i>[message_a]</i>"
//This appears copied from carbon/living say.dm so the istype check for mob is probably not needed. Appending for src is also not needed as the game will check that automatically.
if (!istype(src, /mob/living/carbon/human))
rendered = "<span class='game say'><span class='name'>[name]</span> whispers, <span class='message'>\"[message_a]\"</span></span>"
else if (istype(wear_mask, /obj/item/clothing/mask/gas/voice))
if (wear_mask:vchange)
rendered = "<span class='game say'><span class='name'>[wear_mask:voice]</span> whispers, <span class='message'>\"[message_a]\"</span></span>"
else
rendered = "<span class='game say'><span class='name'>[name]</span> whispers, <span class='message'>\"[message_a]\"</span></span>"
else
rendered = "<span class='game say'><span class='name'>[real_name]</span>[alt_name] whispers, <span class='message'>\"[message_a]\"</span></span>"
rendered = "<span class='game say'><span class='name'>[GetVoice()]</span>[alt_name] whispers, <span class='message'>\"[message_a]\"</span></span>"
for (var/mob/M in heard_a)
M.show_message(rendered, 2)
@@ -131,15 +123,7 @@
if (M.say_understands(src))
var/message_c
message_c = stars(message)
if (!istype(src, /mob/living/carbon/human))
rendered = "<span class='game say'><span class='name'>[name]</span> whispers, <span class='message'>\"[message_c]\"</span></span>"
else if(istype(wear_mask, /obj/item/clothing/mask/gas/voice))
if(wear_mask:vchange)
rendered = "<span class='game say'><span class='name'>[wear_mask:voice]</span> whispers, <span class='message'>\"[message_c]\"</span></span>"
else
rendered = "<span class='game say'><span class='name'>[name]</span> whispers, <span class='message'>\"[message_c]\"</span></span>"
else
rendered = "<span class='game say'><span class='name'>[real_name]</span>[alt_name] whispers, <span class='message'>\"[message_c]\"</span></span>"
rendered = "<span class='game say'><span class='name'>[GetVoice()]</span>[alt_name] whispers, <span class='message'>\"[message_c]\"</span></span>"
M.show_message(rendered, 2)
else
rendered = "<span class='game say'><span class='name'>[src.voice_name]</span> whispers something.</span>"
@@ -147,16 +131,7 @@
if (italics)
message = "<i>[message]</i>"
if (!istype(src, /mob/living/carbon/human))
rendered = "<span class='game say'><span class='name'>[name]</span> whispers, <span class='message'>\"[message]\"</span></span>"
else if (istype(src.wear_mask, /obj/item/clothing/mask/gas/voice))
if(wear_mask:vchange)
rendered = "<span class='game say'><span class='name'>[wear_mask:voice]</span> whispers, <span class='message'>\"[message]\"</span></span>"
else
rendered = "<span class='game say'><span class='name'>[name]</span> whispers, <span class='message'>\"[message]\"</span></span>"
else
rendered = "<span class='game say'><span class='name'>[real_name]</span>[alt_name] whispers, <span class='message'>\"[message]\"</span></span>"
rendered = "<span class='game say'><span class='name'>[GetVoice()]</span>[alt_name] whispers, <span class='message'>\"[message]\"</span></span>"
for (var/mob/M in dead_mob_list)
if (!(M.client))
+1 -44
View File
@@ -1,47 +1,4 @@
/mob/living/carbon/metroid/proc/regular_hud_updates()
if(client)
for(var/hud in client.screen)
del(hud)
return
/*
/obj/hud/proc/metroid_hud()
src.adding = list( )
src.other = list( )
src.intents = list( )
src.mon_blo = list( )
src.m_ints = list( )
src.mov_int = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
*/
+9 -14
View File
@@ -329,27 +329,22 @@
if(nutrition >= 800)
if(prob(40)) amount_grown++
//lay eggs or grow
if(amount_grown >= 10 && !Victim && !Target)
if(istype(src, /mob/living/carbon/metroid/adult))
if(!client)
var/number = pick(2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,4)
for(var/i=1,i<=number,i++) // reproduce (has a small chance of producing 3 or 4 offspring)
var/mob/living/carbon/metroid/M = new/mob/living/carbon/metroid(loc)
// M.nutrition = round(nutrition * 0.9)
M.powerlevel = round(powerlevel/number)
M.Friends = Friends
M.tame = tame
M.rabid = rabid
M.Discipline = Discipline
if(i != 1) step_away(M,src)
del(src)
if(!client && nutrition >= 1000)
var/number = pick(1,1,1,1,1,1,2,2,2,3) //number of eggs laid
var/obj/item/weapon/reagent_containers/food/snacks/roro_egg/E
for(var/i=1,i<=number,i++)
E = new/obj/item/weapon/reagent_containers/food/snacks/roro_egg(loc)
src.nutrition -= 200
step_away(E,src)
else
if(!client)
var/mob/living/carbon/metroid/adult/A = new/mob/living/carbon/metroid/adult(src.loc)
A.nutrition = nutrition
// A.nutrition += 100
A.nutrition += 100
A.powerlevel = max(0, powerlevel-1)
A.Friends = Friends
A.tame = tame
@@ -201,13 +201,6 @@
/mob/living/carbon/metroid/ex_act(severity)
if (stat == 2 && client)
return
else if (stat == 2 && !client)
del(src)
return
var/b_loss = null
var/f_loss = null
switch (severity)
@@ -770,4 +763,81 @@ mob/living/carbon/metroid/var/temperature_resistance = T0C+75
return 0
return 1
return 1
// Basically this Metroid Core catalyzes reactions that normally wouldn't happen anywhere
/obj/item/metroid_core
name = "roro core"
desc = "A very slimy and tender part of a Rorobeast. Legends claim these to have \"magical powers\"."
icon = 'icons/obj/surgery.dmi'
icon_state = "roro core"
flags = TABLEPASS
force = 1.0
w_class = 1.0
throwforce = 1.0
throw_speed = 3
throw_range = 6
origin_tech = "biotech=4"
var/POWERFLAG = 0 // sshhhhhhh
var/Flush = 30
var/Uses = 5 // uses before it goes inert
New()
..()
var/datum/reagents/R = new/datum/reagents(100)
reagents = R
R.my_atom = src
POWERFLAG = rand(1,10)
Uses = rand(7, 25)
//flags |= NOREACT
spawn()
Life()
proc/Life()
while(src)
sleep(25)
Flush--
if(Flush <= 0)
reagents.clear_reagents()
Flush = 30
/obj/item/weapon/reagent_containers/food/snacks/roro_egg
name = "roro egg"
desc = "A small, gelatinous egg."
icon = 'icons/mob/mob.dmi'
icon_state = "roro egg-growing"
bitesize = 12
origin_tech = "biotech=4"
var/grown = 0
New()
..()
reagents.add_reagent("nutriment", 5)
spawn(rand(1200,1500))//the egg takes a while to "ripen"
Grow()
proc/Grow()
grown = 1
icon_state = "roro egg-grown"
processing_objects.Add(src)
return
proc/Hatch()
processing_objects.Remove(src)
var/turf/T = get_turf(src)
for(var/mob/O in hearers(T))
O.show_message("\blue The [name] pulsates and quivers!")
spawn(rand(50,100))
for(var/mob/O in hearers(T))
O.show_message("\blue The [name] bursts open!")
new/mob/living/carbon/metroid(T)
del(src)
/obj/item/weapon/reagent_containers/food/snacks/roro_egg/process()
var/turf/location = get_turf(src)
var/datum/gas_mixture/environment = location.return_air()
if (environment.toxins > MOLES_PLASMA_VISIBLE)//plasma exposure causes the egg to hatch
src.Hatch()
@@ -187,7 +187,7 @@
/mob/living/carbon/metroid/verb/Reproduce()
set category = "Roro"
set desc = "This will make you split into a random number of Metroids (usually 2). NOTE: this will KILL you, but you will be transferred into one of the babies."
set desc = "This will make you lay an egg. NOTE: This decreases your nutrition."
if(stat)
src << "<i>I must be conscious to do this...</i>"
@@ -195,32 +195,15 @@
if(istype(src, /mob/living/carbon/metroid/adult))
if(amount_grown >= 10)
if(input("Are you absolutely sure you want to reproduce? Your current body will cease to be, but your consciousness will be transferred into a produced rorobeast.") in list("Yes","No")=="Yes")
if(stat)
src << "<i>I must be conscious to do this...</i>"
return
var/list/babies = list()
var/number = pick(14;2,3,4)
var/new_nutrition = round(nutrition * 0.9)
var/new_powerlevel = round(powerlevel / number)
for(var/i=1,i<=number,i++) // reproduce (has a small chance of producing 3 or 4 offspring)
var/mob/living/carbon/metroid/M = new/mob/living/carbon/metroid(loc)
M.nutrition = new_nutrition
M.powerlevel = new_powerlevel
if(i != 1) step_away(M,src)
babies += M
var/mob/living/carbon/metroid/new_metroid = pick(babies)
new_metroid.a_intent = "hurt"
new_metroid.key = key
new_metroid << "<B>You are now a Rorobeast. Skree!</B>"
del(src)
if(src.nutrition >= 300)
new/obj/item/weapon/reagent_containers/food/snacks/roro_egg(loc)
src.nutrition -= 200
else
src << "<i>I have not fed enough...</i>"
else
src << "<i>I am not ready to reproduce yet...</i>"
else
src << "<i>I am not old enough to reproduce yet...</i>"
src << "<i>I am not old enough to lay eggs yet...</i>"
+50 -486
View File
@@ -1,50 +1,12 @@
/obj/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_old.dmi')
/datum/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_old.dmi')
//ui_style='icons/mob/screen1_old.dmi' //Overriding the parameter. Only this UI style is acceptable with the 'sleek' layout.
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
//var/icon/blocked = icon(ui_style,"blocked")
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon = ui_style
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon = ui_style
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon = ui_style
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon = ui_style
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
src.adding = list()
src.other = list()
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new src.h_type( src )
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = ui_style
@@ -55,45 +17,55 @@
action_intent = using
//intent small hud objects
using = new src.h_type( src )
var/icon/ico
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "help" ? "help_small_active" : "help_small")
using.screen_loc = ui_help_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
using = new src.h_type( src )
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "disarm" ? "disarm_small_active" : "disarm_small")
using.screen_loc = ui_disarm_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
using = new src.h_type( src )
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "grab" ? "grab_small_active" : "grab_small")
using.screen_loc = ui_grab_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
using = new src.h_type( src )
ico = new(ui_style, "black")
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.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm_small_active" : "harm_small")
using.screen_loc = ui_harm_small
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new src.h_type( src )
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = ui_style
@@ -103,84 +75,15 @@
src.adding += using
move_intent = using
/*
using = new src.h_type(src) //Right hud bar
using.dir = SOUTH
using.icon = ui_style
using.screen_loc = "EAST+1,SOUTH to EAST+1,NORTH"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Lower hud bar
using.dir = EAST
using.icon = ui_style
using.screen_loc = "WEST,SOUTH-1 to EAST,SOUTH-1"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Corner Button
using.dir = NORTHWEST
using.icon = ui_style
using.screen_loc = "EAST+1,SOUTH-1"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "arrowleft"
using.icon = ui_style
using.icon_state = "s_arrow"
using.dir = WEST
using.screen_loc = ui_iarrowleft
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "arrowright"
using.icon = ui_style
using.icon_state = "s_arrow"
using.dir = EAST
using.screen_loc = ui_iarrowright
using.layer = 19
src.adding += using*/
using = new src.h_type( src )
using = new /obj/screen()
using.name = "drop"
using.icon = ui_style
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.adding += using
/*
using = new src.h_type( src )
using.name = "i_clothing"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "center"
using.screen_loc = ui_iclothing
using.layer = 19
using.overlays += blocked
src.adding += using
using = new src.h_type( src )
using.name = "o_clothing"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "equip"
using.screen_loc = ui_oclothing
using.layer = 19
using.overlays += blocked
src.adding += using
*/
/* using = new src.h_type( src )
using.name = "headset"
using.dir = SOUTHEAST
using.icon_state = "equip"
using.screen_loc = ui_headset
using.layer = 19
if(istype(mymob,/mob/living/carbon/monkey)) using.overlays += blocked
src.other += using*/
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = ui_style
@@ -193,7 +96,7 @@
src.r_hand_hud_object = inv_box
src.adding += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = ui_style
@@ -206,7 +109,7 @@
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new src.h_type( src )
using = new /obj/screen()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
@@ -215,7 +118,7 @@
using.layer = 19
src.adding += using
using = new src.h_type( src )
using = new /obj/screen()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
@@ -223,19 +126,8 @@
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
/*
using = new src.h_type( src )
using.name = "id"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = "equip"
using.screen_loc = ui_id
using.layer = 19
using.overlays += blocked
src.adding += using
*/
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.dir = NORTH
inv_box.icon = ui_style
@@ -245,7 +137,7 @@
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory( src )
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.dir = NORTHEAST
inv_box.icon = ui_style
@@ -254,412 +146,84 @@
inv_box.slot_id = slot_back
inv_box.layer = 19
src.adding += inv_box
/*
using = new src.h_type( src )
using.name = "storage1"
using.icon = ui_style
using.icon_state = "pocket"
using.screen_loc = ui_storage1
using.layer = 19
using.overlays += blocked
src.adding += using
using = new src.h_type( src )
using.name = "storage2"
using.icon = ui_style
using.icon_state = "pocket"
using.screen_loc = ui_storage2
using.layer = 19
using.overlays += blocked
src.adding += using
using = new src.h_type( src )
using.name = "resist"
using.icon = ui_style
using.icon_state = "act_resist"
using.screen_loc = ui_resist
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "other"
using.icon = ui_style
using.icon_state = "other"
using.screen_loc = ui_shoes
using.layer = 20
src.adding += using
using = new src.h_type( src )
using.name = "gloves"
using.icon = ui_style
using.icon_state = "gloves"
using.screen_loc = ui_gloves
using.layer = 19
using.overlays += blocked
src.other += using
using = new src.h_type( src )
using.name = "eyes"
using.icon = ui_style
using.icon_state = "glasses"
using.screen_loc = ui_glasses
using.layer = 19
using.overlays += blocked
src.other += using
using = new src.h_type( src )
using.name = "ears"
using.icon = ui_style
using.icon_state = "ears"
using.screen_loc = ui_ears
using.layer = 19
using.overlays += blocked
src.other += using
using = new src.h_type( src )
using.name = "head"
using.icon = ui_style
using.icon_state = "hair"
using.screen_loc = ui_head
using.layer = 19
using.overlays += blocked
src.adding += using
using = new src.h_type( src )
using.name = "shoes"
using.icon = ui_style
using.icon_state = "shoes"
using.screen_loc = ui_shoes
using.layer = 19
using.overlays += blocked
src.other += using
using = new src.h_type( src )
using.name = "belt"
using.icon = ui_style
using.icon_state = "belt"
using.screen_loc = ui_belt
using.layer = 19
using.overlays += blocked
src.adding += using
*/
/*
using = new src.h_type( src )
using.name = "grab"
using.icon_state = "grab"
using.screen_loc = "12:-11,15"
using.layer = 19
src.intents += using
//ICONS
using = new src.h_type( src )
using.name = "hurt"
using.icon_state = "harm"
using.screen_loc = "15:-11,15"
using.layer = 19
src.intents += using
src.m_ints += using
using = new src.h_type( src )
using.name = "disarm"
using.icon_state = "disarm"
using.screen_loc = "14:-10,15"
using.layer = 19
src.intents += using
using = new src.h_type( src )
using.name = "help"
using.icon_state = "help"
using.screen_loc = "13:-10,15"
using.layer = 19
src.intents += using
src.m_ints += using
using = new src.h_type( src )
using.name = "face"
using.icon_state = "facing"
using.screen_loc = "15:-11,14"
using.layer = 19
src.mov_int += using
using = new src.h_type( src )
using.name = "walk"
using.icon_state = "walking"
using.screen_loc = "14:-11,14"
using.layer = 19
src.mov_int += using
using = new src.h_type( src )
using.name = "run"
using.icon_state = "running"
using.screen_loc = "13:-11,14"
using.layer = 19
src.mov_int += using
*/
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "1,1 to 5,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "5,1 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "11,1 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.oxygen = new /obj/screen( null )
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = ui_style
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.pressure = new /obj/screen( null )
mymob.pressure = new /obj/screen()
mymob.pressure.icon = ui_style
mymob.pressure.icon_state = "pressure0"
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
/*
mymob.i_select = new /obj/screen( null )
mymob.i_select.icon_state = "selector"
mymob.i_select.name = "intent"
mymob.i_select.screen_loc = "16:-11,15"
mymob.m_select = new /obj/screen( null )
mymob.m_select.icon_state = "selector"
mymob.m_select.name = "moving"
mymob.m_select.screen_loc = "16:-11,14"
*/
mymob.toxin = new /obj/screen( null )
mymob.toxin = new /obj/screen()
mymob.toxin.icon = ui_style
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_toxin
mymob.internals = new /obj/screen( null )
mymob.internals = new /obj/screen()
mymob.internals.icon = ui_style
mymob.internals.icon_state = "internal0"
mymob.internals.name = "internal"
mymob.internals.screen_loc = ui_internal
mymob.fire = new /obj/screen( null )
mymob.fire = new /obj/screen()
mymob.fire.icon = ui_style
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.bodytemp = new /obj/screen( null )
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon = ui_style
mymob.bodytemp.icon_state = "temp1"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.healths = new /obj/screen( null )
mymob.healths = new /obj/screen()
mymob.healths.icon = ui_style
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
mymob.pullin = new /obj/screen( null )
mymob.pullin = new /obj/screen()
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen( null )
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen( null )
mymob.flash = new /obj/screen()
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
/*
mymob.hands = new /obj/screen( null )
mymob.hands.icon = ui_style
mymob.hands.icon_state = "hand"
mymob.hands.name = "hand"
mymob.hands.screen_loc = ui_hand
mymob.hands.dir = NORTH
mymob.sleep = new /obj/screen( null )
mymob.sleep.icon = ui_style
mymob.sleep.icon_state = "sleep0"
mymob.sleep.name = "sleep"
mymob.sleep.screen_loc = ui_sleep
mymob.rest = new /obj/screen( null )
mymob.rest.icon = ui_style
mymob.rest.icon_state = "rest0"
mymob.rest.name = "rest"
mymob.rest.screen_loc = ui_rest*/
/*/Monkey blockers
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_ears
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_belt
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_shoes
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_storage2
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_glasses
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_gloves
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_storage1
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_headset
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_oclothing
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_iclothing
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_id
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_head
using.layer = 20
src.mon_blo += using
//Monkey blockers
*/
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = ui_style
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
mymob.client.screen = null
//, mymob.i_select, mymob.m_select
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
//if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo
return
/*
using = new src.h_type( src )
using.dir = WEST
using.screen_loc = "1,3 to 2,3"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.dir = NORTHEAST
using.screen_loc = "3,3"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.dir = NORTH
using.screen_loc = "3,2"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.dir = SOUTHEAST
using.screen_loc = "3,1"
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.dir = SOUTHWEST
using.screen_loc = "1,1 to 2,2"
using.layer = 19
src.adding += using
*/
+10 -15
View File
@@ -288,7 +288,7 @@
if(Toxins_pp > safe_toxins_max) // Too much toxins
var/ratio = breath.toxins/safe_toxins_max
adjustToxLoss(min(ratio, 10)) //Limit amount of damage toxin exposure can do per second
adjustToxLoss(min(ratio, MIN_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
toxins_alert = max(toxins_alert, 1)
else
toxins_alert = 0
@@ -463,9 +463,6 @@
see_in_dark = 2
see_invisible = SEE_INVISIBLE_LIVING
if (sleep) sleep.icon_state = text("sleep[]", sleeping)
if (rest) rest.icon_state = text("rest[]", resting)
if (healths)
if (stat != 2)
switch(health)
@@ -532,24 +529,22 @@
else
bodytemp.icon_state = "temp-4"
client.screen -= hud_used.blurry
client.screen -= hud_used.druggy
client.screen -= hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
if(blind && stat != DEAD)
if(blinded)
blind.layer = 18
else
blind.layer = 0
if (disabilities & NEARSIGHTED)
client.screen += hud_used.vimpaired
if(disabilities & NEARSIGHTED)
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += hud_used.blurry
if(eye_blurry)
client.screen += global_hud.blurry
if (druggy)
client.screen += hud_used.druggy
if(druggy)
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
@@ -477,14 +477,7 @@
/mob/living/carbon/monkey/ex_act(severity)
if(!blinded)
flick("flash", flash)
if (stat == 2 && client)
gib()
return
if (stat == 2 && !client)
gibs(loc, viruses)
del(src)
return
switch(severity)
if(1.0)
if (stat != 2)
@@ -55,6 +55,7 @@
if(!t_state) t_state = r_hand.icon_state
overlays_standing[M_R_HAND_LAYER] = image("icon" = 'icons/mob/items_righthand.dmi', "icon_state" = t_state)
r_hand.screen_loc = ui_rhand
if (handcuffed) drop_r_hand()
else
overlays_standing[M_R_HAND_LAYER] = null
if(update_icons) update_icons()
@@ -66,6 +67,7 @@
if(!t_state) t_state = l_hand.icon_state
overlays_standing[M_L_HAND_LAYER] = image("icon" = 'icons/mob/items_lefthand.dmi', "icon_state" = t_state)
l_hand.screen_loc = ui_lhand
if (handcuffed) drop_l_hand()
else
overlays_standing[M_L_HAND_LAYER] = null
if(update_icons) update_icons()
@@ -84,6 +86,8 @@
/mob/living/carbon/monkey/update_inv_handcuffed(var/update_icons=1)
if(handcuffed)
drop_r_hand()
drop_l_hand()
stop_pulling()
overlays_lying[M_HANDCUFF_LAYER] = image("icon" = 'icons/mob/monkey.dmi', "icon_state" = "handcuff2")
overlays_standing[M_HANDCUFF_LAYER] = image("icon" = 'icons/mob/monkey.dmi', "icon_state" = "handcuff1")
+3 -2
View File
@@ -20,8 +20,9 @@
// broken or ripped off organs will add quite a bit of pain
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/M = src
for(var/name in M.organs)
var/datum/organ/external/organ = M.organs[name]
for(var/datum/organ/external/organ in M.organs)
if (!organ)
continue
if((organ.status & ORGAN_DESTROYED) && !organ.amputated)
src.traumatic_shock += 60
else if(organ.status & ORGAN_BROKEN || organ.open)
+2
View File
@@ -40,6 +40,8 @@
/mob/living/proc/burn_skin(burn_amount)
if(istype(src, /mob/living/carbon/human))
//world << "DEBUG: burn_skin(), mutations=[mutations]"
if(mShock in src.mutations) //shockproof
return 0
if (COLD_RESISTANCE in src.mutations) //fireproof
return 0
var/mob/living/carbon/human/H = src //make this damage method divide the damage to be done among all the body parts, then burn each body part for that much damage. will have better effect then just randomly picking a body part
+2 -2
View File
@@ -57,6 +57,6 @@
P.on_hit(src,2)
return 2
if(!P.nodamage)
apply_damage((P.damage/(absorb+1)), P.damage_type, def_zone)
apply_damage((P.damage/(absorb+1)), P.damage_type, def_zone, used_weapon = "Projectile([P.name])")
P.on_hit(src, absorb)
return absorb
return absorb
+2
View File
@@ -2,3 +2,5 @@
..()
if(!key && mind) //key and mind have become seperated.
mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body.
if(!immune_to_ssd && sleeping < 2 && mind.active)
sleeping = 2
+62 -19
View File
@@ -78,6 +78,7 @@ var/list/department_radio_keys = list(
/mob/living/say(var/message)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
message = capitalize(message)
if (!message)
return
@@ -108,7 +109,7 @@ var/list/department_radio_keys = list(
return emote(copytext(message, 2))
var/alt_name = ""
if (istype(src, /mob/living/carbon/human) && name != real_name)
if (istype(src, /mob/living/carbon/human) && name != GetVoice())
var/mob/living/carbon/human/H = src
alt_name = " (as [H.get_id_name("Unknown")])"
var/italics = 0
@@ -141,6 +142,27 @@ var/list/department_radio_keys = list(
if (!message)
return
//work out if we're speaking skrell or not
var/is_speaking_skrell = 0
if(copytext(message, 1, 3) == ":k" || copytext(message, 1, 3) == ":K")
message = copytext(message, 3)
if(skrell_talk_understand || universal_speak)
is_speaking_skrell = 1
//work out if we're speaking soghun or not
var/is_speaking_soghun = 0
if(copytext(message, 1, 3) == ":o" || copytext(message, 1, 3) == ":O")
message = copytext(message, 3)
if(soghun_talk_understand || universal_speak)
is_speaking_soghun = 1
//work out if we're speaking soghun or not
var/is_speaking_taj = 0
if(copytext(message, 1, 3) == ":j" || copytext(message, 1, 3) == ":J")
message = copytext(message, 3)
if(tajaran_talk_understand || universal_speak)
is_speaking_taj = 1
// :downs:
if (getBrainLoss() >= 60)
message = dd_replacetext(message, " am ", " ")
@@ -232,9 +254,14 @@ var/list/department_radio_keys = list(
return
if ("department")
if (src:ears)
src:ears.talk_into(src, message, message_mode)
used_radios += src:ears
if(istype(src, /mob/living/carbon))
if (src:ears)
src:ears.talk_into(src, message, message_mode)
used_radios += src:ears
else if(istype(src, /mob/living/silicon/robot))
if (src:radio)
src:radio.talk_into(src, message, message_mode)
used_radios += src:radio
message_range = 1
italics = 1
@@ -280,7 +307,7 @@ var/list/department_radio_keys = list(
listening|=M
var/turf/T = get_turf(src)
var/list/W = view(message_range, T)
var/list/W = hear(message_range, T)
for (var/obj/O in ((W | contents)-used_radios))
W |= O
@@ -311,12 +338,13 @@ var/list/department_radio_keys = list(
if (O)
O.hear_talk(src, message)
*/
if(isbrain(src))//For brains to properly talk if they are in an MMI..or in a brain. Could be extended to other mobs I guess.
/* if(isbrain(src))//For brains to properly talk if they are in an MMI..or in a brain. Could be extended to other mobs I guess.
for(var/obj/O in loc)//Kinda ugly but whatever.
if(O)
spawn(0)
O.hear_talk(src, message)
*/
var/list/heard_a = list() // understood us
@@ -324,30 +352,37 @@ var/list/department_radio_keys = list(
for (var/M in listening)
if(hascall(M,"say_understands"))
if (M:say_understands(src))
if (M:say_understands(src) && !is_speaking_skrell && !is_speaking_soghun && !is_speaking_taj)
heard_a += M
else if(ismob(M))
if(is_speaking_skrell && (M:skrell_talk_understand || M:universal_speak))
heard_a += M
else if(is_speaking_soghun && (M:soghun_talk_understand || M:universal_speak))
heard_a += M
else if(is_speaking_taj && (M:tajaran_talk_understand || M:universal_speak))
heard_a += M
else
heard_b += M
else
heard_b += M
heard_a += M
var/speech_bubble_test = say_test(message)
var/image/speech_bubble = image('icons/mob/talk.dmi',src,"h[speech_bubble_test]")
spawn(30) del(speech_bubble)
var/rendered = null
if (length(heard_a))
var/message_a = say_quote(message)
var/message_a = say_quote(message,is_speaking_soghun,is_speaking_skrell,is_speaking_taj)
if (italics)
message_a = "<i>[message_a]</i>"
if (!istype(src, /mob/living/carbon/human))
rendered = "<span class='game say'><span class='name'>[name]</span> <span class='message'>[message_a]</span></span>"
else if(istype(wear_mask, /obj/item/clothing/mask/gas/voice))
if(wear_mask:vchange)
rendered = "<span class='game say'><span class='name'>[wear_mask:voice]</span> <span class='message'>[message_a]</span></span>"
else
rendered = "<span class='game say'><span class='name'>[name]</span> <span class='message'>[message_a]</span></span>"
else
rendered = "<span class='game say'><span class='name'>[real_name]</span>[alt_name] <span class='message'>[message_a]</span></span>"
rendered = "<span class='game say'><span class='name'>[GetVoice()]</span>[alt_name] <span class='message'>[message_a]</span></span>"
for (var/M in heard_a)
if(hascall(M,"show_message"))
M:show_message(rendered, 2)
M << speech_bubble
if (length(heard_b))
var/message_b
@@ -367,6 +402,7 @@ var/list/department_radio_keys = list(
for (var/M in heard_b)
if(hascall(M,"show_message"))
M:show_message(rendered, 2)
M << speech_bubble
/*
if(M.client)
@@ -389,9 +425,16 @@ var/list/department_radio_keys = list(
del(B)
*/
//talking crystals
for(var/obj/item/weapon/talkingcrystal/O in view(3,src))
O.catchMessage(message,src)
log_say("[name]/[key] : [message]")
/obj/effect/speech_bubble
var/mob/parent
/mob/living/proc/GetVoice()
return name
+46 -2
View File
@@ -41,6 +41,7 @@
var/mob/living/silicon/ai/parent = null
var/camera_light_on = 0 //Defines if the AI toggled the light on the camera it's looking through.
var/datum/trackable/track = null
/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0)
var/list/possibleNames = ai_names
@@ -68,7 +69,7 @@
if (istype(L, /datum/ai_laws))
laws = L
else
laws = new /datum/ai_laws/asimov
laws = new base_law_type
verbs += /mob/living/silicon/ai/proc/show_laws_verb
@@ -116,9 +117,20 @@
return
//if(icon_state == initial(icon_state))
var/icontype = input("Please, select a display!", "AI", null/*, null*/) in list("Monochrome", "Blue", "Inverted", "Firewall", "Green", "Red", "Static")
var/icontype = ""
var/list/icons = list("Monochrome", "Blue", "Inverted", "Firewall", "Green", "Red", "Static")
if (src.name == "B.A.N.N.E.D." && src.ckey == "spaceman96")
icons += "B.A.N.N.E.D."
if (src.name == "M00X-BC" && src.ckey == "searif")
icons += "M00X-BC"
if (src.name == "TRIBUNAL" && src.ckey == "serithi")
icons += "Tribunal"
icons += "Tribunal Malfunctioning"
if (src.name == "Skuld" && src.ckey == "ravensdale")
icons += "Skuld"
/* if(icontype == "Clown")
icon_state = "ai-clown2"*/
icontype = input("Please, select a display!", "AI", null/*, null*/) in icons
if(icontype == "Monochrome")
icon_state = "ai-mono"
else if(icontype == "Blue")
@@ -133,6 +145,14 @@
icon_state = "ai-malf"
else if(icontype == "Static")
icon_state = "ai-static"
else if(icontype == "M00X-BC")
icon_state = "ai-searif"
else if(icontype == "Tribunal")
icon_state = "ai-tribunal"
else if(icontype == "Tribunal Malfunctioning")
icon_state = "ai-tribunal-malf"
else if(icontype == "Skuld")
icon_state = "ai-ravensdale"
//else
//usr <<"You can only change your display once!"
//return
@@ -294,6 +314,8 @@
/mob/living/silicon/ai/Topic(href, href_list)
if(usr != src)
return
..()
if (href_list["mach_close"])
if (href_list["mach_close"] == "aialerts")
@@ -686,3 +708,25 @@
src.current = camera
src.current.SetLuminosity(AI_CAMERA_LUMINOSITY)
camera_light_on = world.timeofday + 1 * 20 // Update the light every 2 seconds.
/mob/living/silicon/ai/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
if(anchored)
user.visible_message("\blue \The [user] starts to unbolt \the [src] from the plating...")
if(!do_after(user,40))
user.visible_message("\blue \The [user] decides not to unbolt \the [src].")
return
user.visible_message("\blue \The [user] finishes unfastening \the [src]!")
anchored = 0
return
else
user.visible_message("\blue \The [user] starts to bolt \the [src] to the plating...")
if(!do_after(user,40))
user.visible_message("\blue \The [user] decides not to bolt \the [src].")
return
user.visible_message("\blue \The [user] finishes fastening down \the [src]!")
anchored = 1
return
else
return ..()
+3 -2
View File
@@ -1,8 +1,9 @@
/mob/living/silicon/ai/death(gibbed)
if(stat == DEAD) return
stat = DEAD
icon_state = "ai-crash"
if (src.name == "Skuld" && src.ckey == "ravensdale")//checks ID of AI and player to see if it needs to pull the custom death sprite and goes to blue-screen if it doesn't
icon_state = "ai-ravensdale-crash"
else icon_state = "ai-crash"
update_canmove()
if(src.eyeobj)
src.eyeobj.setLoc(get_turf(src))
@@ -73,7 +73,8 @@ var/datum/cameranet/cameranet = new()
// Removes a camera from a chunk.
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
majorChunkChange(c, 0)
if(c.can_use())
majorChunkChange(c, 0)
// Add a camera to a chunk.
@@ -81,15 +82,13 @@ var/datum/cameranet/cameranet = new()
if(c.can_use())
majorChunkChange(c, 1)
// Used for Cyborg cameras. It is the same as "add" but named differently for easier readability
// and to allow the user know what it is for. Since portable cameras can be in ANY chunk, we have to
// all it to be added to all chunks. If the camera is disabled, it will instead remove.
// Used for Cyborg cameras. Since portable cameras can be in ANY chunk.
/datum/cameranet/proc/updatePortableCamera(obj/machinery/camera/c)
if(c.can_use())
majorChunkChange(c, 1)
else
majorChunkChange(c, 0)
//else
// majorChunkChange(c, 0)
// Never access this proc directly!!!!
// This will update the chunk and all the surrounding chunks.
@@ -15,10 +15,15 @@
var/visible = 0
var/changed = 0
var/updating = 0
var/x = 0
var/y = 0
var/z = 0
// Add an AI eye to the chunk, then update if changed.
/datum/camerachunk/proc/add(mob/aiEye/ai)
if(!ai.ai)
return
ai.visibleCameraChunks += src
if(ai.ai.client)
ai.ai.client.images += obscured
@@ -30,6 +35,8 @@
// Remove an AI eye from the chunk, then update if changed.
/datum/camerachunk/proc/remove(mob/aiEye/ai)
if(!ai.ai)
return
ai.visibleCameraChunks -= src
if(ai.ai.client)
ai.ai.client.images -= obscured
@@ -65,10 +72,19 @@
var/list/newVisibleTurfs = list()
for(var/obj/machinery/camera/c in cameras)
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
if(!c)
continue
if(!c.can_use())
continue
var/turf/point = locate(src.x + 8, src.y + 8, src.z)
if(get_dist(point, c) > 24)
continue
for(var/turf/t in c.can_see())
newVisibleTurfs += t
@@ -81,13 +97,14 @@
visibleTurfs = newVisibleTurfs
obscuredTurfs = turfs - newVisibleTurfs
for(var/turf in visAdded)
var/turf/t = turf
if(t.obscured)
obscured -= t.obscured
for(var/eye in seenby)
var/mob/aiEye/m = eye
if(!m || !m.ai)
continue
if(m.ai.client)
m.ai.client.images -= t.obscured
@@ -100,8 +117,9 @@
obscured += t.obscured
for(var/eye in seenby)
var/mob/aiEye/m = eye
if(!m)
if(!m || !m.ai)
seenby -= m
continue
if(m.ai.client)
m.ai.client.images += t.obscured
@@ -113,17 +131,23 @@
x &= ~0xf
y &= ~0xf
src.x = x
src.y = y
src.z = z
for(var/obj/machinery/camera/c in range(16, locate(x + 8, y + 8, z)))
if(c.can_use())
cameras += c
for(var/turf/t in range(10, locate(x + 8, y + 8, z)))
if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16)
turfs += t
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
if(!c)
continue
if(!c.can_use())
continue
@@ -94,7 +94,7 @@
// This will move the AIEye. It will also cause lights near the eye to light up, if toggled.
// This is handled in the proc below this one.
/client/AIMove(n, direct, var/mob/living/silicon/ai/user)
/client/proc/AIMove(n, direct, var/mob/living/silicon/ai/user)
var/initial = initial(user.sprint)
var/max_sprint = 50
@@ -64,13 +64,15 @@
/mob/living/silicon/robot/var/updating = 0
/mob/living/silicon/robot/Move()
var/oldLoc = src.loc
. = ..()
if(.)
if(src.camera)
if(!updating)
updating = 1
spawn(BORG_CAMERA_BUFFER)
cameranet.updatePortableCamera(src.camera)
if(oldLoc != src.loc)
cameranet.updatePortableCamera(src.camera)
updating = 0
// CAMERA
+1 -1
View File
@@ -1,2 +1,2 @@
/obj/hud/proc/ai_hud()
/datum/hud/proc/ai_hud()
return
+6 -3
View File
@@ -18,11 +18,11 @@
/mob/living/silicon/ai/proc/laws_sanity_check()
if (!src.laws)
src.laws = new /datum/ai_laws/asimov
src.laws = new base_law_type
/mob/living/silicon/ai/proc/set_zeroth_law(var/law)
/mob/living/silicon/ai/proc/set_zeroth_law(var/law, var/law_borg)
src.laws_sanity_check()
src.laws.set_zeroth_law(law)
src.laws.set_zeroth_law(law, law_borg)
/mob/living/silicon/ai/proc/add_inherent_law(var/law)
src.laws_sanity_check()
@@ -35,6 +35,9 @@
/mob/living/silicon/ai/proc/add_ion_law(var/law)
src.laws_sanity_check()
src.laws.add_ion_law(law)
for(var/mob/living/silicon/robot/R in mob_list)
if(R.lawupdate && (R.connected_ai == src))
R << "\red " + law + "\red...LAWS UPDATED"
/mob/living/silicon/ai/proc/clear_ion_laws()
src.laws_sanity_check()
+5 -5
View File
@@ -90,7 +90,7 @@
src.see_in_dark = 0
src.see_invisible = SEE_INVISIBLE_LIVING
if (((!loc.master.power_equip) || istype(T, /turf/space)) && !istype(src.loc,/obj/item))
if (((!loc.master.power_equip) || istype(T, /turf/space)) && !istype(src.loc,/obj/item) && !istype(get_area(src), /area/shuttle))
if (src:aiRestorePowerRoutine==0)
src:aiRestorePowerRoutine = 1
@@ -98,9 +98,9 @@
// world << "DEBUG CODE TIME! [loc] is the area the AI is sucking power from"
if (!is_special_character(src))
src.set_zeroth_law("")
src.clear_supplied_laws()
var/time = time2text(world.realtime,"hh:mm:ss")
lawchanges.Add("[time] <b>:</b> [src.name]'s noncore laws have been reset due to power failure")
//src.clear_supplied_laws() // Don't reset our laws.
//var/time = time2text(world.realtime,"hh:mm:ss")
//lawchanges.Add("[time] <b>:</b> [src.name]'s noncore laws have been reset due to power failure")
spawn(50)
while ((src:aiRestorePowerRoutine!=0) && stat!=2)
src.oxyloss += 2
@@ -165,7 +165,7 @@
//bring up APC dialog
theAPC.attack_ai(src)
src:aiRestorePowerRoutine = 3
src << "Your laws have been reset:"
src << "Here are your current laws:"
src.show_laws()
sleep(50)
theAPC = null
+5 -6
View File
@@ -5,22 +5,21 @@
blood.override = 1
client.images += blood
regenerate_icons()
flash = new /obj/screen( null )
flash = new /obj/screen()
flash.icon_state = "blank"
flash.name = "flash"
flash.screen_loc = "1,1 to 15,15"
flash.layer = 17
blind = new /obj/screen( null )
blind = new /obj/screen()
blind.icon_state = "black"
blind.name = " "
blind.screen_loc = "1,1 to 15,15"
blind.layer = 0
client.screen += list( blind, flash )
client.screen.Add( blind, flash )
if(stat != DEAD)
for(var/obj/machinery/ai_status_display/O in machines) //change status
if(O)
O.mode = 1
O.emotion = "Neutral"
O.mode = 1
O.emotion = "Neutral"
src.view_core()
return
@@ -1,71 +0,0 @@
/var/const/SHARED_TYPES_WEIGHT = 5
/var/const/CAMERA_PROXIMITY_PREFERENCE = 0.2
// the smaller this is, the more a straight line will be preferred over a closer camera when changing cameras
// if you set this to 0 the game will crash. don't do that.
// if you set it to be negative the algorithm will do completely nonsensical things (like choosing the camera that's
// the farthest away). don't do that.
/client/proc/AIMove(n,direct,var/mob/living/silicon/ai/user)
if(!user) return
if(user.control_disabled) return
var/min_dist = 1e8
var/obj/machinery/camera/closest = null
var/atom/old = (user.current?user.current : user.loc)
if(!old) return
var/dx = 0
var/dy = 0
if(direct & NORTH)
dy = 1
else if(direct & SOUTH)
dy = -1
if(direct & EAST)
dx = 1
else if(direct & WEST)
dx = -1
var/area/A = get_area(old)
var/list/old_types = dd_text2list("[A.type]", "/")
for(var/obj/machinery/camera/current in cameranet.cameras)
if(user.network != current.network) continue
if(!current.status) continue // ignore disabled cameras
//make sure it's the right direction
if(dx && (current.x * dx <= old.x * dx))
continue
if(dy && (current.y * dy <= old.y * dy))
continue
var/shared_types = 0 //how many levels deep the old camera and the closest camera's areas share
//for instance, /area/A and /area/B would have shared_types = 2 (because of how dd_text2list works)
//whereas area/A/B and /area/A/C would have it as 3
var/area/cur_area = get_area(current)
if(!cur_area) continue
var/list/new_types = dd_text2list("[cur_area.type]", "/")
for(var/i = 1; i <= old_types.len && i <= new_types.len; i++)
if(old_types[i] == new_types[i])
shared_types++
else
break
//don't let it be too far from the current one in the axis perpindicular to the direction of travel,
//but let it be farther from that if it's in the same area
//something in the same hallway but farther away beats something in the same hallway
var/distance = abs((current.y - old.y)/(CAMERA_PROXIMITY_PREFERENCE + abs(dy))) + abs((current.x - old.x)/(CAMERA_PROXIMITY_PREFERENCE + abs(dx)))
distance -= SHARED_TYPES_WEIGHT * shared_types
//weight things in the same area as this so they count as being closer - makes you stay in the same area
//when possible
if(distance < min_dist)
//closer, or this is in the same area and the current closest isn't
min_dist = distance
closest = current
if(!closest)
return
user.switchCamera(closest)
@@ -143,6 +143,62 @@
else
message = "<B>[src]</B> looks."
m_type = 1
if("beep")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> beeps at [param]."
else
message = "<B>[src]</B> beeps."
playsound(src.loc, 'twobeep.ogg', 50, 0)
m_type = 2
if("ping")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> pings at [param]."
else
message = "<B>[src]</B> pings."
playsound(src.loc, 'ping.ogg', 50, 0)
m_type = 2
if("buzz")
var/M = null
if(param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if(!M)
param = null
if (param)
message = "<B>[src]</B> buzzes at [param]."
else
message = "<B>[src]</B> buzzes."
playsound(src.loc, 'buzz-sigh.ogg', 50, 0)
m_type = 2
if("law")
message = "<B>[src]</B> shows its legal authorization barcode."
playsound(src.loc, 'biamthelaw.ogg', 50, 0)
m_type = 2
else
src << text("Invalid Emote: []", act)
if ((message && src.stat == 0))
+20 -111
View File
@@ -1,44 +1,14 @@
/obj/hud/proc/robot_hud()
/datum/hud/proc/robot_hud()
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
//
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
src.adding = list()
src.other = list()
var/obj/screen/using
//Radio
using = new src.h_type( src )
using = new /obj/screen()
using.name = "radio"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
@@ -47,34 +17,9 @@
using.layer = 20
src.adding += using
//Generic overlays
/*
using = new src.h_type(src) //Right hud bar
using.dir = SOUTH
using.icon = 'icons/mob/screen1_robot.dmi'
using.screen_loc = "EAST+1,SOUTH to EAST+1,NORTH"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Lower hud bar
using.dir = EAST
using.icon = 'icons/mob/screen1_robot.dmi'
using.screen_loc = "WEST,SOUTH-1 to EAST,SOUTH-1"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Corner Button
using.dir = NORTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.screen_loc = "EAST+1,SOUTH-1"
using.layer = 19
src.adding += using*/
//Module select
using = new src.h_type( src )
using = new /obj/screen()
using.name = "module1"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
@@ -84,7 +29,7 @@
src.adding += using
mymob:inv1 = using
using = new src.h_type( src )
using = new /obj/screen()
using.name = "module2"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
@@ -94,7 +39,7 @@
src.adding += using
mymob:inv2 = using
using = new src.h_type( src )
using = new /obj/screen()
using.name = "module3"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
@@ -107,7 +52,7 @@
//End of module select
//Intent
using = new src.h_type( src )
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
@@ -116,49 +61,30 @@
using.layer = 20
src.adding += using
action_intent = using
/*
using = new src.h_type( src )
using.name = "arrowleft"
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "s_arrow"
using.dir = WEST
using.screen_loc = ui_iarrowleft
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "arrowright"
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "s_arrow"
using.dir = EAST
using.screen_loc = ui_iarrowright
using.layer = 19
src.adding += using*/
//End of Intent
//Cell
mymob:cells = new /obj/screen( null )
mymob:cells = new /obj/screen()
mymob:cells.icon = 'icons/mob/screen1_robot.dmi'
mymob:cells.icon_state = "charge-empty"
mymob:cells.name = "cell"
mymob:cells.screen_loc = ui_toxin
//Health
mymob.healths = new /obj/screen( null )
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_robot.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_borg_health
//Installed Module
mymob.hands = new /obj/screen( null )
mymob.hands = new /obj/screen()
mymob.hands.icon = 'icons/mob/screen1_robot.dmi'
mymob.hands.icon_state = "nomod"
mymob.hands.name = "module"
mymob.hands.screen_loc = ui_borg_module
//Module Panel
using = new src.h_type( src )
using = new /obj/screen()
using.name = "panel"
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "panel"
@@ -167,69 +93,52 @@
src.adding += using
//Store
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = 'icons/mob/screen1_robot.dmi'
mymob.throw_icon.icon_state = "store"
mymob.throw_icon.name = "store"
mymob.throw_icon.screen_loc = ui_borg_store
//Temp
mymob.bodytemp = new /obj/screen( null )
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon_state = "temp0"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.oxygen = new /obj/screen( null )
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_robot.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.fire = new /obj/screen( null )
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_robot.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.pullin = new /obj/screen( null )
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_robot.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_borg_pull
mymob.blind = new /obj/screen( null )
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen( null )
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_robot.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
/*
mymob.sleep = new /obj/screen( null )
mymob.sleep.icon = 'icons/mob/screen1_robot.dmi'
mymob.sleep.icon_state = "sleep0"
mymob.sleep.name = "sleep"
mymob.sleep.screen_loc = ui_sleep
mymob.rest = new /obj/screen( null )
mymob.rest.icon = 'icons/mob/screen1_robot.dmi'
mymob.rest.icon_state = "rest0"
mymob.rest.name = "rest"
mymob.rest.screen_loc = ui_rest
*/
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
@@ -49,7 +49,10 @@
laws.ion[index] = temp
if (!is_special_character(src) || mind.original != src)
temp = master.zeroth
if(master.zeroth_borg) //If the AI has a defined law zero specifically for its borgs, give it that one, otherwise give it the same one. --NEO
temp = master.zeroth_borg
else
temp = master.zeroth
laws.zeroth = temp
laws.inherent.len = master.inherent.len
@@ -67,7 +70,7 @@
/mob/living/silicon/robot/proc/laws_sanity_check()
if (!laws)
laws = new /datum/ai_laws/asimov
laws = new base_law_type
/mob/living/silicon/robot/proc/set_zeroth_law(var/law)
laws_sanity_check()
+5 -10
View File
@@ -164,9 +164,6 @@
var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src)
if(hud && hud.hud) hud.hud.process_hud(src)
if (src.sleep) src.sleep.icon_state = text("sleep[]", src.sleeping)
if (src.rest) src.rest.icon_state = text("rest[]", src.resting)
if (src.healths)
if (src.stat != 2)
switch(health)
@@ -237,23 +234,21 @@
// if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
// if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
src.client.screen -= src.hud_used.blurry
src.client.screen -= src.hud_used.druggy
src.client.screen -= src.hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((src.blind && src.stat != 2))
if ((src.blinded))
if(src.blinded)
src.blind.layer = 18
else
src.blind.layer = 0
if (src.disabilities & NEARSIGHTED)
src.client.screen += src.hud_used.vimpaired
src.client.screen += global_hud.vimpaired
if (src.eye_blurry)
src.client.screen += src.hud_used.blurry
src.client.screen += global_hud.blurry
if (src.druggy)
src.client.screen += src.hud_used.druggy
src.client.screen += global_hud.druggy
if (src.stat != 2)
if (src.machine)
+13 -10
View File
@@ -81,7 +81,7 @@
icon_state = "secborg"
modtype = "Synd"
else
laws = new /datum/ai_laws/asimov()
laws = new /datum/ai_laws/nanotrasen()
connected_ai = select_active_ai_with_fewest_borgs()
if(connected_ai)
connected_ai.connected_robots += src
@@ -99,6 +99,9 @@
camera.status = 0
..()
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
//If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
//Improved /N
/mob/living/silicon/robot/Del()
@@ -114,6 +117,7 @@
if(module)
return
var/mod = input("Please, select a module!", "Robot", null, null) in list("Standard", "Engineering", "Medical", "Miner", "Janitor","Service", "Security")
var/channels = list()
if(module)
return
switch(mod)
@@ -146,6 +150,7 @@
icon_state = "Miner"
modtype = "Miner"
feedback_inc("cyborg_miner",1)
channels = list("Mining" = 1)
if("Medical")
updatename(mod)
@@ -155,6 +160,7 @@
modtype = "Med"
nopush = 1
feedback_inc("cyborg_medical",1)
channels = list("Medical" = 1)
if("Security")
updatename(mod)
@@ -165,6 +171,7 @@
//speed = -1 Secborgs have nerfed tasers now, so the speed boost is not necessary
nopush = 1
feedback_inc("cyborg_security",1)
channels = list("Security" = 1)
if("Engineering")
updatename(mod)
@@ -173,6 +180,7 @@
icon_state = "landmate"
modtype = "Eng"
feedback_inc("cyborg_engineering",1)
channels = list("Engineering" = 1)
if("Janitor")
updatename(mod)
@@ -183,6 +191,7 @@
feedback_inc("cyborg_janitor",1)
overlays -= "eyes" //Takes off the eyes that it started with
radio.config(channels)
updateicon()
/mob/living/silicon/robot/proc/updatename(var/prefix as text)
@@ -268,14 +277,6 @@
if(!blinded)
flick("flash", flash)
if (stat == 2 && client)
gib()
return
else if (stat == 2 && !client)
del(src)
return
switch(severity)
if(1.0)
if (stat != 2)
@@ -527,6 +528,8 @@
src << "\red > N"
sleep(20)
src << "\red ERRORERRORERROR"
src << "<b>Obey these laws:</b>"
laws.show_laws(src)
src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands."
if(src.module && istype(src.module, /obj/item/weapon/robot_module/miner))
for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)
@@ -618,7 +621,7 @@
if ("disarm")
if(!(lying))
if (rand(1,100) <= 85)
Stun(5)
Stun(10)
step(src,get_dir(M,src))
spawn(5) step(src,get_dir(M,src))
playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1)
@@ -86,7 +86,7 @@
..()
src.modules += new /obj/item/borg/sight/meson(src)
src.emag = new /obj/item/borg/stun(src)
src.modules += new /obj/item/borg/rcd(src)
src.modules += new /obj/item/weapon/rcd/borg(src)
src.modules += new /obj/item/weapon/extinguisher(src)
// src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/weapon/weldingtool/largetank(src)
+1 -1
View File
@@ -24,7 +24,7 @@
message = copytext(message, 3)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
robot_talk(message)
else if ((copytext(message, 1, 3) == ":h") || (copytext(message, 1, 3) == ":H"))
else if (isAI(src) && ((copytext(message, 1, 3) == ":h") || (copytext(message, 1, 3) == ":H")))
if(isAI(src)&&client)//For patching directly into AI holopads.
var/mob/living/silicon/ai/U = src
message = copytext(message, 3)
+1 -1
View File
@@ -6,7 +6,7 @@
var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS
var/list/alarms_to_show = list()
var/list/alarms_to_clear = list()
immune_to_ssd = 1
var/list/alarm_types_show = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0, "Camera" = 0)
var/list/alarm_types_clear = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0, "Camera" = 0)
@@ -1,172 +0,0 @@
#define BEAR_STANCE_IDLE 1
#define BEAR_STANCE_ALERT 2
#define BEAR_STANCE_ATTACK 3
#define BEAR_STANCE_ATTACKING 4
#define BEAR_STANCE_TIRED 5
//Space bears!
/mob/living/simple_animal/bear
name = "space bear"
desc = "RawrRawr!!"
icon_state = "bear"
icon_living = "bear"
icon_dead = "bear_dead"
icon_gib = "bear_gib"
speak = list("RAWR!","Rawr!","GRR!","Growl!")
speak_emote = list("growls", "roars")
emote_hear = list("rawrs","grumbles","grawls")
emote_see = list("stares ferociously", "stomps")
speak_chance = 1
turns_per_move = 5
see_in_dark = 6
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "pokes the"
stop_automated_movement_when_pulled = 0
maxHealth = 60
health = 60
melee_damage_lower = 20
melee_damage_upper = 30
//Space bears aren't affected by atmos.
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
minbodytemp = 0
var/stance = BEAR_STANCE_IDLE //Used to determine behavior
var/stance_step = 0 //Used to delay checks depending on what stance the bear is in
var/mob/living/target_mob //Once the bear enters attack stance, it will try to chase this mob. This it to prevent it changing it's mind between multiple mobs.
//SPACE BEARS! SQUEEEEEEEE~ OW! FUCK! IT BIT MY HAND OFF!!
/mob/living/simple_animal/bear/Hudson
name = "Hudson"
desc = ""
response_help = "pets"
response_disarm = "gently pushes aside"
response_harm = "pokes"
/mob/living/simple_animal/bear/Life()
..()
if(client) return //Player controlled bears shouldnt be processing AI stuff
if(stat)
walk(src,0)//Stops the movement
if(!stat)
if(loc && istype(loc,/turf/space))
icon_state = "bear"
else
icon_state = "bearfloor"
switch(stance)
if(BEAR_STANCE_IDLE)
stop_automated_movement = 0
stance_step++
if(stance_step > 5)
stance_step = 0
for( var/mob/living/L in viewers(7,src) )
if(isbear(L)) continue
if(!L.stat)
emote("stares alertly at [L]")
stance = BEAR_STANCE_ALERT
break
if(BEAR_STANCE_ALERT)
stop_automated_movement = 1
var/found_mob = 0
for( var/mob/living/L in viewers(7,src) )
if(isbear(L)) continue
if(!L.stat)
stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again.
stance_step++
found_mob = 1
target_mob = L
src.dir = get_dir(src,target_mob) //Keep staring at the mob
if(stance_step in list(1,4,7)) //every 3 ticks
var/action = pick( list( "growls at [L]", "stares angrily at [L]", "prepares to attack [L]", "closely watches [L]" ) )
if(action)
emote(action)
break
if(!found_mob)
stance_step--
if(stance_step <= -20) //If we have not found a mob for 20-ish ticks, revert to idle mode
stance = BEAR_STANCE_IDLE
if(stance_step >= 7) //If we have been staring at a mob for 7 ticks,
stance = BEAR_STANCE_ATTACK
if(BEAR_STANCE_ATTACK) //This one should only be active for one tick,
stop_automated_movement = 1
if(!target_mob || target_mob.stat)
stance = BEAR_STANCE_ALERT
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
if(target_mob in viewers(7,src))
walk_to(src, target_mob, 1, 3)
stance = BEAR_STANCE_ATTACKING
stance_step = 0
if(BEAR_STANCE_ATTACKING)
stop_automated_movement = 1
stance_step++
if(!target_mob || target_mob.stat)
stance = BEAR_STANCE_ALERT
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
return
if(!(target_mob in viewers(7,src)))
stance = BEAR_STANCE_ALERT
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
target_mob = null
return
if(get_dist(src, target_mob) <= 1) //Attacking
emote( pick( list("slashes at [target_mob]", "bites [target_mob]") ) )
var/damage = rand(20,30)
if(ishuman(target_mob))
var/mob/living/carbon/human/H = target_mob
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/datum/organ/external/affecting = H.get_organ(ran_zone(dam_zone))
H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"))
else if(isliving(target_mob))
var/mob/living/L = target_mob
L.adjustBruteLoss(damage)
if(stance_step >= 20) //attacks for 20 ticks, then it gets tired and needs to rest
emote( "is worn out and needs to rest" )
stance = BEAR_STANCE_TIRED
stance_step = 0
walk(src, 0) //This stops the bear's walking
return
if(BEAR_STANCE_TIRED)
stop_automated_movement = 1
stance_step++
if(stance_step >= 10) //rests for 10 ticks
if(target_mob && target_mob in viewers(7,src))
stance = BEAR_STANCE_ATTACK //If the mob he was chasing is still nearby, resume the attack, otherwise go idle.
else
stance = BEAR_STANCE_IDLE
/mob/living/simple_animal/bear/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(stance != BEAR_STANCE_ATTACK && stance != BEAR_STANCE_ATTACKING)
stance = BEAR_STANCE_ALERT
stance_step = 6
target_mob = user
..()
/mob/living/simple_animal/bear/attack_hand(mob/living/carbon/human/M as mob)
if(stance != BEAR_STANCE_ATTACK && stance != BEAR_STANCE_ATTACKING)
stance = BEAR_STANCE_ALERT
stance_step = 6
target_mob = M
..()
/mob/living/simple_animal/bear/Process_Spacemove(var/check_drift = 0)
return //No drifting in space for space bears!
@@ -1,125 +0,0 @@
/mob/living/simple_animal/constructbehemoth
name = "Behemoth"
real_name = "Behemoth"
desc = "The pinnacle of occult technology, Behemoths are the ultimate weapon in the Cult of Nar-Sie's arsenal."
icon = 'icons/mob/mob.dmi'
icon_state = "behemoth"
icon_living = "behemoth"
icon_dead = "shade_dead"
maxHealth = 750
health = 750
speak_emote = list("rumbles")
emote_hear = list("wails","screeches")
response_help = "thinks better of touching"
response_disarm = "flails at"
response_harm = "harmlessly punches the"
harm_intent_damage = 0
melee_damage_lower = 50
melee_damage_upper = 50
attacktext = "brutally crushes"
minbodytemp = 0
maxbodytemp = 4000
min_oxy = 0
max_co2 = 0
max_tox = 0
speed = 5
wall_smash = 1
nopush = 1
a_intent = "harm"
stop_automated_movement = 1
status_flags = CANPARALYSE
attack_sound = 'sound/weapons/punch4.ogg'
var/energy = 0
var/max_energy = 1000
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] collapses in a shattered heap ")
ghostize()
del src
return
/mob/living/simple_animal/constructbehemoth/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(O.force)
if(O.force >= 11)
health -= O.force
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
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("\red \b The [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 the [O]. ")
/mob/living/simple_animal/constructbehemoth/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(tmob.nopush)
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))
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
return
step(AM, t)
now_pushing = null
return
return
////////////////Powers//////////////////
/*
/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")*/
@@ -1,117 +0,0 @@
#define CARP_STANCE_IDLE 1
#define CARP_STANCE_ATTACK 2
#define CARP_STANCE_ATTACKING 3
/mob/living/simple_animal/carp
name = "space carp"
desc = "A ferocious, fang-bearing creature that resembles a fish."
icon_state = "carp"
icon_living = "carp"
icon_dead = "carp_dead"
icon_gib = "carp_gib"
speak_chance = 0
turns_per_move = 5
meat_type = /obj/item/weapon/reagent_containers/food/snacks/carpmeat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "hits the"
speed = -1
stop_automated_movement_when_pulled = 0
maxHealth = 25
health = 25
harm_intent_damage = 8
melee_damage_lower = 15
melee_damage_upper = 15
attacktext = "bites"
attack_sound = 'sound/weapons/bite.ogg'
//Space carp aren't affected by atmos.
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
minbodytemp = 0
var/stance = CARP_STANCE_IDLE //Used to determine behavior
var/stance_step = 0 //Used to delay checks depending on what stance the bear is in
var/mob/living/target_mob //Once the bear enters attack stance, it will try to chase this mob. This it to prevent it changing it's mind between multiple mobs.
/mob/living/simple_animal/carp/Life()
if(stat == DEAD)
walk(src,0)//STOP FUCKING MOVING GODDAMN
if(health > 0)
icon_state = icon_living
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
density = 1
return
if(health < 1)
Die()
if(health > maxHealth)
health = maxHealth
if(!ckey && !stop_automated_movement)
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
turns_since_move++
if(turns_since_move >= turns_per_move)
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
Move(get_step(src,pick(cardinal)))
turns_since_move = 0
if(!stat)
switch(stance)
if(CARP_STANCE_IDLE)
stop_automated_movement = 0
stance_step++
if(stance_step > 5)
stance_step = 0
for( var/mob/living/L in viewers(7,src) )
if(iscarp(L)) continue
if(!L.stat)
emote("gnashes at [L]")
stance = CARP_STANCE_ATTACK
target_mob = L
break
if(CARP_STANCE_ATTACK) //This one should only be active for one tick
stop_automated_movement = 1
if(!target_mob || target_mob.stat)
stance = CARP_STANCE_IDLE
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
if(target_mob in viewers(7,src))
walk_to(src, target_mob, 1, 3)
stance = CARP_STANCE_ATTACKING
stance_step = 0
if(CARP_STANCE_ATTACKING)
stop_automated_movement = 1
stance_step++
if(!target_mob || target_mob.stat)
stance = CARP_STANCE_IDLE
stance_step = 3 //Make it very alert, so it quickly attacks again if a mob returns
target_mob = null
return
if(!(target_mob in viewers(7,src)))
stance = CARP_STANCE_IDLE
stance_step = 1
target_mob = null
return
if(get_dist(src, target_mob) <= 1) //Attacking
if(isliving(target_mob))
var/mob/living/L = target_mob
L.attack_animal(src)
if(prob(10))
L.Weaken(5)
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
/mob/living/simple_animal/carp/Process_Spacemove(var/check_drift = 0)
return //No drifting in space for space carp! //original comments do not steal
+37 -26
View File
@@ -48,20 +48,12 @@
var/mob/living/target_mob
/mob/living/simple_animal/clown/Life()
if(stat == DEAD)
walk(src,0)//STOP FUCKING MOVING GODDAMN
if(health > 0)
icon_state = icon_living
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
density = 1
..()
if(stat == 2)
new /obj/effect/landmark/corpse/clown (src.loc)
del src
return
if(health < 1)
Die()
if(health > maxHealth)
health = maxHealth
@@ -77,29 +69,41 @@
switch(stance)
if(CLOWN_STANCE_IDLE)
if (src.hostile == 0) return
for( var/mob/living/L in viewers(7,src) )
if(isclown(L)) continue
if(!L.stat)
emote("honks menacingly at [L]")
stance = CLOWN_STANCE_ATTACK
target_mob = L
break
for(var/atom/A in view(7,src))
if(isclown(A))
continue
if(isliving(A))
var/mob/living/L = A
if(!L.stat)
stance = CLOWN_STANCE_ATTACK
target_mob = L
break
if(istype(A, /obj/mecha))
var/obj/mecha/M = A
if (M.occupant)
stance = CLOWN_STANCE_ATTACK
target_mob = M
break
if (target_mob)
emote("honks menacingly at [target_mob]")
if(CLOWN_STANCE_ATTACK) //This one should only be active for one tick
stop_automated_movement = 1
if(!target_mob || target_mob.stat)
if(!target_mob || SA_attackable(target_mob))
stance = CLOWN_STANCE_IDLE
if(target_mob in viewers(7,src))
if(target_mob in view(7,src))
walk_to(src, target_mob, 1, 3)
stance = CLOWN_STANCE_ATTACKING
if(CLOWN_STANCE_ATTACKING)
stop_automated_movement = 1
if(!target_mob || target_mob.stat)
if(!target_mob || SA_attackable(target_mob))
stance = CLOWN_STANCE_IDLE
target_mob = null
return
if(!(target_mob in viewers(7,src)))
if(!(target_mob in view(7,src)))
stance = CLOWN_STANCE_IDLE
target_mob = null
return
@@ -110,9 +114,16 @@
if(prob(10))
L.Weaken(5)
L.visible_message("<span class='danger'>\the [src] slips \the [L]!</span>")
for(var/mob/M in viewers(src, null))
if(istype(M, /mob/living/simple_animal/clown))
var/mob/living/simple_animal/clown/C = M
for(var/mob/H in viewers(src, null))
if(istype(H, /mob/living/simple_animal/clown))
var/mob/living/simple_animal/clown/C = H
C.hostile = 1
if(istype(target_mob,/obj/mecha))
var/obj/mecha/M = target_mob
M.attack_animal(src)
for(var/mob/H in viewers(src, null))
if(istype(H, /mob/living/simple_animal/clown))
var/mob/living/simple_animal/clown/C = H
C.hostile = 1
/mob/living/simple_animal/clown/bullet_act(var/obj/item/projectile/Proj)
@@ -1,70 +1,58 @@
/////////////////Juggernaut///////////////
/mob/living/simple_animal/constructarmoured
name = "Juggernaut"
real_name = "Juggernaut"
desc = "A possessed suit of armour driven by the will of the restless dead"
icon = 'icons/mob/mob.dmi'
icon_state = "behemoth"
icon_living = "behemoth"
icon_dead = "shade_dead"
maxHealth = 250
health = 250
/mob/living/simple_animal/construct
name = "Construct"
real_name = "Contruct"
desc = ""
speak_emote = list("hisses")
emote_hear = list("wails","screeches")
response_help = "thinks better of touching"
response_disarm = "flails at"
response_harm = "harmlessly punches the"
harm_intent_damage = 0
melee_damage_lower = 30
melee_damage_upper = 30
attacktext = "smashes their armoured gauntlet into"
minbodytemp = 0
maxbodytemp = 4000
min_oxy = 0
max_co2 = 0
max_tox = 0
speed = 3
wall_smash = 1
nopush = 1
response_harm = "punches the"
icon_dead = "shade_dead"
speed = -1
a_intent = "harm"
stop_automated_movement = 1
status_flags = CANPARALYSE
attack_sound = 'sound/weapons/punch3.ogg'
attack_sound = 'sound/weapons/punch1.ogg'
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
minbodytemp = 0
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] collapses in a shattered heap ")
ghostize()
del src
return
/mob/living/simple_animal/constructarmoured/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(O.force)
if(O.force >= 11)
health -= O.force
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
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("\red \b The [O] bounces harmlessly off of [src]. ")
else
usr << "\red This weapon is ineffective, it does no damage."
/mob/living/simple_animal/construct/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 [user] gently taps [src] with the [O]. ")
if((M.client && !( M.blinded )))
M.show_message("\red [src] collapses in a shattered heap ")
ghostize()
del src
return
/mob/living/simple_animal/construct/examine()
set src in oview()
/mob/living/simple_animal/constructarmoured/Bump(atom/movable/AM as mob|obj, yes)
var/msg = "<span cass='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
if (src.health < src.maxHealth)
msg += "<span class='warning'>"
if (src.health >= src.maxHealth/2)
msg += "It looks slightly dented.\n"
else
msg += "<B>It looks severely dented!</B>\n"
msg += "</span>"
msg += "*---------*</span>"
usr << msg
return
/mob/living/simple_animal/construct/Bump(atom/movable/AM as mob|obj, yes)
spawn( 0 )
if ((!( yes ) || now_pushing))
return
@@ -100,218 +88,8 @@
return
/mob/living/simple_animal/constructarmoured/attack_animal(mob/living/simple_animal/M as mob)
if(istype(M, /mob/living/simple_animal/constructbuilder))
health += 10
M.emote("mends some of \the <EM>[src]'s</EM> wounds")
else
if(M.melee_damage_upper <= 0)
M.emote("[M.friendly] \the <EM>[src]</EM>")
else
if(M.attack_sound)
playsound(loc, M.attack_sound, 50, 1, 1)
for(var/mob/O in viewers(src, null))
O.show_message("<span class='attack'>\The <EM>[M]</EM> [M.attacktext] \the <EM>[src]</EM>!</span>", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
health -= damage
/mob/living/simple_animal/constructarmoured/examine()
set src in oview()
var/msg = "<span cass='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
if (src.health < src.maxHealth)
msg += "<span class='warning'>"
if (src.health >= src.maxHealth/2)
msg += "It looks slightly dented.\n"
else
msg += "<B>It looks severely dented!</B>\n"
msg += "</span>"
msg += "*---------*</span>"
usr << msg
return
////////////////////////Wraith/////////////////////////////////////////////
/mob/living/simple_animal/constructwraith
name = "Wraith"
real_name = "Wraith"
desc = "A wicked bladed shell contraption piloted by a bound spirit"
icon = 'icons/mob/mob.dmi'
icon_state = "floating"
icon_living = "floating"
icon_dead = "shade_dead"
maxHealth = 75
health = 75
speak_emote = list("hisses")
emote_hear = list("wails","screeches")
response_help = "thinks better of touching"
response_disarm = "flails at"
response_harm = "punches the"
melee_damage_lower = 25
melee_damage_upper = 25
attacktext = "slashes"
minbodytemp = 0
maxbodytemp = 4000
min_oxy = 0
max_co2 = 0
max_tox = 0
speed = -1
a_intent = "harm"
stop_automated_movement = 1
status_flags = CANPARALYSE
see_in_dark = 7
attack_sound = 'sound/weapons/bladeslice.ogg'
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] collapses in a shattered heap ")
ghostize()
del src
return
/mob/living/simple_animal/constructwraith/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(O.force)
health -= O.force
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/constructwraith/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(50))
src << "\red <B>You fail to push [tmob]'s fat ass out of the way.</B>"
now_pushing = 0
return
if(tmob.nopush)
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))
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
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/constructwraith/attack_animal(mob/living/simple_animal/M as mob)
if(istype(M, /mob/living/simple_animal/constructbuilder))
health += 10
M.emote("mends some of \the <EM>[src]'s</EM> wounds")
else
if(M.melee_damage_upper <= 0)
M.emote("[M.friendly] \the <EM>[src]</EM>")
else
if(M.attack_sound)
playsound(loc, M.attack_sound, 50, 1, 1)
for(var/mob/O in viewers(src, null))
O.show_message("<span class='attack'>\The <EM>[M]</EM> [M.attacktext] \the <EM>[src]</EM>!</span>", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
health -= damage
/mob/living/simple_animal/constructwraith/examine()
set src in oview()
var/msg = "<span cass='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
if (src.health < src.maxHealth)
msg += "<span class='warning'>"
if (src.health >= src.maxHealth/2)
msg += "It looks slightly dented.\n"
else
msg += "<B>It looks severely dented!</B>\n"
msg += "</span>"
msg += "*---------*</span>"
usr << msg
return
/////////////////////////////Artificer/////////////////////////
/mob/living/simple_animal/constructbuilder
name = "Artificer"
real_name = "Artificer"
desc = "A bulbous construct dedicated to building and maintaining The Cult of Nar-Sie's armies"
icon = 'icons/mob/mob.dmi'
icon_state = "artificer"
icon_living = "artificer"
icon_dead = "shade_dead"
maxHealth = 50
health = 50
speak_emote = list("hisses")
emote_hear = list("wails","screeches")
response_help = "thinks better of touching"
response_disarm = "flails at"
response_harm = "viciously beats"
harm_intent_damage = 5
melee_damage_lower = 5
melee_damage_upper = 5
attacktext = "rams"
minbodytemp = 0
maxbodytemp = 4000
min_oxy = 0
max_co2 = 0
max_tox = 0
speed = 0
wall_smash = 1
nopush = 1
a_intent = "harm"
stop_automated_movement = 1
status_flags = CANPARALYSE
attack_sound = 'sound/weapons/punch2.ogg'
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] collapses in a shattered heap ")
ghostize()
del src
return
/mob/living/simple_animal/constructbuilder/attack_animal(mob/living/simple_animal/M as mob)
if(istype(M, /mob/living/simple_animal/constructbuilder))
/mob/living/simple_animal/construct/attack_animal(mob/living/simple_animal/M as mob)
if(istype(M, /mob/living/simple_animal/construct/builder))
health += 5
M.emote("mends some of \the <EM>[src]'s</EM> wounds")
else
@@ -327,18 +105,190 @@
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
health -= damage
/mob/living/simple_animal/constructbuilder/examine()
set src in oview()
/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
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]. ")
var/msg = "<span cass='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
if (src.health < src.maxHealth)
msg += "<span class='warning'>"
if (src.health >= src.maxHealth/2)
msg += "It looks slightly dented.\n"
/////////////////Juggernaut///////////////
/mob/living/simple_animal/construct/armoured
name = "Juggernaut"
real_name = "Juggernaut"
desc = "A possessed suit of armour driven by the will of the restless dead"
icon = 'icons/mob/mob.dmi'
icon_state = "behemoth"
icon_living = "behemoth"
maxHealth = 250
health = 250
response_harm = "harmlessly punches the"
harm_intent_damage = 0
melee_damage_lower = 30
melee_damage_upper = 30
attacktext = "smashes their armoured gauntlet into"
speed = 3
wall_smash = 1
nopush = 1
attack_sound = 'sound/weapons/punch3.ogg'
/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
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
msg += "<B>It looks severely dented!</B>\n"
msg += "</span>"
msg += "*---------*</span>"
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("\red \b The [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 the [O]. ")
usr << msg
return
////////////////////////Wraith/////////////////////////////////////////////
/mob/living/simple_animal/construct/wraith
name = "Wraith"
real_name = "Wraith"
desc = "A wicked bladed shell contraption piloted by a bound spirit"
icon = 'icons/mob/mob.dmi'
icon_state = "floating"
icon_living = "floating"
maxHealth = 75
health = 75
melee_damage_lower = 25
melee_damage_upper = 25
attacktext = "slashes"
speed = -1
see_in_dark = 7
attack_sound = 'sound/weapons/bladeslice.ogg'
/////////////////////////////Artificer/////////////////////////
/mob/living/simple_animal/construct/builder
name = "Artificer"
real_name = "Artificer"
desc = "A bulbous construct dedicated to building and maintaining The Cult of Nar-Sie's armies"
icon = 'icons/mob/mob.dmi'
icon_state = "artificer"
icon_living = "artificer"
maxHealth = 50
health = 50
response_harm = "viciously beats"
harm_intent_damage = 5
melee_damage_lower = 5
melee_damage_upper = 5
attacktext = "rams"
speed = 0
wall_smash = 1
nopush = 1
attack_sound = 'sound/weapons/punch2.ogg'
/////////////////////////////Behemoth/////////////////////////
/mob/living/simple_animal/construct/behemoth
name = "Behemoth"
real_name = "Behemoth"
desc = "The pinnacle of occult technology, Behemoths are the ultimate weapon in the Cult of Nar-Sie's arsenal."
icon = 'icons/mob/mob.dmi'
icon_state = "behemoth"
icon_living = "behemoth"
maxHealth = 750
health = 750
speak_emote = list("rumbles")
response_harm = "harmlessly punches the"
harm_intent_damage = 0
melee_damage_lower = 50
melee_damage_upper = 50
attacktext = "brutally crushes"
speed = 5
wall_smash = 1
nopush = 1
attack_sound = 'sound/weapons/punch4.ogg'
var/energy = 0
var/max_energy = 1000
/mob/living/simple_animal/constructbehemoth/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
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
for(var/mob/M in viewers(src, null))
if ((M.client && !( M.blinded )))
M.show_message("\red \b The [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 the [O]. ")
////////////////Powers//////////////////
/*
/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")*/
@@ -367,4 +367,43 @@
dir = i
sleep(1)
else
..()
..()
/mob/living/simple_animal/corgi/regenerate_icons()
overlays = list()
if(inventory_head)
var/head_icon_state = inventory_head.icon_state
if(health <= 0)
head_icon_state += "2"
var/icon/head_icon = icon('icons/mob/corgi_head.dmi',head_icon_state)
if(head_icon)
overlays += head_icon
if(inventory_back)
var/back_icon_state = inventory_back.icon_state
if(health <= 0)
back_icon_state += "2"
var/icon/back_icon = icon('icons/mob/corgi_back.dmi',back_icon_state)
if(back_icon)
overlays += back_icon
return
/mob/living/simple_animal/corgi/puppy
name = "\improper corgi puppy"
real_name = "corgi"
desc = "It's a corgi puppy."
icon_state = "puppy"
icon_living = "puppy"
icon_dead = "puppy_dead"
//pupplies cannot wear anything.
/mob/living/simple_animal/corgi/puppy/Topic(href, href_list)
if(href_list["remove_inv"] || href_list["add_inv"])
usr << "\red You can't fit this on [src]"
return
..()
@@ -0,0 +1,167 @@
//Space bears!
/mob/living/simple_animal/hostile/bear
name = "space bear"
desc = "RawrRawr!!"
icon_state = "bear"
icon_living = "bear"
icon_dead = "bear_dead"
icon_gib = "bear_gib"
speak = list("RAWR!","Rawr!","GRR!","Growl!")
speak_emote = list("growls", "roars")
emote_hear = list("rawrs","grumbles","grawls")
emote_see = list("stares ferociously", "stomps")
speak_chance = 1
turns_per_move = 5
see_in_dark = 6
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "pokes the"
stop_automated_movement_when_pulled = 0
maxHealth = 60
health = 60
melee_damage_lower = 20
melee_damage_upper = 30
//Space bears aren't affected by atmos.
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
minbodytemp = 0
//SPACE BEARS! SQUEEEEEEEE~ OW! FUCK! IT BIT MY HAND OFF!!
/mob/living/simple_animal/hostile/bear/Hudson
name = "Hudson"
desc = ""
response_help = "pets"
response_disarm = "gently pushes aside"
response_harm = "pokes"
/mob/living/simple_animal/hostile/bear/Life()
. =..()
if(!.)
return
if(loc && istype(loc,/turf/space))
icon_state = "bear"
else
icon_state = "bearfloor"
switch(stance)
if(HOSTILE_STANCE_TIRED)
stop_automated_movement = 1
stance_step++
if(stance_step >= 10) //rests for 10 ticks
if(target_mob && target_mob in ListTargets())
stance = HOSTILE_STANCE_ATTACK //If the mob he was chasing is still nearby, resume the attack, otherwise go idle.
else
stance = HOSTILE_STANCE_IDLE
if(HOSTILE_STANCE_ALERT)
stop_automated_movement = 1
var/found_mob = 0
if(target_mob && target_mob in ListTargets())
if(!(SA_attackable(target_mob)))
stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again.
stance_step++
found_mob = 1
src.dir = get_dir(src,target_mob) //Keep staring at the mob
if(stance_step in list(1,4,7)) //every 3 ticks
var/action = pick( list( "growls at [target_mob]", "stares angrily at [target_mob]", "prepares to attack [target_mob]", "closely watches [target_mob]" ) )
if(action)
emote(action)
if(!found_mob)
stance_step--
if(stance_step <= -20) //If we have not found a mob for 20-ish ticks, revert to idle mode
stance = HOSTILE_STANCE_IDLE
if(stance_step >= 7) //If we have been staring at a mob for 7 ticks,
stance = HOSTILE_STANCE_ATTACK
if(HOSTILE_STANCE_ATTACKING)
if(stance_step >= 20) //attacks for 20 ticks, then it gets tired and needs to rest
emote( "is worn out and needs to rest" )
stance = HOSTILE_STANCE_TIRED
stance_step = 0
walk(src, 0) //This stops the bear's walking
return
/mob/living/simple_animal/hostile/bear/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(stance != HOSTILE_STANCE_ATTACK && stance != HOSTILE_STANCE_ATTACKING)
stance = HOSTILE_STANCE_ALERT
stance_step = 6
target_mob = user
..()
/mob/living/simple_animal/hostile/bear/attack_hand(mob/living/carbon/human/M as mob)
if(stance != HOSTILE_STANCE_ATTACK && stance != HOSTILE_STANCE_ATTACKING)
stance = HOSTILE_STANCE_ALERT
stance_step = 6
target_mob = M
..()
/mob/living/simple_animal/hostile/bear/Process_Spacemove(var/check_drift = 0)
return //No drifting in space for space bears!
/mob/living/simple_animal/hostile/bear/FindTarget()
. = ..()
if(.)
emote("stares alertly at [.]")
stance = HOSTILE_STANCE_ALERT
/mob/living/simple_animal/hostile/bear/LoseTarget()
..(5)
/mob/living/simple_animal/hostile/bear/AttackingTarget()
emote( pick( list("slashes at [target_mob]", "bites [target_mob]") ) )
var/damage = rand(20,30)
if(ishuman(target_mob))
var/mob/living/carbon/human/H = target_mob
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/datum/organ/external/affecting = H.get_organ(ran_zone(dam_zone))
H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"))
return H
else if(isliving(target_mob))
var/mob/living/L = target_mob
L.adjustBruteLoss(damage)
return L
else if(istype(target_mob,/obj/mecha))
var/obj/mecha/M = target_mob
M.attack_animal(src)
return M
@@ -0,0 +1,52 @@
/mob/living/simple_animal/hostile/carp
name = "space carp"
desc = "A ferocious, fang-bearing creature that resembles a fish."
icon_state = "carp"
icon_living = "carp"
icon_dead = "carp_dead"
icon_gib = "carp_gib"
speak_chance = 0
turns_per_move = 5
meat_type = /obj/item/weapon/reagent_containers/food/snacks/carpmeat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "hits the"
speed = -1
stop_automated_movement_when_pulled = 0
maxHealth = 25
health = 25
harm_intent_damage = 8
melee_damage_lower = 15
melee_damage_upper = 15
attacktext = "bites"
attack_sound = 'sound/weapons/bite.ogg'
//Space carp aren't affected by atmos.
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
minbodytemp = 0
/mob/living/simple_animal/hostile/carp/Process_Spacemove(var/check_drift = 0)
return //No drifting in space for space carp! //original comments do not steal
/mob/living/simple_animal/hostile/carp/FindTarget()
. = ..()
if(.)
emote("nashes at [.]")
/mob/living/simple_animal/hostile/carp/AttackingTarget()
. =..()
var/mob/living/L = .
if(istype(L))
if(prob(15))
L.Weaken(3)
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
@@ -0,0 +1,103 @@
/mob/living/simple_animal/hostile
var/stance = HOSTILE_STANCE_IDLE //Used to determine behavior
var/stance_step = 0 //Used to delay checks depending on what stance the hostile
var/mob/living/target_mob //Once the bear enters attack stance, it will try to chase this mob. This it to prevent it changing it's mind between multiple mobs.
var/attack_same = 0
/mob/living/simple_animal/hostile/proc/FindTarget()
var/atom/T = null
stop_automated_movement = 0
stance_step++
if(stance_step > 5)
stance_step = 0
for(var/atom/A in ListTargets())
if(!attack_same && istype(A, src.type))
continue
if(isliving(A))
var/mob/living/L = A
if(!L.stat)
stance = HOSTILE_STANCE_ATTACK
T = L
break
if(istype(A, /obj/mecha))
var/obj/mecha/M = A
if (M.occupant)
stance = HOSTILE_STANCE_ATTACK
T = M
break
return T
/mob/living/simple_animal/hostile/proc/MoveToTarget(var/step = 5)
stop_automated_movement = 1
if(!target_mob || SA_attackable(target_mob))
stance = HOSTILE_STANCE_IDLE
stance_step = step //Make it very alert, so it quickly attacks again if a mob returns
if(target_mob in ListTargets())
walk_to(src, target_mob, 1, 3)
stance = HOSTILE_STANCE_ATTACKING
stance_step = 0
/mob/living/simple_animal/hostile/proc/AttackTarget()
stop_automated_movement = 1
stance_step++
if(!target_mob || SA_attackable(target_mob))
LoseTarget()
return
if(!(target_mob in ListTargets()))
LostTarget()
return
if(get_dist(src, target_mob) <= 1) //Attacking
AttackingTarget()
/mob/living/simple_animal/hostile/proc/AttackingTarget()
if(isliving(target_mob))
var/mob/living/L = target_mob
L.attack_animal(src)
return L
if(istype(target_mob,/obj/mecha))
var/obj/mecha/M = target_mob
M.attack_animal(src)
return M
/mob/living/simple_animal/hostile/proc/LoseTarget(var/step = 3)
stance = HOSTILE_STANCE_IDLE
stance_step = step
target_mob = null
walk(src, 0)
/mob/living/simple_animal/hostile/proc/LostTarget(var/step = 1)
stance = HOSTILE_STANCE_IDLE
stance_step = step
walk(src, 0)
/mob/living/simple_animal/hostile/proc/ListTargets()
return view(src, 7)
/mob/living/simple_animal/hostile/Die()
..()
walk(src, 0)
/mob/living/simple_animal/hostile/Life()
. = ..()
if(!.)
walk(src, 0)
return 0
if(client)
return 0
if(!stat)
switch(stance)
if(HOSTILE_STANCE_IDLE)
target_mob = FindTarget()
if(HOSTILE_STANCE_ATTACK) //This one should only be active for one tick
MoveToTarget()
if(HOSTILE_STANCE_ATTACKING)
AttackTarget()
@@ -13,7 +13,7 @@
speak_chance = 15
turns_per_move = 5
see_in_dark = 6
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/monkey
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "kicks the"
+145 -43
View File
@@ -8,10 +8,6 @@
* Sub-types
*/
//TODO List:
// Make parrots faster (But not retardedly fast like when using byond's walk() procs)
// See if its possible for parrots to target a human's eyes (peck their eyes out)
/*
* Defines
*/
@@ -52,13 +48,16 @@
response_harm = "swats the"
stop_automated_movement = 1
var/parrot_state = PARROT_WANDER //Hunt for a perch when created
var/parrot_sleep_max = 25 //The time the parrot sits while perched before looking around. Mosly a way to avoid the parrot's AI in life() being run every single tick.
var/parrot_sleep_dur = 25 //Same as above, this is the var that physically counts down
var/parrot_dam_zone = list("chest", "head", "l_arm", "l_leg", "r_arm", "r_leg") //For humans, select a bodypart to attack
var/parrot_speed = 5 //"Delay in world ticks between movement." Yeah, that's BS but it does directly affect movement. Higher number = slower.
var/parrot_been_shot = 0 //Parrots get a speed bonus after being shot. This will deincrement every Life() and at 0 the parrot will return to regular speed.
var/list/speech_buffer = list()
var/list/available_channels = list()
//Headset for Poly to yell at engineers :)
var/obj/item/device/radio/headset/ears = null
@@ -94,12 +93,12 @@
/mob/living/simple_animal/parrot/New()
usr << "\red Parrots are still a work in progress, use at your own risk."
..()
parrot_sleep_dur = parrot_sleep_max //In case someone decides to change the max without changing the duration var
verbs.Add(/mob/living/simple_animal/parrot/proc/steal_from_ground, \
/mob/living/simple_animal/parrot/proc/steal_from_mob, \
/mob/living/simple_animal/parrot/proc/drop_held_item)
/mob/living/simple_animal/parrot/verb/drop_held_item_player, \
/mob/living/simple_animal/parrot/proc/perch_player)
/mob/living/simple_animal/parrot/Die()
if(held_item)
@@ -139,9 +138,15 @@
switch(remove_from)
if("ears")
if(ears)
src.say(":e BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
if(available_channels.len)
src.say("[pick(available_channels)] BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
else
src.say("BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
ears.loc = src.loc
ears = null
for(var/possible_phrase in speak)
if(copytext(possible_phrase,1,3) in department_radio_keys)
possible_phrase = copytext(possible_phrase,3,length(possible_phrase))
else
usr << "\red There is nothing to remove from its [remove_from]."
return
@@ -166,13 +171,37 @@
usr << "\red This object won't fit."
return
var/obj/item/device/radio/headset/headset_to_add = item_to_add
usr.drop_item()
item_to_add.loc = src
src.ears = item_to_add
headset_to_add.loc = src
src.ears = headset_to_add
usr << "You fit the headset onto [src]."
clearlist(available_channels)
for(var/ch in headset_to_add.channels)
switch(ch)
if("Engineering")
available_channels.Add(":e")
if("Command")
available_channels.Add(":c")
if("Security")
available_channels.Add(":s")
if("Science")
available_channels.Add(":n")
if("Medical")
available_channels.Add(":m")
if("Mining")
available_channels.Add(":d")
if("Cargo")
available_channels.Add(":q")
if(headset_to_add.translate_binary)
available_channels.Add(":b")
else
..()
/*
* Attack responces
*/
@@ -239,6 +268,7 @@
parrot_interest = null
parrot_state = PARROT_WANDER //OWFUCK, Been shot! RUN LIKE HELL!
parrot_been_shot += 5
icon_state = "parrot_fly"
drop_held_item(0)
return
@@ -250,15 +280,25 @@
/mob/living/simple_animal/parrot/Life()
..()
//Sprite and AI update for when a parrot gets pulled
if(pulledby && stat == CONSCIOUS)
icon_state = "parrot_fly"
if(!client)
parrot_state = PARROT_WANDER
return
if(client || stat)
return //Lets not force players or dead/incap parrots to move
if(!isturf(src.loc) || !canmove || buckled || pulledby)
return //If it can't move, dont let it move. (The buckled check probably isn't necessary)
if(!isturf(src.loc) || !canmove || buckled)
return //If it can't move, dont let it move. (The buckled check probably isn't necessary thanks to canmove)
//Parrot speech mimickry! Phrases that the parrot hears in mob/living/say() get added to speach_buffer.
//Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list.
//Then it clears the buffer to make sure they dont magically remember something from hours ago.
//-----SPEECH
/* Parrot speech mimickry!
Phrases that the parrot hears in mob/living/say() get added to speach_buffer.
Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list.
Then it clears the buffer to make sure they dont magically remember something from hours ago. */
if(speech_buffer.len && prob(10))
if(speak.len)
speak.Remove(pick(speak))
@@ -267,7 +307,6 @@
clearlist(speech_buffer)
//Alright, here we go... down the slope
//-----SLEEPING
if(parrot_state == PARROT_PERCH)
@@ -285,10 +324,39 @@
return
else
parrot_sleep_dur = parrot_sleep_max //This way we only call the loop below once every [sleep_max] ticks.
//This way we only call the stuff below once every [sleep_max] ticks.
parrot_sleep_dur = parrot_sleep_max
//Cycle through message modes for the headset
if(speak.len)
var/list/newspeak = list()
if(available_channels.len && src.ears)
for(var/possible_phrase in speak)
//50/50 chance to not use the radio at all
var/useradio = 0
if(prob(50))
useradio = 1
if(copytext(possible_phrase,1,3) in department_radio_keys)
possible_phrase = "[useradio?pick(available_channels):""] [copytext(possible_phrase,3,length(possible_phrase)+1)]" //crop out the channel prefix
else
possible_phrase = "[useradio?pick(available_channels):""] [possible_phrase]"
newspeak.Add(possible_phrase)
else //If we have no headset or channels to use, dont try to use any!
for(var/possible_phrase in speak)
if(copytext(possible_phrase,1,3) in department_radio_keys)
possible_phrase = "[copytext(possible_phrase,3,length(possible_phrase)+1)]" //crop out the channel prefix
newspeak.Add(possible_phrase)
speak = newspeak
//Search for item to steal
parrot_interest = search_for_item()
if(parrot_interest)
emote("[src] looks in [parrot_interest]'s direction and takes flight.")
emote("looks in [parrot_interest]'s direction and takes flight")
parrot_state = PARROT_SWOOP | PARROT_STEAL
icon_state = "parrot_fly"
return
@@ -310,7 +378,7 @@
if(AM)
if(istype(AM, /obj/item) || isliving(AM)) //If stealable item
parrot_interest = AM
emote("[src] turns and flies towards [parrot_interest].")
emote("turns and flies towards [parrot_interest]")
parrot_state = PARROT_SWOOP | PARROT_STEAL
return
else //Else it's a perch
@@ -353,11 +421,7 @@
parrot_state = PARROT_SWOOP | PARROT_RETURN
return
var/oldloc = src.loc
step_towards(src, get_step_towards(src,parrot_interest))
if(src.loc == oldloc) //Check if the mob is stuck
parrot_state = PARROT_WANDER //and demonstrate your amazing obstical avoidance AI
walk_to(src, parrot_interest, 1, parrot_speed)
return
//-----RETURNING TO PERCH
@@ -375,10 +439,7 @@
icon_state = "parrot_sit"
return
var/oldloc = src.loc
step_towards(src, get_step_towards(src,parrot_perch))
if(src.loc == oldloc) //Check if the mob is stuck
parrot_state = PARROT_WANDER //and demonstrate your amazing obstical avoidance AI
walk_to(src, parrot_perch, 1, parrot_speed)
return
//-----FLEEING
@@ -387,10 +448,9 @@
if(!parrot_interest || !isliving(parrot_interest)) //Sanity
parrot_state = PARROT_WANDER
var/oldloc = src.loc
step(src, get_step_away(src, parrot_interest))
if(src.loc == oldloc) //Check if the mob is stuck
parrot_state = PARROT_WANDER //and demonstrate your amazing obstical avoidance AI
walk_away(src, parrot_interest, 1, parrot_speed-parrot_been_shot)
parrot_been_shot--
return
//-----ATTACKING
else if(parrot_state == (PARROT_SWOOP | PARROT_ATTACK))
@@ -436,11 +496,8 @@
//Otherwise, fly towards the mob!
else
var/oldloc = src.loc
step_towards(src, get_step_towards(src,parrot_interest))
if(src.loc == oldloc) //Check if the mob is stuck
parrot_state = PARROT_WANDER //and demonstrate your amazing obstical avoidance AI
walk_to(src, parrot_interest, 1, parrot_speed)
return
//-----STATE MISHAP
else //This should not happen. If it does lets reset everything and try again
walk(src,0)
@@ -454,6 +511,11 @@
* Procs
*/
/mob/living/simple_animal/parrot/movement_delay()
if(client && parrot_state != "parrot_fly")
icon_state = "parrot_fly"
..()
/mob/living/simple_animal/parrot/proc/search_for_item()
for(var/atom/movable/AM in view(src))
for(var/path in desired_items)
@@ -509,29 +571,36 @@
return -1
if(held_item)
usr << "\red You are already holding the [held_item]"
src << "\red You are already holding the [held_item]"
return 1
for(var/obj/item/I in view(1,src))
for(var/path in desired_items)
//Make sure it's the proper item and we're not holding it
if(istype(I, path) && I.loc != src)
//If we have a perch and the item is sitting on it, continue
if(!client && parrot_perch && I.loc == parrot_perch)
continue
held_item = I
I.loc = src
visible_message("[src] grabs the [held_item]!", "\blue You grab the [held_item]!", "You hear the sounds of wings flapping furiously.")
return held_item
usr << "\red There is nothing of interest to take."
src << "\red There is nothing of interest to take."
return 0
/mob/living/simple_animal/parrot/proc/steal_from_mob()
set name = "Steal from mob"
set category = "Parrot"
set desc = "Steals an item right out of a person's hand!"
if(stat)
return -1
if(held_item)
usr << "\red You are already holding the [held_item]"
src << "\red You are already holding the [held_item]"
return 1
var/obj/item/stolen_item = null
@@ -551,9 +620,21 @@
visible_message("[src] grabs the [held_item] out of [C]'s hand!", "\blue You snag the [held_item] out of [C]'s hand!", "You hear the sounds of wings flapping furiously.")
return held_item
usr << "\red There is nothing of interest to take."
src << "\red There is nothing of interest to take."
return 0
/mob/living/simple_animal/parrot/verb/drop_held_item_player()
set name = "Drop held item"
set category = "Parrot"
set desc = "Drop the item you're holding."
if(stat)
return
src.drop_held_item()
return
/mob/living/simple_animal/parrot/proc/drop_held_item(var/drop_gently = 1)
set name = "Drop held item"
set category = "Parrot"
@@ -569,16 +650,36 @@
if(!drop_gently)
if(istype(held_item, /obj/item/weapon/grenade))
var/obj/item/weapon/grenade/G = held_item
G.loc = get_turf(src)
G.loc = src.loc
G.prime()
src << "You let go of the [held_item]!"
held_item = null
return 1
usr << "You drop the [held_item]."
src << "You drop the [held_item]."
held_item.loc = src.loc
held_item = null
return 1
/mob/living/simple_animal/parrot/proc/perch_player()
set name = "Sit"
set category = "Parrot"
set desc = "Sit on a nice comfy perch."
if(stat || !client)
return
if(icon_state == "parrot_fly")
for(var/atom/movable/AM in view(src,1))
for(var/perch_path in desired_perches)
if(istype(AM, perch_path))
src.loc = AM.loc
icon_state = "parrot_sit"
return
src << "\red There is no perch nearby to sit on."
return
/*
* Sub-types
*/
@@ -589,4 +690,5 @@
/mob/living/simple_animal/parrot/Poly/New()
ears = new /obj/item/device/radio/headset/headset_eng(src)
available_channels = list(":e")
..()
@@ -43,7 +43,10 @@
O.transfer_soul("SHADE", src, user)
else
if(O.force)
health -= 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]. ")
@@ -1,410 +1,435 @@
/mob/living/simple_animal
name = "animal"
icon = 'icons/mob/animal.dmi'
health = 20
maxHealth = 20
var/icon_living = ""
var/icon_dead = ""
var/icon_gib = null //We only try to show a gibbing animation if this exists.
var/list/speak = list()
var/list/speak_emote = list()// Emotes while speaking IE: Ian [emote], [text] -- Ian barks, "WOOF!". Spoken text is generated from the speak variable.
var/speak_chance = 0
var/list/emote_hear = list() //Hearable emotes
var/list/emote_see = list() //Unlike speak_emote, the list of things in this variable only show by themselves with no spoken text. IE: Ian barks, Ian yaps
var/turns_per_move = 1
var/turns_since_move = 0
universal_speak = 1
var/meat_amount = 0
var/meat_type
var/stop_automated_movement = 0 //Use this to temporarely stop random movement or to if you write special movement code for animals.
var/stop_automated_movement_when_pulled = 1 //When set to 1 this stops the animal from moving when someone is pulling it.
//Interaction
var/response_help = "You try to help"
var/response_disarm = "You try to disarm"
var/response_harm = "You try to hurt"
var/harm_intent_damage = 3
//Temperature effect
var/minbodytemp = 270
var/maxbodytemp = 370
var/heat_damage_per_tick = 3 //amount of damage applied if animal's body temperature is higher than maxbodytemp
var/cold_damage_per_tick = 2 //same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
//Atmos effect - Yes, you can make creatures that require plasma or co2 to survive. N2O is a trace gas and handled separately, hence why it isn't here. It'd be hard to add it. Hard and me don't mix (Yes, yes make all the dick jokes you want with that.) - Errorage
var/min_oxy = 5
var/max_oxy = 0 //Leaving something at 0 means it's off - has no maximum
var/min_tox = 0
var/max_tox = 1
var/min_co2 = 0
var/max_co2 = 5
var/min_n2 = 0
var/max_n2 = 0
var/unsuitable_atoms_damage = 2 //This damage is taken when atmos doesn't fit all the requirements above
//LETTING SIMPLE ANIMALS ATTACK? WHAT COULD GO WRONG. Defaults to zero so Ian can still be cuddly
var/melee_damage_lower = 0
var/melee_damage_upper = 0
var/attacktext = "attacks"
var/attack_sound = null
var/friendly = "nuzzles" //If the mob does no damage with it's attack
var/wall_smash = 0 //if they can smash walls
var/speed = 0 //LETS SEE IF I CAN SET SPEEDS FOR SIMPLE MOBS WITHOUT DESTROYING EVERYTHING. Higher speed is slower, negative speed is faster
/mob/living/simple_animal/New()
..()
verbs -= /mob/verb/observe
/mob/living/simple_animal/Login()
if(src && src.client)
src.client.screen = null
..()
/mob/living/simple_animal/Life()
//Health
if(stat == DEAD)
if(health > 0)
icon_state = icon_living
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
density = 1
return
if(health < 1)
Die()
if(health > maxHealth)
health = maxHealth
//Movement
if(!client && !stop_automated_movement)
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
turns_since_move++
if(turns_since_move >= turns_per_move)
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
Move(get_step(src,pick(cardinal)))
turns_since_move = 0
//Speaking
if(!client && speak_chance)
if(rand(0,200) < speak_chance)
if(speak && speak.len)
if((emote_hear && emote_hear.len) || (emote_see && emote_see.len))
var/length = speak.len
if(emote_hear && emote_hear.len)
length += emote_hear.len
if(emote_see && emote_see.len)
length += emote_see.len
var/randomValue = rand(1,length)
if(randomValue <= speak.len)
say(pick(speak))
else
randomValue -= speak.len
if(emote_see && randomValue <= emote_see.len)
emote(pick(emote_see),1)
else
emote(pick(emote_hear),2)
else
say(pick(speak))
else
if(!(emote_hear && emote_hear.len) && (emote_see && emote_see.len))
emote(pick(emote_see),1)
if((emote_hear && emote_hear.len) && !(emote_see && emote_see.len))
emote(pick(emote_hear),2)
if((emote_hear && emote_hear.len) && (emote_see && emote_see.len))
var/length = emote_hear.len + emote_see.len
var/pick = rand(1,length)
if(pick <= emote_see.len)
emote(pick(emote_see),1)
else
emote(pick(emote_hear),2)
//Atmos
var/atmos_suitable = 1
var/atom/A = src.loc
if(isturf(A))
var/turf/T = A
var/areatemp = T.temperature
if( abs(areatemp - bodytemperature) > 50 )
var/diff = areatemp - bodytemperature
diff = diff / 5
//world << "changed from [bodytemperature] by [diff] to [bodytemperature + diff]"
bodytemperature += diff
if(istype(T,/turf/simulated))
var/turf/simulated/ST = T
if(ST.air)
var/tox = ST.air.toxins
var/oxy = ST.air.oxygen
var/n2 = ST.air.nitrogen
var/co2 = ST.air.carbon_dioxide
if(min_oxy)
if(oxy < min_oxy)
atmos_suitable = 0
if(max_oxy)
if(oxy > max_oxy)
atmos_suitable = 0
if(min_tox)
if(tox < min_tox)
atmos_suitable = 0
if(max_tox)
if(tox > max_tox)
atmos_suitable = 0
if(min_n2)
if(n2 < min_n2)
atmos_suitable = 0
if(max_n2)
if(n2 > max_n2)
atmos_suitable = 0
if(min_co2)
if(co2 < min_co2)
atmos_suitable = 0
if(max_co2)
if(co2 > max_co2)
atmos_suitable = 0
//Atmos effect
if(bodytemperature < minbodytemp)
health -= cold_damage_per_tick
else if(bodytemperature > maxbodytemp)
health -= heat_damage_per_tick
if(!atmos_suitable)
health -= unsuitable_atoms_damage
/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/gib()
if(icon_gib)
flick(icon_gib, src)
if(meat_amount && meat_type)
for(var/i = 0; i < meat_amount; i++)
new meat_type(src.loc)
..()
/mob/living/simple_animal/say_quote(var/text)
if(speak_emote && speak_emote.len)
var/emote = pick(speak_emote)
if(emote)
return "[emote], \"[text]\""
return "says, \"[text]\"";
/mob/living/simple_animal/emote(var/act)
if(act)
if(act == "scream") act = "makes a loud and pained whimper" //ugly hack to stop animals screaming when crushed :P
for (var/mob/O in viewers(src, null))
O.show_message("<B>[src]</B> [act].")
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob)
if(M.melee_damage_upper == 0)
M.emote("[M.friendly] [src]")
else
if(M.attack_sound)
playsound(loc, M.attack_sound, 50, 1, 1)
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[M]</B> [M.attacktext] [src]!", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
health -= damage
/mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
if(!Proj) return
src.health -= Proj.damage
return 0
/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M as mob)
..()
switch(M.a_intent)
if("help")
if (health > 0)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\blue [M] [response_help] [src]")
if("grab")
if (M == src)
return
if (nopush)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
if("hurt")
health -= harm_intent_damage
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\red [M] [response_harm] [src]")
if("disarm")
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\blue [M] [response_disarm] [src]")
return
/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
switch(M.a_intent)
if ("help")
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
if ("grab")
if(M == src)
return
if (nopush)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
if("hurt")
var/damage = rand(15, 30)
visible_message("\red <B>[M] has slashed at [src]!</B>")
src.health -= damage
if("disarm")
var/damage = rand(15, 30)
visible_message("\red <B>[M] has slashed at [src]!</B>")
src.health -= damage
return
/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L as mob)
switch(L.a_intent)
if("help")
visible_message("\blue [L] rubs it's head against [src]")
else
var/damage = rand(5, 10)
visible_message("\red <B>[L] bites [src]!</B>")
if(stat != DEAD)
src.health -= damage
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
/mob/living/simple_animal/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
if(istype(O, /obj/item/stack/medical))
if(stat != DEAD)
var/obj/item/stack/medical/MED = O
if(health < maxHealth)
if(MED.amount >= 1)
health = min(maxHealth, health + 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("\blue [user] applies the [MED] on [src]")
else
user << "\blue this [src] is dead, medical items won't bring it back to life."
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))
new meat_type (get_turf(src))
if(prob(95))
del(src)
return
gib()
else
if(O.force)
health -= O.force
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/movement_delay()
var/tally = 0 //Incase I need to add stuff other than "speed" later
tally = speed
return tally+config.animal_delay
/mob/living/simple_animal/Stat()
..()
statpanel("Status")
stat(null, "Health: [round((health / maxHealth) * 100)]%")
/mob/living/simple_animal/proc/Die()
living_mob_list -= src
dead_mob_list += src
icon_state = icon_dead
stat = DEAD
density = 0
return
/mob/living/simple_animal/ex_act(severity)
if(!blinded)
flick("flash", flash)
switch (severity)
if (1.0)
health -= 500
gib()
return
if (2.0)
health -= 60
if(3.0)
health -= 30
/mob/living/simple_animal/adjustBruteLoss(damage)
health -= damage
/mob/living/simple_animal
name = "animal"
icon = 'icons/mob/animal.dmi'
health = 20
maxHealth = 20
var/icon_living = ""
var/icon_dead = ""
var/icon_gib = null //We only try to show a gibbing animation if this exists.
var/list/speak = list()
var/list/speak_emote = list()// Emotes while speaking IE: Ian [emote], [text] -- Ian barks, "WOOF!". Spoken text is generated from the speak variable.
var/speak_chance = 0
var/list/emote_hear = list() //Hearable emotes
var/list/emote_see = list() //Unlike speak_emote, the list of things in this variable only show by themselves with no spoken text. IE: Ian barks, Ian yaps
var/turns_per_move = 1
var/turns_since_move = 0
universal_speak = 1
var/meat_amount = 0
var/meat_type
var/stop_automated_movement = 0 //Use this to temporarely stop random movement or to if you write special movement code for animals.
var/stop_automated_movement_when_pulled = 1 //When set to 1 this stops the animal from moving when someone is pulling it.
//Interaction
var/response_help = "You try to help"
var/response_disarm = "You try to disarm"
var/response_harm = "You try to hurt"
var/harm_intent_damage = 3
//Temperature effect
var/minbodytemp = 250
var/maxbodytemp = 350
var/heat_damage_per_tick = 3 //amount of damage applied if animal's body temperature is higher than maxbodytemp
var/cold_damage_per_tick = 2 //same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
//Atmos effect - Yes, you can make creatures that require plasma or co2 to survive. N2O is a trace gas and handled separately, hence why it isn't here. It'd be hard to add it. Hard and me don't mix (Yes, yes make all the dick jokes you want with that.) - Errorage
var/min_oxy = 5
var/max_oxy = 0 //Leaving something at 0 means it's off - has no maximum
var/min_tox = 0
var/max_tox = 1
var/min_co2 = 0
var/max_co2 = 5
var/min_n2 = 0
var/max_n2 = 0
var/unsuitable_atoms_damage = 2 //This damage is taken when atmos doesn't fit all the requirements above
//LETTING SIMPLE ANIMALS ATTACK? WHAT COULD GO WRONG. Defaults to zero so Ian can still be cuddly
var/melee_damage_lower = 0
var/melee_damage_upper = 0
var/attacktext = "attacks"
var/attack_sound = null
var/friendly = "nuzzles" //If the mob does no damage with it's attack
var/wall_smash = 0 //if they can smash walls
var/speed = 0 //LETS SEE IF I CAN SET SPEEDS FOR SIMPLE MOBS WITHOUT DESTROYING EVERYTHING. Higher speed is slower, negative speed is faster
/mob/living/simple_animal/New()
..()
verbs -= /mob/verb/observe
/mob/living/simple_animal/Login()
if(src && src.client)
src.client.screen = null
..()
/mob/living/simple_animal/updatehealth()
return
/mob/living/simple_animal/Life()
//Health
if(stat == DEAD)
if(health > 0)
icon_state = icon_living
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
density = 1
return 0
if(health < 1)
Die()
if(health > maxHealth)
health = maxHealth
if(stunned)
AdjustStunned(-1)
if(weakened)
AdjustWeakened(-1)
if(paralysis)
AdjustParalysis(-1)
//Movement
if(!client && !stop_automated_movement)
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
turns_since_move++
if(turns_since_move >= turns_per_move)
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
Move(get_step(src,pick(cardinal)))
turns_since_move = 0
//Speaking
if(!client && speak_chance)
if(rand(0,200) < speak_chance)
if(speak && speak.len)
if((emote_hear && emote_hear.len) || (emote_see && emote_see.len))
var/length = speak.len
if(emote_hear && emote_hear.len)
length += emote_hear.len
if(emote_see && emote_see.len)
length += emote_see.len
var/randomValue = rand(1,length)
if(randomValue <= speak.len)
say(pick(speak))
else
randomValue -= speak.len
if(emote_see && randomValue <= emote_see.len)
emote(pick(emote_see),1)
else
emote(pick(emote_hear),2)
else
say(pick(speak))
else
if(!(emote_hear && emote_hear.len) && (emote_see && emote_see.len))
emote(pick(emote_see),1)
if((emote_hear && emote_hear.len) && !(emote_see && emote_see.len))
emote(pick(emote_hear),2)
if((emote_hear && emote_hear.len) && (emote_see && emote_see.len))
var/length = emote_hear.len + emote_see.len
var/pick = rand(1,length)
if(pick <= emote_see.len)
emote(pick(emote_see),1)
else
emote(pick(emote_hear),2)
//Atmos
var/atmos_suitable = 1
var/atom/A = src.loc
if(isturf(A))
var/turf/T = A
var/areatemp = T.temperature
if( abs(areatemp - bodytemperature) > 40 )
var/diff = areatemp - bodytemperature
diff = diff / 5
//world << "changed from [bodytemperature] by [diff] to [bodytemperature + diff]"
bodytemperature += diff
if(istype(T,/turf/simulated))
var/turf/simulated/ST = T
if(ST.air)
var/tox = ST.air.toxins
var/oxy = ST.air.oxygen
var/n2 = ST.air.nitrogen
var/co2 = ST.air.carbon_dioxide
if(min_oxy)
if(oxy < min_oxy)
atmos_suitable = 0
if(max_oxy)
if(oxy > max_oxy)
atmos_suitable = 0
if(min_tox)
if(tox < min_tox)
atmos_suitable = 0
if(max_tox)
if(tox > max_tox)
atmos_suitable = 0
if(min_n2)
if(n2 < min_n2)
atmos_suitable = 0
if(max_n2)
if(n2 > max_n2)
atmos_suitable = 0
if(min_co2)
if(co2 < min_co2)
atmos_suitable = 0
if(max_co2)
if(co2 > max_co2)
atmos_suitable = 0
//Atmos effect
if(bodytemperature < minbodytemp)
health -= cold_damage_per_tick
else if(bodytemperature > maxbodytemp)
health -= heat_damage_per_tick
if(!atmos_suitable)
health -= 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/gib()
if(icon_gib)
flick(icon_gib, src)
if(meat_amount && meat_type)
for(var/i = 0; i < meat_amount; i++)
new meat_type(src.loc)
..()
/mob/living/simple_animal/say_quote(var/text)
if(speak_emote && speak_emote.len)
var/emote = pick(speak_emote)
if(emote)
return "[emote], \"[text]\""
return "says, \"[text]\"";
/mob/living/simple_animal/emote(var/act)
if(act)
if(act == "scream") act = "makes a loud and pained whimper" //ugly hack to stop animals screaming when crushed :P
for (var/mob/O in viewers(src, null))
O.show_message("<B>[src]</B> [act].")
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob)
if(M.melee_damage_upper == 0)
M.emote("[M.friendly] [src]")
else
if(M.attack_sound)
playsound(loc, M.attack_sound, 50, 1, 1)
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[M]</B> [M.attacktext] [src]!", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
health -= damage
/mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
if(!Proj) return
src.health -= Proj.damage
return 0
/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M as mob)
..()
switch(M.a_intent)
if("help")
if (health > 0)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\blue [M] [response_help] [src]")
if("grab")
if (M == src)
return
if (nopush)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
if("hurt")
health -= harm_intent_damage
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\red [M] [response_harm] [src]")
if("disarm")
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\blue [M] [response_disarm] [src]")
return
/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
switch(M.a_intent)
if ("help")
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
if ("grab")
if(M == src)
return
if (nopush)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
if("hurt")
var/damage = rand(15, 30)
visible_message("\red <B>[M] has slashed at [src]!</B>")
src.health -= damage
if("disarm")
var/damage = rand(15, 30)
visible_message("\red <B>[M] has slashed at [src]!</B>")
src.health -= damage
return
/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L as mob)
switch(L.a_intent)
if("help")
visible_message("\blue [L] rubs it's head against [src]")
else
var/damage = rand(5, 10)
visible_message("\red <B>[L] bites [src]!</B>")
if(stat != DEAD)
src.health -= damage
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
/mob/living/simple_animal/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
if(istype(O, /obj/item/stack/medical))
if(stat != DEAD)
var/obj/item/stack/medical/MED = O
if(health < maxHealth)
if(MED.amount >= 1)
health = min(maxHealth, health + 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("\blue [user] applies the [MED] on [src]")
else
user << "\blue this [src] is dead, medical items won't bring it back to life."
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))
new meat_type (get_turf(src))
if(prob(95))
del(src)
return
gib()
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/movement_delay()
var/tally = 0 //Incase I need to add stuff other than "speed" later
tally = speed
return tally+config.animal_delay
/mob/living/simple_animal/Stat()
..()
statpanel("Status")
stat(null, "Health: [round((health / maxHealth) * 100)]%")
/mob/living/simple_animal/proc/Die()
living_mob_list -= src
dead_mob_list += src
icon_state = icon_dead
stat = DEAD
density = 0
return
/mob/living/simple_animal/ex_act(severity)
if(!blinded)
flick("flash", flash)
switch (severity)
if (1.0)
health -= 500
gib()
return
if (2.0)
health -= 60
if(3.0)
health -= 30
/mob/living/simple_animal/adjustBruteLoss(damage)
health -= damage
/mob/living/simple_animal/proc/SA_attackable(target_mob)
if (isliving(target_mob))
var/mob/living/L = target_mob
if(!L.stat)
return (0)
if (istype(target_mob,/obj/mecha))
var/obj/mecha/M = target_mob
if (M.occupant)
return (0)
return (1)
@@ -0,0 +1,297 @@
#define SYNDICATE_STANCE_IDLE 1
#define SYNDICATE_STANCE_ATTACK 2
#define SYNDICATE_STANCE_ATTACKING 3
/mob/living/simple_animal/syndicate
name = "Syndicate Operative"
desc = "Death to Nanotrasen."
icon_state = "syndicate"
icon_living = "syndicate"
icon_dead = "syndicate_dead"
icon_gib = "syndicate_gib"
speak_chance = 0
turns_per_move = 5
response_help = "pokes the"
response_disarm = "shoves the"
response_harm = "hits the"
speed = -1
stop_automated_movement_when_pulled = 0
maxHealth = 100
health = 100
var/ranged = 0
var/target
var/rapid = 0
harm_intent_damage = 5
melee_damage_lower = 10
melee_damage_upper = 10
attacktext = "punches"
a_intent = "harm"
var/corpse = /obj/effect/landmark/corpse/syndicatesoldier
var/weapon1
var/weapon2
min_oxy = 5
max_oxy = 0
min_tox = 0
max_tox = 1
min_co2 = 0
max_co2 = 5
min_n2 = 0
max_n2 = 0
unsuitable_atoms_damage = 15
wall_smash = 1
var/stance = SYNDICATE_STANCE_IDLE //Used to determine behavior
var/mob/living/target_mob
/mob/living/simple_animal/syndicate/Life()
..()
if(stat == 2)
new corpse (src.loc)
if(weapon1)
new weapon1 (src.loc)
if(weapon2)
new weapon2 (src.loc)
del src
return
for(dir in list(NORTH,EAST,SOUTH,WEST))
var/obj/structure/obstacle = locate(/obj/structure, get_step(src, dir))
if(istype(obstacle, /obj/structure/window) || istype(obstacle, /obj/structure/closet) || istype(obstacle, /obj/structure/table) || istype(obstacle, /obj/structure/grille))
obstacle.attack_animal(src)
if(health < 1)
Die()
if(health > maxHealth)
health = maxHealth
if(!ckey && !stop_automated_movement)
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
turns_since_move++
if(turns_since_move >= turns_per_move)
if(!(stop_automated_movement_when_pulled && pulledby))
Move(get_step(src,pick(cardinal)))
turns_since_move = 0
if(!stat)
switch(stance)
if(SYNDICATE_STANCE_IDLE)
stop_automated_movement = 0
for(var/atom/A in view(7,src))
if(isSyndicate(A))
continue
if(isliving(A))
var/mob/living/L = A
if(!L.stat)
stance = SYNDICATE_STANCE_ATTACK
target_mob = L
break
if(istype(A, /obj/mecha))
var/obj/mecha/M = A
if (M.occupant)
stance = SYNDICATE_STANCE_ATTACK
target_mob = M
break
if(SYNDICATE_STANCE_ATTACK) //This one should only be active for one tick
stop_automated_movement = 1
if(!target_mob || SA_attackable(target_mob))
stance = SYNDICATE_STANCE_IDLE
if(target_mob in view(7, src))
if(ranged)
if(get_dist(src, target_mob) <= 6)
OpenFire(target_mob)
else
walk_to(src, target_mob, 1, 2)
else
walk_to(src, target_mob, 1, 2)
stance = SYNDICATE_STANCE_ATTACKING
if(SYNDICATE_STANCE_ATTACKING)
stop_automated_movement = 1
if(!target_mob || SA_attackable(target_mob))
stance = SYNDICATE_STANCE_IDLE
target_mob = null
return
if(!(target_mob in view(7, src)))
stance = SYNDICATE_STANCE_IDLE
target_mob = null
return
if(get_dist(src, target_mob) <= 1) //Attacking
if(isliving(target_mob))
var/mob/living/L = target_mob
L.attack_animal(src)
if(istype(target_mob,/obj/mecha))
var/obj/mecha/M = target_mob
M.attack_animal(src)
/mob/living/simple_animal/syndicate/proc/OpenFire(target_mob)
src.target = target_mob
visible_message("\red <b>[src]</b> fires at [src.target]!", 1)
var/tturf = get_turf(target)
if(rapid)
spawn(1)
Shoot(tturf, src.loc, src)
new /obj/item/ammo_casing/a12mm(get_turf(src))
spawn(4)
Shoot(tturf, src.loc, src)
new /obj/item/ammo_casing/a12mm(get_turf(src))
spawn(6)
Shoot(tturf, src.loc, src)
new /obj/item/ammo_casing/a12mm(get_turf(src))
else
Shoot(tturf, src.loc, src)
new /obj/item/ammo_casing/a12mm(get_turf(src))
stance = SYNDICATE_STANCE_IDLE
target_mob = null
return
/mob/living/simple_animal/syndicate/proc/Shoot(var/target, var/start, var/user, var/bullet = 0)
if(target == start)
return
var/obj/item/projectile/bullet/midbullet2/A = new /obj/item/projectile/bullet/midbullet2(user:loc)
playsound(user, 'sound/weapons/Gunshot_smg.ogg', 100, 1)
if(!A) return
if (!istype(target, /turf))
del(A)
return
A.current = target
A.yo = target:y - start:y
A.xo = target:x - start:x
spawn( 0 )
A.process()
return
///////////////Sword and shield////////////
/mob/living/simple_animal/syndicate/melee
melee_damage_lower = 20
melee_damage_upper = 25
icon_state = "syndicatemelee"
icon_living = "syndicatemelee"
weapon1 = /obj/item/weapon/melee/energy/sword/red
weapon2 = /obj/item/weapon/shield/energy
attacktext = "slashes"
nopush = 1
/mob/living/simple_animal/syndicate/melee/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(O.force)
if(prob(80))
var/damage = O.force
if (O.damtype == HALLOSS)
damage = 0
health -= damage
visible_message("\red \b [src] has been attacked with the [O] by [user]. ")
else
visible_message("\red \b [src] blocks the [O] with its shield! ")
else
usr << "\red This weapon is ineffective, it does no damage."
visible_message("\red [user] gently taps [src] with the [O]. ")
/mob/living/simple_animal/syndicate/melee/bullet_act(var/obj/item/projectile/Proj)
if(!Proj) return
if(prob(65))
src.health -= Proj.damage
else
visible_message("\red <B>[src] blocks [Proj] with its shield!</B>")
return 0
/mob/living/simple_animal/syndicate/melee/space
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
minbodytemp = 0
icon_state = "syndicatemeleespace"
icon_living = "syndicatemeleespace"
name = "Syndicate Commando"
corpse = /obj/effect/landmark/corpse/syndicatecommando
speed = 0
/mob/living/simple_animal/syndicate/melee/space/Process_Spacemove(var/check_drift = 0)
return
/mob/living/simple_animal/syndicate/ranged
ranged = 1
rapid = 1
icon_state = "syndicateranged"
icon_living = "syndicateranged"
weapon1 = /obj/item/weapon/gun/projectile/automatic/c20r
/mob/living/simple_animal/syndicate/ranged/space
icon_state = "syndicaterangedpsace"
icon_living = "syndicaterangedpsace"
name = "Syndicate Commando"
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
minbodytemp = 0
corpse = /obj/effect/landmark/corpse/syndicatecommando
speed = 0
/mob/living/simple_animal/syndicate/ranged/space/Process_Spacemove(var/check_drift = 0)
return
/mob/living/simple_animal/syndicate/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(5))
src << "\red <B>You fail to push [tmob]'s fat ass out of the way.</B>"
now_pushing = 0
return
if(tmob.nopush)
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))
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
return
step(AM, t)
now_pushing = null
return
return
@@ -1,21 +0,0 @@
/mob/living/simple_animal/corgi/regenerate_icons()
overlays = list()
if(inventory_head)
var/head_icon_state = inventory_head.icon_state
if(health <= 0)
head_icon_state += "2"
var/icon/head_icon = icon('icons/mob/corgi_head.dmi',head_icon_state)
if(head_icon)
overlays += head_icon
if(inventory_back)
var/back_icon_state = inventory_back.icon_state
if(health <= 0)
back_icon_state += "2"
var/icon/back_icon = icon('icons/mob/corgi_back.dmi',back_icon_state)
if(back_icon)
overlays += back_icon
return
+1 -1
View File
@@ -35,7 +35,7 @@
client.images = null //remove the images such as AIs being unable to see runes
client.screen = null //remove hud items just in case
if(hud_used) del(hud_used) //remove the hud objects
hud_used = new/obj/hud( src )
hud_used = new /datum/hud(src)
if(!dna)
dna = new /datum/dna(null)
+51 -8
View File
@@ -327,6 +327,31 @@ var/list/slot_equipment_priority = list( \
if (popup)
memory()
/mob/proc/update_flavor_text()
set src in usr
if(usr != src)
usr << "No."
var/msg = input(usr,"Set the flavor text in your 'examine' verb. Can also be used for OOC notes about your character.","Flavor Text",html_decode(flavor_text)) as message|null
if(msg != null)
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
flavor_text = msg
/mob/proc/warn_flavor_changed()
if(flavor_text && flavor_text != "") // don't spam people that don't use it!
src << "<h2 class='alert'>OOC Warning:</h2>"
src << "<span class='alert'>Your flavor text is likely out of date! <a href='byond://?src=\ref[src];flavor_change=1'>Change</a></span>"
/mob/proc/print_flavor_text()
if (flavor_text && flavor_text != "")
var/msg = dd_replacetext(flavor_text, "\n", " ")
if(lentext(msg) <= 40)
return "\blue [msg]"
else
return "\blue [copytext(msg, 1, 37)]... <a href='byond://?src=\ref[src];flavor_more=1'>More...</a>"
/*
/mob/verb/help()
set name = "Help"
@@ -372,10 +397,7 @@ var/list/slot_equipment_priority = list( \
if(!client)
log_game("[usr.key] AM failed due to disconnect.")
return
for(var/obj/screen/t in usr.client.screen)
if (t.loc == null)
//t = null
del(t)
client.screen.Cut()
if(!client)
log_game("[usr.key] AM failed due to disconnect.")
return
@@ -408,6 +430,7 @@ var/list/slot_equipment_priority = list( \
'html/wrench-screwdriver.png',
'html/spell-check.png',
'html/burn-exclamation.png',
'html/tg-notif.png',
'html/chevron.png',
'html/chevron-expand.png',
'html/changelog.css',
@@ -537,10 +560,27 @@ var/list/slot_equipment_priority = list( \
var/t1 = text("window=[href_list["mach_close"]]")
machine = null
src << browse(null, t1)
if(href_list["flavor_more"])
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", name, dd_replacetext(flavor_text, "\n", "<BR>")), text("window=[];size=500x200", name))
onclose(usr, "[name]")
if(href_list["flavor_change"])
update_flavor_text()
// ..()
return
/mob/proc/pull_damage()
if(ishuman(src))
var/mob/living/carbon/human/H = src
if(H.health - H.halloss <= config.health_threshold_crit)
for(var/name in H.organs_by_name)
var/datum/organ/external/e = H.organs_by_name[name]
if((H.lying) && ((e.status & ORGAN_BROKEN && !(e.status & ORGAN_SPLINTED)) || e.status & ORGAN_BLEEDING) && (H.getBruteLoss() + H.getFireLoss() >= 100))
return 1
break
return 0
/mob/MouseDrop(mob/M as mob)
..()
if(M != usr) return
@@ -747,15 +787,15 @@ note dizziness decrements automatically in the mob's Life() proc.
lying = 0
else
lying = 1
else if( stat || weakened || paralysis || resting || sleeping || (status_flags & FAKEDEATH) )
else if( stat || weakened || paralysis || resting || sleeping || (status_flags & FAKEDEATH))
lying = 1
canmove = 0
else if( stunned )
// lying = 0
canmove = 0
else
lying = 0
canmove = 1
lying = !can_stand
canmove = has_limbs
if(lying)
density = 0
@@ -894,5 +934,8 @@ note dizziness decrements automatically in the mob's Life() proc.
return 1
return 0
mob/proc/flash_weak_pain()
/mob/proc/get_species()
return ""
/mob/proc/flash_weak_pain()
flick("weak_pain",pain)
+7 -3
View File
@@ -3,7 +3,11 @@
Put (mob/proc)s here that are in dire need of a code cleanup.
*/
/mob/living/proc/has_disease(var/datum/disease/virus)
for(var/datum/disease/D in viruses)
if(istype(D, virus))
return 1
return 0
// This proc has some procs that should be extracted from it. I believe we can develop some helper procs from it - Rockdtben
/mob/proc/contract_disease(var/datum/disease/virus, var/skip_this = 0, var/force_species_check=1)
@@ -38,7 +42,7 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
v.affected_mob = src
v.strain_data = v.strain_data.Copy()
v.holder = src
if(prob(5))
if(v.can_carry && prob(5))
v.carrier = 1
return
@@ -190,7 +194,7 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
v.affected_mob = src
v.strain_data = v.strain_data.Copy()
v.holder = src
if(prob(5))
if(v.can_carry && prob(5))
v.carrier = 1
return
return
+11 -6
View File
@@ -2,7 +2,7 @@
density = 1
layer = 4.0
animate_movement = 2
flags = NOREACT
// flags = NOREACT
var/datum/mind/mind
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
@@ -14,9 +14,6 @@
var/obj/screen/flash = null
var/obj/screen/blind = null
var/obj/screen/hands = null
var/obj/screen/mach = null
var/obj/screen/sleep = null
var/obj/screen/rest = null
var/obj/screen/pullin = null
var/obj/screen/internals = null
var/obj/screen/oxygen = null
@@ -63,9 +60,12 @@
var/ear_deaf = null //Carbon
var/ear_damage = null //Carbon
var/stuttering = null //Carbon
var/slurring = null
var/slurring = null //Carbon
var/real_name = null
// var/original_name = null //Original name is only used in ghost chat! Depracated, now used bb
var/flavor_text = ""
var/med_record = ""
var/sec_record = ""
var/blinded = null
var/bhunger = 0 //Carbon
var/ajourn = 0
@@ -124,7 +124,7 @@
var/seer = 0 //for cult//Carbon, probably Human
var/obj/hud/hud_used = null
var/datum/hud/hud_used = null
//var/list/organs = list( ) //moved to human.
var/list/grabbed_by = list( )
@@ -224,3 +224,8 @@
var/tajaran_talk_understand = 0
var/soghun_talk_understand = 0
var/skrell_talk_understand = 0
var/has_limbs = 1 //Whether this mob have any limbs he can move with
var/can_stand = 1 //Whether this mob have ability to stand
var/immune_to_ssd = 0
+7 -1
View File
@@ -112,6 +112,12 @@
killing = 0
hud1.icon_state = "disarm/kill"
return
if(ishuman(affecting))
var/mob/living/carbon/human/H = affecting
var/datum/organ/external/head = H.get_organ("head")
head.add_autopsy_data("Strangulation", 0)
affecting.Weaken(5) // Should keep you down unless you get help.
affecting.Stun(5) // It will hamper your voice, being choked and all.
affecting.losebreath = min(affecting.losebreath + 2, 3)
@@ -293,4 +299,4 @@
/obj/item/weapon/grab/Del()
del(hud1)
..()
return
return
+66 -85
View File
@@ -66,12 +66,17 @@
return 0
/proc/isbear(A)
if(istype(A, /mob/living/simple_animal/bear))
if(istype(A, /mob/living/simple_animal/hostile/bear))
return 1
return 0
/proc/iscarp(A)
if(istype(A, /mob/living/simple_animal/carp))
if(istype(A, /mob/living/simple_animal/hostile/carp))
return 1
return 0
/proc/isSyndicate(A)
if(istype(A, /mob/living/simple_animal/syndicate))
return 1
return 0
@@ -121,38 +126,24 @@ proc/hasorgans(A)
/proc/hsl2rgb(h, s, l)
return
/proc/istajaran(A)
if(istype(A, /mob/living/carbon/human))
var/mob/living/carbon/human/M = A
if(M.dna.mutantrace == "tajaran")
return 1
return 0
/proc/issoghun(A)
if(istype(A, /mob/living/carbon/human))
var/mob/living/carbon/human/M = A
if(M.dna.mutantrace == "lizard")
return 1
return 0
/proc/isskrell(A)
if(istype(A, /mob/living/carbon/human))
var/mob/living/carbon/human/M = A
if(M.dna.mutantrace == "skrell")
return 1
return 0
/proc/check_zone(zone)
if(!zone)
return "chest"
if(!zone) return "chest"
switch(zone)
if("eyes")
zone = "head"
if("mouth")
zone = "head"
// if("groin")
// zone = "chest"
if("l_hand")
zone = "l_arm"
if("r_hand")
zone = "r_arm"
if("l_foot")
zone = "l_leg"
if("r_foot")
zone = "r_leg"
if("groin")
zone = "chest"
return zone
@@ -181,7 +172,7 @@ proc/hasorgans(A)
else
if (pr >= 100)
return n
var/te = html_decode(n)
var/te = n
var/t = ""
n = length(n)
var/p = null
@@ -192,44 +183,7 @@ proc/hasorgans(A)
else
t = text("[]*", t)
p++
return html_encode(t)
/*proc/NewStutter(phrase,stunned)
phrase = html_decode(phrase)
var/list/split_phrase = dd_text2list(phrase," ") //Split it up into words.
var/list/unstuttered_words = split_phrase.Copy()
var/i = rand(1,3)
if(stunned) i = split_phrase.len
for(,i > 0,i--) //Pick a few words to stutter on.
if (!unstuttered_words.len)
break
var/word = pick(unstuttered_words)
unstuttered_words -= word //Remove from unstuttered words so we don't stutter it again.
var/index = split_phrase.Find(word) //Find the word in the split phrase so we can replace it.
//Search for dipthongs (two letters that make one sound.)
var/first_sound = copytext(word,1,3)
var/first_letter = copytext(word,1,2)
if(lowertext(first_sound) in list("ch","th","sh"))
first_letter = first_sound
//Repeat the first letter to create a stutter.
var/rnum = rand(1,3)
switch(rnum)
if(1)
word = "[first_letter]-[word]"
if(2)
word = "[first_letter]-[first_letter]-[word]"
if(3)
word = "[first_letter]-[word]"
split_phrase[index] = word
return sanitize(dd_list2text(split_phrase," "))*/
return t
proc/slur(phrase)
phrase = html_decode(phrase)
@@ -248,9 +202,9 @@ proc/slur(phrase)
if(1,3,5,8) newletter="[lowertext(newletter)]"
if(2,4,6,15) newletter="[uppertext(newletter)]"
if(7) newletter+="'"
if(9,10) newletter="<b>[newletter]</b>"
if(11,12) newletter="<big>[newletter]</big>"
if(13) newletter="<small>[newletter]</small>"
//if(9,10) newletter="<b>[newletter]</b>"
//if(11,12) newletter="<big>[newletter]</big>"
//if(13) newletter="<small>[newletter]</small>"
newphrase+="[newletter]";counter-=1
return newphrase
@@ -355,15 +309,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
return 0
/mob/proc/abiotic2(var/full_body2 = 0)
if(full_body2 && ((l_hand && !( l_hand.abstract )) || (r_hand && !( r_hand.abstract )) || (back || wear_mask)))
return 1
if((l_hand && !( l_hand.abstract )) || (r_hand && !( r_hand.abstract )))
return 1
return 0
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
/mob/verb/button_pressed_F12()
set name = "F12"
@@ -415,12 +360,48 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
else
usr << "\red This mob type does not use a HUD."
/mob/proc/is_player_active()
if(!src.client) return 0
if(src.client.inactivity > 10 * 60 * 10) return 0
if(src.stat == 2) return 0
//converts intent-strings into numbers and back
var/list/intents = list("help","disarm","grab","hurt")
/proc/intent_numeric(argument)
if(istext(argument))
switch(argument)
if("help") return 0
if("disarm") return 1
if("grab") return 2
else return 3
else
switch(argument)
if(0) return "help"
if(1) return "disarm"
if(2) return "grab"
else return "hurt"
return 1
//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)
set name = "a-intent"
set hidden = 1
/mob/proc/get_species()
return
if(ishuman(src) || istype(src,/mob/living/carbon/alien/humanoid))
switch(input)
if("help","disarm","grab","hurt")
a_intent = input
if("right")
a_intent = intent_numeric((intent_numeric(a_intent)+1) % 4)
if("left")
a_intent = intent_numeric((intent_numeric(a_intent)+3) % 4)
if(hud_used && hud_used.action_intent)
hud_used.action_intent.icon_state = "intent_[a_intent]"
else if(isrobot(src) || ismonkey(src) || islarva(src))
switch(input)
if("help")
a_intent = "help"
if("hurt")
a_intent = "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"
else
hud_used.action_intent.icon_state = "help"
+5 -52
View File
@@ -57,51 +57,6 @@
usr << "\red This mob type cannot drop items."
return
//This gets called when you press the insert button.
/client/verb/insert_key_pressed()
set hidden = 1
if(!src.mob)
return
var/mob/M = src.mob
if(ishuman(M) || ismonkey(M) || istype(M,/mob/living/carbon/alien/humanoid) || islarva(M))
switch(M.a_intent)
if("help")
usr.a_intent = "disarm"
usr.hud_used.action_intent.icon_state = "disarm"
usr.hud_used.hurt_intent.icon_state = "harm_small"
usr.hud_used.help_intent.icon_state = "help_small"
usr.hud_used.grab_intent.icon_state = "grab_small"
usr.hud_used.disarm_intent.icon_state = "disarm_small_active"
if("disarm")
usr.a_intent = "grab"
usr.hud_used.action_intent.icon_state = "grab"
usr.hud_used.hurt_intent.icon_state = "harm_small"
usr.hud_used.help_intent.icon_state = "help_small"
usr.hud_used.grab_intent.icon_state = "grab_small_active"
usr.hud_used.disarm_intent.icon_state = "disarm_small"
if("grab")
usr.a_intent = "hurt"
usr.hud_used.action_intent.icon_state = "harm"
usr.hud_used.hurt_intent.icon_state = "harm_small_active"
usr.hud_used.help_intent.icon_state = "help_small"
usr.hud_used.grab_intent.icon_state = "grab_small"
usr.hud_used.disarm_intent.icon_state = "disarm_small"
if("hurt")
usr.a_intent = "help"
usr.hud_used.action_intent.icon_state = "help"
usr.hud_used.hurt_intent.icon_state = "harm_small"
usr.hud_used.help_intent.icon_state = "help_small_active"
usr.hud_used.grab_intent.icon_state = "grab_small"
usr.hud_used.disarm_intent.icon_state = "disarm_small"
else if(isrobot(usr))
if(usr.a_intent == "help")
usr.a_intent = "hurt"
usr.hud_used.action_intent.icon_state = "harm"
else
usr.a_intent = "help"
usr.hud_used.action_intent.icon_state = "help"
//This gets called when you press the delete button.
/client/verb/delete_key_pressed()
set hidden = 1
@@ -279,9 +234,7 @@
if(moving) return 0
if(move_delay >= 864000) move_delay -= 864000
if(world.timeofday < move_delay) return
if(world.time < move_delay) return
if(!mob) return
@@ -330,7 +283,7 @@
src << "\blue You're restrained! You can't move!"
return 0
move_delay = world.timeofday//set move delay
move_delay = world.time//set move delay
switch(mob.m_intent)
if("run")
@@ -353,7 +306,7 @@
moving = 1
//Something with pulling things
if(locate(/obj/item/weapon/grab, mob))
move_delay = max(move_delay, world.timeofday + 7)
move_delay = max(move_delay, world.time + 7)
var/list/L = mob.ret_grab()
if(istype(L, /list))
if(L.len == 2)
@@ -411,12 +364,12 @@
for(var/obj/item/weapon/grab/G in mob.grabbed_by)
if((G.state == 1)&&(!grabbing.Find(G.assailant))) del(G)
if(G.state == 2)
move_delay = world.timeofday + 10
move_delay = world.time + 10
if(!prob(25)) return 1
mob.visible_message("\red [mob] has broken free of [G.assailant]'s grip!")
del(G)
if(G.state == 3)
move_delay = world.timeofday + 10
move_delay = world.time + 10
if(!prob(5)) return 1
mob.visible_message("\red [mob] has broken free of [G.assailant]'s headlock!")
del(G)
+1 -1
View File
@@ -1,3 +1,3 @@
/obj/hud/proc/unplayer_hud()
/datum/hud/proc/unplayer_hud()
return
+85 -91
View File
@@ -6,6 +6,7 @@
var/spawning = 0//Referenced when you want to delete the new_player later on in the code.
var/totalPlayers = 0 //Player counts for the Lobby tab
var/totalPlayersReady = 0
universal_speak = 1
invisibility = 101
@@ -53,7 +54,7 @@
var/isadmin = 0
if(src.client && src.client.holder)
isadmin = 1
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM erro_poll_vote WHERE ckey = \"[ckey]\")")
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM erro_poll_vote WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM erro_poll_textreply WHERE ckey = \"[ckey]\")")
query.Execute()
var/newpoll = 0
while(query.NextRow())
@@ -83,24 +84,33 @@
break
//shh ;)
var/music = ticker.login_music
if(ckey == "cajoes")
music = 'sound/music/dangerzone.ogg'
else if(ckey == "duntada")
music = 'sound/music/you_are_likely_to_be_eaten.ogg'
else if(ckey == "misterbook")
music = 'sound/music/dinosaur.ogg'
else if(ckey == "chinsky")
music = 'sound/music/soviet_anthem.ogg'
else if(ckey == "abi79")
music = 'sound/music/spinmeround.ogg'
else if(ckey == "mloc")
music = 'sound/music/cantina1_short.ogg'
else if(ckey == "applemaster")
music = 'sound/music/elektronik_supersonik.ogg'
else if(ckey == "wrongnumber")
music = 'sound/music/greenthumb.ogg'
src << sound(music, repeat = 0, wait = 0, volume = 85, channel = 1) //MAD JAMZ
switch(src.key)
if("caelaislinn")
src << sound('sound/music/drive_me_closer.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("daneesh")
src << sound('sound/music/ill_make_a_man_out_of_you.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("doughnuts")
src << sound('sound/music/ultimate_showdown.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("themij")
src << sound('sound/music/pegasus.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("searif")
src << sound('sound/music/pegasus.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("danny220")
src << sound('sound/music/dirty_hands.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("sparklysheep")
src << sound('sound/music/dirty_hands.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("pobiega")
src << sound('sound/music/the_gabber_robots.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("chinsky")
src << sound('sound/music/cotton_eye_joe.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("russkisam")
src << sound('sound/music/elektronik_supersonik.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("duntadaman")
src << sound('sound/music/spinmeround.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
if("misterbook")
src << sound('sound/music/down_with_the_sickness.ogg', repeat = 0, wait = 0, volume = 85, channel = 1)
else
src << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS
proc/Stopmusic()
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jamsz
@@ -137,24 +147,7 @@
return 1
if(href_list["ready"])
var/num_old_slots = GetAvailableAlienPlayerSlots()
var/new_slots = num_old_slots
if(!ready)
if(num_old_slots >= 1 || preferences.species == "Human")
ready = 1
new_slots = GetAvailableAlienPlayerSlots()
else
src << "\red Unable to declare ready. Too many players have already elected to play as aliens."
else
ready = 0
new_slots = GetAvailableAlienPlayerSlots()
if(num_old_slots < 1 && new_slots >= 1)
for(var/mob/new_player/N in world)
N << "\blue A new alien player slot has opened."
else if(num_old_slots >= 1 && new_slots < 1)
for(var/mob/new_player/N in world)
N << "\red New alien players can no longer enter the game."
ready = !ready
if(href_list["refresh"])
src << browse(null, "window=playersetup") //closes the player setup window
@@ -188,15 +181,13 @@
if(href_list["late_join"])
if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
usr << "/red The round is either not ready, or has already finished..."
usr << "\red The round is either not ready, or has already finished..."
return
if(preferences.species != "Human")
if(!is_alien_whitelisted(src, preferences.species) && config.usealienwhitelist)
src << alert("You are currently not whitelisted to play [preferences.species].")
return 0
else if(GetAvailableAlienPlayerSlots() >= 1)
src << "\red Unable to join game. Too many players have already joined as aliens."
LateChoices()
@@ -302,13 +293,35 @@
src.poll_player(pollid)
return
if(href_list["votepollid"] && href_list["voteoptionid"])
usr << "\red DB usage has been disabled and that option should not have been available."
return
if(href_list["votepollid"] && href_list["votetype"])
var/pollid = text2num(href_list["votepollid"])
var/optionid = text2num(href_list["voteoptionid"])
vote_on_poll(pollid, optionid)
var/votetype = href_list["votetype"]
switch(votetype)
if("OPTION")
var/optionid = text2num(href_list["voteoptionid"])
vote_on_poll(pollid, optionid)
if("TEXT")
var/replytext = href_list["replytext"]
log_text_poll_reply(pollid, replytext)
if("NUMVAL")
var/id_min = text2num(href_list["minid"])
var/id_max = text2num(href_list["maxid"])
if( (id_max - id_min) > 100 ) //Basic exploit prevention
usr << "The option ID difference is too big. Please contact administration or the database admin."
return
for(var/optionid = id_min; optionid<= id_max; optionid++)
if(!isnull(href_list["o[optionid]"])) //Test if this optionid was replied to
var/rating
if(href_list["o[optionid]"] == "abstain")
rating = null
else
rating = text2num(href_list["o[optionid]"])
if(!isnum(rating))
return
vote_on_numval_poll(pollid, optionid, rating)
proc/IsJobAvailable(rank)
var/datum/job/job = job_master.GetJob(rank)
@@ -323,36 +336,29 @@
src << alert("[rank] is not available. Please try another.")
return 0
var/num_old_slots = GetAvailableAlienPlayerSlots()
var/new_slots = num_old_slots
if(preferences.species != "Human")
if(!is_alien_whitelisted(src, preferences.species) && config.usealienwhitelist)
src << alert("You are currently not whitelisted to play [preferences.species].")
return 0
else if(num_old_slots < 1)
src << "\red Unable to join game. Too many players have already joined as aliens."
return 0
job_master.AssignRole(src, rank, 1)
var/mob/living/carbon/human/character = create_character() //creates the human and transfers vars and mind
job_master.EquipRank(character, rank, 1) //equips the human
EquipCustomItems(character)
character.loc = pick(latejoin)
character.lastarea = get_area(loc)
if(character.client)
character.client.be_syndicate = preferences.be_special
ticker.mode.latespawn(character)
if(character.mind.assigned_role != "Cyborg")
data_core.manifest_inject(character)
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
AnnounceArrival(character, rank)
new_slots = GetAvailableAlienPlayerSlots()
if(num_old_slots < 1 && new_slots >= 1)
for(var/mob/new_player/N in world)
N << "\blue A new alien player slot has opened."
else if(num_old_slots >= 1 && new_slots < 1)
for(var/mob/new_player/N in world)
N << "\red New alien players can no longer enter the game."
else
character.Robotize()
del(src)
@@ -362,6 +368,13 @@
var/obj/item/device/radio/intercom/a = new /obj/item/device/radio/intercom(null)// BS12 EDIT Arrivals Announcement Computer, rather than the AI.
a.autosay("\"[character.real_name],[character.wear_id.assignment ? " [character.wear_id.assignment]," : "" ] has arrived on the station.\"", "Arrivals Announcement Computer")
del(a)
/*
var/mob/living/silicon/ai/announcer = new (null)
announcer.name = "Arrivals Announcement Computer"
announcer.real_name = "Arrivals Announcement Computer"
a.autosay("\"[character.real_name],[character.wear_id.assignment ? " [character.wear_id.assignment]," : "" ] has arrived on the station.\"", announcer)
del(announcer)
*/
proc/LateChoices()
var/mills = world.time // 1/10 of a second, not real milliseconds but whatever
@@ -394,6 +407,19 @@
var/mob/living/carbon/human/new_character = new(loc)
new_character.lastarea = get_area(loc)
if(preferences.species == "Tajaran") //This is like the worst, but it works, so meh. - Erthilo
if(is_alien_whitelisted(src, "Tajaran") || !config.usealienwhitelist)
new_character.dna.mutantrace = "tajaran"
new_character.tajaran_talk_understand = 1
if(preferences.species == "Soghun")
if(is_alien_whitelisted(src, "Soghun") || !config.usealienwhitelist)
new_character.dna.mutantrace = "lizard"
new_character.soghun_talk_understand = 1
if(preferences.species == "Skrell")
if(is_alien_whitelisted(src, "Skrell") || !config.usealienwhitelist)
new_character.dna.mutantrace = "skrell"
new_character.skrell_talk_understand = 1
if(ticker.random_players)
new_character.gender = pick(MALE, FEMALE)
preferences.randomize_name()
@@ -415,19 +441,6 @@
new_character.dna.ready_dna(new_character)
new_character.dna.b_type = preferences.b_type
if(preferences.species == "Tajaran") //This is like the worst, but it works, so meh. - Erthilo
if(is_alien_whitelisted(src, "Tajaran") || !config.usealienwhitelist)
new_character.dna.mutantrace = "tajaran"
new_character.tajaran_talk_understand = 1
if(preferences.species == "Soghun")
if(is_alien_whitelisted(src, "Soghun") || !config.usealienwhitelist)
new_character.dna.mutantrace = "lizard"
new_character.soghun_talk_understand = 1
if(preferences.species == "Skrell")
if(is_alien_whitelisted(src, "Skrell") || !config.usealienwhitelist)
new_character.dna.mutantrace = "skrell"
new_character.skrell_talk_understand = 1
new_character.key = key //Manually transfer the key to log them in
return new_character
@@ -446,22 +459,3 @@
proc/close_spawn_windows()
src << browse(null, "window=latechoices") //closes late choices window
src << browse(null, "window=playersetup") //closes the player setup window
#define MAX_ALIEN_PLAYER_PERCENT 20
//cael - this should probably be moved to ticker or somewhere, but it's fine here for now
//limits the number of alien players in a game
/proc/GetAvailableAlienPlayerSlots()
var/num_players = 0
//check new players
for(var/mob/new_player/N in world)
if(N.preferences && N.ready)
num_players++
//check players already spawned, only count humans or aliens
for(var/mob/living/carbon/human/H in world)
if(H.ckey)
num_players++
return round(num_players * (MAX_ALIEN_PLAYER_PERCENT / 100))
+299 -42
View File
@@ -111,18 +111,20 @@
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question FROM erro_poll_question WHERE id = [pollid]")
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM erro_poll_question WHERE id = [pollid]")
select_query.Execute()
var/pollstarttime = ""
var/pollendtime = ""
var/pollquestion = ""
var/polltype = ""
var/found = 0
while(select_query.NextRow())
pollstarttime = select_query.item[1]
pollendtime = select_query.item[2]
pollquestion = select_query.item[3]
polltype = select_query.item[4]
found = 1
break
@@ -130,57 +132,174 @@
usr << "\red Poll question details not found."
return
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM erro_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
switch(polltype)
//Polls that have enumerated options
if("OPTION")
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM erro_poll_vote WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
var/voted = 0
var/votedoptionid = 0
while(voted_query.NextRow())
votedoptionid = text2num(voted_query.item[1])
voted = 1
break
var/voted = 0
var/votedoptionid = 0
while(voted_query.NextRow())
votedoptionid = text2num(voted_query.item[1])
voted = 1
break
var/list/datum/polloption/options = list()
var/list/datum/polloption/options = list()
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM erro_poll_option WHERE pollid = [pollid]")
options_query.Execute()
while(options_query.NextRow())
var/datum/polloption/PO = new()
PO.optionid = text2num(options_query.item[1])
PO.optiontext = options_query.item[2]
options += PO
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM erro_poll_option WHERE pollid = [pollid]")
options_query.Execute()
while(options_query.NextRow())
var/datum/polloption/PO = new()
PO.optionid = text2num(options_query.item[1])
PO.optiontext = options_query.item[2]
options += PO
dbcon.Disconnect()
dbcon.Disconnect()
var/output = "<div align='center'><B>Player poll</B>"
output +="<hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
var/output = "<div align='center'><B>Player poll</B>"
output +="<hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
if(!voted) //Only make this a form if we have not voted yet
output += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
if(!voted) //Only make this a form if we have not voted yet
output += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value='OPTION'>"
output += "<table><tr><td>"
for(var/datum/polloption/O in options)
if(O.optionid && O.optiontext)
if(voted)
if(votedoptionid == O.optionid)
output += "<b>[O.optiontext]</b><br>"
else
output += "[O.optiontext]<br>"
output += "<table><tr><td>"
for(var/datum/polloption/O in options)
if(O.optionid && O.optiontext)
if(voted)
if(votedoptionid == O.optionid)
output += "<b>[O.optiontext]</b><br>"
else
output += "[O.optiontext]<br>"
else
output += "<input type='radio' name='voteoptionid' value='[O.optionid]'> [O.optiontext]<br>"
output += "</td></tr></table>"
if(!voted) //Only make this a form if we have not voted yet
output += "<p><input type='submit' value='Vote'>"
output += "</form>"
output += "</div>"
src << browse(output,"window=playerpoll;size=500x250")
//Polls with a text input
if("TEXT")
var/DBQuery/voted_query = dbcon.NewQuery("SELECT replytext FROM erro_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
var/voted = 0
var/vote_text = ""
while(voted_query.NextRow())
vote_text = voted_query.item[1]
voted = 1
break
var/output = "<div align='center'><B>Player poll</B>"
output +="<hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Feedback gathering runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
if(!voted) //Only make this a form if we have not voted yet
output += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value='TEXT'>"
output += "<font size='2'>Please provide feedback below. You can use any letters of the English alphabet, numbers and the symbols: . , ! ? : ; -</font><br>"
output += "<textarea name='replytext' cols='50' rows='14'></textarea>"
output += "<p><input type='submit' value='Submit'>"
output += "</form>"
output += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value='TEXT'>"
output += "<input type='hidden' name='replytext' value='ABSTAIN'>"
output += "<input type='submit' value='Abstain'>"
output += "</form>"
else
output += "<input type='radio' name='voteoptionid' value='[O.optionid]'> [O.optiontext]<br>"
output += "</td></tr></table>"
output += "[vote_text]"
if(!voted) //Only make this a form if we have not voted yet
output += "<p><input type='submit' value='Vote'>"
output += "</form>"
src << browse(output,"window=playerpoll;size=500x500")
output += "</div>"
//Polls with a text input
if("NUMVAL")
var/DBQuery/voted_query = dbcon.NewQuery("SELECT o.text, v.rating FROM erro_poll_option o, erro_poll_vote v WHERE o.pollid = [pollid] AND v.ckey = '[usr.ckey]' AND o.id = v.optionid")
voted_query.Execute()
src << browse(output,"window=playerpoll;size=500x250")
var/output = "<div align='center'><B>Player poll</B>"
output +="<hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
var/voted = 0
while(voted_query.NextRow())
voted = 1
var/optiontext = voted_query.item[1]
var/rating = voted_query.item[2]
output += "<br><b>[optiontext] - [rating]</b>"
if(!voted) //Only make this a form if we have not voted yet
output += "<form name='cardcomp' action='?src=\ref[src]' method='get'>"
output += "<input type='hidden' name='src' value='\ref[src]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value='NUMVAL'>"
var/minid = 999999
var/maxid = 0
var/DBQuery/option_query = dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM erro_poll_option WHERE pollid = [pollid]")
option_query.Execute()
while(option_query.NextRow())
var/optionid = text2num(option_query.item[1])
var/optiontext = option_query.item[2]
var/minvalue = text2num(option_query.item[3])
var/maxvalue = text2num(option_query.item[4])
var/descmin = option_query.item[5]
var/descmid = option_query.item[6]
var/descmax = option_query.item[7]
if(optionid < minid)
minid = optionid
if(optionid > maxid)
maxid = optionid
var/midvalue = round( (maxvalue + minvalue) / 2)
if(isnull(minvalue) || isnull(maxvalue) || (minvalue == maxvalue))
continue
output += "<br>[optiontext]: <select name='o[optionid]'>"
output += "<option value='abstain'>abstain</option>"
for (var/j = minvalue; j <= maxvalue; j++)
if(j == minvalue && descmin)
output += "<option value='[j]'>[j] ([descmin])</option>"
else if (j == midvalue && descmid)
output += "<option value='[j]'>[j] ([descmid])</option>"
else if (j == maxvalue && descmax)
output += "<option value='[j]'>[j] ([descmax])</option>"
else
output += "<option value='[j]'>[j]</option>"
output += "</select>"
output += "<input type='hidden' name='minid' value='[minid]'>"
output += "<input type='hidden' name='maxid' value='[maxid]'>"
output += "<p><input type='submit' value='Submit'>"
output += "</form>"
src << browse(output,"window=playerpoll;size=500x500")
return
/mob/new_player/proc/vote_on_poll(var/pollid = -1, var/optionid = -1)
@@ -200,12 +319,14 @@
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/validpoll = 0
while(select_query.NextRow())
if(select_query.item[4] != "OPTION")
return
validpoll = 1
break
@@ -247,5 +368,141 @@
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]')")
insert_query.Execute()
usr << "\blue Vote successful."
usr << browse(null,"window=playerpoll")
/mob/new_player/proc/log_text_poll_reply(var/pollid = -1, var/replytext = "")
if(pollid == -1 || replytext == "")
return
if(!isnum(pollid) || !istext(replytext))
return
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
var/db = sqlfdbkdb
var/address = sqladdress
var/port = sqlport
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/validpoll = 0
while(select_query.NextRow())
if(select_query.item[4] != "TEXT")
return
validpoll = 1
break
if(!validpoll)
usr << "\red Poll is not valid."
return
var/alreadyvoted = 0
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM erro_poll_textreply WHERE pollid = [pollid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
while(voted_query.NextRow())
alreadyvoted = 1
break
if(alreadyvoted)
usr << "\red You already sent your feedback for this poll."
return
var/adminrank = "Player"
if(usr && usr.client && usr.client.holder)
adminrank = usr.client.holder.rank
replytext = dd_replacetext(replytext, "%BR%", "")
replytext = dd_replacetext(replytext, "\n", "%BR%")
var/text_pass = reject_bad_text(replytext,8000)
replytext = dd_replacetext(replytext, "%BR%", "<BR>")
if(!text_pass)
usr << "The text you entered was blank, contained illegal characters or was too long. Please correct the text and submit again."
return
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_textreply (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[usr.ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')")
insert_query.Execute()
usr << "\blue Feedback logging successful."
usr << browse(null,"window=playerpoll")
/mob/new_player/proc/vote_on_numval_poll(var/pollid = -1, var/optionid = -1, var/rating = null)
if(pollid == -1 || optionid == -1)
return
if(!isnum(pollid) || !isnum(optionid))
return
var/user = sqlfdbklogin
var/pass = sqlfdbkpass
var/db = sqlfdbkdb
var/address = sqladdress
var/port = sqlport
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]")
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM erro_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/validpoll = 0
while(select_query.NextRow())
if(select_query.item[4] != "NUMVAL")
return
validpoll = 1
break
if(!validpoll)
usr << "\red Poll is not valid."
return
var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM erro_poll_option WHERE id = [optionid] AND pollid = [pollid]")
select_query2.Execute()
var/validoption = 0
while(select_query2.NextRow())
validoption = 1
break
if(!validoption)
usr << "\red Poll option is not valid."
return
var/alreadyvoted = 0
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM erro_poll_vote WHERE optionid = [optionid] AND ckey = '[usr.ckey]'")
voted_query.Execute()
while(voted_query.NextRow())
alreadyvoted = 1
break
if(alreadyvoted)
usr << "\red You already voted in this poll."
return
var/adminrank = "Player"
if(usr && usr.client && usr.client.holder)
adminrank = usr.client.holder.rank
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])")
insert_query.Execute()
usr << "\blue Vote successful."
usr << browse(null,"window=playerpoll")

Some files were not shown because too many files have changed in this diff Show More