Removed witnesses and minor changes

actorid
Jeffrey Haines 11 years ago
parent 0c957a3cde
commit 70919ba60a

@ -739,11 +739,12 @@ namespace MWMechanics
{
creatureStats.getAiSequence().stack(AiCombat(player));
creatureStats.setHostile(true);
creatureStats.setAlarmed(true);
}
}
// if I was a witness to a crime
if (creatureStats.getCrimeId() != -1)
if (creatureStats.isAlarmed())
{
if(player.getClass().getNpcStats(player).getBounty() == 0)
{
@ -752,19 +753,23 @@ namespace MWMechanics
if (ptr.getClass().isClass(ptr, "Guard"))
creatureStats.getAiSequence().stopPersue();
creatureStats.getAiSequence().stopCombat();
creatureStats.setCrimeId(-1);
}
else if (creatureStats.isAlarmed())
else if (!creatureStats.isHostile())
{
if (ptr.getClass().isClass(ptr, "Guard") && !creatureStats.isHostile())
if (ptr.getClass().isClass(ptr, "Guard"))
creatureStats.getAiSequence().stack(AiPersue(player.getClass().getId(player)));
else if (!creatureStats.isHostile())
{
else
creatureStats.getAiSequence().stack(AiCombat(player));
creatureStats.setHostile(true);
}
}
}
// if I didn't report a crime was I attacked?
else if (creatureStats.getAttacked() && !creatureStats.isHostile())
{
creatureStats.getAiSequence().stack(AiCombat(player));
creatureStats.setHostile(true);
}
}
}

@ -14,8 +14,8 @@ namespace MWMechanics
CreatureStats::CreatureStats()
: mLevel (0), mDead (false), mDied (false), mFriendlyHits (0),
mTalkedTo (false), mAlarmed (false),
mAttacked (false), mHostile (false), mAssaulted(false),
mAttackingOrSpell(false), mCrimeId(-1),
mAttacked (false), mHostile (false),
mAttackingOrSpell(false),
mIsWerewolf(false),
mFallHeight(0), mRecalcDynamicStats(false), mKnockdown(false), mHitRecovery(false), mBlock(false),
mMovementFlags(0), mDrawState (DrawState_Nothing), mAttackStrength(0.f)
@ -316,26 +316,6 @@ namespace MWMechanics
mHostile = hostile;
}
bool CreatureStats::isAssaulted() const
{
return mAssaulted;
}
void CreatureStats::setAssaulted (bool assaulted)
{
mAssaulted = assaulted;
}
int CreatureStats::getCrimeId() const
{
return mCrimeId;
}
void CreatureStats::setCrimeId (int id)
{
mCrimeId = id;
}
bool CreatureStats::getCreatureTargetted() const
{
std::string target;

@ -40,7 +40,6 @@ namespace MWMechanics
bool mAttacked;
bool mHostile;
bool mAssaulted;
int mCrimeId;
bool mAttackingOrSpell;
bool mKnockdown;
bool mHitRecovery;
@ -188,14 +187,6 @@ namespace MWMechanics
void setHostile (bool hostile);
bool isAssaulted() const;
void setAssaulted (bool assaulted);
int getCrimeId() const;
void setCrimeId (int id);
bool getCreatureTargetted() const;
float getEvasion() const;

@ -839,9 +839,8 @@ namespace MWMechanics
CreatureStats& creatureStats = MWWorld::Class::get(*it).getCreatureStats(*it);
// Was the crime seen or the victim assulted?
if ( ( MWBase::Environment::get().getWorld()->getLOS(ptr, *it) && awarenessCheck(ptr, *it) ) ||
type == OT_Assault)
// Was the crime seen?
if ( MWBase::Environment::get().getWorld()->getLOS(ptr, *it) && awarenessCheck(ptr, *it) )
{
// Say something!
// TODO: Add more messages
@ -862,16 +861,10 @@ namespace MWMechanics
// Will the witness be affected by the crime?
CreatureStats& creatureStats1 = MWWorld::Class::get(*it1).getCreatureStats(*it1);
if (creatureStats1.getAiSetting(CreatureStats::AI_Alarm).getBase() >= alarm)
{
creatureStats1.setAlarmed(true);
creatureStats1.setCrimeId(player.getWitnessTotal());
player.addWitness();
}
}
break; // Someone saw the crime and everyone has been told
}
else if (type == OT_Assault)
creatureStats.setAlarmed(true);
}
}
if (reported)

@ -30,7 +30,6 @@ namespace MWWorld
mAutoMove(false),
mForwardBackward(0),
mTeleported(false),
mWitnessTotal(0),
mMarkedCell(NULL)
{
mPlayer.mBase = player;
@ -66,16 +65,6 @@ namespace MWWorld
return mSign;
}
void Player::addWitness()
{
mWitnessTotal++;
}
int Player::getWitnessTotal() const
{
return mWitnessTotal;
}
void Player::setDrawState (MWMechanics::DrawState_ state)
{
MWWorld::Ptr ptr = getPlayer();

@ -41,8 +41,6 @@ namespace MWWorld
bool mAutoMove;
int mForwardBackward;
bool mTeleported;
int mWitnessTotal;
public:
@ -67,10 +65,6 @@ namespace MWWorld
void setBirthSign(const std::string &sign);
void addWitness();
int getWitnessTotal() const;
const std::string &getBirthSign() const;
void setDrawState (MWMechanics::DrawState_ state);

Loading…
Cancel
Save