コード例 #1
0
        public StarDuckHandler(Duck stunTarget, int stunTime = 10, bool fixH = false, bool fixV = false, bool showDaze = false)
        {
            _stunTarget = stunTarget;
            _stunTime   = stunTime;
            _fixH       = fixH;
            _fixV       = fixV;
            _showDaze   = showDaze;
            foreach (Thing t in Level.current.things)
            {
                if (t is StarDuckHandler && t != this && ((StarDuckHandler)t)._stunTarget == stunTarget && !((StarDuckHandler)t)._overrider)
                {
                    if (showDaze)
                    {
                        ((StarDuckHandler)t)._showDaze = true;
                    }
                    if (stunTime > ((StarDuckHandler)t)._stunTime)
                    {
                        ((StarDuckHandler)t)._stunTime = stunTime;
                    }
                    _overrider = true;
                }
            }

            mover = new SinWave(1f / 15f);
            ipos  = _stunTarget.position;
            _stunTarget.GoRagdoll();
        }