Beispiel #1
0
 public CMove(CThucHanh pThucHanh, string pName, CActObj pObj, int start, int pduration, List <Vector3> ptargets, bool pstophide, float pdstopangleZ, int pisound, bool loop) : base(pThucHanh)
 {
     this.Name           = pName;
     this.Obj            = pObj;
     this.StartTickCount = start;
     this.duration       = pduration;
     this.StopTickCount  = this.StartTickCount + this.duration;
     this.stophide       = pstophide;
     this.stopangleZ     = Geometry.DegreeToRadian(pdstopangleZ);
     this.targets        = new List <CTarget>();
     foreach (Vector3 current in ptargets)
     {
         CTarget cTarget = new CTarget();
         cTarget.Position = current;
         if (cTarget.Position.Z == 0f)
         {
             cTarget.Position.Z = this.myThucHanh.myTerrain.getZ(current.X, current.Y);
         }
         this.targets.Add(cTarget);
     }
     this.targetsCount = this.targets.Count;
     this.SetTickCount();
     this.itarget   = 0;
     this.done      = false;
     this.isound    = pisound;
     this.soundloop = loop;
 }
 public CBombard(CThucHanh pThucHanh, string pName, string texfile, float pWidth, float pHeight, int start, int pduration, float pspeed, float pdAngle, CActObj pFromObj, Vector3 pTo, int pisound, bool loop)
     : base(pThucHanh)
 {
     try
     {
         this.Name      = pName;
         this.fromObj   = pFromObj;
         this.SpriteObj = this.myThucHanh.Add1SpriteObj(texfile, pWidth, pHeight, 0, this.fromObj.Position, 0f);
         this.topos     = pTo;
         if (this.topos.Z == 0f)
         {
             this.topos.Z = this.myThucHanh.myTerrain.getZ(this.topos.X, this.topos.Y);
         }
         this.StartTickCount = start;
         this.duration       = pduration;
         this.speed          = pspeed;
         this.interval       = (int)(this.speed * 1000f);
         this.dAngle         = pdAngle;
         this.rAngle         = Geometry.DegreeToRadian(this.dAngle);
         this.StopTickCount  = this.StartTickCount + this.duration;
         this.isound         = pisound;
         this.soundloop      = loop;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public CHide(CThucHanh pThucHanh, string pName, CActObj pObj, int start, int pduration, int pisound, bool loop) : base(pThucHanh)
 {
     this.Name           = pName;
     this.Obj            = pObj;
     this.StartTickCount = start;
     this.duration       = pduration;
     this.StopTickCount  = this.StartTickCount + this.duration;
     this.isound         = pisound;
     this.soundloop      = loop;
 }
Beispiel #4
0
 public CBlink(CThucHanh pThucHanh, string pName, CActObj pObj, int start, int pduration, float pspeed, int pisound, bool loop)
     : base(pThucHanh)
 {
     this.Name           = pName;
     this.Obj            = pObj;
     this.StartTickCount = start;
     this.duration       = pduration;
     this.speed          = pspeed;
     if (this.speed < 1f)
     {
         this.speed = 1f;
     }
     this.StopTickCount = this.StartTickCount + this.duration;
     this.interval      = (int)(1000f / this.speed);
     this.isound        = pisound;
     this.soundloop     = loop;
 }
Beispiel #5
0
        public CActObj GetActObjByName(string name)
        {
            CActObj cActObj = null;

            if (this.Models.Count > 0)
            {
                for (int i = 0; i < this.Models.Count; i++)
                {
                    if (this.Models[i].Name.Length == name.Length && this.Models[i].Name.ToUpper() == name.ToUpper())
                    {
                        cActObj         = this.Models[i];
                        cActObj.ObjType = "Model";
                        break;
                    }
                }
            }
            if (cActObj == null && this.texObjs.Count > 0)
            {
                for (int j = 0; j < this.texObjs.Count; j++)
                {
                    if (this.texObjs[j].Name.Length == name.Length && this.texObjs[j].Name.ToUpper() == name.ToUpper())
                    {
                        cActObj         = this.texObjs[j];
                        cActObj.ObjType = "TexObj";
                        break;
                    }
                }
            }
            if (cActObj == null && this.Billboards.Count > 0)
            {
                for (int k = 0; k < this.Billboards.Count; k++)
                {
                    if (this.Billboards[k].Name.Length == name.Length && this.Billboards[k].Name.ToUpper() == name.ToUpper())
                    {
                        cActObj         = this.Billboards[k];
                        cActObj.ObjType = "Billboard";
                        break;
                    }
                }
            }
            return(cActObj);
        }
 public CShootFrom(CThucHanh pThucHanh, string pName, string texfile, float pWidth, float pHeight, int start, int pduration, float pspeed, CActObj pFromObj, Vector3 pTo, int pisound, bool loop) : base(pThucHanh)
 {
     this.Name      = pName;
     this.fromObj   = pFromObj;
     this.SpriteObj = this.myThucHanh.Add1SpriteObj(texfile, pWidth, pHeight, 0, this.fromObj.Position, 0f);
     this.topos     = pTo;
     if (pTo.Z == 0f)
     {
         this.topos.Z = this.myThucHanh.myTerrain.getZ(this.topos.X, this.topos.Y) - 0.2f;
     }
     this.StartTickCount = start;
     this.duration       = pduration;
     this.speed          = pspeed;
     this.tickcount      = (int)(this.speed * 1000f);
     this.StopTickCount  = this.StartTickCount + this.duration;
     this.from2          = new CTarget();
     this.to2            = new CTarget();
     this.isound         = pisound;
     this.soundloop      = loop;
 }
 public CShootO2P(CThucHanh pThucHanh, string pName, string texfile, float pWidth, float pHeight, int start, int pduration, float pspeed, CActObj pFromObj, Vector3 pTo, int pisound, bool loop) : base(pThucHanh, pName, texfile, pWidth, pHeight, start, pduration, pspeed, pFromObj, pTo, pisound, loop)
 {
     this.interval = (int)(this.speed * 1000f);
 }
Beispiel #8
0
 public CExplodeObj(CThucHanh pThucHanh, string pName, string texfile, float pWidth, float pHeight, float pShiftZ, int start, int pduration, float pspeed, CActObj pexplObj, int pisound, bool loop) : base(pThucHanh)
 {
     this.explObj = pexplObj;
     this.explPos = this.explObj.Position;
     this.CreatExplode(pName, texfile, pWidth, pHeight, pShiftZ, start, pduration, pspeed, pisound, loop);
 }
 public CExplodeMObj(CThucHanh pThucHanh, string pName, string texfile, float pWidth, float pHeight, float pShiftZ, int start, int pduration, float pspeed, CActObj pexplObj, int pisound, bool loop) : base(pThucHanh, pName, texfile, pWidth, pHeight, pShiftZ, start, pduration, pspeed, pexplObj, pisound, loop)
 {
 }
 public CBombardO2P(CThucHanh pThucHanh, string pName, string texfile, float pWidth, float pHeight, int start, int pduration, float pspeed, float pdAngle, CActObj pFromObj, Vector3 pTo, int pisound, bool loop) : base(pThucHanh, pName, texfile, pWidth, pHeight, start, pduration, pspeed, pdAngle, pFromObj, pTo, pisound, loop)
 {
 }
Beispiel #11
0
 public CFly(CThucHanh pThucHanh, string pName, CActObj pObj, int start, int pduration, List <Vector3> ptargets, bool pstophide, int pisound, bool loop) : base(pThucHanh, pName, pObj, start, pduration, ptargets, pstophide, pisound, loop)
 {
 }