예제 #1
0
파일: Character.cs 프로젝트: avidvid/OUP
 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;
 }
예제 #2
0
 public void Set(Statistic s, StatisticHolder origin, CarryType t)
 {
     statistic = s;
     type = t;
     originalStat = origin;
     originalStat.AddSavable(this);
     GameState.IsCarrying = true;
 }
예제 #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);
     }
 }
예제 #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);
        }
예제 #5
0
 public void Parse(byte[] data)
 {
     TimeStamp = BitConverter.ToUInt16(data, 0);
     Position  = (CarryType)data[2];
 }
예제 #6
0
 protected virtual void Awake()
 {
     objectRigidbody = GetComponent <Rigidbody>();
     type            = CarryType.Null;
 }
예제 #7
0
        public void Carry(CarryType type)
        {
            int idx = (int)type;

            amongLastCarryTimes[idx] = DateTime.Now;
        }