Esempio n. 1
0
 public Character(Character character, bool enable = true)
 {
     Id                   = character.Id;
     Name                 = character.Name;
     Description          = character.Description;
     IconPath             = character.IconPath;
     IconId               = character.IconId;
     IsAnimated           = character.IsAnimated;
     HasFightMode         = character.HasFightMode;
     Move                 = character.Move;
     AttackR              = character.AttackR;
     DefenseR             = character.DefenseR;
     AttackT              = character.AttackT;
     DefenseT             = character.DefenseT;
     BasicAttack          = character.BasicAttack;
     BasicDefense         = character.BasicDefense;
     Speed                = character.Speed;
     Body                 = character.Body;
     Carry                = character.Carry;
     View                 = character.View;
     Rarity               = character.Rarity;
     DropItems            = character.DropItems;
     DropChance           = character.DropChance;
     FavoriteTerrainTypes = character.FavoriteTerrainTypes;
     IsEnable             = enable;
 }
Esempio n. 2
0
 public void Set(Statistic s, StatisticHolder origin, CarryType t)
 {
     statistic = s;
     type = t;
     originalStat = origin;
     originalStat.AddSavable(this);
     GameState.IsCarrying = true;
 }
Esempio n. 3
0
     public object Validate(CarryType type)
     {
         if (!ReCaptcha.Validate())
         {
             int wait_seconds = CanCarry(type);
             if (wait_seconds > 0)
             {
                 return new { captcha_or_wait_seconds = wait_seconds }
             }
             ;
         }
         Carry(type);
         return(null);
     }
 }
Esempio n. 4
0
        public int /*need to wait seconds*/ CanCarry(CarryType type)
        {
            int idx = (int)type;

            DateTime lct = amongLastCarryTimes[idx];
            int      ci  = amongCarryIntervals[idx];

            if (lct == DateTime.MinValue)
            {
                return(0);
            }

            int elapsed = (int)Math.Truncate((DateTime.Now - lct).TotalSeconds);

            if (elapsed >= ci)                          // = for 0 second interval to work.
            {
                return(0);
            }
            return(ci - elapsed);
        }
Esempio n. 5
0
 public void Parse(byte[] data)
 {
     TimeStamp = BitConverter.ToUInt16(data, 0);
     Position  = (CarryType)data[2];
 }
 protected virtual void Awake()
 {
     objectRigidbody = GetComponent <Rigidbody>();
     type            = CarryType.Null;
 }
Esempio n. 7
0
        public void Carry(CarryType type)
        {
            int idx = (int)type;

            amongLastCarryTimes[idx] = DateTime.Now;
        }