示例#1
0
 public static RingAttack Instance(int count, float radius = 0, float offset = 0, int projectileIndex = 0)
 {
     var key = new Tuple<int, float, float, int>(count, radius, offset, projectileIndex);
     RingAttack ret;
     if (!instances.TryGetValue(key, out ret))
         ret = instances[key] = new RingAttack(count, radius, offset, projectileIndex);
     return ret;
 }
示例#2
0
        public static RingAttack Instance(int count, float radius = 0, float offset = 0, int projectileIndex = 0)
        {
            var        key = new Tuple <int, float, float, int>(count, radius, offset, projectileIndex);
            RingAttack ret;

            if (!instances.TryGetValue(key, out ret))
            {
                ret = instances[key] = new RingAttack(count, radius, offset, projectileIndex);
            }
            return(ret);
        }
示例#3
0
        protected override bool TickCore(RealmTime time)
        {
            Behavior behav = RingAttack.Instance(arms, 0, (offsetIncrement * (float)Math.PI / 180) * incrementMultiplier,
                                                 projectileIndex);

            int    remainingTick;
            object o;

            if (!Host.StateStorage.TryGetValue(Key, out o))
            {
                remainingTick = rand.Next(0, cooldown);
            }
            else
            {
                remainingTick = (int)o;
            }

            remainingTick -= time.thisTickTimes;
            bool ret;

            if (remainingTick <= 0)
            {
                if (behav != null)
                {
                    behav.Tick(Host, time);
                }
                if (behav != null)
                {
                    incrementMultiplier += 1;
                }
                remainingTick = rand.Next((int)(cooldown * 0.95), (int)(cooldown * 1.05));
                ret           = true;
            }
            else
            {
                ret = false;
            }
            Host.StateStorage[Key] = remainingTick;
            return(ret);
        }