コード例 #1
0
        public void onDeath(IHarmfulEntity source)
        {
            //throw new NotImplementedException();
            invincibilitytime *= 3f;

            if (Game.player == this)
            {
                //if (Game.timeRemaining > 0)
                if (Game.timeRemaining >= Game.baseLifeCost)
                {
                    Position.CopyFrom(SpawnLocation);
                    HP = maxHP;
                    Game.timeRemaining -= Game.baseLifeCost;
                    //Game.timeRemaining *= 0.85f;
                    //Game.timeRemaining *= 0.6667f;
                    Game.camera.instawarp = true;
                    Game.skiprender       = true;
                }
                else
                {
                    Game.DoGameOver();
                }
            }
            else
            {
                Position.CopyFrom(SpawnLocation);
                HP = maxHP;
            }
        }
コード例 #2
0
 public void onDamaged(IHarmfulEntity source, float amount)
 {
     //throw new NotImplementedException();
     if (invincibilitytime <= 0)
     {
         //HP -= (amount / defensepower);
         HP -= Game.calcdamage(amount, defensepower);
         invincibilitytime = 50 * invincibilitymod;
     }
 }
コード例 #3
0
        public void onDamaged(IHarmfulEntity source, float amount)
        {
            //throw new NotImplementedException();
            //if (!(source is MRGhosty))
            {
                //HP -= (amount / defensepower);
                HP -= Game.calcdamage(amount, defensepower);
            }

            /*else
             * {
             *  Helper.Log("ghosts are allergic to themselves???");
             * }*/
        }
コード例 #4
0
        public void onDeath(IHarmfulEntity source)
        {
            //throw new NotImplementedException();
            Alive = false;
            CollectableItem P = new PointItem(Game);

            P.Position.CopyFrom(Position);
            P.collectionDelay /= 2;
            Game.AddEntity(P);
            if (Math.Random() < 0.15)
            {
                P = new HealingItem(Game);
                P.Position.CopyFrom(Position);
                P.Vspeed           = -2;
                P.collectionDelay /= 2;
                this.Game.AddEntity(P);
            }
        }
コード例 #5
0
 public void onDeath(IHarmfulEntity source)
 {
     //throw new NotImplementedException();
 }
コード例 #6
0
 public void onDamaged(IHarmfulEntity source, float amount)
 {
     //throw new NotImplementedException();
 }