ID:1533541
 
(See the best response by Super Saiyan X.)
Is there anyway I can replace .north with a different movement verb?

Example; I have a movement verb that is called MoveNorth, MoveSouth, e.t.c

Now I have a skill that uses .north instead. Is there anyway I can replace the .north with MoveNorth or MoveSouth

Coding for the skill;
obj/water
icon='Icons/Abilites/WaterCapture.dmi'
var/Owner
var/list/CaptureList=list()
var/list/TrailList=list()
watertrail
density=0
layer=2
water
icon_state="head"
layer=TURF_LAYER
density=1
var
reach=0
waterreach=0
firststep=0
Move()
if(src.dir==NORTH)
src.pixel_y=-13;src.pixel_x=0
if(src.dir==WEST)
src.pixel_y=0;src.pixel_x=13
if(src.dir==EAST)
src.pixel_y=0;src.pixel_x=-13
if(src.dir==SOUTH)
src.pixel_y=13;src.pixel_x=0
src.reach+=1
var/mob/O=src.Owner
if(!O.Water_Limit)
var/ManaLoss=50;O.Mana-=abs(ManaLoss)
var/LALA=src.waterreach
if(src.reach>LALA)
O<<"Your water falls because it cannot reach any further!";del(src)

var/prevloc=src.loc;
var/prevdir=src.dir
..()
if(src.dir==NORTH)
src.pixel_y=-13;src.pixel_x=0
if(src.dir==WEST)
src.pixel_y=0;src.pixel_x=13
if(src.dir==EAST)
src.pixel_y=0;src.pixel_x=-13
if(src.dir==SOUTH)
src.pixel_y=13;src.pixel_x=0
var/obj/water/watertrail/A=new(prevloc);
A.icon='Icons/Abilites/WaterCapture.dmi';
A.icon_state="trail"

src.TrailList.Add(A)
if(!src.firststep)
src.firststep=1;
A.icon_state="start";
var/obj/water/watertrail/B=new(prevloc);
B.icon='Icons/Abilites/WaterCapture.dmi';
B.icon_state="head";
B.dir=src.dir;
B.Owner=src.Owner

src.TrailList.Add(B)
if(B.dir==NORTH)
B.pixel_y=11;B.pixel_x=0
if(B.dir==WEST)
B.pixel_y=0;B.pixel_x=-11
if(B.dir==EAST)
B.pixel_y=0;B.pixel_x=11
if(B.dir==SOUTH)
B.pixel_y=-11;B.pixel_x=0
else
if(prevdir==src.dir)
A.dir=prevdir
else if(prevdir==(turn(src.dir,180)))
A.dir=prevdir
else
if(prevdir==NORTH&&src.dir==EAST)
A.dir=NORTHEAST
if(prevdir==EAST&&src.dir==NORTH)
A.dir=SOUTHWEST
if(prevdir==SOUTH&&src.dir==EAST)
A.dir=SOUTHEAST
if(prevdir==EAST&&src.dir==SOUTH)
A.dir=NORTHWEST
if(prevdir==WEST&&src.dir==NORTH)
A.dir=SOUTHEAST
if(prevdir==NORTH&&src.dir==WEST)
A.dir=NORTHWEST
if(prevdir==SOUTH&&src.dir==WEST)
A.dir=SOUTHWEST
if(prevdir==WEST&&src.dir==SOUTH)
A.dir=NORTHEAST
A.Owner=src.Owner

//and for the move

mob/verb
MoveNorth()
set hidden=1;set instant=1
if(src.controlled!=null&&src.controlled!="")
src=src.controlled
src.ResetFocus()
src.SprintCheck("North")
if(src.screwed)
step(src,WEST)
return
if(src.ClanCreate)
return
if(src.Bone<5)
src<<"You can't move! Your Bones are too damaged!";return

src.MN=1;src.MS=0;QueN=1;src.MovementLoop()


With my knowledge of DM I don't know how to change .north to the new way of moving. I'm also using Falacy's Moving System if that helps.
client
North()
MoveNorth()


Though I can hardly imagine why you'd do it this way, instead of something like:

client
North()
src.mob.MoveHandler("north")
..()

mob
MoveHandler(var/dir)
switch(dir)
if("north")
// Your stuff


This makes your code more reusable.
I've already tried using client. It still doesn't move the water with the MoveNorth from some reason :/ I dunno why.

I always get a runtime error in-game that tells me that MoveNorth is an undefined var when I try moving the water around. (Same goes for south, east, and west)
Water is an obj, not a mob.
I know that .-. But I'm try to control the obj/water using MoveNorth() (south east west) instead of .north (south east west)
Then you'll need to use an obj verb, not a mob verb.

Specifically, .north is a client proc and it calls step(src.mob, NORTH). You can control the water using .north but you're gonna need to call a function to do so when .north is called. Keep in mind my suggestion of making 1 move function instead of making 4-8 though.
obj verb?
Objects can have verbs too. It's the way I often code skills.

obj
Paper
desc = "This is a blank sheet of paper"

verb // Defines verbs for /obj/Paper
Read()
set src in oview(usr,1)
usr << "[src.desc]"
return

// alternatively, you can define it in one line or
// over multiple lines like this.

obj/Paper
verb/Read()
// ...
obj/Paper/verb/Read()
// ...

// Personally I go with the method I first demonstrated
// because it's easy for me to keep track of what inherits what.
Best response
Correction, .north is not a client proc. It's a verb. Specifically it is client/North().