/*
Copyright (C) 2003, 2010 - Wolfire Games
+Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
This file is part of Lugaru.
-Lugaru is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
+This file is part of Lugaru.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+Lugaru is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
-See the GNU General Public License for more details.
+Lugaru is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+along with Lugaru. If not, see <http://www.gnu.org/licenses/>.
*/
/**> HEADER FILES <**/
extern GLubyte bloodText[512 * 512 * 3];
extern int bloodtoggle;
extern Objects objects;
-extern bool osx;
extern bool autoslomo;
extern float camerashake;
extern float woozy;
static XYZ point[3];
static XYZ closestpoint;
static XYZ closestswordpoint;
- static XYZ extramove;
static float tempmult;
if (owner != -1) {
position = colpoint - normalrot * .2;
else if (type == staff)
position = colpoint - normalrot * .2;
- XYZ temppoint1, temppoint2, tempforward;
+ XYZ temppoint1, temppoint2;
float distance;
temppoint1 = 0;
(Person::players[j]->creature == rabbittype && Random() % 2 == 0 && Person::players[j]->aitype == attacktypecutoff && Person::players[j]->weaponactive == -1)) {
emit_sound_at(knifedrawsound, Person::players[j]->coords, 128.);
- Person::players[j]->weaponactive = 0;
Person::players[j]->animTarget = removeknifeanim;
Person::players[j]->frameTarget = 1;
Person::players[j]->target = 1;
- owner = Person::players[j]->id;
- if (Person::players[j]->num_weapons > 0) {
- Person::players[j]->weaponids[Person::players[j]->num_weapons] = Person::players[j]->weaponids[0];
- }
- Person::players[j]->num_weapons++;
- Person::players[j]->weaponids[0] = i;
+ Person::players[j]->takeWeapon(i);
Person::players[j]->aitype = attacktypecutoff;
} else {
tippoint.z = M[14];
glPopMatrix();
position -= tippoint * .15;
- XYZ temppoint1, temppoint2, tempforward;
+ XYZ temppoint1, temppoint2;
rotation3 = 0;
smallrotation = 90;
if (velocity.x != 0 || velocity.z != 0 || velocity.y != 0) {
velocity.y += gravity * multiplier;
- XYZ temppoint1, temppoint2, tempforward;
+ XYZ temppoint1, temppoint2;
float distance;
temppoint1 = 0;
tipvelocity.y += gravity * multiplier;
//Rotation
- XYZ temppoint1, temppoint2, tempforward;
+ XYZ temppoint1, temppoint2;
float distance;
temppoint1 = position;
}
}
+void Weapon::drop(XYZ v, XYZ tv, bool sethitsomething)
+{
+ owner = -1;
+ velocity = v;
+ tipvelocity = tv;
+ missed = 1;
+ if (sethitsomething) {
+ hitsomething = 0;
+ }
+ freetime = 0;
+ firstfree = 1;
+ physics = 1;
+}
+
+void Weapon::thrown(XYZ v, bool sethitsomething)
+{
+ drop(v, v, sethitsomething);
+ missed = 0;
+ physics = 0;
+}
+
int Weapons::Draw()
{
glAlphaFunc(GL_GREATER, 0.9);