funpackf(tfile, "Bi Bf Bf Bf Bf", &Hotspot::hotspots[i].type, &Hotspot::hotspots[i].size, &Hotspot::hotspots[i].position.x, &Hotspot::hotspots[i].position.y, &Hotspot::hotspots[i].position.z);
funpackf(tfile, "Bi", &templength);
if (templength)
funpackf(tfile, "Bi Bf Bf Bf Bf", &Hotspot::hotspots[i].type, &Hotspot::hotspots[i].size, &Hotspot::hotspots[i].position.x, &Hotspot::hotspots[i].position.y, &Hotspot::hotspots[i].position.z);
funpackf(tfile, "Bi", &templength);
if (templength)
if (Random() % 2 == 0) {
if (!Person::players[1]->skeleton.free)
temp2 = (Person::players[1]->coords - Person::players[1]->oldcoords) / multiplier / 2; //velocity/2;
if (Random() % 2 == 0) {
if (!Person::players[1]->skeleton.free)
temp2 = (Person::players[1]->coords - Person::players[1]->oldcoords) / multiplier / 2; //velocity/2;
if (Random() % 2 == 0) {
if (!Person::players[1]->skeleton.free)
temp2 = (Person::players[1]->coords - Person::players[1]->oldcoords) / multiplier / 2; //velocity/2;
if (Random() % 2 == 0) {
if (!Person::players[1]->skeleton.free)
temp2 = (Person::players[1]->coords - Person::players[1]->oldcoords) / multiplier / 2; //velocity/2;
bodyprop = Person::players[closest]->proportionbody.x / 1.1;
armprop = Person::players[closest]->proportionarms.x / 1.1;
legprop = Person::players[closest]->proportionlegs.x / 1.1;
bodyprop = Person::players[closest]->proportionbody.x / 1.1;
armprop = Person::players[closest]->proportionarms.x / 1.1;
legprop = Person::players[closest]->proportionlegs.x / 1.1;
headprop = Person::players[closest]->proportionhead.x / 1.2;
bodyprop = Person::players[closest]->proportionbody.x / 1.05;
armprop = Person::players[closest]->proportionarms.x / 1.00;
headprop = Person::players[closest]->proportionhead.x / 1.2;
bodyprop = Person::players[closest]->proportionbody.x / 1.05;
armprop = Person::players[closest]->proportionarms.x / 1.00;
XYZ headspurtdirection;
//int i = Person::players[closest]->skeleton.jointlabels[head];
Joint& headjoint = Person::players[closest]->joint(head);
XYZ headspurtdirection;
//int i = Person::players[closest]->skeleton.jointlabels[head];
Joint& headjoint = Person::players[closest]->joint(head);
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
emit_sound_at(splattersound, blah);
emit_sound_at(breaksound2, blah);
emit_sound_at(splattersound, blah);
emit_sound_at(breaksound2, blah);
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
Sprite::MakeSprite(cloudsprite, flatfacing2, flatvelocity2 * 0, .6, 0, 0, 1, .5);
}
Sprite::MakeSprite(cloudsprite, flatfacing2, flatvelocity2 * 0, .6, 0, 0, 1, .5);
}
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
Sprite::MakeSprite(bloodsprite, flatfacing2, flatvelocity2, 1, 1, 1, .4, 1);
}
Sprite::MakeSprite(bloodsprite, flatfacing2, flatvelocity2, 1, 1, 1, .4, 1);
}
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
Sprite::MakeSprite(bloodsprite, flatfacing2, flatvelocity2 * 2, 1, 1, 1, .4, 1);
}
Sprite::MakeSprite(bloodsprite, flatfacing2, flatvelocity2 * 2, 1, 1, 1, .4, 1);
}
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
if (!Person::players[closest]->skeleton.free)
flatvelocity2 = Person::players[closest]->velocity;
if (Person::players[closest]->skeleton.free)
Person::players[j]->skeleton.free = 1;
Person::players[j]->skeleton.longdead = 0;
Person::players[j]->RagDoll(0);
Person::players[j]->skeleton.free = 1;
Person::players[j]->skeleton.longdead = 0;
Person::players[j]->RagDoll(0);
temppos = Person::players[j]->skeleton.joints[i].position + Person::players[j]->coords;
if (distsq(&temppos, &Person::players[closest]->coords) < 25) {
flatvelocity2 = temppos - Person::players[closest]->coords;
temppos = Person::players[j]->skeleton.joints[i].position + Person::players[j]->coords;
if (distsq(&temppos, &Person::players[closest]->coords) < 25) {
flatvelocity2 = temppos - Person::players[closest]->coords;
bodyprop = Person::players[0]->proportionbody.x / 1.1;
armprop = Person::players[0]->proportionarms.x / 1.1;
legprop = Person::players[0]->proportionlegs.x / 1.1;
bodyprop = Person::players[0]->proportionbody.x / 1.1;
armprop = Person::players[0]->proportionarms.x / 1.1;
legprop = Person::players[0]->proportionlegs.x / 1.1;
headprop = Person::players[0]->proportionhead.x / 1.2;
bodyprop = Person::players[0]->proportionbody.x / 1.05;
armprop = Person::players[0]->proportionarms.x / 1.00;
headprop = Person::players[0]->proportionhead.x / 1.2;
bodyprop = Person::players[0]->proportionbody.x / 1.05;
armprop = Person::players[0]->proportionarms.x / 1.00;
if (closest == -1 || distsq(&Person::players[i]->finalfinaltarget, &pathpoint[j]) < closestdistance) {
closestdistance = distsq(&Person::players[i]->finalfinaltarget, &pathpoint[j]);
closest = j;
Person::players[i]->finaltarget = pathpoint[j];
}
if (closest == -1 || distsq(&Person::players[i]->finalfinaltarget, &pathpoint[j]) < closestdistance) {
closestdistance = distsq(&Person::players[i]->finalfinaltarget, &pathpoint[j]);
closest = j;
Person::players[i]->finaltarget = pathpoint[j];
}
- DistancePointLine(&Person::players[i]->finalfinaltarget, &pathpoint[j], &pathpoint[pathpointconnect[j][k]], &tempdist, &colpoint );
+ DistancePointLine(&Person::players[i]->finalfinaltarget, &pathpoint[j], &pathpoint[pathpointconnect[j][k]], &tempdist, &colpoint);
if (sq(tempdist) < closestdistance)
if (findDistance(&colpoint, &pathpoint[j]) + findDistance(&colpoint, &pathpoint[pathpointconnect[j][k]]) <
findDistance(&pathpoint[j], &pathpoint[pathpointconnect[j][k]]) + .1) {
if (sq(tempdist) < closestdistance)
if (findDistance(&colpoint, &pathpoint[j]) + findDistance(&colpoint, &pathpoint[pathpointconnect[j][k]]) <
findDistance(&pathpoint[j], &pathpoint[pathpointconnect[j][k]]) + .1) {
while (hotspotvisual[i] < 0) {
hotspotsprite = 0;
hotspotsprite.x = float(abs(Random() % 100000)) / 100000 * Hotspot::hotspots[i].size;
while (hotspotvisual[i] < 0) {
hotspotsprite = 0;
hotspotsprite.x = float(abs(Random() % 100000)) / 100000 * Hotspot::hotspots[i].size;
if (Hotspot::hotspots[i].type <= 10 && Hotspot::hotspots[i].type > 0) {
Hotspot::hotspots[i].position = Person::players[Hotspot::hotspots[i].type]->coords;
}
if (Hotspot::hotspots[i].type <= 10 && Hotspot::hotspots[i].type > 0) {
Hotspot::hotspots[i].position = Person::players[Hotspot::hotspots[i].type]->coords;
}
if (Input::isKeyDown(SDL_SCANCODE_KP_0)) whichend = 0;
Dialog::currentScene().participantfacing[whichend] = facing;
}
if (Input::isKeyDown(SDL_SCANCODE_KP_0)) whichend = 0;
Dialog::currentScene().participantfacing[whichend] = facing;
}
if (Dialog::currentScene().sound != 0) {
playdialoguescenesound();
if (Dialog::currentScene().sound == -5) {
if (Dialog::currentScene().sound != 0) {
playdialoguescenesound();
if (Dialog::currentScene().sound == -5) {
Person::players[i]->victim->skeleton.joints[l].velchange = 0;
Person::players[i]->victim->skeleton.joints[l].locked = 0;
}
Person::players[i]->victim->skeleton.joints[l].velchange = 0;
Person::players[i]->victim->skeleton.joints[l].locked = 0;
}
if (distsq(&temp, &Person::players[1]->coords) >= distsq(&temp, &temp2) - 1 || distsq(&temp3, &Person::players[1]->coords) < 4) {
emit_sound_at(fireendsound, Person::players[1]->coords);
if (distsq(&temp, &Person::players[1]->coords) >= distsq(&temp, &temp2) - 1 || distsq(&temp3, &Person::players[1]->coords) < 4) {
emit_sound_at(fireendsound, Person::players[1]->coords);
if (Random() % 2 == 0) {
if (!Person::players[1]->skeleton.free)
temp2 = (Person::players[1]->coords - Person::players[1]->oldcoords) / multiplier / 2; //velocity/2;
if (Random() % 2 == 0) {
if (!Person::players[1]->skeleton.free)
temp2 = (Person::players[1]->coords - Person::players[1]->oldcoords) / multiplier / 2; //velocity/2;
if (Hotspot::hotspots[i].type > 10 && Hotspot::hotspots[i].type < 20) {
if (Person::players[Hotspot::hotspots[i].type - 10]->dead == 0)
Hotspot::killhotspot = 0;
if (Hotspot::hotspots[i].type > 10 && Hotspot::hotspots[i].type < 20) {
if (Person::players[Hotspot::hotspots[i].type - 10]->dead == 0)
Hotspot::killhotspot = 0;
- for (int i = 0; i < Hotspot::hotspots.size(); i++)
- if (Hotspot::hotspots[i].type == -1)
- if (distsq(&Person::players[0]->coords, &Hotspot::hotspots[i].position) < Hotspot::hotspots[i].size)
+ for (unsigned i = 0; i < Hotspot::hotspots.size(); i++) {
+ if (Hotspot::hotspots[i].type == -1) {
+ if (distsq(&Person::players[0]->coords, &Hotspot::hotspots[i].position) < Hotspot::hotspots[i].size) {
- for (unsigned i = 1; i < Person::players.size(); i++)
- if (!Person::players[i]->dead && Person::players[i]->aitype == attacktypecutoff && Person::players[i]->surprised <= 0)
+ for (unsigned i = 1; i < Person::players.size(); i++) {
+ if (!Person::players[i]->dead && Person::players[i]->aitype == attacktypecutoff && Person::players[i]->surprised <= 0) {
if (changedelay <= 0 && !loading && !editorenabled && gameon && !tutoriallevel && changedelay != -999 && !won) {
if (Person::players[0]->dead && changedelay <= 0) {
if (changedelay <= 0 && !loading && !editorenabled && gameon && !tutoriallevel && changedelay != -999 && !won) {
if (Person::players[0]->dead && changedelay <= 0) {
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;
target.y += .1;
if (Person::players[0]->skeleton.free) {
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;
target.y += .1;
if (Person::players[0]->skeleton.free) {
if (Person::players[0]->skeleton.joints[i].position.y * Person::players[0]->scale + Person::players[0]->coords.y > target.y)
target.y = Person::players[0]->skeleton.joints[i].position.y * Person::players[0]->scale + Person::players[0]->coords.y;
}
if (Person::players[0]->skeleton.joints[i].position.y * Person::players[0]->scale + Person::players[0]->coords.y > target.y)
target.y = Person::players[0]->skeleton.joints[i].position.y * Person::players[0]->scale + Person::players[0]->coords.y;
}