Exemple #1
0
        public ObjBoss CreateBoss(Scene _this, int dataId, Vector2 pos, Vector2 dir, string name = "", int level = -1)
        {
            var npc = new ObjBoss();

            npc.Init(_this.GenerateNextId(), dataId, level);

            if (!string.IsNullOrEmpty(name))
            {
                npc.SetName(name);
            }
            //if (level > 0)
            //{
            //    npc.SetLevel(level);
            //}

            if (!_this.ValidPosition(pos))
            {
                Logger.Warn("Npc postion is invalid. DataId={2},name={0},pos={1},scene={3}", npc.GetName(), pos, dataId,
                            _this.TypeId);
            }

            npc.SetPosition(pos.X, pos.Y);
            npc.SetDirection(dir);
            npc.BornPosition  = pos;
            npc.BornDirection = dir;
            _this.EnterScene(npc);
            return(npc);
        }
Exemple #2
0
        public DamageList CollectDamageList(ObjBoss _this)
        {
            var ret = _this.damageList;

            _this.damageList = new DamageList();
            return(ret);
        }
Exemple #3
0
 private void CreateBoss()
 {
     if (mBoss == null && BossSceneNpcId != -1)
     {
         mBoss     = CreateSceneBoss(BossSceneNpcId);
         BossMaxHp = mBoss.GetAttribute(eAttributeType.HpMax);
         StartGetDamageList();
         this.IsOnlineDamage = true;
     }
 }
Exemple #4
0
 public void OnDamage(ObjBoss _this, ObjCharacter enemy, int damage)
 {
     ObjNPC.GetImpl().OnDamage(_this, enemy, damage);
     enemy = enemy.GetRewardOwner();
     if (enemy.GetObjType() == ObjType.PLAYER)
     {
         var unit = new DamageUnit();
         unit.CharacterId = enemy.ObjId;
         unit.Damage      = damage;
         _this.damageList.Data.Add(unit);
     }
 }
Exemple #5
0
 //构造函数
 public void InitObjBoss(ObjBoss _this)
 {
     _this.mDropOnDie = false;
 }