mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
File restructuring: ohgodihopenothingbroke edition.
All /world/ stuff that I've found is now in code/world.dm instead of being scattered throughout the code in 6-7 files. *****IMPORTANT***** This means that hub.dm is now part of world.dm. Server hosts using the hub will likely have to redo the hub/password variables! Again, that stuff is now located in code/world.dm ******************* The tester list has been removed as it is not in use. /code/defines - Moved atom.dm code into /code/game/atom.dm and atom_movable.dm - Moved hub.dm code into /code/world.dm - Moved the /defines/tanning into objects/item/sheets/leather.dm - Moved /defines/area/ into game/area/ - Moved turf.dm code into the code/game/turfs folder and divided it up into meaningful places A lot of the files in /code/game were placed in new areas since they really didn't have a reason to be there. - algorithm.dm: - - The world stuff is in world.dm. - - countJob() and AutoUpdateTK() were removed entirely (unused). - - AutoUpdateAI() is now in /mob/living/silicon/ai.dm - atom_procs.dm was split into atom.dm and atom_movable.dm - cellautomata.dm - - World stuff was moved into world.dm - - Atom stuff was moved into atom.dm and atom_movable.dm - - Atom verbs were moved into code/game/verbs/atom_verbs.dm - chemistry.dm - - Beaker box code was moved into storage/misc.dm - - The trash can and 'alechemy' paper were removed. (unused) - Landmarks.dm was moved into /objects/effects/landmarks.dm - prisonshuttle.dm, specops_shuttle.dm, syndicate_shuttle.dm and syndicate_specops_shuttle.dm have been moved into game/machinery/computer/ - status.dm and topic.dm code were moved into world.dm - step_triggers.dm are now in objects/effects/step_triggers.dm - throwing.dm was split into appropriate files (carbon mob code, atom_movable.dm, ect) - vote.dm is now in code/datums /code/game/asteroid was split up. - turf.dm was moved into game/turfs/simulated/asteroid.dm - artifacts were split up - - Wish granter is now in game/machinery - - The stealth box is gone (unused) - - The list of 'space suprises' was moved into astroid.dm - asteroid.dm, being the only file left, was moved into /code/game and finally... modules/mob/organs files are now in code/datums/organs git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4659 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -325,3 +325,104 @@
|
||||
src << "You must be conscious to do this!"
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/clean_blood()
|
||||
. = ..()
|
||||
if(ishuman(src))
|
||||
var/mob/living/carbon/human/H = src
|
||||
if(H.gloves)
|
||||
if(H.gloves.clean_blood())
|
||||
H.update_inv_gloves(0)
|
||||
else
|
||||
if(H.bloody_hands)
|
||||
H.bloody_hands = 0
|
||||
H.update_inv_gloves(0)
|
||||
update_icons() //apply the now updated overlays to the mob
|
||||
|
||||
|
||||
//Throwing stuff
|
||||
|
||||
/mob/living/carbon/proc/toggle_throw_mode()
|
||||
var/obj/item/W = get_active_hand()
|
||||
if( !W )//Not holding anything
|
||||
if( client && (TK in mutations) )
|
||||
var/obj/item/tk_grab/O = new(src)
|
||||
put_in_active_hand(O)
|
||||
O.host = src
|
||||
return
|
||||
|
||||
if( istype(W,/obj/item/tk_grab) )
|
||||
if(hand) del(l_hand)
|
||||
else del(r_hand)
|
||||
return
|
||||
|
||||
if (src.in_throw_mode)
|
||||
throw_mode_off()
|
||||
else
|
||||
throw_mode_on()
|
||||
|
||||
/mob/living/carbon/proc/throw_mode_off()
|
||||
src.in_throw_mode = 0
|
||||
src.throw_icon.icon_state = "act_throw_off"
|
||||
|
||||
/mob/living/carbon/proc/throw_mode_on()
|
||||
src.in_throw_mode = 1
|
||||
src.throw_icon.icon_state = "act_throw_on"
|
||||
|
||||
/mob/living/carbon/proc/throw_item(atom/target)
|
||||
src.throw_mode_off()
|
||||
if(usr.stat || !target)
|
||||
return
|
||||
if(target.type == /obj/screen) return
|
||||
|
||||
var/atom/movable/item = src.get_active_hand()
|
||||
|
||||
if(!item) return
|
||||
|
||||
if (istype(item, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = item
|
||||
item = G.throw() //throw the person instead of the grab
|
||||
if(ismob(item))
|
||||
var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors
|
||||
var/turf/end_T = get_turf(target)
|
||||
if(start_T && end_T)
|
||||
var/mob/M = item
|
||||
var/start_T_descriptor = "<font color='#6b5d00'>tile at [start_T.x], [start_T.y], [start_T.z] in area [get_area(start_T)]</font>"
|
||||
var/end_T_descriptor = "<font color='#6b4400'>tile at [end_T.x], [end_T.y], [end_T.z] in area [get_area(end_T)]</font>"
|
||||
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been thrown by [usr.name] ([usr.ckey]) from [start_T_descriptor] with the target [end_T_descriptor]</font>")
|
||||
usr.attack_log += text("\[[time_stamp()]\] <font color='red'>Has thrown [M.name] ([M.ckey]) from [start_T_descriptor] with the target [end_T_descriptor]</font>")
|
||||
|
||||
if(!item) return //Grab processing has a chance of returning null
|
||||
|
||||
u_equip(item)
|
||||
update_icons()
|
||||
if(src.client)
|
||||
src.client.screen -= item
|
||||
|
||||
item.loc = src.loc
|
||||
|
||||
if(istype(item, /obj/item))
|
||||
item:dropped(src) // let it know it's been dropped
|
||||
|
||||
//actually throw it!
|
||||
if (item)
|
||||
item.layer = initial(item.layer)
|
||||
src.visible_message("\red [src] has thrown [item].")
|
||||
|
||||
if(!src.lastarea)
|
||||
src.lastarea = get_area(src.loc)
|
||||
if((istype(src.loc, /turf/space)) || (src.lastarea.has_gravity == 0))
|
||||
src.inertia_dir = get_dir(target, src)
|
||||
step(src, inertia_dir)
|
||||
|
||||
|
||||
/*
|
||||
if(istype(src.loc, /turf/space) || (src.flags & NOGRAV)) //they're in space, move em one space in the opposite direction
|
||||
src.inertia_dir = get_dir(target, src)
|
||||
step(src, inertia_dir)
|
||||
*/
|
||||
|
||||
|
||||
|
||||
item.throw_at(target, item.throw_range, item.throw_speed)
|
||||
@@ -1,3 +1,10 @@
|
||||
//Not sure why this is necessary...
|
||||
/proc/AutoUpdateAI(obj/subject)
|
||||
if (subject!=null)
|
||||
for(var/mob/living/silicon/ai/M in player_list)
|
||||
if ((M.client && M.machine == subject))
|
||||
subject.attack_ai(M)
|
||||
|
||||
|
||||
/mob/living/silicon/ai
|
||||
name = "AI"
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
/datum/organ
|
||||
var/name = "organ"
|
||||
var/mob/owner = null
|
||||
|
||||
///datum/organ/proc/process()
|
||||
// return 0
|
||||
|
||||
///datum/organ/proc/receive_chem(chemical as obj)
|
||||
// return 0
|
||||
|
||||
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
/datum/organ/external
|
||||
name = "external"
|
||||
var/icon_name = null
|
||||
var/body_part = null
|
||||
var/brutestate = 0
|
||||
var/burnstate = 0
|
||||
var/brute_dam = 0
|
||||
var/burn_dam = 0
|
||||
var/max_damage = 0
|
||||
// var/bandaged = 0
|
||||
// var/wound_size = 0
|
||||
// var/max_size = 0
|
||||
|
||||
/datum/organ/external/chest
|
||||
name = "chest"
|
||||
icon_name = "chest"
|
||||
max_damage = 150
|
||||
body_part = UPPER_TORSO
|
||||
|
||||
/datum/organ/external/head
|
||||
name = "head"
|
||||
icon_name = "head"
|
||||
max_damage = 125
|
||||
body_part = HEAD
|
||||
|
||||
/datum/organ/external/l_arm
|
||||
name = "l_arm"
|
||||
icon_name = "l_arm"
|
||||
max_damage = 75
|
||||
body_part = ARM_LEFT
|
||||
|
||||
/datum/organ/external/l_leg
|
||||
name = "l_leg"
|
||||
icon_name = "l_leg"
|
||||
max_damage = 75
|
||||
body_part = LEG_LEFT
|
||||
|
||||
/datum/organ/external/r_arm
|
||||
name = "r_arm"
|
||||
icon_name = "r_arm"
|
||||
max_damage = 75
|
||||
body_part = ARM_RIGHT
|
||||
|
||||
/datum/organ/external/r_leg
|
||||
name = "r_leg"
|
||||
icon_name = "r_leg"
|
||||
max_damage = 75
|
||||
body_part = LEG_RIGHT
|
||||
|
||||
/*Leaving these here in case we want to use them later
|
||||
/datum/organ/external/l_foot
|
||||
name = "l foot"
|
||||
icon_name = "l_foot"
|
||||
body_part = FOOT_LEFT
|
||||
|
||||
/datum/organ/external/r_foot
|
||||
name = "r foot"
|
||||
icon_name = "r_foot"
|
||||
body_part = FOOT_RIGHT
|
||||
|
||||
/datum/organ/external/r_hand
|
||||
name = "r hand"
|
||||
icon_name = "r_hand"
|
||||
body_part = HAND_RIGHT
|
||||
|
||||
/datum/organ/external/l_hand
|
||||
name = "l hand"
|
||||
icon_name = "l_hand"
|
||||
body_part = HAND_LEFT
|
||||
|
||||
/datum/organ/external/groin
|
||||
name = "groin"
|
||||
icon_name = "groin"
|
||||
body_part = LOWER_TORSO
|
||||
*/
|
||||
|
||||
//Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all.
|
||||
//Damage will not exceed max_damage using this proc
|
||||
//Cannot apply negative damage
|
||||
/datum/organ/external/proc/take_damage(brute, burn)
|
||||
if(owner && owner.nodamage) return 0 //godmode
|
||||
brute = max(brute,0)
|
||||
burn = max(burn,0)
|
||||
|
||||
var/can_inflict = max_damage - (brute_dam + burn_dam)
|
||||
if(!can_inflict) return 0
|
||||
|
||||
if((brute + burn) < can_inflict)
|
||||
brute_dam += brute
|
||||
burn_dam += burn
|
||||
else
|
||||
if(brute > 0)
|
||||
if(burn > 0)
|
||||
brute = round( (brute/(brute+burn)) * can_inflict, 1 )
|
||||
burn = can_inflict - brute //gets whatever damage is left over
|
||||
brute_dam += brute
|
||||
burn_dam += burn
|
||||
else
|
||||
brute_dam += can_inflict
|
||||
else
|
||||
if(burn > 0)
|
||||
burn_dam += can_inflict
|
||||
else
|
||||
return 0
|
||||
return update_icon()
|
||||
|
||||
|
||||
//Heals brute and burn damage for the organ. Returns 1 if the damage-icon states changed at all.
|
||||
//Damage cannot go below zero.
|
||||
//Cannot remove negative damage (i.e. apply damage)
|
||||
/datum/organ/external/proc/heal_damage(brute, burn)
|
||||
brute = max(brute, 0)
|
||||
burn = max(burn, 0)
|
||||
brute_dam = max(brute_dam - brute, 0)
|
||||
burn_dam = max(burn_dam - burn, 0)
|
||||
return update_icon()
|
||||
|
||||
|
||||
//Returns total damage...kinda pointless really
|
||||
/datum/organ/external/proc/get_damage() //returns total damage
|
||||
return brute_dam + burn_dam
|
||||
|
||||
|
||||
//Updates an organ's brute/burn states for use by updateDamageIcon()
|
||||
//Returns 1 if we need to update overlays. 0 otherwise.
|
||||
/datum/organ/external/proc/update_icon()
|
||||
var/tbrute = round( (brute_dam/max_damage)*3, 1 )
|
||||
var/tburn = round( (burn_dam/max_damage)*3, 1 )
|
||||
if((tbrute != brutestate) || (tburn != burnstate))
|
||||
brutestate = tbrute
|
||||
burnstate = tburn
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//Returns a display name for the organ
|
||||
/datum/organ/external/proc/getDisplayName()
|
||||
switch(name)
|
||||
if("l_leg") return "left leg"
|
||||
if("r_leg") return "right leg"
|
||||
if("l_arm") return "left arm"
|
||||
if("r_arm") return "right arm"
|
||||
else return name
|
||||
@@ -1,51 +0,0 @@
|
||||
/datum/organ/internal
|
||||
name = "internal"
|
||||
|
||||
/datum/organ/internal/blood_vessels
|
||||
name = "blood vessels"
|
||||
var/heart = null
|
||||
var/lungs = null
|
||||
var/kidneys = null
|
||||
|
||||
/datum/organ/internal/brain
|
||||
name = "brain"
|
||||
var/head = null
|
||||
|
||||
/datum/organ/internal/excretory
|
||||
name = "excretory"
|
||||
var/excretory = 7.0
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/heart
|
||||
name = "heart"
|
||||
|
||||
/datum/organ/internal/immune_system
|
||||
name = "immune system"
|
||||
var/blood_vessels = null
|
||||
var/isys = null
|
||||
|
||||
/datum/organ/internal/intestines
|
||||
name = "intestines"
|
||||
var/intestines = 3.0
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/liver
|
||||
name = "liver"
|
||||
var/intestines = null
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/lungs
|
||||
name = "lungs"
|
||||
var/lungs = 3.0
|
||||
var/throat = null
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/stomach
|
||||
name = "stomach"
|
||||
var/intestines = null
|
||||
|
||||
/datum/organ/internal/throat
|
||||
name = "throat"
|
||||
var/lungs = null
|
||||
var/stomach = null
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
mob/proc/flash_pain()
|
||||
// flick("pain",pain)
|
||||
return
|
||||
|
||||
mob/var/list/pain_stored = list()
|
||||
mob/var/last_pain_message = ""
|
||||
mob/var/next_pain_time = 0
|
||||
|
||||
// partname is the name of a body part
|
||||
// amount is a num from 1 to 100
|
||||
mob/proc/pain(var/partname, var/amount, var/force)
|
||||
if(stat >= 2) return
|
||||
if(world.time < next_pain_time && !force)
|
||||
return
|
||||
if(amount > 10 && istype(src,/mob/living/carbon/human))
|
||||
if(src:paralysis)
|
||||
src:paralysis = max(0, src:paralysis-round(amount/10))
|
||||
if(amount > 50 && prob(amount / 5))
|
||||
src:drop_item()
|
||||
/*
|
||||
switch(amount)
|
||||
if(1 to 10)
|
||||
msg = "<b>Your [partname] hurts a bit.</b>"
|
||||
if(11 to 90)
|
||||
// flash_weak_pain()
|
||||
msg = "<b><font size=1>Ouch! Your [partname] hurts.</font></b>"
|
||||
if(91 to 10000)
|
||||
flash_pain()
|
||||
msg = "<b><font size=3>OH GOD! Your [partname] is hurting terribly!</font></b>"
|
||||
|
||||
if(msg && (msg != last_pain_message || prob(10)))
|
||||
last_pain_message = msg
|
||||
src << msg
|
||||
|
||||
*/
|
||||
next_pain_time = world.time + (100 - amount)
|
||||
|
||||
mob/living/carbon/human/proc/handle_pain()
|
||||
// not when sleeping
|
||||
if(stat >= 2) return
|
||||
if(reagents.has_reagent("tramadol"))
|
||||
return
|
||||
if(reagents.has_reagent("oxycodone"))
|
||||
return
|
||||
var/maxdam = 0
|
||||
var/datum/organ/external/damaged_organ = null
|
||||
for(var/name in organs)
|
||||
var/datum/organ/external/E = organs[name]
|
||||
var/dam = E.get_damage()
|
||||
// make the choice of the organ depend on damage,
|
||||
// but also sometimes use one of the less damaged ones
|
||||
if(dam > maxdam && (maxdam == 0 || prob(70)) )
|
||||
damaged_organ = E
|
||||
maxdam = dam
|
||||
if(damaged_organ)
|
||||
pain(damaged_organ.display_name, maxdam, 0)
|
||||
Reference in New Issue
Block a user