Exemple #1
0
        public ITPO_SPEED_TIMER(NPCProto proto)
            : base(3000000000)
        {
            npc = proto;

            OnTick += new Events.TimerEvent(endTimer);
        }
        public ShrinkTimer(NPCProto proto)
            : base(10000 * 500)
        {
            npcToShrink = proto;
            initalScale = npcToShrink.Scale;
            OnTick     += new Events.TimerEvent(tick);

            Start();
        }
 protected void tick()
 {
     if (npcToShrink.Scale.Y > 0.7f)
     {
         npcToShrink.setScale(new Vec3f(0.699f, 0.699f, 0.699f));
     }
     else if (npcToShrink.Scale.Y > 0.5f)
     {
         npcToShrink.setScale(new Vec3f(0.499f, 0.499f, 0.499f));
     }
     else if (npcToShrink.Scale.Y > 0.3f)
     {
         npcToShrink.setScale(new Vec3f(0.299f, 0.299f, 0.299f));
     }
     else
     {
         OnTick -= new Events.TimerEvent(tick);
         OnTick += new Events.TimerEvent(tickUnShrink);
         this.End();
         this.TimeSpan = 10000 * 1000 * 25;
         this.Start();
     }
 }