/*
Copyright (C) 2003, 2010 - Wolfire Games
+Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
This file is part of Lugaru.
extern GLubyte wolfbloodText[512 * 512 * 3];
extern int bloodtoggle;
extern Objects objects;
-extern bool osx;
extern bool autoslomo;
extern float camerashake;
extern float woozy;
// FIXME: should abstract out inputs
static int bleedxint, bleedyint;
static XYZ bloodvel;
- //if(howmuch&&id==0)blooddimamount=1;
if (bloodtoggle && tutoriallevel != 1) {
if (bleeding <= 0 && spurt) {
spurt = 0;
envsoundvol[numenvsounds] = 16;
envsoundlife[numenvsounds] = .4;
numenvsounds++;
- //if(i==2)whichsound=rabbitpain2sound;
}
if (whichsound != -1)
// texture manipulation follows
int offsetx = 0, offsety = 0;
- /*if(which==225){
- offsety=Random()%40;
- offsetx=abs(Random()%120);
- }
- if(which==220||which==215){
- offsety=Random()%20;
- offsetx=abs(Random()%80);
- }*/
- //which=220;
offsetx = (1 + coordsy) * 512 - 291;
offsety = coordsx * 512 - 437;
if (animTarget == staffhitanim && distsq(&victim->coords, &coords) < 2 && ((victim->id == 0 && victim->crouchkeydown) || Random() % 4 == 0)) {
if (victim->weaponactive != -1) {
victim->throwtogglekeydown = 1;
- weapons[victim->weaponids[0]].owner = -1;
- weapons[victim->weaponids[0]].velocity = victim->velocity * .2;
- if (weapons[victim->weaponids[0]].velocity.x == 0)
- weapons[victim->weaponids[0]].velocity.x = .1;
- weapons[victim->weaponids[0]].tipvelocity = weapons[victim->weaponids[0]].velocity;
- weapons[victim->weaponids[0]].missed = 1;
- weapons[victim->weaponids[0]].freetime = 0;
- weapons[victim->weaponids[0]].firstfree = 1;
- weapons[victim->weaponids[0]].physics = 1;
+ XYZ tempVelocity = victim->velocity * .2;
+ if (tempVelocity.x == 0)
+ tempVelocity.x = .1;
+ weapons[victim->weaponids[0]].drop(tempVelocity, tempVelocity, false);
victim->num_weapons--;
if (victim->num_weapons) {
victim->weaponids[0] = victim->weaponids[victim->num_weapons];
if (animTarget == staffspinhitanim && distsq(&victim->coords, &coords) < 2 && ((victim->id == 0 && victim->crouchkeydown) || Random() % 2 == 0)) {
if (victim->weaponactive != -1) {
victim->throwtogglekeydown = 1;
- weapons[victim->weaponids[0]].owner = -1;
- weapons[victim->weaponids[0]].velocity = victim->velocity * .2;
- if (weapons[victim->weaponids[0]].velocity.x == 0)
- weapons[victim->weaponids[0]].velocity.x = .1;
- weapons[victim->weaponids[0]].tipvelocity = weapons[victim->weaponids[0]].velocity;
- weapons[victim->weaponids[0]].missed = 1;
- weapons[victim->weaponids[0]].freetime = 0;
- weapons[victim->weaponids[0]].firstfree = 1;
- weapons[victim->weaponids[0]].physics = 1;
+ XYZ tempVelocity = victim->velocity * .2;
+ if (tempVelocity.x == 0)
+ tempVelocity.x = .1;
+ weapons[victim->weaponids[0]].drop(tempVelocity, tempVelocity, false);
victim->num_weapons--;
if (victim->num_weapons) {
victim->weaponids[0] = victim->weaponids[victim->num_weapons];
if (animTarget == swordslashanim && distsq(&victim->coords, &coords) < 2 && ((victim->id == 0 && victim->crouchkeydown) || Random() % 4 == 0)) {
if (victim->weaponactive != -1) {
victim->throwtogglekeydown = 1;
- weapons[victim->weaponids[0]].owner = -1;
- weapons[victim->weaponids[0]].velocity = victim->velocity * .2;
- if (weapons[victim->weaponids[0]].velocity.x == 0)
- weapons[victim->weaponids[0]].velocity.x = .1;
- weapons[victim->weaponids[0]].tipvelocity = weapons[victim->weaponids[0]].velocity;
- weapons[victim->weaponids[0]].missed = 1;
- weapons[victim->weaponids[0]].freetime = 0;
- weapons[victim->weaponids[0]].firstfree = 1;
- weapons[victim->weaponids[0]].physics = 1;
+ XYZ tempVelocity = victim->velocity * .2;
+ if (tempVelocity.x == 0)
+ tempVelocity.x = .1;
+ weapons[victim->weaponids[0]].drop(tempVelocity, tempVelocity, false);
victim->num_weapons--;
if (victim->num_weapons) {
victim->weaponids[0] = victim->weaponids[victim->num_weapons];
if (animTarget == knifeslashstartanim && distsq(&victim->coords, &coords) < 2 && (victim->id == 0 || Random() % 4 == 0)) {
if (victim->weaponactive != -1) {
victim->throwtogglekeydown = 1;
- weapons[victim->weaponids[0]].owner = -1;
- weapons[victim->weaponids[0]].velocity = victim->velocity * .2;
- if (weapons[victim->weaponids[0]].velocity.x == 0)
- weapons[victim->weaponids[0]].velocity.x = .1;
- weapons[victim->weaponids[0]].tipvelocity = weapons[victim->weaponids[0]].velocity;
- weapons[victim->weaponids[0]].missed = 1;
- weapons[victim->weaponids[0]].freetime = 0;
- weapons[victim->weaponids[0]].firstfree = 1;
- weapons[victim->weaponids[0]].physics = 1;
+ XYZ tempVelocity = victim->velocity * .2;
+ if (tempVelocity.x == 0)
+ tempVelocity.x = .1;
+ weapons[victim->weaponids[0]].drop(tempVelocity, tempVelocity, false);
victim->num_weapons--;
if (victim->num_weapons) {
victim->weaponids[0] = victim->weaponids[victim->num_weapons];
victim->animCurrent = knifeslashreversalanim;
victim->animTarget = knifeslashreversalanim;
}
- if (animTarget != knifeslashstartanim && animTarget != staffhitanim && animTarget != staffspinhitanim && animTarget != winduppunchanim && animTarget != wolfslapanim && animTarget != swordslashanim && animTarget != swordslashanim) {
+ if (animTarget != knifeslashstartanim && animTarget != staffhitanim && animTarget != staffspinhitanim && animTarget != winduppunchanim && animTarget != wolfslapanim && animTarget != swordslashanim) {
victim->targettilt2 = targettilt2;
victim->frameCurrent = frameCurrent;
victim->frameTarget = frameTarget;
victim->animTarget = staggerbackhighanim;
victim->targetyaw = targetyaw + 180;
victim->target = 0;
- weapons[victim->weaponids[0]].owner = -1;
aim = DoRotation(facing, 0, 90, 0) * 21;
aim.y += 7;
- weapons[victim->weaponids[0]].velocity = aim * -.2;
- weapons[victim->weaponids[0]].tipvelocity = aim;
- weapons[victim->weaponids[0]].missed = 1;
- weapons[victim->weaponids[0]].hitsomething = 0;
- weapons[victim->weaponids[0]].freetime = 0;
- weapons[victim->weaponids[0]].firstfree = 1;
- weapons[victim->weaponids[0]].physics = 1;
+ weapons[victim->weaponids[0]].drop(aim * -.2, aim);
victim->num_weapons--;
if (victim->num_weapons) {
victim->weaponids[0] = victim->weaponids[num_weapons];
animTarget = staggerbackhighanim;
targetyaw = targetyaw + 180;
target = 0;
- weapons[weaponids[0]].owner = -1;
aim = DoRotation(facing, 0, 90, 0) * 21;
aim.y += 7;
- weapons[weaponids[0]].velocity = aim * -.2;
- weapons[weaponids[0]].tipvelocity = aim;
- weapons[weaponids[0]].hitsomething = 0;
- weapons[weaponids[0]].missed = 1;
- weapons[weaponids[0]].freetime = 0;
- weapons[weaponids[0]].firstfree = 1;
- weapons[weaponids[0]].physics = 1;
+ weapons[victim->weaponids[0]].drop(aim * -.2, aim);
num_weapons--;
if (num_weapons) {
weaponids[0] = weaponids[num_weapons];
skeleton.free = 2;
DoDamage(10000);
RagDoll(0);
- /*if(autoslomo){
- slomo=1;
- slomodelay=.2;
- }*/
if (!dead && creature == wolftype) {
award_bonus(0, Wolfbonus);
}
envsoundvol[numenvsounds] = 16;
envsoundlife[numenvsounds] = .4;
numenvsounds++;
- //if(i==2)whichsound=rabbitpain2sound;
}
if (whichsound != -1) {
}
}
speechdelay = .3;
-
- //if(permanentdamage>=damagetolerance&&howmuch<50)permanentdamage=damagetolerance-1;
- //if(damage>=damagetolerance&&howmuch<30&&!dead)damage=damagetolerance-1;
}
/* EFFECT
skeleton.joints[i].locked = 0;
skeleton.joints[i].position = DoRotation(DoRotation(DoRotation(skeleton.joints[i].position, 0, 0, tilt), tilt2, 0, 0), 0, yaw, 0);
if (!isnormal(skeleton.joints[i].position.x)) skeleton.joints[i].position = DoRotation(skeleton.joints[i].position, 0, yaw, 0);
- if (!isnormal(skeleton.joints[i].position.x)) skeleton.joints[i].position = skeleton.joints[i].position;
if (!isnormal(skeleton.joints[i].position.x)) skeleton.joints[i].position = coords;
skeleton.joints[i].position.y += .1;
skeleton.joints[i].oldposition = skeleton.joints[i].position;
// drop weapon
if (Random() % 2 == 0) {
if (weaponactive != -1 && animTarget != rabbitkickanim && num_weapons > 0) {
- weapons[weaponids[0]].owner = -1;
- weapons[weaponids[0]].hitsomething = 0;
- weapons[weaponids[0]].velocity = jointVel(righthand) * scale * -.3;
+ weapons[weaponids[0]].drop(jointVel(righthand) * scale * -.3, jointVel(righthand) * scale);
weapons[weaponids[0]].velocity.x += .01;
- weapons[weaponids[0]].tipvelocity = jointVel(righthand) * scale;
- weapons[weaponids[0]].missed = 1;
- weapons[weaponids[0]].freetime = 0;
- weapons[weaponids[0]].firstfree = 1;
- weapons[weaponids[0]].physics = 1;
num_weapons--;
if (num_weapons) {
weaponids[0] = weaponids[num_weapons];
}
if (animTarget == rabbittacklinganim && frameTarget == 1) {
- //if(victim->aitype==attacktypecutoff&&Random()%2==0&&victim->stunned<=0&&animation[victim->animTarget].attack==neutral&&victim->id!=0)Reverse();
if (victim->aitype == attacktypecutoff && victim->stunned <= 0 && victim->surprised <= 0 && victim->id != 0)
Reverse();
if (animTarget == rabbittacklinganim && frameTarget == 1 && !victim->isCrouch() && victim->animTarget != backhandspringanim) {
}
speechdelay = .3;
}
- //if(animation[animTarget].attack==neutral)whichsound=movewhooshsound;
}
- //else if(animation[animTarget].label[frameTarget]==4)whichsound=knifeswishsound;
- //if(animation[animTarget].label[frameTarget]==8)whichsound=landsound2;
if (whichsound != -1) {
emit_sound_at(whichsound, coords);
emit_sound_at(knifedrawsound, coords, 128.);
}
- weaponactive = 0;
- weapons[i].owner = id;
- if (num_weapons > 0) {
- weaponids[num_weapons] = weaponids[0];
- }
- num_weapons++;
- weaponids[0] = i;
+ takeWeapon(i);
}
}
}
emit_sound_at(knifedrawsound, coords, 128.);
}
}
- weaponactive = 0;
if (weapons[i].owner != -1) {
-
victim = Person::players[weapons[i].owner];
if (victim->num_weapons == 1)
victim->num_weapons = 0;
victim->jointVel(rightshoulder) += relative * 6;
victim->jointVel(leftshoulder) += relative * 6;
}
- weapons[i].owner = id;
- if (num_weapons > 0) {
- weaponids[num_weapons] = weaponids[0];
- }
- num_weapons++;
- weaponids[0] = i;
+ takeWeapon(i);
}
}
}
if (hasvictim) {
damagemult /= victim->damagetolerance / 200;
}
- //if(onfire)damagemult=3;
if ((animation[animTarget].attack == normalattack || animTarget == walljumprightkickanim || animTarget == walljumpleftkickanim) && (!feint) && (victim->skeleton.free != 2 || animTarget == killanim || animTarget == dropkickanim || animTarget == crouchstabanim || animTarget == swordgroundstabanim || animTarget == staffgroundsmashanim)) {
if (animTarget == spinkickanim && animation[animTarget].label[frameCurrent] == 5) {
if (distsq(&coords, &victim->coords) < (scale * 5) * (scale * 5) * 3 && 3 && animation[victim->animTarget].height != lowheight) {
}
if ((animTarget == crouchstabanim || animTarget == swordgroundstabanim) && animation[animTarget].label[frameCurrent] == 5) {
- //if(id==0)camerashake+=.4;
if (hasvictim)
if (!victim->skeleton.free)
if (weaponactive != -1) {
escapednum = 0;
XYZ aim;
- weapons[weaponids[0]].owner = -1;
aim = victim->coords + DoRotation(victim->jointPos(abdomen), 0, victim->yaw, 0) * victim->scale + victim->velocity * findDistance(&victim->coords, &coords) / 50 - (coords + DoRotation(jointPos(righthand), 0, yaw, 0) * scale);
Normalise(&aim);
- /*if(victim->animTarget==jumpupanim||victim->animTarget==jumpdownanim){
- aim=DoRotation(aim,(float)abs(Random()%15)-7,(float)abs(Random()%15)-7,0);
- }*/
- weapons[weaponids[0]].velocity = aim * 50;
- weapons[weaponids[0]].tipvelocity = aim * 50;
- weapons[weaponids[0]].missed = 0;
- weapons[weaponids[0]].hitsomething = 0;
- weapons[weaponids[0]].freetime = 0;
- weapons[weaponids[0]].firstfree = 1;
- weapons[weaponids[0]].physics = 0;
+ weapons[weaponids[0]].thrown(aim * 50);
num_weapons--;
if (num_weapons) {
weaponids[0] = weaponids[num_weapons];
victim->animTarget = staggerbackhighanim;
victim->targetyaw = targetyaw + 180;
victim->target = 0;
- weapons[victim->weaponids[0]].owner = -1;
aim = DoRotation(facing, 0, 90, 0) * 21;
aim.y += 7;
- weapons[victim->weaponids[0]].velocity = aim * -.2;
- weapons[victim->weaponids[0]].tipvelocity = aim;
- weapons[victim->weaponids[0]].missed = 1;
- weapons[weaponids[0]].hitsomething = 0;
- weapons[victim->weaponids[0]].freetime = 0;
- weapons[victim->weaponids[0]].firstfree = 1;
- weapons[victim->weaponids[0]].physics = 1;
+ weapons[victim->weaponids[0]].drop(aim * -.2, aim);
victim->num_weapons--;
if (victim->num_weapons) {
victim->weaponids[0] = victim->weaponids[num_weapons];
if ((animTarget == swordslashreversalanim || animTarget == knifeslashreversalanim || animTarget == staffhitreversalanim || animTarget == staffspinhitreversalanim) && animation[animTarget].label[frameCurrent] == 5) {
if (victim->weaponactive != -1 && victim->num_weapons > 0) {
if (weapons[victim->weaponids[victim->weaponactive]].owner == int(victim->id)) {
- weapons[victim->weaponids[victim->weaponactive]].owner = id;
- weaponactive = 0;
- if (num_weapons > 0) {
- weaponids[num_weapons] = weaponids[victim->weaponactive];
- }
- num_weapons++;
- weaponids[0] = victim->weaponids[victim->weaponactive];
+ takeWeapon(victim->weaponids[victim->weaponactive]);
victim->num_weapons--;
if (victim->num_weapons > 0) {
victim->weaponids[victim->weaponactive] = victim->weaponids[victim->num_weapons];
- //if(victim->weaponstuck==victim->num_weapons)victim->weaponstuck=0;
}
victim->weaponactive = -1;
}
relative = victim->coords - oldcoords;
relative.y = 0;
Normalise(&relative);
- //relative=DoRotation(relative,0,-90,0);
for (int i = 0; i < victim->skeleton.num_joints; i++) {
victim->skeleton.joints[i].velocity += relative * damagemult * 30;
}
victim->jointVel(abdomen) += relative * damagemult * 200;
- //FootLand(1,2);
victim->Puff(head);
victim->DoDamage(damagemult * 70 / victim->protectionhigh);
}
relative = victim->coords - oldcoords;
relative.y = 0;
Normalise(&relative);
- //relative=DoRotation(relative,0,-90,0);
for (int i = 0; i < victim->skeleton.num_joints; i++) {
victim->skeleton.joints[i].velocity += relative * damagemult * 30;
}
victim->jointVel(abdomen) += relative * damagemult * 200;
- //FootLand(1,2);
victim->Puff(head);
victim->DoDamage(damagemult * 70 / victim->protectionhigh);
}
relative = facing;
relative.y = 0;
Normalise(&relative);
- //relative*=-1;
relative.y -= .1;
for (int i = 0; i < victim->skeleton.num_joints; i++) {
victim->skeleton.joints[i].velocity += relative * damagemult * 70;
relative = facing;
relative.y = 0;
Normalise(&relative);
- //relative*=-1;
relative.y -= .1;
for (int i = 0; i < victim->skeleton.num_joints; i++) {
victim->skeleton.joints[i].velocity += relative * damagemult * 70;
victim->skeleton.joints[i].velocity += relative * damagemult * 40;
}
victim->jointVel(abdomen) += relative * damagemult * 200;
- //FootLand(1,2);
victim->Puff(abdomen);
victim->DoDamage(damagemult * 30 / victim->protectionhigh);
for (int i = 0; i < victim->skeleton.num_joints; i++) {
victim->skeleton.joints[i].velocity += relative * damagemult * 40;
}
- //victim->DoDamage(1000);
victim->damage = victim->damagetolerance;
victim->permanentdamage = victim->damagetolerance - 1;
bool doslice;
if (animTarget == knifefollowanim)
victim->DoBloodBig(200, 210);
if (animTarget == knifesneakattackanim) {
- /*victim->DoBloodBig(200,195);
- XYZ bloodvel;
- bloodvel=0;
- bloodvel.z=20;
- bloodvel.y=5;
- bloodvel=DoRotation(bloodvel,((float)(Random()%100))/4,yaw+((float)(Random()%100))/4,0)*scale;
- Sprite::MakeSprite(bloodsprite, DoRotation(jointPos(neck),0,yaw,0)*scale+coords,bloodvel, 1,1,1, .05, 1);
- */
XYZ footvel, footpoint;
footvel = 0;
footpoint = weapons[weaponids[0]].tippoint;
victim->Puff(neck);
XYZ relative;
- //relative=victim->coords-oldcoords;
relative = facing * -1;
relative.y = 0;
Normalise(&relative);
escapednum = 0;
victim->RagDoll(0);
XYZ relative;
- //relative=victim->coords-oldcoords;
relative = facing * -1;
relative.y = 0;
Normalise(&relative);
transspeed = 15;
}
}
- //skeleton.DoConstraints();
}
/* EFFECT
if (onfire) {
burnt += multiplier;
- /*if(aitype!=playercontrolled)*///deathbleeding=5;
- /*if(aitype!=playercontrolled)*/
deathbleeding = 1;
if (burnt > .6)
burnt = .6;
bleeding -= multiplier * .3;
if (bloodtoggle == 2) {
skeleton.drawmodel.textureptr.bind();
- if (bleeding <= 0 && (detail != 2 || osx))
+ if ((bleeding <= 0) && (detail != 2))
DoMipmaps();
}
}
}
bloodloss += deathbleeding * multiplier * 80;
deathbleeding -= multiplier * 1.6;
- //if(id==0)deathbleeding-=multiplier*.2;
if (deathbleeding < 0)
deathbleeding = 0;
if (bloodloss > damagetolerance && animation[animTarget].attack == neutral) {
if (weaponactive != -1) {
- weapons[weaponids[0]].owner = -1;
- weapons[weaponids[0]].velocity = velocity * scale * -.3;
+ weapons[weaponids[0]].drop(velocity * scale * -.3, velocity * scale);
weapons[weaponids[0]].velocity.x += .01;
- weapons[weaponids[0]].tipvelocity = velocity * scale;
- weapons[weaponids[0]].missed = 1;
- weapons[weaponids[0]].hitsomething = 0;
- weapons[weaponids[0]].freetime = 0;
- weapons[weaponids[0]].firstfree = 1;
- weapons[weaponids[0]].physics = 1;
num_weapons--;
if (num_weapons) {
weaponids[0] = weaponids[num_weapons];
}
}
}
- if (!osx && detail > 1) {
+ if (detail > 1) {
skeleton.drawmodel.textureptr.bind();
DoMipmaps();
}
RagDoll(0);
if (weaponactive != -1) {
- weapons[weaponids[0]].owner = -1;
- weapons[weaponids[0]].velocity = velocity * scale * -.3;
+ weapons[weaponids[0]].drop(velocity * scale * -.3, velocity * scale);
weapons[weaponids[0]].velocity.x += .01;
- weapons[weaponids[0]].tipvelocity = velocity * scale;
- weapons[weaponids[0]].missed = 1;
- weapons[weaponids[0]].hitsomething = 0;
- weapons[weaponids[0]].freetime = 0;
- weapons[weaponids[0]].firstfree = 1;
- weapons[weaponids[0]].physics = 1;
num_weapons--;
if (num_weapons) {
weaponids[0] = weaponids[num_weapons];
damage += 20;
}
- //if(dead)damage-=multiplier/4;
if (!dead)
damage -= multiplier * 13;
- //if(!dead&&deathbleeding<=0&&id==0)bloodloss-=multiplier*4;
if (!dead)
permanentdamage -= multiplier * 4;
if (isIdle() || isCrouch()) {
if (!dead)
permanentdamage -= multiplier * 4;
- //if(!dead&&deathbleeding<=0&&id==0)bloodloss-=multiplier*4;
}
if (damage < 0)
damage = 0;
DoBlood(1, 255);
if (weaponactive != -1) {
- weapons[weaponids[0]].owner = -1;
- weapons[weaponids[0]].velocity = velocity * scale * -.3;
+ weapons[weaponids[0]].drop(velocity * scale * -.3, velocity * scale);
weapons[weaponids[0]].velocity.x += .01;
- weapons[weaponids[0]].tipvelocity = velocity * scale;
- weapons[weaponids[0]].missed = 1;
- weapons[weaponids[0]].hitsomething = 0;
- weapons[weaponids[0]].freetime = 0;
- weapons[weaponids[0]].firstfree = 1;
- weapons[weaponids[0]].physics = 1;
num_weapons--;
if (num_weapons) {
weaponids[0] = weaponids[num_weapons];
yaw = targetyaw;
frameTarget = 0;
- // frameTarget=2;
animTarget = flipanim;
crouchtogglekeydown = 1;
target = 0;
animCurrent = tempanim;
frameCurrent = 0;
target = 0;
- //tilt2=targettilt2;
-
- //if(middle.y>0)targetoffset.y=middle.y+1;
for (int i = 0; i < skeleton.num_joints; i++) {
tempanimation.position[i][0] = skeleton.joints[i].position;
}
}
- if (animTarget == jumpupanim || animTarget == crouchstabanim || animTarget == swordgroundstabanim || animTarget == swordfightidlebothanim || animTarget == blockhighleftanim || animTarget == blockhighleftanim) {
+ if (animTarget == jumpupanim || animTarget == crouchstabanim || animTarget == swordgroundstabanim || animTarget == swordfightidlebothanim || animTarget == blockhighleftanim) {
//close hands and mouth
if (righthandmorphend != 1 && righthandmorphness == targetrighthandmorphness) {
righthandmorphness = 0;
}
//Running velocity
- //if(!creature==wolftype||animTarget==rabbitkickanim)
if (animTarget == rabbittackleanim) {
velocity += facing * multiplier * speed * 700 * scale;
velspeed = findLength(&velocity);
velocity = flatfacing * velspeed;
}
-
- /*if(animCurrent==rollanim&&(isCrouch()||isIdle())){
- velocity+=facing*multiplier*speed*700*scale;
- velspeed=findLength(&velocity);
- if(velspeed>speed*25*scale){
- velocity/=velspeed;
- velspeed=speed*25*scale;
- velocity*=velspeed;
- }
- velocity.y+=gravity*multiplier*20;
- ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z));
- velspeed=findLength(&velocity);
- velocity=flatfacing*velspeed;
- }*/
-
if (animTarget == sneakanim || animTarget == walkanim) {
velocity += facing * multiplier * speed * 700 * scale;
velspeed = findLength(&velocity);
(v0.y * (1 - morphness) + v1.y * morphness) * proportionhead.y,
(v0.z * (1 - morphness) + v1.z * morphness) * proportionhead.z);
glGetFloatv(GL_MODELVIEW_MATRIX, M);
- //if(!isnormal(M[12])||!isnormal(M[13])||!isnormal(M[14]))test=0;
- //if(!isnormal(scale))test=1;
skeleton.drawmodel.vertex[skeleton.muscles[i].vertices[j]].x = M[12] * scale;
skeleton.drawmodel.vertex[skeleton.muscles[i].vertices[j]].y = M[13] * scale;
skeleton.drawmodel.vertex[skeleton.muscles[i].vertices[j]].z = M[14] * scale;
- //test=2;
glPopMatrix();
}
}
glEnable(GL_BLEND);
}
if (tutoriallevel && id != 0) {
- //glDisable(GL_TEXTURE_2D);
glColor4f(.7, .7, .7, 0.6);
glDepthMask(0);
glEnable(GL_LIGHTING);
calcrot = 1;
if (animCurrent != animTarget)
calcrot = 1;
- //if(id==0)calcrot=1;
if (skeleton.free == 2)
calcrot = 0;
return firstintersecting;
}
+void Person::takeWeapon(int weaponId)
+{
+ weaponactive = 0;
+ weapons[weaponId].owner = id;
+ if (num_weapons > 0) {
+ weaponids[num_weapons] = weaponids[0];
+ }
+ num_weapons++;
+ weaponids[0] = weaponId;
+}
+