Batman? wrote
Does your relationship with cleptia have an effect of the whip of thievery?
Yes, and it increases your relationship with her every time you receive that unique hit message.
truth whipofthievery::CleptiaHelps(ccharacter* Enemy, ccharacter* Hitter) const
{
if(Enemy->IsImmuneToWhipOfThievery() || !Enemy->GetMainWielded() || GetMainMaterial()->GetFlexibility() <= 5)
return false;
if(Hitter->IsPlayer())
{
if(game::GetGod(CLEPTIA)->GetRelation() < 0)
return false; //if your relationship with Cleptia is below 0, you cannot steal with the whip at all
else
return !RAND_N(10 - game::GetGod(CLEPTIA)->GetRelation() / 200);
}
else
return !RAND_N(10);
}
The above code for some very bizarre reason generates a random number between 0 and the result of the following:
Quote
10 - [your relation to Cleptia] / 200
If that number ends up being 0, the check passes. Otherwise it fails.
(e.g. if your relationship value with Cleptia is 2000 you'll have guaranteed success every time because it generates a number between 0 and 0, but 1900 is a 50% chance per hit because it generates a number between 0 and 1.
However the relationship caps out at 1000, so you'll only ever have a maximum of a 17% chance.)
In fact there's a lot of code in IVAN which specifically looks to produce a negative number and then inverts it to see if it's 1 or 0 and I have no idea why. It seems like a very roundabout way to do checks/rolls.
The part of the hit code where it checks if Cleptia helps and increases the relationship is:
truth whipofthievery::HitEffect(character* Enemy, character* Hitter, v2 HitPos,
int BodyPartIndex, int Direction, truth BlockedByArmour)
{
truth BaseSuccess = meleeweapon::HitEffect(Enemy, Hitter, HitPos, BodyPartIndex, Direction, BlockedByArmour);
if(!IsBroken() && Enemy->IsEnabled() && Hitter && [b]CleptiaHelps(Enemy, Hitter)[/b])
//the above checks whether the whip is broken, whether the enemy is immune to stealing, whether there's a person swinging the whip, and lastly whether Cleptia's relationship with the player is strong enough to deploy the steal action
{
if(Hitter->IsPlayer())
{
game::DoEvilDeed(10); //make player more chaotic
game::GetGod(CLEPTIA)->AdjustRelation(10); //increase relationship with Cleptia
}
Enemy->GetMainWielded()->MoveTo(GetLSquareUnder()->GetStack()); // this is the part where it steals the weapon
return true;
}
else
return BaseSuccess;
}
Interestingly the code in there also says that an inflexible whip of thievery cannot steal items (flexibility must be at least 5, which is the flexibility of flesh and the most inflexible cloth materials)