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; }
public void Set(Statistic s, StatisticHolder origin, CarryType t) { statistic = s; type = t; originalStat = origin; originalStat.AddSavable(this); GameState.IsCarrying = true; }
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); } }
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); }
public void Parse(byte[] data) { TimeStamp = BitConverter.ToUInt16(data, 0); Position = (CarryType)data[2]; }
protected virtual void Awake() { objectRigidbody = GetComponent <Rigidbody>(); type = CarryType.Null; }
public void Carry(CarryType type) { int idx = (int)type; amongLastCarryTimes[idx] = DateTime.Now; }