refactor 'dir = ' into 'set_dir()'

This should have little/no gameplay effect right now, just paving the
 way for directional lights.
Replaced handle_rotation() on buckly things with this.

Signed-off-by: Mloc-Argent <colmohici@gmail.com>
This commit is contained in:
Mloc-Argent
2014-11-27 21:33:55 +00:00
committed by Mloc
parent a1a66870ca
commit 117ca6a135
143 changed files with 480 additions and 480 deletions
@@ -368,7 +368,7 @@
var/predir = M.dir
step(M, throw_dir)
M.dir = predir
M.set_dir(predir)
//gives turf a different description, to try and trick players
/obj/effect/step_trigger/trap/fake
@@ -62,7 +62,7 @@
continue moving
var/turf/X = new T.type(B)
X.dir = old_dir1
X.set_dir(old_dir1)
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
@@ -39,7 +39,7 @@
// offset 24 pixels in direction of dir
// this allows the APC to be embedded in a wall, yet still inside an area
if (building)
dir = ndir
set_dir(ndir)
else
has_electronics = 3
opened = 0
@@ -39,7 +39,7 @@
// offset 24 pixels in direction of dir
// this allows the APC to be embedded in a wall, yet still inside an area
if (building)
dir = ndir
set_dir(ndir)
else
has_electronics = 3
opened = 0
@@ -294,7 +294,7 @@
if (usr.stat || usr.restrained() || anchored)
return
src.dir = turn(src.dir, 90)
src.set_dir(turn(src.dir, 90))
/obj/machinery/power/rust_fuel_injector/verb/rotate_anticlock()
set category = "Object"
@@ -304,4 +304,4 @@
if (usr.stat || usr.restrained() || anchored)
return
src.dir = turn(src.dir, -90)
src.set_dir(turn(src.dir, -90))
@@ -95,7 +95,7 @@
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
A.dir = src.dir
A.set_dir(src.dir)
if(src.dir == 1)//Up
A.yo = 20
A.xo = 0
@@ -125,7 +125,7 @@
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()*/
A.dir = src.dir
A.set_dir(src.dir)
if(src.dir == 1)//Up
A.yo = 20
A.xo = 0
@@ -26,7 +26,7 @@
if(!dir)
RadiateParticleRand(energy, ionizing)
var/obj/effect/accelerated_particle/particle = new
particle.dir = dir
particle.set_dir(dir)
particle.ionizing = ionizing
if(energy)
particle.energy = energy
@@ -22,7 +22,7 @@
if(!first)
src.first = new /obj/beam/e_beam(src.loc)
src.first.master = src
src.first.dir = src.dir
src.first.set_dir(src.dir)
src.first.power = src.power
src.first.freq = src.freq
src.first.phase = src.phase
@@ -61,7 +61,7 @@
if(!next)
if(get_step(src.loc,src.dir))
var/obj/beam/e_beam/e = new /obj/beam/e_beam(src.loc)
e.dir = src.dir
e.set_dir(src.dir)
src.next = e
e.master = src.master
e.power = src.power
@@ -34,7 +34,7 @@
if (src.anchored || usr:stat)
usr << "It is fastened to the floor!"
return 0
src.dir = turn(src.dir, 90)
src.set_dir(turn(src.dir, 90))
return 1
/obj/machinery/zero_point_emitter/New()
@@ -98,7 +98,7 @@
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
A.dir = src.dir
A.set_dir(src.dir)
switch(dir)
if(NORTH)
A.yo = 20
@@ -13,7 +13,7 @@
/obj/item/projectile/missile/process(var/turf/newtarget)
target = newtarget
dir = get_dir(src.loc, target)
set_dir(get_dir(src.loc, target))
walk_towards(src, target, MISSILE_SPEED)
/obj/item/projectile/missile/Bump(atom/A)
@@ -164,7 +164,7 @@
/obj/machinery/meteor_battery/proc/target()
while(src && enabled && !stat)
src.dir = get_dir(src, cur_target)
src.set_dir(get_dir(src, cur_target))
shootAt(cur_target)
sleep(shot_delay)
return
@@ -56,7 +56,7 @@
continue
turfs += thisturf
var/turf/target_turf = pick(turfs)
src.dir = get_dir(src, target_turf)
src.set_dir(get_dir(src, target_turf))
src.loc = target_turf
hibernate = 1
@@ -193,7 +193,7 @@
if(!next_turf.CanPass(src, next_turf))
break
src.loc = next_turf
src.dir = get_dir(src, target_mob)
src.set_dir(get_dir(src, target_mob))
next_turf = get_step(src, get_dir(next_turf,target_mob))
num_turfs--
@@ -233,7 +233,7 @@
if(!next_turf.CanPass(src, next_turf))
break
src.loc = next_turf
src.dir = get_dir(src, target_mob)
src.set_dir(get_dir(src, target_mob))
next_turf = get_step(src, get_dir(next_turf,target_turf))
num_turfs--
else if(G)
@@ -89,7 +89,7 @@
anchored = 1
New(var/turf/nloc, var/ndir, var/temp)
dir = ndir
set_dir(ndir)
..(nloc)
if(nloc)
+12 -12
View File
@@ -46,7 +46,7 @@
using = new /obj/screen( src )
using.name = "act_intent"
using.dir = SOUTHWEST
using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
@@ -105,7 +105,7 @@
using = new /obj/screen( src )
using.name = "mov_intent"
using.dir = SOUTHWEST
using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
@@ -123,7 +123,7 @@
using = new /obj/screen( src )
using.name = "r_hand"
using.dir = WEST
using.set_dir(WEST)
using.icon = ui_style
using.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
@@ -135,7 +135,7 @@
using = new /obj/screen( src )
using.name = "l_hand"
using.dir = EAST
using.set_dir(EAST)
using.icon = ui_style
using.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
@@ -147,7 +147,7 @@
using = new /obj/screen( src )
using.name = "hand"
using.dir = SOUTH
using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
@@ -156,7 +156,7 @@
using = new /obj/screen( src )
using.name = "hand"
using.dir = SOUTH
using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
@@ -165,7 +165,7 @@
using = new /obj/screen( src )
using.name = "mask"
using.dir = NORTH
using.set_dir(NORTH)
using.icon = ui_style
using.icon_state = "equip"
using.screen_loc = ui_monkey_mask
@@ -174,7 +174,7 @@
using = new /obj/screen( src )
using.name = "back"
using.dir = NORTHEAST
using.set_dir(NORTHEAST)
using.icon = ui_style
using.icon_state = "equip"
using.screen_loc = ui_back
@@ -291,19 +291,19 @@
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
mymob.gun_setting_icon.set_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
mymob.item_use_icon.set_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_move_icon.set_dir(1)
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
mymob.gun_run_icon.set_dir(1)
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
+5 -5
View File
@@ -63,15 +63,15 @@
if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds
if (movement_target.loc.x < src.x)
dir = WEST
set_dir(WEST)
else if (movement_target.loc.x > src.x)
dir = EAST
set_dir(EAST)
else if (movement_target.loc.y < src.y)
dir = SOUTH
set_dir(SOUTH)
else if (movement_target.loc.y > src.y)
dir = NORTH
set_dir(NORTH)
else
dir = SOUTH
set_dir(SOUTH)
if(isturf(movement_target.loc))
movement_target.attack_animal(src)
@@ -25,7 +25,7 @@
del(src)
return
dir = get_dir(T, loc)
set_dir(get_dir(T, loc))
/obj/machinery/constructable_frame/wallmount_frame/attackby(obj/item/P as obj, mob/user as mob)
if(P.crit_fail)
@@ -109,7 +109,7 @@
if(component_check)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
new_machine.dir = dir
new_machine.set_dir(dir)
if(istype(circuit, /obj/item/weapon/circuitboard/status_display))
new_machine.pixel_x = pixel_x * 1.33
new_machine.pixel_y = pixel_y * 1.33
+11 -11
View File
@@ -48,15 +48,15 @@
Click()
switch(dir)
if(NORTH)
dir = EAST
set_dir(EAST)
if(EAST)
dir = SOUTH
set_dir(SOUTH)
if(SOUTH)
dir = WEST
set_dir(WEST)
if(WEST)
dir = NORTHWEST
set_dir(NORTHWEST)
if(NORTHWEST)
dir = NORTH
set_dir(NORTH)
return 1
/obj/effect/bmode/buildhelp
@@ -219,19 +219,19 @@
switch(holder.builddir.dir)
if(NORTH)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
WIN.dir = NORTH
WIN.set_dir(NORTH)
if(SOUTH)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
WIN.dir = SOUTH
WIN.set_dir(SOUTH)
if(EAST)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
WIN.dir = EAST
WIN.set_dir(EAST)
if(WEST)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
WIN.dir = WEST
WIN.set_dir(WEST)
if(NORTHWEST)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
WIN.dir = NORTHWEST
WIN.set_dir(NORTHWEST)
if(2)
if(pa.Find("left"))
if(ispath(holder.buildmode.objholder,/turf))
@@ -239,7 +239,7 @@
T.ChangeTurf(holder.buildmode.objholder)
else
var/obj/A = new holder.buildmode.objholder (get_turf(object))
A.dir = holder.builddir.dir
A.set_dir(holder.builddir.dir)
else if(pa.Find("right"))
if(isobj(object)) del(object)