ÄÚµå : |
public const int OverloadAllowance = 4; // We can be four stones overweight without getting fatigued
public static int GetMaxWeight( Mobile m )
{
return 40 + (int)(3.5 * m.Str); //str = 100À϶§ 390
}
public static void EventSink_Movement( MovementEventArgs e )
{
Mobile from = e.Mobile;
if ( !from.Player || !from.Alive || from.AccessLevel >= AccessLevel.GameMaster )
return;
int maxWeight = GetMaxWeight( from ) + OverloadAllowance; //390 + 4 = 394 (maxWeight)
int overWeight = (Mobile.BodyWeight + from.TotalWeight) - maxWeight; //Mobile.BodyWeight = 17
// ¸¸¾à TotalWeight°¡ 390À̶ó¸é 17 + 390 - 394, overWeight = 13
if ( overWeight > 0 )
{
from.Stam -= GetStamLoss( from, overWeight, (e.Direction & Direction.Running) != 0 );
if ( from.Stam == 0 )
{
from.SendLocalizedMessage( 500109 ); // You are too fatigued to move, because you are carrying too much weight!
e.Blocked = true;
return;
}
}
if ( from is PlayerMobile )
{
int amt = ( from.Mounted ? 48 : 16 );
PlayerMobile pm = (PlayerMobile)from;
if ( (++pm.StepsTaken % amt) == 0 )
--from.Stam;
}
}
|