Exemple #1
0
        public void IncreaseLevel(CPos cell, int level, int max_level)
        {
            // Initialize, on fresh impact.
            if (!tiles.ContainsKey(cell))
            {
                tiles[cell] = new Radioactivity();
            }

            var ra        = tiles[cell];
            var new_level = level + ra.level;

            if (new_level > max_level)
            {
                new_level = max_level;
            }

            if (ra.level > new_level)
            {
                return;                 // the given weapon can't make the cell more radio active. (saturate)
            }
            // apply new level.
            ra.level = new_level;

            ra.ticks = info.UpdateDelay;
            //ra.ticks = info.Halflife;

            dirty.Add(cell);
        }
Exemple #2
0
        public Radioactivity Clone()
        {
            Radioactivity result = new Radioactivity();

            result.ticks = ticks;
            result.level = level;
            return(result);
        }