ONCLICK CODE PORT. GOD HELP US ALL.

This commit is contained in:
Rob Nelson
2014-01-17 18:24:53 -08:00
parent 07348e94c1
commit 27e1c5e869
191 changed files with 7295 additions and 4353 deletions

View File

@@ -31,6 +31,23 @@
#include "code\__HELPERS\type2type.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\_onclick\adjacent.dm"
#include "code\_onclick\ai.dm"
#include "code\_onclick\click.dm"
#include "code\_onclick\cyborg.dm"
#include "code\_onclick\drag_drop.dm"
#include "code\_onclick\item_attack.dm"
#include "code\_onclick\observer.dm"
#include "code\_onclick\other_mobs.dm"
#include "code\_onclick\telekinesis.dm"
#include "code\_onclick\hud\_defines.dm"
#include "code\_onclick\hud\alien.dm"
#include "code\_onclick\hud\alien_larva.dm"
#include "code\_onclick\hud\hud.dm"
#include "code\_onclick\hud\human.dm"
#include "code\_onclick\hud\monkey.dm"
#include "code\_onclick\hud\other_mobs.dm"
#include "code\_onclick\hud\robot.dm"
#include "code\_onclick\hud\screen_objects.dm"
#include "code\ATMOSPHERICS\atmospherics.dm"
#include "code\ATMOSPHERICS\chiller.dm"
#include "code\ATMOSPHERICS\datum_pipe_network.dm"
@@ -165,7 +182,6 @@
#include "code\game\atoms.dm"
#include "code\game\atoms_movable.dm"
#include "code\game\communications.dm"
#include "code\game\hud.dm"
#include "code\game\response_team.dm"
#include "code\game\shuttle_engines.dm"
#include "code\game\skincmd.dm"
@@ -195,7 +211,6 @@
#include "code\game\gamemodes\blob\blob.dm"
#include "code\game\gamemodes\blob\blob_finish.dm"
#include "code\game\gamemodes\blob\blob_report.dm"
#include "code\game\gamemodes\blob\hud.dm"
#include "code\game\gamemodes\blob\overmind.dm"
#include "code\game\gamemodes\blob\powers.dm"
#include "code\game\gamemodes\blob\theblob.dm"
@@ -459,7 +474,7 @@
#include "code\game\objects\effects\decals\Cleanable\humans.dm"
#include "code\game\objects\effects\decals\Cleanable\misc.dm"
#include "code\game\objects\effects\decals\Cleanable\robots.dm"
#include "code\game\objects\effects\decals\Cleanable\trails.dm"
#include "code\game\objects\effects\decals\Cleanable\tracks.dm"
#include "code\game\objects\effects\decals\posters\bs12.dm"
#include "code\game\objects\effects\decals\posters\tgposters.dm"
#include "code\game\objects\effects\spawners\bombspawner.dm"
@@ -474,7 +489,6 @@
#include "code\game\objects\items\crayons.dm"
#include "code\game\objects\items\latexballoon.dm"
#include "code\game\objects\items\shooting_range.dm"
#include "code\game\objects\items\tk_grab.dm"
#include "code\game\objects\items\toys.dm"
#include "code\game\objects\items\trash.dm"
#include "code\game\objects\items\devices\aicard.dm"
@@ -858,6 +872,7 @@
#include "code\modules\mining\ores_coins.dm"
#include "code\modules\mining\satchel_ore_boxdm.dm"
#include "code\modules\mining\smelting.dm"
#include "code\modules\mob\abilities.dm"
#include "code\modules\mob\death.dm"
#include "code\modules\mob\emote.dm"
#include "code\modules\mob\inventory.dm"
@@ -872,12 +887,10 @@
#include "code\modules\mob\mob_movement.dm"
#include "code\modules\mob\mob_transformation_simple.dm"
#include "code\modules\mob\say.dm"
#include "code\modules\mob\screen.dm"
#include "code\modules\mob\transform_procs.dm"
#include "code\modules\mob\update_icons.dm"
#include "code\modules\mob\camera\camera.dm"
#include "code\modules\mob\dead\death.dm"
#include "code\modules\mob\dead\observer\hud.dm"
#include "code\modules\mob\dead\observer\login.dm"
#include "code\modules\mob\dead\observer\logout.dm"
#include "code\modules\mob\dead\observer\observer.dm"
@@ -904,7 +917,6 @@
#include "code\modules\mob\living\carbon\alien\humanoid\alien_powers.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\death.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\emote.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\hud.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\humanoid.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\inventory.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\life.dm"
@@ -916,7 +928,6 @@
#include "code\modules\mob\living\carbon\alien\humanoid\caste\sentinel.dm"
#include "code\modules\mob\living\carbon\alien\larva\death.dm"
#include "code\modules\mob\living\carbon\alien\larva\emote.dm"
#include "code\modules\mob\living\carbon\alien\larva\hud.dm"
#include "code\modules\mob\living\carbon\alien\larva\inventory.dm"
#include "code\modules\mob\living\carbon\alien\larva\larva.dm"
#include "code\modules\mob\living\carbon\alien\larva\life.dm"
@@ -928,7 +939,6 @@
#include "code\modules\mob\living\carbon\brain\brain_item.dm"
#include "code\modules\mob\living\carbon\brain\death.dm"
#include "code\modules\mob\living\carbon\brain\emote.dm"
#include "code\modules\mob\living\carbon\brain\hud.dm"
#include "code\modules\mob\living\carbon\brain\life.dm"
#include "code\modules\mob\living\carbon\brain\MMI.dm"
#include "code\modules\mob\living\carbon\brain\posibrain.dm"
@@ -936,7 +946,6 @@
#include "code\modules\mob\living\carbon\human\death.dm"
#include "code\modules\mob\living\carbon\human\emote.dm"
#include "code\modules\mob\living\carbon\human\examine.dm"
#include "code\modules\mob\living\carbon\human\hud.dm"
#include "code\modules\mob\living\carbon\human\human.dm"
#include "code\modules\mob\living\carbon\human\human_attackalien.dm"
#include "code\modules\mob\living\carbon\human\human_attackhand.dm"
@@ -963,9 +972,9 @@
#include "code\modules\mob\living\carbon\metroid\subtypes.dm"
#include "code\modules\mob\living\carbon\metroid\update_icons.dm"
#include "code\modules\mob\living\carbon\monkey\death.dm"
#include "code\modules\mob\living\carbon\monkey\diona.dm"
#include "code\modules\mob\living\carbon\monkey\emote.dm"
#include "code\modules\mob\living\carbon\monkey\examine.dm"
#include "code\modules\mob\living\carbon\monkey\hud.dm"
#include "code\modules\mob\living\carbon\monkey\inventory.dm"
#include "code\modules\mob\living\carbon\monkey\life.dm"
#include "code\modules\mob\living\carbon\monkey\login.dm"
@@ -981,7 +990,6 @@
#include "code\modules\mob\living\silicon\ai\ai.dm"
#include "code\modules\mob\living\silicon\ai\death.dm"
#include "code\modules\mob\living\silicon\ai\examine.dm"
#include "code\modules\mob\living\silicon\ai\hud.dm"
#include "code\modules\mob\living\silicon\ai\laws.dm"
#include "code\modules\mob\living\silicon\ai\life.dm"
#include "code\modules\mob\living\silicon\ai\login.dm"
@@ -1021,7 +1029,6 @@
#include "code\modules\mob\living\silicon\robot\death.dm"
#include "code\modules\mob\living\silicon\robot\emote.dm"
#include "code\modules\mob\living\silicon\robot\examine.dm"
#include "code\modules\mob\living\silicon\robot\hud.dm"
#include "code\modules\mob\living\silicon\robot\inventory.dm"
#include "code\modules\mob\living\silicon\robot\laws.dm"
#include "code\modules\mob\living\silicon\robot\life.dm"
@@ -1031,7 +1038,6 @@
#include "code\modules\mob\living\silicon\robot\robot_items.dm"
#include "code\modules\mob\living\silicon\robot\robot_modules.dm"
#include "code\modules\mob\living\silicon\robot\robot_movement.dm"
#include "code\modules\mob\living\silicon\robot\say.dm"
#include "code\modules\mob\living\simple_animal\bees.dm"
#include "code\modules\mob\living\simple_animal\borer.dm"
#include "code\modules\mob\living\simple_animal\constructs.dm"
@@ -1068,7 +1074,6 @@
#include "code\modules\mob\living\simple_animal\hostile\retaliate\clown.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\drone.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\retaliate.dm"
#include "code\modules\mob\new_player\hud.dm"
#include "code\modules\mob\new_player\login.dm"
#include "code\modules\mob\new_player\logout.dm"
#include "code\modules\mob\new_player\new_player.dm"

View File

@@ -176,7 +176,7 @@
/obj/machinery/atmospherics/pipe/simple/proc/burst()
src.visible_message("\red \bold [src] bursts!");
playsound(get_turf(src), 'sound/effects/bang.ogg', 25, 1)
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new
var/datum/effect/effect/system/smoke_spread/smoke = new
smoke.set_up(1,0, src.loc, 0)
smoke.start()
del(src)

View File

@@ -1,5 +1,5 @@
/obj/effect/expl_particles
name = "fire"
name = "explosive particles"
icon = 'icons/effects/effects.dmi'
icon_state = "explosion_particle"
opacity = 1
@@ -9,7 +9,7 @@
/obj/effect/expl_particles/New()
..()
spawn (15)
del(src)
src.loc = null
return
/obj/effect/expl_particles/Move()
@@ -32,13 +32,12 @@
spawn(0)
var/obj/effect/expl_particles/expl = new /obj/effect/expl_particles(src.location)
var/direct = pick(alldirs)
var/a = 0
for(a=0, a<pick(1;25,2;50,3,4;200), a++)
for(i=0, i<pick(1;25,2;50,3,4;200), i++)
sleep(1)
step(expl,direct)
/obj/effect/explosion
name = "fire"
name = "explosive particles"
icon = 'icons/effects/96x96.dmi'
icon_state = "explosion"
opacity = 1
@@ -50,7 +49,7 @@
/obj/effect/explosion/New()
..()
spawn (10)
del(src)
src.loc = null
return
/datum/effect/system/explosion
@@ -66,6 +65,6 @@
P.set_up(10,location)
P.start()
spawn(5)
var/datum/effect/effect/system/harmless_smoke_spread/S = new/datum/effect/effect/system/harmless_smoke_spread()
var/datum/effect/effect/system/smoke_spread/S = new/datum/effect/effect/system/smoke_spread()
S.set_up(5,0,location,null)
S.start()

View File

@@ -80,12 +80,12 @@ obj/var/contaminated = 0
/mob/living/carbon/human/proc/burn_eyes()
//The proc that handles eye burning.
if(prob(20)) src << "\red Your eyes burn!"
eye_stat += 2.5
var/datum/organ/internal/eyes/E = internal_organs["eyes"]
E.damage += 2.5
eye_blurry = min(eye_blurry+1.5,50)
if (prob(max(0,eye_stat - 20) + 1) &&!eye_blind)
if (prob(max(0,E.damage - 15) + 1) &&!eye_blind)
src << "\red You are blinded!"
eye_blind += 20
eye_stat = 0
/mob/living/carbon/human/proc/pl_head_protected()
//Checks if the head is adequately sealed.

View File

@@ -773,4 +773,14 @@ proc
for(var/O in A.overlays)
var/image/I = O
composite.Blend(icon(I.icon, I.icon_state, I.dir, 1), ICON_OVERLAY)
return composite
return composite
proc/adjust_brightness(var/color, var/value)
if (!color) return "#FFFFFF"
if (!value) return color
var/list/RGB = ReadRGB(color)
RGB[1] = Clamp(RGB[1]+value,0,255)
RGB[2] = Clamp(RGB[2]+value,0,255)
RGB[3] = Clamp(RGB[3]+value,0,255)
return rgb(RGB[1],RGB[2],RGB[3])

126
code/_onclick/ai.dm Normal file
View File

@@ -0,0 +1,126 @@
/*
AI ClickOn()
Note currently ai restrained() returns 0 in all cases,
therefore restrained code has been removed
The AI can double click to move the camera (this was already true but is cleaner),
or double click a mob to track them.
Note that AI have no need for the adjacency proc, and so this proc is a lot cleaner.
*/
/mob/living/silicon/ai/DblClickOn(var/atom/A, params)
if(client.buildmode) // comes after object.Click to allow buildmode gui objects to be clicked
build_click(src, client.buildmode, params, A)
return
if(control_disabled || stat) return
next_move = world.time + 9
if(ismob(A))
ai_actual_track(A)
else
A.move_camera_by_click()
/mob/living/silicon/ai/ClickOn(var/atom/A, params)
if(world.time <= next_click)
return
next_click = world.time + 1
if(client.buildmode) // comes after object.Click to allow buildmode gui objects to be clicked
build_click(src, client.buildmode, params, A)
return
var/list/modifiers = params2list(params)
if(modifiers["middle"])
MiddleClickOn(A)
return
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(control_disabled || stat || world.time <= next_move) return
next_move = world.time + 9
/*
AI restrained() currently does nothing
if(restrained())
RestrainedClickOn(A)
else
*/
A.add_hiddenprint(src)
A.attack_ai(src)
/*
AI has no need for the UnarmedAttack() and RangedAttack() procs,
because the AI code is not generic; attack_ai() is used instead.
The below is only really for safety, or you can alter the way
it functions and re-insert it above.
*/
/mob/living/silicon/ai/UnarmedAttack(atom/A)
A.attack_ai(src)
/mob/living/silicon/ai/RangedAttack(atom/A)
A.attack_ai(src)
/atom/proc/attack_ai(mob/user as mob)
return
/*
Since the AI handles shift, ctrl, and alt-click differently
than anything else in the game, atoms have separate procs
for AI shift, ctrl, and alt clicking.
*/
/mob/living/silicon/ai/ShiftClickOn(var/atom/A)
A.AIShiftClick(src)
/mob/living/silicon/ai/CtrlClickOn(var/atom/A)
A.AICtrlClick(src)
/mob/living/silicon/ai/AltClickOn(var/atom/A)
A.AIAltClick(src)
/*
The following criminally helpful code is just the previous code cleaned up;
I have no idea why it was in atoms.dm instead of respective files.
*/
/atom/proc/AIShiftClick()
return
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(density)
Topic("aiEnable=7", list("aiEnable"="7"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=7", list("aiDisable"="7"), 1)
return
/atom/proc/AICtrlClick()
return
/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
if(locked)
Topic("aiEnable=4", list("aiEnable"="4"), 1)// 1 meaning no window (consistency!)
else
Topic("aiDisable=4", list("aiDisable"="4"), 1)
/obj/machinery/power/apc/AICtrlClick() // turns off APCs.
Topic("breaker=1", list("breaker"="1"), 0) // 0 meaning no window (consistency! wait...)
/atom/proc/AIAltClick()
return
/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.
if(!secondsElectrified)
// permenant shock
Topic("aiEnable=6", list("aiEnable"="6"), 1) // 1 meaning no window (consistency!)
else
// disable/6 is not in Topic; disable/5 disables both temporary and permenant shock
Topic("aiDisable=5", list("aiDisable"="5"), 1)
return

304
code/_onclick/click.dm Normal file
View File

@@ -0,0 +1,304 @@
/*
Click code cleanup
~Sayu
*/
// 1 decisecond click delay (above and beyond mob/next_move)
/mob/var/next_click = 0
/*
Before anything else, defer these calls to a per-mobtype handler. This allows us to
remove istype() spaghetti code, but requires the addition of other handler procs to simplify it.
Alternately, you could hardcode every mob's variation in a flat ClickOn() proc; however,
that's a lot of code duplication and is hard to maintain.
Note that this proc can be overridden, and is in the case of screen objects.
*/
/atom/Click(location,control,params)
usr.ClickOn(src, params)
/atom/DblClick(location,control,params)
usr.DblClickOn(src,params)
/*
Standard mob ClickOn()
Handles exceptions: Buildmode, middle click, modified clicks, mech actions
After that, mostly just check your state, check whether you're holding an item,
check whether you're adjacent to the target, then pass off the click to whoever
is recieving it.
The most common are:
* mob/UnarmedAttack(atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
* atom/attackby(item,user) - used only when adjacent
* item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent
* mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
*/
/mob/proc/ClickOn( var/atom/A, var/params )
if(world.time <= next_click)
return
next_click = world.time + 1
if(client.buildmode)
build_click(src, client.buildmode, params, A)
return
var/list/modifiers = params2list(params)
if(modifiers["middle"])
MiddleClickOn(A)
return
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(stat || paralysis || stunned || weakened)
return
face_atom(A) // change direction to face what you clicked on
if(next_move > world.time) // in the year 2000...
return
if(istype(loc,/obj/mecha))
if(!locate(/turf) in list(A,A.loc)) // Prevents inventory from being drilled
return
var/obj/mecha/M = loc
return M.click_action(A,src)
if(restrained())
RestrainedClickOn(A)
return
if(in_throw_mode)
throw_item(A)
return
var/obj/item/W = get_active_hand()
if(W == A)
next_move = world.time + 6
if(W.flags&USEDELAY)
next_move += 5
W.attack_self(src)
if(hand)
update_inv_l_hand(0)
else
update_inv_r_hand(0)
return
// operate two levels deep here (item in backpack in src; NOT item in box in backpack in src)
if(A == loc || (A in loc) || (A in contents) || (A.loc in contents))
// faster access to objects already on you
if(A in contents)
next_move = world.time + 6 // on your person
else
next_move = world.time + 8 // in a box/bag or in your square
// No adjacency needed
if(W)
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W,src)
if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1 indicates adjacency
else
UnarmedAttack(A)
return
if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that
return
// Allows you to click on a box's contents, if that box is on the ground, but no deeper than that
if(isturf(A) || isturf(A.loc) || (A.loc && isturf(A.loc.loc)))
next_move = world.time + 10
if(A.Adjacent(src)) // see adjacent.dm
if(W)
if(W.flags&USEDELAY)
next_move += 5
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = A.attackby(W,src)
if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1: clicking something Adjacent
else
UnarmedAttack(A, 1)
return
else // non-adjacent click
if(W)
W.afterattack(A,src,0,params) // 0: not Adjacent
else
RangedAttack(A, params)
return
// Default behavior: ignore double clicks, consider them normal clicks instead
/mob/proc/DblClickOn(var/atom/A, var/params)
ClickOn(A,params)
/*
Translates into attack_hand, etc.
Note: proximity_flag here is used to distinguish between normal usage (flag=1),
and usage when clicking on things telekinetically (flag=0). This proc will
not be called at ranged except with telekinesis.
proximity_flag is not currently passed to attack_hand, and is instead used
in human click code to allow glove touches only at melee range.
*/
/mob/proc/UnarmedAttack(var/atom/A, var/proximity_flag)
return
/*
Ranged unarmed attack:
This currently is just a default for all mobs, involving
laser eyes and telekinesis. You could easily add exceptions
for things like ranged glove touches, spitting alien acid/neurotoxin,
animals lunging, etc.
*/
/mob/proc/RangedAttack(var/atom/A, var/params)
if(!mutations.len) return
if((LASER in mutations) && a_intent == "harm")
LaserEyes(A) // moved into a proc below
else if(TK in mutations)
switch(get_dist(src,A))
if(0)
;
if(1 to 5) // not adjacent may mean blocked by window
next_move += 2
if(5 to 7)
next_move += 5
if(8 to tk_maxrange)
next_move += 10
else
return
A.attack_tk(src)
/*
Restrained ClickOn
Used when you are handcuffed and click things.
Not currently used by anything but could easily be.
*/
/mob/proc/RestrainedClickOn(var/atom/A)
return
/*
Middle click
Only used for swapping hands
*/
/mob/proc/MiddleClickOn(var/atom/A)
return
/mob/living/carbon/MiddleClickOn(var/atom/A)
swap_hand()
// In case of use break glass
/*
/atom/proc/MiddleClick(var/mob/M as mob)
return
*/
/*
Shift click
For most mobs, examine.
This is overridden in ai.dm
*/
/mob/proc/ShiftClickOn(var/atom/A)
A.ShiftClick(src)
return
/atom/proc/ShiftClick(var/mob/user)
if(user.client && user.client.eye == user)
examine()
user.face_atom(src)
return
/*
Ctrl click
For most objects, pull
*/
/mob/proc/CtrlClickOn(var/atom/A)
A.CtrlClick(src)
return
/atom/proc/CtrlClick(var/mob/user)
return
/atom/movable/CtrlClick(var/mob/user)
if(Adjacent(user))
user.start_pulling(src)
/*
Alt click
Unused except for AI
*/
/mob/proc/AltClickOn(var/atom/A)
A.AltClick(src)
return
/atom/proc/AltClick(var/mob/user)
var/turf/T = get_turf(src)
if(T && T.Adjacent(user))
if(user.listed_turf == T)
user.listed_turf = null
else
user.listed_turf = T
user.client.statpanel = T.name
return
/*
Misc helpers
Laser Eyes: as the name implies, handles this since nothing else does currently
face_atom: turns the mob towards what you clicked on
*/
/mob/proc/LaserEyes(atom/A)
return
/mob/living/LaserEyes(atom/A)
next_move = world.time + 6
var/turf/T = get_turf(src)
var/turf/U = get_turf(A)
var/obj/item/projectile/beam/LE = new /obj/item/projectile/beam( loc )
LE.icon = 'icons/effects/genetics.dmi'
LE.icon_state = "eyelasers"
playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
LE.firer = src
LE.def_zone = get_organ_target()
LE.original = A
LE.current = T
LE.yo = U.y - T.y
LE.xo = U.x - T.x
spawn( 1 )
LE.process()
/mob/living/carbon/human/LaserEyes()
if(nutrition>0)
..()
nutrition = max(nutrition - rand(1,5),0)
handle_regular_hud_updates()
else
src << "\red You're out of energy! You need food!"
// Simple helper to face what you clicked on, in case it should be needed in more than one place
/mob/proc/face_atom(var/atom/A)
if( stat || buckled || !A || !x || !y || !A.x || !A.y ) return
var/dx = A.x - x
var/dy = A.y - y
if(!dx && !dy) return
if(abs(dx) < abs(dy))
if(dy > 0) usr.dir = NORTH
else usr.dir = SOUTH
else
if(dx > 0) usr.dir = EAST
else usr.dir = WEST

119
code/_onclick/cyborg.dm Normal file
View File

@@ -0,0 +1,119 @@
/*
Cyborg ClickOn()
Cyborgs have no range restriction on attack_robot(), because it is basically an AI click.
However, they do have a range restriction on item use, so they cannot do without the
adjacency code.
*/
/mob/living/silicon/robot/ClickOn(var/atom/A, var/params)
if(world.time <= next_click)
return
next_click = world.time + 1
if(client.buildmode) // comes after object.Click to allow buildmode gui objects to be clicked
build_click(src, client.buildmode, params, A)
return
var/list/modifiers = params2list(params)
if(modifiers["middle"])
MiddleClickOn(A)
return
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(stat || lockcharge || weakened || stunned || paralysis)
return
if(next_move >= world.time)
return
face_atom(A) // change direction to face what you clicked on
/*
cyborg restrained() currently does nothing
if(restrained())
RestrainedClickOn(A)
return
*/
var/obj/item/W = get_active_hand()
// Cyborgs have no range-checking unless there is item use
if(!W)
A.add_hiddenprint(src)
A.attack_robot(src)
return
// buckled cannot prevent machine interlinking but stops arm movement
if( buckled )
return
if(W == A)
next_move = world.time + 8
if(W.flags&USEDELAY)
next_move += 5
W.attack_self(src)
return
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents)
if(A == loc || (A in loc) || (A in contents))
// No adjacency checks
next_move = world.time + 8
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W,src)
if(!resolved && A && W)
W.afterattack(A,src,1,params)
return
if(!isturf(loc))
return
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm
next_move = world.time + 10
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W, src)
if(!resolved && A && W)
W.afterattack(A, src, 1, params)
return
else
next_move = world.time + 10
W.afterattack(A, src, 0, params)
return
return
//Middle click cycles through selected modules.
/mob/living/silicon/robot/MiddleClickOn(var/atom/A)
cycle_modules()
return
/*
As with AI, these are not used in click code,
because the code for robots is specific, not generic.
If you would like to add advanced features to robot
clicks, you can do so here, but you will have to
change attack_robot() above to the proper function
*/
/mob/living/silicon/robot/UnarmedAttack(atom/A)
A.attack_robot(src)
/mob/living/silicon/robot/RangedAttack(atom/A)
A.attack_robot(src)
/atom/proc/attack_robot(mob/user as mob)
attack_ai(user)
return

View File

@@ -0,0 +1,18 @@
/*
MouseDrop:
Called on the atom you're dragging. In a lot of circumstances we want to use the
recieving object instead, so that's the default action. This allows you to drag
almost anything into a trash can.
*/
/atom/MouseDrop(atom/over)
if(!usr || !over) return
if(!Adjacent(usr) || !over.Adjacent(usr)) return // should stop you from dragging through windows
spawn(0)
over.MouseDrop_T(src,usr)
return
// recieve a mousedrop
/atom/proc/MouseDrop_T(atom/dropping, mob/user)
return

View File

@@ -0,0 +1,119 @@
/*
These defines specificy screen locations. For more information, see the byond documentation on the screen_loc var.
The short version:
Everything is encoded as strings because apparently that's how Byond rolls.
"1,1" is the bottom left square of the user's screen. This aligns perfectly with the turf grid.
"1:2,3:4" is the square (1,3) with pixel offsets (+2, +4); slightly right and slightly above the turf grid.
Pixel offsets are used so you don't perfectly hide the turf under them, that would be crappy.
The size of the user's screen is defined by client.view (indirectly by world.view), in our case "15x15".
Therefore, the top right corner (except during admin shenanigans) is at "15,15"
*/
//Upper left action buttons, displayed when you pick up an item that has this enabled.
#define ui_action_slot1 "1:6,14:26"
#define ui_action_slot2 "2:8,14:26"
#define ui_action_slot3 "3:10,14:26"
#define ui_action_slot4 "4:12,14:26"
#define ui_action_slot5 "5:14,14:26"
//Lower left, persistant menu
#define ui_inventory "1:6,1:5"
//Lower center, persistant menu
#define ui_sstore1 "3:10,1:5"
#define ui_id "4:12,1:5"
#define ui_belt "5:14,1:5"
#define ui_back "6:14,1:5"
#define ui_rhand "7:16,1:5"
#define ui_lhand "8:16,1:5"
#define ui_equip "7:16,2:5"
#define ui_swaphand1 "7:16,2:5"
#define ui_swaphand2 "8:16,2:5"
#define ui_storage1 "9:18,1:5"
#define ui_storage2 "10:20,1:5"
#define ui_alien_head "4:12,1:5" //aliens
#define ui_alien_oclothing "5:14,1:5" //aliens
#define ui_inv1 "6:16,1:5" //borgs
#define ui_inv2 "7:16,1:5" //borgs
#define ui_inv3 "8:16,1:5" //borgs
#define ui_borg_store "9:16,1:5" //borgs
#define ui_monkey_mask "5:14,1:5" //monkey
#define ui_monkey_back "6:14,1:5" //monkey
//Lower right, persistant menu
#define ui_dropbutton "11:22,1:5"
#define ui_drop_throw "14:28,2:7"
#define ui_pull_resist "13:26,2:7"
#define ui_acti "13:26,1:5"
#define ui_movi "12:24,1:5"
#define ui_zonesel "14:28,1:5"
#define ui_acti_alt "14:28,1:5" //alternative intent switcher for when the interface is hidden (F12)
#define ui_borg_pull "12:24,2:7"
#define ui_borg_module "13:26,2:7"
#define ui_borg_panel "14:28,2:7"
//Gun buttons
#define ui_gun1 "13:26,3:7"
#define ui_gun2 "14:28, 4:7"
#define ui_gun3 "13:26,4:7"
#define ui_gun_select "14:28,3:7"
//Upper-middle right (damage indicators)
#define ui_toxin "14:28,13:27"
#define ui_fire "14:28,12:25"
#define ui_oxygen "14:28,11:23"
#define ui_pressure "14:28,10:21"
#define ui_alien_toxin "14:28,13:25"
#define ui_alien_fire "14:28,12:25"
#define ui_alien_oxygen "14:28,11:25"
//Middle right (status indicators)
#define ui_nutrition "14:28,5:11"
#define ui_temp "14:28,6:13"
#define ui_health "14:28,7:15"
#define ui_internal "14:28,8:17"
//borgs
#define ui_borg_health "14:28,6:13" //borgs have the health display where humans have the pressure damage indicator.
#define ui_alien_health "14:28,6:13" //aliens have the health display where humans have the pressure damage indicator.
//Pop-up inventory
#define ui_shoes "2:8,1:5"
#define ui_iclothing "1:6,2:7"
#define ui_oclothing "2:8,2:7"
#define ui_gloves "3:10,2:7"
#define ui_glasses "1:6,3:9"
#define ui_mask "2:8,3:9"
#define ui_l_ear "3:10,3:9"
#define ui_r_ear "3:10,4:11"
#define ui_head "2:8,4:11"
//Intent small buttons
#define ui_help_small "12:8,1:1"
#define ui_disarm_small "12:15,1:18"
#define ui_grab_small "12:32,1:18"
#define ui_harm_small "12:39,1:1"
//#define ui_swapbutton "6:-16,1:5" //Unused
//#define ui_headset "SOUTH,8"
#define ui_hand "6:14,1:5"
#define ui_hstore1 "5,5"
//#define ui_resist "EAST+1,SOUTH-1"
#define ui_sleep "EAST+1, NORTH-13"
#define ui_rest "EAST+1, NORTH-14"
#define ui_iarrowleft "SOUTH-1,11"
#define ui_iarrowright "SOUTH-1,13"

View File

@@ -1,242 +1,241 @@
/datum/hud/proc/alien_hud()
src.adding = list( )
src.other = list( )
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen()
using.name = "drop"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.adding += using
//equippable shit
//suit
inv_box = new /obj/screen/inventory()
inv_box.name = "o_clothing"
inv_box.dir = SOUTH
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_alien_oclothing
inv_box.slot_id = slot_wear_suit
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
using.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
inv_box.slot_id = slot_r_hand
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.layer = 19
inv_box.slot_id = slot_l_hand
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
//pocket 1
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = slot_l_store
inv_box.layer = 19
src.adding += inv_box
//pocket 2
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = slot_r_store
inv_box.layer = 19
src.adding += inv_box
//head
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hair"
inv_box.screen_loc = ui_alien_head
inv_box.slot_id = slot_head
inv_box.layer = 19
src.adding += inv_box
//end of equippable shit
/*
using = new /obj/screen()
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
*/
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()
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()
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()
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()
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()
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()
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()
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.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, 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
/datum/hud/proc/alien_hud()
src.adding = list( )
src.other = list( )
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen()
using.name = "drop"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.adding += using
//equippable shit
//suit
inv_box = new /obj/screen/inventory()
inv_box.name = "o_clothing"
inv_box.dir = SOUTH
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_alien_oclothing
inv_box.slot_id = slot_wear_suit
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
using.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
inv_box.slot_id = slot_r_hand
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.layer = 19
inv_box.slot_id = slot_l_hand
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
//pocket 1
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = slot_l_store
inv_box.layer = 19
src.adding += inv_box
//pocket 2
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = slot_r_store
inv_box.layer = 19
src.adding += inv_box
//head
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hair"
inv_box.screen_loc = ui_alien_head
inv_box.slot_id = slot_head
inv_box.layer = 19
src.adding += inv_box
//end of equippable shit
/*
using = new /obj/screen()
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
*/
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()
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()
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()
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()
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()
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()
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()
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.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, 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

View File

@@ -1,85 +1,81 @@
/datum/hud/proc/larva_hud()
src.adding = list()
src.other = list()
var/obj/screen/using
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
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()
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()
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()
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()
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()
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()
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.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
mymob.client.screen = null
mymob.client.screen += list( mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
/datum/hud/proc/larva_hud()
src.adding = list()
src.other = list()
var/obj/screen/using
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
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()
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()
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()
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()
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()
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()
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.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
mymob.client.screen = null
mymob.client.screen += list( mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other

240
code/_onclick/hud/hud.dm Normal file
View File

@@ -0,0 +1,240 @@
/*
The global hud:
Uses the same visual objects for all players.
*/
var/datum/global_hud/global_hud = new()
/datum/hud/var/obj/screen/grab_intent
/datum/hud/var/obj/screen/hurt_intent
/datum/hud/var/obj/screen/disarm_intent
/datum/hud/var/obj/screen/help_intent
/datum/global_hud
var/obj/screen/druggy
var/obj/screen/blurry
var/list/vimpaired
var/list/darkMask
/datum/global_hud/New()
//420erryday psychedellic colours screen overlay for when you are high
druggy = new /obj/screen()
druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
druggy.icon_state = "druggy"
druggy.layer = 17
druggy.mouse_opacity = 0
//that white blurry effect you get when you eyes are damaged
blurry = new /obj/screen()
blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
blurry.icon_state = "blurry"
blurry.layer = 17
blurry.mouse_opacity = 0
var/obj/screen/O
var/i
//that nasty looking dither you get when you're short-sighted
vimpaired = newlist(/obj/screen,/obj/screen,/obj/screen,/obj/screen)
O = vimpaired[1]
O.screen_loc = "1,1 to 5,15"
O = vimpaired[2]
O.screen_loc = "5,1 to 10,5"
O = vimpaired[3]
O.screen_loc = "6,11 to 10,15"
O = vimpaired[4]
O.screen_loc = "11,1 to 15,15"
//welding mask overlay black/dither
darkMask = newlist(/obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen)
O = darkMask[1]
O.screen_loc = "3,3 to 5,13"
O = darkMask[2]
O.screen_loc = "5,3 to 10,5"
O = darkMask[3]
O.screen_loc = "6,11 to 10,13"
O = darkMask[4]
O.screen_loc = "11,3 to 13,13"
O = darkMask[5]
O.screen_loc = "1,1 to 15,2"
O = darkMask[6]
O.screen_loc = "1,3 to 2,15"
O = darkMask[7]
O.screen_loc = "14,3 to 15,15"
O = darkMask[8]
O.screen_loc = "3,14 to 13,15"
for(i = 1, i <= 4, i++)
O = vimpaired[i]
O.icon_state = "dither50"
O.layer = 17
O.mouse_opacity = 0
O = darkMask[i]
O.icon_state = "dither50"
O.layer = 17
O.mouse_opacity = 0
for(i = 5, i <= 8, i++)
O = darkMask[i]
O.icon_state = "black"
O.layer = 17
O.mouse_opacity = 0
/*
The hud datum
Used to show and hide huds for all the different mob types,
including inventories and item quick actions.
*/
/datum/hud
var/mob/mymob
var/hud_shown = 1 //Used for the HUD toggle (F12)
var/inventory_shown = 1 //the inventory
var/show_intent_icons = 0
var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
var/obj/screen/lingchemdisplay
var/obj/screen/blobpwrdisplay
var/obj/screen/blobhealthdisplay
var/obj/screen/vampire_blood_display // /vg/
var/obj/screen/r_hand_hud_object
var/obj/screen/l_hand_hud_object
var/obj/screen/action_intent
var/obj/screen/move_intent
var/list/adding
var/list/other
var/list/obj/screen/hotkeybuttons
var/list/obj/screen/item_action/item_action_list = list() //Used for the item action ui buttons.
datum/hud/New(mob/owner)
mymob = owner
instantiate()
..()
/datum/hud/proc/hidden_inventory_update()
if(!mymob) return
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(inventory_shown && hud_shown)
if(H.shoes) H.shoes.screen_loc = ui_shoes
if(H.gloves) H.gloves.screen_loc = ui_gloves
if(H.l_ear) H.l_ear.screen_loc = ui_l_ear
if(H.r_ear) H.r_ear.screen_loc = ui_r_ear
if(H.glasses) H.glasses.screen_loc = ui_glasses
if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing
if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing
if(H.wear_mask) H.wear_mask.screen_loc = ui_mask
if(H.head) H.head.screen_loc = ui_head
else
if(H.shoes) H.shoes.screen_loc = null
if(H.gloves) H.gloves.screen_loc = null
if(H.l_ear) H.l_ear.screen_loc = null
if(H.r_ear) H.r_ear.screen_loc = null
if(H.glasses) H.glasses.screen_loc = null
if(H.w_uniform) H.w_uniform.screen_loc = null
if(H.wear_suit) H.wear_suit.screen_loc = null
if(H.wear_mask) H.wear_mask.screen_loc = null
if(H.head) H.head.screen_loc = null
/datum/hud/proc/persistant_inventory_update()
if(!mymob)
return
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(hud_shown)
if(H.s_store) H.s_store.screen_loc = ui_sstore1
if(H.wear_id) H.wear_id.screen_loc = ui_id
if(H.belt) H.belt.screen_loc = ui_belt
if(H.back) H.back.screen_loc = ui_back
if(H.l_store) H.l_store.screen_loc = ui_storage1
if(H.r_store) H.r_store.screen_loc = ui_storage2
else
if(H.s_store) H.s_store.screen_loc = null
if(H.wear_id) H.wear_id.screen_loc = null
if(H.belt) H.belt.screen_loc = null
if(H.back) H.back.screen_loc = null
if(H.l_store) H.l_store.screen_loc = null
if(H.r_store) H.r_store.screen_loc = null
/datum/hud/proc/instantiate()
if(!ismob(mymob)) return 0
if(!mymob.client) return 0
var/ui_style = ui_style2icon(mymob.client.prefs.UI_style)
var/ui_color = mymob.client.prefs.UI_style_color
var/ui_alpha = mymob.client.prefs.UI_style_alpha
if(ishuman(mymob))
human_hud(ui_style, ui_color, ui_alpha) // Pass the player the UI style chosen in preferences
else if(ismonkey(mymob))
monkey_hud(ui_style)
else if(isbrain(mymob))
brain_hud(ui_style)
else if(islarva(mymob))
larva_hud()
else if(isalien(mymob))
alien_hud()
else if(isAI(mymob))
ai_hud()
else if(isrobot(mymob))
robot_hud()
else if(isobserver(mymob))
ghost_hud()
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
/mob/verb/button_pressed_F12()
set name = "F12"
set hidden = 1
if(hud_used)
if(ishuman(src))
if(!src.client) return
if(hud_used.hud_shown)
hud_used.hud_shown = 0
if(src.hud_used.adding)
src.client.screen -= src.hud_used.adding
if(src.hud_used.other)
src.client.screen -= src.hud_used.other
if(src.hud_used.hotkeybuttons)
src.client.screen -= src.hud_used.hotkeybuttons
if(src.hud_used.item_action_list)
src.client.screen -= src.hud_used.item_action_list
//Due to some poor coding some things need special treatment:
//These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
//These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
else
hud_used.hud_shown = 1
if(src.hud_used.adding)
src.client.screen += src.hud_used.adding
if(src.hud_used.other && src.hud_used.inventory_shown)
src.client.screen += src.hud_used.other
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
src.client.screen += src.hud_used.hotkeybuttons
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
src.client.screen += src.zone_sel //This one is a special snowflake
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
else
usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
else
usr << "\red This mob type does not use a HUD."

527
code/_onclick/hud/human.dm Normal file
View File

@@ -0,0 +1,527 @@
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255)
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 /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = ui_style
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
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
move_intent = using
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
using.color = ui_color
using.alpha = ui_alpha
src.hotkeybuttons += using
inv_box = new /obj/screen/inventory()
inv_box.name = "i_clothing"
inv_box.dir = SOUTH
inv_box.icon = ui_style
inv_box.slot_id = slot_w_uniform
inv_box.icon_state = "center"
inv_box.screen_loc = ui_iclothing
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "o_clothing"
inv_box.dir = SOUTH
inv_box.icon = ui_style
inv_box.slot_id = slot_wear_suit
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_oclothing
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.r_hand_hud_object = inv_box
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "id"
inv_box.dir = NORTH
inv_box.icon = ui_style
inv_box.icon_state = "id"
inv_box.screen_loc = ui_id
inv_box.slot_id = slot_wear_id
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.dir = NORTH
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_mask
inv_box.slot_id = slot_wear_mask
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.dir = NORTH
inv_box.icon = ui_style
inv_box.icon_state = "back"
inv_box.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = slot_l_store
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = slot_r_store
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
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.
inv_box.icon_state = "belt"
inv_box.screen_loc = ui_sstore1
inv_box.slot_id = slot_s_store
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
using = new /obj/screen()
using.name = "resist"
using.icon = ui_style
using.icon_state = "act_resist"
using.screen_loc = ui_pull_resist
using.layer = 19
using.color = ui_color
using.alpha = ui_alpha
src.hotkeybuttons += using
using = new /obj/screen()
using.name = "toggle"
using.icon = ui_style
using.icon_state = "other"
using.screen_loc = ui_inventory
using.layer = 20
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
using = new /obj/screen()
using.name = "equip"
using.icon = ui_style
using.icon_state = "act_equip"
using.screen_loc = ui_equip
using.layer = 20
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "gloves"
inv_box.icon = ui_style
inv_box.icon_state = "gloves"
inv_box.screen_loc = ui_gloves
inv_box.slot_id = slot_gloves
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "eyes"
inv_box.icon = ui_style
inv_box.icon_state = "glasses"
inv_box.screen_loc = ui_glasses
inv_box.slot_id = slot_glasses
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_ear"
inv_box.icon = ui_style
inv_box.icon_state = "ears"
inv_box.screen_loc = ui_l_ear
inv_box.slot_id = slot_l_ear
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "r_ear"
inv_box.icon = ui_style
inv_box.icon_state = "ears"
inv_box.screen_loc = ui_r_ear
inv_box.slot_id = slot_r_ear
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = ui_style
inv_box.icon_state = "hair"
inv_box.screen_loc = ui_head
inv_box.slot_id = slot_head
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "shoes"
inv_box.icon = ui_style
inv_box.icon_state = "shoes"
inv_box.screen_loc = ui_shoes
inv_box.slot_id = slot_shoes
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "belt"
inv_box.icon = ui_style
inv_box.icon_state = "belt"
inv_box.screen_loc = ui_belt
inv_box.slot_id = slot_belt
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
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.throw_icon.color = ui_color
mymob.throw_icon.alpha = ui_alpha
src.hotkeybuttons += mymob.throw_icon
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()
mymob.pressure.icon = ui_style
mymob.pressure.icon_state = "pressure0"
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
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()
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()
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()
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()
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()
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()
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()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.mouse_opacity = 0
mymob.blind.layer = 0
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 = 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()
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.pain = new /obj/screen( null )
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel.icon = ui_style
mymob.zone_sel.color = ui_color
mymob.zone_sel.alpha = ui_alpha
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
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.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += src.adding + src.hotkeybuttons
inventory_shown = 0;
return
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
set category = "OOC"
set name = "Toggle hotkey buttons"
set desc = "This disables or enables the user interface buttons which can be used with hotkeys."
if(hud_used.hotkey_ui_hidden)
client.screen += hud_used.hotkeybuttons
hud_used.hotkey_ui_hidden = 0
else
client.screen -= hud_used.hotkeybuttons
hud_used.hotkey_ui_hidden = 1
/mob/living/carbon/human/update_action_buttons()
var/num = 1
if(!hud_used) return
if(!client) return
if(!hud_used.hud_shown) //Hud toggled to minimal
return
client.screen -= hud_used.item_action_list
hud_used.item_action_list = list()
for(var/obj/item/I in src)
if(I.icon_action_button)
var/obj/screen/item_action/A = new(hud_used)
//A.icon = 'icons/mob/screen1_action.dmi'
//A.icon_state = I.icon_action_button
A.icon = ui_style2icon(client.prefs.UI_style)
A.icon_state = "template"
var/image/img = image(I.icon, A, I.icon_state)
img.pixel_x = 0
img.pixel_y = 0
A.overlays += img
if(I.action_button_name)
A.name = I.action_button_name
else
A.name = "Use [I.name]"
A.owner = I
hud_used.item_action_list += A
switch(num)
if(1)
A.screen_loc = ui_action_slot1
if(2)
A.screen_loc = ui_action_slot2
if(3)
A.screen_loc = ui_action_slot3
if(4)
A.screen_loc = ui_action_slot4
if(5)
A.screen_loc = ui_action_slot5
break //5 slots available, so no more can be added.
num++
src.client.screen += src.hud_used.item_action_list

248
code/_onclick/hud/monkey.dm Normal file
View File

@@ -0,0 +1,248 @@
/datum/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_old.dmi')
src.adding = list()
src.other = list()
var/obj/screen/using
var/obj/screen/inventory/inv_box
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.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
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 = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
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
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.dir = NORTH
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_monkey_mask
inv_box.slot_id = slot_wear_mask
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.dir = NORTHEAST
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.layer = 19
src.adding += inv_box
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()
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()
mymob.pressure.icon = ui_style
mymob.pressure.icon_state = "pressure0"
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
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()
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()
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()
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()
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()
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()
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()
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.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = ui_style
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
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.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
return

View File

@@ -0,0 +1,35 @@
/datum/hud/proc/unplayer_hud()
return
/datum/hud/proc/ghost_hud()
return
/datum/hud/proc/brain_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
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
/datum/hud/proc/ai_hud()
return
/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
blobpwrdisplay = new /obj/screen()
blobpwrdisplay.name = "blob power"
blobpwrdisplay.icon_state = "block"
blobpwrdisplay.screen_loc = ui_health
blobpwrdisplay.layer = 20
blobhealthdisplay = new /obj/screen()
blobhealthdisplay.name = "blob health"
blobhealthdisplay.icon_state = "block"
blobhealthdisplay.screen_loc = ui_internal
blobhealthdisplay.layer = 20
mymob.client.screen = null
mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay)

View File

@@ -1,171 +1,170 @@
/datum/hud/proc/robot_hud()
src.adding = list()
src.other = list()
var/obj/screen/using
//Radio
using = new /obj/screen()
using.name = "radio"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "radio"
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
//Module select
using = new /obj/screen()
using.name = "module1"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv1"
using.screen_loc = ui_inv1
using.layer = 20
src.adding += using
mymob:inv1 = using
using = new /obj/screen()
using.name = "module2"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv2"
using.screen_loc = ui_inv2
using.layer = 20
src.adding += using
mymob:inv2 = using
using = new /obj/screen()
using.name = "module3"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv3"
using.screen_loc = ui_inv3
using.layer = 20
src.adding += using
mymob:inv3 = using
//End of module select
//Intent
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//Cell
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()
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()
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 /obj/screen()
using.name = "panel"
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "panel"
using.screen_loc = ui_borg_panel
using.layer = 19
src.adding += using
//Store
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()
mymob.bodytemp.icon_state = "temp0"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
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()
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()
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()
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()
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.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
return
/datum/hud/proc/robot_hud()
src.adding = list()
src.other = list()
var/obj/screen/using
//Radio
using = new /obj/screen()
using.name = "radio"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "radio"
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
//Module select
using = new /obj/screen()
using.name = "module1"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv1"
using.screen_loc = ui_inv1
using.layer = 20
src.adding += using
mymob:inv1 = using
using = new /obj/screen()
using.name = "module2"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv2"
using.screen_loc = ui_inv2
using.layer = 20
src.adding += using
mymob:inv2 = using
using = new /obj/screen()
using.name = "module3"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv3"
using.screen_loc = ui_inv3
using.layer = 20
src.adding += using
mymob:inv3 = using
//End of module select
//Intent
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//Cell
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()
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()
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 /obj/screen()
using.name = "panel"
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "panel"
using.screen_loc = ui_borg_panel
using.layer = 19
src.adding += using
//Store
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()
mymob.bodytemp.icon_state = "temp0"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
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()
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()
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()
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()
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.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
return

View File

@@ -0,0 +1,495 @@
/*
Screen objects
Todo: improve/re-implement
Screen objects are only used for the hud and should not appear anywhere "in-game".
They are used with the client/screen list and the screen_loc var.
For more information, see the byond documentation on the screen_loc and screen vars.
*/
/obj/screen
name = ""
icon = 'icons/mob/screen1.dmi'
layer = 20.0
unacidable = 1
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
var/gun_click_time = -100 //I'm lazy.
/obj/screen/text
icon = null
icon_state = null
mouse_opacity = 0
screen_loc = "CENTER-7,CENTER-7"
maptext_height = 480
maptext_width = 480
/obj/screen/inventory
var/slot_id //The indentifier for the slot. It has nothing to do with ID cards.
/obj/screen/close
name = "close"
/obj/screen/close/Click()
if(master)
if(istype(master, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = master
S.close(usr)
else if(istype(master,/obj/item/clothing/suit/storage))
var/obj/item/clothing/suit/storage/S = master
S.close(usr)
return 1
/obj/screen/item_action
var/obj/item/owner
/obj/screen/item_action/Click()
if(!usr || !owner)
return 1
if(usr.next_move >= world.time)
return
usr.next_move = world.time + 6
if(usr.stat || usr.restrained() || usr.stunned || usr.lying)
return 1
if(!(owner in usr))
return 1
owner.ui_action_click()
return 1
//This is the proc used to update all the action buttons. It just returns for all mob types except humans.
/mob/proc/update_action_buttons()
return
/obj/screen/grab
name = "grab"
/obj/screen/grab/Click()
var/obj/item/weapon/grab/G = master
G.s_click(src)
return 1
/obj/screen/grab/attack_hand()
return
/obj/screen/grab/attackby()
return
/obj/screen/storage
name = "storage"
/obj/screen/storage/Click()
if(world.time <= usr.next_move)
return 1
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
return 1
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
if(master)
var/obj/item/I = usr.get_active_hand()
if(I)
master.attackby(I, usr)
usr.next_move = world.time+2
return 1
/obj/screen/gun
name = "gun"
icon = 'icons/mob/screen1.dmi'
master = null
dir = 2
move
name = "Allow Walking"
icon_state = "no_walk0"
screen_loc = ui_gun2
run
name = "Allow Running"
icon_state = "no_run0"
screen_loc = ui_gun3
item
name = "Allow Item Use"
icon_state = "no_item0"
screen_loc = ui_gun1
mode
name = "Toggle Gun Mode"
icon_state = "gun0"
screen_loc = ui_gun_select
//dir = 1
/obj/screen/zone_sel
name = "damage zone"
icon_state = "zone_sel"
screen_loc = ui_zonesel
var/selecting = "chest"
/obj/screen/zone_sel/Click(location, control,params)
var/list/PL = params2list(params)
var/icon_x = text2num(PL["icon-x"])
var/icon_y = text2num(PL["icon-y"])
var/old_selecting = selecting //We're only going to update_icon() if there's been a change
switch(icon_y)
if(1 to 3) //Feet
switch(icon_x)
if(10 to 15)
selecting = "r_foot"
if(17 to 22)
selecting = "l_foot"
else
return 1
if(4 to 9) //Legs
switch(icon_x)
if(10 to 15)
selecting = "r_leg"
if(17 to 22)
selecting = "l_leg"
else
return 1
if(10 to 13) //Hands and groin
switch(icon_x)
if(8 to 11)
selecting = "r_hand"
if(12 to 20)
selecting = "groin"
if(21 to 24)
selecting = "l_hand"
else
return 1
if(14 to 22) //Chest and arms to shoulders
switch(icon_x)
if(8 to 11)
selecting = "r_arm"
if(12 to 20)
selecting = "chest"
if(21 to 24)
selecting = "l_arm"
else
return 1
if(23 to 30) //Head, but we need to check for eye or mouth
if(icon_x in 12 to 20)
selecting = "head"
switch(icon_y)
if(23 to 24)
if(icon_x in 15 to 17)
selecting = "mouth"
if(26) //Eyeline, eyes are on 15 and 17
if(icon_x in 14 to 18)
selecting = "eyes"
if(25 to 27)
if(icon_x in 15 to 17)
selecting = "eyes"
if(old_selecting != selecting)
update_icon()
return 1
/obj/screen/zone_sel/update_icon()
overlays.Cut()
overlays += image('icons/mob/zone_sel.dmi', "[selecting]")
/obj/screen/Click(location, control, params)
if(!usr) return 1
switch(name)
if("toggle")
if(usr.hud_used.inventory_shown)
usr.hud_used.inventory_shown = 0
usr.client.screen -= usr.hud_used.other
else
usr.hud_used.inventory_shown = 1
usr.client.screen += usr.hud_used.other
usr.hud_used.hidden_inventory_update()
if("equip")
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
H.quick_equip()
if("resist")
if(isliving(usr))
var/mob/living/L = usr
L.resist()
if("mov_intent")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
if(C.legcuffed)
C << "<span class='notice'>You are legcuffed! You cannot run until you get [C.legcuffed] removed!</span>"
C.m_intent = "walk" //Just incase
C.hud_used.move_intent.icon_state = "walking"
return 1
switch(usr.m_intent)
if("run")
usr.m_intent = "walk"
usr.hud_used.move_intent.icon_state = "walking"
if("walk")
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
if(istype(usr,/mob/living/carbon/alien/humanoid))
usr.update_icons()
if("m_intent")
if(!usr.m_int)
switch(usr.m_intent)
if("run")
usr.m_int = "13,14"
if("walk")
usr.m_int = "14,14"
if("face")
usr.m_int = "15,14"
else
usr.m_int = null
if("walk")
usr.m_intent = "walk"
usr.m_int = "14,14"
if("face")
usr.m_intent = "face"
usr.m_int = "15,14"
if("run")
usr.m_intent = "run"
usr.m_int = "13,14"
if("Reset Machine")
usr.unset_machine()
if("internal")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
if(!C.stat && !C.stunned && !C.paralysis && !C.restrained())
if(C.internal)
C.internal = null
C << "<span class='notice'>No longer running on internals.</span>"
if(C.internals)
C.internals.icon_state = "internal0"
else
if(!istype(C.wear_mask, /obj/item/clothing/mask))
C << "<span class='notice'>You are not wearing a mask.</span>"
return 1
else
var/list/nicename = null
var/list/tankcheck = null
var/breathes = "oxygen" //default, we'll check later
var/list/contents = list()
if(ishuman(C))
var/mob/living/carbon/human/H = C
breathes = H.species.breath_type
nicename = list ("suit", "back", "belt", "right hand", "left hand", "left pocket", "right pocket")
tankcheck = list (H.s_store, C.back, H.belt, C.r_hand, C.l_hand, H.l_store, H.r_store)
else
nicename = list("Right Hand", "Left Hand", "Back")
tankcheck = list(C.r_hand, C.l_hand, C.back)
for(var/i=1, i<tankcheck.len+1, ++i)
if(istype(tankcheck[i], /obj/item/weapon/tank))
var/obj/item/weapon/tank/t = tankcheck[i]
if (!isnull(t.manipulated_by) && t.manipulated_by != C.real_name && findtext(t.desc,breathes))
contents.Add(t.air_contents.total_moles) //Someone messed with the tank and put unknown gasses
continue //in it, so we're going to believe the tank is what it says it is
switch(breathes)
//These tanks we're sure of their contents
if("nitrogen") //So we're a bit more picky about them.
if(t.air_contents.nitrogen && !t.air_contents.oxygen)
contents.Add(t.air_contents.nitrogen)
else
contents.Add(0)
if ("oxygen")
if(t.air_contents.oxygen && !t.air_contents.toxins)
contents.Add(t.air_contents.oxygen)
else
contents.Add(0)
// No races breath this, but never know about downstream servers.
if ("carbon dioxide")
if(t.air_contents.carbon_dioxide && !t.air_contents.toxins)
contents.Add(t.air_contents.carbon_dioxide)
else
contents.Add(0)
else
//no tank so we set contents to 0
contents.Add(0)
//Alright now we know the contents of the tanks so we have to pick the best one.
var/best = 0
var/bestcontents = 0
for(var/i=1, i < contents.len + 1 , ++i)
if(!contents[i])
continue
if(contents[i] > bestcontents)
best = i
bestcontents = contents[i]
//We've determined the best container now we set it as our internals
if(best)
C << "<span class='notice'>You are now running on internals from [tankcheck[best]] on your [nicename[best]].</span>"
C.internal = tankcheck[best]
if(C.internal)
if(C.internals)
C.internals.icon_state = "internal1"
else
C << "<span class='notice'>You don't have a[breathes=="oxygen" ? "n oxygen" : addtext(" ",breathes)] tank.</span>"
if("act_intent")
usr.a_intent_change("right")
if("help")
usr.a_intent = "help"
usr.hud_used.action_intent.icon_state = "intent_help"
if("harm")
usr.a_intent = "hurt"
usr.hud_used.action_intent.icon_state = "intent_hurt"
if("grab")
usr.a_intent = "grab"
usr.hud_used.action_intent.icon_state = "intent_grab"
if("disarm")
usr.a_intent = "disarm"
usr.hud_used.action_intent.icon_state = "intent_disarm"
if("pull")
usr.stop_pulling()
if("throw")
if(!usr.stat && isturf(usr.loc) && !usr.restrained())
usr:toggle_throw_mode()
if("drop")
usr.drop_item_v()
if("module")
if(issilicon(usr))
if(usr:module)
return 1
usr:pick_module()
if("radio")
if(issilicon(usr))
usr:radio_menu()
if("panel")
if(issilicon(usr))
usr:installed_modules()
if("store")
if(issilicon(usr))
usr:uneq_active()
if("module1")
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(1)
if("module2")
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(2)
if("module3")
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(3)
if("Allow Walking")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetMove()
gun_click_time = world.time
if("Disallow Walking")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetMove()
gun_click_time = world.time
if("Allow Running")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetRun()
gun_click_time = world.time
if("Disallow Running")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetRun()
gun_click_time = world.time
if("Allow Item Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetClick()
gun_click_time = world.time
if("Disallow Item Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetClick()
gun_click_time = world.time
if("Toggle Gun Mode")
usr.client.ToggleGunMode()
else
return 0
return 1
/obj/screen/inventory/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
if(world.time <= usr.next_move)
return 1
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
return 1
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
switch(name)
if("r_hand")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.activate_hand("r")
usr.next_move = world.time+2
if("l_hand")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.activate_hand("l")
usr.next_move = world.time+2
if("swap")
usr:swap_hand()
if("hand")
usr:swap_hand()
else
if(usr.attack_ui(slot_id))
usr.update_inv_l_hand(0)
usr.update_inv_r_hand(0)
usr.next_move = world.time+6
return 1

View File

@@ -0,0 +1,163 @@
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
/obj/item/proc/attack_self(mob/user)
return
// No comment
/atom/proc/attackby(obj/item/W, mob/user)
return
/atom/movable/attackby(obj/item/W, mob/user)
if(!(W.flags&NOBLUDGEON))
visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>")
/mob/living/attackby(obj/item/I, mob/user)
if(istype(I) && ismob(user))
I.attack(src, user)
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
// Click parameters is the params string from byond Click() code, see that documentation.
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
return
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (!istype(M)) // not sure if this is the right thing...
return
var/messagesource = M
if (can_operate(M)) //Checks if mob is lying down on table for surgery
if (do_surgery(M,user,src))
return
if (istype(M,/mob/living/carbon/brain))
messagesource = M:container
if (hitsound)
playsound(loc, hitsound, 50, 1, -1)
/////////////////////////
user.lastattacked = M
M.lastattacker = user
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>" )
//spawn(1800) // this wont work right
// M.lastattacker = null
/////////////////////////
var/power = force
if(HULK in user.mutations)
power *= 2
if(!istype(M, /mob/living/carbon/human))
if(istype(M, /mob/living/carbon/slime))
var/mob/living/carbon/slime/slime = M
if(prob(25))
user << "\red [src] passes right through [M]!"
return
if(power > 0)
slime.attacked += 10
if(slime.Discipline && prob(50)) // wow, buddy, why am I getting attacked??
slime.Discipline = 0
if(power >= 3)
if(istype(slime, /mob/living/carbon/slime/adult))
if(prob(5 + round(power/2)))
if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++
slime.Victim = null
slime.anchored = 0
spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0
spawn(0)
if(slime)
slime.canmove = 0
step_away(slime, user)
if(prob(25 + power))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1
else
if(prob(10 + power*2))
if(slime)
if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++
if(slime.Discipline == 1)
slime.attacked = 0
spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0
slime.Victim = null
slime.anchored = 0
spawn(0)
if(slime && user)
step_away(slime, user)
slime.canmove = 0
if(prob(25 + power*4))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1
var/showname = "."
if(user)
showname = " by [user]."
if(!(user in viewers(M, null)))
showname = "."
for(var/mob/O in viewers(messagesource, null))
if(attack_verb.len)
O.show_message("\red <B>[M] has been [pick(attack_verb)] with [src][showname] </B>", 1)
else
O.show_message("\red <B>[M] has been attacked with [src][showname] </B>", 1)
if(!showname && user)
if(user.client)
user << "\red <B>You attack [M] with [src]. </B>"
if(istype(M, /mob/living/carbon/human))
M:attacked_by(src, user, def_zone)
else
switch(damtype)
if("brute")
if(istype(src, /mob/living/carbon/slime))
M.adjustBrainLoss(power)
else
M.take_organ_damage(power)
if (prob(33)) // Added blood for whacking non-humans too
var/turf/location = M.loc
if (istype(location, /turf/simulated))
location:add_blood_floor(M)
if("fire")
if (!(COLD_RESISTANCE in M.mutations))
M.take_organ_damage(0, power)
M << "Aargh it burns!"
M.updatehealth()
add_fingerprint(user)
return 1

83
code/_onclick/observer.dm Normal file
View File

@@ -0,0 +1,83 @@
/client/var/inquisitive_ghost = 1
/mob/dead/observer/verb/toggle_inquisition() // warning: unexpected inquisition
set name = "Toggle Inquisitiveness"
set desc = "Sets whether your ghost examines everything on click by default"
set category = "Ghost"
if(!client) return
client.inquisitive_ghost = !client.inquisitive_ghost
if(client.inquisitive_ghost)
src << "\blue You will now examine everything you click on."
else
src << "\blue You will no longer examine things you click on."
/mob/dead/observer/DblClickOn(var/atom/A, var/params)
if(client.buildmode)
build_click(src, client.buildmode, params, A)
return
if(can_reenter_corpse && mind && mind.current)
if(A == mind.current || (mind.current in A)) // double click your corpse or whatever holds it
reenter_corpse() // (cloning scanner, body bag, closet, mech, etc)
return // seems legit.
// Things you might plausibly want to follow
if((ismob(A) && A != src) || istype(A,/obj/machinery/bot) || istype(A,/obj/machinery/singularity))
ManualFollow(A)
// Otherwise jump
else
loc = get_turf(A)
/mob/dead/observer/ClickOn(var/atom/A, var/params)
if(client.buildmode)
build_click(src, client.buildmode, params, A)
return
if(world.time <= next_move) return
next_move = world.time + 8
// You are responsible for checking config.ghost_interaction when you override this function
// Not all of them require checking, see below
A.attack_ghost(src)
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
/atom/proc/attack_ghost(mob/dead/observer/user as mob)
if(user.client && user.client.inquisitive_ghost)
examine()
return
// ---------------------------------------
// And here are some good things for free:
// Now you can click through portals, wormholes, gateways, and teleporters while observing. -Sayu
/obj/machinery/teleport/hub/attack_ghost(mob/user as mob)
var/atom/l = loc
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(l.x - 2, l.y, l.z))
if(com.locked)
user.loc = get_turf(com.locked)
/obj/effect/portal/attack_ghost(mob/user as mob)
if(target)
user.loc = get_turf(target)
/obj/machinery/gateway/centerstation/attack_ghost(mob/user as mob)
if(awaygate)
user.loc = awaygate.loc
else
user << "[src] has no destination."
/obj/machinery/gateway/centeraway/attack_ghost(mob/user as mob)
if(stationgate)
user.loc = stationgate.loc
else
user << "[src] has no destination."
// -------------------------------------------
// This was supposed to be used by adminghosts
// I think it is a *terrible* idea
// but I'm leaving it here anyway
// commented out, of course.
/*
/atom/proc/attack_admin(mob/user as mob)
if(!user || !user.client || !user.client.holder)
return
attack_hand(user)
*/

376
code/_onclick/oldcode.dm Normal file
View File

@@ -0,0 +1,376 @@
/atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE
if(!usr) return
// ------- TIME SINCE LAST CLICK -------
if (world.time <= usr:lastDblClick+1)
return
else
usr:lastDblClick = world.time
//Putting it here for now. It diverts stuff to the mech clicking procs. Putting it here stops us drilling items in our inventory Carn
if(istype(usr.loc,/obj/mecha))
if(usr.client && (src in usr.client.screen))
return
var/obj/mecha/Mech = usr.loc
Mech.click_action(src,usr)
return
// ------- DIR CHANGING WHEN CLICKING ------
if( iscarbon(usr) && !usr.buckled )
if( src.x && src.y && usr.x && usr.y )
var/dx = src.x - usr.x
var/dy = src.y - usr.y
if(dy || dx)
if(abs(dx) < abs(dy))
if(dy > 0) usr.dir = NORTH
else usr.dir = SOUTH
else
if(dx > 0) usr.dir = EAST
else usr.dir = WEST
else
if(pixel_y > 16) usr.dir = NORTH
else if(pixel_y < -16) usr.dir = SOUTH
else if(pixel_x > 16) usr.dir = EAST
else if(pixel_x < -16) usr.dir = WEST
// ------- AI -------
else if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled)
return
// ------- CYBORG -------
else if (istype(usr, /mob/living/silicon/robot))
var/mob/living/silicon/robot/bot = usr
if (bot.lockcharge) return
..()
// ------- SHIFT-CLICK -------
if(params)
var/parameters = params2list(params)
if(parameters["shift"]){
if(!isAI(usr))
ShiftClick(usr)
else
AIShiftClick(usr)
return
}
// ------- ALT-CLICK -------
if(parameters["alt"]){
if(!isAI(usr))
AltClick(usr)
else
AIAltClick(usr)
return
}
// ------- CTRL-CLICK -------
if(parameters["ctrl"]){
if(!isAI(usr))
CtrlClick(usr)
else
AICtrlClick(usr)
return
}
// ------- MIDDLE-CLICK -------
if(parameters["middle"]){
if(!isAI(usr))
MiddleClick(usr)
return
}
// ------- THROW -------
if(usr.in_throw_mode)
return usr:throw_item(src)
// ------- ITEM IN HAND DEFINED -------
var/obj/item/W = usr.get_active_hand()
/* Now handled by get_active_hand()
// ------- ROBOT -------
if(istype(usr, /mob/living/silicon/robot))
if(!isnull(usr:module_active))
W = usr:module_active
else
W = null
*/
// ------- ATTACK SELF -------
if (W == src && usr.stat == 0)
W.attack_self(usr)
if(usr.hand)
usr.update_inv_l_hand(0) //update in-hand overlays
else
usr.update_inv_r_hand(0)
return
// ------- PARALYSIS, STUN, WEAKENED, DEAD, (And not AI) -------
if (((usr.paralysis || usr.stunned || usr.weakened) && !istype(usr, /mob/living/silicon/ai)) || usr.stat != 0)
return
// ------- CLICKING STUFF IN CONTAINERS -------
if ((!( src in usr.contents ) && (((!( isturf(src) ) && (!( isturf(src.loc) ) && (src.loc && !( isturf(src.loc.loc) )))) || !( isturf(usr.loc) )) && (src.loc != usr.loc && (!( istype(src, /obj/screen) ) && !( usr.contents.Find(src.loc) ))))))
if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled || ai.malfhacking)
return
else
return
// ------- 1 TILE AWAY -------
var/t5
// ------- AI CAN CLICK ANYTHING -------
if(istype(usr, /mob/living/silicon/ai))
t5 = 1
// ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF -------
else if(istype(usr, /mob/living/silicon/robot) && !W)
t5 = 1
else
t5 = in_range(src, usr) || src.loc == usr
// world << "according to dblclick(), t5 is [t5]"
// ------- ACTUALLY DETERMINING STUFF -------
if (((t5 || (W && (W.flags & USEDELAY))) && !( istype(src, /obj/screen) )))
// ------- ( CAN USE ITEM OR HAS 1 SECOND USE DELAY ) AND NOT CLICKING ON SCREEN -------
if (usr.next_move < world.time)
usr.prev_move = usr.next_move
usr.next_move = world.time + 10
else
// ------- ALREADY USED ONE ITEM WITH USE DELAY IN THE PREVIOUS SECOND -------
return
// ------- DELAY CHECK PASSED -------
if ((src.loc && (get_dist(src, usr) < 2 || src.loc == usr.loc)))
// ------- CLICKED OBJECT EXISTS IN GAME WORLD, DISTANCE FROM PERSON TO OBJECT IS 1 SQUARE OR THEY'RE ON THE SAME SQUARE -------
var/direct = get_dir(usr, src)
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( usr.loc )
var/ok = 0
if ( (direct - 1) & direct)
// ------- CLICKED OBJECT IS LOCATED IN A DIAGONAL POSITION FROM THE PERSON -------
var/turf/Step_1
var/turf/Step_2
switch(direct)
if(5.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, EAST)
if(6.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, EAST)
if(9.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, WEST)
if(10.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, WEST)
else
if(Step_1 && Step_2)
// ------- BOTH CARDINAL DIRECTIONS OF THE DIAGONAL EXIST IN THE GAME WORLD -------
var/check_1 = 0
var/check_2 = 0
if(step_to(D, Step_1))
check_1 = 1
for(var/obj/border_obstacle in Step_1)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_1 = 0
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON ONE OF THE DIRECITON TILES -------
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON THE TILE YOU'RE ON -------
check_1 = 0
D.loc = usr.loc
if(step_to(D, Step_2))
check_2 = 1
for(var/obj/border_obstacle in Step_2)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_2 = 0
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
check_2 = 0
if(check_1 || check_2)
ok = 1
// ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. -------
/*
More info:
If you're trying to click an item in the north-east of your mob, the above section of code will first check if tehre's a tile to the north or you and to the east of you
These two tiles are Step_1 and Step_2. After this, a new dummy object is created on your location. It then tries to move to Step_1, If it succeeds, objects on the turf you're on and
the turf that Step_1 is are checked for items which have the ON_BORDER flag set. These are itmes which limit you on only one tile border. Windows, for the most part.
CheckExit() and CanPass() are use to determine this. The dummy object is then moved back to your location and it tries to move to Step_2. Same checks are performed here.
If at least one of the two checks succeeds, it means you can reach the item and ok is set to 1.
*/
else
// ------- OBJECT IS ON A CARDINAL TILE (NORTH, SOUTH, EAST OR WEST OR THE TILE YOU'RE ON) -------
if(loc == usr.loc)
ok = 1
// ------- OBJECT IS ON THE SAME TILE AS YOU -------
else
ok = 1
//Now, check objects to block exit that are on the border
for(var/obj/border_obstacle in usr.loc)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
ok = 0
//Next, check objects to block entry that are on the border
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
ok = 0
/*
See the previous More info, for... more info...
*/
//del(D)
// Garbage Collect Dummy
D.loc = null
D = null
// ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE -------
if (!( ok ))
// ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE -------
return 0
if (!( usr.restrained() || (usr.lying && usr.buckled!=src) ))
// ------- YOU ARE NOT REASTRAINED -------
if (W)
// ------- YOU HAVE AN ITEM IN YOUR HAND - HANDLE ATTACKBY AND AFTERATTACK -------
var/ignoreAA = 0 //Ignore afterattack(). Surgery uses this.
if (t5)
ignoreAA = src.attackby(W, usr)
if (W && !ignoreAA)
W.afterattack(src, usr, (t5 ? 1 : 0), params)
else
// ------- YOU DO NOT HAVE AN ITEM IN YOUR HAND -------
if (istype(usr, /mob/living/carbon/human))
// ------- YOU ARE HUMAN -------
src.attack_hand(usr, usr.hand)
else
// ------- YOU ARE NOT HUMAN. WHAT ARE YOU - DETERMINED HERE AND PROPER ATTACK_MOBTYPE CALLED -------
if (istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
if(usr.m_intent == "walk" && istype(usr, /mob/living/carbon/alien/humanoid/hunter))
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
usr.update_icons()
src.attack_alien(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/larva))
src.attack_larva(usr)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.attack_ai(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/slime))
src.attack_slime(usr)
else if(istype(usr, /mob/living/simple_animal))
src.attack_animal(usr)
else
// ------- YOU ARE RESTRAINED. DETERMINE WHAT YOU ARE AND ATTACK WITH THE PROPER HAND_X PROC -------
if (istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.hand_a(usr, usr.hand)
else
// ------- ITEM INACESSIBLE OR CLICKING ON SCREEN -------
if (istype(src, /obj/screen))
// ------- IT'S THE HUD YOU'RE CLICKING ON -------
usr.prev_move = usr.next_move
usr:lastDblClick = world.time + 2
if (usr.next_move < world.time)
usr.next_move = world.time + 2
else
return
// ------- 2 DECISECOND DELAY FOR CLICKING PASSED -------
if (!( usr.restrained() ))
// ------- YOU ARE NOT RESTRAINED -------
if ((W && !( istype(src, /obj/screen) )))
// ------- IT SHOULD NEVER GET TO HERE, DUE TO THE ISTYPE(SRC, /OBJ/SCREEN) FROM PREVIOUS IF-S - I TESTED IT WITH A DEBUG OUTPUT AND I COULDN'T GET THIST TO SHOW UP. -------
src.attackby(W, usr)
if (W)
W.afterattack(src, usr,, params)
else
// ------- YOU ARE NOT RESTRAINED, AND ARE CLICKING A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
src.attack_hand(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.attack_alien(usr, usr.hand)
else
// ------- YOU ARE RESTRAINED CLICKING ON A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else
// ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD -------
if((LASER in usr:mutations) && usr:a_intent == "harm" && world.time >= usr.next_move)
// ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED -------
var/turf/T = get_turf(usr)
var/turf/U = get_turf(src)
if(istype(usr, /mob/living/carbon/human))
usr:nutrition -= rand(1,5)
usr:handle_regular_hud_updates()
var/obj/item/projectile/beam/A = new /obj/item/projectile/beam( usr.loc )
A.icon = 'icons/effects/genetics.dmi'
A.icon_state = "eyelasers"
playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
A.firer = usr
A.def_zone = usr:get_organ_target()
A.original = src
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
spawn( 1 )
A.process()
usr.next_move = world.time + 6
return

124
code/_onclick/other_mobs.dm Normal file
View File

@@ -0,0 +1,124 @@
/*
Humans:
Adds an exception for gloves, to allow special glove types like the ninja ones.
Otherwise pretty standard.
*/
/mob/living/carbon/human/UnarmedAttack(var/atom/A, var/proximity)
var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines
// Special glove functions:
// If the gloves do anything, have them return 1 to stop
// normal attack_hand() here.
if(proximity && istype(G) && G.Touch(A,1))
return
A.attack_hand(src)
/atom/proc/attack_hand(mob/user as mob)
return
/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
return
/mob/living/carbon/human/RangedAttack(var/atom/A)
if(!gloves && !mutations.len) return
var/obj/item/clothing/gloves/G = gloves
if((LASER in mutations) && a_intent == "harm")
LaserEyes(A) // moved into a proc below
else if(istype(G) && G.Touch(A,0)) // for magic gloves
return
else if(TK in mutations)
switch(get_dist(src,A))
if(1 to 5) // not adjacent may mean blocked by window
next_move += 2
if(5 to 7)
next_move += 5
if(8 to 15)
next_move += 10
if(16 to 128)
return
A.attack_tk(src)
/*
Animals & All Unspecified
*/
/mob/living/UnarmedAttack(var/atom/A)
A.attack_animal(src)
/atom/proc/attack_animal(mob/user as mob)
return
/mob/living/RestrainedClickOn(var/atom/A)
return
/*
Monkeys
*/
/mob/living/carbon/monkey/UnarmedAttack(var/atom/A)
A.attack_paw(src)
/atom/proc/attack_paw(mob/user as mob)
return
/*
Monkey RestrainedClickOn() was apparently the
one and only use of all of the restrained click code
(except to stop you from doing things while handcuffed);
moving it here instead of various hand_p's has simplified
things considerably
*/
/mob/living/carbon/monkey/RestrainedClickOn(var/atom/A)
if(a_intent != "harm" || !ismob(A)) return
if(istype(wear_mask, /obj/item/clothing/mask/muzzle))
return
var/mob/living/carbon/ML = A
var/dam_zone = ran_zone(pick("chest", "l_hand", "r_hand", "l_leg", "r_leg"))
var/armor = ML.run_armor_check(dam_zone, "melee")
if(prob(75))
ML.apply_damage(rand(1,3), BRUTE, dam_zone, armor)
for(var/mob/O in viewers(ML, null))
O.show_message("\red <B>[name] has bit [ML]!</B>", 1)
if(armor >= 2) return
if(ismonkey(ML))
for(var/datum/disease/D in viruses)
if(istype(D, /datum/disease/jungle_fever))
ML.contract_disease(D,1,0)
else
for(var/mob/O in viewers(ML, null))
O.show_message("\red <B>[src] has attempted to bite [ML]!</B>", 1)
/*
Aliens
Defaults to same as monkey in most places
*/
/mob/living/carbon/alien/UnarmedAttack(var/atom/A)
A.attack_alien(src)
/atom/proc/attack_alien(mob/user as mob)
attack_paw(user)
return
/mob/living/carbon/alien/RestrainedClickOn(var/atom/A)
return
// Babby aliens
/mob/living/carbon/alien/larva/UnarmedAttack(var/atom/A)
A.attack_larva(src)
/atom/proc/attack_larva(mob/user as mob)
return
/*
Slimes
Nothing happening here
*/
/mob/living/carbon/slime/UnarmedAttack(var/atom/A)
A.attack_slime(src)
/atom/proc/attack_slime(mob/user as mob)
return
/mob/living/carbon/slime/RestrainedClickOn(var/atom/A)
return
/*
New Players:
Have no reason to click on anything at all.
*/
/mob/new_player/ClickOn()
return

View File

@@ -0,0 +1,208 @@
/*
Telekinesis
This needs more thinking out, but I might as well.
*/
var/const/tk_maxrange = 15
/*
Telekinetic attack:
By default, emulate the user's unarmed attack
*/
/atom/proc/attack_tk(mob/user)
if(user.stat) return
user.UnarmedAttack(src,0) // attack_hand, attack_paw, etc
return
/*
This is similar to item attack_self, but applies to anything
that you can grab with a telekinetic grab.
It is used for manipulating things at range, for example, opening and closing closets.
There are not a lot of defaults at this time, add more where appropriate.
*/
/atom/proc/attack_self_tk(mob/user)
return
/obj/attack_tk(mob/user)
if(user.stat) return
if(anchored)
..()
return
var/obj/item/tk_grab/O = new(src)
user.put_in_active_hand(O)
O.host = user
O.focus_object(src)
return
/obj/item/attack_tk(mob/user)
if(user.stat || !isturf(loc)) return
if((TK in user.mutations) && !user.get_active_hand()) // both should already be true to get here
var/obj/item/tk_grab/O = new(src)
user.put_in_active_hand(O)
O.host = user
O.focus_object(src)
else
warning("Strange attack_tk(): TK([TK in user.mutations]) empty hand([!user.get_active_hand()])")
return
/mob/attack_tk(mob/user)
return // needs more thinking about
/*
TK Grab Item (the workhorse of old TK)
* If you have not grabbed something, do a normal tk attack
* If you have something, throw it at the target. If it is already adjacent, do a normal attackby()
* If you click what you are holding, or attack_self(), do an attack_self_tk() on it.
* Deletes itself if it is ever not in your hand, or if you should have no access to TK.
*/
/obj/item/tk_grab
name = "Telekinetic Grab"
desc = "Magic"
icon = 'icons/obj/magic.dmi'//Needs sprites
icon_state = "2"
flags = NOBLUDGEON
//item_state = null
w_class = 10.0
layer = 20
var/last_throw = 0
var/atom/movable/focus = null
var/mob/living/host = null
dropped(mob/user as mob)
if(focus && user && loc != user && loc != user.loc) // drop_item() gets called when you tk-attack a table/closet with an item
if(focus.Adjacent(loc))
focus.loc = loc
del(src)
return
//stops TK grabs being equipped anywhere but into hands
equipped(var/mob/user, var/slot)
if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return
del(src)
return
attack_self(mob/user as mob)
if(focus)
focus.attack_self_tk(user)
afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity)//TODO: go over this
if(!target || !user) return
if(last_throw+3 > world.time) return
if(!host || host != user)
del(src)
return
if(!(TK in host.mutations))
del(src)
return
if(isobj(target) && !isturf(target.loc))
return
var/d = get_dist(user, target)
if(focus) d = max(d,get_dist(user,focus)) // whichever is further
switch(d)
if(0)
;
if(1 to 5) // not adjacent may mean blocked by window
if(!proximity)
user.next_move += 2
if(5 to 7)
user.next_move += 5
if(8 to tk_maxrange)
user.next_move += 10
else
user << "\blue Your mind won't reach that far."
return
if(!focus)
focus_object(target, user)
return
if(target == focus)
target.attack_self_tk(user)
return // todo: something like attack_self not laden with assumptions inherent to attack_self
if(!istype(target, /turf) && istype(focus,/obj/item) && target.Adjacent(focus))
var/obj/item/I = focus
var/resolved = target.attackby(I, user, user:get_organ_target())
if(!resolved && target && I)
I.afterattack(target,user,1) // for splashing with beakers
else
apply_focus_overlay()
focus.throw_at(target, 10, 1)
last_throw = world.time
return
attack(mob/living/M as mob, mob/living/user as mob, def_zone)
return
proc/focus_object(var/obj/target, var/mob/living/user)
if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
if(target.anchored || !isturf(target.loc))
del src
return
focus = target
update_icon()
apply_focus_overlay()
return
proc/apply_focus_overlay()
if(!focus) return
var/obj/effect/overlay/O = new /obj/effect/overlay(locate(focus.x,focus.y,focus.z))
O.name = "sparkles"
O.anchored = 1
O.density = 0
O.layer = FLY_LAYER
O.dir = pick(cardinal)
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "nothing"
flick("empdisable",O)
spawn(5)
O.delete()
return
update_icon()
overlays.Cut()
if(focus && focus.icon && focus.icon_state)
overlays += icon(focus.icon,focus.icon_state)
return
/*Not quite done likely needs to use something thats not get_step_to
proc/check_path()
var/turf/ref = get_turf(src.loc)
var/turf/target = get_turf(focus.loc)
if(!ref || !target) return 0
var/distance = get_dist(ref, target)
if(distance >= 10) return 0
for(var/i = 1 to distance)
ref = get_step_to(ref, target, 0)
if(ref != target) return 0
return 1
*/
//equip_to_slot_or_del(obj/item/W, slot, del_on_fail = 1)
/*
if(istype(user, /mob/living/carbon))
if(user:mutations & TK && get_dist(source, user) <= 7)
if(user:get_active_hand()) return 0
var/X = source:x
var/Y = source:y
var/Z = source:z
*/

View File

@@ -65,6 +65,12 @@
var/automute_on = 0 //enables automuting/spam prevention
var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access.
var/cult_ghostwriter = 1 //Allows ghosts to write in blood in cult rounds...
var/cult_ghostwriter_req_cultists = 10 //...so long as this many cultists are active.
var/disable_player_mice = 0
var/uneducated_mice = 0 //Set to 1 to prevent newly-spawned mice from understanding human speech
var/usealienwhitelist = 0
var/limitalienplayers = 0
var/alien_to_human_ratio = 0.5
@@ -86,6 +92,7 @@
//game_options.txt configs
var/health_threshold_softcrit = 0
var/health_threshold_crit = 0
var/health_threshold_dead = -100
@@ -435,6 +442,12 @@
if("ghost_interaction")
config.ghost_interaction = 1
if("disable_player_mice")
config.disable_player_mice = 1
if("uneducated_mice")
config.uneducated_mice = 1
if("comms_password")
config.comms_password = value
@@ -455,6 +468,12 @@
config.python_path = "/usr/bin/env python2"
else //probably windows, if not this should work anyway
config.python_path = "python"
if("allow_cult_ghostwriter")
config.cult_ghostwriter = 1
if("req_cult_ghostwriter")
config.cult_ghostwriter_req_cultists = value
if("assistant_limit")
config.assistantlimit = 1
if("assistant_ratio")
@@ -462,7 +481,6 @@
else
diary << "Unknown setting in configuration: '[name]'"
else if(type == "game_options")
if(!value)
diary << "Unknown value for setting [name] in [filename]."
@@ -471,6 +489,8 @@
switch(name)
if("health_threshold_crit")
config.health_threshold_crit = value
if("health_threshold_softcrit")
config.health_threshold_softcrit = value
if("health_threshold_dead")
config.health_threshold_dead = value
if("revival_pod_plants")

View File

@@ -794,7 +794,8 @@ datum/mind
var/mob/living/carbon/human/H = current
del(H.belt)
del(H.back)
del(H.ears)
del(H.l_ear)
del(H.r_ear)
del(H.gloves)
del(H.head)
del(H.shoes)
@@ -1096,7 +1097,8 @@ datum/mind
var/mob/living/carbon/human/H = current
del(H.belt)
del(H.back)
del(H.ears)
del(H.l_ear)
del(H.r_ear)
del(H.gloves)
del(H.head)
del(H.shoes)

View File

@@ -176,11 +176,11 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
sparks.start()
if(smoke_spread)
if(smoke_spread == 1)
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is
smoke.start()
else if(smoke_spread == 2)
var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread()
var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad()
smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is
smoke.start()

View File

@@ -246,8 +246,8 @@ its easier to just keep the beam vertical.
//usr << "[name]: Dn:[density] dir:[dir] cont:[contents] icon:[icon] is:[icon_state] loc:[loc]"
return
/atom/proc/MouseDrop_T()
return
// /atom/proc/MouseDrop_T()
// return
/atom/proc/relaymove()
return
@@ -260,7 +260,7 @@ its easier to just keep the beam vertical.
/atom/proc/fire_act()
return
/*
/atom/proc/attack_hand(mob/user as mob)
return
@@ -324,18 +324,19 @@ its easier to just keep the beam vertical.
/atom/proc/hand_m(mob/user as mob) //slime - restrained
return
*/
/atom/proc/hitby(atom/movable/AM as mob|obj)
return
/*
/atom/proc/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (!(istype(W, /obj/item/weapon/grab) ) && !(istype(W, /obj/item/weapon/plastique)) && !(istype(W, /obj/item/weapon/reagent_containers/spray)) && !(istype(W, /obj/item/weapon/packageWrap)) && !istype(W, /obj/item/device/detective_scanner))
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O << "\red <B>[src] has been hit by [user] with [W]</B>"
return
*/
/atom/proc/add_hiddenprint(mob/living/M as mob)
if(isnull(M)) return
if(isnull(M.key)) return
@@ -459,7 +460,9 @@ its easier to just keep the beam vertical.
return 0
if(!blood_DNA || !istype(blood_DNA, /list)) //if our list of DNA doesn't exist yet (or isn't a list) initialise it.
blood_DNA = list()
blood_color = "#A10808"
if (M.species)
blood_color = M.species.blood_color
//adding blood to humans
else if (istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
@@ -487,619 +490,6 @@ its easier to just keep the beam vertical.
return 1
/atom/MouseDrop(atom/over_object as mob|obj|turf|area)
spawn(0)
if (istype(over_object, /atom))
over_object.MouseDrop_T(src, usr)
return
..()
return
/atom/Click(location,control,params)
//world << "atom.Click() on [src] by [usr] : src.type is [src.type]"
var/acting_bad = 1 //Check for gun targeting code.
if (istype(src,/obj/item/weapon/gun)) //Allow people to lower weapon
acting_bad = 0
if (istype(src, /turf) && istype(usr,/mob/living/carbon/human)) //Allow people to turn around
var/mob/living/carbon/human/H = usr
if (!H.equipped())
acting_bad = 0
if(acting_bad)
usr.last_target_click = world.time
if(usr.client.buildmode)
build_click(usr, usr.client.buildmode, location, control, params, src)
return
return DblClick(location, control, params)
/atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE
if(!usr) return
// ------- TIME SINCE LAST CLICK -------
if (world.time <= usr:lastDblClick+1)
// world << "BLOCKED atom.DblClick() on [src] by [usr] : src.type is [src.type]"
return
else
// world << "atom.DblClick() on [src] by [usr] : src.type is [src.type]"
usr:lastDblClick = world.time
// AI camera shit
if(isAI(usr))
if(usr:aicamera.in_camera_mode)
usr:aicamera.camera_mode_off()
usr:aicamera.captureimage(src, usr)
return
//Putting it here for now. It diverts stuff to the mech clicking procs. Putting it here stops us drilling items in our inventory Carn
if(istype(usr.loc,/obj/mecha))
if(usr.client && (src in usr.client.screen))
return
var/obj/mecha/Mech = usr.loc
Mech.click_action(src,usr)
return
// ------- DIR CHANGING WHEN CLICKING ------
if( iscarbon(usr) && !usr.buckled )
if( src.x && src.y && usr.x && usr.y )
var/dx = src.x - usr.x
var/dy = src.y - usr.y
if(dy || dx)
if(abs(dx) < abs(dy))
if(dy > 0) usr.dir = NORTH
else usr.dir = SOUTH
else
if(dx > 0) usr.dir = EAST
else usr.dir = WEST
else
if(pixel_y > 16) usr.dir = NORTH
else if(pixel_y < -16) usr.dir = SOUTH
else if(pixel_x > 16) usr.dir = EAST
else if(pixel_x < -16) usr.dir = WEST
// ------- AI -------
else if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled)
return
// ------- CYBORG -------
else if (istype(usr, /mob/living/silicon/robot))
var/mob/living/silicon/robot/bot = usr
if (bot.lockcharge) return
..()
// ------- SHIFT-CLICK -------
if(params)
var/parameters = params2list(params)
if(parameters["shift"]){
if(!isAI(usr)/* && !isAdminGhost(usr)*/)
ShiftClick(usr)
else
//if(isAdminGhost(usr))
// log_adminghost("[key_name(usr)] shift-clicked on [src]!")
AIShiftClick(usr)
return
}
// ------- ALT-CLICK -------
if(parameters["alt"]){
if(isrobot(usr))
RobotAltClick(usr)
else if(isovermind(usr))
OvermindAltClick(usr)
else if(!isAI(usr))
AltClick(usr)
else
AIAltClick(usr)
return
}
// ------- CTRL-CLICK -------
if(parameters["ctrl"]){
if(isovermind(usr))
OvermindCtrlClick(usr)
else if(!isAI(usr))
CtrlClick(usr)
else
AICtrlClick(usr)
return
}
// ------- MIDDLE-CLICK -------
if(parameters["middle"]){
if(!isAI(usr) && !isAdminGhost(usr))
MiddleClick(usr)
return
}
// ------- THROW -------
if(usr.in_throw_mode)
return usr:throw_item(src)
// ------- ITEM IN HAND DEFINED -------
var/obj/item/W = usr.get_active_hand()
/* Now handled by get_active_hand()
// ------- ROBOT -------
if(istype(usr, /mob/living/silicon/robot))
if(!isnull(usr:module_active))
W = usr:module_active
else
W = null
*/
// ------- ATTACK SELF -------
if (W == src && usr.stat == 0)
W.attack_self(usr)
if(usr.hand)
usr.update_inv_l_hand() //update in-hand overlays
else
usr.update_inv_r_hand()
return
// ------- PARALYSIS, STUN, WEAKENED, DEAD, (And not AI/AGhost) -------
if ((((usr.paralysis || usr.stunned || usr.weakened) && !istype(usr, /mob/living/silicon/ai)) || usr.stat != 0) && !isobserver(usr))
return
// ------- CLICKING STUFF IN CONTAINERS -------
if ((!( src in usr.contents ) && (((!( isturf(src) ) && (!( isturf(src.loc) ) && (src.loc && !( isturf(src.loc.loc) )))) || !( isturf(usr.loc) )) && (src.loc != usr.loc && (!( istype(src, /obj/screen) ) && !( usr.contents.Find(src.loc) ))))))
if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled || ai.malfhacking)
return
else
return
// ------- 1 TILE AWAY -------
var/t5
// ------- AI CAN CLICK ANYTHING -------
if(istype(usr, /mob/living/silicon/ai))
t5 = 1
// ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF -------
else if(istype(usr, /mob/living/silicon/robot) && !W)
t5 = 1
else
t5 = in_range(src, usr) || src.loc == usr
// world << "according to dblclick(), t5 is [t5]"
// ------- ACTUALLY DETERMINING STUFF -------
if (((t5 || (W && (W.flags & USEDELAY))) && !( istype(src, /obj/screen) )))
// ------- ( CAN USE ITEM OR HAS 1 SECOND USE DELAY ) AND NOT CLICKING ON SCREEN -------
if (usr.next_move < world.time)
usr.prev_move = usr.next_move
usr.next_move = world.time + 10
else
// ------- ALREADY USED ONE ITEM WITH USE DELAY IN THE PREVIOUS SECOND -------
return
// ------- DELAY CHECK PASSED -------
if ((src.loc && (get_dist(src, usr) < 2 || src.loc == usr.loc)))
// ------- CLICKED OBJECT EXISTS IN GAME WORLD, DISTANCE FROM PERSON TO OBJECT IS 1 SQUARE OR THEY'RE ON THE SAME SQUARE -------
var/direct = get_dir(usr, src)
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( usr.loc )
var/ok = 0
if ( (direct - 1) & direct)
// ------- CLICKED OBJECT IS LOCATED IN A DIAGONAL POSITION FROM THE PERSON -------
var/turf/Step_1
var/turf/Step_2
switch(direct)
if(5.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, EAST)
if(6.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, EAST)
if(9.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, WEST)
if(10.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, WEST)
else
if(Step_1 && Step_2)
// ------- BOTH CARDINAL DIRECTIONS OF THE DIAGONAL EXIST IN THE GAME WORLD -------
var/check_1 = 0
var/check_2 = 0
if(step_to(D, Step_1))
check_1 = 1
for(var/obj/border_obstacle in Step_1)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_1 = 0
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON ONE OF THE DIRECITON TILES -------
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON THE TILE YOU'RE ON -------
check_1 = 0
D.loc = usr.loc
if(step_to(D, Step_2))
check_2 = 1
for(var/obj/border_obstacle in Step_2)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_2 = 0
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
check_2 = 0
if(check_1 || check_2)
ok = 1
// ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. -------
/*
More info:
If you're trying to click an item in the north-east of your mob, the above section of code will first check if tehre's a tile to the north or you and to the east of you
These two tiles are Step_1 and Step_2. After this, a new dummy object is created on your location. It then tries to move to Step_1, If it succeeds, objects on the turf you're on and
the turf that Step_1 is are checked for items which have the ON_BORDER flag set. These are itmes which limit you on only one tile border. Windows, for the most part.
CheckExit() and CanPass() are use to determine this. The dummy object is then moved back to your location and it tries to move to Step_2. Same checks are performed here.
If at least one of the two checks succeeds, it means you can reach the item and ok is set to 1.
*/
else
// ------- OBJECT IS ON A CARDINAL TILE (NORTH, SOUTH, EAST OR WEST OR THE TILE YOU'RE ON) -------
if(loc == usr.loc)
ok = 1
// ------- OBJECT IS ON THE SAME TILE AS YOU -------
else
ok = 1
//Now, check objects to block exit that are on the border
for(var/obj/border_obstacle in usr.loc)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
ok = 0
//Next, check objects to block entry that are on the border
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
ok = 0
/*
See the previous More info, for... more info...
*/
//del(D)
// Garbage Collect Dummy
D.loc = null
D = null
// ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE -------
if (!( ok ))
// ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE -------
return 0
if (!( usr.restrained() || (usr.lying && usr.buckled!=src) ))
// ------- YOU ARE NOT RESTRAINED -------
if (W)
// ------- YOU HAVE AN ITEM IN YOUR HAND - HANDLE ATTACKBY AND AFTERATTACK -------
if (t5)
src.attackby(W, usr)
if (W)
W.afterattack(src, usr, (t5 ? 1 : 0), params)
else
// ------- YOU DO NOT HAVE AN ITEM IN YOUR HAND -------
if (istype(usr, /mob/living/carbon/human))
// ------- YOU ARE HUMAN -------
src.attack_hand(usr, usr.hand)
else
// ------- YOU ARE NOT HUMAN. WHAT ARE YOU - DETERMINED HERE AND PROPER ATTACK_MOBTYPE CALLED -------
if (istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (isobserver(usr))
src.attack_ghost(usr)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
if(usr.m_intent == "walk" && istype(usr, /mob/living/carbon/alien/humanoid/hunter))
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
usr.update_icons()
src.attack_alien(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/larva))
src.attack_larva(usr)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)/* || isobserver(usr)*/)
src.attack_ai(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/slime))
src.attack_slime(usr)
else if(istype(usr, /mob/living/simple_animal))
src.attack_animal(usr)
else
// ------- YOU ARE RESTRAINED. DETERMINE WHAT YOU ARE AND ATTACK WITH THE PROPER HAND_X PROC -------
if (istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.hand_a(usr, usr.hand)
else
// ------- ITEM INACESSIBLE OR CLICKING ON SCREEN -------
if (istype(src, /obj/screen))
// ------- IT'S THE HUD YOU'RE CLICKING ON -------
usr.prev_move = usr.next_move
usr:lastDblClick = world.time + 2
if (usr.next_move < world.time)
usr.next_move = world.time + 2
else
return
// ------- 2 DECISECOND DELAY FOR CLICKING PASSED -------
if (!( usr.restrained() ))
// ------- YOU ARE NOT RESTRAINED -------
if ((W && !( istype(src, /obj/screen) )))
// ------- IT SHOULD NEVER GET TO HERE, DUE TO THE ISTYPE(SRC, /OBJ/SCREEN) FROM PREVIOUS IF-S - I TESTED IT WITH A DEBUG OUTPUT AND I COULDN'T GET THIST TO SHOW UP. -------
src.attackby(W, usr)
if (W)
W.afterattack(src, usr,, params)
else
// ------- YOU ARE NOT RESTRAINED, AND ARE CLICKING A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
src.attack_hand(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.attack_alien(usr, usr.hand)
else
// ------- YOU ARE RESTRAINED CLICKING ON A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else
// ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD -------
if(ishuman(usr) && (istype(usr:gloves, /obj/item/clothing/gloves/yellow/power)) && usr:a_intent == "hurt" && world.time >= usr.next_move)
var/obj/item/clothing/gloves/yellow/power/G = usr:gloves
var/time = 100
var/turf/T = get_turf(usr)
var/turf/U = get_turf(src)
var/obj/structure/cable/cable = locate() in T
if(!cable || !istype(cable))
return
if(world.time < G.next_shock)
usr << "<span class='warning'>[G] aren't ready to shock again!</span>"
return
usr.visible_message("<span class='warning'>[usr.name] fires an arc of electricity!</span>", \
"<span class='warning'>You fire an arc of electricity!</span>", \
"You hear the loud crackle of electricity!")
var/datum/powernet/PN = cable.get_powernet()
var/available = 0
var/obj/item/projectile/beam/lightning/A = new /obj/item/projectile/beam/lightning/( usr.loc )
if(PN)
available = PN.avail
A.damage = PN.get_electrocute_damage()
if(available >= 5000000)
A.damage = 205
if(A.damage >= 200)
usr:apply_damage(15, BURN, (usr:hand ? "l_hand" : "r_hand"))
usr:Stun(15)
usr:Weaken(15)
if(usr:status_flags & CANSTUN) // stun is usually associated with stutter
usr:stuttering += 20
time = 200
usr << "<span class='warning'>[G] overload from the massive current shocking you in the process!"
else if(A.damage >= 100)
usr:apply_damage(5, BURN, (usr:hand ? "l_hand" : "r_hand"))
usr:Stun(10)
usr:Weaken(10)
if(usr:status_flags & CANSTUN) // stun is usually associated with stutter
usr:stuttering += 10
time = 150
usr << "<span class='warning'>[G] overload from the massive current shocking you in the process!"
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, usr)
s.start()
if(A.damage <= 0)
del(A)
if(A)
playsound(usr.loc, 'sound/effects/eleczap.ogg', 75, 1)
A.tang = A.adjustAngle(get_angle(U,T))
A.icon = midicon
A.icon_state = "[A.tang]"
A.firer = usr
A.def_zone = usr:get_organ_target()
A.original = src
A.current = U
A.starting = U
A.yo = U.y - T.y
A.xo = U.x - T.x
spawn( 1 )
A.process()
usr.next_move = world.time + 12
G.next_shock = world.time + time
else if((LASER in usr:mutations) && usr:a_intent == "hurt" && world.time >= usr.next_move)
// ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED -------
var/turf/T = get_turf(usr)
var/turf/U = get_turf(src)
if(istype(usr, /mob/living/carbon/human))
usr:nutrition -= rand(1,5)
usr:handle_regular_hud_updates()
var/obj/item/projectile/beam/A = new /obj/item/projectile/beam( usr.loc )
A.icon = 'icons/effects/genetics.dmi'
A.icon_state = "eyelasers"
playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
A.firer = usr
A.def_zone = usr:get_organ_target()
A.original = src
A.current = T
A.starting = U
A.yo = U.y - T.y
A.xo = U.x - T.x
spawn( 1 )
A.process()
usr.next_move = world.time + 6
return
/atom/proc/ShiftClick(var/mob/M as mob)
if(istype(M.machine, /obj/machinery/computer/security)) //No examining by looking through cameras
return
//I dont think this was ever really a problem and it's only creating more bugs...
// if(( abs(src.x-M.x)<8 || abs(src.y-M.y)<8 ) && src.z == M.z ) //This should prevent non-observers to examine stuff from outside their view.
examine()
return
/atom/proc/AltClick()
var/turf/T = get_turf(src)
T.AltClick()
/* // NOT UNTIL I FIGURE OUT A GOOD WAY TO DO THIS SHIT
if((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
if(!istype(src, /obj/item) && !istype(src, /mob) && !istype(src, /turf))
if(!usr.get_active_hand())
var/liftable = 0
for(var/x in liftable_structures)
if(findtext("[src.type]", "[x]"))
liftable = 1
break
if(liftable)
add_fingerprint(usr)
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(usr)
G.assailant = usr
usr.put_in_active_hand(G)
G.structure = src
G.synch()
visible_message("\red [usr] has picked up [src]!")
return
else
usr << "\red You can't pick this up!"
*/
return
/atom/proc/CtrlClick()
if(hascall(src,"pull"))
src:pull()
return
/atom/proc/OvermindCtrlClick(var/mob/camera/blob/blob)
if(istype(src, /turf))
blob.click_expand_blob(src)
return
/atom/proc/OvermindAltClick(var/mob/camera/blob/blob)
if(istype(src, /obj/effect/blob/normal))
blob.click_create_shield(src)
return
/atom/proc/RobotAltClick() // Opens and closes doors!
if(istype(src , /obj/machinery/door/airlock))
if(src:density)
var/nhref = "src=\ref[src];aiEnable=7"
src.Topic(nhref, params2list(nhref), src, 1)
else
var/nhref = "src=\ref[src];aiDisable=7"
src.Topic(nhref, params2list(nhref), src, 1)
else
var/turf/T = get_turf(src)
T.AltClick()
return
/turf/AltClick()
if(!usr)
return
if(usr.listed_turf == src)
usr.listed_turf = null
else
usr.listed_turf = src
if(usr.client && !(get_dist(src,usr) > 1))
usr.client.statpanel = "[src.name]"
/atom/proc/AIShiftClick() // Opens and closes doors!
if(istype(src , /obj/machinery/door/airlock))
if(src:density)
var/nhref = "src=\ref[src];aiEnable=7"
src.Topic(nhref, params2list(nhref), src, 1)
else
var/nhref = "src=\ref[src];aiDisable=7"
src.Topic(nhref, params2list(nhref), src, 1)
return
/atom/proc/AIAltClick() // Eletrifies doors.
if(istype(src , /obj/machinery/door/airlock))
if(!src:secondsElectrified)
var/nhref = "src=\ref[src];aiEnable=6"
src.Topic(nhref, params2list(nhref), src, 1)
else
var/nhref = "src=\ref[src];aiDisable=5"
src.Topic(nhref, params2list(nhref), src, 1)
return
/atom/proc/AICtrlClick() // Bolts doors, turns off APCs.
if(istype(src , /obj/machinery/door/airlock))
if(src:locked)
var/nhref = "src=\ref[src];aiEnable=4"
src.Topic(nhref, params2list(nhref), src, 1)
else
var/nhref = "src=\ref[src];aiDisable=4"
src.Topic(nhref, params2list(nhref), src, 1)
else if (istype(src , /obj/machinery/power/apc/))
var/nhref = "src=\ref[src];breaker=1"
src.Topic(nhref, params2list(nhref), 0)
return
/atom/proc/MiddleClick(var/mob/M as mob) // switch hands
if(istype(M, /mob/living/carbon))
var/mob/living/carbon/U = M
U.swap_hand()
/atom/proc/get_global_map_pos()
if(!islist(global_map) || isemptylist(global_map)) return
var/cur_x = null
@@ -1118,16 +508,3 @@ its easier to just keep the beam vertical.
/atom/proc/checkpass(passflag)
return pass_flags&passflag
/*
/client/verb/check_dummy()
set name = "List Dummies"
set category = "Debug"
var/list/dummies = list()
for(var/obj/item/weapon/dummy/D in world)
usr << "[D] - [D.x], [D.y], [D.z] - [D.loc]"
dummies += D
usr << "[dummies.len] found!"
*/

View File

@@ -153,7 +153,7 @@
//done throwing, either because it hit something or it finished moving
src.throwing = 0
if(isobj(src)) src:throw_impact(get_turf(src),speed)
if(isobj(src)) src.throw_impact(get_turf(src),speed)
//Overlays

View File

@@ -104,8 +104,8 @@ var/list/radiochannels = list(
"Medical" = 1355,
"Engineering" = 1357,
"Security" = 1359,
"Response Team" = 1443,
"Deathsquad" = 1441,
"Response Team" = 1345,
"Deathsquad" = 1341,
"Syndicate" = 1213,
"Supply" = 1347,
)
@@ -116,13 +116,13 @@ var/list/DEPT_FREQS = list(
1357,
1359,
1213,
1443,
1441,
1345,
1341,
1347
)
// central command channels, i.e deathsquid & response teams
var/list/CENT_FREQS = list(1441, 1443)
var/list/CENT_FREQS = list(1345, 1341)
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
var/const/SYND_FREQ = 1213

View File

@@ -86,7 +86,7 @@
src << "<span class='warning'>This creature's DNA is ruined beyond useability!</span>"
return
if(!G.killing)
if(!G.state == GRAB_KILL)
src << "<span class='warning'>We must have a tighter grip to absorb this creature.</span>"
return
@@ -205,6 +205,10 @@
var/datum/changeling/changeling = changeling_power(1,0,0)
if(!changeling) return
if(src.has_brain_worms())
src << "<span class='warning'>We cannot perform this ability at the present time!</span>"
return
var/mob/living/carbon/C = src
changeling.chem_charges--
C.remove_changeling_powers()

View File

@@ -57,7 +57,7 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
if(!ninjacost(,2))
var/mob/living/carbon/human/U = affecting
U << "\blue There are <B>[s_bombs]</B> smoke bombs remaining."
var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread()
var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad()
smoke.set_up(10, 0, U.loc)
smoke.start()
playsound(U.loc, 'sound/effects/bamf.ogg', 50, 2)

View File

@@ -527,7 +527,7 @@ As such, it's hard-coded for now. No reason for it not to be, really.
del(gloves)
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src)
equip_to_slot_or_del(R, slot_ears)
equip_to_slot_or_del(R, slot_l_ear)
if(gender==FEMALE)
equip_to_slot_or_del(new /obj/item/clothing/under/color/blackf(src), slot_w_uniform)
else

View File

@@ -205,7 +205,7 @@
var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(synd_mob)
R.set_frequency(radio_freq)
synd_mob.equip_to_slot_or_del(R, slot_ears)
synd_mob.equip_to_slot_or_del(R, slot_l_ear)
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(synd_mob), slot_w_uniform)
synd_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(synd_mob), slot_shoes)

View File

@@ -114,14 +114,14 @@
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_ears)
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/device/pda/engineering(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes)
// M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store)
//M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears)
//M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
if (prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
@@ -136,7 +136,7 @@
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_ears)
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes)
@@ -159,7 +159,7 @@
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_ears)
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/utilitybelt(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_engineer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes)
@@ -180,7 +180,7 @@
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears)
M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
//M.equip_to_slot_or_del(new /obj/item/weapon/gun/revolver(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)

View File

@@ -213,7 +213,7 @@
M.current.visible_message("\red [M.current.name] lets out an ear piercing shriek!", "\red You let out a loud shriek.", "\red You hear a loud painful shriek!")
for(var/mob/living/carbon/C in ohearers(4, M.current))
if(C == M.current) continue
if(ishuman(C) && C:ears && istype(C:ears, /obj/item/clothing/ears/earmuffs)) continue
if(ishuman(C) && C:is_on_ears(/obj/item/clothing/ears/earmuffs)) continue
if(!C.vampire_affected(M)) continue
C << "<span class='warning'><font size='3'><b>You hear a ear piercing shriek and your senses dull!</font></b></span>"
C.Weaken(8)

View File

@@ -163,7 +163,7 @@
del(wizard_mob.r_store)
del(wizard_mob.l_store)
wizard_mob.equip_to_slot_or_del(new /obj/item/device/radio/headset(wizard_mob), slot_ears)
wizard_mob.equip_to_slot_or_del(new /obj/item/device/radio/headset(wizard_mob), slot_l_ear)
wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(wizard_mob), slot_w_uniform)
wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(wizard_mob), slot_shoes)
wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(wizard_mob), slot_wear_suit)

View File

@@ -14,7 +14,7 @@
minimal_player_age = 14
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/captain(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/captain(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/captain(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_cap(H), slot_back)
@@ -35,6 +35,9 @@
L.imp_in = H
L.implanted = 1
world << "<b>[H.real_name] is the captain!</b>"
var/datum/organ/external/affected = H.organs_by_name["head"]
affected.implants += L
L.part = affected
return 1
get_access()
@@ -70,7 +73,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/hop(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/hop(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)

View File

@@ -116,7 +116,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_cargo(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_cargo(H), slot_l_ear)
H.equip_to_slot_or_drop(new /obj/item/clothing/under/rank/cargo(H), slot_w_uniform)
H.equip_to_slot_or_drop(new /obj/item/clothing/shoes/brown(H), slot_shoes)
H.equip_to_slot_or_drop(new /obj/item/device/pda/quartermaster(H), slot_belt)
@@ -146,7 +146,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_cargo(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_cargo(H), slot_l_ear)
H.equip_to_slot_or_drop(new /obj/item/clothing/under/rank/cargotech(H), slot_w_uniform)
H.equip_to_slot_or_drop(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_drop(new /obj/item/device/pda/cargo(H), slot_belt)
@@ -174,7 +174,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_cargo (H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_cargo (H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/industrial(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back)

View File

@@ -22,7 +22,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/ce(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/ce(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/industrial(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back)
@@ -57,7 +57,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_eng(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_eng(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/industrial(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back)
@@ -91,7 +91,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_eng(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_eng(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)

View File

@@ -19,7 +19,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/cmo(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/cmo(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
@@ -53,7 +53,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
@@ -115,7 +115,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
H.equip_to_slot_or_drop(new /obj/item/clothing/under/rank/chemist(H), slot_w_uniform)
H.equip_to_slot_or_drop(new /obj/item/clothing/shoes/white(H), slot_shoes)
H.equip_to_slot_or_drop(new /obj/item/device/pda/chemist(H), slot_belt)
@@ -143,7 +143,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_medsci(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_medsci(H), slot_l_ear)
H.equip_to_slot_or_drop(new /obj/item/clothing/under/rank/geneticist(H), slot_w_uniform)
H.equip_to_slot_or_drop(new /obj/item/clothing/shoes/white(H), slot_shoes)
H.equip_to_slot_or_drop(new /obj/item/device/pda/geneticist(H), slot_belt)
@@ -171,7 +171,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
@@ -204,7 +204,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)

View File

@@ -12,7 +12,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_med(H), slot_l_ear)
if(H.backbag == 2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/medic (H), slot_back)
if(H.backbag == 3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
H.equip_to_slot_or_drop(new /obj/item/clothing/under/rank/medical/paramedic(H), slot_w_uniform)

View File

@@ -26,7 +26,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/rd(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/rd(H), slot_l_ear)
H.equip_to_slot_or_drop(new /obj/item/clothing/shoes/brown(H), slot_shoes)
H.equip_to_slot_or_drop(new /obj/item/clothing/under/rank/research_director(H), slot_w_uniform)
H.equip_to_slot_or_drop(new /obj/item/device/pda/heads/rd(H), slot_belt)
@@ -60,7 +60,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sci(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sci(H), slot_l_ear)
H.equip_to_slot_or_drop(new /obj/item/clothing/under/rank/scientist(H), slot_w_uniform)
H.equip_to_slot_or_drop(new /obj/item/clothing/shoes/white(H), slot_shoes)
H.equip_to_slot_or_drop(new /obj/item/device/pda/toxins(H), slot_belt)
@@ -93,7 +93,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sci(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sci(H), slot_l_ear)
if(H.backbag == 2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack(H), slot_back)
if(H.backbag == 3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
H.equip_to_slot_or_drop(new /obj/item/clothing/under/rank/roboticist(H), slot_w_uniform)

View File

@@ -25,7 +25,7 @@
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/security(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
if(4) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/hos(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/heads/hos(H), slot_l_ear)
H.equip_to_slot_or_drop(new /obj/item/clothing/under/rank/head_of_security(H), slot_w_uniform)
H.equip_to_slot_or_drop(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
H.equip_to_slot_or_drop(new /obj/item/device/pda/heads/hos(H), slot_belt)
@@ -61,7 +61,7 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/security(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
@@ -103,7 +103,7 @@
minimal_player_age = 7
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
@@ -151,7 +151,7 @@
minimal_player_age = 7
equip(var/mob/living/carbon/human/H)
if(!H) return 0
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
H.equip_to_slot_or_drop(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
switch(H.backbag)
if(2) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/security(H), slot_back)
if(3) H.equip_to_slot_or_drop(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)

View File

@@ -419,7 +419,7 @@ var/global/datum/controller/occupations/job_master
H << "<b>You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.</b>"
spawnId(H, rank, alt_title)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_ears)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_l_ear)
//Gives glasses to the vision impaired
if(H.disabilities & DISABILITY_FLAG_NEARSIGHTED)

View File

@@ -44,11 +44,6 @@
if(prob(75))
del(src)
/obj/machinery/optable/hand_p(mob/user as mob)
return src.attack_paw(user)
return
/obj/machinery/optable/attack_paw(mob/user as mob)
if ((HULK in usr.mutations))
usr << text("\blue You destroy the operating table.")
@@ -137,22 +132,44 @@
/obj/machinery/optable/process()
check_victim()
/obj/machinery/optable/attackby(obj/item/weapon/W as obj, mob/living/carbon/user as mob)
/obj/machinery/optable/proc/take_victim(mob/living/carbon/C, mob/living/carbon/user as mob)
if (C == user)
user.visible_message("[user] climbs on the operating table.","You climb on the operating table.")
else
visible_message("\red [C] has been laid on the operating table by [user].", 3)
if (C.client)
C.client.perspective = EYE_PERSPECTIVE
C.client.eye = src
C.resting = 1
C.loc = src.loc
for(var/obj/O in src)
O.loc = src.loc
src.add_fingerprint(user)
if(ishuman(C))
var/mob/living/carbon/human/H = C
src.victim = H
icon_state = H.pulse ? "table2-active" : "table2-idle"
else
icon_state = "table2-idle"
/obj/machinery/optable/verb/climb_on()
set name = "Climb On Table"
set category = "Object"
set src in oview(1)
if(usr.stat || !ishuman(usr) || usr.buckled || usr.restrained())
return
if(src.victim)
usr << "\blue <B>The table is already occupied!</B>"
return
take_victim(usr,usr)
/obj/machinery/optable/attackby(obj/item/weapon/W as obj, mob/living/carbon/user as mob)
if (istype(W, /obj/item/weapon/grab))
if(ismob(W:affecting))
var/mob/M = W:affecting
if (M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.resting = 1
M.loc = src.loc
visible_message("\red [M] has been laid on the operating table by [user].", 3)
for(var/obj/O in src)
O.loc = src.loc
src.add_fingerprint(user)
icon_state = "table2-active"
src.victim = M
if(iscarbon(W:affecting))
take_victim(W:affecting,usr)
del(W)
return
if(isrobot(user)) return

View File

@@ -55,6 +55,8 @@
var/datum/job/janitor/J = new/datum/job/janitor
src.botcard.access = J.get_access()
src.locked = 0 // Start unlocked so roboticist can set them to patrol.
if(radio_controller)
radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS)
@@ -300,33 +302,30 @@ text("<A href='?src=\ref[src];operation=oddbutton'>[src.oddbutton ? "Yes" : "No"
target_types += /obj/effect/decal/cleanable/blood/oil
target_types += /obj/effect/decal/cleanable/vomit
target_types += /obj/effect/decal/cleanable/blood/robot
target_types += /obj/effect/decal/cleanable/crayon
target_types += /obj/effect/decal/cleanable/liquid_fuel
target_types += /obj/effect/decal/cleanable/mucus
if(src.blood)
target_types += /obj/effect/decal/cleanable/blood/xeno/
target_types += /obj/effect/decal/cleanable/blood/xeno/xgibs
target_types += /obj/effect/decal/cleanable/blood/
target_types += /obj/effect/decal/cleanable/blood/tracks
target_types += /obj/effect/decal/cleanable/blood/gibs/
target_types += /obj/effect/decal/cleanable/dirt
/obj/machinery/bot/cleanbot/proc/clean(var/obj/effect/decal/cleanable/target)
src.anchored = 1
src.icon_state = "cleanbot-c"
anchored = 1
icon_state = "cleanbot-c"
visible_message("\red [src] begins to clean up the [target]")
src.cleaning = 1
cleaning = 1
var/cleantime = 50
if(istype(target,/obj/effect/decal/cleanable/dirt)) // Clean Dirt much faster
cleantime = 10
spawn(cleantime)
src.cleaning = 0
del(target)
src.icon_state = "cleanbot[src.on]"
src.anchored = 0
src.target = null
icon_state = "cleanbot[on]"
anchored = 0
target = null
/obj/machinery/bot/cleanbot/explode()
src.on = 0

View File

@@ -27,7 +27,7 @@
for(var/x in verbs)
verbs -= x
set_broken()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
smoke.set_up(5, 0, src)
smoke.start()
return

View File

@@ -79,13 +79,15 @@
continue
O.Weaken(strength)
if ((O.eye_stat > 15 && prob(O.eye_stat + 50)))
flick("e_flash", O:flash)
O.eye_stat += rand(1, 2)
if (istype(O, /mob/living/carbon/human))
var/mob/living/carbon/human/H = O
var/datum/organ/internal/eyes/E = H.internal_organs["eyes"]
if ((E.damage > E.min_bruised_damage && prob(E.damage + 50)))
flick("e_flash", O:flash)
E.damage += rand(1, 5)
else
if(!O.blinded)
flick("flash", O:flash)
O.eye_stat += rand(0, 2)
/obj/machinery/flasher/emp_act(severity)

View File

@@ -294,7 +294,7 @@ obj/machinery/gibber/New()
B.loc = src.loc
B.throw_at(Tx,2,3)
if(isalien(victim))
new /obj/effect/decal/cleanable/blood/xeno/xgibs(Tx,2)
new /obj/effect/decal/cleanable/blood/gibs/xeno(Tx,2)
else
new /obj/effect/decal/cleanable/blood/gibs(Tx,2)
del(victim)

View File

@@ -14,7 +14,7 @@
var/smoke = 5
var/smoke_ready = 1
var/smoke_cooldown = 100
var/datum/effect/effect/system/harmless_smoke_spread/smoke_system = new
var/datum/effect/effect/system/smoke_spread/smoke_system = new
operation_req_access = list(access_cent_specops)
wreckage = /obj/effect/decal/mecha_wreckage/marauder
add_req_access = 0

View File

@@ -20,6 +20,11 @@
action(atom/target)
if(!action_checks(target)) return
if(!cargo_holder) return
if(istype(target, /obj/structure/stool)) return
for(var/M in target.contents)
if(istype(M, /mob/living))
return
if(istype(target,/obj))
var/obj/O = target
if(!O.anchored)
@@ -455,8 +460,18 @@
var/atom/movable/locked
var/mode = 1 //1 - gravsling 2 - gravpush
var/last_fired = 0 //Concept stolen from guns.
var/fire_delay = 10 //Used to prevent spam-brute against humans.
action(atom/movable/target)
if(world.time >= last_fired + fire_delay)
last_fired = world.time
else
if (world.time % 3)
occupant_message("<span class='warning'>[src] is not ready to fire again!")
return 0
switch(mode)
if(1)
if(!action_checks(target) && !locked) return
@@ -503,6 +518,7 @@
return "[..()] [mode==1?"([locked||"Nothing"])":null] \[<a href='?src=\ref[src];mode=1'>S</a>|<a href='?src=\ref[src];mode=2'>P</a>\]"
Topic(href, href_list)
..()
if(href_list["mode"])
mode = text2num(href_list["mode"])
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())

View File

@@ -137,7 +137,7 @@
for(var/mob/living/carbon/M in ohearers(6, chassis))
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(istype(H.ears, /obj/item/clothing/ears/earmuffs))
if(istype(H.l_ear, /obj/item/clothing/ears/earmuffs) || istype(H.r_ear, /obj/item/clothing/ears/earmuffs))
continue
M << "<font color='red' size='7'>HONK</font>"
M.sleeping = 0

View File

@@ -110,6 +110,11 @@
for(var/mob/O in oviewers(src))
O.show_message("\red [usr] destroys the [name]!", 1)
health = 0
else
usr << "\blue You claw at the [name]."
for(var/mob/O in oviewers(src))
O.show_message("\red [usr] claws at the [name]!", 1)
health -= rand(5,10)
healthcheck()
return

View File

@@ -1,8 +1,8 @@
/obj/effect/sign/barsign
/obj/effect/sign/double/barsign
icon = 'icons/obj/barsigns.dmi'
icon_state = "empty"
anchored = 1
New()
var/list/valid_states = list("pinkflamingo", "magmasea", "limbo", "rustyaxe", "armokbar", "brokendrum", "meadbay", "thedamnwall", "thecavern", "cindikate", "theorchard", "thesaucyclown", "theclownshead")
var/list/valid_states = list("pinkflamingo", "magmasea", "limbo", "rustyaxe", "armokbar", "brokendrum", "meadbay", "thedamnwall", "thecavern", "cindikate", "theorchard", "thesaucyclown", "theclownshead", "whiskeyimplant", "carpecarp", "robustroadhouse", "greytide", "theredshirt")
src.icon_state = "[pick(valid_states)]"

View File

@@ -3,52 +3,33 @@
/obj/effect/decal/cleanable/blood/xeno
name = "xeno blood"
desc = "It's green and acidic. It looks like... <i>blood?</i>"
basecolor="#38F500" // Color when wet.
icon = 'icons/effects/blood.dmi'
icon_state = "xfloor1"
random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7")
basecolor = "#05EE05"
/obj/effect/decal/cleanable/blood/xeno/proc/streak(var/list/directions)
spawn (0)
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
sleep(3)
if (i > 0)
var/obj/effect/decal/cleanable/blood/xeno/b = new /obj/effect/decal/cleanable/blood/xeno/xsplatter(src.loc)
for(var/datum/disease/D in src.viruses)
var/datum/disease/ND = D.Copy(1)
b.viruses += ND
ND.holder = b
if (step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/blood/xeno/xsplatter
random_icon_states = list("xgibbl1", "xgibbl2", "xgibbl3", "xgibbl4", "xgibbl5")
/obj/effect/decal/cleanable/blood/xeno/xgibs
/obj/effect/decal/cleanable/blood/gibs/xeno
name = "xeno gibs"
desc = "Gnarly..."
gender = PLURAL
icon = 'icons/effects/blood.dmi'
icon_state = "xgib1"
random_icon_states = list("xgib1", "xgib2", "xgib3", "xgib4", "xgib5", "xgib6")
basecolor = "#05EE05"
/obj/effect/decal/cleanable/blood/xeno/xgibs/up
/obj/effect/decal/cleanable/blood/gibs/xeno/update_icon()
color = "#FFFFFF"
/obj/effect/decal/cleanable/blood/gibs/xeno/up
random_icon_states = list("xgib1", "xgib2", "xgib3", "xgib4", "xgib5", "xgib6","xgibup1","xgibup1","xgibup1")
/obj/effect/decal/cleanable/blood/xeno/xgibs/down
/obj/effect/decal/cleanable/blood/gibs/xeno/down
random_icon_states = list("xgib1", "xgib2", "xgib3", "xgib4", "xgib5", "xgib6","xgibdown1","xgibdown1","xgibdown1")
/obj/effect/decal/cleanable/blood/xeno/xgibs/body
/obj/effect/decal/cleanable/blood/gibs/xeno/body
random_icon_states = list("xgibhead", "xgibtorso")
/obj/effect/decal/cleanable/blood/xeno/xgibs/limb
/obj/effect/decal/cleanable/blood/gibs/xeno/limb
random_icon_states = list("xgibleg", "xgibarm")
/obj/effect/decal/cleanable/blood/xeno/xgibs/core
/obj/effect/decal/cleanable/blood/gibs/xeno/core
random_icon_states = list("xgibmid1", "xgibmid2", "xgibmid3")
/obj/effect/decal/cleanable/blood/xtracks
icon_state = "xtracks"
random_icon_states = null
basecolor = "#05EE05"

View File

@@ -1,15 +1,18 @@
#define DRYING_TIME 5 * 60*10 //for 1 unit of depth in puddle (amount var)
var/global/list/image/splatter_cache=list()
/obj/effect/decal/cleanable/blood
name = "blood"
desc = "It's red and gooey. Perhaps it's the chef's cooking?"
desc = "It's thick and gooey. Perhaps it's the chef's cooking?"
gender = PLURAL
density = 0
anchored = 1
layer = 2
icon = 'icons/effects/blood.dmi'
icon_state = "floor1"
random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7")
icon_state = "mfloor1"
random_icon_states = list("mfloor1", "mfloor2", "mfloor3", "mfloor4", "mfloor5", "mfloor6", "mfloor7")
var/base_icon = 'icons/effects/blood.dmi'
var/list/viruses = list()
blood_DNA = list()
var/basecolor="#A10808" // Color when wet.
@@ -23,6 +26,7 @@
/obj/effect/decal/cleanable/blood/New()
..()
update_icon()
if(istype(src, /obj/effect/decal/cleanable/blood/gibs))
return
if(istype(src, /obj/effect/decal/cleanable/blood/tracks))
@@ -37,6 +41,10 @@
spawn(DRYING_TIME * (amount+1))
dry()
/obj/effect/decal/cleanable/blood/update_icon()
if(basecolor == "rainbow") basecolor = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
color = basecolor
/obj/effect/decal/cleanable/blood/HasEntered(mob/living/carbon/human/perp)
if (!istype(perp))
return
@@ -44,17 +52,18 @@
return
if(perp.shoes)
perp.shoes:track_blood = max(amount,perp.shoes:track_blood) //Adding blood to shoes
perp.shoes:track_blood = max(amount,perp.shoes:track_blood) //Adding blood to shoes
if(!perp.shoes.blood_overlay)
perp.shoes.generate_blood_overlay()
if(!perp.shoes.blood_DNA)
perp.shoes.blood_DNA = list()
perp.shoes.blood_overlay.color = basecolor
perp.shoes.overlays += perp.shoes.blood_overlay
perp.update_inv_shoes(1)
perp.shoes.blood_DNA |= blood_DNA.Copy()
perp.shoes.blood_color=basecolor
else
perp.track_blood = max(amount,perp.track_blood) //Or feet
perp.track_blood = max(amount,perp.track_blood) //Or feet
if(!perp.feet_blood_DNA)
perp.feet_blood_DNA = list()
perp.feet_blood_DNA |= blood_DNA.Copy()
@@ -63,15 +72,30 @@
amount--
/obj/effect/decal/cleanable/blood/proc/dry()
name = "dried [src]"
desc = "It's dark red and crusty. Someone is not doing their job."
var/icon/I = icon(icon,icon_state)
I.SetIntensity(0.7)
icon = I
name = "dried [src.name]"
desc = "It's dry and crusty. Someone is not doing their job."
color = adjust_brightness(color, -50)
amount = 0
/obj/effect/decal/cleanable/blood/attack_hand(mob/living/carbon/human/user)
..()
if (amount && istype(user))
add_fingerprint(user)
if (user.gloves)
return
var/taken = rand(1,amount)
amount -= taken
user << "<span class='notice'>You get some of \the [src] on your hands.</span>"
if (!user.blood_DNA)
user.blood_DNA = list()
user.blood_DNA |= blood_DNA.Copy()
user.bloody_hands += taken
user.hand_blood_color = basecolor
user.update_inv_gloves(1)
user.verbs += /mob/living/carbon/human/proc/bloody_doodle
/obj/effect/decal/cleanable/blood/splatter
random_icon_states = list("gibbl1", "gibbl2", "gibbl3", "gibbl4", "gibbl5")
random_icon_states = list("mgibbl1", "mgibbl2", "mgibbl3", "mgibbl4", "mgibbl5")
amount = 2
/obj/effect/decal/cleanable/blood/drip
@@ -80,8 +104,30 @@
gender = PLURAL
icon = 'icons/effects/drip.dmi'
icon_state = "1"
random_icon_states = list("1","2","3","4","5")
amount = 0
/obj/effect/decal/cleanable/blood/writing
icon_state = "tracks"
desc = "It looks like a writing in blood."
gender = NEUTER
random_icon_states = list("writing1","writing2","writing3","writing4","writing5")
amount = 0
var/message
/obj/effect/decal/cleanable/blood/writing/New()
..()
if(random_icon_states.len)
for(var/obj/effect/decal/cleanable/blood/writing/W in loc)
random_icon_states.Remove(W.icon_state)
icon_state = pick(random_icon_states)
else
icon_state = "writing1"
/obj/effect/decal/cleanable/blood/writing/examine()
..()
usr << "It reads: <font color='[basecolor]'>\"[message]\"<font>"
/obj/effect/decal/cleanable/blood/gibs
name = "gibs"
desc = "They look bloody and gruesome."
@@ -92,6 +138,22 @@
icon = 'icons/effects/blood.dmi'
icon_state = "gibbl5"
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6")
var/fleshcolor = "#FFFFFF"
/obj/effect/decal/cleanable/blood/gibs/update_icon()
var/image/giblets = new(base_icon, "[icon_state]_flesh", dir)
if(!fleshcolor || fleshcolor == "rainbow")
fleshcolor = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
giblets.color = fleshcolor
var/icon/blood = new(base_icon,"[icon_state]",dir)
if(basecolor == "rainbow") basecolor = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
blood.Blend(basecolor,ICON_MULTIPLY)
icon = blood
overlays.Cut()
overlays += giblets
/obj/effect/decal/cleanable/blood/gibs/up
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibup1","gibup1","gibup1")
@@ -116,6 +178,8 @@
sleep(3)
if (i > 0)
var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(src.loc)
b.basecolor = src.basecolor
b.update_icon()
for(var/datum/disease/D in src.viruses)
var/datum/disease/ND = D.Copy(1)
b.viruses += ND
@@ -135,6 +199,7 @@
icon = 'icons/effects/blood.dmi'
icon_state = "mucus"
random_icon_states = list("mucus")
var/list/datum/disease2/disease/virus2 = list()
var/dry=0 // Keeps the lag down

View File

@@ -32,6 +32,7 @@
layer = 2
icon = 'icons/effects/effects.dmi'
icon_state = "dirt"
mouse_opacity = 0
/obj/effect/decal/cleanable/flour
name = "flour"

View File

@@ -1,20 +1,26 @@
/obj/effect/decal/cleanable/blood/robot
/obj/effect/decal/cleanable/blood/gibs/robot
name = "robot debris"
desc = "It's a useless heap of junk... <i>or is it?</i>"
icon = 'icons/mob/robots.dmi'
icon_state = "gib1"
basecolor="#2B2B2B"
basecolor="#030303"
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7")
/obj/effect/decal/cleanable/blood/robot/proc/streak(var/list/directions)
/obj/effect/decal/cleanable/blood/gibs/robot/update_icon()
color = "#FFFFFF"
/obj/effect/decal/cleanable/blood/gibs/robot/dry() //pieces of robots do not dry up like
return
/obj/effect/decal/cleanable/blood/gibs/robot/streak(var/list/directions)
spawn (0)
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
sleep(3)
if (i > 0)
if (prob(40))
/*var/obj/effect/decal/cleanable/blood/oil/o =*/
new /obj/effect/decal/cleanable/blood/oil/streak(src.loc)
var/obj/effect/decal/cleanable/blood/oil/streak = new(src.loc)
streak.update_icon()
else if (prob(10))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
@@ -22,27 +28,23 @@
if (step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/blood/robot/limb
/obj/effect/decal/cleanable/blood/gibs/robot/limb
random_icon_states = list("gibarm", "gibleg")
/obj/effect/decal/cleanable/blood/robot/up
/obj/effect/decal/cleanable/blood/gibs/robot/up
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibup1","gibup1") //2:7 is close enough to 1:4
/obj/effect/decal/cleanable/blood/robot/down
/obj/effect/decal/cleanable/blood/gibs/robot/down
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibdown1","gibdown1") //2:7 is close enough to 1:4
/obj/effect/decal/cleanable/blood/oil
name = "motor oil"
desc = "It's black and greasy. Looks like Beepsky made another mess."
basecolor="#2B2B2B"
icon = 'icons/mob/robots.dmi'
icon_state = "floor1"
random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7")
basecolor="#030303"
Del()
for(var/datum/disease/D in viruses)
D.cure(0)
..()
/obj/effect/decal/cleanable/blood/oil/dry()
return
/obj/effect/decal/cleanable/blood/oil/streak
random_icon_states = list("streak1", "streak2", "streak3", "streak4", "streak5")
random_icon_states = list("mgibbl1", "mgibbl2", "mgibbl3", "mgibbl4", "mgibbl5")
amount = 2

View File

@@ -33,6 +33,7 @@ var/global/list/image/fluidtrack_cache=list()
random_icon_states = null
var/dirs=0
icon = 'icons/effects/fluidtracks.dmi'
icon_state = ""
var/coming_state="blood1"
var/going_state="blood2"
var/updatedtracks=0
@@ -115,9 +116,6 @@ var/global/list/image/fluidtrack_cache=list()
if(updated)
update_icon()
process()
return PROCESS_KILL
update_icon()
// Clear everything.
// Comment after the FIXME below is fixed.
@@ -151,22 +149,8 @@ var/global/list/image/fluidtrack_cache=list()
if(track.overlay)
track.overlay=null
//var/cache_key="[track.basecolor]|[state]|[track.direction]|[track.wet<t?"1":"0"]"
var/cache_key="[track.basecolor]|[state]|[track.direction]"
var/icon/I=null
if(cache_key in fluidtrack_cache)
I = fluidtrack_cache[cache_key]
else
I = new /icon(icon, icon_state=state, dir=num2dir(truedir))
I.SwapColor("#000000",track.basecolor);
// This track is crusty.
//if(track.wet<t)
// I.SetIntensity(0.7)
fluidtrack_cache[cache_key]=I
//if(track.wet<t)
// track.crusty=1
var/image/I = image(icon, icon_state=state, dir=num2dir(truedir))
I.color = track.basecolor
track.fresh=0
track.overlay=I

View File

@@ -17,7 +17,7 @@
/datum/poster/bay_4
icon_state="bsposter4"
name = "Keep Calm"
desc = "This particular one is of a famous New Earth design, although a bit modified."
desc = "This particular one is of a famous New Earth design, although a bit modified. Someone has scribbled an O over the A on the poster."
/datum/poster/bay_5
icon_state="bsposter5"
@@ -52,7 +52,7 @@
/datum/poster/bay_11
icon_state="bsposter11"
name = "Underwater Laboratory"
desc = "This particular one is of the fabled last crew of Nanotrasen's previous project before going big on Asteroid mining, Sealab."
desc = "This particular one is of the fabled last crew of Nanotrasen's previous project before going big on plasma research."
/datum/poster/bay_12
icon_state="bsposter12"
@@ -62,12 +62,12 @@
/datum/poster/bay_13
icon_state="bsposter13"
name = "User of the Arcane Arts"
desc = "This particular one depicts a wizard, casting a spell. You can't really make out if it's an actial photograph or a computer-generated image."
desc = "This particular one depicts a wizard, casting a spell. You can't really make out if it's an actual photograph or a computer-generated image."
/datum/poster/bay_14
icon_state="bsposter14"
name = "Levitating Skull"
desc = "This particular one is the portrait of a certain flying, friendly and somewhat sex-crazed enchanted skull. Its adventures along with its fabled companion are now fading through history..."
desc = "This particular one is the portrait of a flying enchanted skull. Its adventures along with its fabled companion are now fading through history..."
/datum/poster/bay_15
icon_state="bsposter15"
@@ -77,7 +77,7 @@
/datum/poster/bay_16
icon_state="bsposter16"
name = "Dangerous Static"
desc = "This particular one depicts nothing remarkable other than a rather mesmerising pattern of monitor static. There's a tag on the sides of the poster, urging you to \"tear this poster in half to receive your free sample\"."
desc = "This particular one depicts nothing remarkable other than a rather mesmerising pattern of monitor static. There's a tag on the sides of the poster, but it's ripped off."
/datum/poster/bay_17
icon_state="bsposter17"
@@ -142,4 +142,4 @@
/datum/poster/bay_29
icon_state="bsposter29"
name = "Winter Is Coming"
desc = "On the poster is a frighteningly large wolf, the message on the poster seems ominous."
desc = "On the poster is a frighteningly large wolf, he warns: \"Only YOU can keep the station from freezing during planetary occultation!\""

View File

@@ -21,15 +21,6 @@ would spawn and follow the beaker, even if it is carried or thrown.
flags = TABLEPASS
mouse_opacity = 0
/obj/effect/effect/smoke
name = "smoke"
icon = 'icons/effects/water.dmi'
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 8.0
/obj/effect/proc/delete()
loc = null
if(reagents)
@@ -223,196 +214,186 @@ steam.start() -- spawns the effect
/////////////////////////////////////////////
/obj/effect/effect/harmless_smoke
/obj/effect/effect/smoke
name = "smoke"
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
var/time_to_live = 100
//Remove this bit to use the old smoke
icon = 'icons/effects/96x96.dmi'
pixel_x = -32
pixel_y = -32
/obj/effect/effect/harmless_smoke/New()
/obj/effect/effect/smoke/New()
..()
spawn (100)
spawn (time_to_live)
delete()
return
/obj/effect/effect/harmless_smoke/Move()
/obj/effect/effect/smoke/HasEntered(mob/living/carbon/M as mob )
..()
return
/datum/effect/effect/system/harmless_smoke_spread
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
set_up(n = 5, c = 0, loca, direct)
if(n > 10)
n = 10
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/harmless_smoke/smoke = new /obj/effect/effect/harmless_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(75+rand(10,30))
smoke.delete()
src.total_smoke--
if(istype(M))
affect(M)
/obj/effect/effect/smoke/proc/affect(var/mob/living/carbon/M)
if (istype(M))
return 0
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
return 0
return 1
/////////////////////////////////////////////
// Bad smoke
/////////////////////////////////////////////
/obj/effect/effect/bad_smoke
name = "smoke"
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
//Remove this bit to use the old smoke
icon = 'icons/effects/96x96.dmi'
pixel_x = -32
pixel_y = -32
/obj/effect/effect/smoke/bad
time_to_live = 200
/obj/effect/effect/bad_smoke/New()
..()
spawn (200+rand(10,30))
delete()
return
/obj/effect/effect/bad_smoke/Move()
/obj/effect/effect/smoke/bad/Move()
..()
for(var/mob/living/carbon/M in get_turf(src))
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
else
M.drop_item()
M.adjustOxyLoss(1)
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
return
affect(M)
/obj/effect/effect/smoke/bad/affect(var/mob/living/carbon/M)
if (!..())
return 0
M.drop_item()
M.adjustOxyLoss(1)
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
/obj/effect/effect/bad_smoke/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
/obj/effect/effect/smoke/bad/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover, /obj/item/projectile/beam))
var/obj/item/projectile/beam/B = mover
B.damage = (B.damage/2)
return 1
/////////////////////////////////////////////
// Sleep smoke
/////////////////////////////////////////////
/obj/effect/effect/smoke/sleepy
/obj/effect/effect/bad_smoke/HasEntered(mob/living/carbon/M as mob )
/obj/effect/effect/smoke/sleepy/Move()
..()
if(istype(M, /mob/living/carbon))
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
return
else
M.drop_item()
M.adjustOxyLoss(1)
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
for(var/mob/living/carbon/M in get_turf(src))
affect(M)
/obj/effect/effect/smoke/sleepy/affect(mob/living/carbon/M as mob )
if (!..())
return 0
M.drop_item()
M:sleeping += 1
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
/////////////////////////////////////////////
// Mustard Gas
/////////////////////////////////////////////
/obj/effect/effect/smoke/mustard
name = "mustard gas"
icon_state = "mustard"
/obj/effect/effect/smoke/mustard/Move()
..()
for(var/mob/living/carbon/human/R in get_turf(src))
affect(R)
/obj/effect/effect/smoke/mustard/affect(var/mob/living/carbon/human/R)
if (!..())
return 0
if (R.wear_suit != null)
return 0
R.burn_skin(0.75)
if (R.coughedtime != 1)
R.coughedtime = 1
R.emote("gasp")
spawn (20)
R.coughedtime = 0
R.updatehealth()
return
/datum/effect/effect/system/bad_smoke_spread
/////////////////////////////////////////////
// Smoke spread
/////////////////////////////////////////////
/datum/effect/effect/system/smoke_spread
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
var/smoke_type = /obj/effect/effect/smoke
set_up(n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
/datum/effect/effect/system/smoke_spread/set_up(n = 5, c = 0, loca, direct)
if(n > 10)
n = 10
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/bad_smoke/smoke = new /obj/effect/effect/bad_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(150+rand(10,30))
smoke.delete()
src.total_smoke--
/datum/effect/effect/system/smoke_spread/start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/smoke/smoke = new smoke_type(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(smoke.time_to_live*0.75+rand(10,30))
if (smoke) smoke.delete()
src.total_smoke--
/datum/effect/effect/system/smoke_spread/bad
smoke_type = /obj/effect/effect/smoke/bad
/datum/effect/effect/system/smoke_spread/sleepy
smoke_type = /obj/effect/effect/smoke/sleepy
/datum/effect/effect/system/smoke_spread/mustard
smoke_type = /obj/effect/effect/smoke/mustard
/////////////////////////////////////////////
// Chem smoke
/////////////////////////////////////////////
/obj/effect/effect/chem_smoke
name = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
/obj/effect/effect/smoke/chem
icon = 'icons/effects/chemsmoke.dmi'
pixel_x = -32
pixel_y = -32
/obj/effect/effect/chem_smoke/New()
/obj/effect/effect/smoke/chem/New()
..()
var/datum/reagents/R = new/datum/reagents(500)
reagents = R
R.my_atom = src
spawn (200+rand(10,30))
delete()
return
/obj/effect/effect/chem_smoke/Move()
/obj/effect/effect/smoke/chem/Move()
..()
for(var/atom/A in view(2, src))
if(reagents.has_reagent("radium")||reagents.has_reagent("uranium")||reagents.has_reagent("carbon")||reagents.has_reagent("thermite"))//Prevents unholy radium spam by reducing the number of 'greenglows' down to something reasonable -Sieve
@@ -423,15 +404,11 @@ steam.start() -- spawns the effect
return
/obj/effect/effect/chem_smoke/HasEntered(mob/living/carbon/M as mob )
..()
/obj/effect/effect/smoke/chem/affect(mob/living/carbon/M as mob )
reagents.reaction(M)
return
/datum/effect/effect/system/chem_smoke_spread
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
/datum/effect/effect/system/smoke_spread/chem
smoke_type = /obj/effect/effect/smoke/chem
var/obj/chemholder
New()
@@ -488,7 +465,7 @@ steam.start() -- spawns the effect
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/chem_smoke/smoke = new /obj/effect/effect/chem_smoke(src.location)
var/obj/effect/effect/smoke/chem/smoke = new /obj/effect/effect/smoke/chem(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
@@ -514,189 +491,6 @@ steam.start() -- spawns the effect
smoke.delete()
src.total_smoke--
/////////////////////////////////////////////
// Sleep smoke
/////////////////////////////////////////////
/obj/effect/effect/sleep_smoke
name = "smoke"
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
//Remove this bit to use the old smoke
icon = 'icons/effects/96x96.dmi'
pixel_x = -32
pixel_y = -32
/obj/effect/effect/sleep_smoke/New()
..()
spawn (200+rand(10,30))
delete()
return
/obj/effect/effect/sleep_smoke/Move()
..()
for(var/mob/living/carbon/M in get_turf(src))
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
// if (M.wear_suit, /obj/item/clothing/suit/wizrobe && (M.hat, /obj/item/clothing/head/wizard) && (M.shoes, /obj/item/clothing/shoes/sandal)) // I'll work on it later
else
M.drop_item()
M:sleeping += 1
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
return
/obj/effect/effect/sleep_smoke/HasEntered(mob/living/carbon/M as mob )
..()
if(istype(M, /mob/living/carbon))
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
// if (M.wear_suit, /obj/item/clothing/suit/wizrobe && (M.hat, /obj/item/clothing/head/wizard) && (M.shoes, /obj/item/clothing/shoes/sandal)) // Work on it later
return
else
M.drop_item()
M:sleeping += 1
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
return
/datum/effect/effect/system/sleep_smoke_spread
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
set_up(n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/sleep_smoke/smoke = new /obj/effect/effect/sleep_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(150+rand(10,30))
smoke.delete()
src.total_smoke--
/////////////////////////////////////////////
// Mustard Gas
/////////////////////////////////////////////
/obj/effect/effect/mustard_gas
name = "mustard gas"
icon_state = "mustard"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
/obj/effect/effect/mustard_gas/New()
..()
spawn (100)
del(src)
return
/obj/effect/effect/mustard_gas/Move()
..()
for(var/mob/living/carbon/human/R in get_turf(src))
if (R.internal != null && usr.wear_mask && (R.wear_mask.flags & MASKINTERNALS) && R.wear_suit != null && !istype(R.wear_suit, /obj/item/clothing/suit/storage/labcoat) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket && !istype(R.wear_suit, /obj/item/clothing/suit/armor)))
else
R.burn_skin(0.75)
if (R.coughedtime != 1)
R.coughedtime = 1
R.emote("gasp")
spawn (20)
R.coughedtime = 0
R.updatehealth()
return
/obj/effect/effect/mustard_gas/HasEntered(mob/living/carbon/human/R as mob )
..()
if (istype(R, /mob/living/carbon/human))
if (R.internal != null && usr.wear_mask && (R.wear_mask.flags & MASKINTERNALS) && R.wear_suit != null && !istype(R.wear_suit, /obj/item/clothing/suit/storage/labcoat) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket && !istype(R.wear_suit, /obj/item/clothing/suit/armor)))
return
R.burn_skin(0.75)
if (R.coughedtime != 1)
R.coughedtime = 1
R.emote("gasp")
spawn (20)
R.coughedtime = 0
R.updatehealth()
return
/datum/effect/effect/system/mustard_gas_spread
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
set_up(n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/mustard_gas/smoke = new /obj/effect/effect/mustard_gas(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(100)
del(smoke)
src.total_smoke--
/////////////////////////////////////////////
//////// Attach an Ion trail to any object, that spawns when it moves (like for the jetpack)
/// just pass in the object to attach it to in set_up
@@ -893,7 +687,7 @@ steam.start() -- spawns the effect
M.stop_pulling()
M << "\blue You slipped on the foam!"
playsound(get_turf(src), 'sound/misc/slip.ogg', 50, 1, -3)
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
M.Stun(5)
M.Weaken(2)

View File

@@ -1,8 +1,8 @@
/proc/gibs(atom/location, var/list/viruses, var/datum/dna/MobDNA) //CARN MARKER
new /obj/effect/gibspawner/generic(get_turf(location),viruses,MobDNA)
/proc/hgibs(atom/location, var/list/viruses, var/datum/dna/MobDNA)
new /obj/effect/gibspawner/human(get_turf(location),viruses,MobDNA)
/proc/hgibs(atom/location, var/list/viruses, var/datum/dna/MobDNA, var/fleshcolor, var/bloodcolor)
new /obj/effect/gibspawner/human(get_turf(location),viruses,MobDNA,fleshcolor,bloodcolor)
/proc/xgibs(atom/location, var/list/viruses)
new /obj/effect/gibspawner/xeno(get_turf(location),viruses)
@@ -16,10 +16,15 @@
var/list/gibtypes = list()
var/list/gibamounts = list()
var/list/gibdirections = list() //of lists
var/fleshcolor //Used for gibbed humans.
var/bloodcolor //Used for gibbed humans.
New(location, var/list/viruses, var/datum/dna/MobDNA)
New(location, var/list/viruses, var/datum/dna/MobDNA, var/fleshcolor, var/bloodcolor)
..()
if(fleshcolor) src.fleshcolor = fleshcolor
if(bloodcolor) src.bloodcolor = bloodcolor
if(istype(loc,/turf)) //basically if a badmin spawns it
Gib(loc,viruses,MobDNA)
@@ -44,6 +49,14 @@
var/gibType = gibtypes[i]
gib = new gibType(location)
// Apply human species colouration to masks.
if(fleshcolor)
gib.fleshcolor = fleshcolor
if(bloodcolor)
gib.basecolor = bloodcolor
gib.update_icon()
if(viruses.len > 0)
for(var/datum/disease/D in viruses)
if(prob(virusProb))

View File

@@ -17,7 +17,7 @@
..()
xeno
gibtypes = list(/obj/effect/decal/cleanable/blood/xeno/xgibs/up,/obj/effect/decal/cleanable/blood/xeno/xgibs/down,/obj/effect/decal/cleanable/blood/xeno/xgibs,/obj/effect/decal/cleanable/blood/xeno/xgibs,/obj/effect/decal/cleanable/blood/xeno/xgibs/body,/obj/effect/decal/cleanable/blood/xeno/xgibs/limb,/obj/effect/decal/cleanable/blood/xeno/xgibs/core)
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/xeno/up,/obj/effect/decal/cleanable/blood/gibs/xeno/down,/obj/effect/decal/cleanable/blood/gibs/xeno,/obj/effect/decal/cleanable/blood/gibs/xeno,/obj/effect/decal/cleanable/blood/gibs/xeno/body,/obj/effect/decal/cleanable/blood/gibs/xeno/limb,/obj/effect/decal/cleanable/blood/gibs/xeno/core)
gibamounts = list(1,1,1,1,1,1,1)
New()
@@ -27,7 +27,7 @@
robot
sparks = 1
gibtypes = list(/obj/effect/decal/cleanable/blood/robot/up,/obj/effect/decal/cleanable/blood/robot/down,/obj/effect/decal/cleanable/blood/robot,/obj/effect/decal/cleanable/blood/robot,/obj/effect/decal/cleanable/blood/robot,/obj/effect/decal/cleanable/blood/robot/limb)
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/robot/up,/obj/effect/decal/cleanable/blood/gibs/robot/down,/obj/effect/decal/cleanable/blood/gibs/robot,/obj/effect/decal/cleanable/blood/gibs/robot,/obj/effect/decal/cleanable/blood/gibs/robot,/obj/effect/decal/cleanable/blood/gibs/robot/limb)
gibamounts = list(1,1,1,1,1,1)
New()

View File

@@ -1,7 +1,7 @@
/obj/item
name = "item"
icon = 'icons/obj/items.dmi'
var/icon/blood_overlay = null //this saves our blood splatter overlay, which will be processed not to go over the edges of the sprite
var/image/blood_overlay = null //this saves our blood splatter overlay, which will be processed not to go over the edges of the sprite
var/abstract = 0
var/item_state = null
var/r_speed = 1.0
@@ -141,8 +141,7 @@
else
if(isliving(src.loc))
return
user.lastDblClick = world.time + 2
user.next_move = world.time + 2
user.next_move = max(user.next_move+2,world.time + 2)
src.pickup(user)
add_fingerprint(user)
user.put_in_active_hand(src)
@@ -176,8 +175,7 @@
if(istype(src.loc, /mob/living))
return
src.pickup(user)
user.lastDblClick = world.time + 2
user.next_move = world.time + 2
user.next_move = max(user.next_move+2,world.time + 2)
user.put_in_active_hand(src)
return
@@ -215,161 +213,6 @@
return
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (!istype(M)) // not sure if this is the right thing...
return
if (can_operate(M)) //Checks if mob is lying down on table for surgery
if (do_surgery(M,user,src))
return
var/messagesource = M
if (istype(M,/mob/living/carbon/brain))
messagesource = M:container
if (src.hitsound)
playsound(get_turf(src), hitsound, 50, 1, -1)
/////////////////////////
user.lastattacked = M
M.lastattacker = user
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])</font>" )
msg_admin_attack("ATTACK: [user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])") //BS12 EDIT ALG
if(!iscarbon(user))
M.LAssailant = null
else
M.LAssailant = user
//spawn(1800) // this wont work right
// M.lastattacker = null
/////////////////////////
var/power = src.force
if(HULK in user.mutations)
power *= 2
if(!istype(M, /mob/living/carbon/human))
if(istype(M, /mob/living/carbon/slime))
var/mob/living/carbon/slime/slime = M
if(prob(25))
user << "\red [src] passes right through [M]!"
return
if(power > 0)
slime.attacked += 10
if(slime.Discipline && prob(50)) // wow, buddy, why am I getting attacked??
slime.Discipline = 0
if(power >= 3)
if(istype(slime, /mob/living/carbon/slime/adult))
if(prob(5 + round(power/2)))
if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++
slime.Victim = null
slime.anchored = 0
spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0
spawn(0)
if(slime)
slime.canmove = 0
step_away(slime, user)
if(prob(25 + power))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1
else
if(prob(10 + power*2))
if(slime)
if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++
if(slime.Discipline == 1)
slime.attacked = 0
spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0
slime.Victim = null
slime.anchored = 0
spawn(0)
if(slime && user)
step_away(slime, user)
slime.canmove = 0
if(prob(25 + power*4))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1
var/showname = "."
if(user)
showname = " by [user]."
if(!(user in viewers(M, null)))
showname = "."
for(var/mob/O in viewers(messagesource, null))
if(src.attack_verb.len)
O.show_message("\red <B>[M] has been [pick(src.attack_verb)] with [src][showname] </B>", 1)
else
O.show_message("\red <B>[M] has been attacked with [src][showname] </B>", 1)
if(!showname && user)
if(user.client)
user << "\red <B>You attack [M] with [src]. </B>"
if(istype(M, /mob/living/carbon/human))
M:attacked_by(src, user, def_zone)
else
switch(src.damtype)
if("brute")
if(istype(src, /mob/living/carbon/slime))
M.adjustBrainLoss(power)
else
M.take_organ_damage(power)
if (prob(33)) // Added blood for whacking non-humans too
var/turf/simulated/location = M.loc
if (istype(location))
location.add_blood_floor(M)
if("fire")
if (!(mHeatres in M.mutations))
M.take_organ_damage(0, power)
M << "Aargh it burns!"
M.updatehealth()
src.add_fingerprint(user)
return 1
/obj/item/proc/attack_self()
return
/obj/item/proc/afterattack()
return
/obj/item/proc/talk_into(mob/M as mob, text)
return
@@ -531,14 +374,26 @@
else
return 0
return 1
if(slot_ears)
if( !(slot_flags & SLOT_EARS) )
if(slot_l_ear)
if( !(slot_flags & slot_l_ear) )
return 0
if(H.ears)
if(H.l_ear)
if(automatic)
if(H.check_for_open_slot(src))
return 0
if(H.ears.canremove)
if(H.l_ear.canremove)
return 2
else
return 0
return 1
if(slot_r_ear)
if( !(slot_flags & slot_r_ear) )
return 0
if(H.r_ear)
if(automatic)
if(H.check_for_open_slot(src))
return 0
if(H.r_ear.canremove)
return 2
else
return 0
@@ -686,6 +541,8 @@
if(!(usr)) //BS12 EDIT
return
if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr))
return
if(!istype(usr, /mob/living/carbon) && !isMoMMI(usr))//Is not a carbon being or MoMMI
usr << "You can't pick things up!"
if(istype(usr, /mob/living/carbon/brain))//Is a brain
@@ -693,7 +550,7 @@
if( usr.stat || usr.restrained() )//Is not asleep/dead and is not restrained
usr << "\red You can't pick things up!"
return
if(src.anchored || !Adjacent(usr)) //Object isn't anchored
if(src.anchored) //Object isn't anchored
usr << "\red You can't pick that up!"
return
if(!usr.hand && usr.r_hand) //Right hand is not full
@@ -786,29 +643,28 @@
"\red You stab yourself in the eyes with [src]!" \
)
if(istype(M, /mob/living/carbon/human))
var/datum/organ/internal/eyes/eyes = H.internal_organs["eyes"]
eyes.damage += rand(3,4)
if(eyes.damage >= eyes.min_bruised_damage)
if(M.stat != 2)
if(eyes.robotic <= 1) //robot eyes bleeding might be a bit silly
M << "\red Your eyes start to bleed profusely!"
if(prob(50))
if(M.stat != 2)
M << "\red You drop what you're holding and clutch at your eyes!"
M.drop_item()
M.eye_blurry += 10
M.Paralyse(1)
M.Weaken(4)
if (eyes.damage >= eyes.min_broken_damage)
if(M.stat != 2)
M << "\red You go blind!"
var/datum/organ/external/affecting = M:get_organ("head")
if(affecting.take_damage(7))
M:UpdateDamageIcon()
else
M.take_organ_damage(7)
M.eye_blurry += rand(3,4)
M.eye_stat += rand(2,4)
if (M.eye_stat >= 10)
M.eye_blurry += 15+(0.1*M.eye_blurry)
M.disabilities |= NEARSIGHTED
if(M.stat != 2)
M << "\red Your eyes start to bleed profusely!"
if(prob(50))
if(M.stat != 2)
M << "\red You drop what you're holding and clutch at your eyes!"
M.drop_item()
M.eye_blurry += 10
M.Paralyse(1)
M.Weaken(4)
if (prob(M.eye_stat - 10 + 1))
if(M.stat != 2)
M << "\red You go blind!"
M.sdisabilities |= BLIND
return
/obj/item/clean_blood()
@@ -833,6 +689,7 @@
//apply the blood-splatter overlay if it isn't already in there
if(!blood_DNA.len)
blood_overlay.color = blood_color
overlays += blood_overlay
//if this blood isn't already in the list, add it
@@ -853,4 +710,17 @@
//not sure if this is worth it. It attaches the blood_overlay to every item of the same type if they don't have one already made.
for(var/obj/item/A in world)
if(A.type == type && !A.blood_overlay)
A.blood_overlay = I
A.blood_overlay = image(I)
/obj/item/proc/showoff(mob/user)
for (var/mob/M in view(user))
M.show_message("[user] holds up [src]. <a HREF=?src=\ref[M];lookitem=\ref[src]>Take a closer look.</a>",1)
/mob/living/carbon/verb/showoff()
set name = "Show Held Item"
set category = "Object"
var/obj/item/I = get_active_hand()
if(I && !I.abstract)
I.showoff(src)

View File

@@ -1,6 +1,6 @@
/obj/item/blueprints
name = "station blueprints"
desc = "Blueprints of the station. There's stamp \"Classified\" and several coffee stains on it."
desc = "Blueprints of the station. There is a \"Classified\" stamp and several coffee stains on it."
icon = 'icons/obj/items.dmi'
icon_state = "blueprints"
attack_verb = list("attacked", "bapped", "hit")
@@ -21,7 +21,7 @@
/obj/item/blueprints/attack_self(mob/M as mob)
if (!istype(M,/mob/living/carbon/human))
M << "This is stack of useless pieces of harsh paper." //monkeys cannot into projecting
M << "This stack of blue paper means nothing to you." //monkeys cannot into projecting
return
interact()
return
@@ -53,18 +53,18 @@
switch (get_area_type())
if (AREA_SPACE)
text += {"
<p>According this blueprints you are in <b>open space</b> now.</p>
<p>According the blueprints, you are now in <b>outer space</b>. Hold your breath.</p>
<p><a href='?src=\ref[src];action=create_area'>Mark this place as new area.</a></p>
"}
if (AREA_STATION)
text += {"
<p>According this blueprints you are in <b>[A.name]</b> now.</p>
<p>According the blueprints, you are now in <b>\"[A.name]\"</b>.</p>
<p>You may <a href='?src=\ref[src];action=edit_area'>
move an amendment</a> to the drawing.</p>
"}
if (AREA_SPECIAL)
text += {"
<p>This place isn't noted on these blueprints.</p>
<p>This place isn't noted on the blueprint.</p>
"}
else
return
@@ -105,20 +105,20 @@ move an amendment</a> to the drawing.</p>
if(!istype(res,/list))
switch(res)
if(ROOM_ERR_SPACE)
usr << "\red New area must be complete airtight!"
usr << "\red The new area must be completely airtight!"
return
if(ROOM_ERR_TOOLARGE)
usr << "\red New area too large!"
usr << "\red The new area too large!"
return
else
usr << "\red Error! Please notify administration!"
return
var/list/turf/turfs = res
var/str = trim(stripped_input(usr,"New area title","Blueprints editing", "", MAX_NAME_LEN))
var/str = trim(stripped_input(usr,"New area name:","Blueprint Editing", "", MAX_NAME_LEN))
if(!str || !length(str)) //cancel
return
if(length(str) > 50)
usr << "\red Text too long."
usr << "\red Name too long."
return
var/area/A = new
A.name = str
@@ -153,8 +153,8 @@ move an amendment</a> to the drawing.</p>
/obj/item/blueprints/proc/edit_area()
var/area/A = get_area()
//world << "DEBUG: edit_area"
var/prevname = A.name
var/str = trim(stripped_input(usr,"New area title","Blueprints editing", prevname, MAX_NAME_LEN))
var/prevname = "[A.name]"
var/str = trim(stripped_input(usr,"New area name:","Blueprint Editing", prevname, MAX_NAME_LEN))
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)

View File

@@ -92,7 +92,6 @@
icon = 'icons/obj/cryobag.dmi'
icon_state = "bodybag_folded"
attack_self(mob/user)
var/obj/structure/closet/body_bag/cryobag/R = new /obj/structure/closet/body_bag/cryobag(user.loc)
R.add_fingerprint(user)

View File

@@ -65,7 +65,8 @@
shadeColour = input(user, "Please select the shade colour.", "Crayon colour") as color
return
/obj/item/toy/crayon/afterattack(atom/target, mob/user as mob)
/obj/item/toy/crayon/afterattack(atom/target, mob/user as mob, proximity)
if(!proximity) return
if(istype(target,/turf/simulated/floor))
var/drawtype = input("Choose what you'd like to draw.", "Crayon scribbles") in list("graffiti","rune","letter")
switch(drawtype)
@@ -79,6 +80,7 @@
if(instant || do_after(user, 50))
new /obj/effect/decal/cleanable/crayon(target,colour,shadeColour,drawtype)
user << "You finish drawing."
target.add_fingerprint(user) // Adds their fingerprints to the floor the crayon is drawn on.
if(uses)
uses--
if(!uses)
@@ -96,4 +98,4 @@
user << "\red You ate your crayon!"
del(src)
else
..()
..()

View File

@@ -11,72 +11,75 @@
origin_tech = "syndicate=4;magnets=4"
var/can_use = 1
var/obj/effect/dummy/chameleon/active_dummy = null
var/saved_item = "/obj/item/weapon/cigbutt"
var/saved_item = /obj/item/weapon/cigbutt
var/saved_icon = 'icons/obj/clothing/masks.dmi'
var/saved_icon_state = "cigbutt"
var/saved_overlays
dropped()
disrupt()
/obj/item/device/chameleon/dropped()
disrupt()
attack_self()
toggle()
/obj/item/device/chameleon/equipped()
disrupt()
afterattack(atom/target, mob/user , flag)
if(istype(target,/obj/item))
playsound(src, 'sound/weapons/flash.ogg', 100, 1, 1)
/obj/item/device/chameleon/attack_self()
toggle()
/obj/item/device/chameleon/afterattack(atom/target, mob/user , proximity)
if(!proximity) return
if(!active_dummy)
if(istype(target,/obj/item) && !istype(target, /obj/item/weapon/disk/nuclear))
playsound(get_turf(src), 'sound/weapons/flash.ogg', 100, 1, -6)
user << "\blue Scanned [target]."
saved_item = target.type
saved_icon = target.icon
saved_icon_state = target.icon_state
saved_overlays = target.overlays
proc/toggle()
if(!can_use || !saved_item) return
if(active_dummy)
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
for(var/atom/movable/A in active_dummy)
A.loc = active_dummy.loc
if(ismob(A))
if(A:client)
A:client:eye = A
/obj/item/device/chameleon/proc/toggle()
if(!can_use || !saved_item) return
if(active_dummy)
eject_all()
playsound(get_turf(src), 'sound/effects/pop.ogg', 100, 1, -6)
del(active_dummy)
active_dummy = null
usr << "\blue You deactivate the [src]."
var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src))
T.icon = 'icons/effects/effects.dmi'
flick("emppulse",T)
spawn(8) T.delete()
else
playsound(get_turf(src), 'sound/effects/pop.ogg', 100, 1, -6)
var/obj/O = new saved_item(src)
if(!O) return
var/obj/effect/dummy/chameleon/C = new/obj/effect/dummy/chameleon(usr.loc)
C.activate(O, usr, saved_icon, saved_icon_state, saved_overlays, src)
del(O)
usr << "\blue You activate the [src]."
var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src))
T.icon = 'icons/effects/effects.dmi'
flick("emppulse",T)
spawn(8) T.delete()
/obj/item/device/chameleon/proc/disrupt(var/delete_dummy = 1)
if(active_dummy)
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread
spark_system.set_up(5, 0, src)
spark_system.attach(src)
spark_system.start()
eject_all()
if(delete_dummy)
del(active_dummy)
active_dummy = null
usr << "\blue You deactivate the [src]."
var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src))
T.icon = 'icons/effects/effects.dmi'
flick("emppulse",T)
spawn(8) T.delete()
else
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
var/obj/O = new saved_item(src)
if(!O) return
var/obj/effect/dummy/chameleon/C = new/obj/effect/dummy/chameleon(usr.loc)
C.name = O.name
C.desc = O.desc
C.icon = O.icon
C.icon_state = O.icon_state
C.dir = O.dir
usr.loc = C
C.master = src
src.active_dummy = C
del(O)
usr << "\blue You activate the [src]."
var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src))
T.icon = 'icons/effects/effects.dmi'
flick("emppulse",T)
spawn(8) T.delete()
proc/disrupt()
if(active_dummy)
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread
spark_system.set_up(5, 0, src)
spark_system.attach(src)
spark_system.start()
for(var/atom/movable/A in active_dummy)
A.loc = active_dummy.loc
if(ismob(A))
if(A:client)
A:client:eye = A
del(active_dummy)
active_dummy = null
can_use = 0
spawn(100) can_use = 1
active_dummy = null
can_use = 0
spawn(50) can_use = 1
/obj/item/device/chameleon/proc/eject_all()
for(var/atom/movable/A in active_dummy)
A.loc = active_dummy.loc
if(ismob(A))
var/mob/M = A
M.reset_view(null)
/obj/effect/dummy/chameleon
name = ""
@@ -85,38 +88,58 @@
anchored = 1
var/can_move = 1
var/obj/item/device/chameleon/master = null
attackby()
for(var/mob/M in src)
M << "\red Your chameleon-projector deactivates."
master.disrupt()
attack_hand()
for(var/mob/M in src)
M << "\red Your chameleon-projector deactivates."
master.disrupt()
ex_act()
for(var/mob/M in src)
M << "\red Your chameleon-projector deactivates."
master.disrupt()
bullet_act()
for(var/mob/M in src)
M << "\red Your chameleon-projector deactivates."
..()
master.disrupt()
relaymove(var/mob/user, direction)
if(istype(loc, /turf/space)) return //No magical space movement!
if(can_move)
can_move = 0
switch(usr.bodytemperature)
if(300 to INFINITY)
spawn(10) can_move = 1
if(295 to 300)
spawn(13) can_move = 1
if(280 to 295)
spawn(16) can_move = 1
if(260 to 280)
spawn(20) can_move = 1
else
spawn(25) can_move = 1
step(src,direction)
return
/obj/effect/dummy/chameleon/proc/activate(var/obj/O, var/mob/M, new_icon, new_iconstate, new_overlays, var/obj/item/device/chameleon/C)
name = O.name
desc = O.desc
icon = new_icon
icon_state = new_iconstate
overlays = new_overlays
dir = O.dir
M.loc = src
master = C
master.active_dummy = src
/obj/effect/dummy/chameleon/attackby()
for(var/mob/M in src)
M << "\red Your chameleon-projector deactivates."
master.disrupt()
/obj/effect/dummy/chameleon/attack_hand()
for(var/mob/M in src)
M << "\red Your chameleon-projector deactivates."
master.disrupt()
/obj/effect/dummy/chameleon/ex_act()
for(var/mob/M in src)
M << "\red Your chameleon-projector deactivates."
master.disrupt()
/obj/effect/dummy/chameleon/bullet_act()
for(var/mob/M in src)
M << "\red Your chameleon-projector deactivates."
..()
master.disrupt()
/obj/effect/dummy/chameleon/relaymove(var/mob/user, direction)
if(istype(loc, /turf/space)) return //No magical space movement!
if(can_move)
can_move = 0
switch(user.bodytemperature)
if(300 to INFINITY)
spawn(10) can_move = 1
if(295 to 300)
spawn(13) can_move = 1
if(280 to 295)
spawn(16) can_move = 1
if(260 to 280)
spawn(20) can_move = 1
else
spawn(25) can_move = 1
step(src, direction)
return
/obj/effect/dummy/chameleon/Del()
master.disrupt(0)
..()

View File

@@ -78,6 +78,7 @@
if(M.stat == DEAD || M.sdisabilities & BLIND) //mob is dead or fully blind
user << "<span class='notice'>[M] pupils does not react to the light!</span>"
else if(XRAY in M.mutations) //mob has X-RAY vision
flick("flash", M.flash) //Yes, you can still get flashed wit X-Ray.
user << "<span class='notice'>[M] pupils give an eerie glow!</span>"
else //they're okay!
if(!M.blinded)

View File

@@ -23,7 +23,7 @@
/obj/item/device/radio/headset/receive_range(freq, level)
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
if(H.ears == src)
if(H.l_ear == src || H.r_ear == src)
return ..(freq, level)
return -1

View File

@@ -6,7 +6,7 @@ HEALTH ANALYZER
GAS ANALYZER
PLANT ANALYZER
MASS SPECTROMETER
REAGENT SCANNER
*/
/obj/item/device/t_scanner
name = "T-ray scanner"
@@ -143,7 +143,12 @@ MASS SPECTROMETER
if(M:reagents.total_volume > 0)
user.show_message(text("\red Warning: Unknown substance detected in subject's blood."))
if(M:virus2.len)
user.show_message(text("\red Warning: Unknown pathogen detected in subject's blood."))
var/mob/living/carbon/C = M
for (var/ID in C.virus2)
if (ID in virusDB)
var/datum/data/record/V = virusDB[ID]
user.show_message(text("\red Warning: Pathogen [V.fields["name"]] detected in subject's blood. Known antigen : [V.fields["antigen"]]"))
// user.show_message(text("\red Warning: Unknown pathogen detected in subject's blood."))
if (M.getCloneLoss())
user.show_message("\red Subject appears to have been imperfectly cloned.")
for(var/datum/disease/D in M.viruses)
@@ -151,7 +156,9 @@ MASS SPECTROMETER
user.show_message(text("\red <b>Warning: [D.form] Detected</b>\nName: [D.name].\nType: [D.spread].\nStage: [D.stage]/[D.max_stages].\nPossible Cure: [D.cure]"))
if (M.reagents && M.reagents.get_reagent_amount("inaprovaline"))
user.show_message("\blue Bloodstream Analysis located [M.reagents:get_reagent_amount("inaprovaline")] units of rejuvenation chemicals.")
if (M.getBrainLoss() >= 100 || istype(M, /mob/living/carbon/human) && M:brain_op_stage == 4.0)
if (M.has_brain_worms())
user.show_message("\red Subject suffering from aberrant brain activity. Recommend further scanning.")
else if (M.getBrainLoss() >= 100 || istype(M, /mob/living/carbon/human) && M:brain_op_stage == 4.0)
user.show_message("\red Subject is brain dead.")
else if (M.getBrainLoss() >= 60)
user.show_message("\red Severe brain damage detected. Subject likely to have mental retardation.")

View File

@@ -4,18 +4,35 @@
icon_state = "voice0"
item_state = "flashbang" //looks exactly like a flash (and nothing like a flashbang)
w_class = 1.0
flags = FPRINT | TABLEPASS| CONDUCT
flags = FPRINT | TABLEPASS | CONDUCT
var/spamcheck = 0
var/emagged = 0
var/insults = 0//just in case
/obj/item/device/hailer/attack_self(mob/living/carbon/user as mob)
if (spamcheck)
return
playsound(get_turf(src), 'sound/voice/halt.ogg', 100, 1, vary = 0)
user.visible_message("<span class='warning'>[user]'s [name] rasps, \"Halt! Security!\"</span>")
if(emagged)
if(insults >= 1)
playsound(get_turf(src), 'sound/voice/binsult.ogg', 100, 1, vary = 0)//hueheuheuheuheuheuhe
user.show_message("<span class='warning'>[user]'s [name] gurgles, \"FUCK YOUR CUNT YOU SHIT EATING CUNT TILL YOU ARE A MASS EATING SHIT CUNT. EAT PENISES IN YOUR FUCK FACE AND SHIT OUT ABORTIONS TO FUCK UP SHIT IN YOUR ASS YOU COCK FUCK SHIT MONKEY FROM THE DEPTHS OF SHIT\"</span>",2) //It's a hearable message silly!
insults--
else
user << "\red *BZZZZcuntZZZZT*"
else
playsound(get_turf(src), 'sound/voice/halt.ogg', 100, 1, vary = 0)
user.show_message("<span class='warning'>[user]'s [name] rasps, \"Halt! Security!\"</span>",1)
spamcheck = 1
spawn(20)
spamcheck = 0
spamcheck = 0
/obj/item/device/hailer/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/card/emag) && !emagged)
user << "\red You overload \the [src]'s voice synthesizer."
emagged = 1
insults = rand(1, 3)//to prevent dickflooding
return
return

View File

@@ -5,7 +5,7 @@
***********************************************************************/
//Might want to move this into several files later but for now it works here
/obj/item/borg/stun
name = "Electrified Arm"
name = "electrified arm"
icon = 'icons/obj/decals.dmi'
icon_state = "shock"
@@ -32,7 +32,7 @@
O.show_message("\red <B>[user] has prodded [M] with an electrically-charged arm!</B>", 1, "\red You hear someone fall", 2)
/obj/item/borg/overdrive
name = "Overdrive"
name = "overdrive"
icon = 'icons/obj/decals.dmi'
icon_state = "shock"
@@ -46,27 +46,27 @@
/obj/item/borg/sight/xray
name = "X-ray Vision"
name = "\proper x-ray Vision"
sight_mode = BORGXRAY
/obj/item/borg/sight/thermal
name = "Thermal Vision"
name = "\proper thermal vision"
sight_mode = BORGTHERM
/obj/item/borg/sight/meson
name = "Meson Vision"
name = "\proper meson vision"
sight_mode = BORGMESON
/obj/item/borg/sight/hud
name = "Hud"
name = "hud"
var/obj/item/clothing/glasses/hud/hud = null
/obj/item/borg/sight/hud/med
name = "Medical Hud"
name = "medical hud"
New()
@@ -76,7 +76,7 @@
/obj/item/borg/sight/hud/sec
name = "Security Hud"
name = "security hud"
New()

View File

@@ -33,6 +33,16 @@
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.display_name == "head")
if(H.head && istype(H.head,/obj/item/clothing/head/helmet/space))
user << "\red You can't apply [src] through [H.head]!"
return 1
else
if(H.wear_suit && istype(H.wear_suit,/obj/item/clothing/suit/space))
user << "\red You can't apply [src] through [H.wear_suit]!"
return 1
if(affecting.status & ORGAN_ROBOT)
user << "\red This isn't useful at all on a robotic limb.."
return 1
@@ -41,7 +51,34 @@
user << "\red This isn't useful at all on a peg limb. It's fucking wood."
return 1
if(src.heal_brute)
H.UpdateDamageIcon()
else
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
user.visible_message( \
"\blue [M] has been applied with [src] by [user].", \
"\blue You apply \the [src] to [M]." \
)
use(1)
M.updatehealth()
/obj/item/stack/medical/bruise_pack
name = "roll of gauze"
singular_name = "gauze length"
desc = "Some sterile gauze to wrap around bloody stumps."
icon_state = "brutepack"
origin_tech = "biotech=1"
/obj/item/stack/medical/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(!affecting.bandage())
user << "\red The wounds on [M]'s [affecting.display_name] have already been bandaged."
return 1
@@ -59,33 +96,13 @@
else
user.visible_message( "\blue [user] places bandaid over [W.desc] on [M]'s [affecting.display_name].", \
"\blue You place bandaid over [W.desc] on [M]'s [affecting.display_name]." )
else if(src.heal_burn)
if(!affecting.salve())
user << "\red The wounds on [M]'s [affecting.display_name] have already been salved."
return 1
use(1)
else
if (can_operate(H)) //Checks if mob is lying down on table for surgery
if (do_surgery(H,user,src))
return
else
user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.display_name].", \
"\blue You salve wounds on [M]'s [affecting.display_name]." )
H.UpdateDamageIcon()
else
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
user.visible_message( \
"\blue [M] has been applied with [src] by [user].", \
"\blue You apply \the [src] to [M]." \
)
use(1)
M.updatehealth()
/obj/item/stack/medical/bruise_pack
name = "roll of gauze"
singular_name = "gauze length"
desc = "Some sterile gauze to wrap around bloody stumps."
icon_state = "brutepack"
heal_brute = 60
origin_tech = "biotech=1"
user << "<span class='notice'>The [affecting.display_name] is cut open, you'll need more than a bandage!</span>"
/obj/item/stack/medical/ointment
name = "ointment"
@@ -93,25 +110,49 @@
gender = PLURAL
singular_name = "ointment"
icon_state = "ointment"
heal_burn = 40
heal_burn = 1
origin_tech = "biotech=1"
/obj/item/stack/medical/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(!affecting.salve())
user << "\red The wounds on [M]'s [affecting.display_name] have already been salved."
return 1
else
user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.display_name].", \
"\blue You salve wounds on [M]'s [affecting.display_name]." )
use(1)
else
if (can_operate(H)) //Checks if mob is lying down on table for surgery
if (do_surgery(H,user,src))
return
else
user << "<span class='notice'>The [affecting.display_name] is cut open, you'll need more than a bandage!</span>"
/obj/item/stack/medical/bruise_pack/tajaran
name = "\improper S'rendarr's Hand leaf"
singular_name = "S'rendarr's Hand leaf"
desc = "A soft leaf that is rubbed on bruises."
desc = "A poultice made of soft leaves that is rubbed on bruises."
icon = 'icons/obj/harvest.dmi'
icon_state = "cabbage"
heal_brute = 7
/obj/item/stack/medical/ointment/tajaran
name = "\improper Messa's Tear leaf"
singular_name = "Messa's Tear leaf"
desc = "A cold leaf that is rubbed on burns."
name = "\improper Messa's Tear petals"
singular_name = "Messa's Tear petals"
desc = "A poultice made of cold, blue petals that is rubbed on burns."
icon = 'icons/obj/harvest.dmi'
icon_state = "ambrosiavulgaris"
heal_burn = 7
/obj/item/stack/medical/advanced/bruise_pack
name = "advanced trauma kit"
singular_name = "advanced trauma kit"
@@ -120,6 +161,41 @@
heal_brute = 12
origin_tech = "biotech=1"
/obj/item/stack/medical/advanced/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(!affecting.bandage())
user << "\red The wounds on [M]'s [affecting.display_name] have already been treated."
return 1
else
for (var/datum/wound/W in affecting.wounds)
if (W.internal)
continue
if (W.current_stage <= W.max_bleeding_stage)
user.visible_message( "\blue [user] cleans [W.desc] on [M]'s [affecting.display_name] and seals edges with bioglue.", \
"\blue You clean and seal [W.desc] on [M]'s [affecting.display_name]." )
//H.add_side_effect("Itch")
else if (istype(W,/datum/wound/bruise))
user.visible_message( "\blue [user] places medicine patch over [W.desc] on [M]'s [affecting.display_name].", \
"\blue You place medicine patch over [W.desc] on [M]'s [affecting.display_name]." )
else
user.visible_message( "\blue [user] smears some bioglue over [W.desc] on [M]'s [affecting.display_name].", \
"\blue You smear some bioglue over [W.desc] on [M]'s [affecting.display_name]." )
affecting.heal_damage(heal_brute,0)
use(1)
else
if (can_operate(H)) //Checks if mob is lying down on table for surgery
if (do_surgery(H,user,src))
return
else
user << "<span class='notice'>The [affecting.display_name] is cut open, you'll need more than a bandage!</span>"
/obj/item/stack/medical/advanced/ointment
name = "advanced burn kit"
singular_name = "advanced burn kit"
@@ -128,12 +204,68 @@
heal_burn = 12
origin_tech = "biotech=1"
/obj/item/stack/medical/advanced/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.open == 0)
if(!affecting.salve())
user << "\red The wounds on [M]'s [affecting.display_name] have already been salved."
return 1
else
user.visible_message( "\blue [user] covers wounds on [M]'s [affecting.display_name] with regenerative membrane.", \
"\blue You cover wounds on [M]'s [affecting.display_name] with regenerative membrane." )
affecting.heal_damage(0,heal_burn)
use(1)
else
if (can_operate(H)) //Checks if mob is lying down on table for surgery
if (do_surgery(H,user,src))
return
else
user << "<span class='notice'>The [affecting.display_name] is cut open, you'll need more than a bandage!</span>"
/obj/item/stack/medical/splint
name = "medical splint"
name = "medical splints"
singular_name = "medical splint"
icon_state = "splint"
amount = 5
max_amount = 5
/obj/item/stack/medical/splint/single
amount = 1
/obj/item/stack/medical/splint/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
var/limb = affecting.display_name
if(!((affecting.name == "l_arm") || (affecting.name == "r_arm") || (affecting.name == "l_leg") || (affecting.name == "r_leg")))
user << "\red You can't apply a splint there!"
return
if(affecting.status & ORGAN_SPLINTED)
user << "\red [M]'s [limb] is already splinted!"
return
if (M != user)
user.visible_message("\red [user] starts to apply \the [src] to [M]'s [limb].", "\red You start to apply \the [src] to [M]'s [limb].", "\red You hear something being wrapped.")
else
if((!user.hand && affecting.name == "r_arm") || (user.hand && affecting.name == "l_arm"))
user << "\red You can't apply a splint to the arm you're using!"
return
user.visible_message("\red [user] starts to apply \the [src] to their [limb].", "\red You start to apply \the [src] to your [limb].", "\red You hear something being wrapped.")
if(do_after(user, 50))
if (M != user)
user.visible_message("\red [user] finishes applying \the [src] to [M]'s [limb].", "\red You finish applying \the [src] to [M]'s [limb].", "\red You hear something being wrapped.")
else
if(prob(25))
user.visible_message("\red [user] successfully applies \the [src] to their [limb].", "\red You successfully apply \the [src] to your [limb].", "\red You hear something being wrapped.")
else
user.visible_message("\red [user] fumbles \the [src].", "\red You fumble \the [src].", "\red You hear something being wrapped.")
return
affecting.status |= ORGAN_SPLINTED
use(1)
return

View File

@@ -26,12 +26,20 @@
if (istype(M,/mob/living/carbon/human)) //Repairing robolimbs
var/mob/living/carbon/human/H = M
var/datum/organ/external/S = H.get_organ(user.zone_sel.selecting)
if (S && (S.status & ORGAN_ROBOT))
if(S.get_damage())
S.heal_damage(15, 15, robo_repair = 1)
H.updatehealth()
use(1)
user.visible_message("<span class='notice'>\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"][S.display_name] with \the [src].</span>",\
"<span class='notice'>You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.display_name].</span>")
if(S.open == 1)
if (S && (S.status & ORGAN_ROBOT))
if(S.get_damage())
S.heal_damage(15, 15, robo_repair = 1)
H.updatehealth()
use(1)
user.visible_message("<span class='notice'>\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"][S.display_name] with \the [src].</span>",\
"<span class='notice'>You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.display_name].</span>")
else
user << "<span class='notice'>Nothing to fix here.</span>"
else
if (can_operate(H))
if (do_surgery(H,user,src))
return
else
user << "<span class='notice'>Nothing to fix here.</span>"
user << "<span class='notice'>Nothing to fix in here.</span>"

View File

@@ -1,5 +1,5 @@
/obj/item/stack/rods
name = "metal rods"
name = "metal rod"
desc = "Some rods. Can be used for building, or something."
singular_name = "metal rod"
icon_state = "rods"
@@ -67,4 +67,4 @@
usr << "\blue You assemble a grille"
F.add_fingerprint(usr)
use(2)
return
return

View File

@@ -8,6 +8,7 @@
* Stacks
*/
/obj/item/stack
gender = PLURAL
origin_tech = "materials=1"
var/list/datum/stack_recipe/recipes
var/singular_name

View File

@@ -1,5 +1,5 @@
/obj/item/stack/tile/light
name = "light tiles"
name = "light tile"
singular_name = "light floor tile"
desc = "A floor tile, made out off glass. It produces light."
icon_state = "tile_e"

View File

@@ -1,5 +1,5 @@
/obj/item/stack/tile/plasteel
name = "floor tiles"
name = "floor tile"
singular_name = "floor tile"
desc = "Those could work as a pretty decent throwing weapon"
icon_state = "tile"

View File

@@ -9,7 +9,7 @@
* Grass
*/
/obj/item/stack/tile/grass
name = "grass tiles"
name = "grass tile"
singular_name = "grass floor tile"
desc = "A patch of grass like they often use on golf courses"
icon_state = "tile_grass"
@@ -26,7 +26,7 @@
* Wood
*/
/obj/item/stack/tile/wood
name = "wood floor tiles"
name = "wood floor tile"
singular_name = "wood floor tile"
desc = "an easy to fit wood floor tile"
icon_state = "tile-wood"

View File

@@ -1,117 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
/obj/item/tk_grab
name = "Telekinetic Grab"
desc = "Magic"
icon = 'icons/obj/magic.dmi'//Needs sprites
icon_state = "2"
flags = USEDELAY
//item_state = null
w_class = 10.0
layer = 20
var/last_throw = 0
var/obj/focus = null
var/mob/living/host = null
dropped(mob/user as mob)
del(src)
return
//stops TK grabs being equipped anywhere but into hands
equipped(var/mob/user, var/slot)
if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return
del(src)
return
/*
attack_self(mob/user as mob)
if(!istype(focus,/obj/item)) return
if(!check_path()) return//No clear path
user.put_in_hands(focus)
add_fingerprint(user)
user.update_inv_l_hand(0)
user.update_inv_r_hand()
spawn(0)
del(src)
return
*/
afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)//TODO: go over this
if(!target || !user) return
if(last_throw+3 > world.time) return
if(!host)
del(src)
return
if(!(TK in host.mutations))
del(src)
return
if(isobj(target))
if(!target.loc || !isturf(target.loc))
del(src)
return
if(!focus)
focus_object(target, user)
return
var/focusturf = get_turf(focus)
if(get_dist(focusturf, target) <= 1 && !istype(target, /turf))
target.attackby(focus, user, user:get_organ_target())
else if(get_dist(focusturf, target) <= 16)
apply_focus_overlay()
focus.throw_at(target, 10, 1)
last_throw = world.time
return
proc/focus_object(var/obj/target, var/mob/living/user)
if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
if(target.anchored)
target.attack_hand(user) // you can use shit now!
return//No throwing anchored things
if(!isturf(target.loc))
return
focus = target
update_icon()
apply_focus_overlay()
return
proc/apply_focus_overlay()
if(!focus) return
var/obj/effect/overlay/O = new /obj/effect/overlay(locate(focus.x,focus.y,focus.z))
O.name = "sparkles"
O.anchored = 1
O.density = 0
O.layer = FLY_LAYER
O.dir = pick(cardinal)
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "nothing"
flick("empdisable",O)
spawn(5)
O.delete()
return
update_icon()
overlays.Cut()
if(focus && focus.icon && focus.icon_state)
overlays += icon(focus.icon,focus.icon_state)
return
/*Not quite done likely needs to use something thats not get_step_to
proc/check_path()
var/turf/ref = get_turf(src.loc)
var/turf/target = get_turf(focus.loc)
if(!ref || !target) return 0
var/distance = get_dist(ref, target)
if(distance >= 10) return 0
for(var/i = 1 to distance)
ref = get_step_to(ref, target, 0)
if(ref != target) return 0
return 1
*/

View File

@@ -38,7 +38,7 @@
if(iscarbon(M))
eye_safety = M.eyecheck()
if(ishuman(M))
if(istype(M:ears, /obj/item/clothing/ears/earmuffs))
if(istype(M:l_ear, /obj/item/clothing/ears/earmuffs) || istype(M:r_ear, /obj/item/clothing/ears/earmuffs))
ear_safety += 2
if(HULK in M.mutations)
ear_safety += 1
@@ -48,7 +48,6 @@
//Flashing everyone
if(eye_safety < 1)
flick("e_flash", M.flash)
M.eye_stat += rand(1, 3)
M.Stun(2)
M.Weaken(10)
@@ -80,13 +79,14 @@
M.ear_deaf = max(M.ear_deaf,5)
//This really should be in mob not every check
if (M.eye_stat >= 20)
M << "\red Your eyes start to burn badly!"
M.disabilities |= NEARSIGHTED
if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang)))
if (prob(M.eye_stat - 20 + 1))
M << "\red You can't see anything!"
M.sdisabilities |= BLIND
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/datum/organ/internal/eyes/E = H.internal_organs["eyes"]
if (E.damage >= E.min_bruised_damage)
M << "\red Your eyes start to burn badly!"
if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang)))
if (E.damage >= E.min_broken_damage)
M << "\red You can't see anything!"
if (M.ear_damage >= 15)
M << "\red Your ears start to ring badly!"
if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang)))

View File

@@ -7,11 +7,11 @@
item_state = "flashbang"
flags = FPRINT | TABLEPASS | USEDELAY
slot_flags = SLOT_BELT
var/datum/effect/effect/system/bad_smoke_spread/smoke
var/datum/effect/effect/system/smoke_spread/bad/smoke
New()
..()
src.smoke = new /datum/effect/effect/system/bad_smoke_spread
src.smoke = new /datum/effect/effect/system/smoke_spread/bad
src.smoke.attach(src)
prime()

View File

@@ -54,7 +54,7 @@
if(!((user == loc || (in_range(src, user) && istype(src.loc, /turf)))))
return
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
smoke.set_up(5, 0, user.loc)
smoke.attach(user)
smoke.start()

View File

@@ -1,3 +1,6 @@
#define TANK_MAX_RELEASE_PRESSURE (3*ONE_ATMOSPHERE)
#define TANK_DEFAULT_RELEASE_PRESSURE 24
/obj/item/weapon/tank
name = "tank"
icon = 'icons/obj/tank.dmi'
@@ -15,7 +18,8 @@
var/distribute_pressure = ONE_ATMOSPHERE
var/integrity = 3
var/volume = 70
var/manipulated_by = null //Used by _onclick/hud/screen_objects.dm internals to determine if someone has messed with our tank or not.
//If they have and we haven't scanned it with the PDA or gas analyzer then we might just breath whatever they put in it.
/obj/item/weapon/tank/New()
..()
@@ -23,8 +27,7 @@
src.air_contents.volume = volume //liters
src.air_contents.temperature = T20C
processing_objects.Add(src)
processing_objects.Add(src)
return
/obj/item/weapon/tank/Del()
@@ -86,7 +89,7 @@
O << "\red [user] has used [W] on \icon[icon] [src]"
var/pressure = air_contents.return_pressure()
manipulated_by = user.real_name //This person is aware of the contents of the tank.
var/total_moles = air_contents.total_moles()
user << "\blue Results of analysis of \icon[icon]"
@@ -120,7 +123,10 @@
/obj/item/weapon/tank/attack_self(mob/user as mob)
if (!(src.air_contents))
return
user.set_machine(src)
ui_interact(user)
/obj/item/weapon/tank/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
var/using_internal
if(istype(loc,/mob/living/carbon))
@@ -128,57 +134,69 @@
if(location.internal==src)
using_internal = 1
var/message = {"
<b>Tank</b><BR>
<FONT color='blue'><b>Tank Pressure:</b> [air_contents.return_pressure()]</FONT><BR>
<BR>
<b>Mask Release Pressure:</b> <A href='?src=\ref[src];dist_p=-10'>-</A> <A href='?src=\ref[src];dist_p=-1'>-</A> [distribute_pressure] <A href='?src=\ref[src];dist_p=1'>+</A> <A href='?src=\ref[src];dist_p=10'>+</A><BR>
<b>Mask Release Valve:</b> <A href='?src=\ref[src];stat=1'>[using_internal?("Open"):("Closed")]</A>
"}
user << browse(message, "window=tank;size=600x300")
onclose(user, "tank")
return
// this is the data which will be sent to the ui
var/data[0]
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
data["releasePressure"] = round(distribute_pressure ? distribute_pressure : 0)
data["defaultReleasePressure"] = round(TANK_DEFAULT_RELEASE_PRESSURE)
data["maxReleasePressure"] = round(TANK_MAX_RELEASE_PRESSURE)
data["valveOpen"] = using_internal ? 1 : 0
data["maskConnected"] = 0
if(istype(loc,/mob/living/carbon))
var/mob/living/carbon/location = loc
if(location.internal == src || (location.wear_mask && (location.wear_mask.flags & MASKINTERNALS)))
data["maskConnected"] = 1
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "tanks.tmpl", "Tank", 500, 300)
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
ui.open()
// auto update every Master Controller tick
ui.set_auto_update(1)
/obj/item/weapon/tank/Topic(href, href_list)
..()
if (usr.stat|| usr.restrained())
return
if (src.loc == usr)
usr.set_machine(src)
if (href_list["dist_p"])
return 0
if (src.loc != usr)
return 0
if (href_list["dist_p"])
if (href_list["dist_p"] == "reset")
src.distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
else if (href_list["dist_p"] == "max")
src.distribute_pressure = TANK_MAX_RELEASE_PRESSURE
else
var/cp = text2num(href_list["dist_p"])
src.distribute_pressure += cp
src.distribute_pressure = min(max(round(src.distribute_pressure), 0), 3*ONE_ATMOSPHERE)
if (href_list["stat"])
if(istype(loc,/mob/living/carbon))
var/mob/living/carbon/location = loc
if(location.internal == src)
location.internal = null
src.distribute_pressure = min(max(round(src.distribute_pressure), 0), TANK_MAX_RELEASE_PRESSURE)
if (href_list["stat"])
if(istype(loc,/mob/living/carbon))
var/mob/living/carbon/location = loc
if(location.internal == src)
location.internal = null
location.internals.icon_state = "internal0"
usr << "\blue You close the tank release valve."
if (location.internals)
location.internals.icon_state = "internal0"
usr << "\blue You close the tank release valve."
else
if(location.wear_mask && (location.wear_mask.flags & MASKINTERNALS))
location.internal = src
usr << "\blue You open \the [src] valve."
if (location.internals)
location.internals.icon_state = "internal0"
location.internals.icon_state = "internal1"
else
if(location.wear_mask && (location.wear_mask.flags & MASKINTERNALS))
location.internal = src
usr << "\blue You open \the [src] valve."
if (location.internals)
location.internals.icon_state = "internal1"
else
usr << "\blue You need something to connect to \the [src]."
usr << "\blue You need something to connect to \the [src]."
src.add_fingerprint(usr)
/*
* the following is needed for a tank lying on the floor. But currently we restrict players to use not weared tanks as intrals. --rastaf
for(var/mob/M in viewers(1, src.loc))
if ((M.client && M.machine == src))
src.attack_self(M)
*/
src.attack_self(usr)
else
usr << browse(null, "window=tank")
return
return
src.add_fingerprint(usr)
return 1
/obj/item/weapon/tank/remove_air(amount)

View File

@@ -245,7 +245,8 @@
location.hotspot_expose(700, 5)
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob)
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity)
if(!proximity) return
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && !src.welding)
O.reagents.trans_to(src, max_fuel)
user << "\blue Welder refueled"
@@ -268,9 +269,10 @@
L.IgniteMob()
return
/obj/item/weapon/weldingtool/attack_self(mob/user)
toggle(user)
/obj/item/weapon/weldingtool/attack_self(mob/user as mob)
toggle()
return
//Returns the amount of fuel in the welder
/obj/item/weapon/weldingtool/proc/get_fuel()
@@ -357,33 +359,36 @@
/obj/item/weapon/weldingtool/proc/eyecheck(mob/user as mob)
if(!iscarbon(user)) return 1
var/safety = user:eyecheck()
switch(safety)
if(1)
usr << "\red Your eyes sting a little."
user.eye_stat += rand(1, 2)
if(user.eye_stat > 12)
user.eye_blurry += rand(3,6)
if(0)
usr << "\red Your eyes burn."
user.eye_stat += rand(2, 4)
if(user.eye_stat > 10)
user.eye_blurry += rand(4,10)
if(-1)
usr << "\red Your thermals intensify the welder's glow. Your eyes itch and burn severely."
user.eye_blurry += rand(12,20)
user.eye_stat += rand(12, 16)
if(user.eye_stat > 10 && safety < 2)
user << "\red Your eyes are really starting to hurt. This can't be good for you!"
if (prob(user.eye_stat - 25 + 1))
user << "\red You go blind!"
user.sdisabilities |= BLIND
else if (prob(user.eye_stat - 15 + 1))
user << "\red You go blind!"
user.eye_blind = 5
user.eye_blurry = 5
user.disabilities |= NEARSIGHTED
spawn(100)
user.disabilities &= ~NEARSIGHTED
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/H = user
var/datum/organ/internal/eyes/E = H.internal_organs["eyes"]
switch(safety)
if(1)
usr << "\red Your eyes sting a little."
E.damage += rand(1, 2)
if(E.damage > 12)
user.eye_blurry += rand(3,6)
if(0)
usr << "\red Your eyes burn."
E.damage += rand(2, 4)
if(E.damage > 10)
E.damage += rand(4,10)
if(-1)
usr << "\red Your thermals intensify the welder's glow. Your eyes itch and burn severely."
user.eye_blurry += rand(12,20)
E.damage += rand(12, 16)
if(E.damage > 10 && safety < 2)
user << "\red Your eyes are really starting to hurt. This can't be good for you!"
if (E.damage >= E.min_broken_damage)
user << "\red You go blind!"
user.sdisabilities |= BLIND
else if (E.damage >= E.min_bruised_damage)
user << "\red You go blind!"
user.eye_blind = 5
user.eye_blurry = 5
user.disabilities |= NEARSIGHTED
spawn(100)
user.disabilities &= ~NEARSIGHTED
return

View File

@@ -1,4 +1,4 @@
/obj/structure/sign/barsign
/obj/structure/sign/double/barsign
icon = 'icons/obj/barsigns.dmi'
icon_state = "empty"
anchored = 1

View File

@@ -165,4 +165,27 @@ LINEN BINS
hidden = null
add_fingerprint(user)
/obj/structure/bedsheetbin/attack_tk(mob/user as mob)
if(amount >= 1)
amount--
var/obj/item/weapon/bedsheet/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
else
B = new /obj/item/weapon/bedsheet(loc)
B.loc = loc
user << "<span class='notice'>You telekinetically remove [B] from [src].</span>"
update_icon()
if(hidden)
hidden.loc = loc
hidden = null
add_fingerprint(user)

View File

@@ -1,5 +1,5 @@
/obj/structure/displaycase
name = "Display Case"
name = "display case"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "glassbox1"
desc = "A display case for prized possessions. It taunts you to kick it."

View File

@@ -37,6 +37,15 @@
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
if(has_extinguisher)
has_extinguisher.loc = loc
user << "<span class='notice'>You telekinetically remove [has_extinguisher] from [src].</span>"
has_extinguisher = null
opened = 1
else
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/attack_paw(mob/user)
attack_hand(user)

View File

@@ -12,8 +12,8 @@
icon_state = "pine_1"
/obj/structure/flora/tree/pine/New()
icon_state = "pine_[rand(1, 3)]"
..()
icon_state = "pine_[rand(1, 3)]"
/obj/structure/flora/tree/pine/xmas
name = "xmas tree"
@@ -29,8 +29,8 @@
icon_state = "tree_1"
/obj/structure/flora/tree/dead/New()
icon_state = "tree_[rand(1, 6)]"
..()
icon_state = "tree_[rand(1, 6)]"
//grass
@@ -43,23 +43,23 @@
icon_state = "snowgrass1bb"
/obj/structure/flora/grass/brown/New()
icon_state = "snowgrass[rand(1, 3)]bb"
..()
icon_state = "snowgrass[rand(1, 3)]bb"
/obj/structure/flora/grass/green
icon_state = "snowgrass1gb"
/obj/structure/flora/grass/green/New()
icon_state = "snowgrass[rand(1, 3)]gb"
..()
icon_state = "snowgrass[rand(1, 3)]gb"
/obj/structure/flora/grass/both
icon_state = "snowgrassall1"
/obj/structure/flora/grass/both/New()
icon_state = "snowgrassall[rand(1, 3)]"
..()
icon_state = "snowgrassall[rand(1, 3)]"
//bushes
@@ -70,8 +70,13 @@
anchored = 1
/obj/structure/flora/bush/New()
icon_state = "snowbush[rand(1, 6)]"
..()
icon_state = "snowbush[rand(1, 6)]"
/obj/structure/flora/pottedplant
name = "potted plant"
icon = 'icons/obj/plants.dmi'
icon_state = "plant-26"
//newbushes
@@ -82,110 +87,110 @@
anchored = 1
/obj/structure/flora/ausbushes/New()
icon_state = "firstbush_[rand(1, 4)]"
..()
icon_state = "firstbush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/reedbush
icon_state = "reedbush_1"
/obj/structure/flora/ausbushes/reedbush/New()
icon_state = "reedbush_[rand(1, 4)]"
..()
icon_state = "reedbush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/leafybush
icon_state = "leafybush_1"
/obj/structure/flora/ausbushes/leafybush/New()
icon_state = "leafybush_[rand(1, 3)]"
..()
icon_state = "leafybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/palebush
icon_state = "palebush_1"
/obj/structure/flora/ausbushes/palebush/New()
icon_state = "palebush_[rand(1, 4)]"
..()
icon_state = "palebush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/stalkybush
icon_state = "stalkybush_1"
/obj/structure/flora/ausbushes/stalkybush/New()
icon_state = "stalkybush_[rand(1, 3)]"
..()
icon_state = "stalkybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/grassybush
icon_state = "grassybush_1"
/obj/structure/flora/ausbushes/grassybush/New()
icon_state = "grassybush_[rand(1, 4)]"
..()
icon_state = "grassybush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/fernybush
icon_state = "fernybush_1"
/obj/structure/flora/ausbushes/fernybush/New()
icon_state = "fernybush_[rand(1, 3)]"
..()
icon_state = "fernybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/sunnybush
icon_state = "sunnybush_1"
/obj/structure/flora/ausbushes/sunnybush/New()
icon_state = "sunnybush_[rand(1, 3)]"
..()
icon_state = "sunnybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/genericbush
icon_state = "genericbush_1"
/obj/structure/flora/ausbushes/genericbush/New()
icon_state = "genericbush_[rand(1, 4)]"
..()
icon_state = "genericbush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/pointybush
icon_state = "pointybush_1"
/obj/structure/flora/ausbushes/pointybush/New()
icon_state = "pointybush_[rand(1, 4)]"
..()
icon_state = "pointybush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/lavendergrass
icon_state = "lavendergrass_1"
/obj/structure/flora/ausbushes/lavendergrass/New()
icon_state = "lavendergrass_[rand(1, 4)]"
..()
icon_state = "lavendergrass_[rand(1, 4)]"
/obj/structure/flora/ausbushes/ywflowers
icon_state = "ywflowers_1"
/obj/structure/flora/ausbushes/ywflowers/New()
icon_state = "ywflowers_[rand(1, 3)]"
..()
icon_state = "ywflowers_[rand(1, 3)]"
/obj/structure/flora/ausbushes/brflowers
icon_state = "brflowers_1"
/obj/structure/flora/ausbushes/brflowers/New()
icon_state = "brflowers_[rand(1, 3)]"
..()
icon_state = "brflowers_[rand(1, 3)]"
/obj/structure/flora/ausbushes/ppflowers
icon_state = "ppflowers_1"
/obj/structure/flora/ausbushes/ppflowers/New()
icon_state = "ppflowers_[rand(1, 4)]"
..()
icon_state = "ppflowers_[rand(1, 4)]"
/obj/structure/flora/ausbushes/sparsegrass
icon_state = "sparsegrass_1"
/obj/structure/flora/ausbushes/sparsegrass/New()
icon_state = "sparsegrass_[rand(1, 3)]"
..()
icon_state = "sparsegrass_[rand(1, 3)]"
/obj/structure/flora/ausbushes/fullgrass
icon_state = "fullgrass_1"
/obj/structure/flora/ausbushes/fullgrass/New()
icon_state = "fullgrass_[rand(1, 3)]"
..()
..()
icon_state = "fullgrass_[rand(1, 3)]"

View File

@@ -51,6 +51,7 @@
/obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob)
// /vg/ - Rods for catwalks - N3X
if (istype(C, /obj/item/stack/tile/plasteel) || istype(C, /obj/item/stack/rods))
var/turf/T = get_turf(src)
T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead

View File

@@ -22,13 +22,31 @@
//handle facial hair (if necessary)
if(H.gender == MALE)
var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in facial_hair_styles_list
var/list/species_facial_hair = list()
if(H.species)
for(var/i in facial_hair_styles_list)
var/datum/sprite_accessory/facial_hair/tmp_facial = facial_hair_styles_list[i]
if(H.species.name in tmp_facial.species_allowed)
species_facial_hair += i
else
species_facial_hair = facial_hair_styles_list
var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in species_facial_hair
if(userloc != H.loc) return //no tele-grooming
if(new_style)
H.f_style = new_style
//handle normal hair
var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in hair_styles_list
var/list/species_hair = list()
if(H.species)
for(var/i in hair_styles_list)
var/datum/sprite_accessory/hair/tmp_hair = hair_styles_list[i]
if(H.species.name in tmp_hair.species_allowed)
species_hair += i
else
species_hair = hair_styles_list
var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in species_hair
if(userloc != H.loc) return //no tele-grooming
if(new_style)
H.h_style = new_style

View File

@@ -1,6 +1,6 @@
/obj/structure/mopbucket
desc = "Fill it with water, but don't forget a mop!"
name = "mop bucket"
desc = "Fill it with water, but don't forget a mop!"
icon = 'icons/obj/janitor.dmi'
icon_state = "mopbucket"
density = 1
@@ -10,9 +10,7 @@
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
/obj/structure/mopbucket/New()
var/datum/reagents/R = new/datum/reagents(100)
reagents = R
R.my_atom = src
create_reagents(100)
/obj/structure/mopbucket/examine()

View File

@@ -19,20 +19,60 @@
else
return
/obj/structure/sign/blob_act()
del(src)
return
/obj/structure/sign/attackby(obj/item/tool as obj, mob/user as mob) //deconstruction
if(istype(tool, /obj/item/weapon/screwdriver) && !istype(src, /obj/structure/sign/double))
user << "You unfasten the sign with your [tool]."
var/obj/item/sign/S = new(src.loc)
S.name = name
S.desc = desc
S.icon_state = icon_state
//var/icon/I = icon('icons/obj/decals.dmi', icon_state)
//S.icon = I.Scale(24, 24)
S.sign_state = icon_state
del(src)
else ..()
/obj/structure/sign/map
/obj/item/sign
name = "sign"
desc = ""
icon = 'icons/obj/decals.dmi'
w_class = 3 //big
var/sign_state = ""
/obj/item/sign/attackby(obj/item/tool as obj, mob/user as mob) //construction
if(istype(tool, /obj/item/weapon/screwdriver) && isturf(user.loc))
var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel")
if(direction == "Cancel") return
var/obj/structure/sign/S = new(user.loc)
switch(direction)
if("North")
S.pixel_y = 32
if("East")
S.pixel_x = 32
if("South")
S.pixel_y = -32
if("West")
S.pixel_x = -32
else return
S.name = name
S.desc = desc
S.icon_state = sign_state
user << "You fasten \the [S] with your [tool]."
del(src)
else ..()
/obj/structure/sign/double/map
name = "station map"
desc = "A framed picture of the station."
/obj/structure/sign/map/left
/obj/structure/sign/double/map/left
icon_state = "map-left"
/obj/structure/sign/map/right
/obj/structure/sign/double/map/right
icon_state = "map-right"
/obj/structure/sign/securearea
@@ -75,13 +115,11 @@
desc = "A warning sign which reads 'DANGER: FIRE'"
icon_state = "fire"
/obj/structure/sign/nosmoking_1
name = "\improper NO SMOKING"
desc = "A warning sign which reads 'NO SMOKING'"
icon_state = "nosmoking"
/obj/structure/sign/nosmoking_2
name = "\improper NO SMOKING"
desc = "A warning sign which reads 'NO SMOKING'"
@@ -112,14 +150,14 @@
desc = "This plaque commemorates the fall of the Atmos FEA division. For all the charred, dizzy, and brittle men who have died in its hands."
icon_state = "atmosplaque"
/obj/structure/sign/maltesefalcon //The sign is 64x32, so it needs two tiles. ;3
/obj/structure/sign/double/maltesefalcon //The sign is 64x32, so it needs two tiles. ;3
name = "The Maltese Falcon"
desc = "The Maltese Falcon, Space Bar and Grill."
/obj/structure/sign/maltesefalcon/left
/obj/structure/sign/double/maltesefalcon/left
icon_state = "maltesefalcon-left"
/obj/structure/sign/maltesefalcon/right
/obj/structure/sign/double/maltesefalcon/right
icon_state = "maltesefalcon-right"
/obj/structure/sign/science //These 3 have multiple types, just var-edit the icon_state to whatever one you want on the map
@@ -136,3 +174,28 @@
name = "\improper HYDROPONICS"
desc = "A warning sign which reads 'HYDROPONICS'"
icon_state = "hydro1"
/obj/structure/sign/directions/science
name = "\improper Science department"
desc = "A direction sign, pointing out which way Science department is."
icon_state = "direction_sci"
/obj/structure/sign/directions/engineering
name = "\improper Engineering department"
desc = "A direction sign, pointing out which way Engineering department is."
icon_state = "direction_eng"
/obj/structure/sign/directions/security
name = "\improper Security department"
desc = "A direction sign, pointing out which way Security department is."
icon_state = "direction_sec"
/obj/structure/sign/directions/medical
name = "\improper Medical Bay"
desc = "A direction sign, pointing out which way Meducal Bay is."
icon_state = "direction_med"
/obj/structure/sign/directions/evac
name = "\improper Escape Arm"
desc = "A direction sign, pointing out which way escape shuttle dock is."
icon_state = "direction_evac"

View File

@@ -20,7 +20,14 @@
layer = 2.8
throwpass = 1 //You can throw objects over this, despite it's density.")
var/parts = /obj/item/weapon/table_parts
var/alien_slashes = 0 //Amount of times table has been slashed by an alien.
var/flipped = 0
var/health = 100
/obj/structure/table/proc/update_adjacent()
for(var/direction in list(1,2,4,8,5,6,9,10))
if(locate(/obj/structure/table,get_step(src,direction)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
T.update_icon()
/obj/structure/table/New()
..()
@@ -28,16 +35,10 @@
if(T != src)
del(T)
update_icon()
for(var/direction in list(1,2,4,8,5,6,9,10))
if(locate(/obj/structure/table,get_step(src,direction)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
T.update_icon()
update_adjacent()
/obj/structure/table/Del()
for(var/direction in list(1,2,4,8,5,6,9,10))
if(locate(/obj/structure/table,get_step(src,direction)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
T.update_icon()
update_adjacent()
..()
/obj/structure/table/proc/destroy()
@@ -45,9 +46,36 @@
density = 0
del(src)
/obj/structure/rack/proc/destroy()
new parts(loc)
density = 0
del(src)
/obj/structure/table/update_icon()
spawn(2) //So it properly updates when deleting
if(flipped)
var/type = 0
var/tabledirs = 0
for(var/direction in list(turn(dir,90), turn(dir,-90)) )
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
if (T && T.flipped && T.dir == src.dir)
type++
tabledirs |= direction
var/base = "table"
if (istype(src, /obj/structure/table/woodentable))
base = "wood"
if (istype(src, /obj/structure/table/reinforced))
base = "rtable"
icon_state = "[base]flip[type]"
if (type==1)
if (tabledirs & turn(dir,90))
icon_state = icon_state+"-"
if (tabledirs & turn(dir,-90))
icon_state = icon_state+"+"
return 1
var/dir_sum = 0
for(var/direction in list(1,2,4,8,5,6,9,10))
var/skip_sum = 0
@@ -78,7 +106,8 @@
skip_sum = 1
continue
if(!skip_sum) //means there is a window between the two tiles in this direction
if(locate(/obj/structure/table,get_step(src,direction)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
if(T && !T.flipped)
if(direction <5)
dir_sum += direction
else
@@ -236,11 +265,6 @@
if(prob(75))
destroy()
/obj/structure/table/hand_p(mob/user as mob)
return src.attack_paw(user)
/obj/structure/table/attack_paw(mob/user)
if(HULK in user.mutations)
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
@@ -249,18 +273,7 @@
/obj/structure/table/attack_alien(mob/user)
alien_slashes += 1
visible_message("<span class='danger'>[user] slashes at [src]!</span>")
if(istype(src,/obj/structure/table/reinforced))
if (alien_slashes >= 4) //4 hits if reinforced table
visible_message("<span class='danger'>[user] breaks through [src]!</span>")
destroy()
else
if (alien_slashes >= 2) //2 hits if normal table
visible_message("<span class='danger'>[user] breaks through [src]!</span>")
destroy()
visible_message("<span class='danger'>[user] slices [src] apart!</span>")
/obj/structure/table/attack_animal(mob/living/simple_animal/user)
if(user.wall_smash)
@@ -275,18 +288,60 @@
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
destroy()
/obj/structure/table/attack_tk() // no telehulk sorry
return
/obj/structure/table/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover,/obj/item/projectile))
return (check_cover(mover,target))
if(istype(mover) && mover.checkpass(PASSTABLE))
return 1
else
return 0
if (flipped)
if (get_dir(loc, target) == dir)
return !density
else
return 1
return 0
//checks if projectile 'P' from turf 'from' can hit whatever is behind the table. Returns 1 if it can, 0 if bullet stops.
/obj/structure/table/proc/check_cover(obj/item/projectile/P, turf/from)
var/turf/cover = flipped ? get_turf(src) : get_step(loc, get_dir(from, loc))
if (get_dist(P.starting, loc) <= 1) //Tables won't help you if people are THIS close
return 1
if (get_turf(P.original) == cover)
var/chance = 20
if (ismob(P.original))
var/mob/M = P.original
if (M.lying)
chance += 20 //Lying down lets you catch less bullets
if(flipped)
if(get_dir(loc, from) == dir) //Flipped tables catch mroe bullets
chance += 20
else
return 1 //But only from one side
if(prob(chance))
health -= P.damage/2
if (health > 0)
visible_message("<span class='warning'>[P] hits \the [src]!</span>")
return 0
else
visible_message("<span class='warning'>[src] breaks down!</span>")
destroy()
return 1
return 1
/obj/structure/table/CheckExit(atom/movable/O as mob|obj, target as turf)
if(istype(O) && O.checkpass(PASSTABLE))
return 1
if (flipped)
if (get_dir(loc, target) == dir)
return !density
else
return 1
return 1
/obj/structure/table/MouseDrop_T(obj/O as obj, mob/user as mob)
if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O))
return
if(isrobot(user))
@@ -297,7 +352,8 @@
return
/obj/structure/table/attackby(obj/item/weapon/W as obj, mob/user as mob)
/obj/structure/table/attackby(obj/item/W as obj, mob/user as mob)
if (!W) return
if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
var/obj/item/weapon/grab/G = W
if (istype(G.affecting, /mob/living))
@@ -341,6 +397,119 @@
user.drop_item(src)
return
/obj/structure/table/proc/straight_table_check(var/direction)
var/obj/structure/table/T
for(var/angle in list(-90,90))
T = locate() in get_step(src.loc,turn(direction,angle))
if(T && !T.flipped)
return 0
T = locate() in get_step(src.loc,direction)
if (!T || T.flipped)
return 1
if (istype(T,/obj/structure/table/reinforced/))
var/obj/structure/table/reinforced/R = T
if (R.status == 2)
return 0
return T.straight_table_check(direction)
/obj/structure/table/verb/can_touch(var/mob/user)
if (!user)
return 0
if (user.stat) //zombie goasts go away
return 0
if (issilicon(user))
user << "<span class='notice'>You need hands for this.</span>"
return 0
return 1
/obj/structure/table/verb/do_flip()
set name = "Flip table"
set desc = "Flips a non-reinforced table"
set category = "Object"
set src in oview(1)
if(ismouse(usr))
return
if (!can_touch(usr))
return
if(!flip(get_cardinal_dir(usr,src)))
usr << "<span class='notice'>It won't budge.</span>"
else
usr.visible_message("<span class='warning'>[usr] flips \the [src]!</span>")
return
/obj/structure/table/proc/unflipping_check(var/direction)
for(var/mob/M in oview(src,0))
return 0
var/list/L = list()
if(direction)
L.Add(direction)
else
L.Add(turn(src.dir,-90))
L.Add(turn(src.dir,90))
for(var/new_dir in L)
var/obj/structure/table/T = locate() in get_step(src.loc,new_dir)
if(T)
if(T.flipped && T.dir == src.dir && !T.unflipping_check(new_dir))
return 0
return 1
/obj/structure/table/proc/do_put()
set name = "Put table back"
set desc = "Puts flipped table back"
set category = "Object"
set src in oview(1)
if (!can_touch(usr))
return
if (!unflipping_check())
usr << "<span class='notice'>It won't budge.</span>"
return
unflip()
/obj/structure/table/proc/flip(var/direction)
if( !straight_table_check(turn(direction,90)) || !straight_table_check(turn(direction,-90)) )
return 0
verbs -=/obj/structure/table/verb/do_flip
verbs +=/obj/structure/table/proc/do_put
var/list/targets = list(get_step(src,dir),get_step(src,turn(dir, 45)),get_step(src,turn(dir, -45)))
for (var/atom/movable/A in get_turf(src))
if (!A.anchored)
spawn(0)
A.throw_at(pick(targets),1,1)
dir = direction
if(dir != NORTH)
layer = 5
flipped = 1
flags |= ON_BORDER
for(var/D in list(turn(direction, 90), turn(direction, -90)))
var/obj/structure/table/T = locate() in get_step(src,D)
if(T && !T.flipped)
T.flip(direction)
update_icon()
update_adjacent()
return 1
/obj/structure/table/proc/unflip()
verbs -=/obj/structure/table/proc/do_put
verbs +=/obj/structure/table/verb/do_flip
layer = initial(layer)
flipped = 0
flags &= ~ON_BORDER
for(var/D in list(turn(dir, 90), turn(dir, -90)))
var/obj/structure/table/T = locate() in get_step(src.loc,D)
if(T && T.flipped && T.dir == src.dir)
T.unflip()
update_icon()
update_adjacent()
return 1
/*
* Wooden tables
@@ -350,7 +519,7 @@
desc = "Do not apply fire to this. Rumour says it burns easily."
icon_state = "wood_table"
parts = /obj/item/weapon/table_parts/wood
health = 50
/*
* Reinforced tables
*/
@@ -358,9 +527,15 @@
name = "reinforced table"
desc = "A version of the four legged table. It is stronger."
icon_state = "reinf_table"
health = 200
var/status = 2
parts = /obj/item/weapon/table_parts/reinforced
/obj/structure/table/reinforced/flip(var/direction)
if (status == 2)
return 0
else
return ..()
/obj/structure/table/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/weldingtool))
@@ -401,6 +576,7 @@
flags = FPRINT
anchored = 1.0
throwpass = 1 //You can throw objects over this, despite it's density.
var/parts = /obj/item/weapon/rack_parts
/obj/structure/rack/ex_act(severity)
switch(severity)
@@ -459,34 +635,26 @@
del(src)
/obj/structure/rack/attack_hand(mob/user)
/obj/structure/table/attack_hand(mob/user)
if(HULK in user.mutations)
visible_message("<span class='danger'>[user] smashes [src] apart!</span>")
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
new /obj/item/weapon/rack_parts(loc)
density = 0
del(src)
destroy()
/obj/structure/rack/attack_paw(mob/user)
if(HULK in user.mutations)
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
visible_message("<span class='danger'>[user] smashes [src] apart!</span>")
new /obj/item/weapon/rack_parts(loc)
density = 0
del(src)
destroy()
/obj/structure/rack/attack_alien(mob/user)
visible_message("<span class='danger'>[user] slices [src] apart!</span>")
new /obj/item/weapon/rack_parts(loc)
density = 0
del(src)
destroy()
/obj/structure/rack/attack_animal(mob/living/simple_animal/user)
if(user.wall_smash)
visible_message("<span class='danger'>[user] smashes [src] apart!</span>")
new /obj/item/weapon/rack_parts(loc)
density = 0
del(src)
destroy()
/obj/structure/rack/attack_tk() // no telehulk sorry
return

View File

@@ -86,7 +86,7 @@
/obj/structure/dispenser/Topic(href, href_list)
if(usr.stat || usr.restrained())
return
if(get_dist(src, usr) <= 1)
if(Adjacent(usr))
usr.set_machine(src)
if(href_list["oxygen"])
if(oxygentanks > 0)

View File

@@ -99,6 +99,16 @@ obj/structure/ex_act(severity)
/obj/structure/transit_tube/Bumped(mob/AM as mob|obj)
var/obj/structure/transit_tube/T = locate() in AM.loc
if(T)
AM << "<span class='warning'>The tube's support pylons block your way.</span>"
return ..()
else
AM.loc = src.loc
AM << "<span class='info'>You slip under the tube.</span>"
/obj/structure/transit_tube/station/New(loc)
..(loc)

View File

@@ -16,10 +16,9 @@
open = round(rand(0, 1))
update_icon()
/obj/structure/toilet/attack_hand(mob/living/user)
/obj/structure/toilet/attack_hand(mob/living/user as mob)
if(swirlie)
user.visible_message("<span class='danger'>[user] slams the toilet seat onto [swirlie]'s head!</span>", "<span class='notice'>You slam the toilet seat onto [swirlie]'s head!</span>", "You hear reverberating porcelain.")
usr.visible_message("<span class='danger'>[user] slams the toilet seat onto [swirlie.name]'s head!</span>", "<span class='notice'>You slam the toilet seat onto [swirlie.name]'s head!</span>", "You hear reverberating porcelain.")
swirlie.adjustBruteLoss(8)
return
@@ -43,8 +42,7 @@
/obj/structure/toilet/update_icon()
icon_state = "toilet[open][cistern]"
/obj/structure/toilet/attackby(obj/item/I, mob/living/user)
/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
if(istype(I, /obj/item/weapon/crowbar))
user << "<span class='notice'>You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"].</span>"
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
@@ -168,6 +166,7 @@
if("boiling")
watertemp = "normal"
user.visible_message("<span class='notice'>[user] adjusts the shower with the [I].</span>", "<span class='notice'>You adjust the shower with the [I].</span>")
add_fingerprint(user)
/obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up
overlays.Cut() //once it's been on for a while, in addition to handling the water overlay.
@@ -263,8 +262,11 @@
if(H.glasses && washglasses)
if(H.glasses.clean_blood())
H.update_inv_glasses(0)
if(H.ears && washears)
if(H.ears.clean_blood())
if(H.l_ear && washears)
if(H.l_ear.clean_blood())
H.update_inv_ears(0)
if(H.r_ear && washears)
if(H.r_ear.clean_blood())
H.update_inv_ears(0)
if(H.belt)
if(H.belt.clean_blood())
@@ -326,19 +328,20 @@
if(isrobot(M) || isAI(M))
return
if(!Adjacent(M))
return
if(busy)
M << "\red Someone's already washing here."
return
var/turf/location = M.loc
if(!isturf(location)) return
usr << "\blue You start washing your hands."
busy = 1
sleep(40)
busy = 0
if(M.loc != location) return //Person has moved away from the sink
if(!Adjacent(M)) return //Person has moved away from the sink
M.clean_blood()
if(ishuman(M))
@@ -354,26 +357,25 @@
if (istype(O, /obj/item/weapon/reagent_containers))
var/obj/item/weapon/reagent_containers/RG = O
RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
user << "<span class='notice'>You fill [RG] from [src].</span>"
user.visible_message("\blue [user] fills the [RG] using \the [src].","\blue You fill the [RG] using \the [src].")
return
else if(istype(O, /obj/item/weapon/melee/baton))
else if (istype(O, /obj/item/weapon/melee/baton))
var/obj/item/weapon/melee/baton/B = O
if(B.bcell)
if(B.bcell.charge > 0 && B.status == 1)
flick("baton_active", src)
user.Stun(10)
user.stuttering = 10
user.Weaken(10)
if(isrobot(user))
var/mob/living/silicon/robot/R = user
R.cell.charge -= 20
else
B.deductcharge(B.hitcost)
user.visible_message( \
"<span class='danger'>[user] was stunned by \his wet [O]!</span>", \
"<span class='userdanger'>[user] was stunned by \his wet [O]!</span>")
return
if (B.bcell && B.bcell.charge > 0 && B.status == 1)
flick("baton_active", src)
user.Stun(10)
user.stuttering = 10
user.Weaken(10)
if(isrobot(user))
var/mob/living/silicon/robot/R = user
R.cell.charge -= 20
else
B.deductcharge(1)
user.visible_message( \
"[user] was stunned by his wet [O].", \
"\red You have wet \the [O], it shocks you!")
return
var/turf/location = user.loc
if(!isturf(location)) return
@@ -414,4 +416,4 @@
/obj/structure/sink/puddle/attackby(obj/item/O as obj, mob/user as mob)
icon_state = "puddle-splash"
..()
icon_state = "puddle"
icon_state = "puddle"

View File

@@ -276,7 +276,7 @@ proc/trigger_armed_response_team(var/force = 0)
/mob/living/carbon/human/proc/equip_strike_team(leader_selected = 0)
//Special radio setup
equip_to_slot_or_del(new /obj/item/device/radio/headset/ert(src), slot_ears)
equip_to_slot_or_del(new /obj/item/device/radio/headset/ert(src), slot_l_ear)
//Adding Camera Network
var/obj/machinery/camera/camera = new /obj/machinery/camera(src) //Gives all the commandos internals cameras.

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