for all to u that wanted damage per seconds, i think (and hope) i found the answer on a topic thats lieing on 1 of the deepest bottoms of sauerbraten.org :P
i found this from a comment, tyvm "pheonixsux"...
"In some games, such as some quake games, when you are under water for too long you start to drown.
these are the instructions for how to add this into your game mod and apparently holds up true with network play (not tested on laggy connections)
in struct physent of ents.h
at the top where you're defining your varables add in:
int wair; //represents air in lungs or water air
bool water; //will become true when in water, false when out.
in
void reset() of struct physent add in:
wair = 5000;
in fps.cpp
void update world (vec &pos, int curtime, int lm)
after
maptime += curtime;
add this line:
doMATTS(curtime);
before
void update world(ved &pos, int curtime, int lm)
add in this void function:
void doMATTS (int curtime)
{
//matts modifiers will be placed here.
if (player1->water)
{
int mytime;
mytime = curtime / 5;
if (mytime wair = player1->wair - (mytime);
}
if (!player1->water)
{
player1->wair = player1->wair + (curtime/2);
}
if (player1->wair > 5000) player1->wair = 5000;
if (player1->wair wair = 500;
}
}
in fps.cpp
void gameplayhud (int w, int h)
after
draw_textf("%d",90,822,player1->state==CS_DEAD > 0 : player1->health);
add this line:
draw_textf("%d",450,822,(player1->wair/50));
*in physics.cpp
void modify velocity(physent *pl, bool local, bool water, bool floating, int curtime, bool ladder)
pl->water = water;
*in physics.cpp
bool moveplayer(physent *pl, int movers, bool local, int curtime)
( is this line in the default source code? i don't recall. make sure this line is in there:
bool water = c.ext && c.ext->material == MAT_WATER;
)
after
float secs = curtime / 1000.f;
*add this line:
modifyvelocity(pl,local,water,floating,curtime,ladder);
IF this works for you then you will see a new air indicator on your screen.
it will go down when you're in the water and up when you're out of the water.
when you're in the water and it hits zero then you get roughly 10 points of damage per second until you get to the surface.
on the surface it will take a small amount of time to refill your lungs for your next dive."
i dont know what everything in this means and havent tested it by my own, but as far as i c it looks pretty good :P.
p.s. sorry for this long comment, please put me straight if i should do it on a different way...