player[j].aitype = attacktypecutoff;
} else {
- if (j != 0) numthrowkill++;
+ if (j != 0)
+ numthrowkill++;
player[j].num_weapons++;
player[j].weaponstuck = player[j].num_weapons - 1;
if (normaldotproduct(player[j].facing, velocity) > 0)
else
award_bonus(0, Bullseyebonus);
}
- } else missed = 1;
+ } else {
+ missed = 1;
+ }
}
}
}
bigtilt = 0;
bigtilt2 = 0;
bigrotation = 0;
- if (temppoint1.x > temppoint2.x) rotation1 = 360 - rotation1;
+ if (temppoint1.x > temppoint2.x)
+ rotation1 = 360 - rotation1;
}
}
bounceness = 0;
frictionness = abs(normaldotproduct(velocity, terrainnormal));
velocity -= bounceness;
- if (1 - friction * frictionness > 0)velocity *= 1 - friction * frictionness;
- else velocity = 0;
+ if (1 - friction * frictionness > 0)
+ velocity *= 1 - friction * frictionness;
+ else
+ velocity = 0;
velocity += bounceness * elasticity;
if (findLengthfast(&bounceness) > 1) {
tippoint += terrainnormal * .002;
bounceness = terrainnormal * findLength(&tipvelocity) * (abs(normaldotproduct(tipvelocity, terrainnormal)));
- if (findLengthfast(&tipvelocity) < findLengthfast(&bounceness))bounceness = 0;
+ if (findLengthfast(&tipvelocity) < findLengthfast(&bounceness))
+ bounceness = 0;
frictionness = abs(normaldotproduct(tipvelocity, terrainnormal));
tipvelocity -= bounceness;
- if (1 - friction * frictionness > 0)tipvelocity *= 1 - friction * frictionness;
- else tipvelocity = 0;
+ if (1 - friction * frictionness > 0)
+ tipvelocity *= 1 - friction * frictionness;
+ else
+ tipvelocity = 0;
tipvelocity += bounceness * elasticity;
if (findLengthfast(&bounceness) > 1) {
ReflectVector(&velocity, &terrainnormal);
bounceness = terrainnormal * findLength(&velocity) * (abs(normaldotproduct(velocity, terrainnormal)));
- if (findLengthfast(&velocity) < findLengthfast(&bounceness))bounceness = 0;
+ if (findLengthfast(&velocity) < findLengthfast(&bounceness))
+ bounceness = 0;
frictionness = abs(normaldotproduct(velocity, terrainnormal));
velocity -= bounceness;
- if (1 - friction * frictionness > 0)velocity *= 1 - friction * frictionness;
- else velocity = 0;
+ if (1 - friction * frictionness > 0)
+ velocity *= 1 - friction * frictionness;
+ else
+ velocity = 0;
velocity += bounceness * elasticity;
if (findLengthfast(&bounceness) > 1) {
ReflectVector(&tipvelocity, &terrainnormal);
bounceness = terrainnormal * findLength(&tipvelocity) * (abs(normaldotproduct(tipvelocity, terrainnormal)));
- if (findLengthfast(&tipvelocity) < findLengthfast(&bounceness))bounceness = 0;
+ if (findLengthfast(&tipvelocity) < findLengthfast(&bounceness))
+ bounceness = 0;
frictionness = abs(normaldotproduct(tipvelocity, terrainnormal));
tipvelocity -= bounceness;
- if (1 - friction * frictionness > 0)tipvelocity *= 1 - friction * frictionness;
- else tipvelocity = 0;
+ if (1 - friction * frictionness > 0)
+ tipvelocity *= 1 - friction * frictionness;
+ else
+ tipvelocity = 0;
tipvelocity += bounceness * elasticity;
if (findLengthfast(&bounceness) > 1) {
ReflectVector(&velocity, &terrainnormal);
position += terrainnormal * .002;
bounceness = terrainnormal * findLength(&velocity) * (abs(normaldotproduct(velocity, terrainnormal)));
- if (findLengthfast(&velocity) < findLengthfast(&bounceness))bounceness = 0;
+ if (findLengthfast(&velocity) < findLengthfast(&bounceness))
+ bounceness = 0;
frictionness = abs(normaldotproduct(velocity, terrainnormal));
velocity -= bounceness;
- if (1 - friction * frictionness > 0)velocity *= 1 - friction * frictionness;
- else velocity = 0;
- if (terrain.getOpacity(position.x, position.z) < .2)velocity += bounceness * elasticity * .3;
- else velocity += bounceness * elasticity;
+ if (1 - friction * frictionness > 0)
+ velocity *= 1 - friction * frictionness;
+ else
+ velocity = 0;
+ if (terrain.getOpacity(position.x, position.z) < .2)
+ velocity += bounceness * elasticity * .3;
+ else
+ velocity += bounceness * elasticity;
if (findLengthfast(&bounceness) > 1) {
int whichsound;
ReflectVector(&tipvelocity, &terrainnormal);
tippoint += terrainnormal * .002;
bounceness = terrainnormal * findLength(&tipvelocity) * (abs(normaldotproduct(tipvelocity, terrainnormal)));
- if (findLengthfast(&tipvelocity) < findLengthfast(&bounceness))bounceness = 0;
+ if (findLengthfast(&tipvelocity) < findLengthfast(&bounceness))
+ bounceness = 0;
frictionness = abs(normaldotproduct(tipvelocity, terrainnormal));
tipvelocity -= bounceness;
- if (1 - friction * frictionness > 0)tipvelocity *= 1 - friction * frictionness;
- else tipvelocity = 0;
- if (terrain.getOpacity(tippoint.x, tippoint.z) < .2)tipvelocity += bounceness * elasticity * .3;
- else tipvelocity += bounceness * elasticity;
+ if (1 - friction * frictionness > 0)
+ tipvelocity *= 1 - friction * frictionness;
+ else
+ tipvelocity = 0;
+ if (terrain.getOpacity(tippoint.x, tippoint.z) < .2)
+ tipvelocity += bounceness * elasticity * .3;
+ else
+ tipvelocity += bounceness * elasticity;
if (findLengthfast(&bounceness) > 1) {
int whichsound;
ReflectVector(&velocity, &terrainnormal);
//mid+=terrainnormal*.002;
bounceness = terrainnormal * findLength(&velocity) * (abs(normaldotproduct(velocity, terrainnormal)));
- if (findLengthfast(&velocity) < findLengthfast(&bounceness))bounceness = 0;
+ if (findLengthfast(&velocity) < findLengthfast(&bounceness))
+ bounceness = 0;
frictionness = abs(normaldotproduct(velocity, terrainnormal));
velocity -= bounceness;
- if (1 - friction * frictionness > 0)velocity *= 1 - friction * frictionness;
- else velocity = 0;
- if (terrain.getOpacity(mid.x, mid.z) < .2)velocity += bounceness * elasticity * .3;
- else velocity += bounceness * elasticity;
+ if (1 - friction * frictionness > 0)
+ velocity *= 1 - friction * frictionness;
+ else
+ velocity = 0;
+ if (terrain.getOpacity(mid.x, mid.z) < .2)
+ velocity += bounceness * elasticity * .3;
+ else
+ velocity += bounceness * elasticity;
if (findLengthfast(&bounceness) > 1) {
int whichsound;
if (terrain.getOpacity(mid.x, mid.z) > .2) {
- if (type == staff)whichsound = footstepsound3 + abs(Random() % 2);
- if (type != staff)whichsound = clank1sound + abs(Random() % 4);
- } else whichsound = footstepsound + abs(Random() % 2);
+ if (type == staff)
+ whichsound = footstepsound3 + abs(Random() % 2);
+ if (type != staff)
+ whichsound = clank1sound + abs(Random() % 4);
+ } else {
+ whichsound = footstepsound + abs(Random() % 2);
+ }
emit_sound_at(whichsound, mid,
findLengthfast(&bounceness)
* (terrain.getOpacity(position.x, position.z) > .2
ReflectVector(&tipvelocity, &terrainnormal);
//mid+=terrainnormal*.002;
bounceness = terrainnormal * findLength(&tipvelocity) * (abs(normaldotproduct(tipvelocity, terrainnormal)));
- if (findLengthfast(&tipvelocity) < findLengthfast(&bounceness))bounceness = 0;
+ if (findLengthfast(&tipvelocity) < findLengthfast(&bounceness))
+ bounceness = 0;
frictionness = abs(normaldotproduct(tipvelocity, terrainnormal));
tipvelocity -= bounceness;
- if (1 - friction * frictionness > 0)tipvelocity *= 1 - friction * frictionness;
- else tipvelocity = 0;
- if (terrain.getOpacity(mid.x, mid.z) < .2)tipvelocity += bounceness * elasticity * .3;
- else tipvelocity += bounceness * elasticity;
+ if (1 - friction * frictionness > 0)
+ tipvelocity *= 1 - friction * frictionness;
+ else
+ tipvelocity = 0;
+ if (terrain.getOpacity(mid.x, mid.z) < .2)
+ tipvelocity += bounceness * elasticity * .3;
+ else
+ tipvelocity += bounceness * elasticity;
if (findLengthfast(&bounceness) > 1) {
int whichsound;
if (terrain.getOpacity(mid.x, mid.z) > .2) {
- if (type == staff)whichsound = footstepsound3 + abs(Random() % 2);
- if (type != staff)whichsound = clank1sound + abs(Random() % 4);
- } else whichsound = footstepsound + abs(Random() % 2);
+ if (type == staff)
+ whichsound = footstepsound3 + abs(Random() % 2);
+ if (type != staff)
+ whichsound = clank1sound + abs(Random() % 4);
+ } else {
+ whichsound = footstepsound + abs(Random() % 2);
+ }
emit_sound_at(whichsound, mid,
findLengthfast(&bounceness)
* (terrain.getOpacity(position.x, position.z) > .2
bigtilt = 0;
bigtilt2 = 0;
bigrotation = 0;
- if (temppoint1.x > temppoint2.x)rotation1 = 360 - rotation1;
+ if (temppoint1.x > temppoint2.x)
+ rotation1 = 360 - rotation1;
//Stop moving
if (findLengthfast(&velocity) < .3 && findLengthfast(&tipvelocity) < .3 && hitsomething) {
if (blooddrip && bloody) {
blooddripdelay -= blooddrip * multiplier / 2;
blooddrip -= multiplier;
- if (blooddrip < 0) blooddrip = 0;
- if (blooddrip > 5) blooddrip = 5;
+ if (blooddrip < 0)
+ blooddrip = 0;
+ if (blooddrip > 5)
+ blooddrip = 5;
if (blooddripdelay < 0 && bloodtoggle) {
blooddripdelay = 1;
XYZ bloodvel;
lastdrawnbigtilt2 = bigtilt2;
lastdrawnsmallrotation = smallrotation;
lastdrawnsmallrotation2 = smallrotation2;
- if (owner != -1)lastdrawnanim = player[owner].animCurrent;
+ if (owner != -1)
+ lastdrawnanim = player[owner].animCurrent;
}
if (owner != -1) {
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix