#include "openal_wrapper.h"
#include "Settings.h"
#include "Input.h"
-#include "Animation.h"
+#include "Animation/Animation.h"
#include "Awards.h"
#include "Menu.h"
#include "ConsoleCmds.h"
hostiletime = 0;
won = 0;
- animation[bounceidleanim].Load("Idle", middleheight, neutral);
+ //~ Animation::animations[bounceidleanim].Load("Idle", middleheight, neutral);
Dialog::dialogs.clear();
Person::players[i]->proportionlegs.z = 0;
}
- Person::players[i]->tempanimation.Load("Tempanim", 0, 0);
+ Person::players[i]->tempanimation = Animation("Tempanim", 0, 0);
if (i == 0) {
Person::players[i]->headmorphness = 0;
tutorialsuccess = 1;
break;
case 28:
- if (animation[Person::players[0]->animTarget].attack == reversed && Person::players[0]->feint)
+ if (Animation::animations[Person::players[0]->animTarget].attack == reversed && Person::players[0]->feint)
tutorialsuccess = 1;
break;
case 29:
}
break;
case 33:
- if (animation[Person::players[0]->animTarget].attack == reversal)
+ if (Animation::animations[Person::players[0]->animTarget].attack == reversal)
tutorialsuccess = 1;
break;
case 34:
- if (animation[Person::players[0]->animTarget].attack == reversal)
+ if (Animation::animations[Person::players[0]->animTarget].attack == reversal)
tutorialsuccess = 1;
break;
case 35:
- if (animation[Person::players[0]->animTarget].attack == reversal) {
+ if (Animation::animations[Person::players[0]->animTarget].attack == reversal) {
tutorialsuccess = 1;
reversaltrain = 0;
cananger = 0;
tutorialsuccess = 1;
break;
case 44:
- if (animation[Person::players[0]->animTarget].attack == reversal)
+ if (Animation::animations[Person::players[0]->animTarget].attack == reversal)
tutorialsuccess = 1;
break;
case 45:
- if (animation[Person::players[0]->animTarget].attack == reversal)
+ if (Animation::animations[Person::players[0]->animTarget].attack == reversal)
tutorialsuccess = 1;
break;
case 46:
- if (animation[Person::players[0]->animTarget].attack == reversal)
+ if (Animation::animations[Person::players[0]->animTarget].attack == reversal)
tutorialsuccess = 1;
break;
case 49:
Person::players.back()->proportionlegs.z = 0;
}
- Person::players.back()->tempanimation.Load("Tempanim", 0, 0);
+ Person::players.back()->tempanimation = Animation("Tempanim", 0, 0);
Person::players.back()->damagetolerance = 200;
if (Person::players[i]->animTarget == jumpupanim &&
Person::players[k]->animTarget != getupfrombackanim &&
Person::players[k]->animTarget != getupfromfrontanim &&
- animation[Person::players[k]->animTarget].height == middleheight &&
+ Animation::animations[Person::players[k]->animTarget].height == middleheight &&
normaldotproduct(Person::players[i]->velocity, Person::players[k]->coords - Person::players[i]->coords) < 0 &&
((Person::players[k]->aitype == playercontrolled && Person::players[k]->attackkeydown) ||
Person::players[k]->aitype != playercontrolled)) {
if (Person::players[k]->animTarget == jumpupanim &&
Person::players[i]->animTarget != getupfrombackanim &&
Person::players[i]->animTarget != getupfromfrontanim &&
- animation[Person::players[i]->animTarget].height == middleheight &&
+ Animation::animations[Person::players[i]->animTarget].height == middleheight &&
normaldotproduct(Person::players[k]->velocity, Person::players[i]->coords - Person::players[k]->coords) < 0 &&
((Person::players[i]->aitype == playercontrolled && Person::players[i]->attackkeydown) ||
Person::players[i]->aitype != playercontrolled)) {
Person::players[k]->animTarget == backhandspringanim ||
Person::players[k]->animTarget == dodgebackanim ||
Person::players[k]->animTarget == rollanim ||
- (animation[Person::players[k]->animTarget].attack &&
+ (Animation::animations[Person::players[k]->animTarget].attack &&
Person::players[k]->animTarget != rabbitkickanim &&
(Person::players[k]->animTarget != crouchstabanim || Person::players[k]->hasvictim) &&
(Person::players[k]->animTarget != swordgroundstabanim || Person::players[k]->hasvictim))) {
if (Person::players[k]->animTarget == jumpdownanim || Person::players[k]->isFlip()) {
//flipped into a rock
- if (Person::players[k]->isFlip() && animation[Person::players[k]->animTarget].label[Person::players[k]->frameTarget] == 7)
+ if (Person::players[k]->isFlip() && Animation::animations[Person::players[k]->animTarget].label[Person::players[k]->frameTarget] == 7)
Person::players[k]->RagDoll(0);
if (Person::players[k]->animTarget == jumpupanim) {
}
}
//attack
- if (!animation[Person::players[k]->animTarget].attack &&
+ if (!Animation::animations[Person::players[k]->animTarget].attack &&
!Person::players[k]->backkeydown &&
(Person::players[k]->isIdle() ||
Person::players[k]->isRun() ||
if (i == k || !(k == 0 || i == 0))
continue;
if (!Person::players[k]->hasvictim)
- if (animation[Person::players[k]->animTarget].attack != reversal) {
+ if (Animation::animations[Person::players[k]->animTarget].attack != reversal) {
//choose an attack
const float distance = distsq(&Person::players[k]->coords, &Person::players[i]->coords);
if (distance < 4.5 &&
Person::players[i]->animTarget != getupfrombackanim &&
(Person::players[i]->animTarget != staggerbackhighanim &&
(Person::players[i]->animTarget != staggerbackhardanim ||
- animation[staggerbackhardanim].label[Person::players[i]->frameTarget] == 6)) &&
+ Animation::animations[staggerbackhardanim].label[Person::players[i]->frameTarget] == 6)) &&
Person::players[i]->animTarget != jumpdownanim &&
Person::players[i]->animTarget != jumpupanim &&
Person::players[i]->animTarget != getupfromfrontanim) {
//sweep
if (distance < 2.5 * sq(Person::players[k]->scale * 5) &&
Person::players[k]->crouchkeydown &&
- animation[Person::players[i]->animTarget].height != lowheight)
+ Animation::animations[Person::players[i]->animTarget].height != lowheight)
Person::players[k]->animTarget = sweepanim;
//winduppunch
else if (distance < 1.5 * sq(Person::players[k]->scale * 5) &&
- animation[Person::players[i]->animTarget].height != lowheight &&
+ Animation::animations[Person::players[i]->animTarget].height != lowheight &&
!Person::players[k]->forwardkeydown &&
!Person::players[k]->leftkeydown &&
!Person::players[k]->rightkeydown &&
Person::players[k]->animTarget = winduppunchanim;
//upunch
else if (distance < 2.5 * sq(Person::players[k]->scale * 5) &&
- animation[Person::players[i]->animTarget].height != lowheight &&
+ Animation::animations[Person::players[i]->animTarget].height != lowheight &&
!Person::players[k]->forwardkeydown &&
!Person::players[k]->leftkeydown &&
!Person::players[k]->rightkeydown &&
Person::players[k]->animTarget = knifefollowanim;
//knifeslashstart
else if (distance < 2.5 * sq(Person::players[k]->scale * 5) &&
- animation[Person::players[i]->animTarget].height != lowheight &&
+ Animation::animations[Person::players[i]->animTarget].height != lowheight &&
!Person::players[k]->forwardkeydown &&
!Person::players[k]->leftkeydown &&
!Person::players[k]->rightkeydown &&
Person::players[k]->animTarget = knifeslashstartanim;
//swordslash
else if (distance < 4.5 * sq(Person::players[k]->scale * 5) &&
- animation[Person::players[i]->animTarget].height != lowheight &&
+ Animation::animations[Person::players[i]->animTarget].height != lowheight &&
!Person::players[k]->crouchkeydown &&
attackweapon == sword &&
Person::players[k]->weaponmissdelay <= 0)
Person::players[k]->animTarget = swordslashanim;
//staffhit
else if (distance < 4.5 * sq(Person::players[k]->scale * 5) &&
- animation[Person::players[i]->animTarget].height != lowheight &&
+ Animation::animations[Person::players[i]->animTarget].height != lowheight &&
!Person::players[k]->crouchkeydown &&
attackweapon == staff &&
Person::players[k]->weaponmissdelay <= 0 &&
Person::players[k]->animTarget = staffhitanim;
//staffspinhit
else if (distance < 4.5 * sq(Person::players[k]->scale * 5) &&
- animation[Person::players[i]->animTarget].height != lowheight &&
+ Animation::animations[Person::players[i]->animTarget].height != lowheight &&
!Person::players[k]->crouchkeydown &&
attackweapon == staff &&
Person::players[k]->weaponmissdelay <= 0)
Person::players[k]->animTarget = staffspinhitanim;
//spinkick
else if (distance < 2.5 * sq(Person::players[k]->scale * 5) &&
- animation[Person::players[i]->animTarget].height != lowheight)
+ Animation::animations[Person::players[i]->animTarget].height != lowheight)
Person::players[k]->animTarget = spinkickanim;
//lowkick
else if (distance < 2.5 * sq(Person::players[k]->scale * 5) &&
- animation[Person::players[i]->animTarget].height == lowheight &&
- animation[Person::players[k]->animTarget].attack != normalattack)
+ Animation::animations[Person::players[i]->animTarget].height == lowheight &&
+ Animation::animations[Person::players[k]->animTarget].attack != normalattack)
Person::players[k]->animTarget = lowkickanim;
} else { //AI player
if (distance < 4.5 * sq(Person::players[k]->scale * 5)) {
randattack = abs(Random() % 5);
if (!attackweapon && distance < 2.5 * sq(Person::players[k]->scale * 5)) {
//sweep
- if (randattack == 0 && animation[Person::players[i]->animTarget].height != lowheight)
+ if (randattack == 0 && Animation::animations[Person::players[i]->animTarget].height != lowheight)
Person::players[k]->animTarget = sweepanim;
//upunch
- else if (randattack == 1 && animation[Person::players[i]->animTarget].height != lowheight &&
+ else if (randattack == 1 && Animation::animations[Person::players[i]->animTarget].height != lowheight &&
!attackweapon)
Person::players[k]->animTarget = upunchanim;
//spinkick
- else if (randattack == 2 && animation[Person::players[i]->animTarget].height != lowheight)
+ else if (randattack == 2 && Animation::animations[Person::players[i]->animTarget].height != lowheight)
Person::players[k]->animTarget = spinkickanim;
//lowkick
- else if (animation[Person::players[i]->animTarget].height == lowheight)
+ else if (Animation::animations[Person::players[i]->animTarget].height == lowheight)
Person::players[k]->animTarget = lowkickanim;
}
if (attackweapon) {
if ((tutoriallevel != 1 || !attackweapon) &&
distance < 2.5 * sq(Person::players[k]->scale * 5) &&
randattack == 0 &&
- animation[Person::players[i]->animTarget].height != lowheight)
+ Animation::animations[Person::players[i]->animTarget].height != lowheight)
Person::players[k]->animTarget = sweepanim;
//knifeslashstart
else if (distance < 2.5 * sq(Person::players[k]->scale * 5) &&
else if ((tutoriallevel != 1 || !attackweapon) &&
distance < 2.5 * sq(Person::players[k]->scale * 5) &&
randattack == 1 &&
- animation[Person::players[i]->animTarget].height != lowheight)
+ Animation::animations[Person::players[i]->animTarget].height != lowheight)
Person::players[k]->animTarget = spinkickanim;
//lowkick
else if (distance < 2.5 * sq(Person::players[k]->scale * 5) &&
- animation[Person::players[i]->animTarget].height == lowheight &&
- animation[Person::players[k]->animTarget].attack != normalattack)
+ Animation::animations[Person::players[i]->animTarget].height == lowheight &&
+ Animation::animations[Person::players[k]->animTarget].attack != normalattack)
Person::players[k]->animTarget = lowkickanim;
}
}
Person::players[i]->targetyaw = Person::players[i]->yaw;
}
}
- if (animation[Person::players[k]->animTarget].attack == normalattack &&
+ if (Animation::animations[Person::players[k]->animTarget].attack == normalattack &&
Person::players[k]->victim == Person::players[i] &&
(!Person::players[i]->skeleton.free)) {
oldattackkey = 1;
if (i == k)
continue;
if ((playerrealattackkeydown || Person::players[i]->dead || !hasstaff) &&
- animation[Person::players[k]->animTarget].attack == neutral) {
+ Animation::animations[Person::players[k]->animTarget].attack == neutral) {
const float distance = distsq(&Person::players[k]->coords, &Person::players[i]->coords);
if (!Person::players[i]->dead || !realthreat || (!attackweapon && Person::players[k]->crouchkeydown))
if (Person::players[i]->skeleton.free)
}
}
}
- if (animation[Person::players[k]->animTarget].attack == normalattack &&
+ if (Animation::animations[Person::players[k]->animTarget].attack == normalattack &&
Person::players[k]->victim == Person::players[i] &&
(!Person::players[i]->skeleton.free ||
Person::players[k]->animTarget == killanim ||
!Person::players[k]->victim->skeleton.free &&
Person::players[k]->victim->animTarget != getupfrombackanim &&
Person::players[k]->victim->animTarget != getupfromfrontanim &&
- animation[Person::players[k]->victim->animTarget].height != lowheight &&
+ Animation::animations[Person::players[k]->victim->animTarget].height != lowheight &&
Person::players[k]->aitype != playercontrolled && //wat???
normaldotproduct(Person::players[k]->facing, Person::players[k]->victim->coords - Person::players[k]->coords) > 0 &&
Person::players[k]->rabbitkickenabled) ||
Person::players[k]->setAnimation(rabbitkickanim);
}
//update counts
- if (animation[Person::players[k]->animTarget].attack && k == 0) {
+ if (Animation::animations[Person::players[k]->animTarget].attack && k == 0) {
numattacks++;
switch (attackweapon) {
case 0:
for (unsigned k = 0; k < Person::players.size(); k++)
for (unsigned i = k + 1; i < Person::players.size(); i++) {
//neither player is part of a reversal
- if ((animation[Person::players[i]->animTarget].attack != reversed &&
- animation[Person::players[i]->animTarget].attack != reversal &&
- animation[Person::players[k]->animTarget].attack != reversed &&
- animation[Person::players[k]->animTarget].attack != reversal) || (i != 0 && k != 0))
- if ((animation[Person::players[i]->animCurrent].attack != reversed &&
- animation[Person::players[i]->animCurrent].attack != reversal &&
- animation[Person::players[k]->animCurrent].attack != reversed &&
- animation[Person::players[k]->animCurrent].attack != reversal) || (i != 0 && k != 0))
+ if ((Animation::animations[Person::players[i]->animTarget].attack != reversed &&
+ Animation::animations[Person::players[i]->animTarget].attack != reversal &&
+ Animation::animations[Person::players[k]->animTarget].attack != reversed &&
+ Animation::animations[Person::players[k]->animTarget].attack != reversal) || (i != 0 && k != 0))
+ if ((Animation::animations[Person::players[i]->animCurrent].attack != reversed &&
+ Animation::animations[Person::players[i]->animCurrent].attack != reversal &&
+ Animation::animations[Person::players[k]->animCurrent].attack != reversed &&
+ Animation::animations[Person::players[k]->animCurrent].attack != reversal) || (i != 0 && k != 0))
//neither is sleeping
if (Person::players[i]->howactive <= typesleeping && Person::players[k]->howactive <= typesleeping)
if (Person::players[i]->howactive != typesittingwall && Person::players[k]->howactive != typesittingwall)
k == 0 && findLengthfast(&rotatetarget) > 50 && Person::players[0]->rabbitkickragdoll) &&
normaldotproduct(rotatetarget, Person::players[k]->coords - Person::players[i]->coords) > 0) &&
(k == 0 ||
- k != 0 && Person::players[i]->skeleton.oldfree == 1 && animation[Person::players[k]->animCurrent].attack == neutral ||
- /*i!=0&&*/Person::players[k]->skeleton.oldfree == 1 && animation[Person::players[i]->animCurrent].attack == neutral)) ||
+ k != 0 && Person::players[i]->skeleton.oldfree == 1 && Animation::animations[Person::players[k]->animCurrent].attack == neutral ||
+ /*i!=0&&*/Person::players[k]->skeleton.oldfree == 1 && Animation::animations[Person::players[i]->animCurrent].attack == neutral)) ||
(Person::players[i]->animTarget == jumpupanim || Person::players[i]->animTarget == jumpdownanim || Person::players[i]->isFlip()) &&
(Person::players[k]->animTarget == jumpupanim || Person::players[k]->animTarget == jumpdownanim || Person::players[k]->isFlip()) &&
k == 0 && !Person::players[i]->skeleton.oldfree && !Person::players[k]->skeleton.oldfree) {
//If hit by body
if ( (i != 0 || Person::players[i]->skeleton.free) &&
(k != 0 || Person::players[k]->skeleton.free) ||
- (animation[Person::players[i]->animTarget].height == highheight &&
- animation[Person::players[k]->animTarget].height == highheight)) {
+ (Animation::animations[Person::players[i]->animTarget].height == highheight &&
+ Animation::animations[Person::players[k]->animTarget].height == highheight)) {
if (tutoriallevel != 1) {
emit_sound_at(heavyimpactsound, Person::players[i]->coords);
}
}
}
- if ( (animation[Person::players[i]->animTarget].attack == neutral ||
- animation[Person::players[i]->animTarget].attack == normalattack) &&
- (animation[Person::players[k]->animTarget].attack == neutral ||
- animation[Person::players[k]->animTarget].attack == normalattack)) {
+ if ( (Animation::animations[Person::players[i]->animTarget].attack == neutral ||
+ Animation::animations[Person::players[i]->animTarget].attack == normalattack) &&
+ (Animation::animations[Person::players[k]->animTarget].attack == neutral ||
+ Animation::animations[Person::players[k]->animTarget].attack == normalattack)) {
//If bumped
if (Person::players[i]->skeleton.oldfree == 0 && Person::players[k]->skeleton.oldfree == 0) {
if (distsq(&Person::players[k]->coords, &Person::players[i]->coords) < .5 * sq((Person::players[i]->scale + Person::players[k]->scale) * 2.5)) {
distsq(&Person::players[i]->coords, &Person::players[0]->coords) < 400 &&
Person::players[i]->occluded < 25) {
if (distsq(&Person::players[i]->coords, &Person::players[0]->coords) < 12 &&
- animation[Person::players[0]->animTarget].height != lowheight &&
+ Animation::animations[Person::players[0]->animTarget].height != lowheight &&
!editorenabled &&
(Person::players[0]->coords.y < Person::players[i]->coords.y + 5 || Person::players[0]->onterrain))
Person::players[i]->aitype = attacktypecutoff;
if (distsq(&Person::players[i]->coords, &Person::players[0]->coords) < 30 &&
- animation[Person::players[0]->animTarget].height == highheight &&
+ Animation::animations[Person::players[0]->animTarget].height == highheight &&
!editorenabled)
Person::players[i]->aitype = attacktypecutoff;
Person::players[i]->losupdatedelay = .2;
for (unsigned j = 0; j < Person::players.size(); j++)
if (j == 0 || Person::players[j]->skeleton.free || Person::players[j]->aitype != passivetype)
- if (abs(Random() % 2) || animation[Person::players[j]->animTarget].height != lowheight || j != 0)
+ if (abs(Random() % 2) || Animation::animations[Person::players[j]->animTarget].height != lowheight || j != 0)
if (distsq(&Person::players[i]->coords, &Person::players[j]->coords) < 400)
if (normaldotproduct(Person::players[i]->facing, Person::players[j]->coords - Person::players[i]->coords) > 0)
if (Person::players[j]->coords.y < Person::players[i]->coords.y + 5 || Person::players[j]->onterrain)
distsq(&Person::players[i]->coords, &Person::players[0]->coords) < 400 &&
Person::players[i]->occluded < 25) {
if (distsq(&Person::players[i]->coords, &Person::players[0]->coords) < 12 &&
- animation[Person::players[0]->animTarget].height != lowheight && !editorenabled)
+ Animation::animations[Person::players[0]->animTarget].height != lowheight && !editorenabled)
Person::players[i]->aitype = attacktypecutoff;
if (distsq(&Person::players[i]->coords, &Person::players[0]->coords) < 30 &&
- animation[Person::players[0]->animTarget].height == highheight && !editorenabled)
+ Animation::animations[Person::players[0]->animTarget].height == highheight && !editorenabled)
Person::players[i]->aitype = attacktypecutoff;
//wolf smell
Person::players[i]->losupdatedelay = .2;
for (unsigned j = 0; j < Person::players.size(); j++) {
if (j == 0 || Person::players[j]->skeleton.free || Person::players[j]->aitype != passivetype) {
- if (abs(Random() % 2) || animation[Person::players[j]->animTarget].height != lowheight || j != 0)
+ if (abs(Random() % 2) || Animation::animations[Person::players[j]->animTarget].height != lowheight || j != 0)
if (distsq(&Person::players[i]->coords, &Person::players[j]->coords) < 400)
if (normaldotproduct(Person::players[i]->facing, Person::players[j]->coords - Person::players[i]->coords) > 0)
if ((-1 == checkcollide(
(Person::players[j]->animTarget == hanganim &&
normaldotproduct(Person::players[j]->facing, Person::players[i]->coords - Person::players[j]->coords) < 0)) {
Person::players[i]->lastseentime -= .2;
- if (j == 0 && animation[Person::players[j]->animTarget].height == lowheight)
+ if (j == 0 && Animation::animations[Person::players[j]->animTarget].height == lowheight)
Person::players[i]->lastseentime -= .4;
else
Person::players[i]->lastseentime -= .6;
Person::players[i]->occluded < 2 &&
((tutoriallevel != 1 || cananger) && hostile)) {
Person::players[i]->losupdatedelay = .2;
- if (distsq(&Person::players[i]->coords, &Person::players[0]->coords) < 4 && animation[Person::players[i]->animTarget].height != lowheight) {
+ if (distsq(&Person::players[i]->coords, &Person::players[0]->coords) < 4 && Animation::animations[Person::players[i]->animTarget].height != lowheight) {
Person::players[i]->aitype = attacktypecutoff;
Person::players[i]->lastseentime = 1;
}
- if (abs(Random() % 2) || animation[Person::players[i]->animTarget].height != lowheight)
+ if (abs(Random() % 2) || Animation::animations[Person::players[i]->animTarget].height != lowheight)
//TODO: factor out canSeePlayer()
if (distsq(&Person::players[i]->coords, &Person::players[0]->coords) < 400)
if (normaldotproduct(Person::players[i]->facing, Person::players[0]->coords - Person::players[i]->coords) > 0)
}
//dodge/reverse walljump kicks
if (Person::players[i]->damage < Person::players[i]->damagetolerance / 2)
- if (animation[Person::players[i]->animTarget].height != highheight)
+ if (Animation::animations[Person::players[i]->animTarget].height != highheight)
if (Person::players[i]->damage < Person::players[i]->damagetolerance * .5 &&
((Person::players[0]->animTarget == walljumprightkickanim ||
Person::players[0]->animTarget == walljumpleftkickanim) &&
}
//lose sight of player in the air (?)
if (Person::players[0]->coords.y > Person::players[i]->coords.y + 5 &&
- animation[Person::players[0]->animTarget].height != highheight &&
+ Animation::animations[Person::players[0]->animTarget].height != highheight &&
!Person::players[0]->onterrain) {
Person::players[i]->aitype = pathfindtype;
Person::players[i]->finalfinaltarget = Person::players[i]->waypoints[Person::players[i]->waypoint];
}
//it's time to think (?)
if (Person::players[i]->aiupdatedelay < 0 &&
- !animation[Person::players[i]->animTarget].attack &&
+ !Animation::animations[Person::players[i]->animTarget].attack &&
Person::players[i]->animTarget != staggerbackhighanim &&
Person::players[i]->animTarget != staggerbackhardanim &&
Person::players[i]->animTarget != backhandspringanim &&
Person::players[i]->lastseentime = 1;
}
}
- if (animation[Person::players[0]->animTarget].height == highheight &&
+ if (Animation::animations[Person::players[0]->animTarget].height == highheight &&
(Person::players[i]->aitype == attacktypecutoff ||
Person::players[i]->aitype == searchtype))
if (Person::players[0]->coords.y > terrain.getHeight(Person::players[0]->coords.x, Person::players[0]->coords.z) + 10) {
talkdelay = 1;
talkdelay -= multiplier;
- if (talkdelay <= 0 && !Dialog::inDialog() && animation[Person::players[0]->animTarget].height != highheight) {
+ if (talkdelay <= 0 && !Dialog::inDialog() && Animation::animations[Person::players[0]->animTarget].height != highheight) {
for (int i = 0; i < Dialog::dialogs.size(); i++) {
Dialog::dialogs[i].tick(i);
}
oldtargetyaw = Person::players[i]->targetyaw;
if (i == 0 && !Dialog::inDialog()) {
//TODO: refactor repetitive code
- if (!animation[Person::players[0]->animTarget].attack &&
+ if (!Animation::animations[Person::players[0]->animTarget].attack &&
Person::players[0]->animTarget != staggerbackhighanim &&
Person::players[0]->animTarget != staggerbackhardanim &&
Person::players[0]->animTarget != crouchremoveknifeanim &&
Person::players[i]->targetheadpitch = pitch;
}
if (i != 0 && Person::players[i]->aitype == playercontrolled && !Dialog::inDialog()) {
- if (!animation[Person::players[i]->animTarget].attack &&
+ if (!Animation::animations[Person::players[i]->animTarget].attack &&
Person::players[i]->animTarget != staggerbackhighanim &&
Person::players[i]->animTarget != staggerbackhardanim &&
Person::players[i]->animTarget != crouchremoveknifeanim &&
doAI(i);
- if (animation[Person::players[i]->animTarget].attack == reversed) {
+ if (Animation::animations[Person::players[i]->animTarget].attack == reversed) {
//Person::players[i]->targetyaw=Person::players[i]->yaw;
Person::players[i]->forwardkeydown = 0;
Person::players[i]->leftkeydown = 0;
Person::players[i]->aitype == attacktypecutoff &&
!Person::players[i]->dead &&
!Person::players[i]->skeleton.free &&
- animation[Person::players[i]->animTarget].attack == neutral)
+ Animation::animations[Person::players[i]->animTarget].attack == neutral)
numresponded = 1;
if (!Person::players[i]->throwkeydown)
}
movekey = 0;
//Do controls
- if (!animation[Person::players[i]->animTarget].attack &&
+ if (!Animation::animations[Person::players[i]->animTarget].attack &&
Person::players[i]->animTarget != staggerbackhighanim &&
Person::players[i]->animTarget != staggerbackhardanim &&
Person::players[i]->animTarget != backhandspringanim &&
viewerfacing = facing;
if (!cameramode) {
- if ((animation[Person::players[0]->animTarget].attack != 3 && animation[Person::players[0]->animCurrent].attack != 3) || Person::players[0]->skeleton.free)
+ if ((Animation::animations[Person::players[0]->animTarget].attack != 3 && Animation::animations[Person::players[0]->animCurrent].attack != 3) || Person::players[0]->skeleton.free)
target = Person::players[0]->coords + Person::players[0]->currentoffset * (1 - Person::players[0]->target) * Person::players[0]->scale + Person::players[0]->targetoffset * Person::players[0]->target * Person::players[0]->scale - Person::players[0]->facing * .05;
else
target = Person::players[0]->oldcoords + Person::players[0]->currentoffset * (1 - Person::players[0]->target) * Person::players[0]->scale + Person::players[0]->targetoffset * Person::players[0]->target * Person::players[0]->scale - Person::players[0]->facing * .05;