Attack Code
i would like to create a attack code. i know how to creat one but i dong know the var that i put it when i attack some one i need to face him.
for e.g:
i attack someone and i should face him to attack him or the message should say
oview(4) <<"[usr] missed [M] (rand(punch,kick,fury punch)[attack])"
i dont think i am right on that code..even tho i am not right i diplaying it explain to u wat i need to learn..
mob
verb
Attackpeople(mob/M as mob|mob in oview(1))
set category = "Techniques"
set name = "Attack"
this code allows me to attack the mob even tho i dont face him..and also if there is two mob...when i attack a screen pops up.. i want to learn how to make it as when i attack no window pop and if i am alone and attack
usr <<"throwing kick, punch and fury punch in to the air"
and the damage should be like
M.powerlevel -= (usr.powerlevel * (rand(0.2,0.9)))
Defnece code
i have a defnce code, basically it is a block. but i want to code it like if users pl
mob
verb
Block()
set category = "Techniques"
if(usr.powerlevel < M.powerlevel)
if(usr.ko == 0)
if(usr.Blocking == 0)
usr.Blocking = 1
flick("sparblock",usr)
usr <<"You begin blocking."
sleep(100)
usr.Blocking = 0
else
usr <<"You are already blocking!"
return
else
usr << "Not while you are knocked out."
else
usr <<"[M] trying his best to attack you, chance to show him,what you made off"
i would like better deffence or help me with my system and tell me what i made wrong so..i know how to code if i am teaching a another person who dont know about it..
who panel
mob/Stat()
statpanel("Who")
for(var/mob/M in world)
if(M.client)
stat(M)
thats what i found from the newbei section...i want to know if i add this to my game code..would it show up NPC?
i want a good who panel coding..plus tell me how it works out to find the total members online!
thank alot people
-Dtroys
ID:174018
Oct 12 2003, 12:40 am
|
|
In response to Ease
|
|
Ease i think this is a newbei help page. They can type what ever they want to get help. Dont Accuse the person that use Message words. If you cant help him, then dont reply at all. Just leave it !!
- Gozenko |
In response to Gozenko
|
|
Maybe they can type whatever they want. It just means that it's less likely that they'll get help. No one wants to try to decrypt lines and lines of intentional mispellings and bad punctuation.
|
make a var
npc = 0 mob/Stat() statpanel("Online players") for(var/mob/M in world) if(M.npc =0) if(M.client) stat(M) (Edite)Should work now - Gozenko |
For your attack, try this out.
mob/verb/attack() For your defense, it looks like it is decent. What do you want to make better and why do you think you aren't doing good? For the who, no that should not display npcs. The line that reads if(client) is checking to see if the mob has a client. A client is the type used by the client (the player) to manipulate the world (usually through his/her mob). Only mobs that have players attached will have a client. |
In response to Loduwijk
|
|
So its going to be like this?
mob/verb/attack() var/mob/defender for(var/mob/M in get_step(src,dir)) defender=M break if(M.blocking == 0) M.hp -= usr.strenght - M.defence view(3) <<"[usr] attacks [M]" how do i calculate and show the Mob that user make this much amount of damage? could any one help me on it please. thanks tons - Dtroys |
In response to Dtroys
|
|
Dtroys wrote:
So its going to be like this? You changed the indentation in there, it should be: > mob/verb/attack() |
In response to Loduwijk
|
|
thanks for the help friends
|
e.g. I would like to say BYOND is great.
NOT
i wood lik 2 say bynd s gr8.
Once you have done all of this I may consider helping.
~Ease~