コード例 #1
0
 public BlasterProjectile(BlasterProjectile copy)
     : base(copy)
 {
 }
コード例 #2
0
 //public override int CalculateApproxStatsMaxNEnemies
 //{
 //    get
 //    {
 //        return ((BlastProjectile)Projectile).NumberOfPenetratableUnits + 1;
 //    }
 //}
 //public override AbilityStats CalculateApproxStats(int rageLevel)
 //{
 //    var nEnemies = CalculateApproxStatsMaxNEnemies;
 //    float damage = 0;
 //    float time = 0;
 //    int nAttacks = 0;
 //    var p = new BlasterProjectile();
 //    var bh = (SingleTargetDamage)p.UnitHitAction;
 //    for (int i = 0; i < 1000; i++)
 //    {
 //        float d = (1 + p.NumberOfPenetratableUnits) * bh.Damage;
 //        nAttacks++;
 //        damage += d;
 //        time += Math.Max(Cooldown + InitDelay, TotalDuration);
 //    }
 //    return new AbilityStats
 //    {
 //        DPS = damage / time,
 //        AttacksPerSecond = nAttacks / time,
 //        AvgDamagePerHit = (damage / (float)nEnemies) / (float)nAttacks
 //    };
 //}
 protected override void StartEffectivePerform()
 {
     base.StartEffectivePerform();
     var velocity =
         Vector3.Normalize(TargetPosition - Performer.Translation) * 15 +
         Vector3.UnitZ * 20;
     var proj = new BlasterProjectile
     {
         MainGraphic = new MetaModel
         {
             XMesh = new MeshFromFile("Models/Props/BlasterProjectile1.x"),
             Texture = new TextureFromFile("Models/Props/BlasterProjectile1.png"),
             SpecularTexture = new TextureFromFile("Models/Props/CannonballSpecular1.png"),
             World = Matrix.Scaling(0.06f, 0.06f, 0.063f) * SkinnedMesh.InitSkinnedMeshFromMaya,
             Visible = Priority.High,
             CastShadows = global::Graphics.Content.Priority.Low,
             ReceivesShadows = Priority.High,
             ReceivesSpecular = Priority.High,
         },
         TimeToLive = 9999,
     };
     var or = Matrix.RotationZ(Performer.LookatDir);
     proj.Translation = Performer.Translation + Vector3.TransformCoordinate(proj.Translation, or) + Vector3.UnitZ;
     proj.Velocity = velocity;
     proj.Acceleration = -Vector3.UnitZ*100;
     proj.Scale = new Vector3(3, 3, 3);
     proj.Rotation =
             Quaternion.RotationMatrix(Matrix.RotationZ(
             (float)(Common.Math.AngleFromVector3XY(velocity))));
     proj.Performer = Performer;
     Game.Instance.Scene.Add(proj);
 }