mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-21 05:14:10 +00:00
Removed witnesses and minor changes
This commit is contained in:
parent
0c957a3cde
commit
70919ba60a
6 changed files with 16 additions and 64 deletions
|
@ -739,11 +739,12 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
creatureStats.getAiSequence().stack(AiCombat(player));
|
creatureStats.getAiSequence().stack(AiCombat(player));
|
||||||
creatureStats.setHostile(true);
|
creatureStats.setHostile(true);
|
||||||
|
creatureStats.setAlarmed(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if I was a witness to a crime
|
// if I was a witness to a crime
|
||||||
if (creatureStats.getCrimeId() != -1)
|
if (creatureStats.isAlarmed())
|
||||||
{
|
{
|
||||||
if(player.getClass().getNpcStats(player).getBounty() == 0)
|
if(player.getClass().getNpcStats(player).getBounty() == 0)
|
||||||
{
|
{
|
||||||
|
@ -752,18 +753,22 @@ namespace MWMechanics
|
||||||
if (ptr.getClass().isClass(ptr, "Guard"))
|
if (ptr.getClass().isClass(ptr, "Guard"))
|
||||||
creatureStats.getAiSequence().stopPersue();
|
creatureStats.getAiSequence().stopPersue();
|
||||||
creatureStats.getAiSequence().stopCombat();
|
creatureStats.getAiSequence().stopCombat();
|
||||||
creatureStats.setCrimeId(-1);
|
|
||||||
}
|
}
|
||||||
else if (creatureStats.isAlarmed())
|
|
||||||
{
|
|
||||||
if (ptr.getClass().isClass(ptr, "Guard") && !creatureStats.isHostile())
|
|
||||||
creatureStats.getAiSequence().stack(AiPersue(player.getClass().getId(player)));
|
|
||||||
else if (!creatureStats.isHostile())
|
else if (!creatureStats.isHostile())
|
||||||
{
|
{
|
||||||
|
if (ptr.getClass().isClass(ptr, "Guard"))
|
||||||
|
creatureStats.getAiSequence().stack(AiPersue(player.getClass().getId(player)));
|
||||||
|
else
|
||||||
creatureStats.getAiSequence().stack(AiCombat(player));
|
creatureStats.getAiSequence().stack(AiCombat(player));
|
||||||
creatureStats.setHostile(true);
|
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()
|
CreatureStats::CreatureStats()
|
||||||
: mLevel (0), mDead (false), mDied (false), mFriendlyHits (0),
|
: mLevel (0), mDead (false), mDied (false), mFriendlyHits (0),
|
||||||
mTalkedTo (false), mAlarmed (false),
|
mTalkedTo (false), mAlarmed (false),
|
||||||
mAttacked (false), mHostile (false), mAssaulted(false),
|
mAttacked (false), mHostile (false),
|
||||||
mAttackingOrSpell(false), mCrimeId(-1),
|
mAttackingOrSpell(false),
|
||||||
mIsWerewolf(false),
|
mIsWerewolf(false),
|
||||||
mFallHeight(0), mRecalcDynamicStats(false), mKnockdown(false), mHitRecovery(false), mBlock(false),
|
mFallHeight(0), mRecalcDynamicStats(false), mKnockdown(false), mHitRecovery(false), mBlock(false),
|
||||||
mMovementFlags(0), mDrawState (DrawState_Nothing), mAttackStrength(0.f)
|
mMovementFlags(0), mDrawState (DrawState_Nothing), mAttackStrength(0.f)
|
||||||
|
@ -316,26 +316,6 @@ namespace MWMechanics
|
||||||
mHostile = hostile;
|
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
|
bool CreatureStats::getCreatureTargetted() const
|
||||||
{
|
{
|
||||||
std::string target;
|
std::string target;
|
||||||
|
|
|
@ -40,7 +40,6 @@ namespace MWMechanics
|
||||||
bool mAttacked;
|
bool mAttacked;
|
||||||
bool mHostile;
|
bool mHostile;
|
||||||
bool mAssaulted;
|
bool mAssaulted;
|
||||||
int mCrimeId;
|
|
||||||
bool mAttackingOrSpell;
|
bool mAttackingOrSpell;
|
||||||
bool mKnockdown;
|
bool mKnockdown;
|
||||||
bool mHitRecovery;
|
bool mHitRecovery;
|
||||||
|
@ -188,14 +187,6 @@ namespace MWMechanics
|
||||||
|
|
||||||
void setHostile (bool hostile);
|
void setHostile (bool hostile);
|
||||||
|
|
||||||
bool isAssaulted() const;
|
|
||||||
|
|
||||||
void setAssaulted (bool assaulted);
|
|
||||||
|
|
||||||
int getCrimeId() const;
|
|
||||||
|
|
||||||
void setCrimeId (int id);
|
|
||||||
|
|
||||||
bool getCreatureTargetted() const;
|
bool getCreatureTargetted() const;
|
||||||
|
|
||||||
float getEvasion() const;
|
float getEvasion() const;
|
||||||
|
|
|
@ -839,9 +839,8 @@ namespace MWMechanics
|
||||||
|
|
||||||
CreatureStats& creatureStats = MWWorld::Class::get(*it).getCreatureStats(*it);
|
CreatureStats& creatureStats = MWWorld::Class::get(*it).getCreatureStats(*it);
|
||||||
|
|
||||||
// Was the crime seen or the victim assulted?
|
// Was the crime seen?
|
||||||
if ( ( MWBase::Environment::get().getWorld()->getLOS(ptr, *it) && awarenessCheck(ptr, *it) ) ||
|
if ( MWBase::Environment::get().getWorld()->getLOS(ptr, *it) && awarenessCheck(ptr, *it) )
|
||||||
type == OT_Assault)
|
|
||||||
{
|
{
|
||||||
// Say something!
|
// Say something!
|
||||||
// TODO: Add more messages
|
// TODO: Add more messages
|
||||||
|
@ -862,16 +861,10 @@ namespace MWMechanics
|
||||||
// Will the witness be affected by the crime?
|
// Will the witness be affected by the crime?
|
||||||
CreatureStats& creatureStats1 = MWWorld::Class::get(*it1).getCreatureStats(*it1);
|
CreatureStats& creatureStats1 = MWWorld::Class::get(*it1).getCreatureStats(*it1);
|
||||||
if (creatureStats1.getAiSetting(CreatureStats::AI_Alarm).getBase() >= alarm)
|
if (creatureStats1.getAiSetting(CreatureStats::AI_Alarm).getBase() >= alarm)
|
||||||
{
|
|
||||||
creatureStats1.setAlarmed(true);
|
creatureStats1.setAlarmed(true);
|
||||||
creatureStats1.setCrimeId(player.getWitnessTotal());
|
|
||||||
player.addWitness();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break; // Someone saw the crime and everyone has been told
|
break; // Someone saw the crime and everyone has been told
|
||||||
}
|
}
|
||||||
else if (type == OT_Assault)
|
|
||||||
creatureStats.setAlarmed(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (reported)
|
if (reported)
|
||||||
|
|
|
@ -30,7 +30,6 @@ namespace MWWorld
|
||||||
mAutoMove(false),
|
mAutoMove(false),
|
||||||
mForwardBackward(0),
|
mForwardBackward(0),
|
||||||
mTeleported(false),
|
mTeleported(false),
|
||||||
mWitnessTotal(0),
|
|
||||||
mMarkedCell(NULL)
|
mMarkedCell(NULL)
|
||||||
{
|
{
|
||||||
mPlayer.mBase = player;
|
mPlayer.mBase = player;
|
||||||
|
@ -66,16 +65,6 @@ namespace MWWorld
|
||||||
return mSign;
|
return mSign;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::addWitness()
|
|
||||||
{
|
|
||||||
mWitnessTotal++;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Player::getWitnessTotal() const
|
|
||||||
{
|
|
||||||
return mWitnessTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Player::setDrawState (MWMechanics::DrawState_ state)
|
void Player::setDrawState (MWMechanics::DrawState_ state)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
|
|
|
@ -42,8 +42,6 @@ namespace MWWorld
|
||||||
int mForwardBackward;
|
int mForwardBackward;
|
||||||
bool mTeleported;
|
bool mTeleported;
|
||||||
|
|
||||||
int mWitnessTotal;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Player(const ESM::NPC *player, const MWBase::World& world);
|
Player(const ESM::NPC *player, const MWBase::World& world);
|
||||||
|
@ -67,10 +65,6 @@ namespace MWWorld
|
||||||
|
|
||||||
void setBirthSign(const std::string &sign);
|
void setBirthSign(const std::string &sign);
|
||||||
|
|
||||||
void addWitness();
|
|
||||||
|
|
||||||
int getWitnessTotal() const;
|
|
||||||
|
|
||||||
const std::string &getBirthSign() const;
|
const std::string &getBirthSign() const;
|
||||||
|
|
||||||
void setDrawState (MWMechanics::DrawState_ state);
|
void setDrawState (MWMechanics::DrawState_ state);
|
||||||
|
|
Loading…
Reference in a new issue