Merge branch 'GameLogic' of https://github.com/dean11/Danbias into GameLogic

This commit is contained in:
Linda Andersson 2014-02-27 12:11:03 +01:00
commit 19aa8e5ed4
3 changed files with 10 additions and 15 deletions

View File

@ -44,7 +44,7 @@ void AttatchmentMassDriver::UseAttatchment(const GameLogic::WEAPON_FIRE &usage,
switch (usage)
{
case WEAPON_FIRE::WEAPON_USE_PRIMARY_PRESS:
if(currentEnergy >= 9.0f)
//if(currentEnergy >= 9.0f)
{
currentEnergy -= 9.0f;
ForcePush(usage,dt);
@ -128,11 +128,6 @@ void AttatchmentMassDriver::Update(float dt)
if(currentEnergy < maxEnergy)
{
currentEnergy += rechargeRate;
if(currentEnergy == maxEnergy)
{
int trap = 0;
}
}
}
@ -162,10 +157,10 @@ void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float
Oyster::Math::Float radius = 4;
Oyster::Math::Float3 look = owner->GetLookDir().GetNormalized();
Oyster::Math::Float lenght = 10;
Oyster::Math::Float lenght = 20;
Oyster::Math::Float3 pos = owner->GetRigidBody()->GetState().centerPos;
pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (this->force * 0.6f);
pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (this->force * 0.9f);
Oyster::Collision3D::Cone *hitCone = new Oyster::Collision3D::Cone(lenght,pos,(Oyster::Math::Float4)owner->GetRigidBody()->GetState().quaternion,radius);
@ -201,10 +196,10 @@ void AttatchmentMassDriver::ForcePull(const WEAPON_FIRE &usage, float dt)
//if no object has been picked up then suck objects towards you
Oyster::Math::Float radius = 4;
Oyster::Math::Float3 look = owner->GetLookDir().GetNormalized();
Oyster::Math::Float lenght = 10;
Oyster::Math::Float lenght = 20;
Oyster::Math::Float3 pos = owner->GetRigidBody()->GetState().centerPos;
Oyster::Math::Float4 pullForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (this->force * 0.2);
Oyster::Math::Float4 pullForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (this->force * 0.3f);
Oyster::Collision3D::Cone hitCone(lenght,pos,(Oyster::Math::Float4)owner->GetRigidBody()->GetState().quaternion,radius);
forcePushData args;
@ -218,7 +213,7 @@ void AttatchmentMassDriver::PickUpObject(const WEAPON_FIRE &usage, float dt)
{
//DEBUG:
MessageBeep(MB_ICONINFORMATION);
Oyster::Math::Float3 pos = owner->GetPosition() + owner->GetLookDir().GetNormalized() * 2;
Oyster::Math::Float3 pos = owner->GetPosition() + owner->GetLookDir().GetNormalized() * 1.5f;
//Do ray test first!
//Oyster::Collision3D::Ray r(pos, owner->GetLookDir());
@ -226,7 +221,7 @@ void AttatchmentMassDriver::PickUpObject(const WEAPON_FIRE &usage, float dt)
if(this->hasObject) return;
Oyster::Collision3D::Sphere hitSphere = Oyster::Collision3D::Sphere(pos , 1);
Oyster::Collision3D::Sphere hitSphere = Oyster::Collision3D::Sphere(pos , 0.5);
Oyster::Physics::API::Instance().ApplyEffect(&hitSphere,this,AttemptPickUp);
return;
}

View File

@ -11,7 +11,7 @@ namespace GameLogic
{
const Oyster::Math::Float StandardMaxEnergy = 100.0f;
const Oyster::Math::Float StandardrechargeRate = 0.5f;
const Oyster::Math::Float Standardforce = 1000.0f;
const Oyster::Math::Float Standardforce = 2000.0f;
class AttatchmentMassDriver : public IAttatchment
{

View File

@ -193,7 +193,7 @@ using namespace GameLogic;
Oyster::Math::Float damageDone = 0.0f;
Oyster::Math::Float forceThreashHold = 30.0f; //FIX: balance this
Oyster::Math::Float forceThreashHold = 100.0f; //FIX: balance this
if(impactPower > forceThreashHold) //should only take damage if the force is high enough
{