mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-28 11:03:19 +00:00
Addendum to: r1655
#Added an icon helper procs library by Lummox Jr. #Added more icon+overlay functionality by DarkCampainger. Both can be found under icon_procs.dm. #Added continuous beam code by Gunbuddy to atom.dm. You can now create continuous beams of energy/magic/monkeys/whatever. For instance, pAI cords. It's really awesome. #Like optical camo? Well I have good news. New stealth "graphic." May need some fine tuning depending on player/coder preference. It's also a little slow to change (due to update_clothing()). With that said, it's a lot cooler than what we had before. Check it out. #Added the getIconMask() and AddCamoOverlay() procs for the above. #Added animated satic filter icons by Koil to icons. #New force wall and shield icons. Shield icons moved to effects.dmi. #Changed up the abandoned mining station. #Moved a few carp spawn points closer to the station. Added a few more. Ninjas: No longer spawn whoknowswhere like they did at times before. Get a unique stealth graphic. Yup. Also, small chance of failure. New energy net icon and effects. Energy net now uses the beam code mentioned above. It will now check for stealth. Fixed some graphical icon issues with ninja suit. Added a female black jumpsuit to icons for this reason. Added icon directions to ninja effects. Some more general code cleanup. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1664 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -363,21 +363,22 @@
|
||||
if(degree < 315) return WEST
|
||||
return NORTH|WEST
|
||||
|
||||
//Returns direction that the mob or whomever should be facing in relation to the target.
|
||||
//This proc does not grant absolute direction and is mostly useful for 8dir sprite positioning.
|
||||
//I personally used it with getline() to great effect.
|
||||
/proc/get_dir_to(turf/start,turf/end)//N
|
||||
var/xdiff = start.x - end.x//The sign is important.
|
||||
var/ydiff = start.y - end.y
|
||||
/proc/angle2text(var/degree)
|
||||
return dir2text(angle2dir(degree))
|
||||
|
||||
var/direction_x = xdiff<1 ? 4:8//East - west
|
||||
var/direction_y = ydiff<1 ? 1:2//North - south
|
||||
var/direction_xy = xdiff==0 ? -4:0//If x is the same, subtract 4.
|
||||
var/direction_yx = ydiff==0 ? -1:0//If y is the same, subtract 1.
|
||||
var/direction_f = direction_x+direction_y+direction_xy+direction_yx//Finally direction tally.
|
||||
direction_f = direction_f==0 ? 1:direction_f//If direction is 0(same spot), return north. Otherwise, direction.
|
||||
|
||||
return direction_f
|
||||
/proc/Get_Angle(atom/movable/start,atom/movable/end)//For beams.
|
||||
if(!start || !end) return 0
|
||||
var/dy
|
||||
var/dx
|
||||
dy=(32*end.y+end.pixel_y)-(32*start.y+start.pixel_y)
|
||||
dx=(32*end.x+end.pixel_x)-(32*start.x+start.pixel_x)
|
||||
if(!dy)
|
||||
return (dx>=0)?90:270
|
||||
.=arctan(dx/dy)
|
||||
if(dy<0)
|
||||
.+=180
|
||||
else if(dx<0)
|
||||
.+=360
|
||||
|
||||
//Returns location. Returns null if no location was found.
|
||||
/proc/get_teleport_loc(turf/location,mob/target,distance = 1, density = 0, errorx = 0, errory = 0, eoffsetx = 0, eoffsety = 0)
|
||||
@@ -472,9 +473,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
|
||||
return destination
|
||||
|
||||
/proc/angle2text(var/degree)
|
||||
return dir2text(angle2dir(degree))
|
||||
|
||||
/proc/text_input(var/Message, var/Title, var/Default, var/length=MAX_MESSAGE_LEN)
|
||||
return sanitize(input(Message, Title, Default) as text, length)
|
||||
|
||||
@@ -984,6 +982,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
/proc/between(var/low, var/middle, var/high)
|
||||
return max(min(middle, high), low)
|
||||
|
||||
proc/arctan(x)
|
||||
var/y=arcsin(x/sqrt(1+x*x))
|
||||
return y
|
||||
|
||||
//returns random gauss number
|
||||
proc/GaussRand(var/sigma)
|
||||
var/x,y,rsq
|
||||
|
||||
Reference in New Issue
Block a user