}
}
}
+
+bool Person::catchKnife()
+{
+ return
+ ((PersonType::types[creature].knifeCatchingType == 0) && (Random() % 2 != 0) && (weaponactive == -1) && (aitype == attacktypecutoff)) ||
+ ((PersonType::types[creature].knifeCatchingType == 1) && (Random() % 3 != 0) && (weaponactive == -1) && (isIdle() || isRun() || animTarget == walkanim));
+}
void addClothes();
void doAI();
+
+ bool catchKnife();
};
const int maxplayers = 10;
types[wolftype].hasClaws = true;
types[wolftype].clothes = false;
types[wolftype].maxRunSpeed = 75;
+ types[wolftype].knifeCatchingType = 1;
/* Rabbit */
types[rabbittype].proportions[0] = 1.2;
types[rabbittype].hasClaws = false;
types[rabbittype].clothes = true;
types[rabbittype].maxRunSpeed = 55;
+ types[rabbittype].knifeCatchingType = 0;
}
bool hasClaws;
bool clothes;
unsigned int maxRunSpeed;
+ unsigned int knifeCatchingType;
GLubyte bloodText[512 * 512 * 3] = { 0 };
distsq(&position, &Person::players[j]->coords) < 4 && Person::players[j]->weaponstuck == -1 &&
!Person::players[j]->skeleton.free && (int(j) != oldowner)) {
if ((Person::players[j]->aitype != attacktypecutoff || abs(Random() % 6) == 0 || (Person::players[j]->animTarget != backhandspringanim && Person::players[j]->animTarget != rollanim && Person::players[j]->animTarget != flipanim && Random() % 2 == 0)) && !missed) {
- if ((Person::players[j]->creature == wolftype && Random() % 3 != 0 && Person::players[j]->weaponactive == -1 && (Person::players[j]->isIdle() || Person::players[j]->isRun() || Person::players[j]->animTarget == walkanim)) ||
- (Person::players[j]->creature == rabbittype && Random() % 2 == 0 && Person::players[j]->aitype == attacktypecutoff && Person::players[j]->weaponactive == -1)) {
+ if (Person::players[j]->catchKnife()) {
emit_sound_at(knifedrawsound, Person::players[j]->coords, 128.);
Person::players[j]->animTarget = removeknifeanim;