#include "Level/Awards.hpp"
#include "Level/Dialog.hpp"
#include "Utils/Folders.hpp"
+#include "Tutorial.hpp"
extern float multiplier;
extern Terrain terrain;
extern bool winfreeze;
extern bool showpoints;
extern bool immediate;
-extern int tutoriallevel;
extern float smoketex;
-extern int tutorialstage;
extern bool reversaltrain;
extern bool canattack;
extern bool cananger;
victim->spurt = 1;
DoBlood(.2, 250);
- if (tutoriallevel != 1)
+ if (!Tutorial::active)
emit_sound_at(heavyimpactsound, victim->coords);
victim->RagDoll(0);
for (unsigned i = 0; i < victim->skeleton.joints.size(); i++) {
// FIXME: should abstract out inputs
static int bleedxint, bleedyint;
static XYZ bloodvel;
- if (bloodtoggle && tutoriallevel != 1) {
+ if (bloodtoggle && !Tutorial::active) {
if (bleeding <= 0 && spurt) {
spurt = 0;
for (int i = 0; i < 3; i++) {
if (howmuch && id == 0)
blooddimamount = 1;
- if (tutoriallevel != 1 || id == 0)
+ if (!Tutorial::active || id == 0)
if (aitype != playercontrolled && howmuch > 0) {
// play pain sounds
int whichsound = -1;
Game::flash(.5, 0);
}
- if (bloodtoggle && decals && tutoriallevel != 1) {
+ if (bloodtoggle && decals && !Tutorial::active) {
if (bleeding <= 0 && spurt) {
spurt = 0;
for (int i = 0; i < 3; i++) {
deathbleeding += bleeding;
bloodloss += bleeding * 3;
- if (tutoriallevel != 1 && aitype != playercontrolled && bloodloss > damagetolerance * 2 / 3 && bloodloss < damagetolerance && creature == rabbittype) {
+ if (!Tutorial::active && aitype != playercontrolled && bloodloss > damagetolerance * 2 / 3 && bloodloss < damagetolerance && creature == rabbittype) {
if (abs(Random() % 2) == 0) {
aitype = gethelptype;
lastseentime = 12;
float coordsx, coordsy;
float total;
- if (bloodtoggle && decals && tutoriallevel != 1) {
+ if (bloodtoggle && decals && !Tutorial::active) {
where -= coords;
if (!skeleton.free)
where = DoRotation(where, 0, -yaw, 0);
deathbleeding += bleeding;
bloodloss += bleeding * 3;
- if (tutoriallevel != 1 && aitype != playercontrolled && bloodloss > damagetolerance * 2 / 3 && bloodloss < damagetolerance && creature == rabbittype) {
+ if (!Tutorial::active && aitype != playercontrolled && bloodloss > damagetolerance * 2 / 3 && bloodloss < damagetolerance && creature == rabbittype) {
if (abs(Random() % 2) == 0) {
aitype = gethelptype;
lastseentime = 12;
|| staggerdelay <= 0)
&& victim->animTarget != jumpupanim
&& victim->animTarget != jumpdownanim
- && (tutoriallevel != 1 || cananger)
+ && (!Tutorial::active || cananger)
&& hostile))
return;
void Person::DoDamage(float howmuch)
{
// subtract health (temporary?)
- if (tutoriallevel != 1)
+ if (!Tutorial::active)
damage += howmuch / power;
// stats?
if (id != 0)
if (id == 0 && (bonus == solidhit || bonus == twoxcombo || bonus == threexcombo || bonus == fourxcombo || bonus == megacombo))
bonus = 0;
// subtract health
- if (tutoriallevel != 1)
+ if (!Tutorial::active)
permanentdamage += howmuch / 2 / power;
- if (tutoriallevel != 1)
+ if (!Tutorial::active)
superpermanentdamage += howmuch / 4 / power;
// visual effects
if (permanentdamage > damagetolerance / 2 && permanentdamage - howmuch < damagetolerance / 2 && Random() % 2)
blackout = 1;
// cancel attack?
- if (aitype == passivetype && damage < damagetolerance && ((tutoriallevel != 1 || cananger) && hostile))
+ if (aitype == passivetype && damage < damagetolerance && ((!Tutorial::active || cananger) && hostile))
aitype = attacktypecutoff;
- if (tutoriallevel != 1 && aitype != playercontrolled && damage < damagetolerance && damage > damagetolerance * 2 / 3 && creature == rabbittype) {
+ if (!Tutorial::active && aitype != playercontrolled && damage < damagetolerance && damage > damagetolerance * 2 / 3 && creature == rabbittype) {
if (abs(Random() % 2) == 0) {
aitype = gethelptype;
lastseentime = 12;
}
// play sounds
- if (tutoriallevel != 1 || id == 0)
+ if (!Tutorial::active || id == 0)
if (speechdelay <= 0 && !dead && aitype != playercontrolled) {
int whichsound = -1;
drawtogglekeydown = 1;
}
//Footstep sounds
- if (tutoriallevel != 1 || id == 0)
+ if (!Tutorial::active || id == 0)
if ((targetFrame().label && (targetFrame().label < 5 || targetFrame().label == 8))) {
int whichsound = -1;
if (onterrain) {
} else if (targetFrame().label == 4) {
whichsound = knifeswishsound;
}
- if (targetFrame().label == 8 && tutoriallevel != 1) {
+ if (targetFrame().label == 8 && !Tutorial::active) {
whichsound = landsound2;
}
}
//Combat sounds
- if (tutoriallevel != 1 || id == 0)
+ if (!Tutorial::active || id == 0)
if (speechdelay <= 0)
if (animTarget != crouchstabanim && animTarget != swordgroundstabanim && animTarget != staffgroundsmashanim)
if ((targetFrame().label && (targetFrame().label < 5 || targetFrame().label == 8))) {
if (creature == wolftype)
DoBloodBig(0, 250);
}
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords, 128.);
}
if (creature == wolftype) {
camerashake += .4;
victim->spurt = 1;
DoBlood(.2, 250);
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords, 160.);
}
if (creature == wolftype) {
camerashake += .4;
victim->spurt = 1;
DoBlood(.2, 250);
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords, 160.);
}
if (creature == wolftype) {
escapednum = 0;
if (id == 0)
camerashake += .4;
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, coords, 128.);
}
XYZ relative;
escapednum = 0;
if (id == 0)
camerashake += .4;
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(thudsound, coords);
}
victim->spurt = 1;
DoBlood(.2, 235);
}
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords, 128);
}
if (id == 0)
camerashake += .4;
if (victim->damage <= victim->damagetolerance - 60 && normaldotproduct(victim->facing, victim->coords - coords) < (scale * 5) * (scale * 5) * 0 && Animation::animations[victim->animTarget].height != lowheight) {
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(thudsound, victim->coords);
}
} else if (victim->damage <= victim->damagetolerance - 60 && normaldotproduct(victim->facing, victim->coords - coords) < (scale * 5) * (scale * 5) * 0 && Animation::animations[victim->animTarget].height == lowheight) {
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(whooshhitsound, victim->coords);
}
} else {
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords);
}
}
if (hasvictim)
if (distsq(&coords, &victim->coords) < (scale * 5) * (scale * 5) * 4.5 &&/*Animation::animations[victim->animTarget].height!=lowheight&&*/victim->animTarget != dodgebackanim && victim->animTarget != rollanim) {
escapednum = 0;
- if (tutoriallevel != 1)
+ if (!Tutorial::active)
victim->DoBloodBig(1.5 / victim->armorhigh, 225);
award_bonus(id, Slicebonus);
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(knifeslicesound, victim->coords);
}
//victim->jointVel(abdomen)+=relative*damagemult*200;
if (aitype != playercontrolled)
weaponmissdelay = .6;
- if (tutoriallevel != 1)
+ if (!Tutorial::active)
if (bloodtoggle && !weapons[weaponids[weaponactive]].bloody)
weapons[weaponids[weaponactive]].bloody = 1;
- if (tutoriallevel != 1)
+ if (!Tutorial::active)
weapons[weaponids[weaponactive]].blooddrip += 3;
XYZ footvel, footpoint;
} else {
footpoint = DoRotation((victim->jointPos(abdomen) + victim->jointPos(neck)) / 2, 0, victim->yaw, 0) * victim->scale + victim->coords;
}
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
if (bloodtoggle)
Sprite::MakeSprite(cloudimpactsprite, footpoint, footvel, 1, 0, 0, .6, .3);
footvel = DoRotation(facing, 0, 90, 0) * .8;
Sprite::MakeSprite(bloodflamesprite, footpoint, footvel * 5, 1, 1, 1, .2, 1);
Sprite::MakeSprite(bloodflamesprite, footpoint, footvel * 2, 1, 1, 1, .2, 1);
}
- if (tutoriallevel == 1) {
+ if (Tutorial::active) {
Sprite::MakeSprite(cloudimpactsprite, footpoint, footvel, 1, 1, 1, .6, .3);
}
victim->DoDamage(damagemult * 0);
if (victim->weaponactive == -1 || normaldotproduct(victim->facing, victim->coords - coords) > 0 || (Random() % 2 == 0)) {
award_bonus(id, Slashbonus);
escapednum = 0;
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
if (normaldotproduct(victim->facing, victim->coords - coords) < 0)
victim->DoBloodBig(2 / victim->armorhigh, 190);
else
emit_sound_at(swordslicesound, victim->coords);
}
//victim->jointVel(abdomen)+=relative*damagemult*200;
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
victim->frameTarget = 0;
victim->animTarget = staggerbackhardanim;
victim->targetyaw = targetyaw + 180;
victim->target = 0;
}
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
if (bloodtoggle && !weapons[weaponids[weaponactive]].bloody)
weapons[weaponids[weaponactive]].bloody = 1;
weapons[weaponids[weaponactive]].blooddrip += 3;
if (animTarget == staffhitanim && Animation::animations[animTarget].frames[frameCurrent].label == 5 && victim->animTarget != rollanim) {
if (distsq(&coords, &victim->coords) < (scale * 5) * (scale * 5) * 6.5 && victim->animTarget != dodgebackanim && victim->animTarget != sweepanim) {
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
weapons[weaponids[0]].damage += .4 + float(abs(Random() % 100) - 50) / 250;
escapednum = 0;
if (id == 0)
victim->jointVel(head) += relative * damagemult * 230;
victim->jointVel(neck) += relative * damagemult * 230;
victim->Puff(head);
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
victim->DoDamage(damagemult * 120 / victim->protectionhigh);
award_bonus(id, solidhit, 30);
if (animTarget == staffspinhitanim && Animation::animations[animTarget].frames[frameCurrent].label == 5 && victim->animTarget != rollanim) {
if (distsq(&coords, &victim->coords) < (scale * 5) * (scale * 5) * 6.5 && victim->animTarget != dodgebackanim && victim->animTarget != sweepanim) {
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
weapons[weaponids[0]].damage += .6 + float(abs(Random() % 100) - 50) / 250;
escapednum = 0;
if (id == 0)
victim->jointVel(head) += relative * damagemult * 220;
victim->jointVel(neck) += relative * damagemult * 220;
victim->Puff(head);
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
victim->DoDamage(damagemult * 350 / victim->protectionhead);
award_bonus(id, solidhit, 60);
if (animTarget == staffgroundsmashanim && Animation::animations[animTarget].frames[frameCurrent].label == 5) {
if (distsq(&coords, &victim->coords) < (scale * 5) * (scale * 5) * 6.5) {
escapednum = 0;
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
if (!victim->dead)
weapons[weaponids[0]].damage += .4 + float(abs(Random() % 100) - 50) / 500;
if (id == 0)
}
}
victim->Puff(abdomen);
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
victim->DoDamage(damagemult * 100 / victim->protectionhigh);
if (!victim->dead) {
victim->skeleton.joints[i].velocity += relative * damagemult * 40;
}
victim->jointVel(head) += relative * damagemult * 200;
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords, 128.);
}
victim->Puff(head);
victim->animTarget = staggerbackhighanim;
victim->targetyaw = targetyaw + 180;
victim->target = 0;
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(landsound2, victim->coords, 128.);
}
victim->Puff(abdomen);
escapednum = 0;
if (id == 0)
camerashake += .2;
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(landsound2, victim->coords, 128.);
}
XYZ relative;
victim->animTarget = staggerbackhighanim;
victim->targetyaw = targetyaw + 180;
victim->target = 0;
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(landsound2, victim->coords, 128.);
}
victim->Puff(abdomen);
victim->spurt = 1;
DoBlood(.2, 230);
}
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords, 128.);
}
if (creature == wolftype) {
award_bonus(id, staffreversebonus);
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords, 128.);
}
victim->RagDoll(0);
victim->spurt = 1;
DoBlood(.2, 230);
}
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords, 128.);
}
victim->RagDoll(0);
DoBlood(.2, 240);
}
if (weaponactive == -1) {
- if (tutoriallevel != 1) {
+ if (!Tutorial::active) {
emit_sound_at(heavyimpactsound, victim->coords, 128.);
}
}
Sprite::MakeSprite(flamesprite, flatfacing, flatvelocity, 1, 1, 1, .6 + (float)abs(Random() % 100) / 200 - .25, 1);
}
- while (flamedelay < 0 && !onfire && tutoriallevel == 1 && id != 0) {
+ while (flamedelay < 0 && !onfire && Tutorial::active && id != 0) {
flamedelay += .05;
int howmany = fabs(Random() % (skeleton.joints.size()));
if (skeleton.free) {
if (hasvictim)
if (aitype != passivetype && victim->skeleton.free && !victim->dead)
play = 1;
- if (tutoriallevel == 1 && id != 0)
+ if (Tutorial::active && id != 0)
play = 0;
if (play && aitype != playercontrolled) {
int whichsound = -1;
glEnable(GL_LIGHTING);
glEnable(GL_BLEND);
}
- if (tutoriallevel && id != 0) {
+ if (Tutorial::active && id != 0) {
glColor4f(.7, .7, .7, 0.6);
glDepthMask(0);
glEnable(GL_LIGHTING);
}
if (playerdetail) {
if (!showpoints) {
- if ((tutoriallevel && id != 0))
+ if (Tutorial::active && (id != 0))
skeleton.drawmodel.drawdifftex(Sprite::cloudimpacttexture);
else
skeleton.drawmodel.draw();
}
}
if (!playerdetail) {
- if ((tutoriallevel && id != 0))
+ if (Tutorial::active && (id != 0))
skeleton.drawmodellow.drawdifftex(Sprite::cloudimpacttexture);
else
skeleton.drawmodellow.drawdifftex(skeleton.drawmodel.textureptr);
}
if (!(Animation::animations[animTarget].attack == normalattack || Animation::animations[animTarget].attack == reversed))
- if (tutoriallevel && id != 0) {
+ if (Tutorial::active && id != 0) {
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glEnable(GL_TEXTURE_2D);
glTranslatef(smoketex * .6, 0, 0);
if (playerdetail) {
if (!showpoints) {
- if ((tutoriallevel && id != 0))
+ if (Tutorial::active && (id != 0))
skeleton.drawmodel.drawdifftex(Sprite::cloudimpacttexture);
else
skeleton.drawmodel.draw();
}
}
if (!playerdetail) {
- if ((tutoriallevel && id != 0))
+ if (Tutorial::active && (id != 0))
skeleton.drawmodellow.drawdifftex(Sprite::cloudimpacttexture);
else
skeleton.drawmodellow.drawdifftex(skeleton.drawmodel.textureptr);
}
- if (tutoriallevel && id != 0) {
+ if (Tutorial::active && id != 0) {
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glEnable(GL_TEXTURE_2D);