コード例 #1
0
        public override void Update()
        {
            this.spawnTime = 4f;
            if (this._present != null && this._present.removeFromLevel)
            {
                this._present = (CTFPresent)null;
            }
            CTFPresent ctfPresent1 = (CTFPresent)null;
            CTFPresent ctfPresent2 = (CTFPresent)null;

            foreach (CTFPresent ctfPresent3 in Level.CheckCircleAll <CTFPresent>(this.position, 16f))
            {
                if (ctfPresent3 != this._present)
                {
                    ctfPresent2 = ctfPresent3;
                }
                else
                {
                    ctfPresent1 = ctfPresent3;
                }
            }
            if (ctfPresent2 != null & ctfPresent1 != null)
            {
                if (ctfPresent2.duck != null)
                {
                    ctfPresent2.duck.ThrowItem();
                }
                Level.Remove((Thing)ctfPresent2);
                Level.Add((Thing)SmallSmoke.New(ctfPresent2.x, ctfPresent2.y));
                CTF.CaptureFlag((bool)this.team);
                SFX.Play("equip");
            }
            base.Update();
        }
コード例 #2
0
 public override void SpawnItem()
 {
     if (this._present != null)
     {
         return;
     }
     this._spawnWait      = 0.0f;
     this._present        = new CTFPresent(this.x, this.y, (bool)this.team);
     this._present.x      = this.x;
     this._present.y      = (float)((double)this.top + ((double)this._present.y - (double)this._present.bottom) - 6.0);
     this._present.vSpeed = -2f;
     Level.Add((Thing)this._present);
     if (!this._seated)
     {
         return;
     }
     this.SetHoverItem((Holdable)this._present);
 }